Import any XML or CSV File to WordPress - Version 3.5.7

Version Description

  • improvement: git rid if deprecated join query on manage imports screen
  • improvement: add is_update_post_format option
  • improvement: add wp_all_import_manual_matching filter
  • improvement: add wp_all_import_logger filter
  • bug fix: records were removed from pmxi_posts table when activating WPAI on multisite installation
  • bug fix: get rid of unused deprecated function add_contextual_help()
Download this release

Release Info

Developer soflyy
Plugin Icon 128x128 Import any XML or CSV File to WordPress
Version 3.5.7
Comparing to
See all releases

Code changes from version 3.5.6 to 3.5.7

actions/pmxi_before_xml_import.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
- function pmxi_pmxi_before_xml_import( $import_id )
3
- {
4
  delete_option('wp_all_import_taxonomies_hierarchy_' . $import_id);
5
 
6
  // Remove some costly unnecessary actions during import.
@@ -15,7 +14,7 @@ function pmxi_pmxi_before_xml_import( $import_id )
15
  if ($functions_hash !== $current_hash) {
16
  global $wpdb;
17
  $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'pmxi_hash WHERE import_id = ' . $import_id );
18
- update_option('_wp_all_import_functions_hash_' . $import_id, $functions_hash);
19
  }
20
  }
21
  }
1
  <?php
2
+ function pmxi_pmxi_before_xml_import( $import_id ) {
 
3
  delete_option('wp_all_import_taxonomies_hierarchy_' . $import_id);
4
 
5
  // Remove some costly unnecessary actions during import.
14
  if ($functions_hash !== $current_hash) {
15
  global $wpdb;
16
  $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'pmxi_hash WHERE import_id = ' . $import_id );
17
+ update_option('_wp_all_import_functions_hash_' . $import_id, $functions_hash, false);
18
  }
19
  }
20
  }
actions/wp_ajax_delete_import.php CHANGED
@@ -14,11 +14,7 @@ function pmxi_wp_ajax_delete_import(){
14
  $post = $input->post(array(
15
  'data' => '',
16
  'iteration' => 1
17
- ));
18
-
19
- // $get = $input->get(array(
20
- // 'iteration' => 1
21
- // ));
22
 
23
  $params = array();
24
  parse_str($post['data'], $params);
@@ -26,7 +22,7 @@ function pmxi_wp_ajax_delete_import(){
26
  $response = array(
27
  'result' => false,
28
  'msg' => ''
29
- );
30
 
31
  $get_import_id = $params['import_ids'][0];
32
 
@@ -51,40 +47,28 @@ function pmxi_wp_ajax_delete_import(){
51
  break;
52
  }
53
  $cpt_name = ( ! empty($custom_type)) ? strtolower($custom_type->label) : '';
54
- }
55
- else{
56
  $cpt_name = '';
57
  }
58
  }
59
 
60
- if ( $params['is_delete_import'] and ! $params['is_delete_posts'] )
61
- {
62
  $response['redirect'] = add_query_arg('pmxi_nt', urlencode(__('Import deleted', 'wp_all_import_plugin')), $params['base_url']);
63
- }
64
- elseif( ! $params['is_delete_import'] and $params['is_delete_posts'])
65
- {
66
  $response['redirect'] = add_query_arg('pmxi_nt', urlencode(sprintf(__('All associated %s deleted.', 'wp_all_import_plugin'), $cpt_name)), $params['base_url']);
67
- }
68
- elseif( $params['is_delete_import'] and $params['is_delete_posts'])
69
- {
70
  $response['redirect'] = add_query_arg('pmxi_nt', urlencode(sprintf(__('Import and all associated %s deleted.', 'wp_all_import_plugin'), $cpt_name)), $params['base_url']);
71
- }
72
- else
73
- {
74
  $response['redirect'] = add_query_arg('pmxi_nt', urlencode(__('Nothing to delete.', 'wp_all_import_plugin')), $params['base_url']);
75
  exit( json_encode( $response ));
76
  }
77
 
78
-
79
- if ( ! empty($params['import_ids']))
80
- {
81
  foreach ($params['import_ids'] as $key => $id) {
82
  $import = new PMXI_Import_Record();
83
  $import->getById($id);
84
- if ( ! $import->isEmpty() )
85
- {
86
- if ((int) $post['iteration'] === 1)
87
- {
88
  $import->set(array(
89
  'deleted' => 0
90
  ))->update();
14
  $post = $input->post(array(
15
  'data' => '',
16
  'iteration' => 1
17
+ ));
 
 
 
 
18
 
19
  $params = array();
20
  parse_str($post['data'], $params);
22
  $response = array(
23
  'result' => false,
24
  'msg' => ''
25
+ );
26
 
27
  $get_import_id = $params['import_ids'][0];
28
 
47
  break;
48
  }
49
  $cpt_name = ( ! empty($custom_type)) ? strtolower($custom_type->label) : '';
50
+ } else {
 
51
  $cpt_name = '';
52
  }
53
  }
54
 
55
+ if ( $params['is_delete_import'] and ! $params['is_delete_posts'] ) {
 
56
  $response['redirect'] = add_query_arg('pmxi_nt', urlencode(__('Import deleted', 'wp_all_import_plugin')), $params['base_url']);
57
+ } elseif( ! $params['is_delete_import'] and $params['is_delete_posts']) {
 
 
58
  $response['redirect'] = add_query_arg('pmxi_nt', urlencode(sprintf(__('All associated %s deleted.', 'wp_all_import_plugin'), $cpt_name)), $params['base_url']);
59
+ } elseif( $params['is_delete_import'] and $params['is_delete_posts']) {
 
 
60
  $response['redirect'] = add_query_arg('pmxi_nt', urlencode(sprintf(__('Import and all associated %s deleted.', 'wp_all_import_plugin'), $cpt_name)), $params['base_url']);
61
+ } else {
 
 
62
  $response['redirect'] = add_query_arg('pmxi_nt', urlencode(__('Nothing to delete.', 'wp_all_import_plugin')), $params['base_url']);
63
  exit( json_encode( $response ));
64
  }
65
 
66
+ if ( ! empty($params['import_ids'])) {
 
 
67
  foreach ($params['import_ids'] as $key => $id) {
68
  $import = new PMXI_Import_Record();
69
  $import->getById($id);
70
+ if ( ! $import->isEmpty() ) {
71
+ if ((int) $post['iteration'] === 1) {
 
 
72
  $import->set(array(
73
  'deleted' => 0
74
  ))->update();
actions/wp_ajax_dismiss_notifications.php CHANGED
@@ -10,7 +10,7 @@ function pmxi_wp_ajax_dismiss_notifications(){
10
  }
11
 
12
  if (isset($_POST['addon']) ) {
13
- update_option($_POST['addon'] . '_notice_ignore', 'true');
14
  }
15
  exit( json_encode( array('result' => true)));
16
  }
10
  }
11
 
12
  if (isset($_POST['addon']) ) {
13
+ update_option($_POST['addon'] . '_notice_ignore', 'true', false);
14
  }
15
  exit( json_encode( array('result' => true)));
16
  }
actions/wp_ajax_test_images.php CHANGED
@@ -133,7 +133,7 @@ function pmxi_wp_ajax_test_images(){
133
 
134
  if ( (is_wp_error($request) or $request === false) and ! @file_put_contents($image_filepath, @file_get_contents($img, false, $get_ctx))) {
135
  $failed_msgs[] = (is_wp_error($request)) ? $request->get_error_message() : sprintf(__('File `%s` cannot be saved locally', 'wp_all_import_plugin'), $img);
136
- } elseif( ! ($image_info = apply_filters('pmxi_getimagesize', @getimagesize($image_filepath), $image_filepath)) or ! in_array($image_info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP))) {
137
  $failed_msgs[] = sprintf(__('File `%s` is not a valid image.', 'wp_all_import_plugin'), $img);
138
  } else {
139
  $success_images++;
133
 
134
  if ( (is_wp_error($request) or $request === false) and ! @file_put_contents($image_filepath, @file_get_contents($img, false, $get_ctx))) {
135
  $failed_msgs[] = (is_wp_error($request)) ? $request->get_error_message() : sprintf(__('File `%s` cannot be saved locally', 'wp_all_import_plugin'), $img);
136
+ } elseif( ! ($image_info = apply_filters('pmxi_getimagesize', @getimagesize($image_filepath), $image_filepath)) or ! in_array($image_info[2], wp_all_import_supported_image_types())) {
137
  $failed_msgs[] = sprintf(__('File `%s` is not a valid image.', 'wp_all_import_plugin'), $img);
138
  } else {
139
  $success_images++;
classes/api.php CHANGED
@@ -478,7 +478,7 @@ class PMXI_API
478
  $logger and call_user_func($logger, __('- found base64_encoded image', 'wp_all_import_plugin'));
479
  $image_filepath = $targetDir . '/' . $image_filename;
480
  imagejpeg($img, $image_filepath);
481
- if ( ! ($image_info = apply_filters('pmxi_getimagesize', @getimagesize($image_filepath), $image_filepath)) or ! in_array($image_info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP))) {
482
  $logger and call_user_func($logger, sprintf(__('- <b>WARNING</b>: File %s is not a valid image and cannot be set as featured one', 'wp_all_import_plugin'), $image_filepath));
483
  } else {
484
  $result = true;
@@ -514,7 +514,7 @@ class PMXI_API
514
  }
515
  // Validate import images.
516
  elseif ($file_type == 'images') {
517
- if ( preg_match('%\W(svg)$%i', wp_all_import_basename($image_filepath)) or $image_info = apply_filters('pmxi_getimagesize', @getimagesize($image_filepath), $image_filepath) and in_array($image_info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP))) {
518
  $logger and call_user_func($logger, sprintf(__('- Image `%s` has been successfully found', 'wp_all_import_plugin'), $wpai_image_path));
519
  $result = true;
520
  } else {
478
  $logger and call_user_func($logger, __('- found base64_encoded image', 'wp_all_import_plugin'));
479
  $image_filepath = $targetDir . '/' . $image_filename;
480
  imagejpeg($img, $image_filepath);
481
+ if ( ! ($image_info = apply_filters('pmxi_getimagesize', @getimagesize($image_filepath), $image_filepath)) or ! in_array($image_info[2], wp_all_import_supported_image_types())) {
482
  $logger and call_user_func($logger, sprintf(__('- <b>WARNING</b>: File %s is not a valid image and cannot be set as featured one', 'wp_all_import_plugin'), $image_filepath));
483
  } else {
484
  $result = true;
514
  }
515
  // Validate import images.
516
  elseif ($file_type == 'images') {
517
+ if ( preg_match('%\W(svg)$%i', wp_all_import_basename($image_filepath)) or $image_info = apply_filters('pmxi_getimagesize', @getimagesize($image_filepath), $image_filepath) and in_array($image_info[2], wp_all_import_supported_image_types())) {
518
  $logger and call_user_func($logger, sprintf(__('- Image `%s` has been successfully found', 'wp_all_import_plugin'), $wpai_image_path));
519
  $result = true;
520
  } else {
classes/handler.php CHANGED
@@ -96,7 +96,7 @@ class PMXI_Handler extends PMXI_Session {
96
  add_option( $session_option, $this->_data, '', 'no' );
97
  add_option( $session_expiry_option, $this->_session_expiration, '', 'no' );
98
  } else {
99
- update_option( $session_option, $this->_data );
100
  }
101
  }
102
  }
@@ -120,7 +120,7 @@ class PMXI_Handler extends PMXI_Session {
120
  $parser_type = get_option('wpai_parser_type_0');
121
 
122
  if ( ! empty($parser_type) ){
123
- update_option('wpai_parser_type_' . $import_id, $parser_type);
124
  delete_option('wpai_parser_type_0');
125
  }
126
  }
96
  add_option( $session_option, $this->_data, '', 'no' );
97
  add_option( $session_expiry_option, $this->_session_expiration, '', 'no' );
98
  } else {
99
+ update_option( $session_option, $this->_data, false );
100
  }
101
  }
102
  }
120
  $parser_type = get_option('wpai_parser_type_0');
121
 
122
  if ( ! empty($parser_type) ){
123
+ update_option('wpai_parser_type_' . $import_id, $parser_type, false);
124
  delete_option('wpai_parser_type_0');
125
  }
126
  }
controllers/admin/import.php CHANGED
@@ -64,7 +64,8 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
64
  }
65
 
66
  if ( ! PMXI_Plugin::$session->has_session()
67
- or ! empty( PMXI_Plugin::$session->update_previous ) and $update_previous->getById(PMXI_Plugin::$session->update_previous)->isEmpty()
 
68
  or ! @$dom->loadXML($xml)// FIX: libxml xpath doesn't handle default namespace properly, so remove it upon XML load
69
  ) {
70
  if ( ! PMXI_Plugin::is_ajax() ){
@@ -140,6 +141,8 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
140
  'taxonomy_type' => ''
141
  );
142
 
 
 
143
  if ($parent_import and ! $parent_import_record->getById($parent_import)->isEmpty()){
144
  $DefaultOptions['custom_type'] = $parent_import_record->options['custom_type'];
145
  }
@@ -463,7 +466,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
463
  $node_list = @ $xpath->query($post['xpath']); // make sure only element selection is allowed; prevent parsing warning to be displayed
464
 
465
  if (FALSE === $node_list) {
466
- $this->errors->add('form-validation', __('Your XPath is not valid.<br/><br/>Click "get default XPath" to get the default XPath.', 'wp_all_import_plugin'));
467
  } else {
468
  foreach ($node_list as $el) {
469
  if ( ! $el instanceof DOMElement) {
@@ -535,11 +538,10 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
535
  $post = $this->input->post(array('xpath' => '', 'show_element' => 1, 'root_element' => PMXI_Plugin::$session->source['root_element'], 'delimiter' => '', 'is_csv' => 0));
536
  $wp_uploads = wp_upload_dir();
537
 
538
- if ( ! check_ajax_referer( 'wp_all_import_secure', 'security', false )){
539
  $this->errors->add('form-validation', __('Security check', 'wp_all_import_plugin'));
540
- }
541
- elseif ('' == $post['xpath']) {
542
- $this->errors->add('form-validation', __('Your XPath is empty.<br/><br/>Please enter an XPath expression, or click "get default XPath" to get the default XPath.', 'wp_all_import_plugin'));
543
  } else {
544
 
545
  $source = PMXI_Plugin::$session->get('source');
@@ -573,7 +575,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
573
 
574
  if ($post['show_element'] == 1) {
575
  PMXI_Plugin::$session->set('count', $this->data['node_list_count'] = 0);
576
- }else{
577
  $this->data['node_list_count'] = PMXI_Plugin::$session->count;
578
  }
579
 
@@ -669,8 +671,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
669
  /**
670
  * Helper to evaluate xpath and return matching elements as direct paths for javascript side to highlight them
671
  */
672
- public function evaluate_variations()
673
- {
674
  if ( ! PMXI_Plugin::getInstance()->getAdminCurrentScreen()->is_ajax) { // call is only valid when send with ajax
675
  wp_redirect(add_query_arg('action', 'element', $this->baseUrl)); die();
676
  }
@@ -685,14 +686,14 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
685
  $this->data['tagno'] = max(intval($this->input->getpost('tagno', 1)), 0);
686
 
687
  if ('' == $post['xpath']) {
688
- $this->errors->add('form-validation', __('Your XPath is empty.<br/><br/>Please enter an XPath expression, or click "get default XPath" to get the default XPath.', 'wp_all_import_plugin'));
689
  } else {
690
  $post['xpath'] = '/' . ((!empty($this->data['update_previous']->root_element)) ? $this->data['update_previous']->root_element : PMXI_Plugin::$session->source['root_element']) .'/'. ltrim(trim(str_replace("[*]","",$post['xpath']),'{}'), '/');
691
  // in default mode
692
  $this->data['variation_elements'] = $elements = @ $xpath->query($post['xpath']); // prevent parsing warning to be displayed
693
  $this->data['variation_list_count'] = $elements->length;
694
  if (FALSE === $elements) {
695
- $this->errors->add('form-validation', __('Your XPath is not valid.<br/><br/>Click "get default XPath" to get the default XPath.', 'wp_all_import_plugin'));
696
  } elseif ( ! $elements->length) {
697
  $this->errors->add('form-validation', __('No matching variations found for XPath specified', 'wp_all_import_plugin'));
698
  } else {
@@ -823,12 +824,10 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
823
  }
824
  }
825
 
826
- if ( $is_json ){
827
-
828
  ob_start();
829
  $this->render();
830
  exit( json_encode(array('html' => ob_get_clean())) );
831
-
832
  }
833
  else $this->render();
834
  }
@@ -1489,17 +1488,14 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1489
  if ( ! $this->errors->get_error_codes()) {
1490
 
1491
  // Attributes fields logic
1492
- $post = apply_filters('pmxi_save_options', $post, $this->isWizard);
1493
 
1494
  // validate post excerpt
1495
  if ( ! empty($post['post_excerpt'])) $this->_validate_template($post['post_excerpt'], __('Excerpt', 'wp_all_import_plugin'));
1496
  // validate images
1497
- if ( $post['download_images'] == 'yes')
1498
- {
1499
  if ( ! empty($post['download_featured_image'])) $this->_validate_template($post['download_featured_image'], __('Images', 'wp_all_import_plugin'));
1500
- }
1501
- else
1502
- {
1503
  if ( ! empty($post['featured_image'])) $this->_validate_template($post['featured_image'], __('Images', 'wp_all_import_plugin'));
1504
  }
1505
  // validate images meta data
@@ -1665,15 +1661,14 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1665
  $this->render();
1666
  }
1667
 
1668
- protected function _validate_template($text, $field_title)
1669
- {
1670
  try {
1671
- if ($text != ''){
1672
- $scanner = new XmlImportTemplateScanner();
1673
- $tokens = $scanner->scan(new XmlImportStringReader($text));
1674
- $parser = new XmlImportTemplateParser($tokens);
1675
- $tree = $parser->parse();
1676
- }
1677
  } catch (XmlImportException $e) {
1678
  $this->errors->add('form-validation', sprintf(__('%s template is invalid: %s', 'wp_all_import_plugin'), $field_title, $e->getMessage()));
1679
  }
@@ -1682,8 +1677,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1682
  /**
1683
  * Step #4: Options
1684
  */
1685
- public function options()
1686
- {
1687
 
1688
  $default = PMXI_Plugin::get_default_import_options();
1689
 
@@ -1882,8 +1876,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1882
  // loop through the file until all lines are read
1883
  while ($xml = $file->read()) {
1884
 
1885
- if ( ! empty($xml) )
1886
- {
1887
  //PMXI_Import_Record::preprocessXml($xml);
1888
  $xml = "<?xml version=\"1.0\" encoding=\"". $this->data['import']['options']['encoding'] ."\"?>" . "\n" . $xml;
1889
 
@@ -1916,12 +1909,9 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1916
 
1917
  // loop through the file until all lines are read
1918
  while ($xml = $file->read()) {
1919
-
1920
- if ( ! empty($xml) )
1921
- {
1922
  //PMXI_Import_Record::preprocessXml($xml);
1923
- $xml = "<?xml version=\"1.0\" encoding=\"". $this->data['import']['options']['encoding'] ."\"?>" . "\n" . $xml;
1924
-
1925
  $dom = new DOMDocument('1.0', $this->data['import']['options']['encoding']);
1926
  $old = libxml_use_internal_errors(true);
1927
  $dom->loadXML($xml);
@@ -1929,16 +1919,12 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1929
  $xpath = new DOMXPath($dom);
1930
 
1931
  if (($elements = @$xpath->query($baseXpath)) and $elements->length) $loop += $elements->length;
1932
- unset($dom, $xpath, $elements);
1933
-
1934
  }
1935
  }
1936
- unset($file);
1937
-
1938
  if ($loop) $this->data['import']->set(array('count' => $loop))->save();
1939
-
1940
  }
1941
-
1942
  }
1943
 
1944
  $upload_result['root_element'] = $root_element;
@@ -2393,6 +2379,8 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2393
  $logger = function($m) {echo "<div class='progress-msg'>$m</div>\n"; if ( "" != strip_tags(wp_all_import_strip_tags_content($m))) { PMXI_Plugin::$session->log .= "<p>".strip_tags(wp_all_import_strip_tags_content($m))."</p>"; flush(); }};
2394
  }
2395
 
 
 
2396
  PMXI_Plugin::$session->set('start_time', (empty(PMXI_Plugin::$session->start_time)) ? time() : PMXI_Plugin::$session->start_time);
2397
 
2398
  $is_reset_cache = apply_filters('wp_all_import_reset_cache_before_import', false, $import->id);
@@ -2790,7 +2778,7 @@ COMPLETE;
2790
  } elseif (PMXI_Plugin::$session->options['custom_type'] == 'shop_customer') {
2791
  $uniqueKey = PMXI_Plugin::$session->options['pmsci_customer']['login'];
2792
  } else {
2793
- $uniqueKey = PMXI_Plugin::$session->options['title'];
2794
  }
2795
  }
2796
 
64
  }
65
 
66
  if ( ! PMXI_Plugin::$session->has_session()
67
+ or ! empty( PMXI_Plugin::$session->update_previous ) and $update_previous->getById(PMXI_Plugin::$session->update_previous)->isEmpty()
68
+ or empty($xml)
69
  or ! @$dom->loadXML($xml)// FIX: libxml xpath doesn't handle default namespace properly, so remove it upon XML load
70
  ) {
71
  if ( ! PMXI_Plugin::is_ajax() ){
141
  'taxonomy_type' => ''
142
  );
143
 
144
+ $DefaultOptions = apply_filters('wp_all_import_default_options', $DefaultOptions);
145
+
146
  if ($parent_import and ! $parent_import_record->getById($parent_import)->isEmpty()){
147
  $DefaultOptions['custom_type'] = $parent_import_record->options['custom_type'];
148
  }
466
  $node_list = @ $xpath->query($post['xpath']); // make sure only element selection is allowed; prevent parsing warning to be displayed
467
 
468
  if (FALSE === $node_list) {
469
+ $this->errors->add('form-validation', __('Your XPath is not valid.', 'wp_all_import_plugin'));
470
  } else {
471
  foreach ($node_list as $el) {
472
  if ( ! $el instanceof DOMElement) {
538
  $post = $this->input->post(array('xpath' => '', 'show_element' => 1, 'root_element' => PMXI_Plugin::$session->source['root_element'], 'delimiter' => '', 'is_csv' => 0));
539
  $wp_uploads = wp_upload_dir();
540
 
541
+ if ( ! check_ajax_referer( 'wp_all_import_secure', 'security', false )) {
542
  $this->errors->add('form-validation', __('Security check', 'wp_all_import_plugin'));
543
+ } elseif ('' == $post['xpath']) {
544
+ $this->errors->add('form-validation', __('Your XPath is empty.<br/><br/>Please enter an XPath expression.', 'wp_all_import_plugin'));
 
545
  } else {
546
 
547
  $source = PMXI_Plugin::$session->get('source');
575
 
576
  if ($post['show_element'] == 1) {
577
  PMXI_Plugin::$session->set('count', $this->data['node_list_count'] = 0);
578
+ } else {
579
  $this->data['node_list_count'] = PMXI_Plugin::$session->count;
580
  }
581
 
671
  /**
672
  * Helper to evaluate xpath and return matching elements as direct paths for javascript side to highlight them
673
  */
674
+ public function evaluate_variations() {
 
675
  if ( ! PMXI_Plugin::getInstance()->getAdminCurrentScreen()->is_ajax) { // call is only valid when send with ajax
676
  wp_redirect(add_query_arg('action', 'element', $this->baseUrl)); die();
677
  }
686
  $this->data['tagno'] = max(intval($this->input->getpost('tagno', 1)), 0);
687
 
688
  if ('' == $post['xpath']) {
689
+ $this->errors->add('form-validation', __('Your XPath is empty.<br/><br/>Please enter an XPath expression.', 'wp_all_import_plugin'));
690
  } else {
691
  $post['xpath'] = '/' . ((!empty($this->data['update_previous']->root_element)) ? $this->data['update_previous']->root_element : PMXI_Plugin::$session->source['root_element']) .'/'. ltrim(trim(str_replace("[*]","",$post['xpath']),'{}'), '/');
692
  // in default mode
693
  $this->data['variation_elements'] = $elements = @ $xpath->query($post['xpath']); // prevent parsing warning to be displayed
694
  $this->data['variation_list_count'] = $elements->length;
695
  if (FALSE === $elements) {
696
+ $this->errors->add('form-validation', __('Your XPath is not valid.', 'wp_all_import_plugin'));
697
  } elseif ( ! $elements->length) {
698
  $this->errors->add('form-validation', __('No matching variations found for XPath specified', 'wp_all_import_plugin'));
699
  } else {
824
  }
825
  }
826
 
827
+ if ( $is_json ) {
 
828
  ob_start();
829
  $this->render();
830
  exit( json_encode(array('html' => ob_get_clean())) );
 
831
  }
832
  else $this->render();
833
  }
1488
  if ( ! $this->errors->get_error_codes()) {
1489
 
1490
  // Attributes fields logic
1491
+ $post = apply_filters('pmxi_save_options', $post);
1492
 
1493
  // validate post excerpt
1494
  if ( ! empty($post['post_excerpt'])) $this->_validate_template($post['post_excerpt'], __('Excerpt', 'wp_all_import_plugin'));
1495
  // validate images
1496
+ if ( $post['download_images'] == 'yes') {
 
1497
  if ( ! empty($post['download_featured_image'])) $this->_validate_template($post['download_featured_image'], __('Images', 'wp_all_import_plugin'));
1498
+ } else {
 
 
1499
  if ( ! empty($post['featured_image'])) $this->_validate_template($post['featured_image'], __('Images', 'wp_all_import_plugin'));
1500
  }
1501
  // validate images meta data
1661
  $this->render();
1662
  }
1663
 
1664
+ protected function _validate_template($text, $field_title) {
 
1665
  try {
1666
+ if ($text != ''){
1667
+ $scanner = new XmlImportTemplateScanner();
1668
+ $tokens = $scanner->scan(new XmlImportStringReader($text));
1669
+ $parser = new XmlImportTemplateParser($tokens);
1670
+ $parser->parse();
1671
+ }
1672
  } catch (XmlImportException $e) {
1673
  $this->errors->add('form-validation', sprintf(__('%s template is invalid: %s', 'wp_all_import_plugin'), $field_title, $e->getMessage()));
1674
  }
1677
  /**
1678
  * Step #4: Options
1679
  */
1680
+ public function options() {
 
1681
 
1682
  $default = PMXI_Plugin::get_default_import_options();
1683
 
1876
  // loop through the file until all lines are read
1877
  while ($xml = $file->read()) {
1878
 
1879
+ if ( ! empty($xml) ) {
 
1880
  //PMXI_Import_Record::preprocessXml($xml);
1881
  $xml = "<?xml version=\"1.0\" encoding=\"". $this->data['import']['options']['encoding'] ."\"?>" . "\n" . $xml;
1882
 
1909
 
1910
  // loop through the file until all lines are read
1911
  while ($xml = $file->read()) {
1912
+ if ( ! empty($xml) ) {
 
 
1913
  //PMXI_Import_Record::preprocessXml($xml);
1914
+ $xml = "<?xml version=\"1.0\" encoding=\"". $this->data['import']['options']['encoding'] ."\"?>" . "\n" . $xml;
 
1915
  $dom = new DOMDocument('1.0', $this->data['import']['options']['encoding']);
1916
  $old = libxml_use_internal_errors(true);
1917
  $dom->loadXML($xml);
1919
  $xpath = new DOMXPath($dom);
1920
 
1921
  if (($elements = @$xpath->query($baseXpath)) and $elements->length) $loop += $elements->length;
1922
+ unset($dom, $xpath, $elements);
 
1923
  }
1924
  }
1925
+ unset($file);
 
1926
  if ($loop) $this->data['import']->set(array('count' => $loop))->save();
 
1927
  }
 
1928
  }
1929
 
1930
  $upload_result['root_element'] = $root_element;
2379
  $logger = function($m) {echo "<div class='progress-msg'>$m</div>\n"; if ( "" != strip_tags(wp_all_import_strip_tags_content($m))) { PMXI_Plugin::$session->log .= "<p>".strip_tags(wp_all_import_strip_tags_content($m))."</p>"; flush(); }};
2380
  }
2381
 
2382
+ $logger = apply_filters('wp_all_import_logger', $logger);
2383
+
2384
  PMXI_Plugin::$session->set('start_time', (empty(PMXI_Plugin::$session->start_time)) ? time() : PMXI_Plugin::$session->start_time);
2385
 
2386
  $is_reset_cache = apply_filters('wp_all_import_reset_cache_before_import', false, $import->id);
2778
  } elseif (PMXI_Plugin::$session->options['custom_type'] == 'shop_customer') {
2779
  $uniqueKey = PMXI_Plugin::$session->options['pmsci_customer']['login'];
2780
  } else {
2781
+ $uniqueKey = PMXI_Plugin::$session->options['title'];
2782
  }
2783
  }
2784
 
controllers/admin/manage.php CHANGED
@@ -43,15 +43,13 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
43
  }
44
 
45
  $list = new PMXI_Import_List();
46
- $post = new PMXI_Post_Record();
47
  $by = array('parent_import_id' => 0);
48
  if ('' != $s) {
49
  $like = '%' . preg_replace('%\s+%', '%', preg_replace('/[%?]/', '\\\\$0', $s)) . '%';
50
  $by[] = array(array('name LIKE' => $like, 'type LIKE' => $like, 'path LIKE' => $like, 'friendly_name LIKE' => $like), 'OR');
51
  }
52
 
53
- $this->data['list'] = $list->join($post->getTable(), $list->getTable() . '.id = ' . $post->getTable() . '.import_id', 'LEFT')
54
- ->setColumns(
55
  $list->getTable() . '.*'
56
  )
57
  ->getBy($by, "$order_by $order", $pagenum, $perPage, $list->getTable() . '.id');
@@ -453,14 +451,13 @@ class PMXI_Admin_Manage extends PMXI_Controller_Admin {
453
  !$key and $filePath = $path;
454
  }
455
 
456
- if (empty($chunks))
457
- {
458
- if ($item->options['is_delete_missing'])
459
- {
460
  $chunks = 1;
461
- }
462
- else
463
- {
 
464
  $this->errors->add('root-element-validation', __('No matching elements found for Root element and XPath expression specified', 'wp_all_import_plugin'));
465
  }
466
  }
43
  }
44
 
45
  $list = new PMXI_Import_List();
 
46
  $by = array('parent_import_id' => 0);
47
  if ('' != $s) {
48
  $like = '%' . preg_replace('%\s+%', '%', preg_replace('/[%?]/', '\\\\$0', $s)) . '%';
49
  $by[] = array(array('name LIKE' => $like, 'type LIKE' => $like, 'path LIKE' => $like, 'friendly_name LIKE' => $like), 'OR');
50
  }
51
 
52
+ $this->data['list'] = $list->setColumns(
 
53
  $list->getTable() . '.*'
54
  )
55
  ->getBy($by, "$order_by $order", $pagenum, $perPage, $list->getTable() . '.id');
451
  !$key and $filePath = $path;
452
  }
453
 
454
+ if (empty($chunks)) {
455
+ if ($item->options['is_delete_missing']) {
 
 
456
  $chunks = 1;
457
+ } else {
458
+ $item->set(array(
459
+ 'registered_on' => date('Y-m-d H:i:s')
460
+ ))->update();
461
  $this->errors->add('root-element-validation', __('No matching elements found for Root element and XPath expression specified', 'wp_all_import_plugin'));
462
  }
463
  }
controllers/controller/admin.php CHANGED
@@ -137,29 +137,12 @@ abstract class PMXI_Controller_Admin extends PMXI_Controller {
137
  /**
138
  * @see Controller::render()
139
  */
140
- protected function render($viewPath = NULL)
141
- {
142
  // assume template file name depending on calling function
143
  if (is_null($viewPath)) {
144
  $trace = debug_backtrace();
145
  $viewPath = str_replace('_', '/', preg_replace('%^' . preg_quote(PMXI_Plugin::PREFIX, '%') . '%', '', strtolower($trace[1]['class']))) . '/' . $trace[1]['function'];
146
  }
147
-
148
- // render contextual help automatically
149
- $viewHelpPath = $viewPath;
150
- // append file extension if not specified
151
- if ( ! preg_match('%\.php$%', $viewHelpPath)) {
152
- $viewHelpPath .= '.php';
153
- }
154
- $viewHelpPath = preg_replace('%\.php$%', '-help.php', $viewHelpPath);
155
- $fileHelpPath = PMXI_Plugin::ROOT_DIR . '/views/' . $viewHelpPath;
156
-
157
- if (is_file($fileHelpPath)) { // there is help file defined
158
- ob_start();
159
- include $fileHelpPath;
160
- add_contextual_help(PMXI_Plugin::getInstance()->getAdminCurrentScreen()->id, ob_get_clean());
161
- }
162
-
163
  parent::render($viewPath);
164
  }
165
 
137
  /**
138
  * @see Controller::render()
139
  */
140
+ protected function render($viewPath = NULL) {
 
141
  // assume template file name depending on calling function
142
  if (is_null($viewPath)) {
143
  $trace = debug_backtrace();
144
  $viewPath = str_replace('_', '/', preg_replace('%^' . preg_quote(PMXI_Plugin::PREFIX, '%') . '%', '', strtolower($trace[1]['class']))) . '/' . $trace[1]['function'];
145
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  parent::render($viewPath);
147
  }
148
 
helpers/functions.php CHANGED
@@ -273,7 +273,7 @@ function wpai_wp_enqueue_code_editor( $args ) {
273
  if ( ! function_exists('wp_all_import_update_post_count') ) {
274
  function wp_all_import_update_post_count() {
275
  global $wpdb;
276
- update_option( 'post_count', (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_status = 'publish' and post_type = 'post'" ) );
277
  }
278
  }
279
 
273
  if ( ! function_exists('wp_all_import_update_post_count') ) {
274
  function wp_all_import_update_post_count() {
275
  global $wpdb;
276
+ update_option( 'post_count', (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_status = 'publish' and post_type = 'post'" ), false );
277
  }
278
  }
279
 
helpers/reverse_taxonomies_html.php CHANGED
@@ -15,7 +15,7 @@ if ( ! function_exists('reverse_taxonomies_html') ) {
15
  ?>
16
  <li id="item_<?php echo $i; ?>" class="dragging">
17
  <div class="drag-element">
18
- <input type="checkbox" class="assign_term" <?php if (!empty($child_cat->assign)): ?>checked="checked"<?php endif; ?> title="<?php _e('Assign post to the taxonomy.','wp_all_import_plugin');?>"/>
19
  <input class="widefat xpath_field" type="text" value="<?php echo esc_textarea($child_cat->xpath); ?>"/>
20
  <?php do_action('pmxi_category_view', $cat, $i, $ctx_name, $entry); ?>
21
  </div>
15
  ?>
16
  <li id="item_<?php echo $i; ?>" class="dragging">
17
  <div class="drag-element">
18
+ <input type="hidden" class="assign_term" value="1" />
19
  <input class="widefat xpath_field" type="text" value="<?php echo esc_textarea($child_cat->xpath); ?>"/>
20
  <?php do_action('pmxi_category_view', $cat, $i, $ctx_name, $entry); ?>
21
  </div>
helpers/wp_all_import_get_reader_engine.php CHANGED
@@ -11,7 +11,7 @@ if ( ! function_exists('wp_all_import_get_reader_engine')){
11
  // auto detect xml reader engine disabled
12
  if ( $is_auto_detect_xml_reader === false )
13
  {
14
- update_option('wpai_parser_type', 'xmlreader');
15
 
16
  return false;
17
  }
@@ -111,7 +111,7 @@ if ( ! function_exists('wp_all_import_get_reader_engine')){
111
 
112
  $xml_reader_engine = ($xmlreader_count >= $xmlstreamer_count) ? 'xmlreader' : 'xmlstreamer';
113
 
114
- update_option('wpai_parser_type', $xml_reader_engine);
115
  }
116
  }
117
 
11
  // auto detect xml reader engine disabled
12
  if ( $is_auto_detect_xml_reader === false )
13
  {
14
+ update_option('wpai_parser_type', 'xmlreader', false);
15
 
16
  return false;
17
  }
111
 
112
  $xml_reader_engine = ($xmlreader_count >= $xmlstreamer_count) ? 'xmlreader' : 'xmlstreamer';
113
 
114
+ update_option('wpai_parser_type', $xml_reader_engine, false);
115
  }
116
  }
117
 
helpers/wp_all_import_get_url.php CHANGED
@@ -15,7 +15,7 @@ if (!function_exists('wp_all_import_get_url')) {
15
 
16
  $targetDir = (!$targetDir) ? wp_all_import_secure_file($uploads['basedir'] . DIRECTORY_SEPARATOR . PMXI_Plugin::UPLOADS_DIRECTORY) : $targetDir;
17
 
18
- $tmpname = wp_unique_filename($targetDir, ($type and strlen(basename($filePath)) < 30) ? basename($filePath) : time());
19
 
20
  $localPath = $targetDir . '/' . urldecode(sanitize_file_name($tmpname)) . ((!$type) ? '.tmp' : '');
21
 
@@ -35,8 +35,7 @@ if (!function_exists('wp_all_import_get_url')) {
35
  $chunk = @fread($file, 1024);
36
  if (!$type and $first_chunk and (strpos($chunk, "<?") !== FALSE or strpos($chunk, "<rss") !== FALSE) or strpos($chunk, "xmlns") !== FALSE) {
37
  $type = 'xml';
38
- }
39
- elseif (!$type and $first_chunk) {
40
  $type = 'csv';
41
  } // if it's a 1st chunk, then chunk <? symbols to detect XML file
42
  $first_chunk = FALSE;
@@ -89,24 +88,21 @@ if (!function_exists('wp_all_import_get_url')) {
89
  if ( ! $type ) {
90
  if ($contentEncoding == 'gzip') {
91
  $file = @fopen($localPath);
92
- }
93
- else {
94
  $file = @fopen($localPath, "rb");
95
  }
96
  while (!@feof($file)) {
97
  $chunk = @fread($file, 1024);
98
  if (strpos($chunk, "<?") !== FALSE or strpos($chunk, "<rss") !== FALSE or strpos($chunk, "xmlns") !== FALSE) {
99
  $type = 'xml';
100
- }
101
- else {
102
  $type = 'csv';
103
  } // if it's a 1st chunk, then chunk <? symbols to detect XML file
104
  break;
105
  }
106
  @fclose($file);
107
  }
108
- }
109
- else {
110
  return $request;
111
  }
112
 
15
 
16
  $targetDir = (!$targetDir) ? wp_all_import_secure_file($uploads['basedir'] . DIRECTORY_SEPARATOR . PMXI_Plugin::UPLOADS_DIRECTORY) : $targetDir;
17
 
18
+ $tmpname = wp_unique_filename($targetDir, ($type and strlen(basename($filePath)) < 30) ? basename($filePath) : (string) time());
19
 
20
  $localPath = $targetDir . '/' . urldecode(sanitize_file_name($tmpname)) . ((!$type) ? '.tmp' : '');
21
 
35
  $chunk = @fread($file, 1024);
36
  if (!$type and $first_chunk and (strpos($chunk, "<?") !== FALSE or strpos($chunk, "<rss") !== FALSE) or strpos($chunk, "xmlns") !== FALSE) {
37
  $type = 'xml';
38
+ } elseif (!$type and $first_chunk) {
 
39
  $type = 'csv';
40
  } // if it's a 1st chunk, then chunk <? symbols to detect XML file
41
  $first_chunk = FALSE;
88
  if ( ! $type ) {
89
  if ($contentEncoding == 'gzip') {
90
  $file = @fopen($localPath);
91
+ } else {
 
92
  $file = @fopen($localPath, "rb");
93
  }
94
  while (!@feof($file)) {
95
  $chunk = @fread($file, 1024);
96
  if (strpos($chunk, "<?") !== FALSE or strpos($chunk, "<rss") !== FALSE or strpos($chunk, "xmlns") !== FALSE) {
97
  $type = 'xml';
98
+ } else {
 
99
  $type = 'csv';
100
  } // if it's a 1st chunk, then chunk <? symbols to detect XML file
101
  break;
102
  }
103
  @fclose($file);
104
  }
105
+ } else {
 
106
  return $request;
107
  }
108
 
models/import/record.php CHANGED
@@ -169,10 +169,17 @@ class PMXI_Import_Record extends PMXI_Model_Record {
169
  $taxonomy_slug = array();
170
  if ( 'xpath' == $this->options['taxonomy_slug'] && ! empty($this->options['taxonomy_slug_xpath']) && $this->is_parsing_required('is_update_slug')){
171
  $taxonomy_slug = XmlImportParser::factory($xml, $cxpath, $this->options['taxonomy_slug_xpath'], $file)->parse($records); $tmp_files[] = $file;
172
- }
173
- else{
174
  count($titles) and $taxonomy_slug = array_fill(0, count($titles), '');
175
  }
 
 
 
 
 
 
 
 
176
  }
177
 
178
  if ( ! in_array($this->options['custom_type'], array('taxonomies')) ){
@@ -235,12 +242,10 @@ class PMXI_Import_Record extends PMXI_Model_Record {
235
  $chunk == 1 and $logger and call_user_func($logger, __('Composing duplicate indicators...', 'wp_all_import_plugin'));
236
  if (!empty($this->options[$this->options['duplicate_indicator'] . '_xpath'])){
237
  $duplicate_indicator_values = XmlImportParser::factory($xml, $cxpath, $this->options[$this->options['duplicate_indicator'] . '_xpath'], $file)->parse($records); $tmp_files[] = $file;
238
- }
239
- else{
240
  count($titles) and $duplicate_indicator_values = array_fill(0, count($titles), '');
241
  }
242
- }
243
- else{
244
  count($titles) and $duplicate_indicator_values = array_fill(0, count($titles), '');
245
  }
246
 
@@ -806,8 +811,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
806
  if (class_exists($model_class)){
807
  $addons[$class] = new $model_class();
808
  $addons_data[$class] = ( method_exists($addons[$class], 'parse') ) ? $addons[$class]->parse($parsingData) : false;
809
- }
810
- else {
811
  if ( ! empty($parse_functions[$class]) ){
812
  if ( is_array($parse_functions[$class]) and is_callable($parse_functions[$class]) or ! is_array($parse_functions[$class]) and function_exists($parse_functions[$class]) ){
813
  $addons_data[$class] = call_user_func($parse_functions[$class], $parsingData);
@@ -883,8 +887,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
883
  if ( empty($titles[$i]) && !in_array($this->options['custom_type'], array('shop_order', 'import_users', 'shop_customer', 'comments', 'woo_reviews')) ) {
884
  if ( ! empty($addons_data['PMWI_Plugin']) and !empty($addons_data['PMWI_Plugin']['single_product_parent_ID'][$i]) ){
885
  $titles[$i] = $addons_data['PMWI_Plugin']['single_product_parent_ID'][$i] . ' Product Variation';
886
- }
887
- else{
888
  $logger and call_user_func($logger, __('<b>WARNING</b>: title is empty.', 'wp_all_import_plugin'));
889
  $logger and !$is_cron and PMXI_Plugin::$session->warnings++;
890
  }
@@ -1007,11 +1010,9 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1007
 
1008
  $check_for_duplicates = apply_filters('wp_all_import_is_check_duplicates', true, $this->id);
1009
 
1010
- if ( $check_for_duplicates )
1011
- {
1012
  // if Auto Matching re-import option selected
1013
- if ( "manual" != $this->options['duplicate_matching'] ){
1014
-
1015
  // find corresponding article among previously imported
1016
  $logger and call_user_func($logger, sprintf(__('Find corresponding article among previously imported for post `%s`...', 'wp_all_import_plugin'), $this->getRecordTitle($articleData)));
1017
  $postList = new PMXI_Post_List();
@@ -1036,8 +1037,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1036
  if ($post_to_update){
1037
  $logger and call_user_func($logger, sprintf(__('Duplicate post was found for post %s with unique key `%s`...', 'wp_all_import_plugin'), $this->getRecordTitle($articleData), $unique_keys[$i]));
1038
  break;
1039
- }
1040
- else{
1041
  $postRecord->delete();
1042
  }
1043
  }
@@ -1052,8 +1052,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1052
  if ('custom field' == $this->options['duplicate_indicator']) {
1053
  $custom_duplicate_value = XmlImportParser::factory($xml, $cxpath, $this->options['custom_duplicate_value'], $file)->parse($records); $tmp_files[] = $file;
1054
  $custom_duplicate_name = XmlImportParser::factory($xml, $cxpath, $this->options['custom_duplicate_name'], $file)->parse($records); $tmp_files[] = $file;
1055
- }
1056
- else{
1057
  count($titles) and $custom_duplicate_name = $custom_duplicate_value = array_fill(0, count($titles), '');
1058
  }
1059
 
@@ -1071,14 +1070,14 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1071
  $duplicate_id = false;
1072
  }
1073
  }
1074
- }
1075
  // handle duplicates according to import settings
1076
- else
1077
- {
1078
  $duplicates = pmxi_findDuplicates($articleData, $custom_duplicate_name[$i], $custom_duplicate_value[$i], $this->options['duplicate_indicator'], $duplicate_indicator_values[$i]);
1079
  $duplicate_id = ( ! empty($duplicates)) ? array_shift($duplicates) : false;
1080
  }
1081
 
 
 
1082
  if ( ! empty($duplicate_id)) {
1083
  $duplicate_id = apply_filters('wp_all_import_manual_matching_duplicate_id', $duplicate_id, $duplicates, $articleData, $this->id);
1084
  $logger and call_user_func($logger, sprintf(__('Duplicate post was found for post `%s`...', 'wp_all_import_plugin'), $this->getRecordTitle($articleData)));
@@ -1096,8 +1095,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1096
  $post_to_update = get_post($post_to_update_id = $duplicate_id);
1097
  break;
1098
  }
1099
- }
1100
- else{
1101
  $logger and call_user_func($logger, sprintf(__('Duplicate post wasn\'t found for post `%s`...', 'wp_all_import_plugin'), $this->getRecordTitle($articleData)));
1102
  }
1103
  }
@@ -1355,7 +1353,6 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1355
  default:
1356
  break;
1357
  }
1358
-
1359
  }
1360
 
1361
  $is_images_to_delete = apply_filters('pmxi_delete_images', true, $articleData, $current_xml_node);
@@ -1619,9 +1616,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1619
  break;
1620
  }
1621
  }
1622
-
1623
- $articleData['post_title'] = $articleData['user_login'];
1624
-
1625
  break;
1626
  default:
1627
  if (empty($articleData['ID'])){
@@ -1682,11 +1677,13 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1682
  }
1683
 
1684
  // [post format]
1685
- if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type[$i], 'post-formats' ) ){
1686
- set_post_format($pid, ("xpath" == $this->options['post_format']) ? $post_format[$i] : $this->options['post_format'] );
1687
- $logger and call_user_func($logger, sprintf(__('Associate post `%s` with post format %s ...', 'wp_all_import_plugin'), $this->getRecordTitle($articleData), ("xpath" == $this->options['post_format']) ? $post_format[$i] : $this->options['post_format']));
 
 
1688
  }
1689
- // [/post format]
1690
 
1691
  // [addons import]
1692
 
@@ -1710,8 +1707,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1710
  foreach (PMXI_Admin_Addons::get_active_addons() as $class) {
1711
  if (class_exists($class)) {
1712
  if ( method_exists($addons[$class], 'import') ) $addons[$class]->import($importData);
1713
- }
1714
- else {
1715
  if (!empty($import_functions[$class])) {
1716
  if (is_array($import_functions[$class]) and is_callable($import_functions[$class]) or ! is_array($import_functions[$class]) and function_exists($import_functions[$class]) ) {
1717
  call_user_func($import_functions[$class], $importData, $addons_data[$class]);
@@ -1720,7 +1716,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1720
  }
1721
  }
1722
 
1723
- // [/addons import]
1724
 
1725
  // Page Template
1726
  global $wp_version;
@@ -1812,8 +1808,13 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1812
  if ($full_size != $image){
1813
  // check if full size image exists
1814
  $full_size_headers = get_headers($full_size, true);
1815
- if (!empty($full_size_headers['Content-Type']) && strpos($full_size_headers['Content-Type'], 'image') !== false){
1816
- $image = $full_size;
 
 
 
 
 
1817
  }
1818
  }
1819
  }
@@ -2654,12 +2655,12 @@ class PMXI_Import_Record extends PMXI_Model_Record {
2654
  if (!empty($articleData['ID'])){
2655
  if ($this->options['update_all_data'] == "no" and $this->options['update_categories_logic'] == "all_except" and !empty($this->options['taxonomies_list'])
2656
  and is_array($this->options['taxonomies_list']) and in_array($tx_name, $this->options['taxonomies_list'])){
2657
- $logger and call_user_func($logger, sprintf(__('- %s %s `%s` has been skipped attempted to `Leave these taxonomies alone, update all others`...', 'wp_all_import_plugin'), $custom_type_details->labels->singular_name, $tx_name, $single_tax['name']));
2658
  continue;
2659
  }
2660
  if ($this->options['update_all_data'] == "no" and $this->options['update_categories_logic'] == "only" and ((!empty($this->options['taxonomies_list'])
2661
  and is_array($this->options['taxonomies_list']) and ! in_array($tx_name, $this->options['taxonomies_list'])) or empty($this->options['taxonomies_list']))){
2662
- $logger and call_user_func($logger, sprintf(__('- %s %s `%s` has been skipped attempted to `Update only these taxonomies, leave the rest alone`...', 'wp_all_import_plugin'), $custom_type_details->labels->singular_name, $tx_name, $single_tax['name']));
2663
  continue;
2664
  }
2665
  }
@@ -2678,7 +2679,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
2678
  if ( ! empty($txes[$i]) ):
2679
  foreach ($txes[$i] as $key => $single_tax) {
2680
  $is_created_term = false;
2681
- if (is_array($single_tax) and isset($single_tax['name'])){
2682
  $parent_id = ( ! empty($single_tax['parent'])) ? pmxi_recursion_taxes($single_tax['parent'], $tx_name, $txes[$i], $key) : '';
2683
  $term = (empty($this->options['tax_is_full_search_' . $this->options['tax_logic'][$tx_name]][$tx_name])) ? is_exists_term($single_tax['name'], $tx_name, (int)$parent_id) : is_exists_term($single_tax['name'], $tx_name);
2684
  if ( empty($term) and !is_wp_error($term) ){
@@ -2800,13 +2801,9 @@ class PMXI_Import_Record extends PMXI_Model_Record {
2800
  foreach (PMXI_Admin_Addons::get_active_addons() as $class){
2801
  if (class_exists($class)){
2802
  if ( method_exists($addons[$class], 'saved_post') ) $addons[$class]->saved_post($importData);
2803
- }
2804
- else
2805
- {
2806
- if ( ! empty($saved_functions[$class]) ){
2807
-
2808
  if ( is_array($saved_functions[$class]) and is_callable($saved_functions[$class]) or ! is_array($saved_functions[$class]) and function_exists($saved_functions[$class]) ){
2809
-
2810
  call_user_func($saved_functions[$class], $importData);
2811
  }
2812
  }
@@ -2873,9 +2870,10 @@ class PMXI_Import_Record extends PMXI_Model_Record {
2873
 
2874
  $missingPostRecord = new PMXI_Post_Record();
2875
  $missingPostRecord->getBy('id', $missingPost['id']);
2876
- if ( ! $missingPostRecord->isEmpty())
2877
  $missingPostRecord->set(array('iteration' => $this->iteration))->update();
2878
- unset($missingPostRecord);
 
2879
  }
2880
  }
2881
  }
@@ -2919,6 +2917,8 @@ class PMXI_Import_Record extends PMXI_Model_Record {
2919
 
2920
  $file_info = false;
2921
 
 
 
2922
  $logger and call_user_func($logger, sprintf(__('- Downloading image from `%s`', 'wp_all_import_plugin'), $url));
2923
 
2924
  $request = get_file_curl($url, $image_filepath);
@@ -3015,8 +3015,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
3015
  if ( ! @unlink($apath)) {
3016
  $logger and call_user_func($logger, sprintf(__('<b>WARNING</b>: Unable to remove %s', 'wp_all_import_plugin'), $apath));
3017
  }
3018
- }
3019
- else{
3020
  $file_path_array = PMXI_Helper::safe_glob($this->path, PMXI_Helper::GLOB_NODIR | PMXI_Helper::GLOB_PATH);
3021
  if (!empty($file_path_array)){
3022
  foreach ($file_path_array as $path) {
169
  $taxonomy_slug = array();
170
  if ( 'xpath' == $this->options['taxonomy_slug'] && ! empty($this->options['taxonomy_slug_xpath']) && $this->is_parsing_required('is_update_slug')){
171
  $taxonomy_slug = XmlImportParser::factory($xml, $cxpath, $this->options['taxonomy_slug_xpath'], $file)->parse($records); $tmp_files[] = $file;
172
+ } else{
 
173
  count($titles) and $taxonomy_slug = array_fill(0, count($titles), '');
174
  }
175
+ // Composing terms display type
176
+ $chunk == 1 and $logger and call_user_func($logger, __('Composing terms display type...', 'wp_all_import_plugin'));
177
+ $taxonomy_display_type = array();
178
+ if ( 'xpath' == $this->options['taxonomy_display_type'] && ! empty($this->options['taxonomy_display_type_xpath'])) {
179
+ $taxonomy_display_type = XmlImportParser::factory($xml, $cxpath, $this->options['taxonomy_display_type_xpath'], $file)->parse($records); $tmp_files[] = $file;
180
+ } else{
181
+ count($titles) and $taxonomy_display_type = array_fill(0, count($titles), $this->options['taxonomy_display_type']);
182
+ }
183
  }
184
 
185
  if ( ! in_array($this->options['custom_type'], array('taxonomies')) ){
242
  $chunk == 1 and $logger and call_user_func($logger, __('Composing duplicate indicators...', 'wp_all_import_plugin'));
243
  if (!empty($this->options[$this->options['duplicate_indicator'] . '_xpath'])){
244
  $duplicate_indicator_values = XmlImportParser::factory($xml, $cxpath, $this->options[$this->options['duplicate_indicator'] . '_xpath'], $file)->parse($records); $tmp_files[] = $file;
245
+ } else {
 
246
  count($titles) and $duplicate_indicator_values = array_fill(0, count($titles), '');
247
  }
248
+ } else {
 
249
  count($titles) and $duplicate_indicator_values = array_fill(0, count($titles), '');
250
  }
251
 
811
  if (class_exists($model_class)){
812
  $addons[$class] = new $model_class();
813
  $addons_data[$class] = ( method_exists($addons[$class], 'parse') ) ? $addons[$class]->parse($parsingData) : false;
814
+ } else {
 
815
  if ( ! empty($parse_functions[$class]) ){
816
  if ( is_array($parse_functions[$class]) and is_callable($parse_functions[$class]) or ! is_array($parse_functions[$class]) and function_exists($parse_functions[$class]) ){
817
  $addons_data[$class] = call_user_func($parse_functions[$class], $parsingData);
887
  if ( empty($titles[$i]) && !in_array($this->options['custom_type'], array('shop_order', 'import_users', 'shop_customer', 'comments', 'woo_reviews')) ) {
888
  if ( ! empty($addons_data['PMWI_Plugin']) and !empty($addons_data['PMWI_Plugin']['single_product_parent_ID'][$i]) ){
889
  $titles[$i] = $addons_data['PMWI_Plugin']['single_product_parent_ID'][$i] . ' Product Variation';
890
+ } else {
 
891
  $logger and call_user_func($logger, __('<b>WARNING</b>: title is empty.', 'wp_all_import_plugin'));
892
  $logger and !$is_cron and PMXI_Plugin::$session->warnings++;
893
  }
1010
 
1011
  $check_for_duplicates = apply_filters('wp_all_import_is_check_duplicates', true, $this->id);
1012
 
1013
+ if ( $check_for_duplicates ) {
 
1014
  // if Auto Matching re-import option selected
1015
+ if ( "manual" != $this->options['duplicate_matching'] ) {
 
1016
  // find corresponding article among previously imported
1017
  $logger and call_user_func($logger, sprintf(__('Find corresponding article among previously imported for post `%s`...', 'wp_all_import_plugin'), $this->getRecordTitle($articleData)));
1018
  $postList = new PMXI_Post_List();
1037
  if ($post_to_update){
1038
  $logger and call_user_func($logger, sprintf(__('Duplicate post was found for post %s with unique key `%s`...', 'wp_all_import_plugin'), $this->getRecordTitle($articleData), $unique_keys[$i]));
1039
  break;
1040
+ } else {
 
1041
  $postRecord->delete();
1042
  }
1043
  }
1052
  if ('custom field' == $this->options['duplicate_indicator']) {
1053
  $custom_duplicate_value = XmlImportParser::factory($xml, $cxpath, $this->options['custom_duplicate_value'], $file)->parse($records); $tmp_files[] = $file;
1054
  $custom_duplicate_name = XmlImportParser::factory($xml, $cxpath, $this->options['custom_duplicate_name'], $file)->parse($records); $tmp_files[] = $file;
1055
+ } else {
 
1056
  count($titles) and $custom_duplicate_name = $custom_duplicate_value = array_fill(0, count($titles), '');
1057
  }
1058
 
1070
  $duplicate_id = false;
1071
  }
1072
  }
 
1073
  // handle duplicates according to import settings
1074
+ } else {
 
1075
  $duplicates = pmxi_findDuplicates($articleData, $custom_duplicate_name[$i], $custom_duplicate_value[$i], $this->options['duplicate_indicator'], $duplicate_indicator_values[$i]);
1076
  $duplicate_id = ( ! empty($duplicates)) ? array_shift($duplicates) : false;
1077
  }
1078
 
1079
+ $duplicate_id = apply_filters('wp_all_import_manual_matching', $duplicate_id, $duplicate_indicator_values[$i], $this);
1080
+
1081
  if ( ! empty($duplicate_id)) {
1082
  $duplicate_id = apply_filters('wp_all_import_manual_matching_duplicate_id', $duplicate_id, $duplicates, $articleData, $this->id);
1083
  $logger and call_user_func($logger, sprintf(__('Duplicate post was found for post `%s`...', 'wp_all_import_plugin'), $this->getRecordTitle($articleData)));
1095
  $post_to_update = get_post($post_to_update_id = $duplicate_id);
1096
  break;
1097
  }
1098
+ } else {
 
1099
  $logger and call_user_func($logger, sprintf(__('Duplicate post wasn\'t found for post `%s`...', 'wp_all_import_plugin'), $this->getRecordTitle($articleData)));
1100
  }
1101
  }
1353
  default:
1354
  break;
1355
  }
 
1356
  }
1357
 
1358
  $is_images_to_delete = apply_filters('pmxi_delete_images', true, $articleData, $current_xml_node);
1616
  break;
1617
  }
1618
  }
1619
+ $articleData['post_title'] = $articleData['user_login'];
 
 
1620
  break;
1621
  default:
1622
  if (empty($articleData['ID'])){
1677
  }
1678
 
1679
  // [post format]
1680
+ if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type[$i], 'post-formats' ) ) {
1681
+ if (empty($articleData['ID']) || $this->options['update_all_data'] == 'yes' || ($this->options['update_all_data'] == 'no' and $this->options['is_update_post_format'])) {
1682
+ set_post_format($pid, ("xpath" == $this->options['post_format']) ? $post_format[$i] : $this->options['post_format'] );
1683
+ $logger and call_user_func($logger, sprintf(__('Associate post `%s` with post format %s ...', 'wp_all_import_plugin'), $this->getRecordTitle($articleData), ("xpath" == $this->options['post_format']) ? $post_format[$i] : $this->options['post_format']));
1684
+ }
1685
  }
1686
+ // [/post format]
1687
 
1688
  // [addons import]
1689
 
1707
  foreach (PMXI_Admin_Addons::get_active_addons() as $class) {
1708
  if (class_exists($class)) {
1709
  if ( method_exists($addons[$class], 'import') ) $addons[$class]->import($importData);
1710
+ } else {
 
1711
  if (!empty($import_functions[$class])) {
1712
  if (is_array($import_functions[$class]) and is_callable($import_functions[$class]) or ! is_array($import_functions[$class]) and function_exists($import_functions[$class]) ) {
1713
  call_user_func($import_functions[$class], $importData, $addons_data[$class]);
1716
  }
1717
  }
1718
 
1719
+ // [/addons import]
1720
 
1721
  // Page Template
1722
  global $wp_version;
1808
  if ($full_size != $image){
1809
  // check if full size image exists
1810
  $full_size_headers = get_headers($full_size, true);
1811
+ if (!empty($full_size_headers['Content-Type'])) {
1812
+ if (is_array($full_size_headers['Content-Type'])) {
1813
+ $full_size_headers['Content-Type'] = end($full_size_headers['Content-Type']);
1814
+ }
1815
+ if (strpos($full_size_headers['Content-Type'], 'image') !== false){
1816
+ $image = $full_size;
1817
+ }
1818
  }
1819
  }
1820
  }
2655
  if (!empty($articleData['ID'])){
2656
  if ($this->options['update_all_data'] == "no" and $this->options['update_categories_logic'] == "all_except" and !empty($this->options['taxonomies_list'])
2657
  and is_array($this->options['taxonomies_list']) and in_array($tx_name, $this->options['taxonomies_list'])){
2658
+ $logger and call_user_func($logger, sprintf(__('- %s %s has been skipped attempted to `Leave these taxonomies alone, update all others`...', 'wp_all_import_plugin'), $custom_type_details->labels->singular_name, $tx_name));
2659
  continue;
2660
  }
2661
  if ($this->options['update_all_data'] == "no" and $this->options['update_categories_logic'] == "only" and ((!empty($this->options['taxonomies_list'])
2662
  and is_array($this->options['taxonomies_list']) and ! in_array($tx_name, $this->options['taxonomies_list'])) or empty($this->options['taxonomies_list']))){
2663
+ $logger and call_user_func($logger, sprintf(__('- %s %s has been skipped attempted to `Update only these taxonomies, leave the rest alone`...', 'wp_all_import_plugin'), $custom_type_details->labels->singular_name, $tx_name));
2664
  continue;
2665
  }
2666
  }
2679
  if ( ! empty($txes[$i]) ):
2680
  foreach ($txes[$i] as $key => $single_tax) {
2681
  $is_created_term = false;
2682
+ if (is_array($single_tax) and isset($single_tax['name']) and $single_tax['name'] != "") {
2683
  $parent_id = ( ! empty($single_tax['parent'])) ? pmxi_recursion_taxes($single_tax['parent'], $tx_name, $txes[$i], $key) : '';
2684
  $term = (empty($this->options['tax_is_full_search_' . $this->options['tax_logic'][$tx_name]][$tx_name])) ? is_exists_term($single_tax['name'], $tx_name, (int)$parent_id) : is_exists_term($single_tax['name'], $tx_name);
2685
  if ( empty($term) and !is_wp_error($term) ){
2801
  foreach (PMXI_Admin_Addons::get_active_addons() as $class){
2802
  if (class_exists($class)){
2803
  if ( method_exists($addons[$class], 'saved_post') ) $addons[$class]->saved_post($importData);
2804
+ } else {
2805
+ if ( ! empty($saved_functions[$class]) ){
 
 
 
2806
  if ( is_array($saved_functions[$class]) and is_callable($saved_functions[$class]) or ! is_array($saved_functions[$class]) and function_exists($saved_functions[$class]) ){
 
2807
  call_user_func($saved_functions[$class], $importData);
2808
  }
2809
  }
2870
 
2871
  $missingPostRecord = new PMXI_Post_Record();
2872
  $missingPostRecord->getBy('id', $missingPost['id']);
2873
+ if ( ! $missingPostRecord->isEmpty() && empty($this->options['is_delete_missing'])) {
2874
  $missingPostRecord->set(array('iteration' => $this->iteration))->update();
2875
+ }
2876
+ unset($missingPostRecord);
2877
  }
2878
  }
2879
  }
2917
 
2918
  $file_info = false;
2919
 
2920
+ $url = wp_all_import_sanitize_url($url);
2921
+
2922
  $logger and call_user_func($logger, sprintf(__('- Downloading image from `%s`', 'wp_all_import_plugin'), $url));
2923
 
2924
  $request = get_file_curl($url, $image_filepath);
3015
  if ( ! @unlink($apath)) {
3016
  $logger and call_user_func($logger, sprintf(__('<b>WARNING</b>: Unable to remove %s', 'wp_all_import_plugin'), $apath));
3017
  }
3018
+ } else {
 
3019
  $file_path_array = PMXI_Helper::safe_glob($this->path, PMXI_Helper::GLOB_NODIR | PMXI_Helper::GLOB_PATH);
3020
  if (!empty($file_path_array)){
3021
  foreach ($file_path_array as $path) {
phpunit-free.xml DELETED
@@ -1,18 +0,0 @@
1
- <phpunit
2
- bootstrap="tests/bootstrap-free.php"
3
- backupGlobals="false"
4
- colors="true"
5
- convertErrorsToExceptions="true"
6
- convertNoticesToExceptions="true"
7
- convertWarningsToExceptions="true"
8
- >
9
- <testsuites>
10
- <testsuite name="basic">
11
- <file>tests/free-edition-test-posts.php</file>
12
- <file>tests/free-edition-test-pages.php</file>
13
- </testsuite>
14
- <testsuite name="products">
15
- <directory prefix="free-edition-test-products-" suffix=".php">tests</directory>
16
- </testsuite>
17
- </testsuites>
18
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
phpunit.xml DELETED
@@ -1,39 +0,0 @@
1
- <phpunit
2
- bootstrap="tests/bootstrap.php"
3
- backupGlobals="false"
4
- colors="true"
5
- convertErrorsToExceptions="true"
6
- convertNoticesToExceptions="true"
7
- convertWarningsToExceptions="true"
8
- >
9
- <testsuites>
10
- <testsuite name="basic">
11
- <file>tests/test-posts.php</file>
12
- <file>tests/test-pages.php</file>
13
- </testsuite>
14
- <testsuite name="products">
15
- <directory prefix="test-products-" suffix=".php">tests</directory>
16
- </testsuite>
17
- <testsuite name="simple-products">
18
- <directory prefix="test-products-simple" suffix=".php">tests</directory>
19
- </testsuite>
20
- <testsuite name="external-products">
21
- <directory prefix="test-products-external" suffix=".php">tests</directory>
22
- </testsuite>
23
- <testsuite name="grouped-products">
24
- <directory prefix="test-products-grouped" suffix=".php">tests</directory>
25
- </testsuite>
26
- <testsuite name="variable-products">
27
- <directory prefix="test-products-variable" suffix=".php">tests</directory>
28
- </testsuite>
29
- <testsuite name="images">
30
- <directory prefix="test-images" suffix=".php">tests</directory>
31
- </testsuite>
32
- <!-- <testsuite name="user">
33
- <file>tests/test-users.php</file>
34
- </testsuite> -->
35
- <!--testsuite name="acf">
36
- <file>tests/test-acf.php</file>
37
- </testsuite-->
38
- </testsuites>
39
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: WP All Import
4
- Plugin URI: http://www.wpallimport.com/upgrade-to-pro/?utm_source=import-plugin-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
5
  Description: The most powerful solution for importing XML and CSV files to WordPress. Create Posts and Pages with content from any XML or CSV file. A paid upgrade to WP All Import Pro is available for support and additional features.
6
- Version: 3.5.6
7
  Author: Soflyy
8
  */
9
 
@@ -25,7 +25,7 @@ define('WP_ALL_IMPORT_ROOT_URL', rtrim(plugin_dir_url(__FILE__), '/'));
25
  */
26
  define('WP_ALL_IMPORT_PREFIX', 'pmxi_');
27
 
28
- define('PMXI_VERSION', '3.5.6');
29
 
30
  define('PMXI_EDITION', 'free');
31
 
@@ -586,33 +586,33 @@ final class PMXI_Plugin {
586
 
587
  } else {
588
 
589
- $this->_admin_current_screen = (object)array(
590
- 'id' => $controllerName,
591
- 'base' => $controllerName,
592
- 'action' => $actionName,
593
- 'is_ajax' => strpos($_SERVER["HTTP_ACCEPT"], 'json') !== false,
594
- 'is_network' => is_network_admin(),
595
- 'is_user' => is_user_admin(),
596
- );
597
- add_filter('current_screen', array($this, 'getAdminCurrentScreen'));
598
- add_filter('admin_body_class', array($this, 'getAdminBodyClass'), 10, 1);
599
-
600
- $controller = new $controllerName();
601
- if ( ! $controller instanceof PMXI_Controller_Admin) {
602
- throw new Exception("Administration page `$page` matches to a wrong controller type.");
603
- }
604
 
605
- if ($this->_admin_current_screen->is_ajax) { // ajax request
606
- $controller->$action();
607
- do_action('pmxi_action_after');
608
- die(); // stop processing since we want to output only what controller is randered, nothing in addition
609
- } elseif ( ! $controller->isInline) {
610
- @ob_start();
611
- $controller->$action();
612
- self::$buffer = @ob_get_clean();
613
- } else {
614
- self::$buffer_callback = array($controller, $action);
615
- }
616
 
617
  }
618
 
@@ -1275,10 +1275,12 @@ final class PMXI_Plugin {
1275
  'tax_logic_mapping' => array(),
1276
  'is_tax_hierarchical_group_delim' => array(),
1277
  'tax_hierarchical_group_delim' => array(),
 
1278
  'nested_files' => array(),
1279
  'xml_reader_engine' => 0,
1280
  'import_img_tags' => 0,
1281
- 'search_existing_images_logic' => 'by_url'
 
1282
  );
1283
  }
1284
 
@@ -1303,6 +1305,20 @@ final class PMXI_Plugin {
1303
  return strpos($_SERVER["HTTP_ACCEPT"], 'json') !== false;
1304
  }
1305
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1306
  }
1307
 
1308
  PMXI_Plugin::getInstance();
1
  <?php
2
  /*
3
  Plugin Name: WP All Import
4
+ Plugin URI: http://www.wpallimport.com/wordpress-xml-csv-import/?utm_source=import-plugin-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
5
  Description: The most powerful solution for importing XML and CSV files to WordPress. Create Posts and Pages with content from any XML or CSV file. A paid upgrade to WP All Import Pro is available for support and additional features.
6
+ Version: 3.5.7
7
  Author: Soflyy
8
  */
9
 
25
  */
26
  define('WP_ALL_IMPORT_PREFIX', 'pmxi_');
27
 
28
+ define('PMXI_VERSION', '3.5.7');
29
 
30
  define('PMXI_EDITION', 'free');
31
 
586
 
587
  } else {
588
 
589
+ $this->_admin_current_screen = (object)array(
590
+ 'id' => $controllerName,
591
+ 'base' => $controllerName,
592
+ 'action' => $actionName,
593
+ 'is_ajax' => (isset($_SERVER["HTTP_ACCEPT"]) && strpos($_SERVER["HTTP_ACCEPT"], 'json')) !== false,
594
+ 'is_network' => is_network_admin(),
595
+ 'is_user' => is_user_admin(),
596
+ );
597
+ add_filter('current_screen', array($this, 'getAdminCurrentScreen'));
598
+ add_filter('admin_body_class', array($this, 'getAdminBodyClass'), 10, 1);
599
+
600
+ $controller = new $controllerName();
601
+ if ( ! $controller instanceof PMXI_Controller_Admin) {
602
+ throw new Exception("Administration page `$page` matches to a wrong controller type.");
603
+ }
604
 
605
+ if ($this->_admin_current_screen->is_ajax) { // ajax request
606
+ $controller->$action();
607
+ do_action('pmxi_action_after');
608
+ wp_die(); // stop processing since we want to output only what controller is randered, nothing in addition
609
+ } elseif ( ! $controller->isInline) {
610
+ @ob_start();
611
+ $controller->$action();
612
+ self::$buffer = @ob_get_clean();
613
+ } else {
614
+ self::$buffer_callback = array($controller, $action);
615
+ }
616
 
617
  }
618
 
1275
  'tax_logic_mapping' => array(),
1276
  'is_tax_hierarchical_group_delim' => array(),
1277
  'tax_hierarchical_group_delim' => array(),
1278
+ 'tax_hierarchical_group_delim' => array(),
1279
  'nested_files' => array(),
1280
  'xml_reader_engine' => 0,
1281
  'import_img_tags' => 0,
1282
+ 'search_existing_images_logic' => 'by_url',
1283
+ 'is_update_post_format' => 1
1284
  );
1285
  }
1286
 
1305
  return strpos($_SERVER["HTTP_ACCEPT"], 'json') !== false;
1306
  }
1307
 
1308
+ /**
1309
+ * Returns ID of current import.
1310
+ *
1311
+ * @return int|bool
1312
+ */
1313
+ public static function getCurrentImportId() {
1314
+ $input = new PMXI_Input();
1315
+ $import_id = $input->get('id');
1316
+ if (empty($import_id)) {
1317
+ $import_id = $input->get('import_id');
1318
+ }
1319
+ return $import_id;
1320
+ }
1321
+
1322
  }
1323
 
1324
  PMXI_Plugin::getInstance();
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
  Tested up to: 5.7
5
- Stable tag: 3.5.6
6
  Tags: wordpress csv import, wordpress xml import, xml, csv, datafeed, import, migrate, import csv to wordpress, import xml to wordpress, advanced xml import, advanced csv import, bulk csv import, bulk xml import, bulk data import, xml to custom post type, csv to custom post type, woocommerce csv import, woocommerce xml import, csv import, import csv, xml import, import xml, csv importer
7
 
8
  WP All Import is an extremely powerful importer that makes it easy to import any XML or CSV file to WordPress.
@@ -43,7 +43,7 @@ For technical support from the developers, please consider purchasing WP All Imp
43
 
44
  * Guaranteed technical support via e-mail.
45
 
46
- [Upgrade to the Pro edition of WP All Import.](http://www.wpallimport.com/upgrade-to-pro/?utm_source=import-plugin-free&utm_medium=readme&utm_campaign=upgrade-to-pro)
47
 
48
  Need to [import XML and CSV to WooCommerce?](http://www.wpallimport.com/woocommerce-product-import/?utm_source=import-plugin-free&utm_medium=readme&utm_campaign=upgrade-to-pro) Check out our WooCommerce add-on.
49
 
@@ -105,6 +105,14 @@ Does it work with special character encoding like Hebrew, Arabic, Chinese, etc?
105
 
106
  == Changelog ==
107
 
 
 
 
 
 
 
 
 
108
  = 3.5.6 =
109
  * bug fix: PMXI_Hash_Record class doesn't exist error appears when deleting missing records
110
 
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
  Tested up to: 5.7
5
+ Stable tag: 3.5.7
6
  Tags: wordpress csv import, wordpress xml import, xml, csv, datafeed, import, migrate, import csv to wordpress, import xml to wordpress, advanced xml import, advanced csv import, bulk csv import, bulk xml import, bulk data import, xml to custom post type, csv to custom post type, woocommerce csv import, woocommerce xml import, csv import, import csv, xml import, import xml, csv importer
7
 
8
  WP All Import is an extremely powerful importer that makes it easy to import any XML or CSV file to WordPress.
43
 
44
  * Guaranteed technical support via e-mail.
45
 
46
+ [Upgrade to the Pro edition of WP All Import.](http://www.wpallimport.com/wordpress-xml-csv-import/?utm_source=import-plugin-free&utm_medium=readme&utm_campaign=upgrade-to-pro)
47
 
48
  Need to [import XML and CSV to WooCommerce?](http://www.wpallimport.com/woocommerce-product-import/?utm_source=import-plugin-free&utm_medium=readme&utm_campaign=upgrade-to-pro) Check out our WooCommerce add-on.
49
 
105
 
106
  == Changelog ==
107
 
108
+ = 3.5.7 =
109
+ * improvement: git rid if deprecated join query on manage imports screen
110
+ * improvement: add is_update_post_format option
111
+ * improvement: add wp_all_import_manual_matching filter
112
+ * improvement: add wp_all_import_logger filter
113
+ * bug fix: records were removed from pmxi_posts table when activating WPAI on multisite installation
114
+ * bug fix: get rid of unused deprecated function add_contextual_help()
115
+
116
  = 3.5.6 =
117
  * bug fix: PMXI_Hash_Record class doesn't exist error appears when deleting missing records
118
 
schema.php CHANGED
@@ -93,8 +93,8 @@ CREATE TABLE {$table_prefix}files (
93
  CREATE TABLE {$table_prefix}images (
94
  id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
95
  attachment_id BIGINT(20) UNSIGNED NOT NULL,
96
- image_url VARCHAR(600) NOT NULL DEFAULT '',
97
- image_filename VARCHAR(600) NOT NULL DEFAULT '',
98
  PRIMARY KEY (id)
99
  ) $charset_collate;
100
  CREATE TABLE {$table_prefix}history (
93
  CREATE TABLE {$table_prefix}images (
94
  id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
95
  attachment_id BIGINT(20) UNSIGNED NOT NULL,
96
+ image_url VARCHAR(900) NOT NULL DEFAULT '',
97
+ image_filename VARCHAR(900) NOT NULL DEFAULT '',
98
  PRIMARY KEY (id)
99
  ) $charset_collate;
100
  CREATE TABLE {$table_prefix}history (
static/css/admin-wp-4.4.css CHANGED
@@ -2,6 +2,7 @@
2
  margin-top: 8px;
3
  margin-bottom: 8px;
4
  }
 
5
  .wpallimport-plugin .step_description h2{
6
  font-size: 23px;
7
  font-weight: normal;
2
  margin-top: 8px;
3
  margin-bottom: 8px;
4
  }
5
+
6
  .wpallimport-plugin .step_description h2{
7
  font-size: 23px;
8
  font-weight: normal;
static/css/admin.css CHANGED
@@ -4,6 +4,7 @@
4
  *
5
  *-------------------------------------------------------------------------*/
6
  body.wpallimport-plugin {
 
7
  overflow-anchor: none;
8
  }
9
  .wpallimport-plugin hr {
@@ -27,12 +28,38 @@ body.wpallimport-plugin {
27
  vertical-align: middle;
28
  margin-left: 5px;
29
  position: relative;
30
- top: -4px;
31
  background-size: cover;
32
 
33
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  .wpallimport-plugin input.datepicker {
35
- width: 8em;
36
  }
37
  .wpallimport-plugin button.ui-datepicker-trigger {
38
  background-image: url("../img/date-picker.gif");
@@ -44,6 +71,22 @@ body.wpallimport-plugin {
44
  height: 18px;
45
  vertical-align: middle;
46
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  .wpallimport-plugin .progress-msg {
48
  font-style: italic;
49
  display: none;
@@ -86,7 +129,9 @@ body.wpallimport-plugin {
86
  background: url('../img/ui_4.0/continue.png') no-repeat 93% 50% #425f9a;
87
  border: none;
88
  }
89
- .wpallimport-plugin .wpallimport-large-button:hover{
 
 
90
  background: url('../img/ui_4.0/continue.png') no-repeat 93% 50% #425f9a;
91
  border: none;
92
  box-shadow: none;
@@ -368,10 +413,11 @@ body.wpallimport-plugin {
368
  color: #40acad;
369
  text-decoration: none;
370
  }
371
- .wpallimport-plugin div.error{
372
- clear: both;
373
  margin-top: 15px;
374
  }
 
375
  .wpallimport-plugin .wp-pointer-content ul,
376
  .wpallimport-plugin .wpallimport-pointer-content ul{
377
  list-style: disc inside none;
@@ -410,7 +456,7 @@ body.wpallimport-plugin {
410
  font-size: 12px;
411
  /*height: 25px;*/
412
  width: auto;
413
- padding: 2px;
414
  color: #000;
415
  }
416
  .wpallimport-plugin .wpallimport-template input[type="text"],
@@ -469,17 +515,14 @@ body.wpallimport-plugin {
469
  display: inline-block;
470
  width: 16px;
471
  height: 16px;
472
- margin: 0px 3px;
473
  }
474
  .wpallimport-plugin .add-new-ico,
475
  .wpallimport-plugin .add-new-cat,
476
  .wpallimport-plugin .add-new-custom,
477
- .wpallimport-plugin .add-new-key{
478
- background: url("../img/ui_4.0/add.png") no-repeat 0px 5px;
479
  font-size: 12px;
480
  width: 115px;
481
  height: 25px;
482
- padding-left: 20px;
483
  color: #21759B;
484
  padding-top: 2px;
485
  text-decoration: underline;
@@ -980,6 +1023,19 @@ p.upgrade_link {
980
  border-top: #F5F5F5 solid 1px;
981
  }
982
 
 
 
 
 
 
 
 
 
 
 
 
 
 
983
  /*--------------------------------------------------------------------------
984
  *
985
  * WP All Import Layout
@@ -1059,7 +1115,7 @@ p.upgrade_link {
1059
  -moz-border-radius: 4px;
1060
  -khtml-border-radius: 4px;
1061
  -webkit-border-radius: 4px;
1062
- margin-top: 20px;
1063
  margin-bottom: 20px;
1064
  padding-bottom: 15px;
1065
  }
@@ -2007,38 +2063,42 @@ p.upgrade_link {
2007
  .wpallimport-plugin .filtering_rules .drag-element{
2008
  background: url('../img/ui_4.0/list.png') no-repeat 0 3px;
2009
  padding-left: 30px;
2010
- height: 25px;
2011
  }
2012
  .wpallimport-plugin .filtering_rules .drag-element .rule_element{
2013
  display: inline-block;
2014
  width: 30%;
2015
  color:#46ba69;
2016
  font-size: 14px;
 
2017
  }
2018
  .wpallimport-plugin .filtering_rules .drag-element .rule_as_is{
2019
  display: inline-block;
2020
  width: 20%;
2021
  color:#40acad;
2022
  font-size: 14px;
 
2023
  }
2024
  .wpallimport-plugin .filtering_rules .drag-element .rule_condition_value{
2025
  display: inline-block;
2026
  width: 20%;
2027
  color:#000;
2028
  font-size: 14px;
 
 
 
2029
  }
2030
  .wpallimport-plugin .filtering_rules .drag-element .condition{
2031
  display: inline-block;
2032
  width: 25%;
2033
  color:#000;
2034
  font-size: 14px;
 
2035
  }
2036
  .wpallimport-plugin .filtering_rules li{
2037
  position: relative;
2038
  padding: 10px 20px;
2039
  margin: 0;
2040
  border-bottom: 1px solid #ddd;
2041
- height: 25px;
2042
  }
2043
  .wpallimport-plugin .filtering_rules li .remove-ico{
2044
  right: 4%;
@@ -2226,11 +2286,15 @@ p.upgrade_link {
2226
  .wpallimport-plugin form.wpallimport-template.edit {
2227
  /*width: 700px;*/
2228
  }
2229
- .wpallimport-plugin form.wpallimport-template .load-template {
2230
- display: block;
2231
- font-size: 12px;
2232
- }
2233
-
 
 
 
 
2234
  .wpallimport-plugin #poststuff{
2235
  min-width: 200px;
2236
  }
@@ -2623,11 +2687,18 @@ p.upgrade_link {
2623
  .wpallimport-plugin .ui-menu-item a{
2624
  text-decoration: none;
2625
  color: #777;
 
 
 
 
 
 
 
 
 
 
 
2626
  }
2627
- .wpallimport-plugin .ui-menu-item a.ui-state-focus,
2628
- .wpallimport-plugin .ui-menu-item a.ui-state-active{
2629
- margin: 0;
2630
- }
2631
  .wpallimport-plugin .ui-menu-item{
2632
  border-bottom: 1px solid #777;
2633
  }
@@ -2687,8 +2758,6 @@ p.upgrade_link {
2687
  }
2688
  .wpallimport-plugin .wpallimport-cf-menu li a{
2689
  padding: 0;
2690
- /*font-family: "Open Sans",​sans-serif;*/
2691
- font-size: 12px;
2692
  display: inline;
2693
  color: #777;
2694
  }
@@ -2704,6 +2773,11 @@ p.upgrade_link {
2704
  /*display: block;
2705
  padding: 5px;*/
2706
  }
 
 
 
 
 
2707
  /*--------------------------------------------------------------------------
2708
  *
2709
  * Step 4 - Import Options
@@ -3103,9 +3177,9 @@ p.upgrade_link {
3103
  .wpallimport-plugin .tag {
3104
  position: fixed;
3105
  max-width: 450px;
3106
- top: 127px;
3107
  padding-bottom: 20px;
3108
  margin-right: 15px;
 
3109
  width: 22%;
3110
  }
3111
  .wpallimport-plugin #wp-content-editor-tools{
@@ -3225,6 +3299,9 @@ p.upgrade_link {
3225
  color: #40acad;
3226
  font-weight: bold;
3227
  }
 
 
 
3228
  .wpallimport-plugin .xml-tag.opening .xml-tag-name {
3229
  cursor: pointer;
3230
  }
@@ -3393,6 +3470,11 @@ p.upgrade_link {
3393
  .wpallimport-plugin .pmxi-admin-imports .column-info{
3394
  width: 150px;
3395
  }
 
 
 
 
 
3396
  .wpallimport-plugin .scheduling-disabled {
3397
  color: #555;
3398
  text-decoration: none;
@@ -3516,6 +3598,10 @@ p.upgrade_link {
3516
  border-color: #0071a1;
3517
  color: #fff;
3518
  }
 
 
 
 
3519
  /*--------------------------------------------------------------------------
3520
  *
3521
  * RTL
@@ -3532,6 +3618,11 @@ body.rtl.wpallimport-plugin .show_hints
3532
  right: auto;
3533
  left: -1px;
3534
  }
 
 
 
 
 
3535
  /*--------------------------------------------------------------------------
3536
  *
3537
  * Media Queries
@@ -3651,6 +3742,22 @@ body.rtl.wpallimport-plugin .show_hints
3651
  }
3652
  }
3653
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3654
  @media screen and (min-width: 1150px) and (max-width: 1249px) {
3655
  .wpallimport-plugin .wpallimport-wrapper{
3656
  width: 920px;
@@ -3916,3 +4023,9 @@ body.rtl.wpallimport-plugin .show_hints
3916
  font-size: 16px;
3917
  }*/
3918
  }
 
 
 
 
 
 
4
  *
5
  *-------------------------------------------------------------------------*/
6
  body.wpallimport-plugin {
7
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
8
  overflow-anchor: none;
9
  }
10
  .wpallimport-plugin hr {
28
  vertical-align: middle;
29
  margin-left: 5px;
30
  position: relative;
31
+ top: 4px;
32
  background-size: cover;
33
 
34
  }
35
+ .wpallimport-plugin .ui-datepicker {
36
+ /* Overwrite jQuery UI font family */
37
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
38
+
39
+
40
+ }
41
+ .wpallimport-plugin .ui-state-default {
42
+ font-weight: normal;
43
+ }
44
+ .wpallimport-plugin .ui-state-highlight,
45
+ .wpallimport-plugin .ui-state-active {
46
+ color: #fff;
47
+ }
48
+ .wpallimport-plugin .ui-state-highlight {
49
+ border: 1px dashed #40acad;
50
+ background: #fff;
51
+ color: #1d5987;
52
+ }
53
+ .wpallimport-plugin .ui-state-highlight.ui-state-active {
54
+ border: 1px dashed #fff;
55
+ background: #40acad;
56
+ }
57
+ .wpallimport-plugin .ui-datepicker-prev,
58
+ .wpallimport-plugin .ui-datepicker-next {
59
+ cursor: pointer;
60
+ }
61
  .wpallimport-plugin input.datepicker {
62
+ width: 10em;
63
  }
64
  .wpallimport-plugin button.ui-datepicker-trigger {
65
  background-image: url("../img/date-picker.gif");
71
  height: 18px;
72
  vertical-align: middle;
73
  }
74
+ .wpallimport-plugin .ui_tpicker_time_label,
75
+ .wpallimport-plugin .ui_tpicker_hour_label,
76
+ .wpallimport-plugin .ui_tpicker_minute_label {
77
+ font-weight: bold;
78
+ color: #444;
79
+ }
80
+ .wpallimport-plugin .ui_tpicker_time,
81
+ .wpallimport-plugin .ui_tpicker_hour,
82
+ .wpallimport-plugin .ui_tpicker_minute {
83
+ margin: 10px 0;
84
+ }
85
+ .wpallimport-plugin .ui-datepicker-close {
86
+ background: #40acad;
87
+ border-radius: 4px;
88
+ color: #fff;
89
+ }
90
  .wpallimport-plugin .progress-msg {
91
  font-style: italic;
92
  display: none;
129
  background: url('../img/ui_4.0/continue.png') no-repeat 93% 50% #425f9a;
130
  border: none;
131
  }
132
+ .wpallimport-plugin .wpallimport-large-button:hover,
133
+ .wpallimport-plugin .wpallimport-large-button:active,
134
+ .wpallimport-plugin .wpallimport-large-button:focus {
135
  background: url('../img/ui_4.0/continue.png') no-repeat 93% 50% #425f9a;
136
  border: none;
137
  box-shadow: none;
413
  color: #40acad;
414
  text-decoration: none;
415
  }
416
+ .wpallimport-plugin div.error,
417
+ .wpallimport-plugin div.updated{
418
  margin-top: 15px;
419
  }
420
+
421
  .wpallimport-plugin .wp-pointer-content ul,
422
  .wpallimport-plugin .wpallimport-pointer-content ul{
423
  list-style: disc inside none;
456
  font-size: 12px;
457
  /*height: 25px;*/
458
  width: auto;
459
+ padding: 4px 25px 4px 6px;
460
  color: #000;
461
  }
462
  .wpallimport-plugin .wpallimport-template input[type="text"],
515
  display: inline-block;
516
  width: 16px;
517
  height: 16px;
 
518
  }
519
  .wpallimport-plugin .add-new-ico,
520
  .wpallimport-plugin .add-new-cat,
521
  .wpallimport-plugin .add-new-custom,
522
+ .wpallimport-plugin .add-new-key{
 
523
  font-size: 12px;
524
  width: 115px;
525
  height: 25px;
 
526
  color: #21759B;
527
  padding-top: 2px;
528
  text-decoration: underline;
1023
  border-top: #F5F5F5 solid 1px;
1024
  }
1025
 
1026
+ .wpallimport-plugin .delimiter-field {
1027
+ display: flex;
1028
+ flex-direction: row;
1029
+ }
1030
+
1031
+ .wpallimport-plugin .delimiter-field input:nth-child(1) {
1032
+ width: 100%;
1033
+ }
1034
+
1035
+ .wpallimport-plugin .delimiter-field input:nth-child(2) {
1036
+ margin-left: 5px;
1037
+ }
1038
+
1039
  /*--------------------------------------------------------------------------
1040
  *
1041
  * WP All Import Layout
1115
  -moz-border-radius: 4px;
1116
  -khtml-border-radius: 4px;
1117
  -webkit-border-radius: 4px;
1118
+ margin-top: 10px;
1119
  margin-bottom: 20px;
1120
  padding-bottom: 15px;
1121
  }
2063
  .wpallimport-plugin .filtering_rules .drag-element{
2064
  background: url('../img/ui_4.0/list.png') no-repeat 0 3px;
2065
  padding-left: 30px;
 
2066
  }
2067
  .wpallimport-plugin .filtering_rules .drag-element .rule_element{
2068
  display: inline-block;
2069
  width: 30%;
2070
  color:#46ba69;
2071
  font-size: 14px;
2072
+ vertical-align: top;
2073
  }
2074
  .wpallimport-plugin .filtering_rules .drag-element .rule_as_is{
2075
  display: inline-block;
2076
  width: 20%;
2077
  color:#40acad;
2078
  font-size: 14px;
2079
+ vertical-align: top;
2080
  }
2081
  .wpallimport-plugin .filtering_rules .drag-element .rule_condition_value{
2082
  display: inline-block;
2083
  width: 20%;
2084
  color:#000;
2085
  font-size: 14px;
2086
+ word-wrap: break-word;
2087
+ vertical-align: top;
2088
+ max-width: 20vw;
2089
  }
2090
  .wpallimport-plugin .filtering_rules .drag-element .condition{
2091
  display: inline-block;
2092
  width: 25%;
2093
  color:#000;
2094
  font-size: 14px;
2095
+ vertical-align: top;
2096
  }
2097
  .wpallimport-plugin .filtering_rules li{
2098
  position: relative;
2099
  padding: 10px 20px;
2100
  margin: 0;
2101
  border-bottom: 1px solid #ddd;
 
2102
  }
2103
  .wpallimport-plugin .filtering_rules li .remove-ico{
2104
  right: 4%;
2286
  .wpallimport-plugin form.wpallimport-template.edit {
2287
  /*width: 700px;*/
2288
  }
2289
+ .wpallimport-plugin form.wpallimport-template .load-template {
2290
+ display: block;
2291
+ font-size: 12px;
2292
+ }
2293
+ .wpallimport-plugin form.wpallimport-template .load-template select {
2294
+ width: auto;
2295
+ height: 40px;
2296
+ padding: 4px 25px 4px 6px;
2297
+ }
2298
  .wpallimport-plugin #poststuff{
2299
  min-width: 200px;
2300
  }
2687
  .wpallimport-plugin .ui-menu-item a{
2688
  text-decoration: none;
2689
  color: #777;
2690
+
2691
+ font-size: 12px;
2692
+
2693
+ /* Overwrite jQuery UI font family */
2694
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
2695
+ }
2696
+ .wpallimport-plugin .ui-menu-item a.ui-state-focus,
2697
+ .wpallimport-plugin .ui-menu-item a.ui-state-active{
2698
+ background: inherit;
2699
+ border: inherit;
2700
+ margin: 0;
2701
  }
 
 
 
 
2702
  .wpallimport-plugin .ui-menu-item{
2703
  border-bottom: 1px solid #777;
2704
  }
2758
  }
2759
  .wpallimport-plugin .wpallimport-cf-menu li a{
2760
  padding: 0;
 
 
2761
  display: inline;
2762
  color: #777;
2763
  }
2773
  /*display: block;
2774
  padding: 5px;*/
2775
  }
2776
+ .wpallimport-plugin .ui-datepicker-trigger {
2777
+ position: relative;
2778
+ top: -2px;
2779
+ right: 30px;
2780
+ }
2781
  /*--------------------------------------------------------------------------
2782
  *
2783
  * Step 4 - Import Options
3177
  .wpallimport-plugin .tag {
3178
  position: fixed;
3179
  max-width: 450px;
 
3180
  padding-bottom: 20px;
3181
  margin-right: 15px;
3182
+ margin-top: 10px;
3183
  width: 22%;
3184
  }
3185
  .wpallimport-plugin #wp-content-editor-tools{
3299
  color: #40acad;
3300
  font-weight: bold;
3301
  }
3302
+ .wpallimport-plugin .csv-tag-name {
3303
+ word-wrap: break-word;
3304
+ }
3305
  .wpallimport-plugin .xml-tag.opening .xml-tag-name {
3306
  cursor: pointer;
3307
  }
3470
  .wpallimport-plugin .pmxi-admin-imports .column-info{
3471
  width: 150px;
3472
  }
3473
+ .wpallimport-plugin .manage-column.check-column,
3474
+ .wpallimport-plugin #the-pmxi-admin-import-list .check-column{
3475
+ padding: 10px;
3476
+ }
3477
+
3478
  .wpallimport-plugin .scheduling-disabled {
3479
  color: #555;
3480
  text-decoration: none;
3598
  border-color: #0071a1;
3599
  color: #fff;
3600
  }
3601
+ .wpallimport-plugin .wp_all_import_saving_status {
3602
+ padding: 10px;
3603
+ display: block;
3604
+ }
3605
  /*--------------------------------------------------------------------------
3606
  *
3607
  * RTL
3618
  right: auto;
3619
  left: -1px;
3620
  }
3621
+
3622
+ .wpallimport-plugin .settings .submit-buttons {
3623
+ margin-top: 30px;
3624
+ margin-bottom: 30px;
3625
+ }
3626
  /*--------------------------------------------------------------------------
3627
  *
3628
  * Media Queries
3742
  }
3743
  }
3744
 
3745
+ @media screen and (max-width: 1149px) {
3746
+ .wpallimport-plugin .wpallimport-choose-elements table tbody tr:last-of-type td {
3747
+ overflow: visible;
3748
+ padding-left: 5px;
3749
+ }
3750
+ .wpallimport-plugin #pmxi_add_rule{
3751
+ background: url("../img/ui_4.0/rule.png") no-repeat scroll 5px 5px #40acad;
3752
+ display: flex;
3753
+ justify-content: center;
3754
+ align-items: center;
3755
+ width: 100%;
3756
+ height: 46px;
3757
+ padding: 0;
3758
+ }
3759
+ }
3760
+
3761
  @media screen and (min-width: 1150px) and (max-width: 1249px) {
3762
  .wpallimport-plugin .wpallimport-wrapper{
3763
  width: 920px;
4023
  font-size: 16px;
4024
  }*/
4025
  }
4026
+
4027
+ @media screen and (min-width: 783px) {
4028
+ .wpallimport-plugin input[type="checkbox"]{
4029
+ max-width: 1rem;
4030
+ }
4031
+ }
static/js/admin.js CHANGED
@@ -185,7 +185,7 @@
185
  $(this).next('h3').css({'cursor':'pointer'});
186
  });
187
 
188
- $('a.collapser').click(function(){
189
  if ($(this).html() == "+") {
190
  $(this).html("-");
191
  $(this).parents('div:first').find('.collapser_content:first').fadeIn();
@@ -196,7 +196,7 @@
196
  });
197
 
198
  $('a.collapser').each(function(){
199
- $(this).parents('.fieldset:first').find('h3:first').click(function(){
200
  $(this).prev('a.collapser').click();
201
  });
202
  });
@@ -283,7 +283,7 @@
283
  }
284
  });
285
 
286
- $('.wpallimport-import-from').click(function(){
287
 
288
  var showImportType = false;
289
 
@@ -325,7 +325,7 @@
325
  });
326
  $('.wpallimport-import-from.selected').click();
327
 
328
- $('.wpallimport-download-from').click(function(){
329
  if ($(this).attr('rel') === 'url') {
330
  $('.wpallimport-download-resource-step-two-url').show();
331
  $('.wpallimport-download-resource-step-two-ftp').hide();
@@ -380,8 +380,8 @@
380
 
381
  var formHeight = ($('.wpallimport-layout').height() < 730) ? 730 : $('.wpallimport-layout').height();
382
 
383
- $('.wpallimport-import-from').click(function(){
384
-
385
  var showImportType = false;
386
 
387
  switch ($(this).attr('rel')){
@@ -404,7 +404,7 @@
404
  $('.wpallimport-download-resource').hide();
405
  break;
406
  }
407
-
408
  $('.wpallimport-import-from').removeClass('selected').addClass('bind');
409
  $('.wpallimport-import-types').find('h2').slideUp();
410
  $(this).addClass('selected').removeClass('bind');
@@ -412,7 +412,7 @@
412
  $('.wpallimport-choose-file').find('.wpallimport-file-upload-result').attr('rel', $(this).attr('rel'));
413
  $('.wpallimport-choose-file').find('.wpallimport-upload-type-container[rel=' + $(this).attr('rel') + ']').show();
414
  $('.wpallimport-choose-file').find('#wpallimport-url-upload-status').html('');
415
- $('.wpallimport-choose-file').find('input[name=type]').val( $(this).attr('rel').replace('_type', '') );
416
 
417
  if ($('.auto-generate-template').attr('rel') == $(this).attr('rel')){
418
  $('.auto-generate-template').css({'display':'inline-block'});
@@ -514,7 +514,7 @@
514
  $('.dd-container').fadeIn();
515
  });
516
 
517
- $('.wpallimport-download-from').click(function(){
518
  if ($(this).attr('rel') === 'url') {
519
  $('.wpallimport-download-resource-step-two-url').show();
520
  $('.wpallimport-download-resource-step-two-ftp').hide();
@@ -533,7 +533,7 @@
533
  $('.wpallimport-import-to.wpallimport-import-to-checked').click();
534
  $('.wpallimport-download-from.wpallimport-download-from-checked').click();
535
 
536
- $('a.auto-generate-template').click(function(){
537
  $('input[name^=auto_generate]').val('1');
538
  $(this).parents('form:first').submit();
539
  });
@@ -679,7 +679,7 @@
679
 
680
  var $detected_cf = new Array();
681
 
682
- $form.find('.preview, .preview_images, .preview_taxonomies, .preview_prices').click(function () {
683
  var $preview_type = $(this).attr('rel');
684
  var $options_slug = $(this).parent('div').find('.wp_all_import_section_slug').val();
685
 
@@ -783,7 +783,7 @@
783
  }
784
  });
785
 
786
- $form.find('input[name$=download_images]').click(function(){
787
  if ($(this).is(':checked') && $(this).val() == 'gallery' ) {
788
  $(this).parents('.wpallimport-collapsed-content:first').find('.advanced_options_files').find('p:first').show();
789
  $(this).parents('.wpallimport-collapsed-content:first').find('.advanced_options_files').find('input').attr({'disabled':'disabled'});
@@ -794,7 +794,7 @@
794
  });
795
 
796
  // Auto-detect custom fields
797
- $form.find('.auto_detect_cf').click(function(){
798
 
799
  var parent = $(this).parents('.wpallimport-collapsed-content:first');
800
  var request = {
@@ -860,7 +860,7 @@
860
  });
861
 
862
  // Clear all detected custom fields
863
- $form.find('.clear_detected_cf').click(function(){
864
  var parent = $(this).parents('.wpallimport-collapsed-content:first');
865
  if ($detected_cf.length){
866
  for (var i = 0; i < $detected_cf.length; i++){
@@ -915,7 +915,7 @@
915
  });
916
 
917
  // Auto-detect serialized custom fields
918
- $('.auto_detect_sf').on('click', function() {
919
  var $source = $(this).parents('table:first');
920
  var $destination = $('div#' + $source.attr('rel'));
921
  var $parentDestination = $destination.parents('tr:first');
@@ -993,7 +993,7 @@
993
  });
994
 
995
  // Taxonnomies
996
- $form.find('#show_hidden_ctx').click(function(){
997
  $(this).parents('table:first').find('tr.private_ctx').toggle();
998
  });
999
 
@@ -1075,7 +1075,7 @@
1075
  }
1076
  });
1077
 
1078
- $form.find('input[name$=download_images]').click(function(){
1079
  if ($(this).is(':checked') && $(this).val() == 'gallery') {
1080
  $(this).parents('table:first').find('.search_through_the_media_library').slideUp();
1081
  } else {
@@ -1089,13 +1089,13 @@
1089
  }
1090
  });
1091
 
1092
- $form.find('.wpallimport-dismiss-cf-welcome').click(function(){
1093
  $('.cf_welcome, .cf_detect_result').slideUp();
1094
  });
1095
  });
1096
 
1097
  // options form: highlight options of selected post type
1098
- $('form.wpallimport-template input[name="type"]').click(function() {
1099
  var $container = $(this).parents('.post-type-container');
1100
  $('.post-type-container').not($container).removeClass('selected').find('.post-type-options').hide();
1101
  $container.addClass('selected').find('.post-type-options').show();
@@ -1108,11 +1108,11 @@
1108
  });
1109
 
1110
  // options form: auto submit when `load options` checkbox is checked
1111
- $('input[name="load_options"]').click(function () {
1112
  if ($(this).is(':checked')) $(this).parents('form').submit();
1113
  });
1114
  // options form: auto submit when `reset options` checkbox is checked
1115
- $('form.wpallimport-template').find('input[name="reset_options"]').click(function () {
1116
  if ($(this).is(':checked')) $(this).parents('form').submit();
1117
  });
1118
  $(document).on('click', '.form-table .action.remove a, .cf-form-table .action.remove a, .tax-form-table .action.remove a', function () {
@@ -1160,7 +1160,7 @@
1160
 
1161
  var $xml = $('.wpallimport-xml');
1162
 
1163
- var xpathChanged = function () {
1164
  if ($input.val() == $input.data('checkedValue')) return;
1165
 
1166
  $form.addClass('loading');
@@ -1174,7 +1174,7 @@
1174
  go_to_template = false;
1175
  $submit.hide();
1176
  var evaluate = function(){
1177
- $.post('admin.php?page=pmxi-admin-import&action=evaluate', {xpath: $input.val(), show_element: $goto_element.val(), root_element:$root_element.val(), is_csv: $apply_delimiter.length, delimiter:$csv_delimiter.val(), security: wp_all_import_security}, function (response) {
1178
  if (response.result){
1179
  $('.wpallimport-elements-preloader').hide();
1180
  $('.ajax-console').html(response.html);
@@ -1227,30 +1227,38 @@
1227
  $('#filtering_rules').find('p').show();
1228
  }
1229
 
1230
- $get_default_xpath.click(function(){
1231
  $input.val($(this).attr('rel'));
1232
  if ($input.val() == $input.data('checkedValue')) return;
1233
  reset_filters();
1234
- $root_element.val($(this).attr('root')); $goto_element.val(1); xpathChanged();
 
 
1235
  });
1236
- $('.wpallimport-change-root-element').click(function(){
1237
  $input.val('/' + $(this).attr('rel'));
1238
  if ($input.val() == $input.data('checkedValue')) return;
1239
  $('.wpallimport-change-root-element').removeClass('selected');
1240
  $(this).addClass('selected');
1241
  reset_filters();
1242
  $('.root_element').html($(this).attr('rel'));
1243
- $root_element.val($(this).attr('rel')); $goto_element.val(1); xpathChanged();
 
 
1244
  });
1245
- $input.change(function(){$goto_element.val(1); xpathChanged();}).change();
 
 
 
1246
  $input.keyup(function (e) {
1247
  if (13 == e.keyCode) $(this).change();
1248
  });
1249
 
1250
- $apply_delimiter.click(function(){
1251
  if ( ! $input.attr('readonly') ){
1252
  $('input[name="xpath"]').data('checkedValue','');
1253
- xpathChanged();
 
1254
  }
1255
  });
1256
 
@@ -1266,7 +1274,7 @@
1266
  }
1267
  });
1268
 
1269
- $('#pmxi_add_rule').click(function(){
1270
 
1271
  var $el = $('#pmxi_xml_element');
1272
  var $rule = $('#pmxi_rule');
@@ -1282,7 +1290,7 @@
1282
  html += '<input type="hidden" value="'+ $el.val() +'" class="pmxi_xml_element"/>';
1283
  html += '<input type="hidden" value="'+ $rule.val() +'" class="pmxi_rule"/>';
1284
  html += '<input type="hidden" value="'+ $val.val() +'" class="pmxi_value"/>';
1285
- html += '<span class="rule_element">' + $el.val() + '</span> <span class="rule_as_is">' + $rule.find('option:selected').html() + '</span> <span class="rule_condition_value">"' + $val.val() +'"</span>';
1286
  html += '<span class="condition"> <label for="rule_and_'+relunumber+'">AND</label><input id="rule_and_'+relunumber+'" type="radio" value="and" name="rule_'+relunumber+'" checked="checked" class="rule_condition"/><label for="rule_or_'+relunumber+'">OR</label><input id="rule_or_'+relunumber+'" type="radio" value="or" name="rule_'+relunumber+'" class="rule_condition"/> </span>';
1287
  html += '</div><a href="javascript:void(0);" class="icon-item remove-ico"></a></li>';
1288
 
@@ -1303,6 +1311,7 @@
1303
 
1304
  $(document).on('click', '.filtering_rules li a.remove-ico', function() {
1305
  $(this).parents('li:first').remove();
 
1306
  if (!$('.filtering_rules').find('li').length){
1307
  $('#apply_filters').hide();
1308
  $('#filtering_rules').find('p').show();
@@ -1397,7 +1406,7 @@
1397
  if (lvl && rules.length > 1) filter += ') ';
1398
  }
1399
 
1400
- $('#apply_filters').click(function(){
1401
 
1402
  var xpath = $('input[name=xpath]').val();
1403
 
@@ -1406,13 +1415,13 @@
1406
  filter += ']';
1407
 
1408
  $input.val( $input.val().split('[')[0] + filter);
1409
-
1410
- $input.data('checkedValue', ''); xpathChanged();
1411
-
1412
  });
1413
  });
1414
 
1415
- $('form.wpallimport-choose-elements').find('input[type="submit"]').click(function(e){
1416
  e.preventDefault();
1417
  if (go_to_template) $(this).parents('form:first').submit();
1418
  });
@@ -1488,7 +1497,7 @@
1488
  $(this).autocomplete({
1489
  source: eval('__META_KEYS'),
1490
  minLength: 0
1491
- }).click(function () {
1492
  $(this).autocomplete('search', '');
1493
  $(this).attr('rel', '');
1494
  });
@@ -1508,7 +1517,7 @@
1508
  $ths.autocomplete({
1509
  source: eval(data.meta_values),
1510
  minLength: 0
1511
- }).click(function () {
1512
  $(this).autocomplete('search', '');
1513
  }).click();
1514
  }
@@ -1589,7 +1598,7 @@
1589
  $('.widefat').bind('focus', insertxpath );
1590
  });
1591
 
1592
- $('.add-new-cat').click(function(){
1593
  var $template = $(this).parents('td:first').find('ul.tax_hierarchical_logic').children('li.template');
1594
  var $number = $(this).parents('td:first').find('ul.tax_hierarchical_logic').children('li').length - 1;
1595
  var $cloneName = $template.find('input.assign_term').attr('name').replace('NUMBER', $number);
@@ -1602,7 +1611,7 @@
1602
  if ( ! $(this).children('li').not('.template').length ) $(this).next('.add-new-ico').click();
1603
  });
1604
 
1605
- $('form.wpallimport-template').find('input[type=submit]').click(function(e){
1606
 
1607
  e.preventDefault();
1608
 
@@ -1661,13 +1670,13 @@
1661
  $(this).find('input[name^=custom_duplicate_name]').autocomplete({
1662
  source: eval('__META_KEYS'),
1663
  minLength: 0
1664
- }).click(function () {
1665
  $(this).autocomplete('search', '');
1666
  $(this).attr('rel', '');
1667
  });
1668
  });
1669
 
1670
- $('.add-new-entry').click(function(){
1671
  var $template = $(this).parents('table').first().children('tbody').children('tr.template');
1672
  $number = $(this).parents('table').first().children('tbody').children('tr').length - 2;
1673
  $clone = $template.clone(true);
@@ -1680,7 +1689,7 @@
1680
  $clone.find('input[name^=custom_name]').autocomplete({
1681
  source: eval('__META_KEYS'),
1682
  minLength: 0
1683
- }).click(function () {
1684
  $(this).autocomplete('search', '');
1685
  $(this).attr('rel', '');
1686
  });
@@ -1700,14 +1709,14 @@
1700
  var $form = $(this);
1701
  var $uniqueKey = $form.find('input[name=unique_key]');
1702
  var $tmpUniqueKey = $form.find('input[name=tmp_unique_key]');
1703
- $form.find('.wpallimport-auto-detect-unique-key').click(function(){
1704
  $uniqueKey.val($tmpUniqueKey.val());
1705
  });
1706
  });
1707
 
1708
  $('form.edit').each(function(){
1709
  var $form = $(this);
1710
- $form.find('.wpallimport-change-unique-key').click(function(){
1711
  var $ths = $(this);
1712
  $( "#dialog-confirm" ).dialog({
1713
  resizable: false,
@@ -1729,7 +1738,7 @@
1729
  });
1730
  var $uniqueKey = $form.find('input[name=unique_key]');
1731
  var $tmpUniqueKey = $form.find('input[name=tmp_unique_key]');
1732
- $form.find('.wpallimport-auto-detect-unique-key').click(function(){
1733
  $uniqueKey.val($tmpUniqueKey.val());
1734
  });
1735
  });
@@ -1787,7 +1796,7 @@
1787
  else alert('Please enter encoding.');
1788
  });
1789
 
1790
- $('input[name=keep_custom_fields]').click(function(){
1791
  $(this).parents('.input:first').find('.keep_except').slideToggle();
1792
  });
1793
 
@@ -1874,7 +1883,7 @@
1874
  }
1875
  });
1876
 
1877
- $('.wpallimport-overlay').click(function(){
1878
  $('.wp-pointer').hide();
1879
  $('fieldset.wp-all-import-scheduling-help').hide();
1880
  $(this).hide();
@@ -1932,7 +1941,7 @@
1932
  if ( ! $(this).hasClass('closed')) $(this).find('.wpallimport-collapsed-content:first').slideDown();
1933
  });
1934
 
1935
- $('.wpallimport-collapsed').find('.wpallimport-collapsed-header').not('.disabled').click(function(){
1936
  var $parent = $(this).parents('.wpallimport-collapsed:first');
1937
  if ($parent.hasClass('closed')){
1938
  $parent.removeClass('closed');
@@ -1957,12 +1966,12 @@
1957
  $(this).prev('div.input').find('input[type=text]:last, textarea:last').addClass('wpallimport-top-radius');
1958
  });
1959
 
1960
- $('.wpallimport-delete-and-edit, .download_import_template, .download_import_bundle').click(function(e){
1961
  e.preventDefault();
1962
  window.location.href = $(this).attr('rel');
1963
  });
1964
 
1965
- $('.wpallimport-wpae-notify-read-more').click(function(e){
1966
  e.preventDefault();
1967
 
1968
  var request = {
@@ -2020,7 +2029,7 @@
2020
 
2021
  wpai_are_sure_to_delete_import();
2022
 
2023
- $('#is_delete_import, #is_delete_posts').click(function(){
2024
  wpai_are_sure_to_delete_import();
2025
  });
2026
  // [\ Delete Import]
@@ -2037,23 +2046,23 @@
2037
  }
2038
  }
2039
 
2040
- $('.wpallimport-trigger-options').click(function(){
2041
  var $parent = $(this).parents('.switcher-target-update_choosen_data:first');
2042
  var $newtitle = $(this).attr('rel');
2043
  if ( $(this).hasClass('wpallimport-select-all') ) {
2044
- $parent.find('input[type=checkbox]').removeAttr('checked').click();
2045
  $(this).removeClass('wpallimport-select-all');
2046
  } else {
2047
- $parent.find('input[type=checkbox]:checked').click();
2048
  $(this).addClass('wpallimport-select-all');
2049
- }
2050
  $(this).attr('rel', $(this).html());
2051
  $(this).html($newtitle);
2052
  });
2053
 
2054
  $('table.pmxi-admin-imports').each(function () {
2055
  let manage_table = $(this);
2056
- $(this).find('thead tr th.check-column :checkbox, tfoot tr th.check-column :checkbox').click(function () {
2057
  let is_checked = $(this).is(':checked');
2058
  manage_table.find('tbody tr th.check-column :checkbox').prop('checked', function () {
2059
  if (is_checked) {
@@ -2065,13 +2074,19 @@
2065
  });
2066
 
2067
  var fix_tag_position = function(){
2068
- if ($('.wpallimport-layout').length && $('.tag').length){
2069
- var offset = $('.wpallimport-layout').offset();
2070
- if ($(document).scrollTop() > offset.top){
2071
- $('.tag').css({'top':'50px'});
 
 
 
 
 
 
2072
  $('.wpallimport-xml').css({'max-height': ($(window).height() - 147) + 'px' });
2073
  } else {
2074
- $('.tag').css({'top':'127px'});
2075
  $('.wpallimport-xml').css({'max-height': ($(window).height() - 220) + 'px' });
2076
  }
2077
  }
185
  $(this).next('h3').css({'cursor':'pointer'});
186
  });
187
 
188
+ $('a.collapser').on('click', function(){
189
  if ($(this).html() == "+") {
190
  $(this).html("-");
191
  $(this).parents('div:first').find('.collapser_content:first').fadeIn();
196
  });
197
 
198
  $('a.collapser').each(function(){
199
+ $(this).parents('.fieldset:first').find('h3:first').on('click', function(){
200
  $(this).prev('a.collapser').click();
201
  });
202
  });
283
  }
284
  });
285
 
286
+ $('.wpallimport-import-from').on('click', function(){
287
 
288
  var showImportType = false;
289
 
325
  });
326
  $('.wpallimport-import-from.selected').click();
327
 
328
+ $('.wpallimport-download-from').on('click', function(){
329
  if ($(this).attr('rel') === 'url') {
330
  $('.wpallimport-download-resource-step-two-url').show();
331
  $('.wpallimport-download-resource-step-two-ftp').hide();
380
 
381
  var formHeight = ($('.wpallimport-layout').height() < 730) ? 730 : $('.wpallimport-layout').height();
382
 
383
+ $('.wpallimport-import-from').on('click', function(){
384
+
385
  var showImportType = false;
386
 
387
  switch ($(this).attr('rel')){
404
  $('.wpallimport-download-resource').hide();
405
  break;
406
  }
407
+
408
  $('.wpallimport-import-from').removeClass('selected').addClass('bind');
409
  $('.wpallimport-import-types').find('h2').slideUp();
410
  $(this).addClass('selected').removeClass('bind');
412
  $('.wpallimport-choose-file').find('.wpallimport-file-upload-result').attr('rel', $(this).attr('rel'));
413
  $('.wpallimport-choose-file').find('.wpallimport-upload-type-container[rel=' + $(this).attr('rel') + ']').show();
414
  $('.wpallimport-choose-file').find('#wpallimport-url-upload-status').html('');
415
+ $('.wpallimport-choose-file').find('input[name=type]').val( $(this).attr('rel').replace('_type', '') );
416
 
417
  if ($('.auto-generate-template').attr('rel') == $(this).attr('rel')){
418
  $('.auto-generate-template').css({'display':'inline-block'});
514
  $('.dd-container').fadeIn();
515
  });
516
 
517
+ $('.wpallimport-download-from').on('click', function(){
518
  if ($(this).attr('rel') === 'url') {
519
  $('.wpallimport-download-resource-step-two-url').show();
520
  $('.wpallimport-download-resource-step-two-ftp').hide();
533
  $('.wpallimport-import-to.wpallimport-import-to-checked').click();
534
  $('.wpallimport-download-from.wpallimport-download-from-checked').click();
535
 
536
+ $('a.auto-generate-template').on('click', function(){
537
  $('input[name^=auto_generate]').val('1');
538
  $(this).parents('form:first').submit();
539
  });
679
 
680
  var $detected_cf = new Array();
681
 
682
+ $form.find('.preview, .preview_images, .preview_taxonomies, .preview_prices').on('click', function () {
683
  var $preview_type = $(this).attr('rel');
684
  var $options_slug = $(this).parent('div').find('.wp_all_import_section_slug').val();
685
 
783
  }
784
  });
785
 
786
+ $form.find('input[name$=download_images]').on('click', function(){
787
  if ($(this).is(':checked') && $(this).val() == 'gallery' ) {
788
  $(this).parents('.wpallimport-collapsed-content:first').find('.advanced_options_files').find('p:first').show();
789
  $(this).parents('.wpallimport-collapsed-content:first').find('.advanced_options_files').find('input').attr({'disabled':'disabled'});
794
  });
795
 
796
  // Auto-detect custom fields
797
+ $form.find('.auto_detect_cf').on('click', function(){
798
 
799
  var parent = $(this).parents('.wpallimport-collapsed-content:first');
800
  var request = {
860
  });
861
 
862
  // Clear all detected custom fields
863
+ $form.find('.clear_detected_cf').on('click', function(){
864
  var parent = $(this).parents('.wpallimport-collapsed-content:first');
865
  if ($detected_cf.length){
866
  for (var i = 0; i < $detected_cf.length; i++){
915
  });
916
 
917
  // Auto-detect serialized custom fields
918
+ $(document).on('click', '.auto_detect_sf', function() {
919
  var $source = $(this).parents('table:first');
920
  var $destination = $('div#' + $source.attr('rel'));
921
  var $parentDestination = $destination.parents('tr:first');
993
  });
994
 
995
  // Taxonnomies
996
+ $form.find('#show_hidden_ctx').on('click', function(){
997
  $(this).parents('table:first').find('tr.private_ctx').toggle();
998
  });
999
 
1075
  }
1076
  });
1077
 
1078
+ $form.find('input[name$=download_images]').on('click', function(){
1079
  if ($(this).is(':checked') && $(this).val() == 'gallery') {
1080
  $(this).parents('table:first').find('.search_through_the_media_library').slideUp();
1081
  } else {
1089
  }
1090
  });
1091
 
1092
+ $form.find('.wpallimport-dismiss-cf-welcome').on('click', function(){
1093
  $('.cf_welcome, .cf_detect_result').slideUp();
1094
  });
1095
  });
1096
 
1097
  // options form: highlight options of selected post type
1098
+ $('form.wpallimport-template input[name="type"]').on('click', function() {
1099
  var $container = $(this).parents('.post-type-container');
1100
  $('.post-type-container').not($container).removeClass('selected').find('.post-type-options').hide();
1101
  $container.addClass('selected').find('.post-type-options').show();
1108
  });
1109
 
1110
  // options form: auto submit when `load options` checkbox is checked
1111
+ $('input[name="load_options"]').on('click', function () {
1112
  if ($(this).is(':checked')) $(this).parents('form').submit();
1113
  });
1114
  // options form: auto submit when `reset options` checkbox is checked
1115
+ $('form.wpallimport-template').find('input[name="reset_options"]').on('click', function () {
1116
  if ($(this).is(':checked')) $(this).parents('form').submit();
1117
  });
1118
  $(document).on('click', '.form-table .action.remove a, .cf-form-table .action.remove a, .tax-form-table .action.remove a', function () {
1160
 
1161
  var $xml = $('.wpallimport-xml');
1162
 
1163
+ var xpathChanged = function (reset_element) {
1164
  if ($input.val() == $input.data('checkedValue')) return;
1165
 
1166
  $form.addClass('loading');
1174
  go_to_template = false;
1175
  $submit.hide();
1176
  var evaluate = function(){
1177
+ $.post('admin.php?page=pmxi-admin-import&action=evaluate', {xpath: $input.val(), show_element: reset_element ? 1 : $goto_element.val(), root_element:$root_element.val(), is_csv: $apply_delimiter.length, delimiter:$csv_delimiter.val(), security: wp_all_import_security}, function (response) {
1178
  if (response.result){
1179
  $('.wpallimport-elements-preloader').hide();
1180
  $('.ajax-console').html(response.html);
1227
  $('#filtering_rules').find('p').show();
1228
  }
1229
 
1230
+ $get_default_xpath.on('click', function(){
1231
  $input.val($(this).attr('rel'));
1232
  if ($input.val() == $input.data('checkedValue')) return;
1233
  reset_filters();
1234
+ $root_element.val($(this).attr('root'));
1235
+ $goto_element.val(1);
1236
+ xpathChanged(true);
1237
  });
1238
+ $('.wpallimport-change-root-element').on('click', function(){
1239
  $input.val('/' + $(this).attr('rel'));
1240
  if ($input.val() == $input.data('checkedValue')) return;
1241
  $('.wpallimport-change-root-element').removeClass('selected');
1242
  $(this).addClass('selected');
1243
  reset_filters();
1244
  $('.root_element').html($(this).attr('rel'));
1245
+ $root_element.val($(this).attr('rel'));
1246
+ $goto_element.val(1);
1247
+ xpathChanged(true);
1248
  });
1249
+ $input.change(function(){
1250
+ $goto_element.val(1);
1251
+ xpathChanged(true);
1252
+ }).change();
1253
  $input.keyup(function (e) {
1254
  if (13 == e.keyCode) $(this).change();
1255
  });
1256
 
1257
+ $apply_delimiter.on('click', function(){
1258
  if ( ! $input.attr('readonly') ){
1259
  $('input[name="xpath"]').data('checkedValue','');
1260
+ $goto_element.val(1);
1261
+ xpathChanged(true);
1262
  }
1263
  });
1264
 
1274
  }
1275
  });
1276
 
1277
+ $('#pmxi_add_rule').on('click', function(){
1278
 
1279
  var $el = $('#pmxi_xml_element');
1280
  var $rule = $('#pmxi_rule');
1290
  html += '<input type="hidden" value="'+ $el.val() +'" class="pmxi_xml_element"/>';
1291
  html += '<input type="hidden" value="'+ $rule.val() +'" class="pmxi_rule"/>';
1292
  html += '<input type="hidden" value="'+ $val.val() +'" class="pmxi_value"/>';
1293
+ html += '<span class="rule_element">' + $el.val() + '</span><span class="rule_as_is">' + $rule.find('option:selected').html() + '</span><span class="rule_condition_value">"' + $val.val() +'"</span>';
1294
  html += '<span class="condition"> <label for="rule_and_'+relunumber+'">AND</label><input id="rule_and_'+relunumber+'" type="radio" value="and" name="rule_'+relunumber+'" checked="checked" class="rule_condition"/><label for="rule_or_'+relunumber+'">OR</label><input id="rule_or_'+relunumber+'" type="radio" value="or" name="rule_'+relunumber+'" class="rule_condition"/> </span>';
1295
  html += '</div><a href="javascript:void(0);" class="icon-item remove-ico"></a></li>';
1296
 
1311
 
1312
  $(document).on('click', '.filtering_rules li a.remove-ico', function() {
1313
  $(this).parents('li:first').remove();
1314
+ $('.filtering_rules').find('li:last div span.condition').hide();
1315
  if (!$('.filtering_rules').find('li').length){
1316
  $('#apply_filters').hide();
1317
  $('#filtering_rules').find('p').show();
1406
  if (lvl && rules.length > 1) filter += ') ';
1407
  }
1408
 
1409
+ $('#apply_filters').on('click', function(){
1410
 
1411
  var xpath = $('input[name=xpath]').val();
1412
 
1415
  filter += ']';
1416
 
1417
  $input.val( $input.val().split('[')[0] + filter);
1418
+ $input.data('checkedValue', '');
1419
+ $goto_element.val(1);
1420
+ xpathChanged(true);
1421
  });
1422
  });
1423
 
1424
+ $('form.wpallimport-choose-elements').find('input[type="submit"]').on('click', function(e){
1425
  e.preventDefault();
1426
  if (go_to_template) $(this).parents('form:first').submit();
1427
  });
1497
  $(this).autocomplete({
1498
  source: eval('__META_KEYS'),
1499
  minLength: 0
1500
+ }).on('click', function () {
1501
  $(this).autocomplete('search', '');
1502
  $(this).attr('rel', '');
1503
  });
1517
  $ths.autocomplete({
1518
  source: eval(data.meta_values),
1519
  minLength: 0
1520
+ }).on('click', function () {
1521
  $(this).autocomplete('search', '');
1522
  }).click();
1523
  }
1598
  $('.widefat').bind('focus', insertxpath );
1599
  });
1600
 
1601
+ $('.add-new-cat').on('click', function(){
1602
  var $template = $(this).parents('td:first').find('ul.tax_hierarchical_logic').children('li.template');
1603
  var $number = $(this).parents('td:first').find('ul.tax_hierarchical_logic').children('li').length - 1;
1604
  var $cloneName = $template.find('input.assign_term').attr('name').replace('NUMBER', $number);
1611
  if ( ! $(this).children('li').not('.template').length ) $(this).next('.add-new-ico').click();
1612
  });
1613
 
1614
+ $('form.wpallimport-template').find('input[type=submit]').on('click', function(e){
1615
 
1616
  e.preventDefault();
1617
 
1670
  $(this).find('input[name^=custom_duplicate_name]').autocomplete({
1671
  source: eval('__META_KEYS'),
1672
  minLength: 0
1673
+ }).on('click', function () {
1674
  $(this).autocomplete('search', '');
1675
  $(this).attr('rel', '');
1676
  });
1677
  });
1678
 
1679
+ $('.add-new-entry').on('click', function(){
1680
  var $template = $(this).parents('table').first().children('tbody').children('tr.template');
1681
  $number = $(this).parents('table').first().children('tbody').children('tr').length - 2;
1682
  $clone = $template.clone(true);
1689
  $clone.find('input[name^=custom_name]').autocomplete({
1690
  source: eval('__META_KEYS'),
1691
  minLength: 0
1692
+ }).on('click', function () {
1693
  $(this).autocomplete('search', '');
1694
  $(this).attr('rel', '');
1695
  });
1709
  var $form = $(this);
1710
  var $uniqueKey = $form.find('input[name=unique_key]');
1711
  var $tmpUniqueKey = $form.find('input[name=tmp_unique_key]');
1712
+ $form.find('.wpallimport-auto-detect-unique-key').on('click', function(){
1713
  $uniqueKey.val($tmpUniqueKey.val());
1714
  });
1715
  });
1716
 
1717
  $('form.edit').each(function(){
1718
  var $form = $(this);
1719
+ $form.find('.wpallimport-change-unique-key').on('click', function(){
1720
  var $ths = $(this);
1721
  $( "#dialog-confirm" ).dialog({
1722
  resizable: false,
1738
  });
1739
  var $uniqueKey = $form.find('input[name=unique_key]');
1740
  var $tmpUniqueKey = $form.find('input[name=tmp_unique_key]');
1741
+ $form.find('.wpallimport-auto-detect-unique-key').on('click', function(){
1742
  $uniqueKey.val($tmpUniqueKey.val());
1743
  });
1744
  });
1796
  else alert('Please enter encoding.');
1797
  });
1798
 
1799
+ $('input[name=keep_custom_fields]').on('click', function(){
1800
  $(this).parents('.input:first').find('.keep_except').slideToggle();
1801
  });
1802
 
1883
  }
1884
  });
1885
 
1886
+ $('.wpallimport-overlay').on('click', function(){
1887
  $('.wp-pointer').hide();
1888
  $('fieldset.wp-all-import-scheduling-help').hide();
1889
  $(this).hide();
1941
  if ( ! $(this).hasClass('closed')) $(this).find('.wpallimport-collapsed-content:first').slideDown();
1942
  });
1943
 
1944
+ $('.wpallimport-collapsed').find('.wpallimport-collapsed-header').not('.disabled').on('click', function(){
1945
  var $parent = $(this).parents('.wpallimport-collapsed:first');
1946
  if ($parent.hasClass('closed')){
1947
  $parent.removeClass('closed');
1966
  $(this).prev('div.input').find('input[type=text]:last, textarea:last').addClass('wpallimport-top-radius');
1967
  });
1968
 
1969
+ $('.wpallimport-delete-and-edit, .download_import_template, .download_import_bundle').on('click', function(e){
1970
  e.preventDefault();
1971
  window.location.href = $(this).attr('rel');
1972
  });
1973
 
1974
+ $('.wpallimport-wpae-notify-read-more').on('click', function(e){
1975
  e.preventDefault();
1976
 
1977
  var request = {
2029
 
2030
  wpai_are_sure_to_delete_import();
2031
 
2032
+ $('#is_delete_import, #is_delete_posts').on('click', function(){
2033
  wpai_are_sure_to_delete_import();
2034
  });
2035
  // [\ Delete Import]
2046
  }
2047
  }
2048
 
2049
+ $('.wpallimport-trigger-options').on('click', function(){
2050
  var $parent = $(this).parents('.switcher-target-update_choosen_data:first');
2051
  var $newtitle = $(this).attr('rel');
2052
  if ( $(this).hasClass('wpallimport-select-all') ) {
2053
+ $parent.find('input[type=checkbox]').not('.exclude-select-all').removeAttr('checked').click();
2054
  $(this).removeClass('wpallimport-select-all');
2055
  } else {
2056
+ $parent.find('input[type=checkbox]:checked').not('.exclude-select-all').click();
2057
  $(this).addClass('wpallimport-select-all');
2058
+ }
2059
  $(this).attr('rel', $(this).html());
2060
  $(this).html($newtitle);
2061
  });
2062
 
2063
  $('table.pmxi-admin-imports').each(function () {
2064
  let manage_table = $(this);
2065
+ $(this).find('thead tr th.check-column :checkbox, tfoot tr th.check-column :checkbox').on('click', function () {
2066
  let is_checked = $(this).is(':checked');
2067
  manage_table.find('tbody tr th.check-column :checkbox').prop('checked', function () {
2068
  if (is_checked) {
2074
  });
2075
 
2076
  var fix_tag_position = function(){
2077
+ if ($('.wpallimport-layout').length && $('.tag').length && $('.wpallimport-content-section').length){
2078
+ var offset_top = $('.wpallimport-content-section').first().offset().top;
2079
+ var position_top = offset_top - $(document).scrollTop();
2080
+ var wordpress_adminbar_height = $('#wpadminbar').height();
2081
+
2082
+ $('.tag').css({'top': offset_top});
2083
+ $('.tag').css('margin-top', '0');
2084
+
2085
+ if ($(document).scrollTop() + wordpress_adminbar_height > offset_top){
2086
+ $('.tag').css({'top':'50px'});
2087
  $('.wpallimport-xml').css({'max-height': ($(window).height() - 147) + 'px' });
2088
  } else {
2089
+ $('.tag').css({'top': position_top + 'px' });
2090
  $('.wpallimport-xml').css({'max-height': ($(window).height() - 220) + 'px' });
2091
  }
2092
  }
static/js/plupload/wplupload.js CHANGED
@@ -177,7 +177,7 @@ $.fn.wplupload = function($options) {
177
  $('#advanced_upload').show();
178
  });
179
 
180
- $('#cancel-upload').click(function() {
181
  var i, file;
182
 
183
  $up.stop();
177
  $('#advanced_upload').show();
178
  });
179
 
180
+ $('#cancel-upload').on('click', function() {
181
  var i, file;
182
 
183
  $up.stop();
views/admin/import/element.php CHANGED
@@ -179,7 +179,7 @@
179
  </div>
180
  </div>
181
  <div id="wpallimport-filters" class="wpallimport-collapsed-content" style="padding:0;">
182
- <table style="width: 100%; font-weight: bold; padding: 20px;">
183
  <tr>
184
  <td style="width: 30%; padding-left: 30px;"><?php _e('Element', 'wp_all_import_plugin'); ?></td>
185
  <td style="width:20%;"><?php _e('Rule', 'wp_all_import_plugin'); ?></td>
179
  </div>
180
  </div>
181
  <div id="wpallimport-filters" class="wpallimport-collapsed-content" style="padding:0;">
182
+ <table style="width: 100%; font-weight: bold; padding: 20px 20px 0 20px;">
183
  <tr>
184
  <td style="width: 30%; padding-left: 30px;"><?php _e('Element', 'wp_all_import_plugin'); ?></td>
185
  <td style="width:20%;"><?php _e('Rule', 'wp_all_import_plugin'); ?></td>
views/admin/import/options/_import_file.php CHANGED
@@ -22,7 +22,7 @@
22
  <?php
23
  if ( ! empty($upload_validation) ):
24
  $file_type = strtoupper(pmxi_getExtension($post['file']));
25
- printf(__('Please verify that the file you using is a valid %s file.', 'wp_all_import_plugin'), $file_type);
26
  endif;
27
  ?>
28
  </h4>
22
  <?php
23
  if ( ! empty($upload_validation) ):
24
  $file_type = strtoupper(pmxi_getExtension($post['file']));
25
+ printf(__('This %s file has errors and is not valid.', 'wp_all_import_plugin'), $file_type);
26
  endif;
27
  ?>
28
  </h4>
views/admin/import/options/_reimport_options.php CHANGED
@@ -130,6 +130,13 @@
130
  <input type="checkbox" id="is_update_post_type" name="is_update_post_type" value="1" <?php echo $post['is_update_post_type'] ? 'checked="checked"': '' ?> />
131
  <label for="is_update_post_type"><?php _e('Post type', 'wp_all_import_plugin') ?></label>
132
  </div>
 
 
 
 
 
 
 
133
  <div class="input">
134
  <input type="hidden" name="is_update_comment_status" value="0" />
135
  <input type="checkbox" id="is_update_comment_status" name="is_update_comment_status" value="1" <?php echo $post['is_update_comment_status'] ? 'checked="checked"': '' ?> />
130
  <input type="checkbox" id="is_update_post_type" name="is_update_post_type" value="1" <?php echo $post['is_update_post_type'] ? 'checked="checked"': '' ?> />
131
  <label for="is_update_post_type"><?php _e('Post type', 'wp_all_import_plugin') ?></label>
132
  </div>
133
+ <?php if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ): ?>
134
+ <div class="input">
135
+ <input type="hidden" name="is_update_post_format" value="0" />
136
+ <input type="checkbox" id="is_update_post_format" name="is_update_post_format" value="1" <?php echo $post['is_update_post_format'] ? 'checked="checked"': '' ?> />
137
+ <label for="is_update_post_format"><?php _e('Post format', 'wp_all_import_plugin') ?></label>
138
+ </div>
139
+ <?php endif; ?>
140
  <div class="input">
141
  <input type="hidden" name="is_update_comment_status" value="0" />
142
  <input type="checkbox" id="is_update_comment_status" name="is_update_comment_status" value="1" <?php echo $post['is_update_comment_status'] ? 'checked="checked"': '' ?> />
views/admin/import/template.php CHANGED
@@ -201,7 +201,7 @@
201
  </div>
202
  <?php $templates = new PMXI_Template_List(); ?>
203
  <div class="load-template">
204
- <select name="load_template" id="load_template" style="padding:2px; width: auto; height: 40px;">
205
  <option value=""><?php _e('Load Template...', 'wp_all_import_plugin') ?></option>
206
  <?php foreach ($templates->getBy()->convertRecords() as $t): ?>
207
  <option value="<?php echo $t->id ?>"><?php echo $t->name ?></option>
201
  </div>
202
  <?php $templates = new PMXI_Template_List(); ?>
203
  <div class="load-template">
204
+ <select name="load_template" id="load_template">
205
  <option value=""><?php _e('Load Template...', 'wp_all_import_plugin') ?></option>
206
  <?php foreach ($templates->getBy()->convertRecords() as $t): ?>
207
  <option value="<?php echo $t->id ?>"><?php echo $t->name ?></option>
views/admin/import/template/_other_template.php CHANGED
@@ -128,10 +128,10 @@ $custom_type = get_post_type_object( $post_type );
128
  </tr>
129
  <tr>
130
  <td>
131
- <h4 style="float:left;"><?php _e('Download & Import Attachments', 'wp_all_import_plugin') ?></h4>
132
- <div style="clear:both;">
133
- <input type="text" name="attachments" style="width:87%;" value="<?php echo esc_attr($post['attachments']) ?>" />
134
- <input type="text" class="small" name="atch_delim" value="<?php echo esc_attr($post['atch_delim']) ?>" style="width:5%; text-align:center; float:right;"/>
135
  </div>
136
  <div class="input" style="margin:3px;">
137
  <input type="hidden" name="is_search_existing_attach" value="0" />
128
  </tr>
129
  <tr>
130
  <td>
131
+ <h4><?php _e('Download & Import Attachments', 'wp_all_import_plugin') ?></h4>
132
+ <div class="delimiter-field">
133
+ <input type="text" name="attachments" value="<?php echo esc_attr($post['attachments']) ?>" />
134
+ <input type="text" class="small" name="atch_delim" value="<?php echo esc_attr($post['atch_delim']) ?>" />
135
  </div>
136
  <div class="input" style="margin:3px;">
137
  <input type="hidden" name="is_search_existing_attach" value="0" />
views/admin/import/template/_taxonomies_template.php CHANGED
@@ -59,8 +59,7 @@ if ( ! empty($post_taxonomies)):
59
  <input type="radio" name="tax_logic[<?php echo $ctx->name;?>]" value="multiple" id="tax_logic_multiple_<?php echo $ctx->name;?>" class="switcher" <?php echo (!empty($post['tax_logic'][$ctx->name]) and $post['tax_logic'][$ctx->name] == 'multiple') ? 'checked="checked"' : ''; ?>/>
60
  <label for="tax_logic_multiple_<?php echo $ctx->name;?>"><?php printf(__('Each %s has multiple %s', 'wp_all_import_plugin'), $custom_type->labels->singular_name, $ctx->labels->name); ?></label>
61
  <div class="switcher-target-tax_logic_multiple_<?php echo $ctx->name;?> sub_input">
62
- <input type="hidden" name="multiple_term_assing[<?php echo $ctx->name;?>]" value="0"/>
63
- <input type="checkbox" name="multiple_term_assing[<?php echo $ctx->name;?>]" <?php echo (isset($post['multiple_term_assing'][$ctx->name])) ? (( ! empty($post['multiple_term_assing'][$ctx->name]) ) ? 'checked="checked"' : '') : 'checked="checked"'; ?> title="<?php _e('Assign post to the taxonomy.','wp_all_import_plugin');?>" value="1"/>
64
  <input type="text" class="widefat multiple_xpath_field" name="tax_multiple_xpath[<?php echo $ctx->name; ?>]" value="<?php echo ( ! empty($post['tax_multiple_xpath'][$ctx->name])) ? esc_textarea($post['tax_multiple_xpath'][$ctx->name]) : ''; ?>" style="width:50%;"/>
65
  <label><?php _e('Separated by', 'wp_all_import_plugin'); ?></label>
66
  <input type="text" class="small tax_delim" name="tax_multiple_delim[<?php echo $ctx->name; ?>]" value="<?php echo ( ! empty($post['tax_multiple_delim'][$ctx->name]) ) ? str_replace("&amp;","&", htmlentities(htmlentities($post['tax_multiple_delim'][$ctx->name]))) : ',' ?>" />
@@ -93,8 +92,7 @@ if ( ! empty($post_taxonomies)):
93
  <?php $txes_count = 0; if ( ! empty($post['tax_hierarchical_xpath'][$ctx->name])): foreach ($post['tax_hierarchical_xpath'][$ctx->name] as $k => $path) : if (empty($path)) continue; ?>
94
  <li class="dragging">
95
  <div style="position:relative;">
96
- <input type="hidden" name="tax_hierarchical_assing[<?php echo $ctx->name;?>][<?php echo $k;?>]" value="0"/>
97
- <input type="checkbox" class="assign_term" name="tax_hierarchical_assing[<?php echo $ctx->name;?>][<?php echo $k; ?>]" <?php echo (isset($post['tax_hierarchical_assing'][$ctx->name][$k])) ? (( ! empty($post['tax_hierarchical_assing'][$ctx->name][$k]) ) ? 'checked="checked"' : '') : 'checked="checked"'; ?> title="<?php _e('Assign post to the taxonomy.','wp_all_import_plugin');?>" value="1"/>
98
  <input type="text" class="widefat hierarchical_xpath_field" name="tax_hierarchical_xpath[<?php echo $ctx->name; ?>][]" value="<?php echo esc_textarea($path); ?>"/>
99
  <a href="javascript:void(0);" class="icon-item remove-ico" style="top:8px;"></a>
100
  </div>
@@ -103,8 +101,7 @@ if ( ! empty($post_taxonomies)):
103
  <?php if ( ! $txes_count): ?>
104
  <li class="dragging">
105
  <div style="position:relative;">
106
- <input type="hidden" name="tax_hierarchical_assing[<?php echo $ctx->name;?>][0]" value="0"/>
107
- <input type="checkbox" class="assign_term" name="tax_hierarchical_assing[<?php echo $ctx->name;?>][0]" checked="checked" title="<?php _e('Assign post to the taxonomy.','wp_all_import_plugin');?>" value="1"/>
108
  <input type="text" class="widefat hierarchical_xpath_field" name="tax_hierarchical_xpath[<?php echo $ctx->name; ?>][]" value=""/>
109
  <a href="javascript:void(0);" class="icon-item remove-ico" style="top:8px;"></a>
110
  </div>
@@ -112,8 +109,7 @@ if ( ! empty($post_taxonomies)):
112
  <?php endif; ?>
113
  <li class="dragging template">
114
  <div style="position:relative;">
115
- <input type="hidden" name="tax_hierarchical_assing[<?php echo $ctx->name;?>][NUMBER]" value="0"/>
116
- <input type="checkbox" class="assign_term" name="tax_hierarchical_assing[<?php echo $ctx->name;?>][NUMBER]" checked="checked" title="<?php _e('Assign post to the taxonomy.','wp_all_import_plugin');?>" value="1"/>
117
  <input type="text" class="widefat hierarchical_xpath_field" name="tax_hierarchical_xpath[<?php echo $ctx->name; ?>][]" value=""/>
118
  <a href="javascript:void(0);" class="icon-item remove-ico" style="top:8px;"></a>
119
  </div>
@@ -161,7 +157,7 @@ if ( ! empty($post_taxonomies)):
161
  ?>
162
  <li id="item_<?php echo $i; ?>" class="dragging">
163
  <div class="drag-element">
164
- <input type="checkbox" class="assign_term" <?php if (!empty($cat->assign)): ?>checked="checked"<?php endif; ?> title="<?php _e('Assign post to the taxonomy.','wp_all_import_plugin');?>"/>
165
  <input type="text" class="widefat xpath_field" value="<?php echo esc_textarea($cat->xpath); ?>"/>
166
 
167
  <?php do_action('pmxi_category_view', $cat, $i, $ctx->name, $post_type); ?>
@@ -179,14 +175,14 @@ if ( ! empty($post_taxonomies)):
179
  ?>
180
  <li id="item_1" class="dragging">
181
  <div class="drag-element">
182
- <input type="checkbox" class="assign_term" checked="checked" title="<?php _e('Assign post to the taxonomy.','wp_all_import_plugin');?>"/>
183
  <input type="text" class="widefat xpath_field" value=""/>
184
  </div>
185
  <a href="javascript:void(0);" class="icon-item remove-ico"></a>
186
  <ol>
187
  <li id="item_2" class="dragging">
188
  <div class="drag-element">
189
- <input type="checkbox" class="assign_term" checked="checked" title="<?php _e('Assign post to the taxonomy.','wp_all_import_plugin');?>"/>
190
  <input class="widefat xpath_field" type="text" value=""/>
191
  </div>
192
  <a href="javascript:void(0);" class="icon-item remove-ico"></a>
@@ -198,7 +194,7 @@ if ( ! empty($post_taxonomies)):
198
 
199
  <li id="item" class="template">
200
  <div class="drag-element">
201
- <input type="checkbox" class="assign_term" checked="checked" title="<?php _e('Assign post to the taxonomy.','wp_all_import_plugin');?>"/>
202
  <input type="text" class="widefat xpath_field" value=""/>
203
  <?php do_action('pmxi_category_view', false, false, $ctx->name, $post_type); ?>
204
  </div>
59
  <input type="radio" name="tax_logic[<?php echo $ctx->name;?>]" value="multiple" id="tax_logic_multiple_<?php echo $ctx->name;?>" class="switcher" <?php echo (!empty($post['tax_logic'][$ctx->name]) and $post['tax_logic'][$ctx->name] == 'multiple') ? 'checked="checked"' : ''; ?>/>
60
  <label for="tax_logic_multiple_<?php echo $ctx->name;?>"><?php printf(__('Each %s has multiple %s', 'wp_all_import_plugin'), $custom_type->labels->singular_name, $ctx->labels->name); ?></label>
61
  <div class="switcher-target-tax_logic_multiple_<?php echo $ctx->name;?> sub_input">
62
+ <input type="hidden" name="multiple_term_assing[<?php echo $ctx->name;?>]" value="1"/>
 
63
  <input type="text" class="widefat multiple_xpath_field" name="tax_multiple_xpath[<?php echo $ctx->name; ?>]" value="<?php echo ( ! empty($post['tax_multiple_xpath'][$ctx->name])) ? esc_textarea($post['tax_multiple_xpath'][$ctx->name]) : ''; ?>" style="width:50%;"/>
64
  <label><?php _e('Separated by', 'wp_all_import_plugin'); ?></label>
65
  <input type="text" class="small tax_delim" name="tax_multiple_delim[<?php echo $ctx->name; ?>]" value="<?php echo ( ! empty($post['tax_multiple_delim'][$ctx->name]) ) ? str_replace("&amp;","&", htmlentities(htmlentities($post['tax_multiple_delim'][$ctx->name]))) : ',' ?>" />
92
  <?php $txes_count = 0; if ( ! empty($post['tax_hierarchical_xpath'][$ctx->name])): foreach ($post['tax_hierarchical_xpath'][$ctx->name] as $k => $path) : if (empty($path)) continue; ?>
93
  <li class="dragging">
94
  <div style="position:relative;">
95
+ <input type="hidden" class="assign_term" name="tax_hierarchical_assing[<?php echo $ctx->name;?>][<?php echo $k;?>]" value="1"/>
 
96
  <input type="text" class="widefat hierarchical_xpath_field" name="tax_hierarchical_xpath[<?php echo $ctx->name; ?>][]" value="<?php echo esc_textarea($path); ?>"/>
97
  <a href="javascript:void(0);" class="icon-item remove-ico" style="top:8px;"></a>
98
  </div>
101
  <?php if ( ! $txes_count): ?>
102
  <li class="dragging">
103
  <div style="position:relative;">
104
+ <input type="hidden" class="assign_term" name="tax_hierarchical_assing[<?php echo $ctx->name;?>][0]" value="1"/>
 
105
  <input type="text" class="widefat hierarchical_xpath_field" name="tax_hierarchical_xpath[<?php echo $ctx->name; ?>][]" value=""/>
106
  <a href="javascript:void(0);" class="icon-item remove-ico" style="top:8px;"></a>
107
  </div>
109
  <?php endif; ?>
110
  <li class="dragging template">
111
  <div style="position:relative;">
112
+ <input type="hidden" class="assign_term" name="tax_hierarchical_assing[<?php echo $ctx->name;?>][NUMBER]" value="1"/>
 
113
  <input type="text" class="widefat hierarchical_xpath_field" name="tax_hierarchical_xpath[<?php echo $ctx->name; ?>][]" value=""/>
114
  <a href="javascript:void(0);" class="icon-item remove-ico" style="top:8px;"></a>
115
  </div>
157
  ?>
158
  <li id="item_<?php echo $i; ?>" class="dragging">
159
  <div class="drag-element">
160
+ <input type="hidden" class="assign_term" value="1"/>
161
  <input type="text" class="widefat xpath_field" value="<?php echo esc_textarea($cat->xpath); ?>"/>
162
 
163
  <?php do_action('pmxi_category_view', $cat, $i, $ctx->name, $post_type); ?>
175
  ?>
176
  <li id="item_1" class="dragging">
177
  <div class="drag-element">
178
+ <input type="hidden" class="assign_term" value="1"/>
179
  <input type="text" class="widefat xpath_field" value=""/>
180
  </div>
181
  <a href="javascript:void(0);" class="icon-item remove-ico"></a>
182
  <ol>
183
  <li id="item_2" class="dragging">
184
  <div class="drag-element">
185
+ <input type="hidden" class="assign_term" value="1"/>
186
  <input class="widefat xpath_field" type="text" value=""/>
187
  </div>
188
  <a href="javascript:void(0);" class="icon-item remove-ico"></a>
194
 
195
  <li id="item" class="template">
196
  <div class="drag-element">
197
+ <input type="hidden" class="assign_term" value="1"/>
198
  <input type="text" class="widefat xpath_field" value=""/>
199
  <?php do_action('pmxi_category_view', false, false, $ctx->name, $post_type); ?>
200
  </div>
views/admin/manage/index.php CHANGED
@@ -365,8 +365,8 @@ $columns = apply_filters('pmxi_manage_imports_columns', $columns);
365
  }
366
  ?>
367
 
368
- <p style='font-size: 1.3em; font-weight: bold;'><a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=import-plugin-free&utm_medium=help&utm_campaign=upgrade-to-pro" target="_blank" class="upgrade_link"><?php _e('Find out more about the Pro edition of WP All Import.', 'wp_all_import_plugin'); ?></a></p>
369
 
370
  <a href="http://soflyy.com/" target="_blank" class="wpallimport-created-by"><?php _e('Created by', 'wp_all_import_plugin'); ?> <span></span></a>
371
 
372
- </form>
365
  }
366
  ?>
367
 
368
+ <p style='font-size: 1.3em; font-weight: bold;'><a href="http://www.wpallimport.com/wordpress-xml-csv-import/?utm_source=import-plugin-free&utm_medium=help&utm_campaign=upgrade-to-pro" target="_blank" class="upgrade_link"><?php _e('Find out more about the Pro edition of WP All Import.', 'wp_all_import_plugin'); ?></a></p>
369
 
370
  <a href="http://soflyy.com/" target="_blank" class="wpallimport-created-by"><?php _e('Created by', 'wp_all_import_plugin'); ?> <span></span></a>
371
 
372
+ </form>
views/admin/settings/index.php CHANGED
@@ -129,19 +129,15 @@
129
  <label for="force_stream_reader"><input type="checkbox" value="1" id="force_stream_reader" name="force_stream_reader" <?php echo (($post['force_stream_reader']) ? 'checked="checked"' : ''); ?>><?php _e('Enable Stream Reader', 'wp_all_import_plugin'); ?></label>
130
  </fieldset>
131
  <p class="description"><?php _e('XMLReader is much faster, but has a bug that sometimes prevents certain records from being imported with import files that contain special cases.', 'wp_all_import_plugin'); ?></p>
 
 
 
 
 
132
  </td>
133
  </tr>
134
  </tbody>
135
  </table>
136
-
137
- <div class="clear"></div>
138
-
139
- <p class="submit-buttons">
140
- <?php wp_nonce_field('edit-settings', '_wpnonce_edit-settings') ?>
141
- <input type="hidden" name="is_settings_submitted" value="1" />
142
- <input type="submit" class="button-primary" value="Save Settings" />
143
- </p>
144
-
145
  </form>
146
 
147
  <?php
129
  <label for="force_stream_reader"><input type="checkbox" value="1" id="force_stream_reader" name="force_stream_reader" <?php echo (($post['force_stream_reader']) ? 'checked="checked"' : ''); ?>><?php _e('Enable Stream Reader', 'wp_all_import_plugin'); ?></label>
130
  </fieldset>
131
  <p class="description"><?php _e('XMLReader is much faster, but has a bug that sometimes prevents certain records from being imported with import files that contain special cases.', 'wp_all_import_plugin'); ?></p>
132
+ <p class="submit-buttons">
133
+ <?php wp_nonce_field('edit-settings', '_wpnonce_edit-settings') ?>
134
+ <input type="hidden" name="is_settings_submitted" value="1" />
135
+ <input type="submit" class="button-primary" value="Save Settings" />
136
+ </p>
137
  </td>
138
  </tr>
139
  </tbody>
140
  </table>
 
 
 
 
 
 
 
 
 
141
  </form>
142
 
143
  <?php