Skip to content

Commit b859a3b

Browse files
committed
Merge branch 'ari/convert-blog-description-to-interactive' into ari/plugin-installer
2 parents bf19ee7 + 4e4327e commit b859a3b

3 files changed

Lines changed: 46 additions & 13 deletions

File tree

classes/suggested-tasks/providers/class-disable-comments.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ public function print_popover_instructions() {
117117

118118
echo '<p>';
119119
if ( 0 === $comments_count ) {
120-
\esc_html_e( 'Your site currently has no approved comments. Therefore, it seems your site might not need comments. If that is true for most posts or pages on your site, you can use WordPress\'s default setting to disable comments. If your site really doesn\'t need any comments, we recommend installing the "Comment-Free Zone" plugin.', 'progress-planner' );
120+
\esc_html_e( 'Your site currently has no approved comments. Therefore, it seems your site might not need comments. If that is true for most posts or pages on your site, you can use WordPress\'s default setting to disable comments.', 'progress-planner' );
121121
} else {
122122
printf(
123123
\esc_html(
124124
// translators: %d is the number of approved comments.
125125
\_n(
126-
'Your site currently has %d approved comment. Therefore, it seems your site might not need comments. If that is true for most posts or pages on your site, you can use WordPress\'s default setting to disable comments. If your site really doesn\'t need any comments, we recommend installing the "Comment-Free Zone" plugin.',
127-
'Your site currently has %d approved comments. Therefore, it seems your site might not need comments. If that is true for most posts or pages on your site, you can use WordPress\'s default setting to disable comments. If your site really doesn\'t need any comments, we recommend installing the "Comment-Free Zone" plugin.',
126+
'Your site currently has %d approved comment. Therefore, it seems your site might not need comments. If that is true for most posts or pages on your site, you can use WordPress\'s default setting to disable comments.',
127+
'Your site currently has %d approved comments. Therefore, it seems your site might not need comments. If that is true for most posts or pages on your site, you can use WordPress\'s default setting to disable comments.',
128128
$comments_count,
129129
'progress-planner'
130130
)
@@ -133,6 +133,15 @@ public function print_popover_instructions() {
133133
);
134134
}
135135
echo '</p>';
136+
if ( ! \is_multisite() && \current_user_can( 'install_plugins' ) ) {
137+
echo '<p>';
138+
\printf(
139+
/* translators: %s is the <a href="https://w.org/plugins/comment-free-zone/" target="_blank">Comment-Free Zone</a> link */
140+
\esc_html__( 'If your site really doesn\'t need any comments, we recommend installing the "%s" plugin.', 'progress-planner' ),
141+
'<a href="https://w.org/plugins/comment-free-zone/" target="_blank">' . \esc_html__( 'Comment-Free Zone', 'progress-planner' ) . '</a>'
142+
);
143+
echo '</p>';
144+
}
136145
}
137146

138147
/**

classes/suggested-tasks/providers/class-hello-world.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,23 @@ protected function get_title() {
8989
* @return string
9090
*/
9191
protected function get_description() {
92-
return \sprintf(
93-
/* translators: %s:<a href="https://prpl.fyi/delete-hello-world-post" target="_blank">Hello World!</a> link */
94-
\esc_html__( 'On install, WordPress creates a %s post. This post is not needed and should be deleted.', 'progress-planner' ),
95-
'<a href="https://prpl.fyi/delete-hello-world-post" target="_blank">' . \esc_html__( '"Hello World!"', 'progress-planner' ) . '</a>'
96-
);
92+
$hello_world_post_id = $this->get_data_collector()->collect();
93+
94+
if ( 0 === $hello_world_post_id ) {
95+
return \esc_html__( 'On install, WordPress creates a "Hello World!" post. This post is not needed and should be deleted.', 'progress-planner' );
96+
}
97+
98+
$hello_world_post_url = (string) \get_permalink( $hello_world_post_id );
99+
100+
return '<p>' . \sprintf(
101+
/* translators: %s: Link to the post. */
102+
\esc_html__( 'On install, WordPress creates a "Hello World!" post. You can find yours at %s.', 'progress-planner' ),
103+
'<a href="' . \esc_attr( $hello_world_post_url ) . '" target="_blank">' . \esc_html( $hello_world_post_url ) . '</a>',
104+
) . '</p><p>' . \sprintf(
105+
/* translators: %s: URL to https://prpl.fyi/delete-sample-page */
106+
\__( 'This post does not add value to your website and solely exists to show what a post can look like. Therefore, <a href="%s" target="_blank">"Hello World!" is not needed and should be deleted</a>.', 'progress-planner' ),
107+
'https://prpl.fyi/delete-hello-world-post'
108+
) . '</p>';
97109
}
98110

99111
/**

classes/suggested-tasks/providers/class-sample-page.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,23 @@ protected function get_title() {
8888
* @return string
8989
*/
9090
protected function get_description() {
91-
return \sprintf(
92-
/* translators: %s:<a href="https://prpl.fyi/delete-sample-page" target="_blank">Sample Page</a> link */
93-
\esc_html__( 'On install, WordPress creates a %s page. This page is not needed and should be deleted.', 'progress-planner' ),
94-
'<a href="https://prpl.fyi/delete-sample-page" target="_blank">' . \esc_html__( '"Sample Page"', 'progress-planner' ) . '</a>'
95-
);
91+
$sample_page_id = $this->get_data_collector()->collect();
92+
93+
if ( 0 === $sample_page_id ) {
94+
return \esc_html__( 'On install, WordPress creates a "Sample Page" page. This page does not add value to your website and solely exists to show what a page can look like. Therefore, "Sample Page" is not needed and should be deleted.', 'progress-planner' );
95+
}
96+
97+
$sample_page_url = (string) \get_permalink( $sample_page_id );
98+
99+
return '<p>' . \sprintf(
100+
/* translators: %s: Link to the post. */
101+
\esc_html__( 'On install, WordPress creates a "Sample Page" page. You can find yours at %s.', 'progress-planner' ),
102+
'<a href="' . \esc_attr( $sample_page_url ) . '" target="_blank">' . \esc_html( $sample_page_url ) . '</a>',
103+
) . '</p><p>' . \sprintf(
104+
/* translators: %s: URL to https://prpl.fyi/delete-sample-page */
105+
\__( 'This page does not add value to your website and solely exists to show what a page can look like. Therefore, <a href="%s" target="_blank">"Sample Page" is not needed and should be deleted</a>.', 'progress-planner' ),
106+
'https://prpl.fyi/delete-sample-page'
107+
) . '</p>';
96108
}
97109

98110
/**

0 commit comments

Comments
 (0)