Import any XML or CSV File to WordPress - Version 3.3.8

Version Description

  • improvement: 'Force Stream Reader' setting
  • improvement: new filter 'wp_all_import_auto_create_csv_headers'
  • improvement: new filter 'wp_all_import_is_base64_images_allowed'
  • improvement: new filter 'wp_all_import_set_post_terms' to leave a specific category alone when a post is being updated
  • bug fix: nodes navigation for xpath like /news/item
  • bug fix: frozen import template screen for cyrillic XML feeds
  • bug fix: conflict between taxonomies & user import
  • bug fix: creating users with the same email
  • bug fix: enable keep line breaks option by default
  • bug fix: composer namespace conflict
  • bug fix: images preview when wp is in subdirectory
  • bug fix: 'Instead of deletion, set Custom Field' option for users import
Download this release

Release Info

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

Code changes from version 3.3.7 to 3.3.8

Files changed (46) hide show
  1. actions/admin_notices.php +1 -1
  2. actions/wp_ajax_delete_import.php +4 -4
  3. classes/PHPExcel/CachedObjectStorage/MemoryGZip.php +137 -137
  4. classes/XmlStreamReader/composer/ClassLoader.php +1 -1
  5. classes/XmlStreamReader/composer/autoload_real.php +5 -5
  6. classes/XmlStreamReader/prewk/xml-string-streamer/src/XmlStringStreamer/Parser/StringWalker.php +1 -1
  7. classes/XmlStreamReader/prewk/xml-string-streamer/src/XmlStringStreamer/Parser/UniqueNode.php +2 -2
  8. classes/api.php +2 -2
  9. classes/chunk.php +26 -16
  10. classes/render.php +1 -1
  11. config/options.php +1 -0
  12. controllers/admin/import.php +104 -93
  13. controllers/admin/settings.php +7 -7
  14. helpers/functions.php +5 -1
  15. helpers/get_file_curl.php +2 -2
  16. helpers/wp_all_import_get_feed_type.php +2 -1
  17. helpers/wp_all_import_get_image_from_gallery.php +1 -1
  18. helpers/wp_all_import_is_update_cf.php +1 -1
  19. helpers/wp_all_import_template_notifications.php +2 -2
  20. i18n/languages/wp_all_import_plugin-de_CH.po +1 -1
  21. i18n/languages/wp_all_import_plugin-de_DE.po +1 -1
  22. i18n/languages/wp_all_import_plugin-es_ES.po +1 -1
  23. libraries/XmlImportCsvParse.php +18 -6
  24. models/import/record.php +195 -62
  25. plugin.php +3 -3
  26. readme.txt +16 -2
  27. static/css/admin.css +20 -3
  28. static/js/admin.js +15 -13
  29. static/js/jquery/moment.js +1 -1
  30. views/admin/help/index.php +4 -5
  31. views/admin/import/element.php +1 -1
  32. views/admin/import/evaluate.php +2 -2
  33. views/admin/import/index.php +15 -9
  34. views/admin/import/options/_import_file.php +6 -6
  35. views/admin/import/options/_settings_template.php +9 -3
  36. views/admin/import/preview.php +2 -2
  37. views/admin/import/preview_images.php +2 -1
  38. views/admin/import/process.php +21 -5
  39. views/admin/import/tag.php +1 -1
  40. views/admin/import/template.php +5 -5
  41. views/admin/import/template/_custom_fields_template.php +1 -1
  42. views/admin/import/template/_featured_template.php +1 -1
  43. views/admin/import/template/_nested_template.php +1 -1
  44. views/admin/import/template/_other_template.php +1 -1
  45. views/admin/manage/index.php +1 -1
  46. views/admin/settings/index.php +18 -1
actions/admin_notices.php CHANGED
@@ -125,7 +125,7 @@ function pmxi_admin_notices() {
125
  $m = __('<strong>Warning:</strong> You must <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=images" target="_blank">upgrade to the Pro edition of WP All Import</a> to import images. The settings you configured in the images section will be ignored.', 'pmxi_plugin');
126
  break;
127
  case 4:
128
- $m = __('<strong>Warning:</strong> You must <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank">upgrade to the Pro edition of WP All Import</a> to import data to Custom Fields. The settings you configured in the Custom Fields section will be ignored.', 'pmxi_plugin');
129
  break;
130
  default:
131
  $m = false;
125
  $m = __('<strong>Warning:</strong> You must <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=images" target="_blank">upgrade to the Pro edition of WP All Import</a> to import images. The settings you configured in the images section will be ignored.', 'pmxi_plugin');
126
  break;
127
  case 4:
128
+ $m = __('<strong>Warning:</strong> You must <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank">upgrade to the Pro edition of WP All Import</a> to import data to Custom Fields. The settings you configured in the Custom Fields section will be ignored.', 'pmxi_plugin');
129
  break;
130
  default:
131
  $m = false;
actions/wp_ajax_delete_import.php CHANGED
@@ -15,9 +15,9 @@ function pmxi_wp_ajax_delete_import(){
15
  'data' => ''
16
  ));
17
 
18
- $get = $input->get(array(
19
- 'iteration' => 1
20
- ));
21
 
22
  $params = array();
23
  parse_str($post['data'], $params);
