Opened 17 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: | Future Release | Priority: | normal |
Severity: | normal | Version: | 6.3 |
Component: | Site Health | Keywords: | has-patch changes-requested |
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 (27)
This ticket was mentioned in Slack in #core by ramonfincken. View the logs.
17 months ago
#2
@
17 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.
13 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
@
13 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
@
13 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
@
9 months ago
@SergeyBiryukov Is this on your radar still for 6.5? Looks like a punt candidate given the lack of activity.
#10
@
8 months ago
- Milestone changed from 6.5 to 6.6
- Type changed from defect (bug) to enhancement
Looks more like an enhancement to me, so punting.
#12
@
6 months ago
I think this new function should also handle case for WP_DEBUG_LOG and possibly two conditions (for true and false) can be replaced with one is_bool();
Btw, we have 2 weeks until Beta 1 and this is clearly an enhancement.
This ticket was mentioned in Slack in #core by nhrrob. View the logs.
5 months ago
#14
@
5 months ago
We have reviewed this ticket in today's bug scrub.
@SergeyBiryukov do you think it can land in 6.6?
What else is needed to move it forward?
Thank you.
#15
@
5 months ago
- Keywords changes-requested added
- Milestone changed from 6.6 to 6.7
We have 2 days before Beta 1 and no concrete decision, so, I am moving this ticket to the next milestone for further work.
patch.58484.20230608.1.diff