Skip to content

Commit 7835bf2

Browse files
committed
Description fix
1 parent 029c429 commit 7835bf2

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

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

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,26 @@ public function is_task_completed( $task_id = '' ) {
111111
* @return void
112112
*/
113113
public function print_popover_instructions() {
114-
?>
115-
<p><?php \esc_html_e( 'If you don\'t need comments on your site, consider disabling them.', 'progress-planner' ); ?></p>
116-
<?php
114+
$comments_count = (int) \wp_count_comments()->approved;
115+
116+
echo '<p>';
117+
if ( 0 === $comments_count ) {
118+
\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' );
119+
} else {
120+
printf(
121+
\esc_html(
122+
// translators: %d is the number of approved comments.
123+
\_n(
124+
'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.',
125+
'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+
$comments_count,
127+
'progress-planner'
128+
)
129+
),
130+
(int) $comments_count
131+
);
132+
}
133+
echo '</p>';
117134
}
118135

119136
/**

0 commit comments

Comments
 (0)