wppaste
WordPress

WP_Site_Health

Since
5.2.0
Source
wp-admin/includes/class-wp-site-health.php:10
Class for looking up a site's health based on a user's WordPress environment.

Compatibility

WordPress
since 5.2.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 17

Every hook that fires from inside WP_Site_Health, in the order it appears in the class, grouped by the method that fires it.

Properties · 15

$instanceprivate static
$is_acceptable_mysql_versionprivate
$is_mariadbpublic
$mysql_server_versionprivate
$mysql_required_versionprivate
$php_memory_limitpublic
$schedulespublic
$cronspublic
$last_missed_cronpublic
$last_late_cronpublic
$timeout_missed_cronprivate
$timeout_late_cronprivate

Methods · 54

Source code

#[AllowDynamicProperties]class WP_Site_Health {	private static $instance = null; 	private $is_acceptable_mysql_version;	private $is_recommended_mysql_version; 	public $is_mariadb                   = false;	private $mysql_server_version        = '';	private $mysql_required_version      = '5.5';	private $mysql_recommended_version   = '8.0';	private $mariadb_recommended_version = '10.11'; 	public $php_memory_limit; 	public $schedules;	public $crons;	public $last_missed_cron     = null;	public $last_late_cron       = null;	private $timeout_missed_cron = null;	private $timeout_late_cron   = null; 	/**	 * WP_Site_Health constructor.	 *	 * @since 5.2.0	 */	public function __construct() {		$this->maybe_create_scheduled_event(); 		// Save memory limit before it's affected by wp_raise_memory_limit( 'admin' ).		$this->php_memory_limit = ini_get( 'memory_limit' ); 		$this->timeout_late_cron   = 0;		$this->timeout_missed_cron = - 5 * MINUTE_IN_SECONDS; 		if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {			$this->timeout_late_cron   = - 15 * MINUTE_IN_SECONDS;			$this->timeout_missed_cron = - 1 * HOUR_IN_SECONDS;		} 		add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) ); 		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );		add_action( 'wp_site_health_scheduled_check', array( $this, 'wp_cron_scheduled_check' ) ); 		add_action( 'site_health_tab_content', array( $this, 'show_site_health_tab' ) );	} 	/**	 * Outputs the content of a tab in the Site Health screen.	 *	 * @since 5.8.0	 *	 * @param string $tab Slug of the current tab being displayed.	 */	public function show_site_health_tab( $tab ) {		if ( 'debug' === $tab ) {			require_once ABSPATH . 'wp-admin/site-health-info.php';		}	} 	/**	 * Returns an instance of the WP_Site_Health class, or create one if none exist yet.	 *	 * @since 5.4.0	 *	 * @return WP_Site_Health|null	 */	public static function get_instance() {		if ( null === self::$instance ) {			self::$instance = new WP_Site_Health();		} 		return self::$instance;	} 	/**	 * Enqueues the site health scripts.	 *

Changelog

Introduced in 5.2.0. 3 changes between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

7.0.4
Method get_test_insecure_registration() added.verified against source
7.0.4
Method get_test_opcode_cache() added.verified against source
6.9.7
Method get_test_search_engine_visibility() added.verified against source
5.2.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-admin/includes/class-wp-site-health.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.