PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | src/services/health-check/postname-permalink-reports.php +14 -11 18.9 → trunk View file →
@@ -5,14 +5,17 @@
5 5 /**
6 6 * Presents a set of different messages for the Postname_Permalink health check.
7 7 */
8 8 class Postname_Permalink_Reports {
9 +
9 10 use Reports_Trait;
10 11
11 12 /**
12 13 * Constructor.
13 14 *
14 - * @param Report_Builder_Factory $report_builder_factory The factory for result builder objects. This class uses the report builder to generate WordPress-friendly health check results.
15 + * @param Report_Builder_Factory $report_builder_factory The factory for result builder objects.
16 + * This class uses the report builder to generate WordPress-friendly
17 + * health check results.
15 18 */
16 19 public function __construct( Report_Builder_Factory $report_builder_factory ) {
17 20 $this->report_builder_factory = $report_builder_factory;
18 21 }
@@ -23,11 +26,11 @@
23 26 * @return string[] The message as a WordPress site status report.
24 27 */
25 28 public function get_success_result() {
26 29 return $this->get_report_builder()
27 - ->set_label( esc_html__( 'Your permalink structure includes the post name', 'wordpress-seo' ) )
30 + ->set_label( \esc_html__( 'Your permalink structure includes the post name', 'wordpress-seo' ) )
28 31 ->set_status_good()
29 - ->set_description( __( 'You do have your postname in the URL of your posts and pages.', 'wordpress-seo' ) )
32 + ->set_description( \__( 'You do have your postname in the URL of your posts and pages.', 'wordpress-seo' ) )
30 33 ->build();
31 34 }
32 35
33 36 /**
@@ -36,9 +39,9 @@
36 39 * @return string[] The message as a WordPress site status report.
37 40 */
38 41 public function get_has_no_postname_in_permalink_result() {
39 42 return $this->get_report_builder()
40 - ->set_label( __( 'You do not have your postname in the URL of your posts and pages', 'wordpress-seo' ) )
43 + ->set_label( \__( 'You do not have your postname in the URL of your posts and pages', 'wordpress-seo' ) )
41 44 ->set_status_recommended()
42 45 ->set_description( $this->get_has_no_postname_in_permalink_description() )
43 46 ->set_actions( $this->get_has_no_postname_in_permalink_actions() )
44 47 ->build();
@@ -49,12 +52,12 @@
49 52 *
50 53 * @return string The description as a string.
51 54 */
52 55 private function get_has_no_postname_in_permalink_description() {
53 - return sprintf(
56 + return \sprintf(
54 57 /* translators: %s expands to '/%postname%/' */
55 - __( 'It\'s highly recommended to have your postname in the URL of your posts and pages. Consider setting your permalink structure to %s.', 'wordpress-seo' ),
56 - '<strong>/%postname%/</strong>'
58 + \__( 'It\'s highly recommended to have your postname in the URL of your posts and pages. Consider setting your permalink structure to %s.', 'wordpress-seo' ),
59 + '<strong>/%postname%/</strong>',
57 60 );
58 61 }
59 62
60 63 /**
@@ -62,12 +65,12 @@
62 65 *
63 66 * @return string The actions as a string.
64 67 */
65 68 private function get_has_no_postname_in_permalink_actions() {
66 - return sprintf(
69 + return \sprintf(
67 70 /* translators: %1$s is a link start tag to the permalink settings page, %2$s is the link closing tag. */
68 - __( 'You can fix this on the %1$sPermalink settings page%2$s.', 'wordpress-seo' ),
69 - '<a href="' . admin_url( 'options-permalink.php' ) . '">',
70 - '</a>'
71 + \__( 'You can fix this on the %1$sPermalink settings page%2$s.', 'wordpress-seo' ),
72 + '<a href="' . \admin_url( 'options-permalink.php' ) . '">',
73 + '</a>',
71 74 );
72 75 }
73 76 }