wppaste
WordPress

WP_REST_Site_Health_Controller

Since
5.6.0
Source
wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php:17
Core class for interacting with Site Health tests.

Compatibility

WordPress
since 5.6.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 · 1

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

Properties · 1

$site_healthWP_Site_Healthprivate
An instance of the site health class.

Methods · 12

Source code

class WP_REST_Site_Health_Controller extends WP_REST_Controller { 	/**	 * An instance of the site health class.	 *	 * @since 5.6.0	 *	 * @var WP_Site_Health	 */	private $site_health; 	/**	 * Site Health controller constructor.	 *	 * @since 5.6.0	 *	 * @param WP_Site_Health $site_health An instance of the site health class.	 */	public function __construct( $site_health ) {		$this->namespace = 'wp-site-health/v1';		$this->rest_base = 'tests'; 		$this->site_health = $site_health;	} 	/**	 * Registers API routes.	 *	 * @since 5.6.0	 * @since 6.1.0 Adds page-cache async test.	 *	 * @see register_rest_route()	 */	public function register_routes() {		register_rest_route(			$this->namespace,			sprintf(				'/%s/%s',				$this->rest_base,				'background-updates'			),			array(				array(					'methods'             => 'GET',					'callback'            => array( $this, 'test_background_updates' ),					'permission_callback' => function () {						return $this->validate_request_permission( 'background_updates' );					},				),				'schema' => array( $this, 'get_public_item_schema' ),			)		); 		register_rest_route(			$this->namespace,			sprintf(				'/%s/%s',				$this->rest_base,				'loopback-requests'			),			array(				array(					'methods'             => 'GET',					'callback'            => array( $this, 'test_loopback_requests' ),					'permission_callback' => function () {						return $this->validate_request_permission( 'loopback_requests' );					},				),				'schema' => array( $this, 'get_public_item_schema' ),			)		); 		register_rest_route(			$this->namespace,			sprintf(				'/%s/%s',				$this->rest_base,				'https-status'			),			array(

Changelog

Introduced in 5.6.0. Unchanged from 6.7.7 through 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.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.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.