| @@ -77,14 +77,14 @@ | ||
| 77 | 77 | $plugin_all_slugs = array(); |
| 78 | 78 | // Checked Plugin option. |
| 79 | 79 | if ( $scan_settings->integrity_check && $scan_settings->check_plugins ) { |
| 80 | 80 | $plugin_cache = true; |
| 81 | - $arr = get_site_option( Plugin_Integrity::PLUGIN_SLUGS, false ); | |
| 82 | - if ( is_array( $arr ) && ! empty( $arr ) ) { | |
| 81 | + $arr = get_site_option( Plugin_Integrity::PLUGIN_SLUGS, array() ); | |
| 82 | + if ( is_array( $arr ) && array() !== $arr ) { | |
| 83 | 83 | $plugin_slugs_changes = $arr; |
| 84 | 84 | } |
| 85 | - $plugin_slugs = get_site_option( Plugin_Integrity::PLUGIN_PREMIUM_SLUGS, false ); | |
| 86 | - if ( is_array( $plugin_slugs ) && ! empty( $plugin_slugs ) ) { | |
| 85 | + $plugin_slugs = get_site_option( Plugin_Integrity::PLUGIN_PREMIUM_SLUGS, array() ); | |
| 86 | + if ( is_array( $plugin_slugs ) && array() !== $plugin_slugs ) { | |
| 87 | 87 | $plugin_pro_slugs = $plugin_slugs; |
| 88 | 88 | } |
| 89 | 89 | $actioned_plugins = get_site_option( Scan_Component::PLUGINS_ACTIONED ); |
| 90 | 90 | $plugin_all_slugs = Scan_Component::are_actioned_plugins( $actioned_plugins ) |
| @@ -131,9 +131,12 @@ | ||
| 131 | 131 | // Custom files/dirs. |
| 132 | 132 | if ( ! in_array( $base_slug, $rules['plugin_all_slugs'], true ) ) { |
| 133 | 133 | return true; |
| 134 | 134 | } |
| 135 | - if ( empty( $rules['plugin_slugs_changes'] ) && empty( $rules['plugin_pro_slugs'] ) ) { | |
| 135 | + if ( | |
| 136 | + ( ! isset( $rules['plugin_slugs_changes'] ) || array() === (array) $rules['plugin_slugs_changes'] ) | |
| 137 | + && ( ! isset( $rules['plugin_pro_slugs'] ) || array() === (array) $rules['plugin_pro_slugs'] ) | |
| 138 | + ) { | |
| 136 | 139 | // No modifications. |
| 137 | 140 | return false; |
| 138 | 141 | } |
| 139 | 142 | // Is it on premium plugins? |
| @@ -162,9 +165,9 @@ | ||
| 162 | 165 | * @return bool Returns true if the check is successful, false otherwise. |
| 163 | 166 | */ |
| 164 | 167 | public function suspicious_check( Malware_Quick_Scan $quick_scan, Malware_Deep_Scan $deep_scan ): bool { |
| 165 | 168 | $files = get_site_option( Gather_Fact::CACHE_CONTENT, array() ); |
| 166 | - if ( empty( $files ) ) { | |
| 169 | + if ( array() === $files ) { | |
| 167 | 170 | return true; |
| 168 | 171 | } |
| 169 | 172 | |
| 170 | 173 | set_time_limit( 0 ); |
| @@ -235,15 +238,9 @@ | ||
| 235 | 238 | if ( ! $files->valid() ) { |
| 236 | 239 | $last = Model_Scan::get_last(); |
| 237 | 240 | if ( is_object( $last ) ) { |
| 238 | 241 | $ignored_issues = $last->get_issues( Scan_Item::TYPE_SUSPICIOUS, Scan_Item::STATUS_IGNORE ); |
| 239 | - foreach ( $ignored_issues as $issue ) { | |
| 240 | - $this->scan->add_item( | |
| 241 | - Scan_Item::TYPE_SUSPICIOUS, | |
| 242 | - $issue->raw_data, | |
| 243 | - Scan_Item::STATUS_IGNORE | |
| 244 | - ); | |
| 245 | - } | |
| 242 | + $this->scan->carry_forward_ignored_issues( Scan_Item::TYPE_SUSPICIOUS, $ignored_issues, 'file' ); | |
| 246 | 243 | } |
| 247 | 244 | $model->task_checkpoint = ''; |
| 248 | 245 | } |
| 249 | 246 | |