PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.1.9
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.1.9
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/Runners/ExtraContent.php +29 -7 3.0.43.1.9 View file →
@@ -36,11 +36,23 @@
36 36
37 37 public function import( $data, $imported_data ): array {
38 38 $extra_content = [];
39 39 $contents = $this->manifest['extra-content'];
40 + $progress = $this->origin->get_progress();
40 41
42 + if(empty($progress)){
43 + $this->log( 0 );
44 + $progress = ["__started__"];
45 + $this->origin->update_progress( $progress);
46 + }
47 +
41 48 if( ! empty( $contents ) ) {
42 49 foreach( $contents as $type => $content ) {
50 + // If the template has been processed, skip it
51 + if (in_array($type, $progress)) {
52 + continue;
53 + }
54 +
43 55 switch ( $type ) {
44 56 case 'form':
45 57 $import = $this->import_form( $content );
46 58 $extra_content['form'] = $import;
@@ -47,14 +59,23 @@
47 59 break;
48 60 case 'data':
49 61 break;
50 62 }
63 +
64 + $progress[] = $type;
65 + $this->origin->update_progress($progress, [ 'extra-content' => $extra_content ]);
66 +
67 + if( end( $contents ) !== $content){
68 + $this->sse_message( [
69 + 'type' => 'continue',
70 + 'action' => 'continue',
71 + 'results' => __METHOD__ . '::' . __LINE__,
72 + ] );
73 + exit;
74 + }
51 75 }
52 -
53 - // $imported_data = array_merge( $imported_data, [ 'extra-content' => $this->extra_content ] );
54 76 }
55 77
56 -
57 78 return [ 'extra-content' => $extra_content ];
58 79 }
59 80
60 81 private function import_form( $contents ): array {
@@ -77,10 +98,11 @@
77 98 }
78 99
79 100 foreach ( $form_list as $form ) {
80 101 try {
81 - if(isset(self::$imported_form[ $plugin_name ][ $form['form_id'] ])){
82 - $result[$json_id][ $plugin_name ][ $form['id'] ] = self::$imported_form[ $plugin_name ][ $form['form_id'] ];
102 + $form_id = isset( $form['identifier'] ) ? $form['settings'][$form['identifier']] : $form['settings']['form_list'];
103 + if(isset(self::$imported_form[ $plugin_name ][ $form_id ])){
104 + $result[$json_id][ $plugin_name ][ $form['id'] ] = self::$imported_form[ $plugin_name ][ $form_id ];
83 105 continue;
84 106 }
85 107
86 108 $file_path = $root_path . wp_unslash( $form['file_path'] );
@@ -86,10 +108,10 @@
86 108 $file_path = $root_path . wp_unslash( $form['file_path'] );
87 109 $import = new Form( $plugin_name, $file_path, $form );
88 110 $data = $import->run();
89 111
90 - self::$imported_form[ $plugin_name ][ $form['form_id'] ] = $data;
91 - $result[$json_id][ $plugin_name ][ $form['id'] ] = $data;
112 + self::$imported_form[ $plugin_name ][ $form_id ] = (string) $data;
113 + $result[$json_id][ $plugin_name ][ $form['id'] ] = (string) $data;
92 114 } catch ( Exception $e ) {
93 115 continue;
94 116 }
95 117 }