| @@ -52,9 +52,10 @@ | ||
| 52 | 52 | * @return string |
| 53 | 53 | */ |
| 54 | 54 | public static function get_outdated_period(): string { |
| 55 | 55 | // Filter to override outdated threshold period. |
| 56 | - $period = (string) apply_filters( 'wpdef_scan_outdated_period', self::OUTDATED_PERIOD ); | |
| 56 | + $period = apply_filters( 'wpdef_scan_outdated_period', self::OUTDATED_PERIOD ); | |
| 57 | + $period = is_string( $period ) ? $period : (string) $period; | |
| 57 | 58 | // If time period is invalid, use the default one. |
| 58 | 59 | return strtotime( '- ' . $period ) ? $period : self::OUTDATED_PERIOD; |
| 59 | 60 | } |
| 60 | 61 | |
| @@ -102,13 +103,9 @@ | ||
| 102 | 103 | * |
| 103 | 104 | * @param array $ignored_issues The array of ignored issues to add. |
| 104 | 105 | */ |
| 105 | 106 | private function add_ignored_issues( array $ignored_issues ) { |
| 106 | - if ( ! empty( $ignored_issues ) ) { | |
| 107 | - foreach ( $ignored_issues as $issue ) { | |
| 108 | - $this->scan->add_item( $issue->type, $issue->raw_data, Scan_Item::STATUS_IGNORE ); | |
| 109 | - } | |
| 110 | - } | |
| 107 | + $this->scan->carry_forward_ignored_issues( Scan::get_abandoned_types(), $ignored_issues, 'slug' ); | |
| 111 | 108 | } |
| 112 | 109 | |
| 113 | 110 | /** |
| 114 | 111 | * Handle the error by different actions, e.g. logging. |
| @@ -216,9 +213,9 @@ | ||
| 216 | 213 | * @return bool |
| 217 | 214 | */ |
| 218 | 215 | public function check_abandoned_plugin_by( string $slug ): bool { |
| 219 | 216 | // Check if the plugin is not from wp.org. |
| 220 | - $premium_plugin_slugs = get_site_option( Plugin_Integrity::PLUGIN_PREMIUM_SLUGS, false ); | |
| 217 | + $premium_plugin_slugs = get_site_option( Plugin_Integrity::PLUGIN_PREMIUM_SLUGS, array() ); | |
| 221 | 218 | if ( ( is_array( $premium_plugin_slugs ) && in_array( $slug, $premium_plugin_slugs, true ) ) |
| 222 | 219 | || ! $this->is_likely_wporg_slug( $slug ) |
| 223 | 220 | ) { |
| 224 | 221 | return true; |