@@ -53,7 +53,7 @@ function pmxi_wp_ajax_delete_import(){
53
  $import->getById($id);
54
  if ( ! $import->isEmpty() )
55
  {
56
- if ((int) $get['iteration'] === 1)
57
  {
58
  $import->set(array(
59
  'deleted' => 0
15
  'data' => ''
16
  ));
17
 
18
+ // $get = $input->get(array(
19
+ // 'iteration' => 1
20
+ // ));
21
 
22
  $params = array();
23
  parse_str($post['data'], $params);
53
  $import->getById($id);
54
  if ( ! $import->isEmpty() )
55
  {
56
+ if ((int) $params['iteration'] === 1)
57
  {
58
  $import->set(array(
59
  'deleted' => 0
classes/PHPExcel/CachedObjectStorage/MemoryGZip.php CHANGED
@@ -1,137 +1,137 @@
1
- <?php
2
- /**
3
- * PHPExcel
4
- *
5
- * Copyright (c) 2006 - 2014 PHPExcel
6
- *
7
- * This library is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU Lesser General Public
9
- * License as published by the Free Software Foundation; either
10
- * version 2.1 of the License, or (at your option) any later version.
11
- *
12
- * This library is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- * Lesser General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU Lesser General Public
18
- * License along with this library; if not, write to the Free Software
19
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
- *
21
- * @category PHPExcel
22
- * @package PHPExcel_CachedObjectStorage
23
- * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
24
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25
- * @version ##VERSION##, ##DATE##
26
- */
27
-
28
-
29
- /**
30
- * PHPExcel_CachedObjectStorage_MemoryGZip
31
- *
32
- * @category PHPExcel
33
- * @package PHPExcel_CachedObjectStorage
34
- * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
35
- */
36
- class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
37
-
38
- /**
39
- * Store cell data in cache for the current cell object if it's "dirty",
40
- * and the 'nullify' the current cell object
41
- *
42
- * @return void
43
- * @throws PHPExcel_Exception
44
- */
45
- protected function _storeData() {
46
- if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
47
- $this->_currentObject->detach();
48
-
49
- $this->_cellCache[$this->_currentObjectID] = gzdeflate(serialize($this->_currentObject));
50
- $this->_currentCellIsDirty = false;
51
- }
52
- $this->_currentObjectID = $this->_currentObject = null;
53
- } // function _storeData()
54
-
55
-
56
- /**
57
- * Add or Update a cell in cache identified by coordinate address
58
- *
59
- * @param string $pCoord Coordinate address of the cell to update
60
- * @param PHPExcel_Cell $cell Cell to update
61
- * @return PHPExcel_Cell
62
- * @throws PHPExcel_Exception
63
- */
64
- public function addCacheData($pCoord, PHPExcel_Cell $cell) {
65
- if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
66
- $this->_storeData();
67
- }
68
-
69
- $this->_currentObjectID = $pCoord;
70
- $this->_currentObject = $cell;
71
- $this->_currentCellIsDirty = true;
72
-
73
- return $cell;
74
- } // function addCacheData()
75
-
76
-
77
- /**
78
- * Get cell at a specific coordinate
79
- *
80
- * @param string $pCoord Coordinate of the cell
81
- * @throws PHPExcel_Exception
82
- * @return PHPExcel_Cell Cell that was found, or null if not found
83
- */
84
- public function getCacheData($pCoord) {
85
- if ($pCoord === $this->_currentObjectID) {
86
- return $this->_currentObject;
87
- }
88
- $this->_storeData();
89
-
90
- // Check if the entry that has been requested actually exists
91
- if (!isset($this->_cellCache[$pCoord])) {
92
- // Return null if requested entry doesn't exist in cache
93
- return null;
94
- }
95
-
96
- // Set current entry to the requested entry
97
- $this->_currentObjectID = $pCoord;
98
- $this->_currentObject = unserialize(gzinflate($this->_cellCache[$pCoord]));
99
- // Re-attach this as the cell's parent
100
- $this->_currentObject->attach($this);
101
-
102
- // Return requested entry
103
- return $this->_currentObject;
104
- } // function getCacheData()
105
-
106
-
107
- /**
108
- * Get a list of all cell addresses currently held in cache
109
- *
110
- * @return string[]
111
- */
112
- public function getCellList() {
113
- if ($this->_currentObjectID !== null) {
114
- $this->_storeData();
115
- }
116
-
117
- return parent::getCellList();
118
- }
119
-
120
-
121
- /**
122
- * Clear the cell collection and disconnect from our parent
123
- *
124
- * @return void
125
- */
126
- public function unsetWorksheetCells() {
127
- if(!is_null($this->_currentObject)) {
128
- $this->_currentObject->detach();
129
- $this->_currentObject = $this->_currentObjectID = null;
130
- }
131
- $this->_cellCache = array();
132
-
133
- // detach ourself from the worksheet, so that it can then delete this object successfully
134
- $this->_parent = null;
135
- } // function unsetWorksheetCells()
136
-
137
- }
1
+ <?php
2
+ /**
3
+ * PHPExcel
4
+ *
5
+ * Copyright (c) 2006 - 2014 PHPExcel
6
+ *
7
+ * This library is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * This library is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with this library; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
+ *
21
+ * @category PHPExcel
22
+ * @package PHPExcel_CachedObjectStorage
23
+ * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
24
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25
+ * @version ##VERSION##, ##DATE##
26
+ */
27
+
28
+
29
+ /**
30
+ * PHPExcel_CachedObjectStorage_MemoryGZip
31
+ *
32
+ * @category PHPExcel
33
+ * @package PHPExcel_CachedObjectStorage
34
+ * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
35
+ */
36
+ class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
37
+
38
+ /**
39
+ * Store cell data in cache for the current cell object if it's "dirty",
40
+ * and the 'nullify' the current cell object
41
+ *
42
+ * @return void
43
+ * @throws PHPExcel_Exception
44
+ */
45
+ protected function _storeData() {
46
+ if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
47
+ $this->_currentObject->detach();
48
+
49
+ $this->_cellCache[$this->_currentObjectID] = gzdeflate(serialize($this->_currentObject));
50
+ $this->_currentCellIsDirty = false;
51
+ }
52
+ $this->_currentObjectID = $this->_currentObject = null;
53
+ } // function _storeData()
54
+
55
+
56
+ /**
57
+ * Add or Update a cell in cache identified by coordinate address
58
+ *
59
+ * @param string $pCoord Coordinate address of the cell to update
60
+ * @param PHPExcel_Cell $cell Cell to update
61
+ * @return PHPExcel_Cell
62
+ * @throws PHPExcel_Exception
63
+ */
64
+ public function addCacheData($pCoord, PHPExcel_Cell $cell) {
65
+ if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
66
+ $this->_storeData();
67
+ }
68
+
69
+ $this->_currentObjectID = $pCoord;
70
+ $this->_currentObject = $cell;
71
+ $this->_currentCellIsDirty = true;
72
+
73
+ return $cell;
74
+ } // function addCacheData()
75
+
76
+
77
+ /**
78
+ * Get cell at a specific coordinate
79
+ *
80
+ * @param string $pCoord Coordinate of the cell
81
+ * @throws PHPExcel_Exception
82
+ * @return PHPExcel_Cell Cell that was found, or null if not found
83
+ */
84
+ public function getCacheData($pCoord) {
85
+ if ($pCoord === $this->_currentObjectID) {
86
+ return $this->_currentObject;
87
+ }
88
+ $this->_storeData();
89
+
90
+ // Check if the entry that has been requested actually exists
91
+ if (!isset($this->_cellCache[$pCoord])) {
92
+ // Return null if requested entry doesn't exist in cache
93
+ return null;
94
+ }
95
+
96
+ // Set current entry to the requested entry
97
+ $this->_currentObjectID = $pCoord;
98
+ $this->_currentObject = unserialize(gzinflate($this->_cellCache[$pCoord]));
99
+ // Re-attach this as the cell's parent
100
+ $this->_currentObject->attach($this);
101
+
102
+ // Return requested entry
103
+ return $this->_currentObject;
104
+ } // function getCacheData()
105
+
106
+
107
+ /**
108
+ * Get a list of all cell addresses currently held in cache
109
+ *
110
+ * @return string[]
111
+ */
112
+ public function getCellList() {
113
+ if ($this->_currentObjectID !== null) {
114
+ $this->_storeData();
115
+ }
116
+
117
+ return parent::getCellList();
118
+ }
119
+
120
+
121
+ /**
122
+ * Clear the cell collection and disconnect from our parent
123
+ *
124
+ * @return void
125
+ */
126
+ public function unsetWorksheetCells() {
127
+ if(!is_null($this->_currentObject)) {
128
+ $this->_currentObject->detach();
129
+ $this->_currentObject = $this->_currentObjectID = null;
130
+ }
131
+ $this->_cellCache = array();
132
+
133
+ // detach ourself from the worksheet, so that it can then delete this object successfully
134
+ $this->_parent = null;
135
+ } // function unsetWorksheetCells()
136
+
137
+ }
classes/XmlStreamReader/composer/ClassLoader.php CHANGED
@@ -10,7 +10,7 @@
10
  * file that was distributed with this source code.
11
  */
12
 
13
- namespace Composer\Autoload;
14
 
15
  /**
16
  * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
10
  * file that was distributed with this source code.
11
  */
12
 
13
+ namespace WPAllImport\Composer\Autoload;
14
 
15
  /**
16
  * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
classes/XmlStreamReader/composer/autoload_real.php CHANGED
@@ -8,7 +8,7 @@ class ComposerAutoloaderInit18a81a838bde72a6ce7edd20e3ab047d
8
 
9
  public static function loadClassLoader($class)
10
  {
11
- if ('Composer\Autoload\ClassLoader' === $class) {
12
  require __DIR__ . '/ClassLoader.php';
13
  }
14
  }
@@ -20,7 +20,7 @@ class ComposerAutoloaderInit18a81a838bde72a6ce7edd20e3ab047d
20
  }
21
 
22
  spl_autoload_register(array('ComposerAutoloaderInit18a81a838bde72a6ce7edd20e3ab047d', 'loadClassLoader'), true, true);
23
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
  spl_autoload_unregister(array('ComposerAutoloaderInit18a81a838bde72a6ce7edd20e3ab047d', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
@@ -28,10 +28,10 @@ class ComposerAutoloaderInit18a81a838bde72a6ce7edd20e3ab047d
28
  $loader->set($namespace, $path);
29
  }
30
 
31
- $map = require __DIR__ . '/autoload_psr4.php';
32
- foreach ($map as $namespace => $path) {
33
  $loader->setPsr4($namespace, $path);
34
- }
35
 
36
  $classMap = require __DIR__ . '/autoload_classmap.php';
37
  if ($classMap) {
8
 
9
  public static function loadClassLoader($class)
10
  {
11
+ if ('WPAllImport\Composer\Autoload\ClassLoader' === $class) {
12
  require __DIR__ . '/ClassLoader.php';
13
  }
14
  }
20
  }
21
 
22
  spl_autoload_register(array('ComposerAutoloaderInit18a81a838bde72a6ce7edd20e3ab047d', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \WPAllImport\Composer\Autoload\ClassLoader();
24
  spl_autoload_unregister(array('ComposerAutoloaderInit18a81a838bde72a6ce7edd20e3ab047d', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
28
  $loader->set($namespace, $path);
29
  }
30
 
31
+ $map = require __DIR__ . '/autoload_psr4.php';
32
+ foreach ($map as $namespace => $path) {
33
  $loader->setPsr4($namespace, $path);
34
+ }
35
 
36
  $classMap = require __DIR__ . '/autoload_classmap.php';
37
  if ($classMap) {
classes/XmlStreamReader/prewk/xml-string-streamer/src/XmlStringStreamer/Parser/StringWalker.php CHANGED
@@ -231,7 +231,7 @@ class StringWalker implements ParserInterface
231
  if ( strpos($cloud_element, ":") === false )
232
  {
233
  if ( isset($this->cloud[$cloud_element])) $this->cloud[$cloud_element]++; else $this->cloud[$cloud_element] = 1;
234
- }
235
  }
236
 
237
  // Update depth
231
  if ( strpos($cloud_element, ":") === false )
232
  {
233
  if ( isset($this->cloud[$cloud_element])) $this->cloud[$cloud_element]++; else $this->cloud[$cloud_element] = 1;
234
+ }
235
  }
236
 
237
  // Update depth
classes/XmlStreamReader/prewk/xml-string-streamer/src/XmlStringStreamer/Parser/UniqueNode.php CHANGED
@@ -91,7 +91,7 @@ class UniqueNode implements ParserInterface
91
  protected function getOpeningTagPos()
92
  {
93
  $startPositionInBlob = false;
94
- if (preg_match("/<" . preg_quote($this->options["uniqueNode"]) . "(>| )/", $this->workingBlob, $matches, PREG_OFFSET_CAPTURE) === 1) {
95
  $startPositionInBlob = $matches[0][1];
96
  }
97
 
@@ -129,7 +129,7 @@ class UniqueNode implements ParserInterface
129
  * @return bool|int Either returns the char position of the closing tag or false
130
  */
131
  protected function getClosingTagPos()
132
- {
133
  $endPositionInBlob = strpos($this->workingBlob, "</" . $this->options["uniqueNode"] . ">");
134
  if ($endPositionInBlob === false) {
135
 
91
  protected function getOpeningTagPos()
92
  {
93
  $startPositionInBlob = false;
94
+ if (preg_match("/<" . preg_quote($this->options["uniqueNode"]) . "(>| )/", $this->workingBlob, $matches, PREG_OFFSET_CAPTURE) === 1) {
95
  $startPositionInBlob = $matches[0][1];
96
  }
97
 
129
  * @return bool|int Either returns the char position of the closing tag or false
130
  */
131
  protected function getClosingTagPos()
132
+ {
133
  $endPositionInBlob = strpos($this->workingBlob, "</" . $this->options["uniqueNode"] . ">");
134
  if ($endPositionInBlob === false) {
135
 
classes/api.php CHANGED
@@ -355,9 +355,9 @@ class PMXI_API
355
  $bn = wp_all_import_sanitize_filename(urldecode(basename($img_url)));
356
 
357
  if ($image_name == ""){
358
- $img_ext = pmxi_getExtensionFromStr($url);
359
  $default_extension = pmxi_getExtension($bn);
360
- if ($img_ext == "") $img_ext = pmxi_get_remote_image_ext($url);
361
 
362
  // generate local file name
363
  $image_name = apply_filters("wp_all_import_image_filename", urldecode(sanitize_file_name((($img_ext) ? str_replace("." . $default_extension, "", $bn) : $bn))) . (("" != $img_ext) ? '.' . $img_ext : ''));
355
  $bn = wp_all_import_sanitize_filename(urldecode(basename($img_url)));
356
 
357
  if ($image_name == ""){
358
+ $img_ext = pmxi_getExtensionFromStr($img_url);
359
  $default_extension = pmxi_getExtension($bn);
360
+ if ($img_ext == "") $img_ext = pmxi_get_remote_image_ext($img_url);
361
 
362
  // generate local file name
363
  $image_name = apply_filters("wp_all_import_image_filename", urldecode(sanitize_file_name((($img_ext) ? str_replace("." . $default_extension, "", $bn) : $bn))) . (("" != $img_ext) ? '.' . $img_ext : ''));
classes/chunk.php CHANGED
@@ -86,6 +86,8 @@ class PMXI_Chunk {
86
  // set the filename
87
  $this->file = $file;
88
 
 
 
89
  $is_html = false;
90
  $f = @fopen($file, "rb");
91
  while (!@feof($f)) {
@@ -107,25 +109,32 @@ class PMXI_Chunk {
107
  return;
108
  }
109
 
110
- $input = new PMXI_Input();
 
 
 
 
 
 
111
 
112
- $import_id = $input->get('id', 0);
113
 
114
- if ( empty($import_id)) $import_id = $input->get('import_id', 0);
115
 
116
- if ( ! empty($import_id) )
117
- {
118
- $this->parser_type = empty($parser_type) ? 'xmlreader' : $parser_type;
119
- $import = new PMXI_Import_Record();
120
- $import->getById($import_id);
121
- if ( ! $import->isEmpty() ){
122
- $this->parser_type = empty($import->options['xml_reader_engine']) ? 'xmlreader' : 'xmlstreamer';
 
 
 
 
 
123
  }
124
- }
125
- else
126
- {
127
- $this->parser_type = empty($parser_type) ? get_option('wpai_parser_type', 'xmlreader') : $parser_type;
128
- }
129
 
130
  if (empty($this->options['element']) or $this->options['get_cloud'])
131
  {
@@ -169,6 +178,7 @@ class PMXI_Chunk {
169
  }
170
 
171
  $this->cloud = $parser->cloud;
 
172
  }
173
 
174
  if ( ! empty($this->cloud) and empty($this->options['element']) ){
@@ -300,7 +310,7 @@ class PMXI_Chunk {
300
  if ($this->loop < $this->options['pointer']){
301
  $this->loop++;
302
  continue;
303
- }
304
 
305
  if ($is_preprocess_enabled)
306
  {
86
  // set the filename
87
  $this->file = $file;
88
 
89
+ $this->parser_type = empty($parser_type) ? 'xmlreader' : $parser_type;
90
+
91
  $is_html = false;
92
  $f = @fopen($file, "rb");
93
  while (!@feof($f)) {
109
  return;
110
  }
111
 
112
+ if ( PMXI_Plugin::getInstance()->getOption('force_stream_reader') )
113
+ {
114
+ $this->parser_type = 'xmlstreamer';
115
+ }
116
+ else
117
+ {
118
+ $input = new PMXI_Input();
119
 
120
+ $import_id = $input->get('id', 0);
121
 
122
+ if ( empty($import_id)) $import_id = $input->get('import_id', 0);
123
 
124
+ if ( ! empty($import_id) )
125
+ {
126
+ $this->parser_type = empty($parser_type) ? 'xmlreader' : $parser_type;
127
+ $import = new PMXI_Import_Record();
128
+ $import->getById($import_id);
129
+ if ( ! $import->isEmpty() ){
130
+ $this->parser_type = empty($import->options['xml_reader_engine']) ? 'xmlreader' : 'xmlstreamer';
131
+ }
132
+ }
133
+ else
134
+ {
135
+ $this->parser_type = empty($parser_type) ? get_option('wpai_parser_type', 'xmlreader') : $parser_type;
136
  }
137
+ }
 
 
 
 
138
 
139
  if (empty($this->options['element']) or $this->options['get_cloud'])
140
  {
178
  }
179
 
180
  $this->cloud = $parser->cloud;
181
+
182
  }
183
 
184
  if ( ! empty($this->cloud) and empty($this->options['element']) ){
310
  if ($this->loop < $this->options['pointer']){
311
  $this->loop++;
312
  continue;
313
+ }
314
 
315
  if ($is_preprocess_enabled)
316
  {
classes/render.php CHANGED
@@ -222,7 +222,7 @@ if ( ! class_exists('PMXI_Render')){
222
 
223
  protected static function render_element_xpaths(DOMElement $el, $path = '/', $ind = 1, $lvl = 0){
224
  ?>
225
- <ul id="menu-<?php echo sanitize_title(esc_attr($path)); ?>" class="ui-helper-hidden">
226
  <?php foreach ($el->attributes as $attr) : if ( empty($attr->value) ) continue; ?>
227
  <li data-command="action1" title="<?php echo esc_attr($path . '[@'. $attr->nodeName .' = "' . esc_attr($attr->value) . '"]'); ?>">
228
  <a href="#"><?php echo $path . '[@'. $attr->nodeName .' = "' . esc_attr($attr->value) . '"]'; ?></a>
222
 
223
  protected static function render_element_xpaths(DOMElement $el, $path = '/', $ind = 1, $lvl = 0){
224
  ?>
225
+ <ul id="menu-<?php echo str_replace('/', '-', esc_attr($path)); ?>" class="ui-helper-hidden">
226
  <?php foreach ($el->attributes as $attr) : if ( empty($attr->value) ) continue; ?>
227
  <li data-command="action1" title="<?php echo esc_attr($path . '[@'. $attr->nodeName .' = "' . esc_attr($attr->value) . '"]'); ?>">
228
  <a href="#"><?php echo $path . '[@'. $attr->nodeName .' = "' . esc_attr($attr->value) . '"]'; ?></a>
config/options.php CHANGED
@@ -31,4 +31,5 @@ $config = array(
31
  "log_storage" => 5,
32
  "cron_sleep" => "",
33
  "port" => "",
 
34
  );
31
  "log_storage" => 5,
32
  "cron_sleep" => "",
33
  "port" => "",
34
+ "force_stream_reader" => 0
35
  );
controllers/admin/import.php CHANGED
@@ -111,15 +111,15 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
111
  */
112
  public function index() {
113
 
114
- PMXI_Plugin::$session->clean_session();
115
 
116
  $this->data['reimported_import'] = $import = new PMXI_Import_Record();
117
  $this->data['id'] = $id = $this->input->get('id');
118
  $this->data['parent_import'] = $parent_import = $this->input->get('parent_import', 0);
119
  $parent_import_record = new PMXI_Import_Record();
120
 
121
- $default = array(
122
- 'type' => 'upload',
123
  'wizard_type' => 'new',
124
  'custom_type' => 'post',
125
  'show_hidden_cpt' => 0,
@@ -135,11 +135,11 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
135
  'root_element' => '',
136
  'downloaded' => '',
137
  'auto_generate' => 0,
138
- 'template' => false
139
  );
140
 
141
  if ($parent_import and ! $parent_import_record->getById($parent_import)->isEmpty()){
142
- $default['custom_type'] = $parent_import_record->options['custom_type'];
143
  }
144
 
145
  if ($id) { // update requested but corresponding import is not found
@@ -157,11 +157,20 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
157
 
158
  }
159
  else{
160
- $default['custom_type'] = $import->options['custom_type'];
161
  }
162
  }
 
 
 
 
 
 
 
 
 
163
 
164
- $this->data['post'] = $post = $this->input->post( $default );
165
 
166
  if ( ! class_exists('DOMDocument') or ! class_exists('XMLReader') ) {
167
  $this->errors->add('form-validation', __('Required PHP components are missing.<br/><br/>WP All Import requires DOMDocument, XMLReader, and XMLWriter PHP modules to be installed.<br/>These are standard features of PHP, and are necessary for WP All Import to read the files you are trying to import.<br/>Please contact your web hosting provider and ask them to install and activate the DOMDocument, XMLReader, and XMLWriter PHP modules.', 'wp_all_import_plugin'));
@@ -245,7 +254,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
245
  $this->errors->add('form-validation', __('Certain columns are required to be present in your file to enable it to be re-imported with WP All Import. These columns are missing. Re-export your file using WP All Export, and don\'t delete any of the columns when editing it. Then, re-import will work correctly.', 'wp_all_import_plugin'));
246
  }
247
  elseif($importRecord->options['custom_type'] == 'import_users' && ! class_exists('PMUI_Plugin')){
248
- $this->errors->add('form-validation', __('The import template you are using requires the User Import Add-On.<br/><a href="http://www.wpallimport.com/add-ons/user-import/?utm_source=wordpress.org&utm_medium=wpai-import-template&utm_campaign=free+wp+all+export+plugin" target="_blank">Purchase the User Import Add-On</a>', 'wp_all_import_plugin'));
249
  }
250
 
251
  break;
@@ -255,18 +264,28 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
255
  break;
256
  }
257
 
258
- $local_paths = !empty($local_paths) ? $local_paths : array($filePath);
259
 
260
- // wp_all_import_get_reader_engine( $local_paths, $post );
261
-
 
 
 
 
 
 
 
 
262
  foreach ($local_paths as $key => $path) {
263
 
264
  if ( @file_exists($path) ){
265
 
266
- $file = new PMXI_Chunk($path, array('element' => $post['root_element'], 'get_cloud' => true));
267
 
268
  if ( ! empty($file->options['element']) ) {
 
269
  $xpath = "/" . $file->options['element'];
 
270
  $elements_cloud = $file->cloud;
271
 
272
  if ( ! empty($elements_cloud) and class_exists('PMXE_Plugin') and ! $importRecord->isEmpty() ){
@@ -345,7 +364,8 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
345
  'action' => 'import',
346
  'elements_cloud' => (!empty($elements_cloud)) ? $elements_cloud : array(),
347
  'pointer' => 1,
348
- 'deligate' => $deligate
 
349
  );
350
 
351
  // apply options from WP All Export bundle
@@ -578,7 +598,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
578
  {
579
  //PMXI_Import_Record::preprocessXml($xml);
580
  $xml = "<?xml version=\"1.0\" encoding=\"". PMXI_Plugin::$session->encoding ."\"?>" . "\n" . $xml;
581
-
582
  $dom = new DOMDocument('1.0', PMXI_Plugin::$session->encoding);
583
  $old = libxml_use_internal_errors(true);
584
  $dom->loadXML($xml);
@@ -588,8 +608,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
588
  if (($elements = @$xpath->query($post['xpath'])) and $elements->length){
589
 
590
  if ( $post['show_element'] == 1 ){
591
- $this->data['node_list_count'] += $elements->length;
592
- PMXI_Plugin::$session->set('count', $this->data['node_list_count']);
593
  if (!$loop) $this->data['dom'] = $dom;
594
  }
595
 
@@ -601,16 +620,20 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
601
  }
602
 
603
  unset($dom, $xpath, $elements);
604
- }
605
  }
606
  }
607
- unset($file);
 
 
608
  }
609
  if ( ! $this->data['node_list_count']) {
610
  $this->errors->add('form-validation', __('There are no elements to import based on your XPath.<br/><br/>If you are in Step 2, you probably specified filtering options that don’t match any elements present in your file.<br/>If you are seeing this error elsewhere, it means that while the XPath expression for your initial import matched some elements in your file previously, there are now zero elements in the file that match this expression.<br/>You can edit the XPath for your import by going to the Manage Imports -> Import Settings page.', 'wp_all_import_plugin'));
611
  }
612
  }
613
-
 
 
614
  PMXI_Plugin::$session->save_data();
615
 
616
  $this->data['is_csv'] = $post['is_csv'];
@@ -902,11 +925,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
902
  $xpath = "(" . PMXI_Plugin::$session->xpath . ")[1]";
903
 
904
  PMXI_Plugin::$session->set('encoding', $post['import_encoding']);
905
- PMXI_Plugin::$session->save_data();
906
-
907
- $functions = $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_IMPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
908
- if ( @file_exists($functions) )
909
- require_once $functions;
910
 
911
  // validate
912
  try {
@@ -1045,11 +1064,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1045
  $xpath = "(" . PMXI_Plugin::$session->xpath . ")[1]";
1046
 
1047
  PMXI_Plugin::$session->set('encoding', $post['import_encoding']);
1048
- PMXI_Plugin::$session->save_data();
1049
-
1050
- $functions = $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_IMPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
1051
- if ( @file_exists($functions) )
1052
- require_once $functions;
1053
 
1054
  // validate
1055
  try {
@@ -1180,10 +1195,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1180
  PMXI_Plugin::$session->set('encoding', $post['import_encoding']);
1181
  PMXI_Plugin::$session->save_data();
1182
 
1183
- $wp_uploads = wp_upload_dir();
1184
- $functions = $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_IMPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
1185
- if ( @file_exists($functions) )
1186
- require_once $functions;
1187
 
1188
  // validate
1189
  try {
@@ -1335,10 +1347,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1335
  PMXI_Plugin::$session->set('encoding', $post['import_encoding']);
1336
  PMXI_Plugin::$session->save_data();
1337
 
1338
- $wp_uploads = wp_upload_dir();
1339
- $functions = $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_IMPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
1340
- if ( @file_exists($functions) )
1341
- require_once $functions;
1342
 
1343
  // validate
1344
  try {
@@ -1391,19 +1400,21 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1391
  }
1392
  $default['wizard_type'] = PMXI_Plugin::$session->wizard_type;
1393
  if (empty($default['custom_type'])) $default['custom_type'] = PMXI_Plugin::$session->custom_type;
1394
- if (empty($default['delimiter'])) $default['delimiter'] = PMXI_Plugin::$session->is_csv;
1395
 
1396
- $DefaultOptions = (isset(PMXI_Plugin::$session->options) ? PMXI_Plugin::$session->options : array()) + $default;
1397
 
1398
- $post = array_replace_recursive($DefaultOptions, $this->input->post( apply_filters('pmxi_options_options', $DefaultOptions, $this->isWizard)));
1399
 
1400
  } else {
1401
  $this->data['source_type'] = $this->data['import']->type;
1402
- $DefaultOptions = (is_array($this->data['import']->options)) ? $this->data['import']->options + $default : $default;
1403
- foreach (PMXI_Admin_Addons::get_active_addons() as $class) {
1404
- if (class_exists($class)) $DefaultOptions += call_user_func(array($class, "get_default_import_options"));
1405
- }
1406
 
 
 
 
 
 
 
1407
  $source = array(
1408
  'name' => $this->data['import']->name,
1409
  'type' => $this->data['import']->type,
@@ -1412,8 +1423,8 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1412
  );
1413
 
1414
  PMXI_Plugin::$session->set('source', $source);
1415
-
1416
- $post = array_replace_recursive($DefaultOptions, $this->input->post( apply_filters( 'pmxi_options_options', $DefaultOptions, $this->isWizard) ));
1417
 
1418
  }
1419
 
@@ -1422,7 +1433,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1422
  if(ctype_digit($max_input_vars) && count($_POST, COUNT_RECURSIVE) >= $max_input_vars)
1423
  {
1424
  $this->errors->add('form-validation', sprintf(__('You\'ve reached your max_input_vars limit of %d. Please increase this.', 'wp_all_export_plugin'), $max_input_vars));
1425
- }
1426
 
1427
  $this->data['post'] =& $post;
1428
 
@@ -1449,24 +1460,19 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1449
 
1450
  } elseif ($this->input->post('is_submitted')) { // save template submission
1451
 
1452
- check_admin_referer('template', '_wpnonce_template');
1453
-
1454
- $wp_uploads = wp_upload_dir();
1455
- $functions = $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_IMPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
1456
- if ( @file_exists($functions) )
1457
- require_once $functions;
1458
 
1459
  if (!empty($post['title'])) {
1460
  $this->_validate_template($post['title'], 'Post title');
1461
  }
1462
- else{
1463
  $this->warnings->add('1', __('<strong>Warning:</strong> your title is blank.', 'wp_all_import_plugin'));
1464
  }
1465
 
1466
  if (!empty($post['content'])) {
1467
  $this->_validate_template($post['content'], 'Post content');
1468
  }
1469
- else{
1470
  $this->warnings->add('2', __('<strong>Warning:</strong> your content is blank.', 'wp_all_import_plugin'));
1471
  }
1472
 
@@ -1680,7 +1686,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1680
  if (class_exists($class)) $default += call_user_func(array($class, "get_default_import_options"));
1681
  }
1682
 
1683
- $DefaultOptions = (isset(PMXI_Plugin::$session->options) ? PMXI_Plugin::$session->options : array()) + $default;
1684
 
1685
  if ( ! in_array(PMXI_Plugin::$session->options['custom_type'], array('import_users', 'shop_order')) ){
1686
  if (empty(PMXI_Plugin::$session->options['title']))
@@ -1733,16 +1739,18 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1733
  $DefaultOptions['wizard_type'] = PMXI_Plugin::$session->wizard_type;
1734
  if (empty($DefaultOptions['custom_type'])) $DefaultOptions['custom_type'] = PMXI_Plugin::$session->custom_type;
1735
  if (empty($DefaultOptions['delimiter'])) $DefaultOptions['delimiter'] = PMXI_Plugin::$session->is_csv;
1736
-
1737
- $post = array_replace_recursive($DefaultOptions, $this->input->post( $DefaultOptions ));
1738
 
1739
- } else {
1740
- $this->data['source_type'] = $this->data['import']->type;
1741
- $DefaultOptions = (is_array($this->data['import']->options)) ? $this->data['import']->options + $default : $default;
 
 
1742
  foreach (PMXI_Admin_Addons::get_active_addons() as $class) {
1743
- if (class_exists($class)) $DefaultOptions += call_user_func(array($class, "get_default_import_options"));
1744
  }
1745
 
 
 
1746
  $source = array(
1747
  'name' => $this->data['import']->name,
1748
  'type' => $this->data['import']->type,
@@ -1751,8 +1759,8 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1751
  );
1752
 
1753
  PMXI_Plugin::$session->set('source', $source);
1754
-
1755
- $post = array_replace_recursive($DefaultOptions, $this->input->post( $DefaultOptions ));
1756
 
1757
  }
1758
 
@@ -1762,12 +1770,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1762
 
1763
  if ($this->input->post('is_submitted')) {
1764
 
1765
- check_admin_referer('options', '_wpnonce_options');
1766
-
1767
- $wp_uploads = wp_upload_dir();
1768
- $functions = $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_IMPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
1769
- if ( @file_exists($functions) )
1770
- require_once $functions;
1771
 
1772
  if ($post['is_import_specified']) {
1773
  if (empty($post['import_specified'])) {
@@ -1832,7 +1835,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1832
  }
1833
 
1834
  break;
1835
-
1836
  default:
1837
 
1838
  $this->errors->add('form-validation', __('WP All Import doesn\'t support this import type.', 'wp_all_import_plugin'));
@@ -1840,12 +1843,16 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1840
  break;
1841
  }
1842
 
 
 
1843
  if ($upload_result instanceof WP_Error){
1844
  $this->errors = $upload_result;
1845
  }
1846
- elseif ($upload_result !== false and $this->data['import']['path'] != $filePath) {
1847
 
1848
  $file = new PMXI_Chunk($upload_result['filePath'], array('element' => ( ! empty($this->data['import']->root_element)) ? $this->data['import']->root_element : ''));
 
 
1849
 
1850
  $root_element = '';
1851
  if ( ! empty($file->options['element']) ) {
@@ -1879,7 +1886,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1879
 
1880
  if ( (int) $loop === 0 ){
1881
 
1882
- $this->warnings->add('form-validation', __('<strong>Warning:</strong> this file does not have the same structure as the last file associated with this import. WP All Import won\'t be able to import this file with your current settings. Probably you\'ll need to adjust your XPath in the "Configure Advanced Settings" box below, and reconfigure your import by clicking "Edit" on the Manage Imports page.', 'wp_all_import_plugin'));
1883
 
1884
  $file = new PMXI_Chunk($upload_result['filePath'], array('element' => ( ! empty($upload_result['root_element'])) ? $upload_result['root_element'] : ''));
1885
 
@@ -1924,7 +1931,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1924
 
1925
  }
1926
  else{
1927
- $this->errors->add('form-validation', __('Root element not found for uploaded feed.', 'wp_all_import_plugin'));
1928
  }
1929
 
1930
  }
@@ -1963,7 +1970,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1963
  'xpath' => PMXI_Plugin::$session->xpath,
1964
  'options' => PMXI_Plugin::$session->options,
1965
  'count' => PMXI_Plugin::$session->count,
1966
- 'friendly_name' => $this->data['post']['friendly_name'],
1967
  )
1968
  )->save();
1969
 
@@ -1984,7 +1991,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
1984
  $xpath = $this->input->post('xpath');
1985
 
1986
  $toUpdate = array(
1987
- 'friendly_name' => $this->data['post']['friendly_name'],
1988
  'xpath' => $this->input->post('xpath'),
1989
  'settings_update_on' => date('Y-m-d H:i:s')
1990
  );
@@ -2008,7 +2015,12 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2008
  'type' => 'upload',
2009
  'path' => $filePath,
2010
  );
2011
- break;
 
 
 
 
 
2012
  }
2013
 
2014
  $source['path'] = wp_all_import_get_relative_path($source['path']);
@@ -2120,7 +2132,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2120
  if (class_exists($class)) $DefaultOptions += call_user_func(array($class, "get_default_import_options"));
2121
  }
2122
 
2123
- if ($this->isWizard and PMXI_Plugin::$session->options['custom_type'] != 'import_users'){
2124
  if (empty(PMXI_Plugin::$session->options['title']))
2125
  $this->warnings->add('form-validation', __('<strong>Warning:</strong> your title is blank.'));
2126
  if (empty(PMXI_Plugin::$session->options['content']))
@@ -2168,14 +2180,14 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2168
  $log_storage = (int) PMXI_Plugin::getInstance()->getOption('log_storage');
2169
 
2170
  if ( ! PMXI_Plugin::is_ajax() ) {
2171
-
2172
  $import->set(
2173
  (empty(PMXI_Plugin::$session->source) ? array() : PMXI_Plugin::$session->source)
2174
  + array(
2175
  'xpath' => PMXI_Plugin::$session->xpath,
2176
  'options' => PMXI_Plugin::$session->options,
2177
  'count' => PMXI_Plugin::$session->count,
2178
- 'friendly_name' => PMXI_Plugin::$session->options['friendly_name'],
2179
  'feed_type' => PMXI_Plugin::$session->feed_type,
2180
  'parent_import_id' => ($this->data['update_previous']->isEmpty()) ? PMXI_Plugin::$session->parent_import_id : $this->data['update_previous']->parent_import_id,
2181
  'queue_chunk_number' => 0,
@@ -2226,7 +2238,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2226
  PMXI_Plugin::$session->set('history_id', $history_log->id);
2227
 
2228
  foreach ( get_taxonomies() as $tax )
2229
- delete_transient("pmxi_{$tax}_terms");
2230
 
2231
  do_action( 'pmxi_before_xml_import', $import->id );
2232
 
@@ -2323,7 +2335,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2323
  }
2324
  }
2325
  PMXI_Plugin::$session->set('local_paths', $chunk_files);
2326
- }
2327
  }
2328
 
2329
  PMXI_Plugin::$session->save_data();
@@ -2380,11 +2392,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2380
  wp_defer_term_counting(true);
2381
  wp_defer_comment_counting(true);
2382
 
2383
- if ( PMXI_Plugin::is_ajax() or ! $ajax_processing ) {
2384
-
2385
- $functions = $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_IMPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
2386
- if ( @file_exists($functions) )
2387
- require_once $functions;
2388
 
2389
  $iteration_start_time = time();
2390
 
@@ -2483,7 +2491,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2483
  PMXI_Plugin::$session->set('chunk_number', PMXI_Plugin::$session->chunk_number + $elements->length);
2484
  PMXI_Plugin::$session->save_data();
2485
  continue;
2486
- }
2487
 
2488
  if ( ! $loop and $ajax_processing ) ob_start();
2489
 
@@ -2527,7 +2535,8 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2527
  wp_send_json(array(
2528
  'imported' => $import->imported,
2529
  'created' => $import->created,
2530
- 'updated' => $import->updated,
 
2531
  'percentage' => ceil(($processed_records/$import->count) * 100),
2532
  'warnings' => PMXI_Plugin::$session->warnings,
2533
  'errors' => PMXI_Plugin::$session->errors,
@@ -2582,6 +2591,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2582
  'imported' => $import->imported,
2583
  'created' => $import->created,
2584
  'updated' => $import->updated,
 
2585
  'deleted' => $import->deleted,
2586
  'percentage' => 99,
2587
  'warnings' => PMXI_Plugin::$session->warnings,
@@ -2602,7 +2612,7 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2602
  'queue_chunk_number' => 0,
2603
  'registered_on' => date('Y-m-d H:i:s'),
2604
  'iteration' => ++$import->iteration
2605
- ))->update();
2606
 
2607
  if ("ajax" != $import->options['import_processing'] and $log_storage ){
2608
  $log_file = wp_all_import_secure_file( $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXI_Plugin::LOGS_DIRECTORY, $history_log->id ) . DIRECTORY_SEPARATOR . $history_log->id . '.html';
@@ -2625,10 +2635,10 @@ class PMXI_Admin_Import extends PMXI_Controller_Admin {
2625
  $import->set(array(
2626
  'registered_on' => date('Y-m-d H:i:s'),
2627
  'executing' => 0
2628
- ))->update();
2629
 
2630
  wp_defer_term_counting(false);
2631
- wp_defer_comment_counting(false);
2632
 
2633
  // add history log
2634
  $custom_type = get_post_type_object( $import->options['custom_type'] );
@@ -2667,7 +2677,8 @@ COMPLETE;
2667
  wp_send_json(array(
2668
  'imported' => $import->imported,
2669
  'created' => $import->created,
2670
- 'updated' => $import->updated,
 
2671
  'percentage' => 100,
2672
  'warnings' => PMXI_Plugin::$session->warnings,
2673
  'errors' => PMXI_Plugin::$session->errors,
111
  */
112
  public function index() {
113
 
114
+ $action = $this->input->get('action');
115
 
116
  $this->data['reimported_import'] = $import = new PMXI_Import_Record();
117
  $this->data['id'] = $id = $this->input->get('id');
118
  $this->data['parent_import'] = $parent_import = $this->input->get('parent_import', 0);
119
  $parent_import_record = new PMXI_Import_Record();
120
 
121
+ $DefaultOptions = array(
122
+ 'type' => '',
123
  'wizard_type' => 'new',
124
  'custom_type' => 'post',
125
  'show_hidden_cpt' => 0,
135
  'root_element' => '',
136
  'downloaded' => '',
137
  'auto_generate' => 0,
138
+ 'template' => false
139
  );
140
 
141
  if ($parent_import and ! $parent_import_record->getById($parent_import)->isEmpty()){
142
+ $DefaultOptions['custom_type'] = $parent_import_record->options['custom_type'];
143
  }
144
 
145
  if ($id) { // update requested but corresponding import is not found
157
 
158
  }
159
  else{
160
+ $DefaultOptions['custom_type'] = $import->options['custom_type'];
161
  }
162
  }
163
+
164
+ if ( ! in_array($action, array('index')))
165
+ {
166
+ PMXI_Plugin::$session->clean_session();
167
+ }
168
+ else
169
+ {
170
+ $DefaultOptions = (PMXI_Plugin::$session->has_session() ? PMXI_Plugin::$session->first_step : array()) + $DefaultOptions;
171
+ }
172
 
173
+ $this->data['post'] = $post = $this->input->post( $DefaultOptions );
174
 
175
  if ( ! class_exists('DOMDocument') or ! class_exists('XMLReader') ) {
176
  $this->errors->add('form-validation', __('Required PHP components are missing.<br/><br/>WP All Import requires DOMDocument, XMLReader, and XMLWriter PHP modules to be installed.<br/>These are standard features of PHP, and are necessary for WP All Import to read the files you are trying to import.<br/>Please contact your web hosting provider and ask them to install and activate the DOMDocument, XMLReader, and XMLWriter PHP modules.', 'wp_all_import_plugin'));
254
  $this->errors->add('form-validation', __('Certain columns are required to be present in your file to enable it to be re-imported with WP All Import. These columns are missing. Re-export your file using WP All Export, and don\'t delete any of the columns when editing it. Then, re-import will work correctly.', 'wp_all_import_plugin'));
255
  }
256
  elseif($importRecord->options['custom_type'] == 'import_users' && ! class_exists('PMUI_Plugin')){
257
+ $this->errors->add('form-validation', __('<p>The import template you are using requires User Import Add-On.</p><a href="http://www.wpallimport.com/add-ons/user-import/?utm_source=wordpress.org&utm_medium=wpai-import-template&utm_campaign=free+wp+all+export+plugin" target="_blank">Purchase the User Import Add-On</a>', 'wp_all_import_plugin'));
258
  }
259
 
260
  break;
264
  break;
265
  }
266
 
267
+ $local_paths = !empty($local_paths) ? $local_paths : array($filePath);
268
 
269
+ // if ( 'file' == $this->input->post('type') ){
270
+
271
+ // $root_element = wp_all_import_get_reader_engine( $local_paths, $post );
272
+
273
+ // if ( empty($post['root_element']) and ! empty($root_element))
274
+ // {
275
+ // $post['root_element'] = $root_element;
276
+ // }
277
+ // }
278
+
279
  foreach ($local_paths as $key => $path) {
280
 
281
  if ( @file_exists($path) ){
282
 
283
+ $file = new PMXI_Chunk($path, array('element' => $post['root_element'], 'get_cloud' => true));
284
 
285
  if ( ! empty($file->options['element']) ) {
286
+
287
  $xpath = "/" . $file->options['element'];
288
+
289
  $elements_cloud = $file->cloud;
290
 
291
  if ( ! empty($elements_cloud) and class_exists('PMXE_Plugin') and ! $importRecord->isEmpty() ){
364
  'action' => 'import',
365
  'elements_cloud' => (!empty($elements_cloud)) ? $elements_cloud : array(),
366
  'pointer' => 1,
367
+ 'deligate' => $deligate,
368
+ 'first_step' => $post
369
  );
370
 
371
  // apply options from WP All Export bundle
598
  {
599
  //PMXI_Import_Record::preprocessXml($xml);
600
  $xml = "<?xml version=\"1.0\" encoding=\"". PMXI_Plugin::$session->encoding ."\"?>" . "\n" . $xml;
601
+
602
  $dom = new DOMDocument('1.0', PMXI_Plugin::$session->encoding);
603
  $old = libxml_use_internal_errors(true);
604
  $dom->loadXML($xml);
608
  if (($elements = @$xpath->query($post['xpath'])) and $elements->length){
609
 
610
  if ( $post['show_element'] == 1 ){
611
+ $this->data['node_list_count'] += $elements->length;
 
612
  if (!$loop) $this->data['dom'] = $dom;
613
  }
614
 
620
  }
621
 
622
  unset($dom, $xpath, $elements);
623
+ }
624
  }
625
  }
626
+ unset($file);
627
+
628
+ PMXI_Plugin::$session->set('count', $this->data['node_list_count']);
629
  }
630
  if ( ! $this->data['node_list_count']) {
631
  $this->errors->add('form-validation', __('There are no elements to import based on your XPath.<br/><br/>If you are in Step 2, you probably specified filtering options that don’t match any elements present in your file.<br/>If you are seeing this error elsewhere, it means that while the XPath expression for your initial import matched some elements in your file previously, there are now zero elements in the file that match this expression.<br/>You can edit the XPath for your import by going to the Manage Imports -> Import Settings page.', 'wp_all_import_plugin'));
632
  }
633
  }
634
+
635
+ $this->data['show_element'] = $post['show_element'];
636
+
637
  PMXI_Plugin::$session->save_data();
638
 
639
  $this->data['is_csv'] = $post['is_csv'];
925
  $xpath = "(" . PMXI_Plugin::$session->xpath . ")[1]";
926
 
927
  PMXI_Plugin::$session->set('encoding', $post['import_encoding']);
928
+ PMXI_Plugin::$session->save_data();
 
 
 
 
929
 
930
  // validate
931
  try {
1064
  $xpath = "(" . PMXI_Plugin::$session->xpath . ")[1]";
1065
 
1066
  PMXI_Plugin::$session->set('encoding', $post['import_encoding']);
1067
+ PMXI_Plugin::$session->save_data();
 
 
 
 
1068
 
1069
  // validate
1070
  try {
1195
  PMXI_Plugin::$session->set('encoding', $post['import_encoding']);
1196
  PMXI_Plugin::$session->save_data();
1197
 
1198
+ $wp_uploads = wp_upload_dir();
 
 
 
1199
 
1200
  // validate
1201
  try {
1347
  PMXI_Plugin::$session->set('encoding', $post['import_encoding']);
1348
  PMXI_Plugin::$session->save_data();
1349
 
1350
+ $wp_uploads = wp_upload_dir();
 
 
 
1351
 
1352
  // validate
1353
  try {
1400
  }
1401
  $default['wizard_type'] = PMXI_Plugin::$session->wizard_type;
1402
  if (empty($default['custom_type'])) $default['custom_type'] = PMXI_Plugin::$session->custom_type;
1403
+ if (empty($default['delimiter'])) $default['delimiter'] = PMXI_Plugin::$session->is_csv;
1404
 
1405
+ $DefaultOptions = (isset(PMXI_Plugin::$session->options)) ? array_replace_recursive($default, PMXI_Plugin::$session->options) : $default;
1406
 
1407
+ $post = $this->input->post( apply_filters('pmxi_options_options', $DefaultOptions, $this->isWizard) );
1408
 
1409
  } else {
1410
  $this->data['source_type'] = $this->data['import']->type;
 
 
 
 
1411
 
1412
+ foreach (PMXI_Admin_Addons::get_active_addons() as $class) {
1413
+ if (class_exists($class)) $default += call_user_func(array($class, "get_default_import_options"));
1414
+ }
1415
+
1416
+ $DefaultOptions = (is_array($this->data['import']->options)) ? array_replace_recursive($default, $this->data['import']->options) : $default;
1417
+
1418
  $source = array(
1419
  'name' => $this->data['import']->name,
1420
  'type' => $this->data['import']->type,
1423
  );
1424
 
1425
  PMXI_Plugin::$session->set('source', $source);
1426
+
1427
+ $post = $this->input->post( apply_filters('pmxi_options_options', $DefaultOptions, $this->isWizard) );
1428
 
1429
  }
1430
 
1433
  if(ctype_digit($max_input_vars) && count($_POST, COUNT_RECURSIVE) >= $max_input_vars)
1434
  {
1435
  $this->errors->add('form-validation', sprintf(__('You\'ve reached your max_input_vars limit of %d. Please increase this.', 'wp_all_export_plugin'), $max_input_vars));
1436
+ }
1437
 
1438
  $this->data['post'] =& $post;
1439
 
1460
 
1461
  } elseif ($this->input->post('is_submitted')) { // save template submission
1462
 
1463
+ check_admin_referer('template', '_wpnonce_template');
 
 
 
 
 
1464
 
1465
  if (!empty($post['title'])) {
1466
  $this->_validate_template($post['title'], 'Post title');
1467
  }
1468
+ elseif ($post['custom_type'] != 'shop_order'){
1469
  $this->warnings->add('1', __('<strong>Warning:</strong> your title is blank.', 'wp_all_import_plugin'));
1470
  }
1471
 
1472
  if (!empty($post['content'])) {
1473
  $this->_validate_template($post['content'], 'Post content');
1474
  }
1475
+ elseif ($post['custom_type'] != 'shop_order'){
1476
  $this->warnings->add('2', __('<strong>Warning:</strong> your content is blank.', 'wp_all_import_plugin'));
1477
  }
1478
 
1686
  if (class_exists($class)) $default += call_user_func(array($class, "get_default_import_options"));
1687
  }
1688
 
1689
+ $DefaultOptions = array_replace_recursive($default, (isset(PMXI_Plugin::$session->options) ? PMXI_Plugin::$session->options : array()));
1690
 
1691
  if ( ! in_array(PMXI_Plugin::$session->options['custom_type'], array('import_users', 'shop_order')) ){
1692
  if (empty(PMXI_Plugin::$session->options['title']))
1739
  $DefaultOptions['wizard_type'] = PMXI_Plugin::$session->wizard_type;
1740
  if (empty($DefaultOptions['custom_type'])) $DefaultOptions['custom_type'] = PMXI_Plugin::$session->custom_type;
1741
  if (empty($DefaultOptions['delimiter'])) $DefaultOptions['delimiter'] = PMXI_Plugin::$session->is_csv;
 
 
1742
 
1743
+ $post = $this->input->post( $DefaultOptions );
1744
+
1745
+ } else {
1746
+
1747
+ $this->data['source_type'] = $this->data['import']->type;
1748
  foreach (PMXI_Admin_Addons::get_active_addons() as $class) {
1749
+ if (class_exists($class)) $default += call_user_func(array($class, "get_default_import_options"));
1750
  }
1751
 
1752
+ $DefaultOptions = (is_array($this->data['import']->options)) ? array_replace_recursive($default, $this->data['import']->options) : $default;
1753
+
1754
  $source = array(
1755
  'name' => $this->data['import']->name,
1756
  'type' => $this->data['import']->type,
1759
  );
1760
 
1761
  PMXI_Plugin::$session->set('source', $source);
1762
+
1763
+ $post = $this->input->post( $DefaultOptions );
1764
 
1765
  }
1766
 
1770
 
1771
  if ($this->input->post('is_submitted')) {
1772
 
1773
+ check_admin_referer('options', '_wpnonce_options');
 
 
 
 
 
1774
 
1775
  if ($post['is_import_specified']) {
1776
  if (empty($post['import_specified'])) {
1835
  }
1836
 
1837
  break;
1838
+
1839
  default:
1840
 
1841
  $this->errors->add('form-validation', __('WP All Import doesn\'t support this import type.', 'wp_all_import_plugin'));
1843
  break;
1844
  }
1845
 
1846
+ $is_validate_file = apply_filters('wp_all_import_is_validate_file_options_update', true, $this->data['import']->id);
1847
+
1848
  if ($upload_result instanceof WP_Error){
1849
  $this->errors = $upload_result;
1850
  }
1851
+ elseif ($upload_result !== false and $this->data['import']['path'] != $filePath and $is_validate_file) {
1852
 
1853
  $file = new PMXI_Chunk($upload_result['filePath'], array('element' => ( ! empty($this->data['import']->root_element)) ? $this->data['import']->root_element : ''));
1854
+
1855
+ $this->data['is_404'] = $file->is_404;
1856
 
1857
  $root_element = '';
1858
  if ( ! empty($file->options['element']) ) {
1886
 
1887
  if ( (int) $loop === 0 ){
1888
 
1889
+ $this->warnings->add('root-element-validation', __('<strong>Warning:</strong> this file does not have the same structure as the last file associated with this import. WP All Import won\'t be able to import this file with your current settings. Probably you\'ll need to adjust your XPath in the "Configure Advanced Settings" box below, and reconfigure your import by clicking "Edit" on the Manage Imports page.', 'wp_all_import_plugin'));
1890
 
1891
  $file = new PMXI_Chunk($upload_result['filePath'], array('element' => ( ! empty($upload_result['root_element'])) ? $upload_result['root_element'] : ''));
1892
 
1931
 
1932
  }
1933
  else{
1934
+ $this->warnings->add('root-element-validation', __('Root element not found for uploaded feed.', 'wp_all_import_plugin'));
1935
  }
1936
 
1937
  }
1970
  'xpath' => PMXI_Plugin::$session->xpath,
1971
  'options' => PMXI_Plugin::$session->options,
1972
  'count' => PMXI_Plugin::$session->count,
1973
+ 'friendly_name' => wp_all_import_clear_xss($this->data['post']['friendly_name']),
1974
  )
1975
  )->save();
1976
 
1991
  $xpath = $this->input->post('xpath');
1992
 
1993
  $toUpdate = array(
1994
+ 'friendly_name' => wp_all_import_clear_xss($this->data['post']['friendly_name']),
1995
  'xpath' => $this->input->post('xpath'),
1996
  'settings_update_on' => date('Y-m-d H:i:s')
1997
  );
2015
  'type' => 'upload',
2016
  'path' => $filePath,
2017
  );
2018
+ break;
2019
+ default:
2020
+
2021
+ $this->errors->add('form-validation', __('WP All Import doesn\'t support this import type.', 'wp_all_import_plugin'));
2022
+
2023
+ break;
2024
  }
2025
 
2026
  $source['path'] = wp_all_import_get_relative_path($source['path']);
2132
  if (class_exists($class)) $DefaultOptions += call_user_func(array($class, "get_default_import_options"));
2133
  }
2134
 
2135
+ if ($this->isWizard and ! in_array(PMXI_Plugin::$session->options['custom_type'], array('import_users', 'shop_order'))){
2136
  if (empty(PMXI_Plugin::$session->options['title']))
2137
  $this->warnings->add('form-validation', __('<strong>Warning:</strong> your title is blank.'));
2138
  if (empty(PMXI_Plugin::$session->options['content']))
2180
  $log_storage = (int) PMXI_Plugin::getInstance()->getOption('log_storage');
2181
 
2182
  if ( ! PMXI_Plugin::is_ajax() ) {
2183
+
2184
  $import->set(
2185
  (empty(PMXI_Plugin::$session->source) ? array() : PMXI_Plugin::$session->source)
2186
  + array(
2187
  'xpath' => PMXI_Plugin::$session->xpath,
2188
  'options' => PMXI_Plugin::$session->options,
2189
  'count' => PMXI_Plugin::$session->count,
2190
+ 'friendly_name' => wp_all_import_clear_xss(PMXI_Plugin::$session->options['friendly_name']),
2191
  'feed_type' => PMXI_Plugin::$session->feed_type,
2192
  'parent_import_id' => ($this->data['update_previous']->isEmpty()) ? PMXI_Plugin::$session->parent_import_id : $this->data['update_previous']->parent_import_id,
2193
  'queue_chunk_number' => 0,
2238
  PMXI_Plugin::$session->set('history_id', $history_log->id);
2239
 
2240
  foreach ( get_taxonomies() as $tax )
2241
+ delete_transient("pmxi_{$tax}_terms");
2242
 
2243
  do_action( 'pmxi_before_xml_import', $import->id );
2244
 
2335
  }
2336
  }
2337
  PMXI_Plugin::$session->set('local_paths', $chunk_files);
2338
+ }
2339
  }
2340
 
2341
  PMXI_Plugin::$session->save_data();
2392
  wp_defer_term_counting(true);
2393
  wp_defer_comment_counting(true);
2394
 
2395
+ if ( PMXI_Plugin::is_ajax() or ! $ajax_processing ) {
 
 
 
 
2396
 
2397
  $iteration_start_time = time();
2398
 
2491
  PMXI_Plugin::$session->set('chunk_number', PMXI_Plugin::$session->chunk_number + $elements->length);
2492
  PMXI_Plugin::$session->save_data();
2493
  continue;
2494
+ }
2495
 
2496
  if ( ! $loop and $ajax_processing ) ob_start();
2497
 
2535
  wp_send_json(array(
2536
  'imported' => $import->imported,
2537
  'created' => $import->created,
2538
+ 'updated' => $import->updated,
2539
+ 'skipped' => $import->skipped,
2540
  'percentage' => ceil(($processed_records/$import->count) * 100),
2541
  'warnings' => PMXI_Plugin::$session->warnings,
2542
  'errors' => PMXI_Plugin::$session->errors,
2591
  'imported' => $import->imported,
2592
  'created' => $import->created,
2593
  'updated' => $import->updated,
2594
+ 'skipped' => $import->skipped,
2595
  'deleted' => $import->deleted,
2596
  'percentage' => 99,
2597
  'warnings' => PMXI_Plugin::$session->warnings,
2612
  'queue_chunk_number' => 0,
2613
  'registered_on' => date('Y-m-d H:i:s'),
2614
  'iteration' => ++$import->iteration
2615
+ ))->update();
2616
 
2617
  if ("ajax" != $import->options['import_processing'] and $log_storage ){
2618
  $log_file = wp_all_import_secure_file( $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXI_Plugin::LOGS_DIRECTORY, $history_log->id ) . DIRECTORY_SEPARATOR . $history_log->id . '.html';
2635
  $import->set(array(
2636
  'registered_on' => date('Y-m-d H:i:s'),
2637
  'executing' => 0
2638
+ ))->update();
2639
 
2640
  wp_defer_term_counting(false);
2641
+ wp_defer_comment_counting(false);
2642
 
2643
  // add history log
2644
  $custom_type = get_post_type_object( $import->options['custom_type'] );
2677
  wp_send_json(array(
2678
  'imported' => $import->imported,
2679
  'created' => $import->created,
2680
+ 'updated' => $import->updated,
2681
+ 'skipped' => $import->skipped,
2682
  'percentage' => 100,
2683
  'warnings' => PMXI_Plugin::$session->warnings,
2684
  'errors' => PMXI_Plugin::$session->errors,
controllers/admin/settings.php CHANGED
@@ -614,13 +614,13 @@ class PMXI_Admin_Settings extends PMXI_Controller_Admin {
614
  }
615
 
616
  if ( $is_show_cf_notice && $is_show_images_notice ){
617
- $warning = __('<a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&amp;utm_medium=in-plugin&amp;utm_campaign=custom-fields">Upgrade to the Pro edition of WP All Import to import images and custom fields.</a> <p>If you already own it, remove the free edition and install the Pro edition.</p>', 'wp_all_import_plugin');
618
  }
619
  else if ( $is_show_cf_notice ){
620
- $warning = __('<a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&amp;utm_medium=in-plugin&amp;utm_campaign=custom-fields">Upgrade to the Pro edition of WP All Import to import custom fields.</a> <p>If you already own it, remove the free edition and install the Pro edition.</p>', 'wp_all_import_plugin');
621
  }
622
  else if ( $is_show_images_notice ) {
623
- $warning = __('<a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&amp;utm_medium=in-plugin&amp;utm_campaign=custom-fields">Upgrade to the Pro edition of WP All Import to import images.</a> <p>If you already own it, remove the free edition and install the Pro edition.</p>', 'wp_all_import_plugin');
624
  }
625
  }
626
  }
@@ -631,18 +631,18 @@ class PMXI_Admin_Settings extends PMXI_Controller_Admin {
631
  case 'shop_order':
632
 
633
  if ( ! class_exists('WooCommerce') ) {
634
- $notice = __('<p class="wpallimport-bundle-notice">The import bundle you are using requires WooCommerce.</p><a class="upgrade_link" href="https://wordpress.org/plugins/woocommerce/" target="_blank">Get WooCommerce</a>.', 'wp_all_import_plugin');
635
  }
636
  else {
637
 
638
  if ( ! defined('PMWI_EDITION') ) {
639
 
640
- $notice = __('<p class="wpallimport-bundle-notice">The import bundle you are using requires the Pro version of the WooCommerce Add-On.</p><a href="http://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1529&edd_options%5Bprice_id%5D=1" class="upgrade_link" target="_blank">Purchase the WooCommerce Add-On</a>.', 'wp_all_import_plugin');
641
 
642
  }
643
  elseif ( PMWI_EDITION != 'paid' ) {
644
 
645
- $notice = __('<p class="wpallimport-bundle-notice">The import bundle you are using requires the Pro version of the WooCommerce Add-On, but you have the free version installed.</p><a href="http://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1529&edd_options%5Bprice_id%5D=1" target="_blank" class="upgrade_link">Purchase the WooCommerce Add-On</a>.', 'wp_all_import_plugin');
646
 
647
  }
648
  }
@@ -652,7 +652,7 @@ class PMXI_Admin_Settings extends PMXI_Controller_Admin {
652
  case 'import_users':
653
 
654
  if ( ! class_exists('PMUI_Plugin') ) {
655
- $notice = __('<p class="wpallimport-bundle-notice">The import bundle you are using requires the User Import Add-On.</p><a href="http://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1921&edd_options%5Bprice_id%5D=1" target="_blank" class="upgrade_link">Purchase the User Import Add-On</a>.', 'wp_all_import_plugin');
656
  }
657
 
658
  break;
614
  }
615
 
616
  if ( $is_show_cf_notice && $is_show_images_notice ){
617
+ $warning = __('<a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields">Upgrade to the Pro edition of WP All Import to Import Images and Custom Fields</a> <p>If you already own it, remove the free edition and install the Pro edition.</p>', 'wp_all_import_plugin');
618
  }
619
  else if ( $is_show_cf_notice ){
620
+ $warning = __('<a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields">Upgrade to the Pro edition of WP All Import to Import Custom Fields</a> <p>If you already own it, remove the free edition and install the Pro edition.</p>', 'wp_all_import_plugin');
621
  }
622
  else if ( $is_show_images_notice ) {
623
+ $warning = __('<a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields">Upgrade to the Pro edition of WP All Import to Import Images</a> <p>If you already own it, remove the free edition and install the Pro edition.</p>', 'wp_all_import_plugin');
624
  }
625
  }
626
  }
631
  case 'shop_order':
632
 
633
  if ( ! class_exists('WooCommerce') ) {
634
+ $notice = __('<p class="wpallimport-bundle-notice">The import bundle you are using requires WooCommerce.</p><a class="upgrade_link" href="https://wordpress.org/plugins/woocommerce/" target="_blank">Get WooCommerce</a>', 'wp_all_import_plugin');
635
  }
636
  else {
637
 
638
  if ( ! defined('PMWI_EDITION') ) {
639
 
640
+ $notice = __('<p class="wpallimport-bundle-notice">The import bundle you are using requires the Pro version of the WooCommerce Add-On.</p><a href="https://www.wpallimport.com/checkout/?edd_action=purchase_collection&taxonomy=download_category&terms=14&utm_source=free-plugin&utm_medium=dot-org&utm_campaign=woocommerce" class="upgrade_link" target="_blank">Purchase the WooCommerce Add-On</a>', 'wp_all_import_plugin');
641
 
642
  }
643
  elseif ( PMWI_EDITION != 'paid' ) {
644
 
645
+ $notice = __('<p class="wpallimport-bundle-notice">The import bundle you are using requires the Pro version of the WooCommerce Add-On, but you have the free version installed.</p><a href="https://www.wpallimport.com/checkout/?edd_action=purchase_collection&taxonomy=download_category&terms=14&utm_source=free-plugin&utm_medium=dot-org&utm_campaign=woocommerce" target="_blank" class="upgrade_link">Purchase the WooCommerce Add-On</a>', 'wp_all_import_plugin');
646
 
647
  }
648
  }
652
  case 'import_users':
653
 
654
  if ( ! class_exists('PMUI_Plugin') ) {
655
+ $notice = __('<p class="wpallimport-bundle-notice">The import bundle you are using requires the User Import Add-On.</p><a href="http://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1921&edd_options%5Bprice_id%5D=1" target="_blank" class="upgrade_link">Purchase the User Import Add-On</a>', 'wp_all_import_plugin');
656
  }
657
 
658
  break;
helpers/functions.php CHANGED
@@ -149,4 +149,8 @@
149
  }
150
  }
151
 
152
-
 
 
 
 
149
  }
150
  }
151
 
152
+ if ( ! function_exists('wp_all_import_clear_xss') ){
153
+ function wp_all_import_clear_xss( $str ) {
154
+ return stripslashes(esc_sql(htmlspecialchars(strip_tags($str))));
155
+ }
156
+ }
helpers/get_file_curl.php CHANGED
@@ -51,10 +51,10 @@ if ( ! function_exists('get_file_curl') ):
51
  if ($curl === false and $iteration === false)
52
  {
53
  $new_url = wp_all_import_translate_uri($url);
54
- return ($new_url !== $url) ? get_file_curl($new_url, $fullpath, $to_variable, true) : $response;
55
  }
56
 
57
- return ($curl === false) ? $response : $curl;
58
 
59
  }
60
 
51
  if ($curl === false and $iteration === false)
52
  {
53
  $new_url = wp_all_import_translate_uri($url);
54
+ return ($new_url !== $url) ? get_file_curl($new_url, $fullpath, $to_variable, true) : ( is_wp_error($response) ? $response : false );
55
  }
56
 
57
+ return ($curl === false) ? ( is_wp_error($response) ? $response : false ) : $curl;
58
 
59
  }
60
 
helpers/wp_all_import_get_feed_type.php CHANGED
@@ -52,7 +52,8 @@ if ( ! function_exists('wp_all_import_get_feed_type')){
52
  }
53
  return array(
54
  'Content-Type' => $type,
55
- 'Content-Encoding' => (!empty($headers['Content-Encoding'])) ? $headers['Content-Encoding'] : false
 
56
  );
57
  }
58
  }
52
  }
53
  return array(
54
  'Content-Type' => $type,
55
+ 'Content-Encoding' => (!empty($headers['Content-Encoding'])) ? $headers['Content-Encoding'] : false,
56
+ 'Content-Disposition' => (!empty($headers['Content-Disposition'])) ? $headers['Content-Disposition'] : false
57
  );
58
  }
59
  }
helpers/wp_all_import_get_image_from_gallery.php CHANGED
@@ -49,5 +49,5 @@ function wp_all_import_get_image_from_gallery($image_name, $targetDir = false, $
49
  }
50
  }
