Export WordPress data to XML/CSV - Version 1.2.2

Version Description

  • bugfix: support exports scheduled at 12am and 12pm
  • bugfix: fix JS error when editing export template
Download this release

Release Info

Developer soflyy
Plugin Icon 128x128 Export WordPress data to XML/CSV
Version 1.2.2
Comparing to
See all releases

Code changes from version 1.2.1 to 1.2.2

readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Export WordPress data to XML/CSV ===
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
- Tested up to: 4.9.8
5
- Stable tag: 1.2.1
6
  Tags: wordpress csv export, wordpress xml export, xml, csv, datafeed, export, migrate, export csv from wordpress, export xml from wordpress, advanced xml export, advanced csv export, export data, bulk csv export, export custom post type, export woocommerce products, export woocommerce orders, migrate woocommerce, csv export, export csv, xml export, export xml, csv exporter, datafeed
7
 
8
  WP All Export is an extremely powerful exporter that makes it easy to export any XML, CSV, or Excel file from WordPress.
@@ -86,6 +86,10 @@ Either: -
86
 
87
  == Changelog ==
88
 
 
 
 
 
89
  = 1.2.1 =
90
  * new filter: added pmxe_after_iteration action
91
  * bugfix: increase custom query meta limit
1
  === Export WordPress data to XML/CSV ===
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
+ Tested up to: 5.0
5
+ Stable tag: 1.2.2
6
  Tags: wordpress csv export, wordpress xml export, xml, csv, datafeed, export, migrate, export csv from wordpress, export xml from wordpress, advanced xml export, advanced csv export, export data, bulk csv export, export custom post type, export woocommerce products, export woocommerce orders, migrate woocommerce, csv export, export csv, xml export, export xml, csv exporter, datafeed
7
 
8
  WP All Export is an extremely powerful exporter that makes it easy to export any XML, CSV, or Excel file from WordPress.
86
 
87
  == Changelog ==
88
 
89
+ = 1.2.2 =
90
+ * bugfix: support exports scheduled at 12am and 12pm
91
+ * bugfix: fix JS error when editing export template
92
+
93
  = 1.2.1 =
94
  * new filter: added pmxe_after_iteration action
95
  * bugfix: increase custom query meta limit
src/Scheduling/Scheduling.php CHANGED
@@ -164,6 +164,7 @@ class Scheduling
164
 
165
  public static function buildTimesArray($schedulingWeeklyDays, $schedulingTimes)
