PluginProbe ʕ •ᴥ•ʔ
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets / 4.1.1
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets v4.1.1
4.1.1 3.9.5 3.9.6 4.0.0 4.0.1 4.1.0 trunk 2.12 2.13 2.14 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9 3.7.0 3.7.1 3.7.2 3.7.3 3.7.3-beta-1.0 3.7.4 3.7.4-beta-1.0 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4
wp-all-import / views / admin / import / confirm.php
wp-all-import / views / admin / import Last commit date
options 3 days ago template 1 month ago confirm.php 1 month ago element.php 1 month ago error.php 1 month ago evaluate.php 1 month ago evaluate_variations.php 1 month ago filters.php 1 month ago full-preview-modal.php 1 month ago index.php 1 month ago options.php 1 month ago preview.php 1 month ago preview_images.php 1 month ago preview_prices.php 1 month ago preview_taxonomies.php 1 month ago process-complete.php 1 month ago process.php 1 month ago tag.php 1 month ago template.php 1 month ago warning.php 1 month ago
confirm.php
401 lines
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals ?>
2 <?php $is_new_import = ($isWizard or $import->imported + $import->skipped == $import->count or $import->imported + $import->skipped == 0 or $import->options['is_import_specified'] or $import->triggered); ?>
3 <?php $visible_sections = apply_filters('pmxi_visible_confirm_sections', array('data_to_import'), $post['custom_type']); ?>
4 <h2 class="wpallimport-wp-notices"></h2>
5
6 <div class="wpallimport-wrapper wpallimport-step-5">
7
8 <div class="wpallimport-wrapper">
9 <div class="wpallimport-header">
10 <div class="wpallimport-logo"></div>
11 <div class="wpallimport-title">
12 <h2><?php esc_html_e('Confirm & Run', 'wp-all-import'); ?></h2>
13 </div>
14 <?php echo wp_kses_post(apply_filters('wpallimport_links_block', ''));?>
15 </div>
16 <div class="clear"></div>
17 </div>
18 <?php
19 $is_valid_root_element = true;
20 $error_codes = $this->errors->get_error_codes();
21 if ( ! empty($error_codes) and is_array($error_codes) and in_array('root-element-validation', $error_codes))
22 {
23 $is_valid_root_element = false;
24 }
25 ?>
26 <div class="ajax-console">
27 <?php if ($this->errors->get_error_codes()): ?>
28 <?php $this->error() ?>
29 <?php endif ?>
30 <?php if ($this->warnings->get_error_codes()): ?>
31 <?php $this->warning() ?>
32 <?php endif ?>
33
34 <?php
35 wp_all_import_template_notifications( $post );
36 ?>
37 </div>
38
39 <div class="rad4 first-step-errors error-no-root-element" <?php if ($is_valid_root_element === false):?>style="display:block;"<?php endif; ?>>
40 <div class="wpallimport-notify-wrapper">
41 <div class="error-headers exclamation">
42 <h3><?php esc_html_e('There\'s a problem with your import file', 'wp-all-import');?></h3>
43 <h4><?php esc_html_e("It has changed and is not compatible with this import template.", "wp-all-import"); ?></h4>
44 </div>
45 </div>
46 <a class="button wpallimport-large-button wpallimport-notify-read-more" href="http://www.wpallimport.com/documentation/troubleshooting/problems-with-import-files/#invalid?utm_source=import-plugin-free&utm_medium=error&utm_campaign=docs" target="_blank"><?php esc_html_e('Read More', 'wp-all-import');?></a>
47 </div>
48
49 <?php $custom_type = get_post_type_object( PMXI_Plugin::$session->custom_type ); ?>
50
51 <div class="wpallimport-content-section" style="padding: 30px; overflow: hidden;">
52 <div class="wpallimport-ready-to-go">
53
54 <?php if ($is_new_import):?>
55 <h3><?php esc_html_e('Your file is all set up!', 'wp-all-import'); ?></h3>
56 <?php else: ?>
57 <h3><?php esc_html_e('This import did not finish successfully last time it was run.', 'wp-all-import'); ?></h3>
58 <?php endif; ?>
59
60 <?php if ($is_new_import):?>
61 <h4><?php esc_html_e('Check the settings below, then click the green button to run the import.', 'wp-all-import'); ?></h4>
62 <?php else: ?>
63 <h4><?php esc_html_e('You can attempt to continue where it left off.', 'wp-all-import'); ?></h4>
64 <?php endif; ?>
65
66 </div>
67 <?php if ($is_new_import):?>
68 <form class="confirm <?php echo ! $isWizard ? 'edit' : '' ?>" method="post" style="float:right;">
69 <?php wp_nonce_field('confirm', '_wpnonce_confirm') ?>
70 <input type="hidden" name="is_confirmed" value="1" />
71 <input type="submit" class="rad10" value="<?php esc_attr_e('Confirm & Run Import', 'wp-all-import') ?>" />
72 </form>
73 <?php else: ?>
74 <form class="confirm <?php echo ! $isWizard ? 'edit' : '' ?>" method="post" style="float: right;">
75 <?php wp_nonce_field('confirm', '_wpnonce_confirm') ?>
76 <input type="hidden" name="is_confirmed" value="1" />
77 <!--input type="hidden" name="is_continue" value="1" /-->
78 <div class="input wpallimport-is-continue">
79 <div class="input">
80 <input type="radio" name="is_continue" value="yes" checked="checked" id="is_continue_yes"/>
81 <label for="is_continue_yes"><?php esc_html_e('Continue from the last run', 'wp-all-import'); ?></label>
82 </div>
83 <div class="input">
84 <input type="radio" name="is_continue" value="no" id="is_continue_no"/>
85 <label for="is_continue_no"><?php esc_html_e('Run from the beginning', 'wp-all-import'); ?></label>
86 </div>
87 </div>
88 <input type="submit" class="rad10" value="<?php esc_attr_e('Continue Import', 'wp-all-import') ?>" style="margin-left: 0px; float: right;"/>
89 <!--div class="input" style="margin-top:20px;">
90 <a href="<?php echo esc_url(add_query_arg(array('id' => $import->id, 'action' => 'update', 'continue' => 'no'), $this->baseUrl)); ?>" id="entire_run"><?php esc_html_e('Run entire import from the beginning', 'wp-all-import'); ?></a>
91 </div-->
92 </form>
93 <?php endif; ?>
94 </div>
95
96 <div class="clear"></div>
97
98 <table class="wpallimport-layout confirm">
99 <tr>
100 <td class="left">
101
102 <?php if ( $is_new_import ):?>
103
104 <?php $max_execution_time = ini_get('max_execution_time');?>
105
106 <div class="wpallimport-section" style="margin-top: -20px;">
107 <div class="wpallimport-content-section">
108 <div class="wpallimport-collapsed-header" style="padding-left: 30px;">
109 <h3 style="color: #425e99;"><?php esc_html_e('Import Summary', 'wp-all-import'); ?> <?php if (!$isWizard):?><span style="color:#000;"><?php /* translators: 1: import ID, 2: import name */ printf(esc_html__(" - ID: %1\$s - %2\$s", 'wp-all-import'), intval($import->id), empty($import->friendly_name) ? esc_html($import->name) : esc_html($import->friendly_name));?></span><?php endif;?></h3>
110 </div>
111 <div class="wpallimport-collapsed-content" style="padding: 15px 25px 25px;">
112
113 <!-- Warnings -->
114 <?php if ($max_execution_time != -1): ?>
115 <?php /* translators: %s: max_execution_time in seconds */ ?>
116 <p><?php printf(esc_html__('Your max_execution_time is %s seconds', 'wp-all-import'), esc_html($max_execution_time)); ?></p>
117 <?php endif;?>
118
119 <!-- General -->
120 <?php
121 $import_type = (!empty($source['type'])) ? $source['type'] : $import['type'];
122 $path = $source['path'];
123 if ( in_array($import_type, array('upload', 'file'))){
124 $path = wp_all_import_get_absolute_path($source['path']);
125 }
126 if ( in_array($import_type, array('upload'))){
127 $path_parts = pathinfo($source['path']);
128 if ( ! empty($path_parts['dirname'])){
129 $path_all_parts = explode('/', $path_parts['dirname']);
130 $dirname = array_pop($path_all_parts);
131 if ( wp_all_import_isValidMd5($dirname)){
132 $path = str_replace($dirname, preg_replace('%^(.{3}).*(.{3})$%', '$1***$2', $dirname), str_replace('temp/', '', $path));
133 }
134 }
135 } else{
136 $path = str_replace("\\", '/', preg_replace('%^(\w+://[^:]+:)[^@]+@%', '$1*****@', $path));
137 }
138 if ( in_array($import_type, array('upload', 'file'))){ $path = preg_replace('%.*wp-content/%', 'wp-content/', $path); }
139 ?>
140 <?php /* translators: 1: file path, 2: human readable file size */ ?>
141 <p><?php echo wp_kses(sprintf(__('WP All Import will import the file <span style="color:#40acad;">%1$s</span>, which is <span style="color:#000; font-weight:bold;">%2$s</span>', 'wp-all-import'), esc_html($path), (isset($locfilePath)) ? esc_html(pmxi_human_filesize(filesize($locfilePath))) : esc_html__('undefined', 'wp-all-import')), array('span' => array('style' => array()))); ?></p>
142
143 <?php if ( strpos($xpath, '[') !== false){ ?>
144 <?php /* translators: %s: XPath expression */ ?>
145 <p><?php echo wp_kses(sprintf(__('WP All Import will process the records matching the XPath expression: <span style="color:#46ba69; font-weight:bold;">%s</span>', 'wp-all-import'), esc_html($xpath)), array('span' => array('style' => array()))); ?></p>
146 <?php } elseif ($post['delimiter'] and $isWizard ) { ?>
147 <?php /* translators: %s: number of rows */ ?>
148 <p><?php echo wp_kses(sprintf(__('WP All Import will process <span style="color:#46ba69; font-weight:bold;">%s</span> rows in your file', 'wp-all-import'), intval($count)), array('span' => array('style' => array()))); ?></p>
149 <?php } elseif ( $isWizard ) { ?>
150 <?php /* translators: 1: number of records, 2: root element name */ ?>
151 <p><?php echo wp_kses(sprintf(__('WP All Import will process all %1$s <span style="color:#46ba69; font-weight:bold;">&lt;%2$s&gt;</span> records in your file', 'wp-all-import'), intval($count), esc_html($source['root_element'])), array('span' => array('style' => array()))); ?></p>
152 <?php } ?>
153
154 <?php if ( $post['is_import_specified']): ?>
155 <?php /* translators: %s: comma separated list of record indexes */ ?>
156 <p><?php printf(esc_html__('WP All Import will process only specified records: %s', 'wp-all-import'), esc_html($post['import_specified'])); ?></p>
157 <?php endif;?>
158
159 <!-- Record Matching -->
160 <?php $custom_type = get_post_type_object( $post['custom_type'] ); ?>
161
162 <?php if ( "new" == $post['wizard_type']): ?>
163
164 <?php /* translators: %s: unique key value */ ?>
165 <p><?php echo wp_kses(sprintf(__('Your unique key is <span style="color:#000; font-weight:bold;">%s</span>', 'wp-all-import'), esc_html(wp_all_import_clear_xss($post['unique_key']))), array('span' => array('style' => array()))); ?></p>
166
167 <?php if ( ! $isWizard and !empty($custom_type)): ?>
168
169 <?php /* translators: 1: singular post type name, 2: import ID */ ?>
170 <p><?php printf(esc_html__('%1$ss previously imported by this import (ID: %2$s) with the same unique key will be updated.', 'wp-all-import'), esc_html($custom_type->labels->singular_name), esc_html($import->id)); ?></p>
171
172 <?php if ( $post['is_delete_missing'] and $post['delete_missing_action'] != 'keep' and ! $post['is_update_missing_cf'] and ! $post['is_change_post_status_of_removed']): ?>
173 <?php /* translators: 1: singular post type name, 2: import ID */ ?>
174 <p><?php printf(esc_html__('%1$ss previously imported by this import (ID: %2$s) that aren\'t present for this run of the import will be deleted.', 'wp-all-import'), esc_html($custom_type->labels->singular_name), esc_html($import->id)); ?></p>
175 <?php endif; ?>
176
177 <?php if ( $post['is_delete_missing'] and $post['delete_missing_action'] == 'keep' and $post['is_change_post_status_of_removed']): ?>
178 <?php /* translators: 1: singular post type name, 2: import ID */ ?>
179 <p><?php printf(esc_html__('%1$ss previously imported by this import (ID: %2$s) that aren\'t present for this run of the import will be set to draft.', 'wp-all-import'), esc_html($custom_type->labels->singular_name), esc_html($import->id)); ?></p>
180 <?php endif; ?>
181
182 <?php if ( $post['create_new_records']): ?>
183 <?php /* translators: 1: singular post type name, 2: import ID */ ?>
184 <p><?php printf(esc_html__('Records with unique keys that don\'t match any unique keys from %1$ss created by previous runs of this import (ID: %2$s) will be created.', 'wp-all-import'), esc_html($custom_type->labels->singular_name), esc_html($import->id)); ?></p>
185 <?php endif; ?>
186
187 <?php endif; ?>
188
189 <?php else: ?>
190
191 <?php
192 $criteria = '';
193 if ( 'pid' == $post['duplicate_indicator']) $criteria = 'has the same ID';
194 if ( 'title' == $post['duplicate_indicator']){
195 switch ($post['custom_type']){
196 case 'import_users':
197 case 'shop_customer':
198 $criteria = 'has the same Login';
199 break;
200 default:
201 $criteria = 'has the same Title';
202 break;
203 }
204 }
205 if ( 'content' == $post['duplicate_indicator']){
206 switch ($post['custom_type']){
207 case 'import_users':
208 case 'shop_customer':
209 $criteria = 'has the same Email';
210 break;
211 default:
212 $criteria = 'has the same Content';
213 break;
214 }
215 }
216 if ( 'custom field' == $post['duplicate_indicator']) $criteria = 'has Custom Field named "'. $post['custom_duplicate_name'] .'" with value = ' . $post['custom_duplicate_value'];
217 ?>
218 <?php /* translators: 1: singular post type name, 2: match criteria description */ ?>
219 <p><?php printf(esc_html__('WP All Import will merge data into existing %1$ss, matching the following criteria: %2$s', 'wp-all-import'), esc_html($custom_type->labels->singular_name), esc_html($criteria)); ?></p>
220
221 <?php if ( "no" == $post['is_keep_former_posts'] and "yes" == $post['update_all_data']){ ?>
222 <p><?php esc_html_e('Existing data will be updated with the data specified in this import.', 'wp-all-import'); ?></p>
223 <?php } elseif ("no" == $post['is_keep_former_posts'] and "no" == $post['update_all_data']){?>
224 <div>
225 <?php /* translators: %s: singular post type name */ ?>
226 <p><?php echo wp_kses(sprintf(__('Next %s data will be updated, <strong>all other data will be left alone</strong>', 'wp-all-import'), esc_html($custom_type->labels->singular_name)), array('strong' => array())); ?></p>
227 <?php if ( in_array('data_to_import', $visible_sections)):?>
228 <ul style="padding-left: 35px;">
229 <?php if ( $post['is_update_status']): ?>
230 <li> <?php esc_html_e('status', 'wp-all-import'); ?></li>
231 <?php endif; ?>
232 <?php if ( $post['is_update_title']): ?>
233 <li> <?php esc_html_e('title', 'wp-all-import'); ?></li>
234 <?php endif; ?>
235 <?php if ( $post['is_update_slug']): ?>
236 <li> <?php esc_html_e('slug', 'wp-all-import'); ?></li>
237 <?php endif; ?>
238 <?php if ( $post['is_update_content']): ?>
239 <li> <?php esc_html_e('content', 'wp-all-import'); ?></li>
240 <?php endif; ?>
241 <?php if ( $post['is_update_author']): ?>
242 <li> <?php esc_html_e('author', 'wp-all-import'); ?></li>
243 <?php endif; ?>
244 <?php if ( $post['is_update_comment_status']): ?>
245 <li> <?php esc_html_e('comment status', 'wp-all-import'); ?></li>
246 <?php endif; ?>
247 <?php if ( $post['is_update_post_format']): ?>
248 <li> <?php esc_html_e('post format', 'wp-all-import'); ?></li>
249 <?php endif; ?>
250 <?php if ( $post['is_update_excerpt']): ?>
251 <li> <?php esc_html_e('excerpt', 'wp-all-import'); ?></li>
252 <?php endif; ?>
253 <?php if ( $post['is_update_dates']): ?>
254 <li> <?php esc_html_e('dates', 'wp-all-import'); ?></li>
255 <?php endif; ?>
256 <?php if ( $post['is_update_menu_order']): ?>
257 <li> <?php esc_html_e('menu order', 'wp-all-import'); ?></li>
258 <?php endif; ?>
259 <?php if ( $post['is_update_parent']): ?>
260 <li> <?php esc_html_e('parent post', 'wp-all-import'); ?></li>
261 <?php endif; ?>
262 <?php if ( $post['is_update_post_type']): ?>
263 <li> <?php esc_html_e('post type', 'wp-all-import'); ?></li>
264 <?php endif; ?>
265 <?php if ( $post['is_update_attachments']): ?>
266 <li> <?php esc_html_e('attachments', 'wp-all-import'); ?></li>
267 <?php endif; ?>
268 <?php if ( ! empty($post['is_update_acf'])): ?>
269 <li>
270 <?php
271 switch($post['update_acf_logic']){
272 case 'full_update':
273 esc_html_e('all advanced custom fields', 'wp-all-import');
274 break;
275 case 'mapped':
276 esc_html_e('only ACF presented in import options', 'wp-all-import');
277 break;
278 case 'only':
279 /* translators: %s: comma separated list of ACF names */
280 printf(esc_html__('only these ACF : %s', 'wp-all-import'), esc_html($post['acf_only_list']));
281 break;
282 case 'all_except':
283 /* translators: %s: comma separated list of ACF names */
284 printf(esc_html__('all ACF except these: %s', 'wp-all-import'), esc_html($post['acf_except_list']));
285 break;
286 } ?>
287 </li>
288 <?php endif; ?>
289 <?php if ( ! empty($post['is_update_images'])): ?>
290 <li>
291 <?php
292 switch($post['update_images_logic']){
293 case 'full_update':
294 esc_html_e('old images will be updated with new', 'wp-all-import');
295 break;
296 case 'add_new':
297 esc_html_e('only new images will be added', 'wp-all-import');
298 break;
299 } ?>
300 </li>
301 <?php endif; ?>
302 <?php if ( ! empty($post['is_update_custom_fields'])): ?>
303 <li>
304 <?php
305 switch($post['update_custom_fields_logic']){
306 case 'full_update':
307 esc_html_e('all custom fields', 'wp-all-import');
308 break;
309 case 'only':
310 /* translators: %s: comma separated list of custom field names */
311 printf(esc_html__('only these custom fields : %s', 'wp-all-import'), esc_html($post['custom_fields_only_list']));
312 break;
313 case 'all_except':
314 /* translators: %s: comma separated list of custom field names */
315 printf(esc_html__('all custom fields except these: %s', 'wp-all-import'), esc_html($post['custom_fields_except_list']));
316 break;
317 } ?>
318 </li>
319 <?php endif; ?>
320 <?php if ( ! empty($post['is_update_categories'])): ?>
321 <li>
322 <?php
323 switch($post['update_categories_logic']){
324 case 'full_update':
325 esc_html_e('remove existing taxonomies, add new taxonomies', 'wp-all-import');
326 break;
327 case 'add_new':
328 esc_html_e('only add new', 'wp-all-import');
329 break;
330 case 'only':
331 /* translators: %s: comma separated list of taxonomy names */
332 printf(esc_html__('update only these taxonomies: %s , leave the rest alone', 'wp-all-import'), esc_html($post['taxonomies_only_list']));
333 break;
334 case 'all_except':
335 /* translators: %s: comma separated list of taxonomy names */
336 printf(esc_html__('leave these taxonomies: %s alone, update all others', 'wp-all-import'), esc_html($post['taxonomies_except_list']));
337 break;
338 }
339 if(!empty($post['do_not_create_terms']))
340 esc_html_e(' - no new terms will be created', 'wp-all-import');
341 ?>
342 </li>
343 <?php endif; ?>
344 </ul>
345 <?php endif; ?>
346 <?php do_action('pmxi_confirm_data_to_import', $isWizard, $post);?>
347 </div>
348 <?php } ?>
349 <?php if ( $post['create_new_records']): ?>
350 <?php /* translators: %s: singular post type name */ ?>
351 <p><?php printf(esc_html__('New %ss will be created from records that don\'t match the above criteria.', 'wp-all-import'), esc_html($custom_type->labels->singular_name)); ?></p>
352 <?php endif; ?>
353 <?php endif; ?>
354
355 <!-- Import Performance -->
356 <?php if ( "default" == $post['import_processing']): ?>
357 <p><?php esc_html_e('High-Speed, Small File Processing enabled. Your import will fail if it takes longer than your server\'s max_execution_time.', 'wp-all-import'); ?></p>
358 <?php else: ?>
359 <?php /* translators: 1: records per request, 2: records per request */ ?>
360 <p><?php printf(esc_html__('Piece By Piece Processing enabled. %1$s records will be processed each iteration. If it takes longer than your server\'s max_execution_time to process %2$s records, your import will fail.', 'wp-all-import'), esc_html($post['records_per_request']), esc_html($post['records_per_request'])); ?></p>
361 <?php endif; ?>
362
363 <?php if ($post['chuncking'] and "default" != $post['import_processing']):?>
364 <?php /* translators: %s: chunk size (number of records) */ ?>
365 <p><?php printf(esc_html__('Your file will be split into %s records chunks before processing.', 'wp-all-import'), esc_html(PMXI_Plugin::getInstance()->getOption('large_feed_limit'))); ?></p>
366 <?php endif; ?>
367
368 <?php if ($post['is_fast_mode']):?>
369 <p><?php esc_html_e('do_action calls will be disabled in wp_insert_post and wp_insert_attachment during the import.', 'wp-all-import'); ?></p>
370 <?php endif; ?>
371
372 </div>
373 </div>
374 </div>
375
376 <?php endif; ?>
377
378 </td>
379 </tr>
380 </table>
381 <?php if ($is_new_import):?>
382 <form id="wpai-submit-confirm-form" class="confirm <?php echo ! $isWizard ? 'edit' : '' ?>" method="post">
383 <?php wp_nonce_field('confirm', '_wpnonce_confirm') ?>
384 <input type="hidden" name="is_confirmed" value="1" />
385 <input type="submit" class="rad10" value="<?php esc_attr_e('Confirm & Run Import', 'wp-all-import') ?>" />
386 <p>
387 <?php if ($isWizard): ?>
388 <a href="<?php echo esc_url(apply_filters('pmxi_options_back_link', add_query_arg('action', 'options', $this->baseUrl), $isWizard)); ?>"><?php esc_html_e('or go back to Step 4', 'wp-all-import') ?></a>
389 <?php else:?>
390 <a href="<?php echo esc_url(apply_filters('pmxi_options_back_link', remove_query_arg('id', remove_query_arg('action', $this->baseUrl)), $isWizard)); ?>"><?php esc_html_e('or go back to Manage Imports', 'wp-all-import') ?></a>
391 <?php endif; ?>
392 </p>
393 </form>
394 <?php endif; ?>
395
396 <div class="wpallimport-display-columns wpallimport-margin-top-forty">
397 <?php echo wp_kses_post(apply_filters('wpallimport_footer', '')); ?>
398 </div>
399
400 </div>
401