PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.3.2
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.3.2
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 +5 -11 3.6.63.3.2 View file →
@@ -2,9 +2,8 @@
2 2
3 3 namespace Templately\Core\Importer;
4 4
5 5 use Exception;
6 -use Templately\Core\Importer\Exception\NonRetirableErrorException;
7 6 use Templately\Core\Importer\Runners\AIContent;
8 7 use Templately\Core\Importer\Runners\Attachments;
9 8 use Templately\Core\Importer\Runners\BaseRunner;
10 9 use Templately\Core\Importer\Runners\Customizer;
@@ -60,10 +59,8 @@
60 59 new WPContent( $this->request_params ),
61 60 // new AIContent( $this->request_params ),
62 61 new Finalizer( $this->request_params )
63 62 ];
64 -
65 - $this->runners = apply_filters( 'templately_import_runners', $this->runners, $this->request_params );
66 63 }
67 64
68 65 public function run( $callable = null ): array {
69 66 $data = $this->request_params;
@@ -78,14 +75,16 @@
78 75 $import = [];
79 76
80 77 try{
81 78 if ( $runner->should_run( $data, $imported_data ) ) {
82 - if (!$this->is_key_processed($runner->get_name(), 'runner_start')) {
79 + $progress = $this->get_progress();
80 + if(!in_array($runner->get_name(), $progress)){
83 81 $runner->log( 0 );
84 - $this->mark_key_processed($runner->get_name(), 'runner_start');
82 + $progress[] = $runner->get_name();
83 + $this->update_progress( $progress);
85 84 }
86 85 $import = $runner->import( $data, $imported_data );
87 - $imported_data = array_merge( $imported_data, $import );
86 + $imported_data = array_merge_recursive( $imported_data, $import );
88 87
89 88 if( $runner->get_name() != 'finalize' ) {
90 89 $runner->log( 100 );
91 90 } else {
@@ -93,13 +92,8 @@
93 92 }
94 93 }
95 94 }catch (Exception $e){
96 95 error_log($e->getMessage());
97 -
98 - // Re-throw NonRetirableErrorException to stop the import process
99 - if ($e instanceof NonRetirableErrorException) {
100 - throw $e;
101 - }
102 96 }
103 97
104 98 return $imported_data;
105 99 }, null, true);