Skip to content

Commit d70d626

Browse files
committed
Remove get_description methods where possible
1 parent 94a718a commit d70d626

30 files changed

Lines changed: 6 additions & 365 deletions

classes/suggested-tasks/providers/class-content-review.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -151,35 +151,6 @@ protected function get_title_with_data( $task_data = [] ) {
151151
);
152152
}
153153

154-
/**
155-
* Get the task description.
156-
*
157-
* @param array $task_data The task data.
158-
*
159-
* @return string
160-
*/
161-
protected function get_description_with_data( $task_data = [] ) {
162-
if ( ! isset( $task_data['target_post_id'] ) ) {
163-
return '';
164-
}
165-
166-
$post = \get_post( $task_data['target_post_id'] );
167-
168-
if ( ! $post ) {
169-
return '';
170-
}
171-
172-
$months = \in_array( (int) $post->ID, $this->get_saved_page_types(), true ) ? '12' : '6';
173-
174-
return '<p>' . \sprintf(
175-
/* translators: %1$s <a href="https://prpl.fyi/review-post" target="_blank">Review</a> link, %2$s: The post title, %3$s: The number of months. */
176-
\esc_html__( '%1$s the post "%2$s" as it was last updated more than %3$s months ago.', 'progress-planner' ),
177-
'<a href="https://prpl.fyi/review-post" target="_blank">' . \esc_html__( 'Review', 'progress-planner' ) . '</a>',
178-
\esc_html( $post->post_title ), // @phpstan-ignore-line property.nonObject
179-
\esc_html( $months )
180-
) . '</p>';
181-
}
182-
183154
/**
184155
* Get the task URL.
185156
*
@@ -328,7 +299,6 @@ public function get_tasks_to_inject() {
328299
'target_post_type' => $task_data['target_post_type'],
329300
'date' => \gmdate( 'YW' ),
330301
'post_title' => $this->get_title_with_data( $task_data ),
331-
'description' => $this->get_description_with_data( $task_data ),
332302
'url' => $this->get_url_with_data( $task_data ),
333303
'url_target' => $this->get_url_target(),
334304
'dismissable' => $this->is_dismissable(),

classes/suggested-tasks/providers/class-core-update.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,6 @@ protected function get_title() {
8383
return \esc_html__( 'Perform all updates', 'progress-planner' );
8484
}
8585

86-
/**
87-
* Get the task description.
88-
*
89-
* @return string
90-
*/
91-
protected function get_description() {
92-
return \esc_html__( 'Regular updates improve security and performance.', 'progress-planner' );
93-
}
94-
9586
/**
9687
* Add the link to the Progress Planner Dashboard to the update complete actions.
9788
*

classes/suggested-tasks/providers/class-debug-display.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,6 @@ protected function get_title() {
4242
return \esc_html__( 'Disable public display of PHP errors', 'progress-planner' );
4343
}
4444

45-
/**
46-
* Get the task description.
47-
*
48-
* @param array $task_data Optional data to include in the task.
49-
* @return string
50-
*/
51-
protected function get_description( $task_data = [] ) {
52-
return \sprintf(
53-
// translators: %s is the name of the WP_DEBUG_DISPLAY constant.
54-
\esc_html__( '%s is enabled. This means that errors are shown to users. We recommend disabling it.', 'progress-planner' ),
55-
'<code>WP_DEBUG_DISPLAY</code>',
56-
);
57-
}
58-
5945
/**
6046
* Check if the task should be added.
6147
*

classes/suggested-tasks/providers/class-disable-comment-pagination.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,6 @@ protected function get_title() {
7070
return \esc_html__( 'Disable comment pagination', 'progress-planner' );
7171
}
7272

73-
/**
74-
* Get the task description.
75-
*
76-
* @return string
77-
*/
78-
protected function get_description() {
79-
return \sprintf(
80-
/* translators: %d is the number of comments per page.*/
81-
\esc_html__( 'When comment pagination is enabled, your site creates a new page for every %d comments. This is not helping your website in search engines, and can break up the ongoing conversation. That\'s why we recommend to disable comment pagination.', 'progress-planner' ),
82-
(int) \get_option( 'comments_per_page' ),
83-
);
84-
}
85-
8673
/**
8774
* Check if the task condition is satisfied.
8875
* (bool) true means that the task condition is satisfied, meaning that we don't need to add the task or task was completed.

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,26 +70,6 @@ protected function get_title() {
7070
return \esc_html__( 'Disable comments', 'progress-planner' );
7171
}
7272

73-
/**
74-
* Get the task description.
75-
*
76-
* @return string
77-
*/
78-
protected function get_description() {
79-
return \sprintf(
80-
\esc_html(
81-
// translators: %d is the number of approved comments.
82-
\_n(
83-
'There is %1$d comment. If you don\'t need comments on your site, consider disabling them.',
84-
'There are %1$d comments. If you don\'t need comments on your site, consider disabling them.',
85-
(int) \wp_count_comments()->approved,
86-
'progress-planner'
87-
)
88-
),
89-
(int) \wp_count_comments()->approved,
90-
);
91-
}
92-
9373
/**
9474
* Check if the task condition is satisfied.
9575
* (bool) true means that the task condition is satisfied, meaning that we don't need to add the task or task was completed.

classes/suggested-tasks/providers/class-fewer-tags.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,6 @@ protected function get_title() {
113113
return \esc_html__( 'Install Fewer Tags and clean up your tags', 'progress-planner' );
114114
}
115115

116-
/**
117-
* Get the description.
118-
*
119-
* @return string
120-
*/
121-
protected function get_description() {
122-
return \sprintf(
123-
// translators: %1$s is the number of tags, %2$s is the number of published posts.
124-
\esc_html__( 'We detected that you have %1$s tags and %2$s published posts. Consider installing the "Fewer Tags" plugin.', 'progress-planner' ),
125-
$this->post_tag_count_data_collector->collect(),
126-
$this->published_post_count_data_collector->collect(),
127-
);
128-
}
129-
130116
/**
131117
* Check if the task condition is satisfied.
132118
* (bool) true means that the task condition is satisfied, meaning that we don't need to add the task or task was completed.

classes/suggested-tasks/providers/class-permalink-structure.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,6 @@ protected function get_title() {
7878
return \esc_html__( 'Set permalink structure', 'progress-planner' );
7979
}
8080

81-
/**
82-
* Get the description.
83-
*
84-
* @return string
85-
*/
86-
protected function get_description() {
87-
return \esc_html__( 'On install, WordPress sets the permalink structure to a format that is not SEO-friendly. We recommend changing it.', 'progress-planner' );
88-
}
89-
9081
/**
9182
* Check if the task condition is satisfied.
9283
* (bool) true means that the task condition is satisfied, meaning that we don't need to add the task or task was completed.

classes/suggested-tasks/providers/class-php-version.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,6 @@ protected function get_title() {
4949
return \esc_html__( 'Update PHP version', 'progress-planner' );
5050
}
5151

52-
/**
53-
* Get the description.
54-
*
55-
* @param array $task_data Optional data to include in the task.
56-
* @return string
57-
*/
58-
protected function get_description( $task_data = [] ) {
59-
return \sprintf(
60-
/* translators: %1$s: php version, %2$s: minimum PHP version recommended. */
61-
\esc_html__( 'Your site is running on PHP version %1$s. We recommend updating to PHP version %2$s or higher.', 'progress-planner' ),
62-
\phpversion(),
63-
\esc_html( self::RECOMMENDED_PHP_VERSION )
64-
);
65-
}
66-
6752
/**
6853
* Check if the task should be added.
6954
*

classes/suggested-tasks/providers/class-remove-inactive-plugins.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,6 @@ protected function get_title() {
6060
return \esc_html__( 'Remove inactive plugins', 'progress-planner' );
6161
}
6262

63-
/**
64-
* Get the description.
65-
*
66-
* @return string
67-
*/
68-
protected function get_description() {
69-
return \esc_html__( 'You have inactive plugins. Consider removing any plugins that are not activated to free up resources, and improve security.', 'progress-planner' );
70-
}
71-
7263
/**
7364
* Check if the task should be added.
7465
*

classes/suggested-tasks/providers/class-remove-terms-without-posts.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -153,25 +153,6 @@ protected function get_title_with_data( $task_data = [] ) {
153153
: '';
154154
}
155155

156-
/**
157-
* Get the description.
158-
*
159-
* @param array $task_data The task data.
160-
*
161-
* @return string
162-
*/
163-
protected function get_description_with_data( $task_data = [] ) {
164-
$term = \get_term( $task_data['target_term_id'], $task_data['target_taxonomy'] );
165-
return ( $term && ! \is_wp_error( $term ) )
166-
? \sprintf(
167-
/* translators: %1$s: The term name, %2$s <a href="https://prpl.fyi/remove-empty-taxonomy" target="_blank">Read more</a> link */
168-
\esc_html__( 'The "%1$s" term has one or less posts associated with it, we recommend removing it. %2$s', 'progress-planner' ),
169-
$term->name,
170-
'<a href="https://prpl.fyi/remove-empty-taxonomy" target="_blank" data-prpl_accessibility_text="' . \esc_attr__( 'Read more about the removing the empty terms', 'progress-planner' ) . '">' . \esc_html__( 'Read more', 'progress-planner' ) . '</a>'
171-
)
172-
: '';
173-
}
174-
175156
/**
176157
* Get the URL.
177158
*

0 commit comments

Comments
 (0)