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: links-table-runner.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Services\Health_Check;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\SEO\Config\Migration_Status;
[4] Fix | Delete
use Yoast\WP\SEO\Helpers\Options_Helper;
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Runs the Links_Table health check.
[8] Fix | Delete
*/
[9] Fix | Delete
class Links_Table_Runner implements Runner_Interface {
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Is set to true when the links table is accessible.
[13] Fix | Delete
*
[14] Fix | Delete
* @var bool
[15] Fix | Delete
*/
[16] Fix | Delete
private $links_table_accessible = false;
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* The Migration_Status object used to determine whether the links table is accessible.
[20] Fix | Delete
*
[21] Fix | Delete
* @var Migration_Status
[22] Fix | Delete
*/
[23] Fix | Delete
private $migration_status;
[24] Fix | Delete
[25] Fix | Delete
/**
[26] Fix | Delete
* The Options_Helper object used to determine whether the health check should run or not.
[27] Fix | Delete
*
[28] Fix | Delete
* @var Options_Helper
[29] Fix | Delete
*/
[30] Fix | Delete
private $options_helper;
[31] Fix | Delete
[32] Fix | Delete
/**
[33] Fix | Delete
* Constructor.
[34] Fix | Delete
*
[35] Fix | Delete
* @param Migration_Status $migration_status Object used to determine whether the links table is accessible.
[36] Fix | Delete
* @param Options_Helper $options_helper Object used to determine whether the health check should run.
[37] Fix | Delete
*/
[38] Fix | Delete
public function __construct(
[39] Fix | Delete
Migration_Status $migration_status,
[40] Fix | Delete
Options_Helper $options_helper
[41] Fix | Delete
) {
[42] Fix | Delete
$this->migration_status = $migration_status;
[43] Fix | Delete
$this->options_helper = $options_helper;
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
/**
[47] Fix | Delete
* Runs the health check. Checks if the tagline is set to WordPress' default tagline, or to its set translation.
[48] Fix | Delete
*
[49] Fix | Delete
* @return void
[50] Fix | Delete
*/
[51] Fix | Delete
public function run() {
[52] Fix | Delete
if ( ! $this->should_run() ) {
[53] Fix | Delete
return;
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
$this->links_table_accessible = $this->migration_status->is_version( 'free', \WPSEO_VERSION );
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
/**
[60] Fix | Delete
* Determines whether the health check should run or not.
[61] Fix | Delete
*
[62] Fix | Delete
* @return bool True if the text link counter feature is enabled.
[63] Fix | Delete
*/
[64] Fix | Delete
public function should_run() {
[65] Fix | Delete
$text_link_counter_enabled = $this->options_helper->get( 'enable_text_link_counter' );
[66] Fix | Delete
[67] Fix | Delete
if ( ! \is_bool( $text_link_counter_enabled ) ) {
[68] Fix | Delete
return false;
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
return $text_link_counter_enabled;
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
/**
[75] Fix | Delete
* Returns true if the links table is accessible
[76] Fix | Delete
*
[77] Fix | Delete
* @return bool The boolean indicating if the health check was succesful.
[78] Fix | Delete
*/
[79] Fix | Delete
public function is_successful() {
[80] Fix | Delete
return $this->links_table_accessible;
[81] Fix | Delete
}
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function