From 44f50060eb722c75176ff4a2cf2c4ea1bda77dc0 Mon Sep 17 00:00:00 2001 From: Clorith Date: Fri, 5 Nov 2021 21:05:00 +0000 Subject: [PATCH] Site Health: Add the constant `WP_ENVIRONMENT_TYPE` for debug data. As a legacy from the old Health Check plugin, the constant `WP_LOCAL_DEV` was included in the debug data under the "WordPress Constants" section. This was incorrect, and has never been a constant used by core. Instead, that field is now replaced by `WP_ENVIRONMENT_TYPE`, which was introduced with WordPress 5.5, and is a much more appropriate value to provide in a debug scenario. Props johnbillion, bgoewert, sabbirshouvo. Fixes #54340. Built from https://develop.svn.wordpress.org/trunk@52021 git-svn-id: http://core.svn.wordpress.org/trunk@51613 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-debug-data.php | 18 ++++++++---------- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/wp-admin/includes/class-wp-debug-data.php b/wp-admin/includes/class-wp-debug-data.php index 91c6b837c1..3bc30ea212 100644 --- a/wp-admin/includes/class-wp-debug-data.php +++ b/wp-admin/includes/class-wp-debug-data.php @@ -234,13 +234,11 @@ class WP_Debug_Data { $compress_css_debug = 'undefined'; } - // Check WP_LOCAL_DEV. - if ( defined( 'WP_LOCAL_DEV' ) ) { - $wp_local_dev = WP_LOCAL_DEV ? __( 'Enabled' ) : __( 'Disabled' ); - $wp_local_dev_debug = WP_LOCAL_DEV ? 'true' : 'false'; + // Check WP_ENVIRONMENT_TYPE. + if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) { + $wp_environment_type = WP_ENVIRONMENT_TYPE; } else { - $wp_local_dev = __( 'Undefined' ); - $wp_local_dev_debug = 'undefined'; + $wp_environment_type = __( 'Undefined' ); } $info['wp-constants'] = array( @@ -318,10 +316,10 @@ class WP_Debug_Data { 'value' => $compress_css, 'debug' => $compress_css_debug, ), - 'WP_LOCAL_DEV' => array( - 'label' => 'WP_LOCAL_DEV', - 'value' => $wp_local_dev, - 'debug' => $wp_local_dev_debug, + 'WP_ENVIRONMENT_TYPE' => array( + 'label' => 'WP_ENVIRONMENT_TYPE', + 'value' => $wp_environment_type, + 'debug' => $wp_environment_type, ), 'DB_CHARSET' => array( 'label' => 'DB_CHARSET', diff --git a/wp-includes/version.php b/wp-includes/version.php index 5f964d4324..f1cea921d4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-52020'; +$wp_version = '5.9-alpha-52021'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.