| @@ -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 ( array() !== $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. |