| @@ -234,9 +234,11 @@ | ||
| 234 | 234 | ), |
| 235 | 235 | 'new_structure' => '3.4.0', |
| 236 | 236 | ); |
| 237 | 237 | |
| 238 | - $model->add_item( Scan_Item::TYPE_VULNERABILITY, $raw_data ); | |
| 238 | + if ( array() !== $raw_data['bugs'] ) { | |
| 239 | + $model->add_item( Scan_Item::TYPE_VULNERABILITY, $raw_data ); | |
| 240 | + } | |
| 239 | 241 | } |
| 240 | 242 | } elseif ( 'plugin' === $type || 'theme' === $type ) { |
| 241 | 243 | if ( ! isset( $info[ $base_slug ] ) || ! is_array( $info[ $base_slug ] ) ) { |
| 242 | 244 | continue; |
| @@ -242,16 +244,14 @@ | ||
| 242 | 244 | continue; |
| 243 | 245 | } |
| 244 | 246 | |
| 245 | 247 | if ( isset( $bugs['confirmed'] ) && ( is_array( $bugs['confirmed'] ) || $bugs['confirmed'] instanceof Countable ? count( $bugs['confirmed'] ) : 0 ) ) { |
| 248 | + // Default conditions for wp.org and Pro plugins. | |
| 246 | 249 | $wp_org_plugin_details = array( |
| 247 | 250 | 'is_existed' => false, |
| 248 | 251 | 'last_version' => '0', |
| 249 | 252 | ); |
| 250 | - if ( 'plugin' === $type ) { | |
| 251 | - if ( ! $this->is_likely_wporg_slug( $base_slug ) ) { | |
| 252 | - continue; | |
| 253 | - } | |
| 253 | + if ( 'plugin' === $type && $this->is_likely_wporg_slug( $base_slug ) ) { | |
| 254 | 254 | // Additional conditions for wp.org plugin. |
| 255 | 255 | $results = $this->handle_wp_org_response_by( $base_slug ); |
| 256 | 256 | if ( $results['success'] && isset( $results['body']['version'] ) ) { |
| 257 | 257 | $wp_org_plugin_details = array( |
| @@ -292,9 +292,11 @@ | ||
| 292 | 292 | 'cvss_score' => $bug['cvss']['score'] ?? '', |
| 293 | 293 | ); |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | - $model->add_item( Scan_Item::TYPE_VULNERABILITY, $raw_data ); | |
| 296 | + if ( array() !== $raw_data['bugs'] ) { | |
| 297 | + $model->add_item( Scan_Item::TYPE_VULNERABILITY, $raw_data ); | |
| 298 | + } | |
| 297 | 299 | } |
| 298 | 300 | } |
| 299 | 301 | } |
| 300 | 302 | } |