Title: WP_REST_Site_Health_Controller::__construct
Published: December 9, 2020
Last modified: May 20, 2026

---

# WP_REST_Site_Health_Controller::__construct( WP_Site_Health $site_health )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_rest_site_health_controller/__construct/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_site_health_controller/__construct/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_site_health_controller/__construct/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_site_health_controller/__construct/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_rest_site_health_controller/__construct/?output_format=md#wp--skip-link--target)

Site Health controller constructor.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_rest_site_health_controller/__construct/?output_format=md#parameters)󠁿

 `$site_health`[WP_Site_Health](https://developer.wordpress.org/reference/classes/wp_site_health/)
required

An instance of the site health class.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_rest_site_health_controller/__construct/?output_format=md#source)󠁿

    ```php
    public function __construct( $site_health ) {
    	$this->namespace = 'wp-site-health/v1';
    	$this->rest_base = 'tests';

    	$this->site_health = $site_health;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php#L35)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php#L35-L40)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_rest_site_health_controller/__construct/?output_format=md#related)󠁿

| Used by | Description | 
| [create_initial_rest_routes()](https://developer.wordpress.org/reference/functions/create_initial_rest_routes/)`wp-includes/rest-api.php` |

Registers default REST API routes.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_rest_site_health_controller/__construct/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_rest_site_health_controller%2F__construct%2F)
before being able to contribute a note or feedback.