report_builder_factory = $report_builder_factory;
$this->shortlinker = $shortlinker;
}
/**
* Returns the message for a successful health check.
*
* @return string[] The message as a WordPress site status report.
*/
public function get_success_result() {
return $this->get_report_builder()
->set_label( \__( 'The text link counter is working as expected', 'wordpress-seo' ) )
->set_status_good()
->set_description( $this->get_success_description() )
->build();
}
/**
* Returns the message for a failed health check.
*
* @return string[] The message as a WordPress site status report.
*/
public function get_links_table_not_accessible_result() {
return $this->get_report_builder()
->set_label( \__( 'The text link counter feature is not working as expected', 'wordpress-seo' ) )
->set_status_recommended()
->set_description( $this->get_links_table_not_accessible_description() )
->set_actions( $this->get_actions() )
->build();
}
/**
* Returns the description for when the health check was successful.
*
* @return string The description as a string.
*/
private function get_success_description() {
return \sprintf(
/* translators: 1: Link to the Yoast SEO blog, 2: Link closing tag. */
\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' ),
'',
WPSEO_Admin_Utils::get_new_tab_message() . ''
);
}
/**
* Returns the description for when the health couldn't access the links table.
*
* @return string The description as a string.
*/
private function get_links_table_not_accessible_description() {
return \sprintf(
/* translators: 1: Yoast SEO. */
\__( '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' ),
'Yoast SEO'
);
}
/**
* Returns the actions that the user should take when the links table is not accessible.
*
* @return string The actions as a string.
*/
private function get_actions() {
return \sprintf(
/* translators: 1: Link to the Yoast help center, 2: Link closing tag. */
\esc_html__( '%1$sFind out how to solve this problem on our help center%2$s.', 'wordpress-seo' ),
'',
WPSEO_Admin_Utils::get_new_tab_message() . ''
);
}
}