51
 
52
- return $attch;
53
  }
49
  }
50
  }
51
 
52
+ return apply_filters('wp_all_import_get_image_from_gallery', $attch, $image_name, $targetDir);
53
  }
helpers/wp_all_import_is_update_cf.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- function wp_all_import_is_update_cf( $met_key, $options ){
4
 
5
  if ( $options['update_all_data'] == 'yes') return true;
6
 
1
  <?php
2
 
3
+ function wp_all_import_is_update_cf( $meta_key, $options ){
4
 
5
  if ( $options['update_all_data'] == 'yes') return true;
6
 
helpers/wp_all_import_template_notifications.php CHANGED
@@ -20,11 +20,11 @@ if ( ! function_exists('wp_all_import_template_notifications') )
20
 
21
  if ( $post['custom_type'] == 'import_users' && ! class_exists('PMUI_Plugin') )
22
  {
23
- $notifications[] = __('The import template you are using requires the User Import Add-On. If you continue without it your data may import incorrectly.<br/><br/><a href="http://www.wpallimport.com/add-ons/user-import/?utm_source=wordpress.org&utm_medium=wpai-import-template&utm_campaign=free+wp+all+export+plugin" target="_blank">Purchase the User Import Add-On</a>.', 'wp_all_import_plugin');
24
  }
25
  elseif ( $post['custom_type'] == 'product' && ! class_exists('PMWI_Plugin') && class_exists( 'Woocommerce' ))
26
  {
27
- $notifications[] = __('The import template you are using requires the WooCommerce Import Add-On. If you continue without it your data may import incorrectly.<br/><br/><a href="http://www.wpallimport.com/woocommerce-product-import/" target="_blank">Purchase the WooCommerce Import Add-On</a>.', 'wp_all_import_plugin');
28
  }
29
  // Realia Add-On
30
  elseif ( ! empty($post['realia_addon']) and ! is_plugin_active('realia-xml-csv-property-listings-import/realia-add-on.php') )
20
 
21
  if ( $post['custom_type'] == 'import_users' && ! class_exists('PMUI_Plugin') )
22
  {
23
+ $notifications[] = __('The import template you are using requires the User Import Add-On. If you continue without it your data may import incorrectly.<br/><br/><a href="http://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1921&edd_options%5Bprice_id%5D=1&utm_source=wordpress.org&utm_medium=wpai-import-template&utm_campaign=free+wp+all+export+plugin" target="_blank">Purchase the User Import Add-On</a>.', 'wp_all_import_plugin');
24
  }
25
  elseif ( $post['custom_type'] == 'product' && ! class_exists('PMWI_Plugin') && class_exists( 'Woocommerce' ))
26
  {
27
+ $notifications[] = __('<p>The import template you are using requires the WooCommerce Import Add-On. If you continue without it your data may import incorrectly.<br/><br/><a href="https://www.wpallimport.com/checkout/?edd_action=purchase_collection&taxonomy=download_category&terms=14&utm_source=wordpress.org&utm_medium=wpai-import-template&utm_campaign=free+wp+all+export+plugin" target="_blank">Purchase the WooCommerce Import Add-On</a>', 'wp_all_import_plugin');
28
  }
29
  // Realia Add-On
30
  elseif ( ! empty($post['realia_addon']) and ! is_plugin_active('realia-xml-csv-property-listings-import/realia-add-on.php') )
i18n/languages/wp_all_import_plugin-de_CH.po CHANGED
@@ -1184,7 +1184,7 @@ msgstr ""
1184
 
1185
  #: ../../controllers/admin/import.php:295
1186
  msgid ""
1187
- "The import template you are using requires the User Import Add-On.<br/><a href=\"http://"
1188
  "www.wpallimport.com/add-ons/user-import/?utm_source=wordpress.org&utm_medium=wpai-"
1189
  "import-template&utm_campaign=free+wp+all+export+plugin\" target=\"_blank\">Purchase "
1190
  "the User Import Add-On</a>"
1184
 
1185
  #: ../../controllers/admin/import.php:295
1186
  msgid ""
1187
+ "The import template you are using requires User Import Add-On.<br/><a href=\"http://"
1188
  "www.wpallimport.com/add-ons/user-import/?utm_source=wordpress.org&utm_medium=wpai-"
1189
  "import-template&utm_campaign=free+wp+all+export+plugin\" target=\"_blank\">Purchase "
1190
  "the User Import Add-On</a>"
i18n/languages/wp_all_import_plugin-de_DE.po CHANGED
@@ -1179,7 +1179,7 @@ msgstr ""
1179
 
1180
  #: ../../controllers/admin/import.php:295
1181
  msgid ""
1182
- "The import template you are using requires the User Import Add-On.<br/><a "
1183
  "href=\"http://www.wpallimport.com/add-ons/user-import/?utm_source=wordpress."
1184
  "org&utm_medium=wpai-import-template&utm_campaign=free+wp+all+export+plugin\" "
1185
  "target=\"_blank\">Purchase the User Import Add-On</a>"
1179
 
1180
  #: ../../controllers/admin/import.php:295
1181
  msgid ""
1182
+ "The import template you are using requires User Import Add-On.<br/><a "
1183
  "href=\"http://www.wpallimport.com/add-ons/user-import/?utm_source=wordpress."
1184
  "org&utm_medium=wpai-import-template&utm_campaign=free+wp+all+export+plugin\" "
1185
  "target=\"_blank\">Purchase the User Import Add-On</a>"
i18n/languages/wp_all_import_plugin-es_ES.po CHANGED
@@ -1190,7 +1190,7 @@ msgstr ""
1190
 
1191
  #: ../../controllers/admin/import.php:295
1192
  msgid ""
1193
- "The import template you are using requires the User Import Add-On.<br/><a "
1194
  "href=\"http://www.wpallimport.com/add-ons/user-import/?utm_source=wordpress."
1195
  "org&utm_medium=wpai-import-template&utm_campaign=free+wp+all+export+plugin\" "
1196
  "target=\"_blank\">Purchase the User Import Add-On</a>"
1190
 
1191
  #: ../../controllers/admin/import.php:295
1192
  msgid ""
1193
+ "The import template you are using requires User Import Add-On.<br/><a "
1194
  "href=\"http://www.wpallimport.com/add-ons/user-import/?utm_source=wordpress."
1195
  "org&utm_medium=wpai-import-template&utm_campaign=free+wp+all+export+plugin\" "
1196
  "target=\"_blank\">Purchase the User Import Add-On</a>"
libraries/XmlImportCsvParse.php CHANGED
@@ -150,7 +150,7 @@ class PMXI_CsvParser
150
  */
151
  public function set_settings($array)
152
  {
153
- $this->settings = array_merge($this->settings, $array);
154
  }
155
 
156
  /**
@@ -968,8 +968,14 @@ class PMXI_CsvParser
968
  $xmlWriter->startDocument('1.0', $this->csv_encoding);
969
  $xmlWriter->startElement('data');
970
 
971
- $create_new_headers = false;
972
-
 
 
 
 
 
 
973
  while ($keys = fgetcsv($res, $l, $d, $e)) {
974
 
975
  $empty_columns = 0;
@@ -984,14 +990,20 @@ class PMXI_CsvParser
984
  foreach ($keys as $key => $value) {
985
  if (!$create_new_headers and (preg_match('%\W(http:|https:|ftp:)$%i', $value) or is_numeric($value))) $create_new_headers = true;
986
  $value = trim(strtolower(preg_replace('/^[0-9]{1}/','el_', preg_replace('/[^a-z0-9_]/i', '', $value))));
987
- $keys[$key] = (!empty($value)) ? $value : 'undefined' . $key;
 
 
 
 
 
 
988
  }
989
  $this->headers = $keys;
990
  if ($create_new_headers){
991
  $this->createHeaders('column');
992
  $keys = $buf_keys;
993
  }
994
- }
995
 
996
  if ( $c or $create_new_headers ) {
997
 
@@ -1010,7 +1022,7 @@ class PMXI_CsvParser
1010
  $value = preg_replace('/\]\]>/s', '', preg_replace('/<!\[CDATA\[/s', '', $value ));
1011
  if ($fixBrokenSymbols){
1012
  // Remove non ASCII symbols and write CDATA
1013
- $xmlWriter->writeCData(preg_replace('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $value));
1014
  }
1015
  else{
1016
  $xmlWriter->writeCData($value);
150
  */
151
  public function set_settings($array)
152
  {
153
+ $this->settings = apply_filters('wp_all_import_csv_parser_settings', array_merge($this->settings, $array));
154
  }
155
 
156
  /**
968
  $xmlWriter->startDocument('1.0', $this->csv_encoding);
969
  $xmlWriter->startElement('data');
970
 
971
+ $import_id = 0;
972
+
973
+ if ( ! empty($_GET['id']) ) $import_id = $_GET['id'];
974
+
975
+ if ( ! empty($_GET['import_id']) ) $import_id = $_GET['import_id'];
976
+
977
+ $create_new_headers = apply_filters('wp_all_import_auto_create_csv_headers', false, $import_id);
978
+ $headers = array();
979
  while ($keys = fgetcsv($res, $l, $d, $e)) {
980
 
981
  $empty_columns = 0;
990
  foreach ($keys as $key => $value) {
991
  if (!$create_new_headers and (preg_match('%\W(http:|https:|ftp:)$%i', $value) or is_numeric($value))) $create_new_headers = true;
992
  $value = trim(strtolower(preg_replace('/^[0-9]{1}/','el_', preg_replace('/[^a-z0-9_]/i', '', $value))));
993
+ $value = (!empty($value)) ? $value : 'undefined' . $key;
994
+ if (empty($headers[$value]))
995
+ $headers[$value] = 1;
996
+ else
997
+ $headers[$value]++;
998
+
999
+ $keys[$key] = ($headers[$value] === 1) ? $value : $value . '_' . $headers[$value];
1000
  }
1001
  $this->headers = $keys;
1002
  if ($create_new_headers){
1003
  $this->createHeaders('column');
1004
  $keys = $buf_keys;
1005
  }
1006
+ }
1007
 
1008
  if ( $c or $create_new_headers ) {
1009
 
1022
  $value = preg_replace('/\]\]>/s', '', preg_replace('/<!\[CDATA\[/s', '', $value ));
1023
  if ($fixBrokenSymbols){
1024
  // Remove non ASCII symbols and write CDATA
1025
+ $xmlWriter->writeCData(preg_replace('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $value));
1026
  }
1027
  else{
1028
  $xmlWriter->writeCData($value);
models/import/record.php CHANGED
@@ -84,8 +84,19 @@ class PMXI_Import_Record extends PMXI_Model_Record {
84
  parent::__construct($data);
85
  $this->setTable(PMXI_Plugin::getInstance()->getTablePrefix() . 'imports');
86
  $this->errors = new WP_Error();
 
 
 
 
 
 
 
 
 
 
 
87
  }
88
-
89
  public $post_meta_to_insert = array();
90
 
91
  /**
@@ -135,12 +146,12 @@ class PMXI_Import_Record extends PMXI_Model_Record {
135
  }
136
  else{
137
  count($titles) and $post_excerpt = array_fill(0, count($titles), '');
138
- }
139
 
140
  if ( "xpath" == $this->options['status'] ){
141
  $chunk == 1 and $logger and call_user_func($logger, __('Composing statuses...', 'wp_all_import_plugin'));
142
  $post_status = array();
143
- if (!empty($this->options['status_xpath'])){
144
  $post_status = XmlImportParser::factory($xml, $cxpath, $this->options['status_xpath'], $file)->parse($records); $tmp_files[] = $file;
145
  }
146
  else{
@@ -391,7 +402,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
391
  $taxonomies = array();
392
  $exclude_taxonomies = apply_filters('pmxi_exclude_taxonomies', (class_exists('PMWI_Plugin')) ? array('post_format', 'product_type', 'product_shipping_class') : array('post_format'));
393
  $post_taxonomies = array_diff_key(get_taxonomies_by_object_type(array($this->options['custom_type']), 'object'), array_flip($exclude_taxonomies));
394
- if ( ! empty($post_taxonomies) ):
395
  foreach ($post_taxonomies as $ctx): if ("" == $ctx->labels->name or (class_exists('PMWI_Plugin') and strpos($ctx->name, "pa_") === 0 and $this->options['custom_type'] == "product")) continue;
396
  $chunk == 1 and $logger and call_user_func($logger, sprintf(__('Composing terms for `%s` taxonomy...', 'wp_all_import_plugin'), $ctx->labels->name));
397
  $tx_name = $ctx->name;
@@ -602,7 +613,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
602
  }
603
  endforeach;
604
  endif;
605
- // [/custom taxonomies]
606
 
607
  // Composing featured images
608
  $image_sections = apply_filters('wp_all_import_image_sections', array(
@@ -853,14 +864,14 @@ class PMXI_Import_Record extends PMXI_Model_Record {
853
  $logger and !$is_cron and PMXI_Plugin::$session->chunk_number++;
854
  $logger and !$is_cron and PMXI_Plugin::$session->save_data();
855
  continue;
856
- }
857
 
858
  wp_cache_flush();
859
 
860
  $logger and call_user_func($logger, __('<b>ACTION</b>: pmxi_before_post_import ...', 'wp_all_import_plugin'));
861
  do_action('pmxi_before_post_import', $this->id);
862
 
863
- if ( empty($titles[$i]) ) {
864
  if ( ! empty($addons_data['PMWI_Plugin']) and !empty($addons_data['PMWI_Plugin']['single_product_parent_ID'][$i]) ){
865
  $titles[$i] = $addons_data['PMWI_Plugin']['single_product_parent_ID'][$i] . ' Product Variation';
866
  }
@@ -871,7 +882,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
871
  }
872
 
873
  if ( $this->options['custom_type'] == 'import_users' ){
874
- $articleData = array(
875
  'user_pass' => $addons_data['PMUI_Plugin']['pmui_pass'][$i],
876
  'user_login' => $addons_data['PMUI_Plugin']['pmui_logins'][$i],
877
  'user_nicename' => $addons_data['PMUI_Plugin']['pmui_nicename'][$i],
@@ -884,11 +895,11 @@ class PMXI_Import_Record extends PMXI_Model_Record {
884
  'description' => $addons_data['PMUI_Plugin']['pmui_description'][$i],
885
  'nickname' => $addons_data['PMUI_Plugin']['pmui_nickname'][$i],
886
  'role' => ('' == $addons_data['PMUI_Plugin']['pmui_role'][$i]) ? 'subscriber' : strtolower($addons_data['PMUI_Plugin']['pmui_role'][$i]),
887
- );
888
  $logger and call_user_func($logger, sprintf(__('Combine all data for user %s...', 'wp_all_import_plugin'), $articleData['user_login']));
889
  }
890
- else {
891
- $articleData = array(
892
  'post_type' => $post_type[$i],
893
  'post_status' => ("xpath" == $this->options['status']) ? $post_status[$i] : $this->options['status'],
894
  'comment_status' => ("xpath" == $this->options['comment_status']) ? $comment_status[$i] : $this->options['comment_status'],
@@ -902,15 +913,27 @@ class PMXI_Import_Record extends PMXI_Model_Record {
902
  'post_author' => $post_author[$i],
903
  'menu_order' => (int) $menu_order[$i],
904
  'post_parent' => ("no" == $this->options['is_multiple_page_parent']) ? (int) $page_parent[$i] : (int) $this->options['parent']
905
- );
906
  $logger and call_user_func($logger, sprintf(__('Combine all data for post `%s`...', 'wp_all_import_plugin'), $articleData['post_title']));
 
 
 
 
 
 
 
 
 
 
 
 
907
  }
908
 
909
  // Re-import Records Matching
910
  $post_to_update = false; $post_to_update_id = false;
911
 
912
  // An array representation of current XML node
913
- $current_xml_node = wp_all_import_xml2array($rootNodes[$i]);
914
 
915
  $check_for_duplicates = apply_filters('wp_all_import_is_check_duplicates', true, $this->id);
916
 
@@ -976,7 +999,17 @@ class PMXI_Import_Record extends PMXI_Model_Record {
976
  $logger and call_user_func($logger, sprintf(__('Duplicate post wasn\'t found for post `%s`...', 'wp_all_import_plugin'), $articleData['post_title']));
977
  }
978
  }
979
- }
 
 
 
 
 
 
 
 
 
 
980
 
981
  if ( ! empty($specified_records) ) {
982
 
@@ -1156,10 +1189,10 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1156
  // existing post not found though it's track was found... clear the leftover, plugin will continue to treat record as new
1157
  $postRecord->clear();
1158
 
1159
- }
1160
 
1161
  $logger and call_user_func($logger, sprintf(__('Applying filter `pmxi_article_data` for `%s`', 'wp_all_import_plugin'), $articleData['post_title']));
1162
- $articleData = apply_filters('pmxi_article_data', $articleData, $this, $post_to_update);
1163
 
1164
  // no new records are created. it will only update posts it finds matching duplicates for
1165
  if ( ! $this->options['create_new_records'] and empty($articleData['ID']) ){
@@ -1282,7 +1315,13 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1282
  }
1283
  $pid = (empty($articleData['ID'])) ? wp_insert_post($articleData, true) : wp_update_post($articleData, true);
1284
  }
1285
- else{
 
 
 
 
 
 
1286
  $pid = (empty($articleData['ID'])) ? wp_insert_user( $articleData ) : wp_update_user( $articleData );
1287
  $articleData['post_title'] = $articleData['user_login'];
1288
  }
@@ -1321,7 +1360,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1321
  set_post_format($pid, ("xpath" == $this->options['post_format']) ? $post_format[$i] : $this->options['post_format'] );
1322
  $logger and call_user_func($logger, sprintf(__('Associate post `%s` with post format %s ...', 'wp_all_import_plugin'), $articleData['post_title'], ("xpath" == $this->options['post_format']) ? $post_format[$i] : $this->options['post_format']));
1323
  }
1324
- // [/post format]
1325
 
1326
  // [addons import]
1327
 
@@ -1357,7 +1396,81 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1357
  }
1358
  }
1359
 
1360
- // [/addons import]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1361
 
1362
  // Page Template
1363
  if ( ! empty($articleData['post_type']) and 'page' == $articleData['post_type'] and wp_all_import_is_update_cf('_wp_page_template', $this->options) and ( !empty($this->options['page_template']) or "no" == $this->options['is_multiple_page_template']) ){
@@ -1366,9 +1479,9 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1366
 
1367
  // [featured image]
1368
 
1369
- $is_images_to_update = apply_filters('pmxi_is_images_to_update', true, $articleData, $current_xml_node);
1370
 
1371
- $is_allow_import_images = apply_filters('wp_all_import_is_allow_import_images', false, empty($articleData['post_type']) ? '' : $articleData['post_type']);
1372
 
1373
  if ( $is_images_to_update and ! empty($uploads) and false === $uploads['error'] and ( ! empty($articleData['post_type']) and $articleData['post_type'] == "product" and class_exists('PMWI_Plugin') or $is_allow_import_images) and (empty($articleData['ID']) or $this->options['update_all_data'] == "yes" or ( $this->options['update_all_data'] == "no" and $this->options['is_update_images'])) ) {
1374
 
@@ -1512,15 +1625,17 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1512
  $logger and call_user_func($logger, sprintf(__('- Importing image `%s` for `%s` ...', 'wp_all_import_plugin'), $img_url, $articleData['post_title']));
1513
 
1514
  // generate local file name
1515
- $image_name = urldecode(($this->options[$option_slug . 'auto_rename_images'] and !empty($auto_rename_images_bundle[$slug][$i])) ? sanitize_file_name(($img_ext) ? str_replace("." . $default_extension, "", $auto_rename_images_bundle[$slug][$i]) : $auto_rename_images_bundle[$slug][$i]) : sanitize_file_name((($img_ext) ? str_replace("." . $default_extension, "", $bn) : $bn))) . (("" != $img_ext) ? '.' . $img_ext : '');
1516
- $image_name = apply_filters("wp_all_import_image_filename", $image_name, empty($img_titles[$k]) ? '' : $img_titles[$k], empty($img_captions[$k]) ? '' : $img_captions[$k], empty($img_alts[$k]) ? '' : $img_alts[$k], $articleData);
1517
-
1518
  // if wizard store image data to custom field
1519
  $create_image = false;
1520
  $download_image = true;
1521
  $wp_filetype = false;
1522
 
1523
- if ($bundle_data['type'] == 'images' and base64_decode($url, true) !== false){
 
 
1524
  $img = @imagecreatefromstring(base64_decode($url));
1525
  if($img)
1526
  {
@@ -1651,7 +1766,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1651
  @unlink($image_filepath); // delete file since failed upload may result in empty file created
1652
  } else{
1653
 
1654
- if($bundle_data['type'] == 'images'){
1655
  if( preg_match('%\W(svg)$%i', 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))) {
1656
  $create_image = true;
1657
  $logger and call_user_func($logger, sprintf(__('- Image `%s` has been successfully downloaded', 'wp_all_import_plugin'), $url));
@@ -1671,42 +1786,48 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1671
 
1672
  }
1673
 
1674
- if ( ! $create_image and $img_url !== pmxi_convert_encoding($img_url) ){
1675
-
1676
- $url = trim(pmxi_convert_encoding($img_url));
 
 
1677
 
1678
- $request = get_file_curl($url, $image_filepath);
1679
-
1680
- $get_ctx = stream_context_create(array('http' => array('timeout' => 5)));
1681
 
1682
- if ( (is_wp_error($request) or $request === false) and ! @file_put_contents($image_filepath, @file_get_contents($url, false, $get_ctx))) {
1683
- $logger and call_user_func($logger, sprintf(__('- <b>WARNING</b>: File %s cannot be saved locally as %s', 'wp_all_import_plugin'), $url, $image_filepath));
1684
- $logger and !$is_cron and PMXI_Plugin::$session->warnings++;
1685
- @unlink($image_filepath); // delete file since failed upload may result in empty file created
1686
- }
1687
- else{
1688
- if($bundle_data['type'] == 'images'){
1689
- if( preg_match('%\W(svg)$%i', 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))) {
1690
- $create_image = true;
1691
- $logger and call_user_func($logger, sprintf(__('- Image `%s` has been successfully downloaded', 'wp_all_import_plugin'), $url));
1692
- } else {
1693
- $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'), $url));
1694
- $logger and !$is_cron and PMXI_Plugin::$session->warnings++;
1695
- @unlink($image_filepath);
1696
- }
1697
- }
1698
- elseif($bundle_data['type'] == 'files'){
1699
- if( ! $wp_filetype = wp_check_filetype(basename($image_filepath), null )) {
1700
- $logger and call_user_func($logger, sprintf(__('- <b>WARNING</b>: Can\'t detect attachment file type %s', 'wp_all_import_plugin'), trim($url)));
1701
- $logger and !$is_cron and PMXI_Plugin::$session->warnings++;
1702
- @unlink($image_filepath);
1703
  }
1704
- else {
1705
- $create_image = true;
1706
- $logger and call_user_func($logger, sprintf(__('- File `%s` has been successfully found', 'wp_all_import_plugin'), $url));
 
 
 
 
 
 
 
1707
  }
1708
  }
1709
  }
 
 
 
1710
  }
1711
  }
1712
  }
@@ -1794,7 +1915,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
1794
  $post_thumbnail_id = get_post_thumbnail_id( $pid );
1795
 
1796
  if ($bundle_data['type'] == 'images' and empty($post_thumbnail_id) and $this->options[$option_slug . 'is_featured'] ) {
1797
- set_post_thumbnail($pid, $attid);
1798
  }
1799
  elseif(!in_array($attid, $gallery_attachment_ids) and $post_thumbnail_id != $attid){
1800
  $gallery_attachment_ids[] = $attid;
@@ -2023,6 +2144,8 @@ class PMXI_Import_Record extends PMXI_Model_Record {
2023
  unset($existing_taxonomies[$tx_name][$i]);
2024
  }
2025
 
 
 
2026
  // create term if not exists
2027
  if ( ! empty($txes[$i]) ):
2028
  foreach ($txes[$i] as $key => $single_tax) {
@@ -2134,7 +2257,8 @@ class PMXI_Import_Record extends PMXI_Model_Record {
2134
  $importData = array(
2135
  'pid' => $pid,
2136
  'import' => $this,
2137
- 'logger' => $logger
 
2138
  );
2139
 
2140
  $saved_functions = apply_filters('wp_all_import_addon_saved_post', array());
@@ -2158,7 +2282,7 @@ class PMXI_Import_Record extends PMXI_Model_Record {
2158
 
2159
  // [/addons import]
2160
  $logger and call_user_func($logger, __('<b>ACTION</b>: pmxi_saved_post', 'wp_all_import_plugin'));
2161
- do_action( 'pmxi_saved_post', $pid, $rootNodes[$i], $is_update); // hook that was triggered immediately after post saved
2162
 
2163
  if (empty($articleData['ID'])) $created++; else $updated++;
2164
 
@@ -2307,9 +2431,15 @@ class PMXI_Import_Record extends PMXI_Model_Record {
2307
 
2308
  // Instead of deletion, set Custom Field
2309
  if ($this->options['is_update_missing_cf']){
2310
- update_post_meta( $missingPostRecord['post_id'], $this->options['update_missing_cf_name'], $this->options['update_missing_cf_value'] );
 
 
 
 
 
 
 
2311
  $to_delete = false;
2312
- $logger and call_user_func($logger, sprintf(__('Instead of deletion post with ID `%s`, set Custom Field `%s` to value `%s`', 'wp_all_import_plugin'), $missingPostRecord['post_id'], $this->options['update_missing_cf_name'], $this->options['update_missing_cf_value']));
2313
  }
2314
 
2315
  // Instead of deletion, change post status to Draft
@@ -2338,7 +2468,10 @@ class PMXI_Import_Record extends PMXI_Model_Record {
2338
  {
2339
 
2340
  $postRecord = new PMXI_Post_Record();
2341
- $postRecord->getById($missingPostRecord['id']);
 
 
 
2342
  if ( ! $postRecord->isEmpty() )
2343
  {
2344
  $postRecord->set(array(
84
  parent::__construct($data);
85
  $this->setTable(PMXI_Plugin::getInstance()->getTablePrefix() . 'imports');
86
  $this->errors = new WP_Error();
87
+ }
88
+
89
+ protected function update_meta( $pid, $key, $value ){
90
+
91
+ $meta_table = _get_meta_table( 'post' );
92
+
93
+ $where = array( 'post_id' => $pid, 'meta_key' => $key );
94
+
95
+ $result = $this->wpdb->update( $meta_table, array('meta_value' => $value), $where );
96
+
97
+ return $result;
98
  }
99
+
100
  public $post_meta_to_insert = array();
101
 
102
  /**
146
  }
147
  else{
148
  count($titles) and $post_excerpt = array_fill(0, count($titles), '');
149
+ }
150
 
151
  if ( "xpath" == $this->options['status'] ){
152
  $chunk == 1 and $logger and call_user_func($logger, __('Composing statuses...', 'wp_all_import_plugin'));
153
  $post_status = array();
154
+ if ( ! empty($this->options['status_xpath']) ){
155
  $post_status = XmlImportParser::factory($xml, $cxpath, $this->options['status_xpath'], $file)->parse($records); $tmp_files[] = $file;
156
  }
157
  else{
402
  $taxonomies = array();
403
  $exclude_taxonomies = apply_filters('pmxi_exclude_taxonomies', (class_exists('PMWI_Plugin')) ? array('post_format', 'product_type', 'product_shipping_class') : array('post_format'));
404
  $post_taxonomies = array_diff_key(get_taxonomies_by_object_type(array($this->options['custom_type']), 'object'), array_flip($exclude_taxonomies));
405
+ if ( ! empty($post_taxonomies) && $this->options['custom_type'] != 'import_users' ):
406
  foreach ($post_taxonomies as $ctx): if ("" == $ctx->labels->name or (class_exists('PMWI_Plugin') and strpos($ctx->name, "pa_") === 0 and $this->options['custom_type'] == "product")) continue;
407
  $chunk == 1 and $logger and call_user_func($logger, sprintf(__('Composing terms for `%s` taxonomy...', 'wp_all_import_plugin'), $ctx->labels->name));
408
  $tx_name = $ctx->name;
613
  }
614
  endforeach;
615
  endif;
616
+ // [/custom taxonomies]
617
 
618
  // Composing featured images
619
  $image_sections = apply_filters('wp_all_import_image_sections', array(
864
  $logger and !$is_cron and PMXI_Plugin::$session->chunk_number++;
865
  $logger and !$is_cron and PMXI_Plugin::$session->save_data();
866
  continue;
867
+ }
868
 
869
  wp_cache_flush();
870
 
871
  $logger and call_user_func($logger, __('<b>ACTION</b>: pmxi_before_post_import ...', 'wp_all_import_plugin'));
872
  do_action('pmxi_before_post_import', $this->id);
873
 
874
+ if ( empty($titles[$i]) && $this->options['custom_type'] != 'shop_order') {
875
  if ( ! empty($addons_data['PMWI_Plugin']) and !empty($addons_data['PMWI_Plugin']['single_product_parent_ID'][$i]) ){
876
  $titles[$i] = $addons_data['PMWI_Plugin']['single_product_parent_ID'][$i] . ' Product Variation';
877
  }
882
  }
883
 
884
  if ( $this->options['custom_type'] == 'import_users' ){
885
+ $articleData = apply_filters('wp_all_import_combine_article_data', array(
886
  'user_pass' => $addons_data['PMUI_Plugin']['pmui_pass'][$i],
887
  'user_login' => $addons_data['PMUI_Plugin']['pmui_logins'][$i],
888
  'user_nicename' => $addons_data['PMUI_Plugin']['pmui_nicename'][$i],
895
  'description' => $addons_data['PMUI_Plugin']['pmui_description'][$i],
896
  'nickname' => $addons_data['PMUI_Plugin']['pmui_nickname'][$i],
897
  'role' => ('' == $addons_data['PMUI_Plugin']['pmui_role'][$i]) ? 'subscriber' : strtolower($addons_data['PMUI_Plugin']['pmui_role'][$i]),
898
+ ), $this->options['custom_type'], $this->id, $i);
899
  $logger and call_user_func($logger, sprintf(__('Combine all data for user %s...', 'wp_all_import_plugin'), $articleData['user_login']));
900
  }
901
+ else {
902
+ $articleData = apply_filters('wp_all_import_combine_article_data', array(
903
  'post_type' => $post_type[$i],
904
  'post_status' => ("xpath" == $this->options['status']) ? $post_status[$i] : $this->options['status'],
905
  'comment_status' => ("xpath" == $this->options['comment_status']) ? $comment_status[$i] : $this->options['comment_status'],
913
  'post_author' => $post_author[$i],
914
  'menu_order' => (int) $menu_order[$i],
915
  'post_parent' => ("no" == $this->options['is_multiple_page_parent']) ? (int) $page_parent[$i] : (int) $this->options['parent']
916
+ ), $this->options['custom_type'], $this->id, $i);
917
  $logger and call_user_func($logger, sprintf(__('Combine all data for post `%s`...', 'wp_all_import_plugin'), $articleData['post_title']));
918
+
919
+ // if ( "xpath" == $this->options['status'] )
920
+ // {
921
+ // $status_object = get_post_status_object($post_status[$i]);
922
+
923
+ // if ( empty($status_object) )
924
+ // {
925
+ // $articleData['post_status'] = 'draft';
926
+ // $logger and call_user_func($logger, sprintf(__('<b>WARNING</b>: Post status `%s` is not supported, post `%s` will be saved in draft.', 'wp_all_import_plugin'), $post_status[$i], $articleData['post_title']));
927
+ // $logger and !$is_cron and PMXI_Plugin::$session->warnings++;
928
+ // }
929
+ // }
930
  }
931
 
932
  // Re-import Records Matching
933
  $post_to_update = false; $post_to_update_id = false;
934
 
935
  // An array representation of current XML node
936
+ $current_xml_node = wp_all_import_xml2array($rootNodes[$i]);
937
 
938
  $check_for_duplicates = apply_filters('wp_all_import_is_check_duplicates', true, $this->id);
939
 
999
  $logger and call_user_func($logger, sprintf(__('Duplicate post wasn\'t found for post `%s`...', 'wp_all_import_plugin'), $articleData['post_title']));
1000
  }
1001
  }
1002
+ }
1003
+
1004
+ $is_post_to_skip = apply_filters('wp_all_import_is_post_to_skip', false, $this->id, $current_xml_node, $i, $post_to_update_id);
1005
+
1006
+ if ( $is_post_to_skip ) {
1007
+ $skipped++;
1008
+ $logger and !$is_cron and PMXI_Plugin::$session->warnings++;
1009
+ $logger and !$is_cron and PMXI_Plugin::$session->chunk_number++;
1010
+ $logger and !$is_cron and PMXI_Plugin::$session->save_data();
1011
+ continue;
1012
+ }
1013
 
1014
  if ( ! empty($specified_records) ) {
1015
 
1189
  // existing post not found though it's track was found... clear the leftover, plugin will continue to treat record as new
1190
  $postRecord->clear();
1191
 
1192
+ }
1193
 
1194
  $logger and call_user_func($logger, sprintf(__('Applying filter `pmxi_article_data` for `%s`', 'wp_all_import_plugin'), $articleData['post_title']));
1195
+ $articleData = apply_filters('pmxi_article_data', $articleData, $this, $post_to_update);
1196
 
1197
  // no new records are created. it will only update posts it finds matching duplicates for
1198
  if ( ! $this->options['create_new_records'] and empty($articleData['ID']) ){
1315
  }
1316
  $pid = (empty($articleData['ID'])) ? wp_insert_post($articleData, true) : wp_update_post($articleData, true);
1317
  }
1318
+ else{
1319
+ if (empty($articleData['ID']) && email_exists( $articleData['user_email'] )){
1320
+ $logger and call_user_func($logger, sprintf(__('<b>ERROR</b> Sorry, that email address `%s` is already used!', 'wp_all_import_plugin'), $articleData['user_email']));
1321
+ $logger and !$is_cron and PMXI_Plugin::$session->errors++;
1322
+ $skipped++;
1323
+ continue;
1324
+ }
1325
  $pid = (empty($articleData['ID'])) ? wp_insert_user( $articleData ) : wp_update_user( $articleData );
1326
  $articleData['post_title'] = $articleData['user_login'];
1327
  }
1360
  set_post_format($pid, ("xpath" == $this->options['post_format']) ? $post_format[$i] : $this->options['post_format'] );
1361
  $logger and call_user_func($logger, sprintf(__('Associate post `%s` with post format %s ...', 'wp_all_import_plugin'), $articleData['post_title'], ("xpath" == $this->options['post_format']) ? $post_format[$i] : $this->options['post_format']));
1362
  }
1363
+ // [/post format]
1364
 
1365
  // [addons import]
1366
 
1396
  }
1397
  }
1398
 
1399
+ // [/addons import]
1400
+
1401
+ if (empty($articleData['ID']) or $this->options['update_all_data'] == 'yes' or ($this->options['update_all_data'] == 'no' and $this->options['is_update_custom_fields']) or ($this->options['update_all_data'] == 'no' and $this->options['is_update_attributes'] and $post_type[$i] == "product" and class_exists('PMWI_Plugin'))) {
1402
+
1403
+ $encoded_meta = array();
1404
+
1405
+ if ( ! empty($serialized_meta)){
1406
+
1407
+ $processed_custom_fields = array();
1408
+
1409
+ foreach ($serialized_meta as $m_keys) {
1410
+
1411
+ foreach ($m_keys as $m_key => $values) {
1412
+
1413
+ if (!empty($articleData['ID'])){
1414
+
1415
+ if ($this->options['update_all_data'] != 'yes'){
1416
+
1417
+ $field_to_update = false;
1418
+
1419
+ if ($this->options['is_update_custom_fields'] and $this->options['update_custom_fields_logic'] == "only" and ! empty($this->options['custom_fields_list']) and is_array($this->options['custom_fields_list']) and in_array($m_key, $this->options['custom_fields_list']) ) $field_to_update = true;
1420
+ if ($this->options['is_update_custom_fields'] and $this->options['update_custom_fields_logic'] == "all_except" and ( empty($this->options['custom_fields_list']) or ! in_array($m_key, $this->options['custom_fields_list']) )) $field_to_update = true;
1421
+
1422
+ if ( $this->options['update_custom_fields_logic'] == "full_update" ) $field_to_update = true;
1423
+
1424
+ // apply addons filters
1425
+ $field_to_update = apply_filters('pmxi_custom_field_to_update', $field_to_update, $post_type[$i], $this->options, $m_key);
1426
+
1427
+ if ( ! $field_to_update ) {
1428
+ $logger and call_user_func($logger, sprintf(__('- Custom field `%s` has been skipped attempted to record matching options ...', 'wp_all_import_plugin'), $m_key));
1429
+ continue;
1430
+ }
1431
+
1432
+ }
1433
+
1434
+ }
1435
+
1436
+ $logger and call_user_func($logger, __('- <b>ACTION</b>: pmxi_custom_field', 'wp_all_import_plugin'));
1437
+ $cf_value = apply_filters('pmxi_custom_field', (is_serialized($values[$i])) ? unserialize($values[$i]) : $values[$i], $pid, $m_key, $existing_meta_keys, $this->id);
1438
+
1439
+ //$this->pushmeta($pid, $m_key, $cf_value);
1440
+ if ( $this->options['custom_type'] == 'import_users')
1441
+ {
1442
+ if (in_array($m_key, $processed_custom_fields))
1443
+ {
1444
+ add_user_meta($pid, $m_key, $cf_value);
1445
+ }
1446
+ else
1447
+ {
1448
+ update_user_meta($pid, $m_key, $cf_value);
1449
+ }
1450
+ }
1451
+ else
1452
+ {
1453
+ if (in_array($m_key, $processed_custom_fields))
1454
+ {
1455
+ add_post_meta($pid, $m_key, $cf_value);
1456
+ }
1457
+ else
1458
+ {
1459
+ update_post_meta($pid, $m_key, $cf_value);
1460
+ }
1461
+ }
1462
+ if ( ! in_array($m_key, $processed_custom_fields)) $processed_custom_fields[] = $m_key;
1463
+
1464
+ $logger and call_user_func($logger, sprintf(__('- Custom field `%s` has been updated with value `%s` for post `%s` ...', 'wp_all_import_plugin'), $m_key, esc_attr(maybe_serialize($cf_value)), $articleData['post_title']));
1465
+ $logger and call_user_func($logger, __('- <b>ACTION</b>: pmxi_update_post_meta', 'wp_all_import_plugin'));
1466
+ do_action( 'pmxi_update_post_meta', $pid, $m_key, (is_serialized($values[$i])) ? unserialize($values[$i]) : $values[$i]); // hook that was triggered after post meta data updated
1467
+ }
1468
+ }
1469
+
1470
+ //$this->executeSQL();
1471
+ }
1472
+ }
1473
+ // [/custom fields]
1474
 
1475
  // Page Template
1476
  if ( ! empty($articleData['post_type']) and 'page' == $articleData['post_type'] and wp_all_import_is_update_cf('_wp_page_template', $this->options) and ( !empty($this->options['page_template']) or "no" == $this->options['is_multiple_page_template']) ){
1479
 
1480
  // [featured image]
1481
 
1482
+ $is_images_to_update = apply_filters('pmxi_is_images_to_update', true, $articleData, $current_xml_node);
1483
 
1484
+ $is_allow_import_images = apply_filters('wp_all_import_is_allow_import_images', false, empty($articleData['post_type']) ? '' : $articleData['post_type']);
1485
 
1486
  if ( $is_images_to_update and ! empty($uploads) and false === $uploads['error'] and ( ! empty($articleData['post_type']) and $articleData['post_type'] == "product" and class_exists('PMWI_Plugin') or $is_allow_import_images) and (empty($articleData['ID']) or $this->options['update_all_data'] == "yes" or ( $this->options['update_all_data'] == "no" and $this->options['is_update_images'])) ) {
1487
 
1625
  $logger and call_user_func($logger, sprintf(__('- Importing image `%s` for `%s` ...', 'wp_all_import_plugin'), $img_url, $articleData['post_title']));
1626
 
1627
  // generate local file name
1628
+ $image_name = urldecode(($this->options[$option_slug . 'auto_rename_images'] and !empty($auto_rename_images_bundle[$slug][$i])) ? sanitize_file_name(($img_ext) ? str_replace("." . $default_extension, "", $auto_rename_images_bundle[$slug][$i]) : $auto_rename_images_bundle[$slug][$i]) : sanitize_file_name((($img_ext) ? str_replace("." . $default_extension, "", $bn) : $bn))) . (("" != $img_ext) ? '.' . $img_ext : '');
1629
+ $image_name = apply_filters("wp_all_import_image_filename", $image_name, empty($img_titles[$k]) ? '' : $img_titles[$k], empty($img_captions[$k]) ? '' : $img_captions[$k], empty($img_alts[$k]) ? '' : $img_alts[$k], $articleData, $this->id);
1630
+
1631
  // if wizard store image data to custom field
1632
  $create_image = false;
1633
  $download_image = true;
1634
  $wp_filetype = false;
1635
 
1636
+ $is_base64_images_allowed = apply_filters("wp_all_import_is_base64_images_allowed", true, $url, $this->id);
1637
+
1638
+ if ( $bundle_data['type'] == 'images' and base64_encode(base64_decode($url)) == $url and $is_base64_images_allowed ){
1639
  $img = @imagecreatefromstring(base64_decode($url));
1640
  if($img)
1641
  {
1766
  @unlink($image_filepath); // delete file since failed upload may result in empty file created
1767
  } else{
1768
 
1769
+ if($bundle_data['type'] == 'images'){
1770
  if( preg_match('%\W(svg)$%i', 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))) {
1771
  $create_image = true;
1772
  $logger and call_user_func($logger, sprintf(__('- Image `%s` has been successfully downloaded', 'wp_all_import_plugin'), $url));
1786
 
1787
  }
1788
 
1789
+ if ( ! $create_image )
1790
+ {
1791
+ if ( $img_url !== pmxi_convert_encoding($img_url) )
1792
+ {
1793
+ $url = trim(pmxi_convert_encoding($img_url));
1794
 
1795
+ $request = get_file_curl($url, $image_filepath);
1796
+
1797
+ $get_ctx = stream_context_create(array('http' => array('timeout' => 5)));
1798
 
1799
+ if ( (is_wp_error($request) or $request === false) and ! @file_put_contents($image_filepath, @file_get_contents($url, false, $get_ctx))) {
1800
+ $logger and call_user_func($logger, sprintf(__('- <b>WARNING</b>: File %s cannot be saved locally as %s', 'wp_all_import_plugin'), $url, $image_filepath));
1801
+ $logger and !$is_cron and PMXI_Plugin::$session->warnings++;
1802
+ @unlink($image_filepath); // delete file since failed upload may result in empty file created
1803
+ }
1804
+ else{
1805
+ if($bundle_data['type'] == 'images'){
1806
+ if( preg_match('%\W(svg)$%i', 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))) {
1807
+ $create_image = true;
1808
+ $logger and call_user_func($logger, sprintf(__('- Image `%s` has been successfully downloaded', 'wp_all_import_plugin'), $url));
1809
+ } else {
1810
+ $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'), $url));
1811
+ $logger and !$is_cron and PMXI_Plugin::$session->warnings++;
1812
+ @unlink($image_filepath);
1813
+ }
 
 
 
 
 
 
1814
  }
1815
+ elseif($bundle_data['type'] == 'files'){
1816
+ if( ! $wp_filetype = wp_check_filetype(basename($image_filepath), null )) {
1817
+ $logger and call_user_func($logger, sprintf(__('- <b>WARNING</b>: Can\'t detect attachment file type %s', 'wp_all_import_plugin'), trim($url)));
1818
+ $logger and !$is_cron and PMXI_Plugin::$session->warnings++;
1819
+ @unlink($image_filepath);
1820
+ }
1821
+ else {
1822
+ $create_image = true;
1823
+ $logger and call_user_func($logger, sprintf(__('- File `%s` has been successfully found', 'wp_all_import_plugin'), $url));
1824
+ }
1825
  }
1826
  }
1827
  }
1828
+ else{
1829
+ @unlink($image_filepath);
1830
+ }
1831
  }
1832
  }
1833
  }
1915
  $post_thumbnail_id = get_post_thumbnail_id( $pid );
1916
 
1917
  if ($bundle_data['type'] == 'images' and empty($post_thumbnail_id) and $this->options[$option_slug . 'is_featured'] ) {
1918
+ set_post_thumbnail($pid, $attid);
1919
  }
1920
  elseif(!in_array($attid, $gallery_attachment_ids) and $post_thumbnail_id != $attid){
1921
  $gallery_attachment_ids[] = $attid;
2144
  unset($existing_taxonomies[$tx_name][$i]);
2145
  }
2146
 
2147
+ $assign_taxes = apply_filters('wp_all_import_set_post_terms', $assign_taxes, $tx_name, $pid, $this->id);
2148
+
2149
  // create term if not exists
2150
  if ( ! empty($txes[$i]) ):
2151
  foreach ($txes[$i] as $key => $single_tax) {
2257
  $importData = array(
2258
  'pid' => $pid,
2259
  'import' => $this,
2260
+ 'logger' => $logger,
2261
+ 'is_update' => $is_update
2262
  );
2263
 
2264
  $saved_functions = apply_filters('wp_all_import_addon_saved_post', array());
2282
 
2283
  // [/addons import]
2284
  $logger and call_user_func($logger, __('<b>ACTION</b>: pmxi_saved_post', 'wp_all_import_plugin'));
2285
+ do_action( 'pmxi_saved_post', $pid, $rootNodes[$i], $is_update ); // hook that was triggered immediately after post saved
2286
 
2287
  if (empty($articleData['ID'])) $created++; else $updated++;
2288
 
2431
 
2432
  // Instead of deletion, set Custom Field
2433
  if ($this->options['is_update_missing_cf']){
2434
+ if ( $this->options['custom_type'] == "import_users" ){
2435
+ update_user_meta( $missingPostRecord['post_id'], $this->options['update_missing_cf_name'], $this->options['update_missing_cf_value'] );
2436
+ $logger and call_user_func($logger, sprintf(__('Instead of deletion user with ID `%s`, set Custom Field `%s` to value `%s`', 'wp_all_import_plugin'), $missingPostRecord['post_id'], $this->options['update_missing_cf_name'], $this->options['update_missing_cf_value']));
2437
+ }
2438
+ else{
2439
+ update_post_meta( $missingPostRecord['post_id'], $this->options['update_missing_cf_name'], $this->options['update_missing_cf_value'] );
2440
+ $logger and call_user_func($logger, sprintf(__('Instead of deletion post with ID `%s`, set Custom Field `%s` to value `%s`', 'wp_all_import_plugin'), $missingPostRecord['post_id'], $this->options['update_missing_cf_name'], $this->options['update_missing_cf_value']));
2441
+ }
2442
  $to_delete = false;
 
2443
  }
2444
 
2445
  // Instead of deletion, change post status to Draft
2468
  {
2469
 
2470
  $postRecord = new PMXI_Post_Record();
2471
+ $postRecord->getBy(array(
2472
+ 'post_id' => $missingPostRecord['post_id'],
2473
+ 'import_id' => $this->id,
2474
+ ));
2475
  if ( ! $postRecord->isEmpty() )
2476
  {
2477
  $postRecord->set(array(
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.3.7
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.3.7');
29
 
30
  define('PMXI_EDITION', 'free');
31
 
@@ -1097,7 +1097,7 @@ final class PMXI_Plugin {
1097
  'title' => '',
1098
  'content' => '',
1099
  'name' => '',
1100
- 'is_keep_linebreaks' => 0,
1101
  'is_leave_html' => 0,
1102
  'fix_characters' => 0,
1103
  'pid_xpath' => '',
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.3.8
7
  Author: Soflyy
8
  */
9
 
25
  */
26
  define('WP_ALL_IMPORT_PREFIX', 'pmxi_');
27
 
28
+ define('PMXI_VERSION', '3.3.8');
29
 
30
  define('PMXI_EDITION', 'free');
31
 
1097
  'title' => '',
1098
  'content' => '',
1099
  'name' => '',
1100
+ 'is_keep_linebreaks' => 1,
1101
  'is_leave_html' => 0,
1102
  'fix_characters' => 0,
1103
  'pid_xpath' => '',
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Import any XML or CSV File to WordPress ===
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
- Tested up to: 4.6
5
- Stable tag: 3.3.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.
@@ -105,6 +105,20 @@ Does it work with special character encoding like Hebrew, Arabic, Chinese, etc?
105
 
106
  == Changelog ==
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  = 3.3.7 =
109
  * added new option 'Use StreamReader instead of XMLReader to parse import file' to fix issue with libxml 2.9.3
110
  * execute 'pmxi_article_data' filter for all posts ( new & existing )
1
  === Import any XML or CSV File to WordPress ===
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
+ Tested up to: 4.6.1
5
+ Stable tag: 3.3.8
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.
105
 
106
  == Changelog ==
107
 
108
+ = 3.3.8 =
109
+ * improvement: 'Force Stream Reader' setting
110
+ * improvement: new filter 'wp_all_import_auto_create_csv_headers'
111
+ * improvement: new filter 'wp_all_import_is_base64_images_allowed'
112
+ * improvement: new filter 'wp_all_import_set_post_terms' to leave a specific category alone when a post is being updated
113
+ * bug fix: nodes navigation for xpath like /news/item
114
+ * bug fix: frozen import template screen for cyrillic XML feeds
115
+ * bug fix: conflict between taxonomies & user import
116
+ * bug fix: creating users with the same email
117
+ * bug fix: enable keep line breaks option by default
118
+ * bug fix: composer namespace conflict
119
+ * bug fix: images preview when wp is in subdirectory
120
+ * bug fix: 'Instead of deletion, set Custom Field' option for users import
121
+
122
  = 3.3.7 =
123
  * added new option 'Use StreamReader instead of XMLReader to parse import file' to fix issue with libxml 2.9.3
124
  * execute 'pmxi_article_data' filter for all posts ( new & existing )
static/css/admin.css CHANGED
@@ -433,7 +433,7 @@
433
  height:25px;
434
  padding-left: 20px;
435
  color:#21759B;
436
- font-family: "Open Sans",​sans-serif;
437
  padding-top: 2px;
438
  text-decoration: underline;
439
  display: block;
@@ -542,6 +542,12 @@
542
  color: #000 !important;
543
  font-size: 1.3em !important;
544
  }
 
 
 
 
 
 
545
  .wpallimport-plugin .auto-generate-template{
546
  display: none;
547
  }
@@ -2343,7 +2349,7 @@
2343
  }
