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
This commit is contained in:
Clorith 2021-11-05 21:05:00 +00:00
parent 0531cc11b4
commit 44f50060eb
2 changed files with 9 additions and 11 deletions

View File

@ -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',

View File

@ -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.