Make WordPress Core

Changeset 52021

Timestamp:
11/05/2021 09:03:34 PM (3 years ago)
Author:
Clorith
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-debug-data.php

    r51956 r52021  
    235235        }
    236236
    237         // Check WP_LOCAL_DEV.
    238         if ( defined( 'WP_LOCAL_DEV' ) ) {
    239             $wp_local_dev       = WP_LOCAL_DEV ? __( 'Enabled' ) : __( 'Disabled' );
    240             $wp_local_dev_debug = WP_LOCAL_DEV ? 'true' : 'false';
    241         } else {
    242             $wp_local_dev       = __( 'Undefined' );
    243             $wp_local_dev_debug = 'undefined';
     237        // Check WP_ENVIRONMENT_TYPE.
     238        if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) {
     239            $wp_environment_type = WP_ENVIRONMENT_TYPE;
     240        } else {
     241            $wp_environment_type = __( 'Undefined' );
    244242        }
    245243
     
    319317                    'debug' => $compress_css_debug,
    320318                ),
    321                 'WP_LOCAL_DEV'        => array(
    322                     'label' => 'WP_LOCAL_DEV',
    323                     'value' => $wp_local_dev,
    324                     'debug' => $wp_local_dev_debug,
     319                'WP_ => array(
     320                    'label' => 'WP_',
     321                    'value' => $wp_,
     322                    'debug' => $wp_,
    325323                ),
    326324                'DB_CHARSET'          => array(
Note: See TracChangeset for help on using the changeset viewer.