mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Site Health: Rename WP_Site_Health::initialize()
introduced in [47063] to ::get_instance()
, for clarity and consistency with other core classes.
Use `WP_Site_Health::get_instance()` where it's needed, instead of creating multiple instances of the class. Props afercia, xkon, Clorith, SergeyBiryukov. See #47606. Built from https://develop.svn.wordpress.org/trunk@47149 git-svn-id: http://core.svn.wordpress.org/trunk@46949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3cd1514b91
commit
0aff1cf6bd
@ -5122,7 +5122,7 @@ function wp_ajax_health_check_dotorg_communication() {
|
|||||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
||||||
}
|
}
|
||||||
|
|
||||||
$site_health = new WP_Site_Health();
|
$site_health = WP_Site_Health::get_instance();
|
||||||
wp_send_json_success( $site_health->get_test_dotorg_communication() );
|
wp_send_json_success( $site_health->get_test_dotorg_communication() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5142,7 +5142,7 @@ function wp_ajax_health_check_is_in_debug_mode() {
|
|||||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
||||||
}
|
}
|
||||||
|
|
||||||
$site_health = new WP_Site_Health();
|
$site_health = WP_Site_Health::get_instance();
|
||||||
wp_send_json_success( $site_health->get_test_is_in_debug_mode() );
|
wp_send_json_success( $site_health->get_test_is_in_debug_mode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5162,7 +5162,7 @@ function wp_ajax_health_check_background_updates() {
|
|||||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
||||||
}
|
}
|
||||||
|
|
||||||
$site_health = new WP_Site_Health();
|
$site_health = WP_Site_Health::get_instance();
|
||||||
wp_send_json_success( $site_health->get_test_background_updates() );
|
wp_send_json_success( $site_health->get_test_background_updates() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5183,7 +5183,7 @@ function wp_ajax_health_check_loopback_requests() {
|
|||||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
||||||
}
|
}
|
||||||
|
|
||||||
$site_health = new WP_Site_Health();
|
$site_health = WP_Site_Health::get_instance();
|
||||||
wp_send_json_success( $site_health->get_test_loopback_requests() );
|
wp_send_json_success( $site_health->get_test_loopback_requests() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class WP_Site_Health {
|
|||||||
*
|
*
|
||||||
* @return WP_Site_Health|null
|
* @return WP_Site_Health|null
|
||||||
*/
|
*/
|
||||||
public static function initialize() {
|
public static function get_instance() {
|
||||||
if ( null === self::$instance ) {
|
if ( null === self::$instance ) {
|
||||||
self::$instance = new WP_Site_Health();
|
self::$instance = new WP_Site_Health();
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ function wp_dashboard_setup() {
|
|||||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
||||||
}
|
}
|
||||||
|
|
||||||
WP_Site_Health::initialize();
|
WP_Site_Health::get_instance();
|
||||||
|
|
||||||
wp_enqueue_style( 'site-health' );
|
wp_enqueue_style( 'site-health' );
|
||||||
wp_enqueue_script( 'site-health' );
|
wp_enqueue_script( 'site-health' );
|
||||||
|
@ -25,7 +25,7 @@ if ( ! class_exists( 'WP_Site_Health' ) ) {
|
|||||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
||||||
}
|
}
|
||||||
|
|
||||||
$health_check_site_status = new WP_Site_Health();
|
$health_check_site_status = WP_Site_Health::get_instance();
|
||||||
|
|
||||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||||
?>
|
?>
|
||||||
|
@ -27,7 +27,7 @@ if ( ! class_exists( 'WP_Site_Health' ) ) {
|
|||||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
||||||
}
|
}
|
||||||
|
|
||||||
$health_check_site_status = new WP_Site_Health();
|
$health_check_site_status = WP_Site_Health::get_instance();
|
||||||
|
|
||||||
// Start by checking if this is a special request checking for the existence of certain filters.
|
// 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();
|
$health_check_site_status->check_wp_version_check_exists();
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.4-alpha-47148';
|
$wp_version = '5.4-alpha-47149';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
@ -355,7 +355,7 @@ if ( ! is_multisite() ) {
|
|||||||
if ( ! class_exists( 'WP_Site_Health' ) ) {
|
if ( ! class_exists( 'WP_Site_Health' ) ) {
|
||||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
require_once( ABSPATH . 'wp-admin/includes/class-wp-site-health.php' );
|
||||||
}
|
}
|
||||||
WP_Site_Health::initialize();
|
WP_Site_Health::get_instance();
|
||||||
|
|
||||||
// Load active plugins.
|
// Load active plugins.
|
||||||
foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
|
foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user