PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.2.7
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.2.7
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | includes/Core/Importer/Import.php +6 -14 3.6.53.2.7 View file →
@@ -2,10 +2,8 @@
2 2
3 3 namespace Templately\Core\Importer;
4 4
5 5 use Exception;
6 -use Templately\Core\Importer\Exception\NonRetirableErrorException;
7 -use Templately\Core\Importer\Runners\AIContent;
8 6 use Templately\Core\Importer\Runners\Attachments;
9 7 use Templately\Core\Importer\Runners\BaseRunner;
10 8 use Templately\Core\Importer\Runners\Customizer;
11 9 use Templately\Core\Importer\Runners\Dependencies;
@@ -57,13 +55,10 @@
57 55 new Templates( $this->request_params ),
58 56 new GutenbergContent( $this->request_params ),
59 57 new ElementorContent( $this->request_params ),
60 58 new WPContent( $this->request_params ),
61 - // new AIContent( $this->request_params ),
62 59 new Finalizer( $this->request_params )
63 60 ];
64 -
65 - $this->runners = apply_filters( 'templately_import_runners', $this->runners, $this->request_params );
66 61 }
67 62
68 63 public function run( $callable = null ): array {
69 64 $data = $this->request_params;
@@ -78,14 +73,16 @@
78 73 $import = [];
79 74
80 75 try{
81 76 if ( $runner->should_run( $data, $imported_data ) ) {
82 - if (!$this->is_key_processed($runner->get_name(), 'runner_start')) {
77 + $progress = $this->get_progress();
78 + if(!in_array($runner->get_name(), $progress)){
83 79 $runner->log( 0 );
84 - $this->mark_key_processed($runner->get_name(), 'runner_start');
80 + $progress[] = $runner->get_name();
81 + $this->update_progress( $progress);
85 82 }
86 83 $import = $runner->import( $data, $imported_data );
87 - $imported_data = array_merge( $imported_data, $import );
84 + $imported_data = array_merge_recursive( $imported_data, $import );
88 85
89 86 if( $runner->get_name() != 'finalize' ) {
90 87 $runner->log( 100 );
91 88 } else {
@@ -93,13 +90,8 @@
93 90 }
94 91 }
95 92 }catch (Exception $e){
96 93 error_log($e->getMessage());
97 -
98 - // Re-throw NonRetirableErrorException to stop the import process
99 - if ($e instanceof NonRetirableErrorException) {
100 - throw $e;
101 - }
102 94 }
103 95
104 96 return $imported_data;
105 97 }, null, true);
@@ -109,5 +101,5 @@
109 101
110 102 public function get_runners() {
111 103 return $this->runners;
112 104 }
113 -}
105 +}