| @@ -209,9 +209,9 @@ | ||
| 209 | 209 | ); |
| 210 | 210 | |
| 211 | 211 | wp_enqueue_style( |
| 212 | 212 | $handle, |
| 213 | - WP_DEFENDER_BASE_URL . 'assets/css/showcase.css', | |
| 213 | + WP_DEFENDER_BASE_URL . 'assets/css/core-ui.css', | |
| 214 | 214 | array(), |
| 215 | 215 | DEFENDER_VERSION |
| 216 | 216 | ); |
| 217 | 217 | |
| @@ -417,9 +417,29 @@ | ||
| 417 | 417 | * |
| 418 | 418 | * @return bool Returns true if the importer data is valid, false otherwise. |
| 419 | 419 | */ |
| 420 | 420 | private function validate_importer( $importer ): bool { |
| 421 | - return $this->service->verify_config_data( $importer ); | |
| 421 | + if ( ! $this->service->verify_config_data( $importer ) || ! is_array( $importer['configs'] ) ) { | |
| 422 | + return false; | |
| 423 | + } | |
| 424 | + | |
| 425 | + $sample = $this->service->gather_data(); | |
| 426 | + foreach ( $importer['configs'] as $slug => $module ) { | |
| 427 | + // Ignore whole modules unavailable on this site, such as Pro-only modules in Free builds. | |
| 428 | + if ( ! isset( $sample[ $slug ] ) ) { | |
| 429 | + continue; | |
| 430 | + } | |
| 431 | + | |
| 432 | + if ( | |
| 433 | + ! is_array( $module ) | |
| 434 | + || ! is_array( $sample[ $slug ] ) | |
| 435 | + || array() !== array_diff_key( $module, $sample[ $slug ] ) | |
| 436 | + ) { | |
| 437 | + return false; | |
| 438 | + } | |
| 439 | + } | |
| 440 | + | |
| 441 | + return true; | |
| 422 | 442 | } |
| 423 | 443 | |
| 424 | 444 | /** |
| 425 | 445 | * Import config. |