2344
  .wpallimport-plugin .wpallimport-cf-menu li a{
2345
  padding: 0;
2346
- font-family: "Open Sans",​sans-serif;
2347
  font-size: 12px;
2348
  display: inline;
2349
  color: #777;
@@ -3005,7 +3011,18 @@
3005
  padding-top: 35px;
3006
  vertical-align: middle;
3007
  }*/
3008
-
 
 
 
 
 
 
 
 
 
 
 
3009
  /*--------------------------------------------------------------------------
3010
  *
3011
  * Setting Page
433
  height:25px;
434
  padding-left: 20px;
435
  color:#21759B;
436
+ /*font-family: "Open Sans",​sans-serif;*/
437
  padding-top: 2px;
438
  text-decoration: underline;
439
  display: block;
542
  color: #000 !important;
543
  font-size: 1.3em !important;
544
  }
545
+ p.upgrade_link {
546
+ margin-top: 0;
547
+ }
548
+ .wpallimport-plugin a.upgrade_link {
549
+ text-decoration: underline;
550
+ }
551
  .wpallimport-plugin .auto-generate-template{
552
  display: none;
553
  }
2349
  }
2350
  .wpallimport-plugin .wpallimport-cf-menu li a{
2351
  padding: 0;
2352
+ /*font-family: "Open Sans",​sans-serif;*/
2353
  font-size: 12px;
2354
  display: inline;
2355
  color: #777;
3011
  padding-top: 35px;
3012
  vertical-align: middle;
3013
  }*/