166
  {
 
167
  $times = array();
168
  $days = explode(',', $schedulingWeeklyDays);
169
  foreach ($days as $day) {
@@ -172,7 +173,8 @@ class Scheduling
172
  if (!$time) {
173
  break;
174
  }
175
- $timeParts = explode(':', $time);
 
176
  $hour = $timeParts[0];
177
  $min = (int)$timeParts[1];
178
 
@@ -180,6 +182,12 @@ class Scheduling
180
  $hour = $hour + 12;
181
  }
182
 
 
 
 
 
 
 
183
  $times[] = array(
184
  'day' => $day,
185
  'hour' => $hour,
164
 
165
  public static function buildTimesArray($schedulingWeeklyDays, $schedulingTimes)
166
  {
167
+
168
  $times = array();
169
  $days = explode(',', $schedulingWeeklyDays);
170
  foreach ($days as $day) {
173
  if (!$time) {
174
  break;
175
  }
176
+
177
+ $timeParts = explode(':', $time);
178
  $hour = $timeParts[0];
179
  $min = (int)$timeParts[1];
180
 
182
  $hour = $hour + 12;
183
  }
184
 
185
+ if($hour == 12) {
186
+ if(strpos($time, 'am') !== false) {
187
+ $hour = 0;
188
+ }
189
+ }
190
+
191
  $times[] = array(
192
  'day' => $day,
193
  'hour' => $hour,
src/Scheduling/SchedulingApi.php CHANGED
@@ -16,7 +16,13 @@ class SchedulingApi
16
 
17
  public function checkConnection()
18
  {
19
- $pingBackUrl = $this->getApiUrl('connection').'?url='.urlencode(get_site_url('admin-ajax.php'));
 
 
 
 
 
 
20
 
21
  $response = wp_remote_request(
22
  $pingBackUrl,
16
 
17
  public function checkConnection()
18
  {
19
+ if ( is_multisite() ) {
20
+ $siteUrl = get_site_url( get_current_blog_id() );
21
+ } else {
22
+ $siteUrl = get_site_url();
23
+ }
24
+
25
+ $pingBackUrl = $this->getApiUrl('connection').'?url='.urlencode($siteUrl);
26
 
27
  $response = wp_remote_request(
28
  $pingBackUrl,
src/Scheduling/views/ConnectionIcon.php CHANGED
@@ -3,9 +3,9 @@ $scheduling = \Wpae\Scheduling\Scheduling::create();
3
  ?>
4
  <span class="wpai-no-license" <?php if ($scheduling->checkLicense()) { ?> style="display: none;" <?php } ?> >
5
 
6
- <a href="#" style="z-index: 1000; position: absolute; top: 1px; left: 155px; padding: 0;" class="help_scheduling tipsy"
7
  title="Automatic Scheduling is a paid service from Soflyy. Click for more info.">
8
- <img style="width: 16px; "
9
  src="<?php echo PMXE_ROOT_URL; ?>/static/img/s-question.png"/>
10
  </a>
11
  </span>
@@ -14,10 +14,10 @@ $scheduling = \Wpae\Scheduling\Scheduling::create();
14
  <span class="wpai-license" <?php if (!$scheduling->checkLicense()) { ?> style="display: none;" <?php } ?> >
15
  <?php if ( $scheduling->checkConnection() ) {
16
  ?>
17
- <a href="#" class="help_scheduling" title="Connection to WP All Export servers is stable and confirmed"
18
- style="z-index: 1000; position: absolute; top: 1px; left: 155px; padding: 0; width: 16px;">
19
  <img src="<?php echo PMXE_ROOT_URL; ?>/static/img/s-check.png" style="width: 16px;"/>
20
- </a>
21
  <?php
22
  } else { ?>
23
  <img src="<?php echo PMXE_ROOT_URL; ?>/static/img/s-exclamation.png" style="width: 16px;"/>
3
  ?>
4
  <span class="wpai-no-license" <?php if ($scheduling->checkLicense()) { ?> style="display: none;" <?php } ?> >
5
 
6
+ <a href="#" style="z-index: 1000;" class="help_scheduling tipsy"
7
  title="Automatic Scheduling is a paid service from Soflyy. Click for more info.">
8
+ <img style="width: 16px; top: 2px; position: absolute; left: 0;"
9
  src="<?php echo PMXE_ROOT_URL; ?>/static/img/s-question.png"/>
10
  </a>
11
  </span>
14
  <span class="wpai-license" <?php if (!$scheduling->checkLicense()) { ?> style="display: none;" <?php } ?> >
15
  <?php if ( $scheduling->checkConnection() ) {
16
  ?>
17
+ <span class="wpallexport-help" title="Connection to WP All Export servers is stable and confirmed"
18
+ style="background-image: none; width: 20px; height: 20px;;">
19
  <img src="<?php echo PMXE_ROOT_URL; ?>/static/img/s-check.png" style="width: 16px;"/>
20
+ </span>
21
  <?php
22
  } else { ?>
23
  <img src="<?php echo PMXE_ROOT_URL; ?>/static/img/s-exclamation.png" style="width: 16px;"/>
static/js/jquery/jquery.mjs.pmxe_nestedSortable.js CHANGED
@@ -13,417 +13,419 @@
13
 
14
  (function($) {
15
 
16
- $.widget("mjs.pmxe_nestedSortable", $.extend({}, $.ui.sortable.prototype, {
17
 
18
- options: {
19
- tabSize: 20,
20
- disableNesting: 'mjs-pmxe_nestedSortable-no-nesting',
21
- errorClass: 'mjs-pmxe_nestedSortable-error',
22
- listType: 'ol',
23
- maxLevels: 0,
24
- protectRoot: false,
25
- rootID: null,
26
- rtl: false,
27
- isAllowed: function(item, parent) { return true; }
28
- },
29
-
30
- _create: function() {
31
- this.element.data('sortable', this.element.data('pmxe_nestedSortable'));
32
-
33
- if (!this.element.is(this.options.listType))
34
- throw new Error('pmxe_nestedSortable: Please check the listType option is set to your actual list type');
35
-
36
- return $.ui.sortable.prototype._create.apply(this, arguments);
37
- },
38
-
39
- destroy: function() {
40
- this.element
41
- .removeData("pmxe_nestedSortable")
42
- .unbind(".pmxe_nestedSortable");
43
- return $.ui.sortable.prototype.destroy.apply(this, arguments);
44
- },
45
-
46
- _mouseDrag: function(event) {
47
-
48
- //Compute the helpers position
49
- this.position = this._generatePosition(event);
50
- this.positionAbs = this._convertPositionTo("absolute");
51
-
52
- if (!this.lastPositionAbs) {
53
- this.lastPositionAbs = this.positionAbs;
54
- }
55
-
56
- //Do scrolling
57
- if(this.options.scroll) {
58
- var o = this.options, scrolled = false;
59
- if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
60
-
61
- if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
62
- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
63
- else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
64
- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
65
-
66
- if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
67
- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
68
- else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
69
- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
70
-
71
- } else {
72
-
73
- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
74
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
75
- else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
76
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
77
-
78
- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
79
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
80
- else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
81
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
82
-
83
- }
84
-
85
- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
86
- $.ui.ddmanager.prepareOffsets(this, event);
87
- }
88
-
89
- //Regenerate the absolute position used for position checks
90
- this.positionAbs = this._convertPositionTo("absolute");
91
-
92
- // Find the top offset before rearrangement,
93
- var previousTopOffset = this.placeholder.offset().top;
94
-
95
- //Set the helper position
96
- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
97
- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
98
-
99
- //Rearrange
100
- for (var i = this.items.length - 1; i >= 0; i--) {
101
-
102
- //Cache variables and intersection, continue if no intersection
103
- var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
104
- if (!intersection) continue;
105
-
106
- if(itemElement != this.currentItem[0] //cannot intersect with itself
107
- && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
108
- && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
109
- && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)
110
- //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
111
- ) {
112
-
113
- $(itemElement).mouseenter();
114
-
115
- this.direction = intersection == 1 ? "down" : "up";
116
-
117
- if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
118
- $(itemElement).mouseleave();
119
- this._rearrange(event, item);
120
- } else {
121
- break;
122
- }
123
-
124
- // Clear emtpy ul's/ol's
125
- this._clearEmpty(itemElement);
126
-
127
- this._trigger("change", event, this._uiHash());
128
- break;
129
- }
130
- }
131
-
132
- var parentItem = (this.placeholder[0].parentNode.parentNode &&
133
- $(this.placeholder[0].parentNode.parentNode).closest('.ui-sortable').length)
134
- ? $(this.placeholder[0].parentNode.parentNode)
135
- : null,
136
- level = this._getLevel(this.placeholder),
137
- childLevels = this._getChildLevels(this.helper);
138
-
139
- // To find the previous sibling in the list, keep backtracking until we hit a valid list item.
140
- var previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null;
141
- if (previousItem != null) {
142
- while (previousItem[0].nodeName.toLowerCase() != 'li' || previousItem[0] == this.currentItem[0] || previousItem[0] == this.helper[0]) {
143
- if (previousItem[0].previousSibling) {
144
- previousItem = $(previousItem[0].previousSibling);
145
- } else {
146
- previousItem = null;
147
- break;
148
- }
149
- }
150
- }
151
-
152
- // To find the next sibling in the list, keep stepping forward until we hit a valid list item.
153
- var nextItem = this.placeholder[0].nextSibling ? $(this.placeholder[0].nextSibling) : null;
154
- if (nextItem != null) {
155
- while (nextItem[0].nodeName.toLowerCase() != 'li' || nextItem[0] == this.currentItem[0] || nextItem[0] == this.helper[0]) {
156
- if (nextItem[0].nextSibling) {
157
- nextItem = $(nextItem[0].nextSibling);
158
- } else {
159
- nextItem = null;
160
- break;
161
- }
162
- }
163
- }
164
-
165
- var newList = document.createElement(o.listType);
166
-
167
- this.beyondMaxLevels = 0;
168
-
169
- // If the item is moved to the left, send it to its parent's level unless there are siblings below it.
170
- if (parentItem != null && nextItem == null &&
171
- (o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) ||
172
- !o.rtl && (this.positionAbs.left < parentItem.offset().left))) {
173
- parentItem.after(this.placeholder[0]);
174
- this._clearEmpty(parentItem[0]);
175
- this._trigger("change", event, this._uiHash());
176
- }
177
- // If the item is below a sibling and is moved to the right, make it a child of that sibling.
178
- else if (previousItem != null &&
179
- (o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) ||
180
- !o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) {
181
- this._isAllowed(previousItem, level, level+childLevels+1);
182
- if (!previousItem.children(o.listType).length) {
183
- previousItem[0].appendChild(newList);
184
- }
185
- // If this item is being moved from the top, add it to the top of the list.
186
- if (previousTopOffset && (previousTopOffset <= previousItem.offset().top)) {
187
- previousItem.children(o.listType).prepend(this.placeholder);
188
- }
189
- // Otherwise, add it to the bottom of the list.
190
- else {
191
- previousItem.children(o.listType)[0].appendChild(this.placeholder[0]);
192
- }
193
- this._trigger("change", event, this._uiHash());
194
- }
195
- else {
196
- this._isAllowed(parentItem, level, level+childLevels);
197
- }
198
-
199
- //Post events to containers
200
- this._contactContainers(event);
201
-
202
- //Interconnect with droppables
203
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
204
-
205
- //Call callbacks
206
- this._trigger('sort', event, this._uiHash());
207
-
208
- this.lastPositionAbs = this.positionAbs;
209
- return false;
210
-
211
- },
212
-
213
- _mouseStop: function(event, noPropagation) {
214
-
215
- // If the item is in a position not allowed, send it back
216
- if (this.beyondMaxLevels) {
217
-
218
- this.placeholder.removeClass(this.options.errorClass);
219
-
220
- if (this.domPosition.prev) {
221
- $(this.domPosition.prev).after(this.placeholder);
222
- } else {
223
- $(this.domPosition.parent).prepend(this.placeholder);
224
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
 
226
- this._trigger("revert", event, this._uiHash());
227
 
228
- }
 
 
 
229
 
230
- // Clean last empty ul/ol
231
- for (var i = this.items.length - 1; i >= 0; i--) {
232
- var item = this.items[i].item[0];
233
- this._clearEmpty(item);
234
- }
235
-
236
- $.ui.sortable.prototype._mouseStop.apply(this, arguments);
237
-
238
- },
239
-
240
- serialize: function(options) {
241
-
242
- var o = $.extend({}, this.options, options),
243
- items = this._getItemsAsjQuery(o && o.connected),
244
- str = [];
245
-
246
- $(items).each(function() {
247
- var res = ($(o.item || this).attr(o.attribute || 'id') || '')
248
- .match(o.expression || (/(.+)[-=_](.+)/)),
249
- pid = ($(o.item || this).parent(o.listType)
250
- .parent(o.items)
251
- .attr(o.attribute || 'id') || '')
252
- .match(o.expression || (/(.+)[-=_](.+)/));
253
-
254
- if (res) {
255
- str.push(((o.key || res[1]) + '[' + (o.key && o.expression ? res[1] : res[2]) + ']')
256
- + '='
257
- + (pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID));
258
- }
259
- });
260
-
261
- if(!str.length && o.key) {
262
- str.push(o.key + '=');
263
- }
264
-
265
- return str.join('&');
266
-
267
- },
268
-
269
- toHierarchy: function(options) {
270
-
271
- var o = $.extend({}, this.options, options),
272
- sDepth = o.startDepthCount || 0,
273
- ret = [];
274
-
275
- $(this.element).children(o.items).each(function () {
276
- var level = _recursiveItems(this);
277
- ret.push(level);
278
- });
279
-
280
- return ret;
281
-
282
- function _recursiveItems(item) {
283
- var id = ($(item).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
284
- if (id) {
285
- var currentItem = {"id" : id[2]};
286
- if ($(item).children(o.listType).children(o.items).length > 0) {
287
- currentItem.children = [];
288
- $(item).children(o.listType).children(o.items).each(function() {
289
- var level = _recursiveItems(this);
290
- currentItem.children.push(level);
291
- });
292
- }
293
- return currentItem;
294
- }
295
- }
296
- },
297
-
298
- toArray: function(options) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
 
300
- var o = $.extend({}, this.options, options),
301
- sDepth = o.startDepthCount || 0,
302
- ret = [],
303
- left = 2;
304
 
305
- /*ret.push({
306
- "item_id": o.rootID,
307
- "parent_id": 'none',
308
- "depth": sDepth,
309
- "left": '1',
310
- "right": ($(o.items, this.element).length + 1) * 2
311
- });*/
312
-
313
- $(this.element).children(o.items).each(function () {
314
- left = _recursiveArray(this, sDepth + 1, left);
315
- });
316
-
317
- ret = ret.sort(function(a,b){ return (a.left - b.left); });
318
-
319
- return ret;
320
-
321
- function _recursiveArray(item, depth, left) {
322
-
323
- var right = left + 1,
324
- id,
325
- pid;
326
-
327
- if ($(item).children(o.listType).children(o.items).length > 0) {
328
- depth ++;
329
- $(item).children(o.listType).children(o.items).each(function () {
330
- right = _recursiveArray($(this), depth, right);
331
- });
332
- depth --;
333
- }
334
-
335
- id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/));
336
-
337
- if (depth === sDepth + 1) {
338
- pid = o.rootID;
339
- } else {
340
- var parentItem = ($(item).parent(o.listType)
341
- .parent(o.items)
342
- .attr(o.attribute || 'id'))
343
- .match(o.expression || (/(.+)[-=_](.+)/));
344
- pid = parentItem[2];
345
- }
346
-
347
- if (id) {
348
-
349
- var clause = ($(item).find('.condition:first').hasClass('last_condition')) ? false : $(item).find('input.rule_condition:checked').val().toUpperCase();
350
-
351
- ret.push({"item_id": id[2], "left": left, "right": right, "parent_id": pid, "element":$(item).find('input.wp_all_export_xml_element').val(), "title" : $(item).find('input.wp_all_export_xml_element_title').val(), "condition" : $(item).find('input.wp_all_export_rule').val(), "value" : $(item).find('input.wp_all_export_value').val(), "clause" : clause });
352
- }
353
-
354
- left = right + 1;
355
- return left;
356
- }
357
-
358
- },
359
-
360
- _clearEmpty: function(item) {
361
-
362
- var emptyList = $(item).children(this.options.listType);
363
- if (emptyList.length && !emptyList.children().length) {
364
- emptyList.remove();
365
- }
366
-
367
- },
368
-
369
- _getLevel: function(item) {
370
-
371
- var level = 1;
372
-
373
- if (this.options.listType) {
374
- var list = item.closest(this.options.listType);
375
- while (list && list.length > 0 &&
376
- !list.is('.ui-sortable')) {
377
- level++;
378
- list = list.parent().closest(this.options.listType);
379
- }
380
- }
381
-
382
- return level;
383
- },
384
-
385
- _getChildLevels: function(parent, depth) {
386
- var self = this,
387
- o = this.options,
388
- result = 0;
389
- depth = depth || 0;
390
-
391
- $(parent).children(o.listType).children(o.items).each(function (index, child) {
392
- result = Math.max(self._getChildLevels(child, depth + 1), result);
393
- });
394
-
395
- return depth ? result + 1 : result;
396
- },
397
-
398
- _isAllowed: function(parentItem, level, levels) {
399
- var o = this.options,
400
- isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false,
401
- maxLevels = this.placeholder.closest('.ui-sortable').pmxe_nestedSortable('option', 'maxLevels'); // this takes into account the maxLevels set to the recipient list
402
-
403
- // Is the root protected?
404
- // Are we trying to nest under a no-nest?
405
- // Are we nesting too deep?
406
- if (!o.isAllowed(parentItem, this.placeholder) ||
407
- parentItem && parentItem.hasClass(o.disableNesting) ||
408
- o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) {
409
- this.placeholder.addClass(o.errorClass);
410
- if (maxLevels < levels && maxLevels != 0) {
411
- this.beyondMaxLevels = levels - maxLevels;
412
- } else {
413
- this.beyondMaxLevels = 1;
414
- }
415
- } else {
416
- if (maxLevels < levels && maxLevels != 0) {
417
- this.placeholder.addClass(o.errorClass);
418
- this.beyondMaxLevels = levels - maxLevels;
419
- } else {
420
- this.placeholder.removeClass(o.errorClass);
421
- this.beyondMaxLevels = 0;
422
- }
423
- }
424
- }
425
-
426
- }));
427
-
428
- $.mjs.pmxe_nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.pmxe_nestedSortable.prototype.options);
429
  })(jQuery);
13
 
14
  (function($) {
15
 
16
+ $.widget("mjs.pmxe_nestedSortable", $.extend({}, $.ui.sortable.prototype, {
17
 
18
+ options: {
19
+ tabSize: 20,
20
+ disableNesting: 'mjs-pmxe_nestedSortable-no-nesting',
21
+ errorClass: 'mjs-pmxe_nestedSortable-error',
22
+ listType: 'ol',
23
+ maxLevels: 0,
24
+ protectRoot: false,
25
+ rootID: null,
26
+ rtl: false,
27
+ isAllowed: function(item, parent) { return true; }
28
+ },
29
+
30
+ _create: function() {
31
+ this.element.data('sortable', this.element.data('pmxe_nestedSortable'));
32
+
33
+ if (!this.element.is(this.options.listType))
34
+ throw new Error('pmxe_nestedSortable: Please check the listType option is set to your actual list type');
35
+
36
+ return $.ui.sortable.prototype._create.apply(this, arguments);
37
+ },
38
+
39
+ destroy: function() {
40
+ this.element
41
+ .removeData("pmxe_nestedSortable")
42
+ .unbind(".pmxe_nestedSortable");
43
+ return $.ui.sortable.prototype.destroy.apply(this, arguments);
44
+ },
45
+
46
+ _mouseDrag: function(event) {
47
+
48
+ //Compute the helpers position
49
+ this.position = this._generatePosition(event);
50
+ this.positionAbs = this._convertPositionTo("absolute");
51
+
52
+ if (!this.lastPositionAbs) {
53
+ this.lastPositionAbs = this.positionAbs;
54
+ }
55
+
56
+ //Do scrolling
57
+ if(this.options.scroll) {
58
+ var o = this.options, scrolled = false;
59
+ if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
60
+
61
+ if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
62
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
63
+ else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
64
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
65
+
66
+ if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
67
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
68
+ else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
69
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
70
+
71
+ } else {
72
+
73
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
74
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
75
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
76
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
77
+
78
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
79
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
80
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
81
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
82
+
83
+ }
84
+
85
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
86
+ $.ui.ddmanager.prepareOffsets(this, event);
87
+ }
88
+
89
+ //Regenerate the absolute position used for position checks
90
+ this.positionAbs = this._convertPositionTo("absolute");
91
+
92
+ // Find the top offset before rearrangement,
93
+ var previousTopOffset = this.placeholder.offset().top;
94
+
95
+ //Set the helper position
96
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
97
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
98
+
99
+ //Rearrange
100
+ for (var i = this.items.length - 1; i >= 0; i--) {
101
+
102
+ //Cache variables and intersection, continue if no intersection
103
+ var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
104
+ if (!intersection) continue;
105
+
106
+ if(itemElement != this.currentItem[0] //cannot intersect with itself
107
+ && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
108
+ && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
109
+ && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)
110
+ //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
111
+ ) {
112
+
113
+ $(itemElement).mouseenter();
114
+
115
+ this.direction = intersection == 1 ? "down" : "up";
116
+
117
+ if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
118
+ $(itemElement).mouseleave();
119
+ this._rearrange(event, item);
120
+ } else {
121
+ break;
122
+ }
123
+
124
+ // Clear emtpy ul's/ol's
125
+ this._clearEmpty(itemElement);
126
+
127
+ this._trigger("change", event, this._uiHash());
128
+ break;
129
+ }
130
+ }
131
+
132
+ var parentItem = (this.placeholder[0].parentNode.parentNode &&
133
+ $(this.placeholder[0].parentNode.parentNode).closest('.ui-sortable').length)
134
+ ? $(this.placeholder[0].parentNode.parentNode)
135
+ : null,
136
+ level = this._getLevel(this.placeholder),
137
+ childLevels = this._getChildLevels(this.helper);
138
+
139
+ // To find the previous sibling in the list, keep backtracking until we hit a valid list item.
140
+ var previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null;
141
+ if (previousItem != null) {
142
+ while (previousItem[0].nodeName.toLowerCase() != 'li' || previousItem[0] == this.currentItem[0] || previousItem[0] == this.helper[0]) {
143
+ if (previousItem[0].previousSibling) {
144
+ previousItem = $(previousItem[0].previousSibling);
145
+ } else {
146
+ previousItem = null;
147
+ break;
148
+ }
149
+ }
150
+ }
151
+
152
+ // To find the next sibling in the list, keep stepping forward until we hit a valid list item.
153
+ var nextItem = this.placeholder[0].nextSibling ? $(this.placeholder[0].nextSibling) : null;
154
+ if (nextItem != null) {
155
+ while (nextItem[0].nodeName.toLowerCase() != 'li' || nextItem[0] == this.currentItem[0] || nextItem[0] == this.helper[0]) {
156
+ if (nextItem[0].nextSibling) {
157
+ nextItem = $(nextItem[0].nextSibling);
158
+ } else {
159
+ nextItem = null;
160
+ break;
161
+ }
162
+ }
163
+ }
164
+
165
+ var newList = document.createElement(o.listType);
166
+
167
+ this.beyondMaxLevels = 0;
168
+
169
+ // If the item is moved to the left, send it to its parent's level unless there are siblings below it.
170
+ if (parentItem != null && nextItem == null &&
171
+ (o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) ||
172
+ !o.rtl && (this.positionAbs.left < parentItem.offset().left))) {
173
+ parentItem.after(this.placeholder[0]);
174
+ this._clearEmpty(parentItem[0]);
175
+ this._trigger("change", event, this._uiHash());
176
+ }
177
+ // If the item is below a sibling and is moved to the right, make it a child of that sibling.
178
+ else if (previousItem != null &&
179
+ (o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) ||
180
+ !o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) {
181
+ this._isAllowed(previousItem, level, level+childLevels+1);
182
+ if (!previousItem.children(o.listType).length) {
183
+ previousItem[0].appendChild(newList);
184
+ }
185
+ // If this item is being moved from the top, add it to the top of the list.
186
+ if (previousTopOffset && (previousTopOffset <= previousItem.offset().top)) {
187
+ previousItem.children(o.listType).prepend(this.placeholder);
188
+ }
189
+ // Otherwise, add it to the bottom of the list.
190
+ else {
191
+ previousItem.children(o.listType)[0].appendChild(this.placeholder[0]);
192
+ }
193
+ this._trigger("change", event, this._uiHash());
194
+ }
195
+ else {
196
+ this._isAllowed(parentItem, level, level+childLevels);
197
+ }
198
+
199
+ //Post events to containers
200
+ this._contactContainers(event);
201
+
202
+ //Interconnect with droppables
203
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
204
+
205
+ //Call callbacks
206
+ this._trigger('sort', event, this._uiHash());
207
+
208
+ this.lastPositionAbs = this.positionAbs;
209
+ return false;
210
+
211
+ },
212
+
213
+ _mouseStop: function(event, noPropagation) {
214
+
215
+ // If the item is in a position not allowed, send it back
216
+ if (this.beyondMaxLevels) {
217
+
218
+ this.placeholder.removeClass(this.options.errorClass);
219
+
220
+ if (this.domPosition.prev) {
221
+ $(this.domPosition.prev).after(this.placeholder);
222
+ } else {
223
+ $(this.domPosition.parent).prepend(this.placeholder);
224
+ }
225
+
226
+ this._trigger("revert", event, this._uiHash());
227
+
228
+ }
229
+
230
+ // Clean last empty ul/ol
231
+ for (var i = this.items.length - 1; i >= 0; i--) {
232
+ var item = this.items[i].item[0];
233
+ this._clearEmpty(item);
234
+ }
235
+
236
+ $.ui.sortable.prototype._mouseStop.apply(this, arguments);
237
+
238
+ },
239
+
240
+ serialize: function(options) {
241
+
242
+ var o = $.extend({}, this.options, options),
243
+ items = this._getItemsAsjQuery(o && o.connected),
244
+ str = [];
245
+
246
+ $(items).each(function() {
247
+ var res = ($(o.item || this).attr(o.attribute || 'id') || '')
248
+ .match(o.expression || (/(.+)[-=_](.+)/)),
249
+ pid = ($(o.item || this).parent(o.listType)
250
+ .parent(o.items)
251
+ .attr(o.attribute || 'id') || '')
252
+ .match(o.expression || (/(.+)[-=_](.+)/));
253
+
254
+ if (res) {
255
+ str.push(((o.key || res[1]) + '[' + (o.key && o.expression ? res[1] : res[2]) + ']')
256
+ + '='
257
+ + (pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID));
258
+ }
259
+ });
260
+
261
+ if(!str.length && o.key) {
262
+ str.push(o.key + '=');
263
+ }
264
+
265
+ return str.join('&');
266
+
267
+ },
268
+
269
+ toHierarchy: function(options) {
270
+
271
+ var o = $.extend({}, this.options, options),
272
+ sDepth = o.startDepthCount || 0,
273
+ ret = [];
274
+
275
+ $(this.element).children(o.items).each(function () {
276
+ var level = _recursiveItems(this);
277
+ ret.push(level);
278
+ });
279
+
280
+ return ret;
281
+
282
+ function _recursiveItems(item) {
283
+ var id = ($(item).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
284
+ if (id) {
285
+ var currentItem = {"id" : id[2]};
286
+ if ($(item).children(o.listType).children(o.items).length > 0) {
287
+ currentItem.children = [];
288
+ $(item).children(o.listType).children(o.items).each(function() {
289
+ var level = _recursiveItems(this);
290
+ currentItem.children.push(level);
291
+ });
292
+ }
293
+ return currentItem;
294
+ }
295
+ }
296
+ },
297
 
298
+ toArray: function(options) {
299
 
300
+ var o = $.extend({}, this.options, options),
301
+ sDepth = o.startDepthCount || 0,
302
+ ret = [],
303
+ left = 2;
304
 
305
+ /*ret.push({
306
+ "item_id": o.rootID,
307
+ "parent_id": 'none',
308
+ "depth": sDepth,
309
+ "left": '1',
310
+ "right": ($(o.items, this.element).length + 1) * 2
311
+ });*/
312
+
313
+ $(this.element).children(o.items).each(function () {
314
+ left = _recursiveArray(this, sDepth + 1, left);
315
+ });
316
+
317
+ ret = ret.sort(function(a,b){ return (a.left - b.left); });
318
+
319
+ return ret;
320
+
321
+ function _recursiveArray(item, depth, left) {
322
+
323
+ var right = left + 1,
324
+ id,
325
+ pid;
326
+
327
+ if ($(item).children(o.listType).children(o.items).length > 0) {
328
+ depth ++;
329
+ $(item).children(o.listType).children(o.items).each(function () {
330
+ right = _recursiveArray($(this), depth, right);
331
+ });
332
+ depth --;
333
+ }
334
+
335
+ id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/));
336
+
337
+ if (depth === sDepth + 1) {
338
+ pid = o.rootID;
339
+ } else {
340
+ var parentItem = ($(item).parent(o.listType)
341
+ .parent(o.items)
342
+ .attr(o.attribute || 'id'))
343
+ .match(o.expression || (/(.+)[-=_](.+)/));
344
+ pid = parentItem[2];
345
+ }
346
+
347
+ if (id) {
348
+
349
+ if(($(item).find('.condition:first').hasClass('last_condition')) ? false : $(item).find('input.rule_condition:checked').val()) {
350
+ var clause = ($(item).find('.condition:first').hasClass('last_condition')) ? false : $(item).find('input.rule_condition:checked').val().toUpperCase();
351
+
352
+ ret.push({"item_id": id[2], "left": left, "right": right, "parent_id": pid, "element":$(item).find('input.wp_all_export_xml_element').val(), "title" : $(item).find('input.wp_all_export_xml_element_title').val(), "condition" : $(item).find('input.wp_all_export_rule').val(), "value" : $(item).find('input.wp_all_export_value').val(), "clause" : clause });
353
+ }
354
+ }
355
+
356
+ left = right + 1;
357
+ return left;
358
+ }
359
+
360
+ },
361
+
362
+ _clearEmpty: function(item) {
363
+
364
+ var emptyList = $(item).children(this.options.listType);
365
+ if (emptyList.length && !emptyList.children().length) {
366
+ emptyList.remove();
367
+ }
368
+
369
+ },
370
+
371
+ _getLevel: function(item) {
372
+
373
+ var level = 1;
374
+
375
+ if (this.options.listType) {
376
+ var list = item.closest(this.options.listType);
377
+ while (list && list.length > 0 &&
378
+ !list.is('.ui-sortable')) {
379
+ level++;
380
+ list = list.parent().closest(this.options.listType);
381
+ }
382
+ }
383
+
384
+ return level;
385
+ },
386
+
387
+ _getChildLevels: function(parent, depth) {
388
+ var self = this,
389
+ o = this.options,
390
+ result = 0;
391
+ depth = depth || 0;
392
+
393
+ $(parent).children(o.listType).children(o.items).each(function (index, child) {
394
+ result = Math.max(self._getChildLevels(child, depth + 1), result);
395
+ });
396
+
397
+ return depth ? result + 1 : result;
398
+ },
399
+
400
+ _isAllowed: function(parentItem, level, levels) {
401
+ var o = this.options,
402
+ isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false,
403
+ maxLevels = this.placeholder.closest('.ui-sortable').pmxe_nestedSortable('option', 'maxLevels'); // this takes into account the maxLevels set to the recipient list
404
+
405
+ // Is the root protected?
406
+ // Are we trying to nest under a no-nest?
407
+ // Are we nesting too deep?
408
+ if (!o.isAllowed(parentItem, this.placeholder) ||
409
+ parentItem && parentItem.hasClass(o.disableNesting) ||
410
+ o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) {
411
+ this.placeholder.addClass(o.errorClass);
412
+ if (maxLevels < levels && maxLevels != 0) {
413
+ this.beyondMaxLevels = levels - maxLevels;
414
+ } else {
415
+ this.beyondMaxLevels = 1;
416
+ }
417
+ } else {
418
+ if (maxLevels < levels && maxLevels != 0) {
419
+ this.placeholder.addClass(o.errorClass);
420
+ this.beyondMaxLevels = levels - maxLevels;
421
+ } else {
422
+ this.placeholder.removeClass(o.errorClass);
423
+ this.beyondMaxLevels = 0;
424
+ }
425
+ }
426
+ }
427
 
428
+ }));
 
 
 
429
 
430
+ $.mjs.pmxe_nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.pmxe_nestedSortable.prototype.options);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
  })(jQuery);
