← All changes
|
src/integrations/admin/health-check-integration.php
+4
-1
18.5.1
→
trunk
View file →
| @@ -21,9 +21,8 @@ | ||
| 21 | 21 | /** |
| 22 | 22 | * Uses the dependency injection container to obtain all available implementations of the Health_Check interface. |
| 23 | 23 | * |
| 24 | 24 | * @param Health_Check ...$health_checks The available health checks implementations. |
| 25 | - * @return void | |
| 26 | 25 | */ |
| 27 | 26 | public function __construct( Health_Check ...$health_checks ) { |
| 28 | 27 | $this->health_checks = $health_checks; |
| 29 | 28 | } |
| @@ -91,8 +90,12 @@ | ||
| 91 | 90 | * @return string[] Array containing WordPress site status tests with Yoast's health checks. |
| 92 | 91 | */ |
| 93 | 92 | private function add_health_checks_to_site_status_tests( $tests ) { |
| 94 | 93 | foreach ( $this->health_checks as $health_check ) { |
| 94 | + if ( $health_check->is_excluded() ) { | |
| 95 | + continue; | |
| 96 | + } | |
| 97 | + | |
| 95 | 98 | $tests['direct'][ $health_check->get_test_identifier() ] = [ |
| 96 | 99 | 'test' => [ $health_check, 'run_and_get_result' ], |
| 97 | 100 | ]; |
| 98 | 101 | } |