3014
+ .wpallimport-plugin .pmxi-admin-imports{
3015
+ table-layout: fixed;
3016
+ }
3017
+ .wpallimport-plugin .pmxi-admin-imports .column-actions{
3018
+ width: 130px;
3019
+ }
3020
+ .wpallimport-plugin .pmxi-admin-imports .column-summary{
3021
+ width: 220px;
3022
+ }
3023
+ .wpallimport-plugin .pmxi-admin-imports .column-info{
3024
+ width: 110px;
3025
+ }
3026
  /*--------------------------------------------------------------------------
3027
  *
3028
  * Setting Page
static/js/admin.js CHANGED
@@ -340,7 +340,7 @@
340
 
341
  $('input[name=custom_type]').val(selectedData.selectedData.value);
342
 
343
- if (selectedData.selectedData.value == 'shop_order')
344
  {
345
  $('.wpallimport-choose-file').find('.wpallimport-submit-buttons').hide();
346
  $('.wpallimport-import-orders-notice').show();
@@ -1147,7 +1147,7 @@
1147
 
1148
  if ($rule.val() != 'is_empty' && $rule.val() != "is_not_empty" && $val.val() == "") return;
1149
 
1150
- var relunumber = $('.filtering_rules').find('li').length;
1151
 
1152
  var html = '<li><div class="drag-element">';
1153
  html += '<input type="hidden" value="'+ $el.val() +'" class="pmxi_xml_element"/>';
@@ -1788,33 +1788,35 @@
1788
  e.preventDefault();
1789
  var $ths = $(this);
1790
  $(this).attr('disabled', 'disabled');
1791
- var request = {
1792
- action: 'delete_import',
1793
- data: $(this).parents('form:first').serialize(),
1794
- security: wp_all_import_security
1795
- };
1796
  var iteration = 1;
 
 
 
 
 
 
1797
  var deleteImport = function(){
 
1798
  $.ajax({
1799
  type: 'POST',
1800
- url: ajaxurl + '?iteration=' + iteration,
1801
  data: request,
1802
- success: function(response) {
1803
-
1804
  iteration++;
1805
 
1806
  $ths.parents('form:first').find('.wp_all_import_deletion_log').html('<p>' + response.msg + '</p>');
1807
 
1808
- if (response.result){
1809
  $('.wp_all_import_functions_preloader').hide();
1810
  window.location.href = response.redirect;
1811
  }
1812
  else
1813
- {
1814
  deleteImport();
1815
  }
1816
  },
1817
- error: function( jqXHR, textStatus ) {
1818
  $ths.removeAttr('disabled');
1819
  $('.wp_all_import_functions_preloader').hide();
1820
  },
340
 
341
  $('input[name=custom_type]').val(selectedData.selectedData.value);
342
 
343
+ if (selectedData.selectedData.value == 'shop_order' && $('.wpallimport-import-orders-notice').attr('rel') == 'free')
344
  {
345
  $('.wpallimport-choose-file').find('.wpallimport-submit-buttons').hide();
346
  $('.wpallimport-import-orders-notice').show();
1147
 
1148
  if ($rule.val() != 'is_empty' && $rule.val() != "is_not_empty" && $val.val() == "") return;
1149
 
1150
+ var relunumber = $('.filtering_rules').find('li').length + "_" + $.now();
1151
 
1152
  var html = '<li><div class="drag-element">';
1153
  html += '<input type="hidden" value="'+ $el.val() +'" class="pmxi_xml_element"/>';
1788
  e.preventDefault();
1789
  var $ths = $(this);
1790
  $(this).attr('disabled', 'disabled');
 
 
 
 
 
1791
  var iteration = 1;
1792
+ var request = {
1793
+ action: 'delete_import',
1794
+ data: $(this).parents('form:first').serialize(),
1795
+ security: wp_all_import_security,
1796
+ iteration: iteration
1797
+ };
1798
  var deleteImport = function(){
1799
+ request.iteration = iteration;
1800
  $.ajax({
1801
  type: 'POST',
1802
+ url: ajaxurl,
1803
  data: request,
1804
+ success: function(response) {
1805
+
1806
  iteration++;
1807
 
1808
  $ths.parents('form:first').find('.wp_all_import_deletion_log').html('<p>' + response.msg + '</p>');
1809
 
1810
+ if (response.result){
1811
  $('.wp_all_import_functions_preloader').hide();
1812
  window.location.href = response.redirect;
1813
  }
1814
  else
1815
+ {
1816
  deleteImport();
1817
  }
1818
  },
1819
+ error: function( jqXHR, textStatus ) {
1820
  $ths.removeAttr('disabled');
1821
  $('.wp_all_import_functions_preloader').hide();
1822
  },
static/js/jquery/moment.js CHANGED
@@ -3,4 +3,4 @@
3
  // author : Tim Wood
4
  // license : MIT
5
  // momentjs.com
6
- (function(a){function E(a,b,c,d){var e=c.lang();return e[a].call?e[a](c,d):e[a][b]}function F(a,b){return function(c){return K(a.call(this,c),b)}}function G(a){return function(b){var c=a.call(this,b);return c+this.lang().ordinal(c)}}function H(a,b,c){this._d=a,this._isUTC=!!b,this._a=a._a||null,this._lang=c||!1}function I(a){var b=this._data={},c=a.years||a.y||0,d=a.months||a.M||0,e=a.weeks||a.w||0,f=a.days||a.d||0,g=a.hours||a.h||0,h=a.minutes||a.m||0,i=a.seconds||a.s||0,j=a.milliseconds||a.ms||0;this._milliseconds=j+i*1e3+h*6e4+g*36e5,this._days=f+e*7,this._months=d+c*12,b.milliseconds=j%1e3,i+=J(j/1e3),b.seconds=i%60,h+=J(i/60),b.minutes=h%60,g+=J(h/60),b.hours=g%24,f+=J(g/24),f+=e*7,b.days=f%30,d+=J(f/30),b.months=d%12,c+=J(d/12),b.years=c,this._lang=!1}function J(a){return a<0?Math.ceil(a):Math.floor(a)}function K(a,b){var c=a+"";while(c.length<b)c="0"+c;return c}function L(a,b,c){var d=b._milliseconds,e=b._days,f=b._months,g;d&&a._d.setTime(+a+d*c),e&&a.date(a.date()+e*c),f&&(g=a.date(),a.date(1).month(a.month()+f*c).date(Math.min(g,a.daysInMonth())))}function M(a){return Object.prototype.toString.call(a)==="[object Array]"}function N(a,b){var c=Math.min(a.length,b.length),d=Math.abs(a.length-b.length),e=0,f;for(f=0;f<c;f++)~~a[f]!==~~b[f]&&e++;return e+d}function O(a,b,c,d){var e,f,g=[];for(e=0;e<7;e++)g[e]=a[e]=a[e]==null?e===2?1:0:a[e];return a[7]=g[7]=b,a[8]!=null&&(g[8]=a[8]),a[3]+=c||0,a[4]+=d||0,f=new Date(0),b?(f.setUTCFullYear(a[0],a[1],a[2]),f.setUTCHours(a[3],a[4],a[5],a[6])):(f.setFullYear(a[0],a[1],a[2]),f.setHours(a[3],a[4],a[5],a[6])),f._a=g,f}function P(a,c){var d,e,g=[];!c&&h&&(c=require("./lang/"+a));for(d=0;d<i.length;d++)c[i[d]]=c[i[d]]||f.en[i[d]];for(d=0;d<12;d++)e=b([2e3,d]),g[d]=new RegExp("^"+(c.months[d]||c.months(e,""))+"|^"+(c.monthsShort[d]||c.monthsShort(e,"")).replace(".",""),"i");return c.monthsParse=c.monthsParse||g,f[a]=c,c}function Q(a){var c=typeof a=="string"&&a||a&&a._lang||null;return c?f[c]||P(c):b}function R(a){return a.match(/\[.*\]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function S(a){var b=a.match(k),c,d;for(c=0,d=b.length;c<d;c++)D[b[c]]?b[c]=D[b[c]]:b[c]=R(b[c]);return function(e){var f="";for(c=0;c<d;c++)f+=typeof b[c].call=="function"?b[c].call(e,a):b[c];return f}}function T(a,b){function d(b){return a.lang().longDateFormat[b]||b}var c=5;while(c--&&l.test(b))b=b.replace(l,d);return A[b]||(A[b]=S(b)),A[b](a)}function U(a){switch(a){case"DDDD":return p;case"YYYY":return q;case"S":case"SS":case"SSS":case"DDD":return o;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":case"a":case"A":return r;case"Z":case"ZZ":return s;case"T":return t;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return n;default:return new RegExp(a.replace("\\",""))}}function V(a,b,c,d){var e,f;switch(a){case"M":case"MM":c[1]=b==null?0:~~b-1;break;case"MMM":case"MMMM":for(e=0;e<12;e++)if(Q().monthsParse[e].test(b)){c[1]=e,f=!0;break}f||(c[8]=!1);break;case"D":case"DD":case"DDD":case"DDDD":b!=null&&(c[2]=~~b);break;case"YY":c[0]=~~b+(~~b>70?1900:2e3);break;case"YYYY":c[0]=~~Math.abs(b);break;case"a":case"A":d.isPm=(b+"").toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":c[3]=~~b;break;case"m":case"mm":c[4]=~~b;break;case"s":case"ss":c[5]=~~b;break;case"S":case"SS":case"SSS":c[6]=~~(("0."+b)*1e3);break;case"Z":case"ZZ":d.isUTC=!0,e=(b+"").match(x),e&&e[1]&&(d.tzh=~~e[1]),e&&e[2]&&(d.tzm=~~e[2]),e&&e[0]==="+"&&(d.tzh=-d.tzh,d.tzm=-d.tzm)}b==null&&(c[8]=!1)}function W(a,b){var c=[0,0,1,0,0,0,0],d={tzh:0,tzm:0},e=b.match(k),f,g;for(f=0;f<e.length;f++)g=(U(e[f]).exec(a)||[])[0],g&&(a=a.slice(a.indexOf(g)+g.length)),D[e[f]]&&V(e[f],g,c,d);return d.isPm&&c[3]<12&&(c[3]+=12),d.isPm===!1&&c[3]===12&&(c[3]=0),O(c,d.isUTC,d.tzh,d.tzm)}function X(a,b){var c,d=a.match(m)||[],e,f=99,g,h,i;for(g=0;g<b.length;g++)h=W(a,b[g]),e=T(new H(h),b[g]).match(m)||[],i=N(d,e),i<f&&(f=i,c=h);return c}function Y(a){var b="YYYY-MM-DDT",c;if(u.exec(a)){for(c=0;c<4;c++)if(w[c][1].exec(a)){b+=w[c][0];break}return s.exec(a)?W(a,b+" Z"):W(a,b)}return new Date(a)}function Z(a,b,c,d,e){var f=e.relativeTime[a];return typeof f=="function"?f(b||1,!!c,a,d):f.replace(/%d/i,b||1)}function $(a,b,c){var e=d(Math.abs(a)/1e3),f=d(e/60),g=d(f/60),h=d(g/24),i=d(h/365),j=e<45&&["s",e]||f===1&&["m"]||f<45&&["mm",f]||g===1&&["h"]||g<22&&["hh",g]||h===1&&["d"]||h<=25&&["dd",h]||h<=45&&["M"]||h<345&&["MM",d(h/30)]||i===1&&["y"]||["yy",i];return j[2]=b,j[3]=a>0,j[4]=c,Z.apply({},j)}function _(a,c){b.fn[a]=function(a){var b=this._isUTC?"UTC":"";return a!=null?(this._d["set"+b+c](a),this):this._d["get"+b+c]()}}function ab(a){b.duration.fn[a]=function(){return this._data[a]}}function bb(a,c){b.duration.fn["as"+a]=function(){return+this/c}}var b,c="1.7.2",d=Math.round,e,f={},g="en",h=typeof module!="undefined"&&module.exports,i="months|monthsShort|weekdays|weekdaysShort|weekdaysMin|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),j=/^\/?Date\((\-?\d+)/i,k=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?|.)/g,l=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?)/g,m=/([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,n=/\d\d?/,o=/\d{1,3}/,p=/\d{3}/,q=/\d{1,4}/,r=/[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i,s=/Z|[\+\-]\d\d:?\d\d/i,t=/T/i,u=/^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,v="YYYY-MM-DDTHH:mm:ssZ",w=[["HH:mm:ss.S",/T\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/T\d\d:\d\d:\d\d/],["HH:mm",/T\d\d:\d\d/],["HH",/T\d\d/]],x=/([\+\-]|\d\d)/gi,y="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),z={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},A={},B="DDD w M D d".split(" "),C="M D H h m s w".split(" "),D={M:function(){return this.month()+1},MMM:function(a){return E("monthsShort",this.month(),this,a)},MMMM:function(a){return E("months",this.month(),this,a)},D:function(){return this.date()},DDD:function(){var a=new Date(this.year(),this.month(),this.date()),b=new Date(this.year(),0,1);return~~((a-b)/864e5+1.5)},d:function(){return this.day()},dd:function(a){return E("weekdaysMin",this.day(),this,a)},ddd:function(a){return E("weekdaysShort",this.day(),this,a)},dddd:function(a){return E("weekdays",this.day(),this,a)},w:function(){var a=new Date(this.year(),this.month(),this.date()-this.day()+5),b=new Date(a.getFullYear(),0,4);return~~((a-b)/864e5/7+1.5)},YY:function(){return K(this.year()%100,2)},YYYY:function(){return K(this.year(),4)},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return K(~~(this.milliseconds()/10),2)},SSS:function(){return K(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return a<0&&(a=-a,b="-"),b+K(~~(a/60),2)+":"+K(~~a%60,2)},ZZ:function(){var a=-this.zone(),b="+";return a<0&&(a=-a,b="-"),b+K(~~(10*a/6),4)}};while(B.length)e=B.pop(),D[e+"o"]=G(D[e]);while(C.length)e=C.pop(),D[e+e]=F(D[e],2);D.DDDD=F(D.DDD,3),b=function(c,d){if(c===null||c==="")return null;var e,f;return b.isMoment(c)?new H(new Date(+c._d),c._isUTC,c._lang):(d?M(d)?e=X(c,d):e=W(c,d):(f=j.exec(c),e=c===a?new Date:f?new Date(+f[1]):c instanceof Date?c:M(c)?O(c):typeof c=="string"?Y(c):new Date(c)),new H(e))},b.utc=function(a,c){return M(a)?new H(O(a,!0),!0):(typeof a=="string"&&!s.exec(a)&&(a+=" +0000",c&&(c+=" Z")),b(a,c).utc())},b.unix=function(a){return b(a*1e3)},b.duration=function(a,c){var d=b.isDuration(a),e=typeof a=="number",f=d?a._data:e?{}:a,g;return e&&(c?f[c]=a:f.milliseconds=a),g=new I(f),d&&(g._lang=a._lang),g},b.humanizeDuration=function(a,c,d){return b.duration(a,c===!0?null:c).humanize(c===!0?!0:d)},b.version=c,b.defaultFormat=v,b.lang=function(a,c){var d;if(!a)return g;(c||!f[a])&&P(a,c);if(f[a]){for(d=0;d<i.length;d++)b[i[d]]=f[a][i[d]];b.monthsParse=f[a].monthsParse,g=a}},b.langData=Q,b.isMoment=function(a){return a instanceof H},b.isDuration=function(a){return a instanceof I},b.lang("en",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}}),b.fn=H.prototype={clone:function(){return b(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this._d.toString()},toDate:function(){return this._d},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds(),!!this._isUTC]},isValid:function(){return this._a?this._a[8]!=null?!!this._a[8]:!N(this._a,(this._a[7]?b.utc(this._a):b(this._a)).toArray()):!isNaN(this._d.getTime())},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(a){return T(this,a?a:b.defaultFormat)},add:function(a,c){var d=c?b.duration(+c,a):b.duration(a);return L(this,d,1),this},subtract:function(a,c){var d=c?b.duration(+c,a):b.duration(a);return L(this,d,-1),this},diff:function(a,c,e){var f=this._isUTC?b(a).utc():b(a).local(),g=(this.zone()-f.zone())*6e4,h=this._d-f._d-g,i=this.year()-f.year(),j=this.month()-f.month(),k=this.date()-f.date(),l;return c==="months"?l=i*12+j+k/30:c==="years"?l=i+(j+k/30)/12:l=c==="seconds"?h/1e3:c==="minutes"?h/6e4:c==="hours"?h/36e5:c==="days"?h/864e5:c==="weeks"?h/6048e5:h,e?l:d(l)},from:function(a,c){return b.duration(this.diff(a)).lang(this._lang).humanize(!c)},fromNow:function(a){return this.from(b(),a)},calendar:function(){var a=this.diff(b().sod(),"days",!0),c=this.lang().calendar,d=c.sameElse,e=a<-6?d:a<-1?c.lastWeek:a<0?c.lastDay:a<1?c.sameDay:a<2?c.nextDay:a<7?c.nextWeek:d;return this.format(typeof e=="function"?e.apply(this):e)},isLeapYear:function(){var a=this.year();return a%4===0&&a%100!==0||a%400===0},isDST:function(){return this.zone()<b([this.year()]).zone()||this.zone()<b([this.year(),5]).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return a==null?b:this.add({d:a-b})},startOf:function(a){switch(a.replace(/s$/,"")){case"year":this.month(0);case"month":this.date(1);case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return this},endOf:function(a){return this.startOf(a).add(a.replace(/s?$/,"s"),1).subtract("ms",1)},sod:function(){return this.clone().startOf("day")},eod:function(){return this.clone().endOf("day")},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return b.utc([this.year(),this.month()+1,0]).date()},lang:function(b){return b===a?Q(this):(this._lang=b,this)}};for(e=0;e<y.length;e++)_(y[e].toLowerCase(),y[e]);_("year","FullYear"),b.duration.fn=I.prototype={weeks:function(){return J(this.days()/7)},valueOf:function(){return this._milliseconds+this._days*864e5+this._months*2592e6},humanize:function(a){var b=+this,c=this.lang().relativeTime,d=$(b,!a,this.lang()),e=b<=0?c.past:c.future;return a&&(typeof e=="function"?d=e(d):d=e.replace(/%s/i,d)),d},lang:b.fn.lang};for(e in z)z.hasOwnProperty(e)&&(bb(e,z[e]),ab(e.toLowerCase()));bb("Weeks",6048e5),h&&(module.exports=b),typeof ender=="undefined"&&(this.moment=b),typeof define=="function"&&define.amd&&define("moment",[],function(){return b})}).call(this);
3
  // author : Tim Wood
4
  // license : MIT
5
  // momentjs.com
6
+ (function(a){function E(a,b,c,d){var e=c.lang();return e[a].call?e[a](c,d):e[a][b]}function F(a,b){return function(c){return K(a.call(this,c),b)}}function G(a){return function(b){var c=a.call(this,b);return c+this.lang().ordinal(c)}}function H(a,b,c){this._d=a,this._isUTC=!!b,this._a=a._a||null,this._lang=c||!1}function I(a){var b=this._data={},c=a.years||a.y||0,d=a.months||a.M||0,e=a.weeks||a.w||0,f=a.days||a.d||0,g=a.hours||a.h||0,h=a.minutes||a.m||0,i=a.seconds||a.s||0,j=a.milliseconds||a.ms||0;this._milliseconds=j+i*1e3+h*6e4+g*36e5,this._days=f+e*7,this._months=d+c*12,b.milliseconds=j%1e3,i+=J(j/1e3),b.seconds=i%60,h+=J(i/60),b.minutes=h%60,g+=J(h/60),b.hours=g%24,f+=J(g/24),f+=e*7,b.days=f%30,d+=J(f/30),b.months=d%12,c+=J(d/12),b.years=c,this._lang=!1}function J(a){return a<0?Math.ceil(a):Math.floor(a)}function K(a,b){var c=a+"";while(c.length<b)c="0"+c;return c}function L(a,b,c){var d=b._milliseconds,e=b._days,f=b._months,g;d&&a._d.setTime(+a+d*c),e&&a.date(a.date()+e*c),f&&(g=a.date(),a.date(1).month(a.month()+f*c).date(Math.min(g,a.daysInMonth())))}function M(a){return Object.prototype.toString.call(a)==="[object Array]"}function N(a,b){var c=Math.min(a.length,b.length),d=Math.abs(a.length-b.length),e=0,f;for(f=0;f<c;f++)~~a[f]!==~~b[f]&&e++;return e+d}function O(a,b,c,d){var e,f,g=[];for(e=0;e<7;e++)g[e]=a[e]=a[e]==null?e===2?1:0:a[e];return a[7]=g[7]=b,a[8]!=null&&(g[8]=a[8]),a[3]+=c||0,a[4]+=d||0,f=new Date(0),b?(f.setUTCFullYear(a[0],a[1],a[2]),f.setUTCHours(a[3],a[4],a[5],a[6])):(f.setFullYear(a[0],a[1],a[2]),f.setHours(a[3],a[4],a[5],a[6])),f._a=g,f}function P(a,c){var d,e,g=[];!c&&h&&(c=require("./lang/"+a));for(d=0;d<i.length;d++)c[i[d]]=c[i[d]]||f.en[i[d]];for(d=0;d<12;d++)e=b([2e3,d]),g[d]=new RegExp("^"+(c.months[d]||c.months(e,""))+"|^"+(c.monthsShort[d]||c.monthsShort(e,"")).replace(".",""),"i");return c.monthsParse=c.monthsParse||g,f[a]=c,c}function Q(a){var c=typeof a=="string"&&a||a&&a._lang||null;return c?f[c]||P(c):b}function R(a){return a.match(/\[.*\]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function S(a){var b=a.match(k),c,d;for(c=0,d=b.length;c<d;c++)D[b[c]]?b[c]=D[b[c]]:b[c]=R(b[c]);return function(e){var f="";for(c=0;c<d;c++)f+=typeof b[c].call=="function"?b[c].call(e,a):b[c];return f}}function T(a,b){function d(b){return a.lang().longDateFormat[b]||b}var c=5;while(c--&&l.test(b))b=b.replace(l,d);return A[b]||(A[b]=S(b)),A[b](a)}function U(a){switch(a){case"DDDD":return p;case"YYYY":return q;case"S":case"SS":case"SSS":case"DDD":return o;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":case"a":case"A":return r;case"Z":case"ZZ":return s;case"T":return t;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return n;default:return new RegExp(a.replace("\\",""))}}function V(a,b,c,d){var e,f;switch(a){case"M":case"MM":c[1]=b==null?0:~~b-1;break;case"MMM":case"MMMM":for(e=0;e<12;e++)if(Q().monthsParse[e].test(b)){c[1]=e,f=!0;break}f||(c[8]=!1);break;case"D":case"DD":case"DDD":case"DDDD":b!=null&&(c[2]=~~b);break;case"YY":c[0]=~~b+(~~b>70?1900:2e3);break;case"YYYY":c[0]=~~Math.abs(b);break;case"a":case"A":d.isPm=(b+"").toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":c[3]=~~b;break;case"m":case"mm":c[4]=~~b;break;case"s":case"ss":c[5]=~~b;break;case"S":case"SS":case"SSS":c[6]=~~(("0."+b)*1e3);break;case"Z":case"ZZ":d.isUTC=!0,e=(b+"").match(x),e&&e[1]&&(d.tzh=~~e[1]),e&&e[2]&&(d.tzm=~~e[2]),e&&e[0]==="+"&&(d.tzh=-d.tzh,d.tzm=-d.tzm)}b==null&&(c[8]=!1)}function W(a,b){var c=[0,0,1,0,0,0,0],d={tzh:0,tzm:0},e=b.match(k),f,g;for(f=0;f<e.length;f++)g=(U(e[f]).exec(a)||[])[0],g&&(a=a.slice(a.indexOf(g)+g.length)),D[e[f]]&&V(e[f],g,c,d);return d.isPm&&c[3]<12&&(c[3]+=12),d.isPm===!1&&c[3]===12&&(c[3]=0),O(c,d.isUTC,d.tzh,d.tzm)}function X(a,b){var c,d=a.match(m)||[],e,f=99,g,h,i;for(g=0;g<b.length;g++)h=W(a,b[g]),e=T(new H(h),b[g]).match(m)||[],i=N(d,e),i<f&&(f=i,c=h);return c}function Y(a){var b="YYYY-MM-DDT",c;if(u.exec(a)){for(c=0;c<4;c++)if(w[c][1].exec(a)){b+=w[c][0];break}return s.exec(a)?W(a,b+" Z"):W(a,b)}return new Date(a)}function Z(a,b,c,d,e){var f=e.relativeTime[a];return typeof f=="function"?f(b||1,!!c,a,d):f.replace(/%d/i,b||1)}function $(a,b,c){var e=d(Math.abs(a)/1e3),f=d(e/60),g=d(f/60),h=d(g/24),i=d(h/365),j=e<45&&["s",e]||f===1&&["m"]||f<45&&["mm",f]||g===1&&["h"]||g<22&&["hh",g]||h===1&&["d"]||h<=25&&["dd",h]||h<=45&&["M"]||h<345&&["MM",d(h/30)]||i===1&&["y"]||["yy",i];return j[2]=b,j[3]=a>0,j[4]=c,Z.apply({},j)}function _(a,c){b.fn[a]=function(a){var b=this._isUTC?"UTC":"";return a!=null?(this._d["set"+b+c](a),this):this._d["get"+b+c]()}}function ab(a){b.duration.fn[a]=function(){return this._data[a]}}function bb(a,c){b.duration.fn["as"+a]=function(){return+this/c}}var b,c="1.7.2",d=Math.round,e,f={},g="en",h=typeof module!="undefined"&&module.exports,i="months|monthsShort|weekdays|weekdaysShort|weekdaysMin|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),j=/^\/?Date\((\-?\d+)/i,k=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?|.)/g,l=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?)/g,m=/([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,n=/\d\d?/,o=/\d{1,3}/,p=/\d{3}/,q=/\d{1,4}/,r=/[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i,s=/Z|[\+\-]\d\d:?\d\d/i,t=/T/i,u=/^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,v="YYYY-MM-DDTHH:mm:ssZ",w=[["HH:mm:ss.S",/T\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/T\d\d:\d\d:\d\d/],["HH:mm",/T\d\d:\d\d/],["HH",/T\d\d/]],x=/([\+\-]|\d\d)/gi,y="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),z={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},A={},B="DDD w M D d".split(" "),C="M D H h m s w".split(" "),D={M:function(){return this.month()+1},MMM:function(a){return E("monthsShort",this.month(),this,a)},MMMM:function(a){return E("months",this.month(),this,a)},D:function(){return this.date()},DDD:function(){var a=new Date(this.year(),this.month(),this.date()),b=new Date(this.year(),0,1);return~~((a-b)/864e5+1.5)},d:function(){return this.day()},dd:function(a){return E("weekdaysMin",this.day(),this,a)},ddd:function(a){return E("weekdaysShort",this.day(),this,a)},dddd:function(a){return E("weekdays",this.day(),this,a)},w:function(){var a=new Date(this.year(),this.month(),this.date()-this.day()+5),b=new Date(a.getFullYear(),0,4);return~~((a-b)/864e5/7+1.5)},YY:function(){return K(this.year()%100,2)},YYYY:function(){return K(this.year(),4)},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return K(~~(this.milliseconds()/10),2)},SSS:function(){return K(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return a<0&&(a=-a,b="-"),b+K(~~(a/60),2)+":"+K(~~a%60,2)},ZZ:function(){var a=-this.zone(),b="+";return a<0&&(a=-a,b="-"),b+K(~~(10*a/6),4)}};while(B.length)e=B.pop(),D[e+"o"]=G(D[e]);while(C.length)e=C.pop(),D[e+e]=F(D[e],2);D.DDDD=F(D.DDD,3),b=function(c,d){if(c===null||c==="")return null;var e,f;return b.isMoment(c)?new H(new Date(+c._d),c._isUTC,c._lang):(d?M(d)?e=X(c,d):e=W(c,d):(f=j.exec(c),e=c===a?new Date:f?new Date(+f[1]):c instanceof Date?c:M(c)?O(c):typeof c=="string"?Y(c):new Date(c)),new H(e))},b.utc=function(a,c){return M(a)?new H(O(a,!0),!0):(typeof a=="string"&&!s.exec(a)&&(a+=" +0000",c&&(c+=" Z")),b(a,c).utc())},b.unix=function(a){return b(a*1e3)},b.duration=function(a,c){var d=b.isDuration(a),e=typeof a=="number",f=d?a._data:e?{}:a,g;return e&&(c?f[c]=a:f.milliseconds=a),g=new I(f),d&&(g._lang=a._lang),g},b.humanizeDuration=function(a,c,d){return b.duration(a,c===!0?null:c).humanize(c===!0?!0:d)},b.version=c,b.defaultFormat=v,b.lang=function(a,c){var d;if(!a)return g;(c||!f[a])&&P(a,c);if(f[a]){for(d=0;d<i.length;d++)b[i[d]]=f[a][i[d]];b.monthsParse=f[a].monthsParse,g=a}},b.langData=Q,b.isMoment=function(a){return a instanceof H},b.isDuration=function(a){return a instanceof I},b.lang("en",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}}),b.fn=H.prototype={clone:function(){return b(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this._d.toString()},toDate:function(){return this._d},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds(),!!this._isUTC]},isValid:function(){return this._a?this._a[8]!=null?!!this._a[8]:!N(this._a,(this._a[7]?b.utc(this._a):b(this._a)).toArray()):!isNaN(this._d.getTime())},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(a){return T(this,a?a:b.defaultFormat)},add:function(a,c){var d=c?b.duration(+c,a):b.duration(a);return L(this,d,1),this},subtract:function(a,c){var d=c?b.duration(+c,a):b.duration(a);return L(this,d,-1),this},diff:function(a,c,e){var f=this._isUTC?b(a).utc():b(a).local(),g=(this.zone()-f.zone())*6e4,h=this._d-f._d-g,i=this.year()-f.year(),j=this.month()-f.month(),k=this.date()-f.date(),l;return c==="months"?l=i*12+j+k/30:c==="years"?l=i+(j+k/30)/12:l=c==="seconds"?h/1e3:c==="minutes"?h/6e4:c==="hours"?h/36e5:c==="days"?h/864e5:c==="weeks"?h/6048e5:h,e?l:d(l)},from:function(a,c){return b.duration(this.diff(a)).lang(this._lang).humanize(!c)},fromNow:function(a){return this.from(b(),a)},calendar:function(){var a=this.diff(b().sod(),"days",!0),c=this.lang().calendar,d=c.sameElse,e=a<-6?d:a<-1?c.lastWeek:a<0?c.lastDay:a<1?c.sameDay:a<2?c.nextDay:a<7?c.nextWeek:d;return this.format(typeof e=="function"?e.apply(this):e)},isLeapYear:function(){var a=this.year();return a%4===0&&a%100!==0||a%400===0},isDST:function(){return this.zone()<b([this.year()]).zone()||this.zone()<b([this.year(),5]).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return a==null?b:this.add({d:a-b})},startOf:function(a){switch(a.replace(/s$/,"")){case"year":this.month(0);case"month":this.date(1);case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return this},endOf:function(a){return this.startOf(a).add(a.replace(/s?$/,"s"),1).subtract("ms",1)},sod:function(){return this.clone().startOf("day")},eod:function(){return this.clone().endOf("day")},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return b.utc([this.year(),this.month()+1,0]).date()},lang:function(b){return b===a?Q(this):(this._lang=b,this)}};for(e=0;e<y.length;e++)_(y[e].toLowerCase(),y[e]);_("year","FullYear"),b.duration.fn=I.prototype={weeks:function(){return J(this.days()/7)},valueOf:function(){return this._milliseconds+this._days*864e5+this._months*2592e6},humanize:function(a){var b=+this,c=this.lang().relativeTime,d=$(b,!a,this.lang()),e=b<=0?c.past:c.future;return a&&(typeof e=="function"?d=e(d):d=e.replace(/%s/i,d)),d},lang:b.fn.lang};for(e in z)z.hasOwnProperty(e)&&(bb(e,z[e]),ab(e.toLowerCase()));bb("Weeks",6048e5),h&&(module.exports=b),typeof ender=="undefined"&&(this.wpai_moment=b),typeof define=="function"&&define.amd&&define("wpai_moment",[],function(){return b})}).call(this);
views/admin/help/index.php CHANGED
@@ -3,16 +3,15 @@
3
  <table class="layout">
4
  <tr>
5
  <td class="left">
6
- <p style="font-size: 1.3em;">
7
- <b>E-mail</b> - <a href="mailto:support@wpallimport.com">support@wpallimport.com</a><br>
8
  <b><?php _e('Support Form', 'wp_all_import_plugin'); ?> </b> - <a target="_blank" href="http://www.wpallimport.com/support">http://www.wpallimport.com/support</a>
9
  </p>
10
 
11
- <p style="font-size: 1.3em;"><?php _e('Thanks for installing the free version of WP All Import.', 'wp_all_import_plugin'); ?></p>
12
 
13
- <p style="font-size: 1.3em;"><?php _e('We do not provide technical support in the WordPress.org community forums. But we are usually more than happy to help out free version users via e-mail - just e-mail us at the address above or submit a ticket through the support form.', 'wp_all_import_plugin'); ?></p>
14
 
15
- <p style="font-size: 1.3em;"><a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=support" target="_blank"><?php _e('For premium support, please upgrade to the Pro edition of WP All Import.', 'wp_all_import_plugin'); ?></a></p>
16
 
17
  </td>
18
  <td class="right">&nbsp;</td>
3
  <table class="layout">
4
  <tr>
5
  <td class="left">
6
+ <p style="font-size: 1.3em !important;">
 
7
  <b><?php _e('Support Form', 'wp_all_import_plugin'); ?> </b> - <a target="_blank" href="http://www.wpallimport.com/support">http://www.wpallimport.com/support</a>
8
  </p>
9
 
10
+ <p style="font-size: 1.3em !important;"><?php _e('Thank you for using WP All Import.', 'wp_all_import_plugin'); ?></p>
11
 
12
+ <p style="font-size: 1.3em !important;"><?php _e('While we do our best to provide technical support to users of the free version, we must prioritize requests from Pro users. If you need help with WP All Import please submit a ticket through the support form.', 'wp_all_import_plugin'); ?></p>
13
 
14
+ <p style="font-size: 1.3em !important;"><a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=support" target="_blank"><?php _e('Upgrade to the Pro edition of WP All Import for Premium Support', 'wp_all_import_plugin'); ?></a></p>
15
 
16
  </td>
17
  <td class="right">&nbsp;</td>
views/admin/import/element.php CHANGED
@@ -203,7 +203,7 @@
203
  <hr>
204
 
205
  <p class="wpallimport-submit-buttons" style="text-align:center;">
206
- <a href="<?php echo $this->baseUrl ?>" class="back rad3"><?php _e('Back to Step 1','wp_all_import_plugin');?></a>
207
  &nbsp;
208
  <input type="hidden" name="is_submitted" value="1" />
209
  <?php wp_nonce_field('choose-elements', '_wpnonce_choose-elements') ?>
203
  <hr>
204
 
205
  <p class="wpallimport-submit-buttons" style="text-align:center;">
206
+ <a href="<?php echo add_query_arg('action', 'index', $this->baseUrl); ?>" class="back rad3"><?php _e('Back to Step 1','wp_all_import_plugin');?></a>
207
  &nbsp;
208
  <input type="hidden" name="is_submitted" value="1" />
209
  <?php wp_nonce_field('choose-elements', '_wpnonce_choose-elements') ?>
views/admin/import/evaluate.php CHANGED
@@ -9,11 +9,11 @@
9
  <p><?php _e('<strong>Note</strong>: Highlighting is turned off since can be very slow on large sets of elements.', 'wp_all_import_plugin') ?></p>
10
  <?php endif ?>
11
  </div>
12
- <div id="current_xml">
13
  <?php if ($is_csv): ?>
14
  <?php PMXI_Render::render_csv_element($elements->item(0), false, '//'); ?>
15
  <?php else:?>
16
- <?php PMXI_Render::render_xml_element($elements->item(0), false, '//'); ?>
17
  <?php endif;?>
18
  </div>
19
  <script type="text/javascript">
9
  <p><?php _e('<strong>Note</strong>: Highlighting is turned off since can be very slow on large sets of elements.', 'wp_all_import_plugin') ?></p>
10
  <?php endif ?>
11
  </div>
12
+ <div id="current_xml">
13
  <?php if ($is_csv): ?>
14
  <?php PMXI_Render::render_csv_element($elements->item(0), false, '//'); ?>
15
  <?php else:?>
16
+ <?php PMXI_Render::render_xml_element($elements->item($elements->length > 1 ? $show_element : 0), false, '//'); ?>
17
  <?php endif;?>
18
  </div>
19
  <script type="text/javascript">
views/admin/import/index.php CHANGED
@@ -91,16 +91,22 @@ $l10n = array(
91
  <div id="plupload-ui" class="wpallimport-file-type-options">
92
  <div>
93
  <input type="hidden" name="filepath" value="<?php echo $post['filepath'] ?>" id="filepath"/>
94
- <a id="select-files" href="javascript:void(0);"/><?php _e('Click here to select file from your computer...', 'wp_all_import_plugin'); ?></a>
95
  <div id="progressbar" class="wpallimport-progressbar">
96
-
 
 
97
  </div>
98
- <div id="progress" class="wpallimport-progress">
 
 
 
99
  <div id="upload_process" class="wpallimport-upload-process"></div>
 
100
  </div>
101
  </div>
102
  </div>
103
- <div class="wpallimport-note" style="margin: 0 auto; font-size: 13px;"></div>
104
  </div>
105
  <div class="wpallimport-upload-type-container" rel="url_type">
106
  <div class="wpallimport-file-type-options">
@@ -112,7 +118,7 @@ $l10n = array(
112
  <div class="wpallimport-note" style="margin: 20px auto 0; font-size: 13px;">
113
  <?php _e('<strong>Hint:</strong> After you create this import, you can schedule it to run automatically, on a pre-defined schedule, with cron jobs. If anything in your file has changed, WP All Import can update your site with the changed data automatically.', 'wp_all_import_plugin'); ?>
114
  <div class="wpallimport-free-edition-notice" style="display:none;">
115
- <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=download-from-url" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to use this feature.', 'wp_all_import_plugin');?></a>
116
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
117
  </div>
118
  </div>
@@ -135,9 +141,9 @@ $l10n = array(
135
  <input type="hidden" name="file" value="<?php echo esc_attr($post['file']); ?>"/>
136
 
137
  <div class="wpallimport-note" style="margin: 0 auto; font-size: 13px;">
138
- <?php printf(__('Upload files to <strong>%s</strong> and they will appear in this list', 'wp_all_import_plugin'), $upload_dir['basedir'] . '/wpallimport/files') ?>
139
  <div class="wpallimport-free-edition-notice">
140
- <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=use-existing-file" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to use this feature.', 'wp_all_import_plugin');?></a>
141
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
142
  </div>
143
  </div>
@@ -277,8 +283,8 @@ $l10n = array(
277
  <a class="button button-primary button-hero wpallimport-large-button wpallimport-notify-read-more" href="http://www.wpallimport.com/documentation/troubleshooting/problems-with-import-files/#invalid" target="_blank"><?php _e('Read More', 'wp_all_import_plugin');?></a>
278
  </div>
279
 
280
- <div class="wpallimport-free-edition-notice wpallimport-import-orders-notice" style="text-align:center; margin-top:20px; margin-bottom: 40px; display: none;">
281
- <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WooCommerce add-on to import WooCommerce Orders.', 'wp_all_import_plugin');?></a>
282
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
283
  </div>
284
 
91
  <div id="plupload-ui" class="wpallimport-file-type-options">
92
  <div>
93
  <input type="hidden" name="filepath" value="<?php echo $post['filepath'] ?>" id="filepath"/>
94
+ <a id="select-files" href="javascript:void(0);" <?php if (empty($post['filepath'])):?>style="display:none;"<?php endif; ?> /><?php _e('Click here to select file from your computer...', 'wp_all_import_plugin'); ?></a>
95
  <div id="progressbar" class="wpallimport-progressbar">
96
+ <?php if (!empty($post['filepath'])):?>
97
+ <span><?php _e('Upload Complete', 'wp_all_import_plugin');?></span> - <?php echo basename($post['filepath']); ?>
98
+ <?php endif; ?>
99
  </div>
100
+ <div id="progress" class="wpallimport-progress" <?php if (!empty($post['filepath'])):?>style="visibility: visible; display: block;"<?php endif; ?>>
101
+ <?php if (!empty($post['filepath'])):?>
102
+ <div class="wpallimport-upload-process ui-progressbar ui-widget ui-widget-content ui-corner-all" id="upload_process" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="100"><div class="ui-progressbar-value ui-widget-header ui-corner-left ui-corner-right" style="width: 100%;"></div></div>
103
+ <?php else: ?>
104
  <div id="upload_process" class="wpallimport-upload-process"></div>
105
+ <?php endif; ?>
106
  </div>
107
  </div>
108
  </div>
109
+ <div class="wpallimport-note" style="margin: 0 auto; font-size: 13px;"><span></span></div>
110
  </div>
111
  <div class="wpallimport-upload-type-container" rel="url_type">
112
  <div class="wpallimport-file-type-options">
118
  <div class="wpallimport-note" style="margin: 20px auto 0; font-size: 13px;">
119
  <?php _e('<strong>Hint:</strong> After you create this import, you can schedule it to run automatically, on a pre-defined schedule, with cron jobs. If anything in your file has changed, WP All Import can update your site with the changed data automatically.', 'wp_all_import_plugin'); ?>
120
  <div class="wpallimport-free-edition-notice" style="display:none;">
121
+ <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=download-from-url" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to Download from URL', 'wp_all_import_plugin');?></a>
122
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
123
  </div>
124
  </div>
141
  <input type="hidden" name="file" value="<?php echo esc_attr($post['file']); ?>"/>
142
 
143
  <div class="wpallimport-note" style="margin: 0 auto; font-size: 13px;">
144
+ <?php printf(__('Files uploaded to <strong>%s</strong> will appear in this list.', 'wp_all_import_plugin'), $upload_dir['basedir'] . '/wpallimport/files') ?>
145
  <div class="wpallimport-free-edition-notice">
146
+ <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=use-existing-file" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to Use Existing Files', 'wp_all_import_plugin');?></a>
147
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
148
  </div>
149
  </div>
283
  <a class="button button-primary button-hero wpallimport-large-button wpallimport-notify-read-more" href="http://www.wpallimport.com/documentation/troubleshooting/problems-with-import-files/#invalid" target="_blank"><?php _e('Read More', 'wp_all_import_plugin');?></a>
284
  </div>
285
 
286
+ <div class="wpallimport-free-edition-notice wpallimport-import-orders-notice" rel="<?php echo (defined('PMWI_EDITION') ? PMWI_EDITION : 'free'); ?>" style="text-align:center; margin-top:20px; margin-bottom: 40px; display: none;">
287
+ <a href="https://www.wpallimport.com/checkout/?edd_action=purchase_collection&taxonomy=download_category&terms=14&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WooCommerce Add-On to Import WooCommerce Orders', 'wp_all_import_plugin');?></a>
288
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
289
  </div>
290
 
views/admin/import/options/_import_file.php CHANGED
@@ -104,8 +104,8 @@ $l10n = array(
104
  <span class="wpallimport-url-icon"></span>
105
  <input type="text" class="regular-text" name="url" value="<?php echo ('url' == $import->type) ? esc_attr($import->path) : 'Enter a web address to download the file from...'; ?>"/>
106
  <div class="wpallimport-free-edition-notice">
107
- <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=download-from-url" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to use this feature.', 'wp_all_import_plugin');?></a>
108
- <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
109
  </div>
110
  </div>
111
  <input type="hidden" name="downloaded"/>
@@ -126,12 +126,12 @@ $l10n = array(
126
 
127
  <input type="hidden" name="file" value="<?php if ('file' == $import->type) echo esc_attr($import->path); ?>"/>
128
 
129
- <div class="wpallimport-note" style="width:60%; margin: 0 auto; ">
130
- <?php printf(__('Upload files to <strong>%s</strong> and they will appear in this list', 'wp_all_import_plugin'), $upload_dir['basedir'] . '/wpallimport/files'); ?>
131
  </div>
132
  <div class="wpallimport-free-edition-notice">
133
- <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=use-existing-file" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to use this feature.', 'wp_all_import_plugin');?></a>
134
- <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
135
  </div>
136
  </div>
137
  </div>
104
  <span class="wpallimport-url-icon"></span>
105
  <input type="text" class="regular-text" name="url" value="<?php echo ('url' == $import->type) ? esc_attr($import->path) : 'Enter a web address to download the file from...'; ?>"/>
106
  <div class="wpallimport-free-edition-notice">
107
+ <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=download-from-url" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to Download from URL', 'wp_all_import_plugin');?></a>
108
+ <p style="margin-top:16px;"><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
109
  </div>
110
  </div>
111
  <input type="hidden" name="downloaded"/>
126
 
127
  <input type="hidden" name="file" value="<?php if ('file' == $import->type) echo esc_attr($import->path); ?>"/>
128
 
129
+ <div class="wpallimport-note" style="margin: 0 auto; ">
130
+ <?php printf(__('Files uploaded to <strong>%s</strong> will appear in this list.', 'wp_all_import_plugin'), $upload_dir['basedir'] . '/wpallimport/files'); ?>
131
  </div>
132
  <div class="wpallimport-free-edition-notice">
133
+ <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=use-existing-file" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to Use Existing Files', 'wp_all_import_plugin');?></a>
134
+ <p style="margin-top:16px;"><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
135
  </div>
136
  </div>
137
  </div>
views/admin/import/options/_settings_template.php CHANGED
@@ -49,7 +49,7 @@
49
 
50
  $custom_types = get_post_types(array('_builtin' => true), 'objects') + get_post_types(array('_builtin' => false, 'show_ui' => true), 'objects');
51
  foreach ($custom_types as $key => $ct) {
52
- if (in_array($key, array('attachment', 'revision', 'nav_menu_item', 'shop_webhook', 'import_users', 'shop_order'))) unset($custom_types[$key]);
53
  }
54
  $custom_types = apply_filters( 'pmxi_custom_types', $custom_types );
55
 
@@ -148,8 +148,14 @@
148
  <?php endif; ?>
149
  <div class="input">
150
  <input type="hidden" name="xml_reader_engine" value="0" />
151
- <input type="checkbox" id="xml_reader_engine" class="fix_checkbox" name="xml_reader_engine" value="1" <?php echo $post['xml_reader_engine'] ? 'checked="checked"': '' ?>/>
152
- <label for="xml_reader_engine"><?php _e('Use StreamReader instead of XMLReader to parse import file', 'wp_all_import_plugin') ?> <a href="#help" class="wpallimport-help" style="position:relative; top:0;" title="<?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'); ?>">?</a></label>
 
 
 
 
 
 
153
  </div>
154
 
155
  <div class="input" style="margin-top: 15px;">
49
 
50
  $custom_types = get_post_types(array('_builtin' => true), 'objects') + get_post_types(array('_builtin' => false, 'show_ui' => true), 'objects');
51
  foreach ($custom_types as $key => $ct) {
52
+ if (in_array($key, array('attachment', 'revision', 'nav_menu_item', 'shop_webhook', 'import_users'))) unset($custom_types[$key]);
53
  }
54
  $custom_types = apply_filters( 'pmxi_custom_types', $custom_types );
55
 
148
  <?php endif; ?>
149
  <div class="input">
150
  <input type="hidden" name="xml_reader_engine" value="0" />
151
+
152
+ <?php if ( PMXI_Plugin::getInstance()->getOption('force_stream_reader') ): ?>
153
+ <input type="checkbox" id="xml_reader_engine" class="fix_checkbox" name="xml_reader_engine" value="1" checked="checked" disabled="disabled"/>
154
+ <label for="xml_reader_engine"><?php _e('Use StreamReader instead of XMLReader to parse import file', 'wp_all_import_plugin') ?> <a href="#help" class="wpallimport-help" style="position:relative; top:0;" title="<?php _e('WP All Import is being forced to use Stream Reader for all imports. Go to WP All Import ▸ Settings to modify this setting.', 'wp_all_import_plugin'); ?>">?</a></label>
155
+ <?php else : ?>
156
+ <input type="checkbox" id="xml_reader_engine" class="fix_checkbox" name="xml_reader_engine" value="1" <?php echo $post['xml_reader_engine'] ? 'checked="checked"': '' ?>/>
157
+ <label for="xml_reader_engine"><?php _e('Use StreamReader instead of XMLReader to parse import file', 'wp_all_import_plugin') ?> <a href="#help" class="wpallimport-help" style="position:relative; top:0;" title="<?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'); ?>">?</a></label>
158
+ <?php endif; ?>
159
  </div>
160
 
161
  <div class="input" style="margin-top: 15px;">
views/admin/import/preview.php CHANGED
@@ -3,7 +3,7 @@
3
  <div class="title">
4
  <div class="navigation">
5
  <?php if ($tagno > 1): ?><a href="#prev" class="previous_element">&nbsp;</a><?php else: ?><span class="previous_element">&nbsp;</span><?php endif ?>
6
- <?php printf(__('<strong><input type="text" value="%s" name="tagno" class="tagno"/></strong><span class="out_of"> of <strong class="pmxi_count">%s</strong></span>', 'pmxi_plugin'), $tagno, PMXI_Plugin::$session->count); ?>
7
  <?php if ($tagno < PMXI_Plugin::$session->count): ?><a href="#next" class="next_element">&nbsp;</a><?php else: ?><span class="next_element">&nbsp;</span><?php endif ?>
8
  </div>
9
  </div>
@@ -15,7 +15,7 @@
15
  <?php endif ?>
16
 
17
  <?php if (isset($title)): ?>
18
- <h2 class="title"><?php echo $title ?></h2>
19
  <?php endif ?>
20
  <?php if (isset($content)): ?>
21
  <?php echo apply_filters('the_content', $content) ?>
3
  <div class="title">
4
  <div class="navigation">
5
  <?php if ($tagno > 1): ?><a href="#prev" class="previous_element">&nbsp;</a><?php else: ?><span class="previous_element">&nbsp;</span><?php endif ?>
6
+ <?php printf(__('<strong><input type="text" value="%s" name="tagno" class="tagno"/></strong><span class="out_of"> of <strong class="pmxi_count">%s</strong></span>', 'wp_all_import_plugin'), $tagno, PMXI_Plugin::$session->count); ?>
7
  <?php if ($tagno < PMXI_Plugin::$session->count): ?><a href="#next" class="next_element">&nbsp;</a><?php else: ?><span class="next_element">&nbsp;</span><?php endif ?>
8
  </div>
9
  </div>
15
  <?php endif ?>
16
 
17
  <?php if (isset($title)): ?>
18
+ <h2 class="title"><?php echo $title; ?></h2>
19
  <?php endif ?>
20
  <?php if (isset($content)): ?>
21
  <?php echo apply_filters('the_content', $content) ?>
views/admin/import/preview_images.php CHANGED
@@ -74,7 +74,7 @@
74
 
75
  <?php
76
  foreach ($imgs as $img) {
77
- $img_url = home_url() . preg_replace('%.*/wp-content%', '/wp-content', $wp_uploads['basedir']) . DIRECTORY_SEPARATOR . PMXI_Plugin::FILES_DIRECTORY . DIRECTORY_SEPARATOR . trim($img);
78
  ?>