wp-all-export.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP All Export
4
  Plugin URI: http://www.wpallimport.com/export/
5
  Description: Export any post type to a CSV or XML file. Edit the exported data, and then re-import it later using WP All Import.
6
- Version: 1.2.1
7
  Author: Soflyy
8
  */
9
 
@@ -59,7 +59,7 @@ else {
59
  */
60
  define('PMXE_PREFIX', 'pmxe_');
61
 
62
- define('PMXE_VERSION', '1.2.1');
63
 
64
  define('PMXE_EDITION', 'free');
65
 
@@ -231,6 +231,8 @@ else {
231
  add_action('admin_init', array($this, 'adminInit'));
232
  add_action('admin_init', array($this, 'fix_db_schema'));
233
  add_action('init', array($this, 'init'));
 
 
234
  }
235
 
236
  /**
@@ -420,7 +422,20 @@ else {
420
  }
421
  }
422
 
423
- /**
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  * Dispatch shorttag: create corresponding controller instance and call its index method
425
  * @param array $args Shortcode tag attributes
426
  * @param string $content Shortcode tag content
@@ -877,3 +892,4 @@ else {
877
  include_once('wpae_api.php');
878
 
879
  }
 
3
  Plugin Name: WP All Export
4
  Plugin URI: http://www.wpallimport.com/export/
5
  Description: Export any post type to a CSV or XML file. Edit the exported data, and then re-import it later using WP All Import.
6
+ Version: 1.2.2
7
  Author: Soflyy
8
  */
9
 
59
  */
60
  define('PMXE_PREFIX', 'pmxe_');
61
 
62
+ define('PMXE_VERSION', '1.2.2');
63
 
64
  define('PMXE_EDITION', 'free');
65
 
231
  add_action('admin_init', array($this, 'adminInit'));
232
  add_action('admin_init', array($this, 'fix_db_schema'));
233
  add_action('init', array($this, 'init'));
234
+ add_action( 'in_plugin_update_message-wp-all-export/wp-all-export.php', array($this, 'wpae_plugin_update_message'), 10, 2 );
235
+
236
  }
