Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordpres.../src/services/health-c...
File: health-check.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Services\Health_Check;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Abstract class for all health checks. Provides a uniform interface for the Health_Check_Integration.
[5] Fix | Delete
*/
[6] Fix | Delete
abstract class Health_Check {
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* The prefix to add to the test identifier. Used to differentiate between Yoast's health checks, and other health checks.
[10] Fix | Delete
*/
[11] Fix | Delete
public const TEST_IDENTIFIER_PREFIX = 'yoast-';
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* The object that runs the actual health check.
[15] Fix | Delete
*
[16] Fix | Delete
* @var Runner_Interface
[17] Fix | Delete
*/
[18] Fix | Delete
private $runner;
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* The health check implementation sets the runner so this class can start a health check.
[22] Fix | Delete
*
[23] Fix | Delete
* @param Runner_Interface $runner The health check runner.
[24] Fix | Delete
* @return void
[25] Fix | Delete
*/
[26] Fix | Delete
protected function set_runner( $runner ) {
[27] Fix | Delete
$this->runner = $runner;
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
/**
[31] Fix | Delete
* Returns the identifier of health check implementation. WordPress needs this to manage the health check (https://developer.wordpress.org/reference/hooks/site_status_tests/).
[32] Fix | Delete
*
[33] Fix | Delete
* @return string The identifier that WordPress requires.
[34] Fix | Delete
*/
[35] Fix | Delete
public function get_test_identifier() {
[36] Fix | Delete
$full_class_name = static::class;
[37] Fix | Delete
$class_name_backslash_index = \strrpos( $full_class_name, '\\' );
[38] Fix | Delete
[39] Fix | Delete
$class_name = $full_class_name;
[40] Fix | Delete
if ( $class_name_backslash_index ) {
[41] Fix | Delete
$class_name_index = ( $class_name_backslash_index + 1 );
[42] Fix | Delete
$class_name = \substr( $full_class_name, $class_name_index );
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
$lowercase = \strtolower( $class_name );
[46] Fix | Delete
$whitespace_as_dashes = \str_replace( '_', '-', $lowercase );
[47] Fix | Delete
$with_prefix = self::TEST_IDENTIFIER_PREFIX . $whitespace_as_dashes;
[48] Fix | Delete
return $with_prefix;
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* 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/).
[53] Fix | Delete
*
[54] Fix | Delete
* @return string A human-readable label for the health check.
[55] Fix | Delete
*/
[56] Fix | Delete
abstract public function get_test_label();
[57] Fix | Delete
[58] Fix | Delete
/**
[59] Fix | Delete
* 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/).
[60] Fix | Delete
*
[61] Fix | Delete
* @return string[] The array containing a WordPress site status report.
[62] Fix | Delete
*/
[63] Fix | Delete
public function run_and_get_result() {
[64] Fix | Delete
$this->runner->run();
[65] Fix | Delete
return $this->get_result();
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
/**
[69] Fix | Delete
* Gets the result from the health check implementation.
[70] Fix | Delete
*
[71] Fix | Delete
* @return string[] The array containing a WordPress site status report.
[72] Fix | Delete
*/
[73] Fix | Delete
abstract protected function get_result();
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function