Site Health: Correct `wp_version_check()` existence verification by performing a request to the Site Health page instead of Dashboard.

Props Clorith, audrasjb.
Fixes #46616.

git-svn-id: https://develop.svn.wordpress.org/trunk@45049 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-03-28 14:30:12 +00:00
parent c833087131
commit b45b58c6b6
3 changed files with 4 additions and 3 deletions

View File

@ -101,7 +101,7 @@ class WP_Site_Health_Auto_Updates {
array(
'health-check-test-wp_version_check' => true,
),
admin_url()
admin_url( 'site-health.php' )
);
$test = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) );

View File

@ -28,8 +28,6 @@ class WP_Site_Health {
public function __construct() {
$this->prepare_sql_data();
add_action( 'wp_loaded', array( $this, 'check_wp_version_check_exists' ) );
add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );

View File

@ -27,6 +27,9 @@ if ( ! class_exists( 'WP_Site_Health' ) ) {
$health_check_site_status = new WP_Site_Health();
// Start by checking if this is a special request checking for the existence of certain filters.
$health_check_site_status->check_wp_version_check_exists();
require_once( ABSPATH . 'wp-admin/admin-header.php' );
?>