# site_status_tests

URL: https://chugunov.pro/api-wordpress/filters/site_status_tests/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: хук-фильтр.
Появился в версии: 5.2.0.

## Сигнатура

```php
apply_filters( 'site_status_tests', array[] $tests )
```

## Описание

Состояние сайта определяется набором проверок, основанных на лучших практиках как команды WordPress Hosting Team, так и веб-стандартов в целом.
У некоторых сайтов могут быть иные требования, например проверки автоматических обновлений могут выполняться хостингом и поэтому отключены в ядре.
Или, возможно, вы хотите добавить новую проверку, например включено/отключено/устарело ли кэширование.
Проверки можно добавлять как прямые, так и асинхронные. Любая проверка, для завершения которой может потребоваться время, должна выполняться асинхронно, чтобы избежать продолжительных загрузок в wp-admin.

## Параметры

- `$tests` `array[]` — обязательный. An associative array of direct and asynchronous tests.
  
  - `direct` array[] An array of direct tests.
  
  - `...$identifier` array `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to prefix test identifiers with their slug to avoid collisions between tests.
  
  - `label` string The friendly label to identify the test.
  
  - `test` callable The callback function that runs the test and returns its result.
  
  - `skip_cron` bool Whether to skip this test when running as cron.
  
  }
  
  - `async` array[] An array of asynchronous tests.
  
  - `...$identifier` array `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to prefix test identifiers with their slug to avoid collisions between tests.
  
  - `label` string The friendly label to identify the test.
  
  - `test` string An admin-ajax.php action to be called to perform the test, or if `$has_rest` is true, a URL to a REST API endpoint to perform the test.
  
  - `has_rest` bool Whether the `$test` property points to a REST API endpoint.
  
  - `skip_cron` bool Whether to skip this test when running as cron.
  
  - `async_direct_test` callable A manner of directly calling the test marked as asynchronous, as the scheduled event can not authenticate, and endpoints may require authentication.
  
  }
  
  [Source](#source)
  
  ```
  $tests = apply_filters( 'site_status_tests', $tests );
  ```
  
  [View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-site-health.php/) [View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/class-wp-site-health.php#L3047) [View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/class-wp-site-health.php#L3047-L3047)
  
  [Related](#related) Used by | Description |
  [WP_Site_Health::get_tests()](https://developer.wordpress.org/reference/classes/wp_site_health/get_tests/)`wp-admin/includes/class-wp-site-health.php` | Returns a set of tests that belong to the site status page.
  |
  
  [Changelog](#changelog) Version | Description |
  [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Added the `async_direct_test` array key for asynchronous tests.
  
  Added the `skip_cron` array key for all tests. |
  [5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |
  
  [User Contributed Notes](#user-contributed-notes)
  -
  
  [Skip to note 4 content](#comment-content-3216)
  
  [Rami Yushuvaev](https://profiles.wordpress.org/ramiy/)
  [
  
  7 years ago
  ](https://developer.wordpress.org/reference/hooks/site_status_tests/#comment-3216)
  
  [You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-3216)Vote results for this note: 1 [You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-3216)
  
  Example usage to remove a test:
  
  ```
  function remove_background_updates_test( $tests ) {
  unset( $tests['async']['background_updates'] );
  return $tests;
  }
  add_filter( 'site_status_tests', 'remove_background_updates_test' );
  ```
  
  Also check out the [Site Health Manager](https://wordpress.org/plugins/site-health-manager/) plugin that allows you to easily remove custom status test using this hook.
  
  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%3Freplytocom%3D3216%23feedback-editor-3216)
  
  -
  
  [Skip to note 5 content](#comment-content-6367)
  
  [Koen Reus](https://profiles.wordpress.org/koen12344/)
  [
  
  3 years ago
  ](https://developer.wordpress.org/reference/hooks/site_status_tests/#comment-6367)
  
  [You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-6367)Vote results for this note: 0 [You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-6367)
  
  Useful code examples for adding your own tests and section to the Info tab can be found in the [Site Health Check in 5.2](https://make.wordpress.org/core/2019/04/25/site-health-check-in-5-2/) announcement article.
  
  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%3Freplytocom%3D6367%23feedback-editor-6367)
  
  -
  
  [Skip to note 6 content](#comment-content-3745)
  
  [Joel](https://profiles.wordpress.org/joelhardi/)
  [
  
  6 years ago
  ](https://developer.wordpress.org/reference/hooks/site_status_tests/#comment-3745)
  
  [You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-3745)Vote results for this note: -2 [You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-3745)
  
  Here’s a quick one-liner to disable 3 Site Health tests that tend to be false alarms. You can drop it into a plugin or your theme’s `functions.php`.
  
  - PHP version (which is outside of user control anyway)
  
  - theme version (complains when it doesn’t find one of the WordPress twenty**** themes)
  
  - background updates (complains when you have a .git directory in your site root, for example)
  
  ```
  add_filter('site_status_tests', function (array $test_type) {
  unset($test_type['direct']['php_version'],
  $test_type['direct']['theme_version'],
  $test_type['async']['background_updates']);
  return $test_type;
  }, 10, 1);
  ```
  
  -
  
  The PHP Version may be out of direct control of the user, but they should still know if they need to contact a host about getting it updated. And having a public .git directory is a problem, and should be warned about. There are security implications. In summary, best to not just disable tests because they are failing :)
  [Caleb Burks](https://profiles.wordpress.org/icaleb/) [6 years ago](https://developer.wordpress.org/reference/hooks/site_status_tests/#comment-3891)
  
  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%3Freplytocom%3D3745%23feedback-editor-3745)
  
  You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F) before being able to contribute a note or feedback.
  
  - [About](https://wordpress.org/about/)
  
  - [News](https://wordpress.org/news/)
  
  - [Hosting](https://wordpress.org/hosting/)
  
  - [Privacy](https://wordpress.org/about/privacy/)
  
  - [Showcase](https://wordpress.org/showcase/)
  
  - [Themes](https://wordpress.org/themes/)
  
  - [Plugins](https://wordpress.org/plugins/)
  
  - [Patterns](https://wordpress.org/patterns/)
  
  - [Learn](https://learn.wordpress.org/)
  
  - [Documentation](https://wordpress.org/documentation/)
  
  - [Developers](https://developer.wordpress.org/)
  
  - [WordPress.tv ↗ ](https://wordpress.tv/)
  
  - [Get Involved](https://make.wordpress.org/)
  
  - [Events](https://events.wordpress.org/)
  
  - [Donate ↗ ](https://wordpressfoundation.org/donate/)
  
  - [Five for the Future](https://wordpress.org/five-for-the-future/)
  
  - [WordPress.com ↗ ](https://wordpress.com/?ref=wporg-footer)
  
  - [Matt ↗ ](https://ma.tt/)
  
  - [bbPress ↗ ](https://bbpress.org/)
  
  - [BuddyPress ↗ ](https://buddypress.org/)
  
  [
  
  WordPress.org
  
  ](https://wordpress.org/)
  
  [
  
  WordPress.org
  
  ](https://wordpress.org/)
  
  - [Visit our X (formerly Twitter) account ](https://www.x.com/WordPress)
  
  - [Visit our Bluesky account ](https://bsky.app/profile/wordpress.org)
  
  - [Visit our Mastodon account ](https://mastodon.world/@WordPress)
  
  - [Visit our Threads account ](https://www.threads.net/@wordpress)
  
  - [Visit our Facebook page ](https://www.facebook.com/WordPress/)
  
  - [Visit our Instagram account ](https://www.instagram.com/wordpress/)
  
  - [Visit our LinkedIn account ](https://www.linkedin.com/company/wordpress)
  
  - [Visit our TikTok account ](https://www.tiktok.com/@wordpress)
  
  - [Visit our YouTube channel ](https://www.youtube.com/wordpress)
  
  - [Visit our Tumblr account ](https://wordpress.tumblr.com/)
  
  The WordPress® trademark is the intellectual property of the WordPress Foundation.

## Фильтруемое значение

An associative array of direct and asynchronous tests.

- `direct` array[] An array of direct tests.

- `...$identifier` array `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to prefix test identifiers with their slug to avoid collisions between tests.

- `label` string The friendly label to identify the test.

- `test` callable The callback function that runs the test and returns its result.

- `skip_cron` bool Whether to skip this test when running as cron.

}

- `async` array[] An array of asynchronous tests.

- `...$identifier` array `$identifier` should be a unique identifier for the test. Plugins and themes are encouraged to prefix test identifiers with their slug to avoid collisions between tests.

- `label` string The friendly label to identify the test.

- `test` string An admin-ajax.php action to be called to perform the test, or if `$has_rest` is true, a URL to a REST API endpoint to perform the test.

- `has_rest` bool Whether the `$test` property points to a REST API endpoint.

- `skip_cron` bool Whether to skip this test when running as cron.

- `async_direct_test` callable A manner of directly calling the test marked as asynchronous, as the scheduled event can not authenticate, and endpoints may require authentication.

}

[Source](#source)

```
$tests = apply_filters( 'site_status_tests', $tests );
```

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

[Related](#related) Used by | Description |
[WP_Site_Health::get_tests()](https://developer.wordpress.org/reference/classes/wp_site_health/get_tests/)`wp-admin/includes/class-wp-site-health.php` | Returns a set of tests that belong to the site status page.
|

[Changelog](#changelog) Version | Description |
[5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Added the `async_direct_test` array key for asynchronous tests.

Added the `skip_cron` array key for all tests. |
[5.2.0](https://developer.wordpress.org/reference/since/5.2.0/) | Introduced. |

[User Contributed Notes](#user-contributed-notes)
-

[Skip to note 4 content](#comment-content-3216)

[Rami Yushuvaev](https://profiles.wordpress.org/ramiy/)
[

7 years ago
](https://developer.wordpress.org/reference/hooks/site_status_tests/#comment-3216)

[You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-3216)Vote results for this note: 1 [You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-3216)

Example usage to remove a test:

```
function remove_background_updates_test( $tests ) {
unset( $tests['async']['background_updates'] );
return $tests;
}
add_filter( 'site_status_tests', 'remove_background_updates_test' );
```

Also check out the [Site Health Manager](https://wordpress.org/plugins/site-health-manager/) plugin that allows you to easily remove custom status test using this hook.

[Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%3Freplytocom%3D3216%23feedback-editor-3216)

-

[Skip to note 5 content](#comment-content-6367)

[Koen Reus](https://profiles.wordpress.org/koen12344/)
[

3 years ago
](https://developer.wordpress.org/reference/hooks/site_status_tests/#comment-6367)

[You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-6367)Vote results for this note: 0 [You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-6367)

Useful code examples for adding your own tests and section to the Info tab can be found in the [Site Health Check in 5.2](https://make.wordpress.org/core/2019/04/25/site-health-check-in-5-2/) announcement article.

[Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%3Freplytocom%3D6367%23feedback-editor-6367)

-

[Skip to note 6 content](#comment-content-3745)

[Joel](https://profiles.wordpress.org/joelhardi/)
[

6 years ago
](https://developer.wordpress.org/reference/hooks/site_status_tests/#comment-3745)

[You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-3745)Vote results for this note: -2 [You must log in to vote on the helpfulness of this note ](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%23comment-3745)

Here’s a quick one-liner to disable 3 Site Health tests that tend to be false alarms. You can drop it into a plugin or your theme’s `functions.php`.

- PHP version (which is outside of user control anyway)

- theme version (complains when it doesn’t find one of the WordPress twenty**** themes)

- background updates (complains when you have a .git directory in your site root, for example)

```
add_filter('site_status_tests', function (array $test_type) {
unset($test_type['direct']['php_version'],
$test_type['direct']['theme_version'],
$test_type['async']['background_updates']);
return $test_type;
}, 10, 1);
```

-

The PHP Version may be out of direct control of the user, but they should still know if they need to contact a host about getting it updated. And having a public .git directory is a problem, and should be warned about. There are security implications. In summary, best to not just disable tests because they are failing :)
[Caleb Burks](https://profiles.wordpress.org/icaleb/) [6 years ago](https://developer.wordpress.org/reference/hooks/site_status_tests/#comment-3891)

[Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fsite_status_tests%2F%3Freplytocom%3D3745%23feedback-editor-3745)

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

- [About](https://wordpress.org/about/)

- [News](https://wordpress.org/news/)

- [Hosting](https://wordpress.org/hosting/)

- [Privacy](https://wordpress.org/about/privacy/)

- [Showcase](https://wordpress.org/showcase/)

- [Themes](https://wordpress.org/themes/)

- [Plugins](https://wordpress.org/plugins/)

- [Patterns](https://wordpress.org/patterns/)

- [Learn](https://learn.wordpress.org/)

- [Documentation](https://wordpress.org/documentation/)

- [Developers](https://developer.wordpress.org/)

- [WordPress.tv ↗ ](https://wordpress.tv/)

- [Get Involved](https://make.wordpress.org/)

- [Events](https://events.wordpress.org/)

- [Donate ↗ ](https://wordpressfoundation.org/donate/)

- [Five for the Future](https://wordpress.org/five-for-the-future/)

- [WordPress.com ↗ ](https://wordpress.com/?ref=wporg-footer)

- [Matt ↗ ](https://ma.tt/)

- [bbPress ↗ ](https://bbpress.org/)

- [BuddyPress ↗ ](https://buddypress.org/)

[

WordPress.org

](https://wordpress.org/)

[

WordPress.org

](https://wordpress.org/)

- [Visit our X (formerly Twitter) account ](https://www.x.com/WordPress)

- [Visit our Bluesky account ](https://bsky.app/profile/wordpress.org)

- [Visit our Mastodon account ](https://mastodon.world/@WordPress)

- [Visit our Threads account ](https://www.threads.net/@wordpress)

- [Visit our Facebook page ](https://www.facebook.com/WordPress/)

- [Visit our Instagram account ](https://www.instagram.com/wordpress/)

- [Visit our LinkedIn account ](https://www.linkedin.com/company/wordpress)

- [Visit our TikTok account ](https://www.tiktok.com/@wordpress)

- [Visit our YouTube channel ](https://www.youtube.com/wordpress)

- [Visit our Tumblr account ](https://wordpress.tumblr.com/)

The WordPress® trademark is the intellectual property of the WordPress Foundation.

## Исходный код

Файл: `wp-admin/includes/class-wp-site-health.php:3047`

```php
$tests = apply_filters( 'site_status_tests', $tests );
```

## История изменений

- 5.6.0 — Added the async_direct_test array key for asynchronous tests. Added the skip_cron array key for all tests.
- 5.2.0 — Introduced.

## Связанные

Используется в: `WP_Site_Health::get_tests`.

Оригинал в официальной документации: https://developer.wordpress.org/reference/hooks/site_status_tests/
