PluginProbe
Elementor Website Builder – more than just a page builder / 3.30.1
Elementor Website Builder – more than just a page builder v3.30.1
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | app/modules/import-export/processes/import.php +6 -25 4.3.0-beta3 → 3.30.1 View file →
@@ -7,10 +7,8 @@
7 7 use Elementor\App\Modules\ImportExport\Compatibility\Kit_Library;
8 8 use Elementor\App\Modules\ImportExport\Utils;
9 9 use Elementor\Core\Base\Document;
10 10 use Elementor\Core\Kits\Documents\Kit;
11 -use Elementor\Modules\AtomicWidgets\Utils\Atomic_Prop_Remap;
12 -use Elementor\Modules\Components\Module as Components_Module;
13 11 use Elementor\Plugin;
14 12
15 13 use Elementor\App\Modules\ImportExport\Runners\Import\Elementor_Content;
16 14 use Elementor\App\Modules\ImportExport\Runners\Import\Import_Runner_Base;
@@ -19,8 +17,9 @@
19 17 use Elementor\App\Modules\ImportExport\Runners\Import\Taxonomies;
20 18 use Elementor\App\Modules\ImportExport\Runners\Import\Templates;
21 19 use Elementor\App\Modules\ImportExport\Runners\Import\Wp_Content;
22 20 use Elementor\App\Modules\ImportExport\Module;
21 +use Elementor\App\Modules\KitLibrary\Connect\Kit_Library as Kit_Library_Api;
23 22
24 23 class Import {
25 24 const MANIFEST_ERROR_KEY = 'manifest-error';
26 25
@@ -140,14 +139,13 @@
140 139 */
141 140 private $runners_import_metadata = [];
142 141
143 142 /**
144 - * @param string $path session_id | zip_file_path
145 - * @param array $settings Use to determine which content to import.
146 - * (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.)
147 146 * @param array|null $old_instance An array of old instance parameters that will be used for creating new instance.
148 - * We are using it for quick creation of the instance when the import process is being split into chunks.
149 - *
147 + * We are using it for quick creation of the instance when the import process is being split into chunks.
150 148 * @throws \Exception If the import session does not exist.
151 149 */
152 150 public function __construct( string $path, array $settings = [], array $old_instance = null ) {
153 151 if ( ! empty( $old_instance ) ) {
@@ -561,9 +559,9 @@
561 559
562 560 /**
563 561 * Prevent saving elements on elementor post creation.
564 562 *
565 - * @param array $data
563 + * @param array $data
566 564 * @param Document $document
567 565 *
568 566 * @return array
569 567 */
@@ -586,9 +584,8 @@
586 584 * Extract the zip file.
587 585 *
588 586 * @param string $zip_path The path to the zip file.
589 587 * @return string The extracted directory path.
590 - * @throws \Error If import process fails, file validation errors occur, or data corruption is detected.
591 588 */
592 589 private function extract_zip( $zip_path ) {
593 590 $extraction_result = Plugin::$instance->uploads_manager->extract_and_validate_zip( $zip_path, [ 'json', 'xml' ] );
594 591
@@ -606,10 +603,8 @@
606 603 /**
607 604 * Get the manifest file from the extracted directory and adapt it if needed.
608 605 *
609 606 * @return string The manifest file content.
610 - *
611 - * @throws \Error If import validation fails or processing errors occur.
612 607 */
613 608 private function read_manifest_json() {
614 609 $manifest = Utils::read_json_file( $this->extracted_directory_path . 'manifest' );
615 610
@@ -741,11 +736,8 @@
741 736 foreach ( $this->documents_data as $new_id => $data ) {
742 737 $document = Plugin::$instance->documents->get( $new_id );
743 738
744 739 if ( isset( $data['elements'] ) ) {
745 - $data['elements'] = Components_Module::prepare_imported_elements( $data['elements'], $imported_data_replacements['post_ids'] ?? [] );
746 - $data['elements'] = Atomic_Prop_Remap::apply( $data['elements'], $imported_data_replacements );
747 - $this->merge_atomic_prop_remap_warnings( Atomic_Prop_Remap::consume_warnings() );
748 740 $data['elements'] = $document->on_import_update_dynamic_content( $data['elements'], $imported_data_replacements );
749 741 }
750 742
751 743 if ( isset( $data['settings'] ) ) {
@@ -759,19 +751,8 @@
759 751 }
760 752
761 753 $document->save( $data );
762 754 }
763 - }
764 -
765 - private function merge_atomic_prop_remap_warnings( array $warnings ): void {
766 - if ( empty( $warnings ) ) {
767 - return;
768 - }
769 -
770 - $existing = $this->runners_import_metadata['atomic_prop_remap']['warnings'] ?? [];
771 - $this->runners_import_metadata['atomic_prop_remap'] = [
772 - 'warnings' => array_merge( $existing, $warnings ),
773 - ];
774 755 }
775 756
776 757 private function update_instance_data_in_import_session_option() {
777 758 $import_sessions = Utils::get_import_sessions();