[wp-trac] [WordPress Trac] #58484: Site Health: Improve display of constants in debug data (was: Always use wp_get_environment_type in all sources)

WordPress Trac noreply at wordpress.org
Thu Oct 19 12:21:56 UTC 2023


#58484: Site Health: Improve display of constants in debug data
---------------------------+-----------------------------
 Reporter:  ramon fincken  |       Owner:  SergeyBiryukov
     Type:  defect (bug)   |      Status:  reviewing
 Priority:  normal         |   Milestone:  6.5
Component:  Site Health    |     Version:  6.3
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * status:  new => reviewing
 * component:  Bootstrap/Load => Site Health
 * milestone:  Awaiting Review => 6.5
 * owner:  (none) => SergeyBiryukov


Old description:

> This is a follow up on https://core.trac.wordpress.org/ticket/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.

New description:

 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.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58484#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list