← All changes
|
app/modules/import-export/processes/import.php
+6
-9
4.1.0-dev2
→
3.30.1
View file →
| @@ -17,8 +17,9 @@ | ||
| 17 | 17 | use Elementor\App\Modules\ImportExport\Runners\Import\Taxonomies; |
| 18 | 18 | use Elementor\App\Modules\ImportExport\Runners\Import\Templates; |
| 19 | 19 | use Elementor\App\Modules\ImportExport\Runners\Import\Wp_Content; |
| 20 | 20 | use Elementor\App\Modules\ImportExport\Module; |
| 21 | +use Elementor\App\Modules\KitLibrary\Connect\Kit_Library as Kit_Library_Api; | |
| 21 | 22 | |
| 22 | 23 | class Import { |
| 23 | 24 | const MANIFEST_ERROR_KEY = 'manifest-error'; |
| 24 | 25 | |
| @@ -138,14 +139,13 @@ | ||
| 138 | 139 | */ |
| 139 | 140 | private $runners_import_metadata = []; |
| 140 | 141 | |
| 141 | 142 | /** |
| 142 | - * @param string $path session_id | zip_file_path | |
| 143 | - * @param array $settings Use to determine which content to import. | |
| 144 | - * (e.g: include, selected_plugins, selected_cpt, selected_override_conditions, etc.) | |
| 143 | + * @param string $path session_id | zip_file_path | |
| 144 | + * @param array $settings Use to determine which content to import. | |
| 145 | + * (e.g: include, selected_plugins, selected_cpt, selected_override_conditions, etc.) | |
| 145 | 146 | * @param array|null $old_instance An array of old instance parameters that will be used for creating new instance. |
| 146 | - * We are using it for quick creation of the instance when the import process is being split into chunks. | |
| 147 | - * | |
| 147 | + * We are using it for quick creation of the instance when the import process is being split into chunks. | |
| 148 | 148 | * @throws \Exception If the import session does not exist. |
| 149 | 149 | */ |
| 150 | 150 | public function __construct( string $path, array $settings = [], array $old_instance = null ) { |
| 151 | 151 | if ( ! empty( $old_instance ) ) { |
| @@ -559,9 +559,9 @@ | ||
| 559 | 559 | |
| 560 | 560 | /** |
| 561 | 561 | * Prevent saving elements on elementor post creation. |
| 562 | 562 | * |
| 563 | - * @param array $data | |
| 563 | + * @param array $data | |
| 564 | 564 | * @param Document $document |
| 565 | 565 | * |
| 566 | 566 | * @return array |
| 567 | 567 | */ |
| @@ -584,9 +584,8 @@ | ||
| 584 | 584 | * Extract the zip file. |
| 585 | 585 | * |
| 586 | 586 | * @param string $zip_path The path to the zip file. |
| 587 | 587 | * @return string The extracted directory path. |
| 588 | - * @throws \Error If import process fails, file validation errors occur, or data corruption is detected. | |
| 589 | 588 | */ |
| 590 | 589 | private function extract_zip( $zip_path ) { |
| 591 | 590 | $extraction_result = Plugin::$instance->uploads_manager->extract_and_validate_zip( $zip_path, [ 'json', 'xml' ] ); |
| 592 | 591 | |
| @@ -604,10 +603,8 @@ | ||
| 604 | 603 | /** |
| 605 | 604 | * Get the manifest file from the extracted directory and adapt it if needed. |
| 606 | 605 | * |
| 607 | 606 | * @return string The manifest file content. |
| 608 | - * | |
| 609 | - * @throws \Error If import validation fails or processing errors occur. | |
| 610 | 607 | */ |
| 611 | 608 | private function read_manifest_json() { |
| 612 | 609 | $manifest = Utils::read_json_file( $this->extracted_directory_path . 'manifest' ); |
| 613 | 610 | |