From 46b25e13023387ec056fe96ade687a878922c45f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 1 Oct 2024 17:59:17 +0000 Subject: [PATCH] Site Health: Adjust display of the `DB_COLLATE` and `WP_ENVIRONMENT_TYPE` constants. Includes: * Simplifying the logic and bringing some consistency to how the values are checked and displayed. * Correcting the debug value for `DB_COLLATE`. This should be the actual contents of the constant, and empty if it is indeed empty, as the debug data that's copied and shared should represent the raw value, and does not need to be in a user-readable format. Follow-up to [45782], [52021], [54239], [59147]. Props Clorith, SergeyBiryukov. See #58265. Built from https://develop.svn.wordpress.org/trunk@59155 git-svn-id: http://core.svn.wordpress.org/trunk@58550 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-debug-data.php | 24 ++++++++++++----------- wp-includes/version.php | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/wp-admin/includes/class-wp-debug-data.php b/wp-admin/includes/class-wp-debug-data.php index 273ab52c51..47e9def7fd 100644 --- a/wp-admin/includes/class-wp-debug-data.php +++ b/wp-admin/includes/class-wp-debug-data.php @@ -1332,19 +1332,21 @@ class WP_Debug_Data { } // Check WP_ENVIRONMENT_TYPE. - if ( defined( 'WP_ENVIRONMENT_TYPE' ) && WP_ENVIRONMENT_TYPE ) { - $wp_environment_type = WP_ENVIRONMENT_TYPE; + if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) { + $wp_environment_type = WP_ENVIRONMENT_TYPE ? WP_ENVIRONMENT_TYPE : __( 'Empty value' ); + $wp_environment_type_debug = WP_ENVIRONMENT_TYPE; } else { - $wp_environment_type = __( 'Undefined' ); + $wp_environment_type = __( 'Undefined' ); + $wp_environment_type_debug = 'undefined'; } // Check DB_COLLATE. - if ( defined( 'DB_COLLATE' ) && DB_COLLATE ) { - $wp_db_collate = DB_COLLATE; - } elseif ( defined( 'DB_COLLATE' ) && empty( DB_COLLATE ) ) { - $wp_db_collate = __( 'Defined, but empty' ); + if ( defined( 'DB_COLLATE' ) ) { + $db_collate = DB_COLLATE ? DB_COLLATE : __( 'Empty value' ); + $db_collate_debug = DB_COLLATE; } else { - $wp_db_collate = __( 'Undefined' ); + $db_collate = __( 'Undefined' ); + $db_collate_debug = 'undefined'; } $fields = array( @@ -1422,7 +1424,7 @@ class WP_Debug_Data { 'WP_ENVIRONMENT_TYPE' => array( 'label' => 'WP_ENVIRONMENT_TYPE', 'value' => $wp_environment_type, - 'debug' => $wp_environment_type, + 'debug' => $wp_environment_type_debug, ), 'WP_DEVELOPMENT_MODE' => array( 'label' => 'WP_DEVELOPMENT_MODE', @@ -1436,8 +1438,8 @@ class WP_Debug_Data { ), 'DB_COLLATE' => array( 'label' => 'DB_COLLATE', - 'value' => $wp_db_collate, - 'debug' => $wp_db_collate, + 'value' => $db_collate, + 'debug' => $db_collate_debug, ), ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 0c80de4f63..0443e4ee9e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-beta1-59154'; +$wp_version = '6.7-beta1-59155'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.