Skip to content

Commit d0360a8

Browse files
committed
More tweaks
1 parent 47de47f commit d0360a8

12 files changed

Lines changed: 19 additions & 14 deletions

classes/class-base.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
* @method \Progress_Planner\Plugin_Installer get_plugin_installer()
4444
* @method \Progress_Planner\Admin\Widgets\Badge_Streak_Content get_admin__widgets__badge_streak_content()
4545
* @method \Progress_Planner\Admin\Widgets\Badge_Streak_Maintenance get_admin__widgets__badge_streak_maintenance()
46+
* @method \Progress_Planner\Admin\Enqueue get_admin__enqueue()
4647
*/
4748
class Base {
4849

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function should_add_task() {
204204
// Add the privacy policy page ID if it exists. Not 'publish' page will not be fetched by get_posts().
205205
$privacy_policy_page_id = \get_option( 'wp_page_for_privacy_policy' );
206206
if ( $privacy_policy_page_id ) {
207-
$important_page_ids[] = (int) $privacy_policy_page_id; // @phpstan-ignore-line cast.int
207+
$important_page_ids[] = (int) $privacy_policy_page_id;
208208
}
209209

210210
/**
@@ -506,7 +506,7 @@ protected function is_specific_task_completed( $task_id ) {
506506
$data = $task->get_data();
507507

508508
return $data && isset( $data['target_post_id'] )
509-
&& (int) \get_post_modified_time( 'U', false, (int) $data['target_post_id'] ) > \strtotime( '-12 months' ); // @phpstan-ignore-line cast.int
509+
&& (int) \get_post_modified_time( 'U', false, (int) $data['target_post_id'] ) > \strtotime( '-12 months' );
510510
}
511511

512512
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function print_popover_instructions() {
101101
\printf(
102102
/* translators: %d is the number of comments per page, %s is the "recommend to disable comment pagination" link */
103103
\esc_html__( 'When comment pagination is enabled, your site creates a new page for every %1$d comments. This is not helping your website in search engines, and can break up the ongoing conversation. That\'s why we %2$s.', 'progress-planner' ),
104-
(int) \get_option( 'comments_per_page' ), // @phpstan-ignore-line cast.int
104+
(int) \get_option( 'comments_per_page' ),
105105
'<a href="https://prpl.fyi/disable-comment-pagination" target="_blank">' . \esc_html__( 'recommend to disable comment pagination', 'progress-planner' ) . '</a>'
106106
);
107107
echo '</p>';

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected function get_title() {
9696
* @return string
9797
*/
9898
protected function get_description() {
99-
$hello_world_post_id = (int) $this->get_data_collector()->collect(); // @phpstan-ignore-line cast.int
99+
$hello_world_post_id = (int) $this->get_data_collector()->collect();
100100

101101
if ( 0 === $hello_world_post_id ) {
102102
return \esc_html__( 'On install, WordPress creates a "Hello World!" post. This post is not needed and should be deleted.', 'progress-planner' );

classes/suggested-tasks/providers/class-rename-uncategorized-category.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Rename_Uncategorized_Category extends Tasks {
5555
* @return string
5656
*/
5757
protected function get_url() {
58-
return \admin_url( 'term.php?taxonomy=category&tag_ID=' . (int) $this->get_data_collector()->collect() ); // @phpstan-ignore-line cast.int
58+
return \admin_url( 'term.php?taxonomy=category&tag_ID=' . (int) $this->get_data_collector()->collect() );
5959
}
6060

6161
/**
@@ -96,7 +96,7 @@ public function update_uncategorized_category_cache() {
9696
public function add_task_actions( $data = [], $actions = [] ) {
9797
$actions[] = [
9898
'priority' => 10,
99-
'html' => '<a class="prpl-tooltip-action-text" href="' . \admin_url( 'term.php?taxonomy=category&tag_ID=' . (int) $this->get_data_collector()->collect() ) . '" target="_self">' . \esc_html__( 'Rename', 'progress-planner' ) . '</a>', // @phpstan-ignore-line cast.int
99+
'html' => '<a class="prpl-tooltip-action-text" href="' . \admin_url( 'term.php?taxonomy=category&tag_ID=' . (int) $this->get_data_collector()->collect() ) . '" target="_self">' . \esc_html__( 'Rename', 'progress-planner' ) . '</a>',
100100
];
101101

102102
return $actions;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected function get_title() {
9595
* @return string
9696
*/
9797
protected function get_description() {
98-
$sample_page_id = (int) $this->get_data_collector()->collect(); // @phpstan-ignore-line cast.int
98+
$sample_page_id = (int) $this->get_data_collector()->collect();
9999

100100
if ( 0 === $sample_page_id ) {
101101
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' );

classes/suggested-tasks/providers/class-search-engine-visibility.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected function get_title() {
6969
* @return bool
7070
*/
7171
public function should_add_task() {
72-
return 0 === (int) \get_option( 'blog_public' ); // @phpstan-ignore-line cast.int
72+
return 0 === (int) \get_option( 'blog_public' );
7373
}
7474

7575
/**

classes/suggested-tasks/providers/class-select-timezone.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ public function print_popover_instructions() {
112112
* @return void
113113
*/
114114
public function print_popover_form_contents() {
115-
$current_offset = (float) \get_option( 'gmt_offset' ); // @phpstan-ignore-line cast.float
116-
$tzstring = (string) \get_option( 'timezone_string', '' ); // @phpstan-ignore-line cast.string
115+
$current_offset = (float) \get_option( 'gmt_offset' );
116+
$tzstring = (string) \get_option( 'timezone_string', '' );
117117
$was_tzstring_saved = '' !== $tzstring || 0 !== (int) $current_offset ? 'true' : 'false';
118118

119119
// Remove old Etc mappings. Fallback to gmt_offset.

classes/suggested-tasks/providers/integrations/yoast/class-archive-date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function should_add_task() {
8282
*/
8383
public function is_task_relevant() {
8484
// If the permalink structure includes %year%, %monthnum%, or %day%, we don't need to add the task.
85-
$permalink_structure = (string) \get_option( 'permalink_structure', '' ); // @phpstan-ignore-line cast.string
85+
$permalink_structure = (string) \get_option( 'permalink_structure', '' );
8686
return \strpos( $permalink_structure, '%year%' ) === false
8787
&& \strpos( $permalink_structure, '%monthnum%' ) === false
8888
&& \strpos( $permalink_structure, '%day%' ) === false;

classes/suggested-tasks/providers/traits/class-dismissable-task.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ protected function is_task_dismissed( $task_data ) {
165165
}
166166

167167
// If the task was dismissed more than the expiration period ago, we can show it again.
168-
if ( ( \time() - (int) $dismissal_data['timestamp'] ) > $this->get_expiration_period( $dismissal_data ) ) { // @phpstan-ignore-line cast.int
168+
if ( ( \time() - (int) $dismissal_data['timestamp'] ) > $this->get_expiration_period( $dismissal_data ) ) {
169169
unset( $dismissed_tasks[ $provider_key ][ $task_identifier ] );
170170
\progress_planner()->get_settings()->set( $this->dismissed_tasks_option, $dismissed_tasks );
171171
return false;
@@ -208,7 +208,7 @@ public function cleanup_old_dismissals() {
208208
if ( ! \is_array( $data ) ) {
209209
continue;
210210
}
211-
if ( ( \time() - (int) $data['timestamp'] ) > $this->get_expiration_period( $data ) ) { // @phpstan-ignore-line cast.int
211+
if ( ( \time() - (int) $data['timestamp'] ) > $this->get_expiration_period( $data ) ) {
212212
unset( $dismissed_tasks[ $provider_key ][ $identifier ] ); // @phpstan-ignore-line
213213
$has_changes = true;
214214
}

0 commit comments

Comments
 (0)