Site Health: Remove unnecessary `function_exists()` checks from `WP_Site_Health::get_tests()`.
By the time the tests run, both `wp_is_site_protected_by_basic_auth()` and `rest_url()` functions are available, so there is no need to check for their existence. Follow-up to [44986], [51057]. Props Clorith, costdev, SergeyBiryukov. Fixes #52642. Built from https://develop.svn.wordpress.org/trunk@51066 git-svn-id: http://core.svn.wordpress.org/trunk@50675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3024b85221
commit
f637014b61
|
@ -2310,6 +2310,11 @@ class WP_Site_Health {
|
|||
'label' => __( 'HTTP Requests' ),
|
||||
'test' => 'http_requests',
|
||||
),
|
||||
'rest_availability' => array(
|
||||
'label' => __( 'REST API availability' ),
|
||||
'test' => 'rest_availability',
|
||||
'skip_cron' => true,
|
||||
),
|
||||
'debug_enabled' => array(
|
||||
'label' => __( 'Debugging enabled' ),
|
||||
'test' => 'is_in_debug_mode',
|
||||
|
@ -2352,7 +2357,6 @@ class WP_Site_Health {
|
|||
);
|
||||
|
||||
// Conditionally include Authorization header test if the site isn't protected by Basic Auth.
|
||||
if ( function_exists( 'wp_is_site_protected_by_basic_auth' ) ) {
|
||||
if ( ! wp_is_site_protected_by_basic_auth() ) {
|
||||
$tests['async']['authorization_header'] = array(
|
||||
'label' => __( 'Authorization header' ),
|
||||
|
@ -2362,16 +2366,6 @@ class WP_Site_Health {
|
|||
'skip_cron' => true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Conditionally include REST rules if the function for it exists.
|
||||
if ( function_exists( 'rest_url' ) ) {
|
||||
$tests['direct']['rest_availability'] = array(
|
||||
'label' => __( 'REST API availability' ),
|
||||
'test' => 'rest_availability',
|
||||
'skip_cron' => true,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or modify which site status tests are run on a site.
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.8-alpha-51065';
|
||||
$wp_version = '5.8-alpha-51066';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue