Import any XML or CSV File to WordPress - Version 3.2.0

Version Description

  • IMPORTANT: WP All Import v4 (3.2.0) is a MAJOR update. Read this post before upgrading: http://www.wpallimport.com/2014/11/free-version-wordpress-org-update-information
  • speed up the import of taxonomies/categories
  • added taxonomies/categories mapping feature
  • added custom fields auto-detection feature
  • added custom fields mapping feature
  • added images/taxonomies preview feature
  • added unofficial support for more file formats - json & sql
  • added new setting (secure mode) to protect your files
  • better import logs
  • updated design
Download this release

Release Info

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

Code changes from version 3.2.2 to 3.2.0

classes/chunk.php CHANGED
@@ -76,7 +76,7 @@ class PMXI_Chunk {
76
  $this->file = $file;
77
 
78
  if (empty($this->options['element'])){
79
- //$founded_tags = array();
80
 
81
  if (function_exists('stream_filter_register')){
82
  stream_filter_register('preprocessxml', 'preprocessXml_filter');
@@ -90,12 +90,8 @@ class PMXI_Chunk {
90
  while ( @$reader->read()) {
91
  switch ($reader->nodeType) {
92
  case (XMLREADER::ELEMENT):
93
- if (array_key_exists(str_replace(":", "_", $reader->localName), $this->cloud))
94
- $this->cloud[str_replace(":", "_", $reader->localName)]++;
95
- else
96
- $this->cloud[str_replace(":", "_", $reader->localName)] = 1;
97
- //array_push($founded_tags, str_replace(":", "_", $reader->localName));
98
-
99
  break;
100
  default:
101
 
@@ -104,7 +100,7 @@ class PMXI_Chunk {
104
  }
105
  unset($reader);
106
 
107
- /*if (!empty($founded_tags)) {
108
  $element_counts = array_count_values($founded_tags);
109
  if (!empty($element_counts)){
110
  foreach ($element_counts as $tag => $count)
@@ -113,12 +109,10 @@ class PMXI_Chunk {
113
 
114
  arsort($element_counts);
115
  }
116
- } */
117
 
118
  if (!empty($this->cloud)){
119
 
120
- arsort($this->cloud);
121
-
122
  $main_elements = array('node', 'product', 'job', 'deal', 'entry', 'item', 'property', 'listing', 'hotel', 'record', 'article', 'post', 'book');
123
 
124
  foreach ($this->cloud as $element_name => $value) {
@@ -128,11 +122,11 @@ class PMXI_Chunk {
128
  }
129
  }
130
  if (empty($this->options['element'])){
131
- foreach ($this->cloud as $el => $count) {
132
  $this->options['element'] = $el;
133
  break;
134
  }
135
- }
136
  }
137
  }
138
 
76
  $this->file = $file;
77
 
78
  if (empty($this->options['element'])){
79
+ $founded_tags = array();
80
 
81
  if (function_exists('stream_filter_register')){
82
  stream_filter_register('preprocessxml', 'preprocessXml_filter');
90
  while ( @$reader->read()) {
91
  switch ($reader->nodeType) {
92
  case (XMLREADER::ELEMENT):
93
+ array_push($founded_tags, str_replace(":", "_", $reader->localName));
94
+ //if (count($founded_tags) > 100) break(2);
 
 
 
 
95
  break;
96
  default:
97
 
100
  }
101
  unset($reader);
102
 
103
+ if (!empty($founded_tags)) {
104
  $element_counts = array_count_values($founded_tags);
105
  if (!empty($element_counts)){
106
  foreach ($element_counts as $tag => $count)
109
 
110
  arsort($element_counts);
111
  }
112
+ }
113
 
114
  if (!empty($this->cloud)){
115
 
 
 
116
  $main_elements = array('node', 'product', 'job', 'deal', 'entry', 'item', 'property', 'listing', 'hotel', 'record', 'article', 'post', 'book');
117
 
118
  foreach ($this->cloud as $element_name => $value) {
122
  }
123
  }
124
  if (empty($this->options['element'])){
125
+ foreach ($element_counts as $el => $count) {
126
  $this->options['element'] = $el;
127
  break;
128
  }
129
+ }
130
  }
131
  }
132
 
controllers/admin/import.php CHANGED
@@ -1564,12 +1564,11 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1564
  }
1565
  elseif ($upload_result !== false and $this->data['import']['path'] != $filePath) {
1566
 
1567
- $file = new PMXI_Chunk($upload_result['filePath'], array('element' => ( ! empty($this->data['import']->root_element)) ? $this->data['import']->root_element : ''));
1568
 
1569
- $root_element = '';
1570
- if ( ! empty($file->options['element']) ) {
1571
 
1572
- $root_element = $file->options['element'];
1573
 
1574
  $baseXpath = $this->data['import']->xpath;
1575
 
@@ -1604,8 +1603,6 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1604
 
1605
  if ( ! empty($file->options['element']) ) {
1606
 
1607
- $root_element = $file->options['element'];
1608
-
1609
  $baseXpath = '/' . $upload_result['root_element'];
1610
 
1611
  $loop = 0;
@@ -1637,8 +1634,6 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1637
 
1638
  }
1639
 
1640
- $upload_result['root_element'] = $root_element;
1641
-
1642
  $post['delimiter'] = ( ! empty($upload_result['is_csv']) ) ? $upload_result['is_csv'] : '';
1643
 
1644
  }
1564
  }
1565
  elseif ($upload_result !== false and $this->data['import']['path'] != $filePath) {
1566
 
1567
+ $file = new PMXI_Chunk($upload_result['filePath'], array('element' => ( ! empty($upload_result['root_element'])) ? $upload_result['root_element'] : ''));
1568
 
1569
+ if ( ! empty($file->options['element']) ) {
 
1570
 
1571
+ $upload_result['root_element'] = $file->options['element'];
1572
 
1573
  $baseXpath = $this->data['import']->xpath;
1574
 
1603
 
1604
  if ( ! empty($file->options['element']) ) {
1605
 
 
 
1606
  $baseXpath = '/' . $upload_result['root_element'];
1607
 
1608
  $loop = 0;
1634
 
1635
  }
1636
 
 
 
1637
  $post['delimiter'] = ( ! empty($upload_result['is_csv']) ) ? $upload_result['is_csv'] : '';
1638
 
1639
  }
controllers/admin/settings.php CHANGED
@@ -438,7 +438,7 @@ class PMXI_Admin_Settings extends PMXI_Controller_Admin {
438
  }
439
 
440
  // Return JSON-RPC response
441
- exit(json_encode(array("jsonrpc" => "2.0", "error" => null, "result" => null, "id" => "id", "name" => $filePath)));
442
 
443
  }
444
 
438
  }
439
 
440
  // Return JSON-RPC response
441
+ echo json_encode(array("jsonrpc" => "2.0", "error" => null, "result" => null, "id" => "id", "name" => $filePath)); die;
442
 
443
  }
444
 
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP All Import
4
  Plugin URI: http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=plugins-page&utm_campaign=free+plugin
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.2.2
7
  Author: Soflyy
8
  */
9
 
@@ -25,7 +25,7 @@ define('PMXI_ROOT_URL', rtrim(plugin_dir_url(__FILE__), '/'));
25
  */
26
  define('PMXI_PREFIX', 'pmxi_');
27
 
28
- define('PMXI_VERSION', '3.2.2');
29
 
30
  define('PMXI_EDITION', 'free');
31
 
@@ -315,8 +315,6 @@ final class PMXI_Plugin {
315
  }
316
 
317
  }
318
-
319
- $this->__fix_db_schema(); // feature to version 3.2.0
320
 
321
  }
322
  else {
@@ -324,9 +322,12 @@ final class PMXI_Plugin {
324
  // migration fixes for vesions
325
  switch ($is_migrated) {
326
 
327
- case '3.2.0':
 
 
 
328
  case '3.2.1':
329
- $this->__fix_db_schema(); // feature to version 3.2.0
330
  break;
331
 
332
  default:
@@ -621,7 +622,11 @@ final class PMXI_Plugin {
621
  }
622
  }
623
 
624
- dbDelta($plugin_queries);
 
 
 
 
625
 
626
  // sync data between plugin tables and wordpress (mostly for the case when plugin is reactivated)
627
 
@@ -642,10 +647,13 @@ final class PMXI_Plugin {
642
  $locale = apply_filters( 'plugin_locale', get_locale(), 'pmxi_plugin' );
643
 
644
  load_plugin_textdomain( 'pmxi_plugin', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages" );
645
- }
646
-
647
- public function __fix_db_schema(){
648
 
 
 
 
 
 
649
  $uploads = wp_upload_dir();
650
 
651
  if ( ! is_dir($uploads['basedir'] . '/wpallimport/logs') or ! is_writable($uploads['basedir'] . '/wpallimport/logs')) {
@@ -673,9 +681,12 @@ final class PMXI_Plugin {
673
  break;
674
  }
675
  }
 
 
 
676
 
677
  $table = $this->getTablePrefix() . 'imports';
678
-
679
  $tablefields = $wpdb->get_results("DESCRIBE {$table};");
680
  $parent_import_id = false;
681
  $iteration = false;
3
  Plugin Name: WP All Import
4
  Plugin URI: http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=plugins-page&utm_campaign=free+plugin
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.2.0
7
  Author: Soflyy
8
  */
9
 
25
  */
26
  define('PMXI_PREFIX', 'pmxi_');
27
 
28
+ define('PMXI_VERSION', '3.2.0');
29
 
30
  define('PMXI_EDITION', 'free');
31
 
315
  }
316
 
317
  }
 
 
318
 
319
  }
320
  else {
322
  // migration fixes for vesions
323
  switch ($is_migrated) {
324
 
325
+ case '3.2.0 RC1':
326
+ # code..
327
+ break;
328
+
329
  case '3.2.1':
330
+ # code..
331
  break;
332
 
333
  default:
622
  }
623
  }
624
 
625
+ dbDelta($plugin_queries);
626
+
627
+ $this->__ver_1_04_transition_fix();
628
+
629
+ $this->__add_feed_type_fix(); // feature to version 2.22
630
 
631
  // sync data between plugin tables and wordpress (mostly for the case when plugin is reactivated)
632
 
647
  $locale = apply_filters( 'plugin_locale', get_locale(), 'pmxi_plugin' );
648
 
649
  load_plugin_textdomain( 'pmxi_plugin', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages" );
650
+ }
 
 
651
 
652
+ /**
653
+ * Method perfoms transition from version when file uploads has been stored in dabase to the solution when it stored on disk
654
+ * NOTE: the function can be removed when plugin version progress and it's sure matter nobody has ver 1.03
655
+ */
656
+ public function __ver_1_04_transition_fix() {
657
  $uploads = wp_upload_dir();
658
 
659
  if ( ! is_dir($uploads['basedir'] . '/wpallimport/logs') or ! is_writable($uploads['basedir'] . '/wpallimport/logs')) {
681
  break;
682
  }
683
  }
684
+ }
685
+
686
+ public function __add_feed_type_fix(){
687
 
688
  $table = $this->getTablePrefix() . 'imports';
689
+ global $wpdb;
690
  $tablefields = $wpdb->get_results("DESCRIBE {$table};");
691
  $parent_import_id = false;
692
  $iteration = false;
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Import any XML or CSV File to WordPress ===
2
  Contributors: soflyy
3
  Requires at least: 3.6.1
4
- Tested up to: 4.0.1
5
- Stable tag: 3.2.2
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
7
 
8
  WP All Import is an extremely powerful plugin that makes it easy to import any XML or CSV file to WordPress.
@@ -76,13 +76,6 @@ Does it work with special character encoding like Hebrew, Arabic, Chinese, etc?
76
 
77
  == Changelog ==
78
 
79
- = 3.2.2 =
80
- * fixed database schema
81
- * uploading large files
82
-
83
- = 3.2.1 =
84
- * fixed updating import settings
85
-
86
  = 3.2.0 =
87
  * IMPORTANT: WP All Import v4 (3.2.0) is a MAJOR update. Read this post before upgrading: http://www.wpallimport.com/2014/11/free-version-wordpress-org-update-information
88
  * speed up the import of taxonomies/categories
1
  === Import any XML or CSV File to WordPress ===
2
  Contributors: soflyy
3
  Requires at least: 3.6.1
4
+ Tested up to: 4.0
5
+ Stable tag: 3.2.0
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
7
 
8
  WP All Import is an extremely powerful plugin that makes it easy to import any XML or CSV file to WordPress.
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
 
 
79
  = 3.2.0 =
80
  * IMPORTANT: WP All Import v4 (3.2.0) is a MAJOR update. Read this post before upgrading: http://www.wpallimport.com/2014/11/free-version-wordpress-org-update-information
81
  * speed up the import of taxonomies/categories
static/js/jquery/jquery.ui-contextmenu.min.js CHANGED
File without changes