Opened 11 months ago
Last modified 5 weeks ago
#58484 reviewing enhancement
Site Health: Improve display of constants in debug data
Reported by: | ramon fincken | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.6 | Priority: | normal |
Severity: | normal | Version: | 6.3 |
Component: | Site Health | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
This is a follow up on #55741.
where we need to have just a single function to be called which determines the environment type.
As wp-admin/includes/class-wp-debug-data.php is already using:
$environment_type = wp_get_environment_type();
and later on:
this happens
// Check WP_ENVIRONMENT_TYPE. if ( defined( 'WP_ENVIRONMENT_TYPE' ) && WP_ENVIRONMENT_TYPE ) { $wp_environment_type = WP_ENVIRONMENT_TYPE; } else { $wp_environment_type = __( 'Undefined' ); }
so this is not the same as what happens at wp_get_environment_type();
So this ticket is where we remove that lines of code.
Attachments (7)
Change History (18)
This ticket was mentioned in Slack in #core by ramonfincken. View the logs.
11 months ago
#2
@
11 months ago
a small update on this, checked with @SergeyBiryukov
this code is accurate meaning it is shown in the tools -> constants.
I will just show the PHP constant which does not have a need to call wp_get_environment_type()
However ... if you have defined WP_ENVIRONMENT_TYPE and it is empty this code will show "Undefined" while it is actually defined indeed.
This ticket was mentioned in PR #5529 on WordPress/wordpress-develop by @ramon fincken.
7 months ago
#6
Trac ticket: https://core.trac.wordpress.org/ticket/58484
PR to enhance the tools section to show the actual result of defines.
#7
@
7 months ago
- Component changed from Bootstrap/Load to Site Health
- Description modified (diff)
- Milestone changed from Awaiting Review to 6.5
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
- Summary changed from Always use wp_get_environment_type in all sources to Site Health: Improve display of constants in debug data
#8
@
7 months ago
The github PR is the latest. Checked with @ocean90 .
So .. we have the changed code to reflect the actual values.
Also we needed a change for the debug values as you can define an empty string or for instance a NULL/null. Therefore we needed to rewrite the isset to key_exists.
Also some translator instructions were added.
We choose to use multi if instead of match/switch because it is more human readable.
#9
@
3 months ago
@SergeyBiryukov Is this on your radar still for 6.5? Looks like a punt candidate given the lack of activity.
patch.58484.20230608.1.diff