From b8670162a78f5e0ab74d443c4e8391db51819715 Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Wed, 16 Sep 2020 13:44:36 +0200 Subject: [PATCH] Added environment type var to WC tracker. --- includes/class-wc-tracker.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/class-wc-tracker.php b/includes/class-wc-tracker.php index ca197d87bbe..722c9c15428 100644 --- a/includes/class-wc-tracker.php +++ b/includes/class-wc-tracker.php @@ -202,11 +202,19 @@ class WC_Tracker { $memory = max( $memory, $system_memory ); } + // WordPress 5.5+ environment type specification. + // 'production' is the default in WP, thus using it as a default here, too. + $environment_type = 'production'; + if ( function_exists( 'wp_get_environment_type' ) ) { + $environment_type = wp_get_environment_type(); + } + $wp_data['memory_limit'] = size_format( $memory ); $wp_data['debug_mode'] = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? 'Yes' : 'No'; $wp_data['locale'] = get_locale(); $wp_data['version'] = get_bloginfo( 'version' ); $wp_data['multisite'] = is_multisite() ? 'Yes' : 'No'; + $wp_data['env_type'] = $environment_type; return $wp_data; }