237
 
238
  /**
422
  }
423
  }
424
 
425
+ function wpae_plugin_update_message( $data, $response ) {
426
+
427
+ if(version_compare($data['new_version'], '1.2.3') >= 0)
428
+ \_e("<br/><br/><strong>Important</strong> - Read This Before Installing
429
+ <br/><br/>
430
+ Some functionality in WP All Export has been moved to add-ons: WooCommerce Add-On and ACF Add-On. You'll need to install those add-ons to export that data. There's a little more to the story, and you can read all about it here: <a href=\"http://www.wpallimport.com/2018/11/export-add-ons/\" target=\"_blank\">Export Add-Ons</a>
431
+ <br/><br/>
432
+ This version of WP All Export will still export that data with or without the add-ons. However, a future version will completely remove support for exporting WooCommerce and ACF data unless you also have the appropriate add-ons installed.
433
+ <br/><br/>
434
+ Please submit a support request if you run in to any problems: <a href=\"http://www.wpallimport.com/support/\" target=\"_blank\">http://www.wpallimport.com/support/</a>", \PMXE_Plugin::LANGUAGE_DOMAIN);
435
+ }
436
+
437
+
438
+ /**
439
  * Dispatch shorttag: create corresponding controller instance and call its index method
440
  * @param array $args Shortcode tag attributes
441
  * @param string $content Shortcode tag content
892
  include_once('wpae_api.php');
893
 
894
  }
895
+