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-reports.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Services\Health_Check;
[2] Fix | Delete
[3] Fix | Delete
use WPSEO_Admin_Utils;
[4] Fix | Delete
use WPSEO_Shortlinker;
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Presents a set of different messages for the Links_Table health check.
[8] Fix | Delete
*/
[9] Fix | Delete
class Links_Table_Reports {
[10] Fix | Delete
[11] Fix | Delete
use Reports_Trait;
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* Shortlinker object used to create short links for reports.
[15] Fix | Delete
*
[16] Fix | Delete
* @var WPSEO_Shortlinker
[17] Fix | Delete
*/
[18] Fix | Delete
private $shortlinker;
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* Constructor
[22] Fix | Delete
*
[23] Fix | Delete
* @param Report_Builder_Factory $report_builder_factory The factory for result builder objects.
[24] Fix | Delete
* This class uses the report builder to generate WordPress-friendly
[25] Fix | Delete
* health check results.
[26] Fix | Delete
* @param WPSEO_Shortlinker $shortlinker Object used to add short links to the report description.
[27] Fix | Delete
*/
[28] Fix | Delete
public function __construct(
[29] Fix | Delete
Report_Builder_Factory $report_builder_factory,
[30] Fix | Delete
WPSEO_Shortlinker $shortlinker
[31] Fix | Delete
) {
[32] Fix | Delete
$this->report_builder_factory = $report_builder_factory;
[33] Fix | Delete
$this->shortlinker = $shortlinker;
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Returns the message for a successful health check.
[38] Fix | Delete
*
[39] Fix | Delete
* @return string[] The message as a WordPress site status report.
[40] Fix | Delete
*/
[41] Fix | Delete
public function get_success_result() {
[42] Fix | Delete
return $this->get_report_builder()
[43] Fix | Delete
->set_label( \__( 'The text link counter is working as expected', 'wordpress-seo' ) )
[44] Fix | Delete
->set_status_good()
[45] Fix | Delete
->set_description( $this->get_success_description() )
[46] Fix | Delete
->build();
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* Returns the message for a failed health check.
[51] Fix | Delete
*
[52] Fix | Delete
* @return string[] The message as a WordPress site status report.
[53] Fix | Delete
*/
[54] Fix | Delete
public function get_links_table_not_accessible_result() {
[55] Fix | Delete
return $this->get_report_builder()
[56] Fix | Delete
->set_label( \__( 'The text link counter feature is not working as expected', 'wordpress-seo' ) )
[57] Fix | Delete
->set_status_recommended()
[58] Fix | Delete
->set_description( $this->get_links_table_not_accessible_description() )
[59] Fix | Delete
->set_actions( $this->get_actions() )
[60] Fix | Delete
->build();
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
/**
[64] Fix | Delete
* Returns the description for when the health check was successful.
[65] Fix | Delete
*
[66] Fix | Delete
* @return string The description as a string.
[67] Fix | Delete
*/
[68] Fix | Delete
private function get_success_description() {
[69] Fix | Delete
return \sprintf(
[70] Fix | Delete
/* translators: 1: Link to the Yoast SEO blog, 2: Link closing tag. */
[71] Fix | Delete
\esc_html__( 'The text link counter helps you improve your site structure. %1$sFind out how the text link counter can enhance your SEO%2$s.', 'wordpress-seo' ),
[72] Fix | Delete
'<a href="' . $this->shortlinker->get( 'https://yoa.st/3zw' ) . '" target="_blank">',
[73] Fix | Delete
WPSEO_Admin_Utils::get_new_tab_message() . '</a>'
[74] Fix | Delete
);
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
/**
[78] Fix | Delete
* Returns the description for when the health couldn't access the links table.
[79] Fix | Delete
*
[80] Fix | Delete
* @return string The description as a string.
[81] Fix | Delete
*/
[82] Fix | Delete
private function get_links_table_not_accessible_description() {
[83] Fix | Delete
return \sprintf(
[84] Fix | Delete
/* translators: 1: Yoast SEO. */
[85] Fix | Delete
\__( 'For this feature to work, %1$s needs to create a table in your database. We were unable to create this table automatically.', 'wordpress-seo' ),
[86] Fix | Delete
'Yoast SEO'
[87] Fix | Delete
);
[88] Fix | Delete
}
[89] Fix | Delete
[90] Fix | Delete
/**
[91] Fix | Delete
* Returns the actions that the user should take when the links table is not accessible.
[92] Fix | Delete
*
[93] Fix | Delete
* @return string The actions as a string.
[94] Fix | Delete
*/
[95] Fix | Delete
private function get_actions() {
[96] Fix | Delete
return \sprintf(
[97] Fix | Delete
/* translators: 1: Link to the Yoast help center, 2: Link closing tag. */
[98] Fix | Delete
\esc_html__( '%1$sFind out how to solve this problem on our help center%2$s.', 'wordpress-seo' ),
[99] Fix | Delete
'<a href="' . $this->shortlinker->get( 'https://yoa.st/3zv' ) . '" target="_blank">',
[100] Fix | Delete
WPSEO_Admin_Utils::get_new_tab_message() . '</a>'
[101] Fix | Delete
);
[102] Fix | Delete
}
[103] Fix | Delete
}
[104] Fix | Delete
[105] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function