79
  <img src="<?php echo trim($img_url);?>" style="width:64px; margin:5px; vertical-align:top;"/>
80
  <?php
@@ -124,6 +124,7 @@
124
  $image_name = apply_filters("wp_all_import_image_filename", urldecode(sanitize_file_name((($img_ext) ? str_replace("." . $default_extension, "", $bn) : $bn))) . (("" != $img_ext) ? '.' . $img_ext : ''));
125
 
126
  $attch = wp_all_import_get_image_from_gallery($image_name);
 
127
  $img_url = (empty($attch)) ? '' : trim(wp_get_attachment_url($attch->ID));
128
  ?>
129
  <img src="<?php echo trim($img_url);?>" style="width:64px; margin:5px; vertical-align:top;"/>
74
 
75
  <?php
76
  foreach ($imgs as $img) {
77
+ $img_url = site_url() . preg_replace('%.*/wp-content%', '/wp-content', $wp_uploads['basedir']) . DIRECTORY_SEPARATOR . PMXI_Plugin::FILES_DIRECTORY . DIRECTORY_SEPARATOR . trim($img);
78
  ?>
79
  <img src="<?php echo trim($img_url);?>" style="width:64px; margin:5px; vertical-align:top;"/>
80
  <?php
124
  $image_name = apply_filters("wp_all_import_image_filename", urldecode(sanitize_file_name((($img_ext) ? str_replace("." . $default_extension, "", $bn) : $bn))) . (("" != $img_ext) ? '.' . $img_ext : ''));
125
 
126
  $attch = wp_all_import_get_image_from_gallery($image_name);
127
+
128
  $img_url = (empty($attch)) ? '' : trim(wp_get_attachment_url($attch->ID));
129
  ?>
130
  <img src="<?php echo trim($img_url);?>" style="width:64px; margin:5px; vertical-align:top;"/>
views/admin/import/process.php CHANGED
@@ -43,6 +43,13 @@
43
  </h4>
44
  <input type="button" class="button button-primary button-hero wpallimport-large-button wpallimport-delete-and-edit" rel="<?php echo add_query_arg(array('id' => $update_previous->id, 'page' => 'pmxi-admin-manage', 'action' => 'delete_and_edit'), $this->baseUrl); ?>" value="<?php _e('Delete & Edit', 'wp_all_import_plugin'); ?>"/>
45
  </div>
 
 
 
 
 
 
 
46
  <h3 class="wpallimport-complete-success"><?php printf(__('WP All Import successfully imported your file <span>%s</span> into your WordPress installation!','wp_all_import_plugin'), (PMXI_Plugin::$session->source['type'] != 'url') ? basename(PMXI_Plugin::$session->source['path']) : PMXI_Plugin::$session->source['path'])?></h3>
47
  <?php if ($ajax_processing): ?>
48
  <p class="wpallimport-log-details"><?php printf(__('There were <span class="wpallimport-errors-count">%s</span> errors and <span class="wpallimport-warnings-count">%s</span> warnings in this import. You can see these in the import log.', 'wp_all_import_plugin'), 0, 0); ?></p>
@@ -158,9 +165,9 @@
158
  $('#status').each(function () {
159
 
160
  var then = $('#then');
161
- start_date = moment().sod();
162
  update = function(){
163
- var duration = moment.duration({'seconds' : 1});
164
  start_date.add(duration);
165
 
166
  if ($('#process_notice').is(':visible') && ! $('.wpallimport-modal-message').is(':visible')){
@@ -209,6 +216,7 @@
209
  $('#created_count').html(data.created);
210
  $('.inserted_count').html(data.created);
211
  $('#updated_count').html(data.updated);
 
212
  $('#warnings').html(data.warnings);
213
  $('#errors').html(data.errors);
214
  $('#percents_count').html(data.percentage);
@@ -229,12 +237,19 @@
229
  // detect broken auto-created Unique ID and notify user
230
  <?php if ( $this->isWizard and $update_previous->options['wizard_type'] == 'new' and ! $update_previous->options['deligate']): ?>
231
  if ( data.imported != data.created )
232
- {
233
- //$('.wpallimport-complete-success').hide();
234
  $('.wpallimport-complete-warning').show();
 
 
 
 
 
 
 
235
  }
236
  <?php endif; ?>
237
 
 
238
  $('#import_finished').fadeIn();
239
 
240
  if ( parseInt(data.errors) || parseInt(data.warnings)){
@@ -324,7 +339,8 @@
324
 
325
  var request = {
326
  action:'import_failed',
327
- id: '<?php echo $update_previous->id; ?>'
 
328
  };
329
 
330
  $.ajax({
43
  </h4>
44
  <input type="button" class="button button-primary button-hero wpallimport-large-button wpallimport-delete-and-edit" rel="<?php echo add_query_arg(array('id' => $update_previous->id, 'page' => 'pmxi-admin-manage', 'action' => 'delete_and_edit'), $this->baseUrl); ?>" value="<?php _e('Delete & Edit', 'wp_all_import_plugin'); ?>"/>
45
  </div>
46
+ <div class="wpallimport-content-section wpallimport-console wpallimport-orders-complete-warning">
47
+ <h3><?php printf(__('<span id="skipped_count">%s</span> orders were skipped during this import', 'wp_all_import_plugin'), $update_previous->skipped); ?></h3>
48
+ <h4>
49
+ <?php printf(__('WP All Import is unable import an order when it cannot match the products or customer specified. <a href="%s" style="margin: 0;">See the import log</a> for a list of which orders were skipped and why.', 'wp_all_import_plugin'), add_query_arg(array('id' => $update_previous->id, 'page' => 'pmxi-admin-history', 'action' => 'log', 'history_id' => PMXI_Plugin::$session->history_id, '_wpnonce' => wp_create_nonce( '_wpnonce-download_log' )), $this->baseUrl)); ?>
50
+ </h4>
51
+ <input type="button" class="button button-primary button-hero wpallimport-large-button wpallimport-delete-and-edit" rel="<?php echo add_query_arg(array('id' => $update_previous->id, 'page' => 'pmxi-admin-manage', 'action' => 'delete_and_edit'), $this->baseUrl); ?>" value="<?php _e('Delete & Edit', 'wp_all_import_plugin'); ?>"/>
52
+ </div>
53
  <h3 class="wpallimport-complete-success"><?php printf(__('WP All Import successfully imported your file <span>%s</span> into your WordPress installation!','wp_all_import_plugin'), (PMXI_Plugin::$session->source['type'] != 'url') ? basename(PMXI_Plugin::$session->source['path']) : PMXI_Plugin::$session->source['path'])?></h3>
54
  <?php if ($ajax_processing): ?>
55
  <p class="wpallimport-log-details"><?php printf(__('There were <span class="wpallimport-errors-count">%s</span> errors and <span class="wpallimport-warnings-count">%s</span> warnings in this import. You can see these in the import log.', 'wp_all_import_plugin'), 0, 0); ?></p>
165
  $('#status').each(function () {
166
 
167
  var then = $('#then');
168
+ start_date = wpai_moment().sod();
169
  update = function(){
170
+ var duration = wpai_moment.duration({'seconds' : 1});
171
  start_date.add(duration);
172
 
173
  if ($('#process_notice').is(':visible') && ! $('.wpallimport-modal-message').is(':visible')){
216
  $('#created_count').html(data.created);
217
  $('.inserted_count').html(data.created);
218
  $('#updated_count').html(data.updated);
219
+ $('#skipped_count').html(data.skipped);
220
  $('#warnings').html(data.warnings);
221
  $('#errors').html(data.errors);
222
  $('#percents_count').html(data.percentage);
237
  // detect broken auto-created Unique ID and notify user
238
  <?php if ( $this->isWizard and $update_previous->options['wizard_type'] == 'new' and ! $update_previous->options['deligate']): ?>
239
  if ( data.imported != data.created )
240
+ {
 
241
  $('.wpallimport-complete-warning').show();
242
+ }
243
+ <?php endif; ?>
244
+
245
+ <?php if ( ! $update_previous->options['deligate'] and ! empty($update_previous->options['custom_type']) and $update_previous->options['custom_type'] == 'shop_order' and empty($update_previous->options['is_import_specified'])): ?>
246
+ if ( data.skipped > 0 )
247
+ {
248
+ $('.wpallimport-orders-complete-warning').show();
249
  }
250
  <?php endif; ?>
251
 
252
+
253
  $('#import_finished').fadeIn();
254
 
255
  if ( parseInt(data.errors) || parseInt(data.warnings)){
339
 
340
  var request = {
341
  action:'import_failed',
342
+ id: '<?php echo $update_previous->id; ?>',
343
+ security: wp_all_import_security
344
  };
345
 
346
  $.ajax({
views/admin/import/tag.php CHANGED
@@ -16,7 +16,7 @@
16
  if ( PMXI_Plugin::$session->options['delimiter'] ):
17
  PMXI_Render::render_csv_element($elements->item(0), true);
18
  else:
19
- PMXI_Render::render_xml_element($elements->item(0), true);
20
  endif;
21
 
22
  endif;
16
  if ( PMXI_Plugin::$session->options['delimiter'] ):
17
  PMXI_Render::render_csv_element($elements->item(0), true);
18
  else:
19
+ PMXI_Render::render_xml_element($elements->item($elements->length > 1 ? $tagno : 0), true);
20
  endif;
21
 
22
  endif;
views/admin/import/template.php CHANGED
@@ -148,7 +148,7 @@
148
  <div class="wpallimport-collapsed-content" style="padding: 0;">
149
  <div class="wpallimport-collapsed-content-inner">
150
  <div class="wpallimport-free-edition-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
151
- <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to enable the Function Editor.', 'wp_all_import_plugin');?></a>
152
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
153
  </div>
154
 
@@ -207,10 +207,10 @@
207
  <div style="text-align:center; width:100%;">
208
 
209
  <div class="wpallimport-free-edition-notice wpallimport-dynamic-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
210
- <input type="hidden" value="<?php _e('Upgrade to the Pro edition of WP All Import to import custom fields.', 'wp_all_import_plugin');?>" class="wpallimport-dynamic-notice-cf-text"/>
211
- <input type="hidden" value="<?php _e('Upgrade to the Pro edition of WP All Import to import images.', 'wp_all_import_plugin');?>" class="wpallimport-dynamic-notice-images-text"/>
212
- <input type="hidden" value="<?php _e('Upgrade to the Pro edition of WP All Import to import images and custom fields.', 'wp_all_import_plugin');?>" class="wpallimport-dynamic-notice-cf-image-text"/>
213
- <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank" class="upgrade_link"></a>
214
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
215
  </div>
216
 
148
  <div class="wpallimport-collapsed-content" style="padding: 0;">
149
  <div class="wpallimport-collapsed-content-inner">
150
  <div class="wpallimport-free-edition-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
151
+ <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to use the Function Editor', 'wp_all_import_plugin');?></a>
152
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
153
  </div>
154
 
207
  <div style="text-align:center; width:100%;">
208
 
209
  <div class="wpallimport-free-edition-notice wpallimport-dynamic-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
210
+ <input type="hidden" value="<?php _e('Upgrade to the Pro edition of WP All Import to Import Custom Fields', 'wp_all_import_plugin');?>" class="wpallimport-dynamic-notice-cf-text"/>
211
+ <input type="hidden" value="<?php _e('Upgrade to the Pro edition of WP All Import to Import Images', 'wp_all_import_plugin');?>" class="wpallimport-dynamic-notice-images-text"/>
212
+ <input type="hidden" value="<?php _e('Upgrade to the Pro edition of WP All Import to Import Images and Custom Fields', 'wp_all_import_plugin');?>" class="wpallimport-dynamic-notice-cf-image-text"/>
213
+ <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank" class="upgrade_link"></a>
214
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
215
  </div>
216
 
views/admin/import/template/_custom_fields_template.php CHANGED
@@ -7,7 +7,7 @@
7
  <div class="wpallimport-collapsed-content" style="padding: 0;">
8
  <div class="wpallimport-collapsed-content-inner">
9
  <div class="wpallimport-free-edition-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
10
- <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to import data to Custom Fields.', 'pmxi_plugin');?></a>
11
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
12
  </div>
13
  <script type="text/javascript">
7
  <div class="wpallimport-collapsed-content" style="padding: 0;">
8
  <div class="wpallimport-collapsed-content-inner">
9
  <div class="wpallimport-free-edition-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
10
+ <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to Import Custom Fields', 'pmxi_plugin');?></a>
11
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
12
  </div>
13
  <script type="text/javascript">
views/admin/import/template/_featured_template.php CHANGED
@@ -8,7 +8,7 @@
8
  <?php if ($section_is_show_warning and ( $post_type != "product" or ! class_exists('PMWI_Plugin'))):?>
9
 
10
  <div class="wpallimport-free-edition-notice" style="text-align:center; margin-top:-15px; margin-bottom: 40px;">
11
- <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=images" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to import images.', 'pmxi_plugin');?></a>
12
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
13
  </div>
14
 
8
  <?php if ($section_is_show_warning and ( $post_type != "product" or ! class_exists('PMWI_Plugin'))):?>
9
 
10
  <div class="wpallimport-free-edition-notice" style="text-align:center; margin-top:-15px; margin-bottom: 40px;">
11
+ <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=images" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to Import Images', 'pmxi_plugin');?></a>
12
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
13
  </div>
14
 
views/admin/import/template/_nested_template.php CHANGED
@@ -9,7 +9,7 @@ $l10n = array(
9
  'default_error' => 'An error occurred in the upload. Please try again later.',
10
  'missing_upload_url' => 'There was a configuration error. Please contact the server administrator.',
11
  'upload_limit_exceeded' => 'You may only upload 1 file.',
12
- 'http_error' => 'HTTP error.',
13
  'upload_failed' => 'Upload failed.',
14
  'io_error' => 'IO error.',
15
  'security_error' => 'Security error.',
9
  'default_error' => 'An error occurred in the upload. Please try again later.',
10
  'missing_upload_url' => 'There was a configuration error. Please contact the server administrator.',
11
  'upload_limit_exceeded' => 'You may only upload 1 file.',
12
+ 'http_error' => 'HTTP Error: Click here for our <a href="http://www.wpallimport.com/documentation/advanced/troubleshooting/" target="_blank">troubleshooting guide</a>, or ask your web host to look in your error_log file for an error that takes place at the same time you are trying to upload a file.',
13
  'upload_failed' => 'Upload failed.',
14
  'io_error' => 'IO error.',
15
  'security_error' => 'Security error.',
views/admin/import/template/_other_template.php CHANGED
@@ -215,7 +215,7 @@
215
  <label for="is_multiple_page_parent_yes"><?php _e('Select page parent', 'wp_all_import_plugin') ?></label>
216
  <div class="switcher-target-is_multiple_page_parent_yes">
217
  <div class="input">
218
- <?php wp_dropdown_pages(array('post_type' => 'page', 'selected' => $post['parent'], 'name' => 'parent', 'show_option_none' => __('(no parent)', 'wp_all_import_plugin'), 'sort_column'=> 'menu_order, post_title',)) ?>
219
  </div>
220
  </div>
221
  </div>
215
  <label for="is_multiple_page_parent_yes"><?php _e('Select page parent', 'wp_all_import_plugin') ?></label>
216
  <div class="switcher-target-is_multiple_page_parent_yes">
217
  <div class="input">
218
+ <?php wp_dropdown_pages(array('post_type' => 'page', 'selected' => $post['parent'], 'name' => 'parent', 'show_option_none' => __('(no parent)', 'wp_all_import_plugin'), 'sort_column'=> 'menu_order, post_title', 'number' => 500)); ?>
219
  </div>
220
  </div>
221
  </div>
views/admin/manage/index.php CHANGED
@@ -1,4 +1,4 @@
1
- <div class="wpallimport-header" style="overflow:hidden; height: 60px; padding-top: 10px; margin-bottom: -20px;">
2
  <div class="wpallimport-logo"></div>
3
  <div class="wpallimport-title">
4
  <p><?php _e('WP All Import', 'wp_all_import_plugin'); ?></p>
1
+ <div class="wpallimport-header" style="overflow:hidden; height: 65px; padding-top: 10px; margin-bottom: -20px;">
2
  <div class="wpallimport-logo"></div>
3
  <div class="wpallimport-title">
4
  <p><?php _e('WP All Import', 'wp_all_import_plugin'); ?></p>
views/admin/settings/index.php CHANGED
@@ -115,6 +115,23 @@
115
  </td>
116
  </tr>
117
  </tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  </table>
119
 
120
  <div class="clear"></div>
@@ -135,7 +152,7 @@
135
  <br>
136
  <h3><?php _e('Function Editor', 'wp_all_import_plugin') ?></h3>
137
  <div class="wpallimport-free-edition-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
138
- <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to enable the Function Editor.', 'wp_all_import_plugin');?></a>
139
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
140
  </div>
141
  <textarea id="wp_all_import_code" name="wp_all_import_code"><?php echo "<?php\n\n?>";?></textarea>
115
  </td>
116
  </tr>
117
  </tbody>
118
+ </table>
119
+
120
+ <h3><?php _e('Force Stream Reader', 'wp_all_import_plugin') ?></h3>
121
+
122
+ <table class="form-table">
123
+ <tbody>
124
+ <tr>
125
+ <th scope="row"><label><?php _e('Force WP All Import to use StreamReader instead of XMLReader to parse all import files', 'wp_all_import_plugin'); ?></label></th>
126
+ <td>
127
+ <fieldset style="padding:0;">
128
+ <input type="hidden" name="force_stream_reader" value="0"/>
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>
152
  <br>
153
  <h3><?php _e('Function Editor', 'wp_all_import_plugin') ?></h3>
154
  <div class="wpallimport-free-edition-notice" style="text-align:center; margin-top:0; margin-bottom: 40px;">
155
+ <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=1748&edd_options%5Bprice_id%5D=0&utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank" class="upgrade_link"><?php _e('Upgrade to the Pro edition of WP All Import to use the Function Editor.', 'wp_all_import_plugin');?></a>
156
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_import_plugin'); ?></p>
157
  </div>
158
  <textarea id="wp_all_import_code" name="wp_all_import_code"><?php echo "<?php\n\n?>";?></textarea>