| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * The prefix to add to the test identifier. Used to differentiate between Yoast's health checks, and other health checks. |
| 12 | 12 | */ |
| 13 | - const TEST_IDENTIFIER_PREFIX = 'yoast-'; | |
| 13 | + public const TEST_IDENTIFIER_PREFIX = 'yoast-'; | |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * The object that runs the actual health check. |
| 17 | 17 | * |
| @@ -34,9 +34,9 @@ | ||
| 34 | 34 | * |
| 35 | 35 | * @return string The identifier that WordPress requires. |
| 36 | 36 | */ |
| 37 | 37 | public function get_test_identifier() { |
| 38 | - $full_class_name = \get_class( $this ); | |
| 38 | + $full_class_name = static::class; | |
| 39 | 39 | $class_name_backslash_index = \strrpos( $full_class_name, '\\' ); |
| 40 | 40 | |
| 41 | 41 | $class_name = $full_class_name; |
| 42 | 42 | if ( $class_name_backslash_index ) { |
| @@ -50,15 +50,8 @@ | ||
| 50 | 50 | return $with_prefix; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | - * Returns the name of health check implementation that the user can see. WordPress needs this to manage the health check (https://developer.wordpress.org/reference/hooks/site_status_tests/). | |
| 55 | - * | |
| 56 | - * @return string A human-readable label for the health check. | |
| 57 | - */ | |
| 58 | - abstract public function get_test_label(); | |
| 59 | - | |
| 60 | - /** | |
| 61 | 54 | * Runs the health check, and returns its result in the format that WordPress requires to show the results to the user (https://developer.wordpress.org/reference/hooks/site_status_test_result/). |
| 62 | 55 | * |
| 63 | 56 | * @return string[] The array containing a WordPress site status report. |
| 64 | 57 | */ |
| @@ -72,5 +65,12 @@ | ||
| 72 | 65 | * |
| 73 | 66 | * @return string[] The array containing a WordPress site status report. |
| 74 | 67 | */ |
| 75 | 68 | abstract protected function get_result(); |
| 69 | + | |
| 70 | + /** | |
| 71 | + * Returns whether the health check should be excluded from the results. | |
| 72 | + * | |
| 73 | + * @return bool Whether the check should be excluded. | |
| 74 | + */ | |
| 75 | + abstract public function is_excluded(); | |
| 76 | 76 | } |