Export WordPress data to XML/CSV - Version 1.3.8

Version Description

  • improvement: only contact Scheduling service if a Scheduling license is set
  • bug fix: enable use of 's', 'LIKE' and 'NOT LIKE' in WP_Query exports
Download this release

Release Info

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

Code changes from version 1.3.7 to 1.3.8

actions/pmxe_after_export.php CHANGED
@@ -110,12 +110,12 @@ function pmxe_pmxe_after_export($export_id, $export)
110
  if ( $export->options['split_large_exports'] and $splitSize < $export->exported )
111
  {
112
 
113
- $exportOptions['split_files_list'] = array();
114
 
115
  if ( @file_exists($filepath) )
116
- {
117
 
118
- switch ($export->options['export_to'])
119
  {
120
  case 'xml':
121
 
@@ -152,7 +152,7 @@ function pmxe_pmxe_after_export($export_id, $export)
152
 
153
  }
154
 
155
-
156
  $records_count = 0;
157
  $chunk_records_count = 0;
158
  $fileCount = 1;
@@ -204,133 +204,43 @@ function pmxe_pmxe_after_export($export_id, $export)
204
  if (($rowCount % $splitSize) == 0) {
205
  if ($rowCount > 0) {
206
  fclose($out);
207
- }
208
  $outputFile = str_replace(basename($filepath), str_replace('.csv', '', basename($filepath)) . '-' . $fileCount++ . '.csv', $filepath);
209
  if ( ! in_array($outputFile, $exportOptions['split_files_list']))
210
  $exportOptions['split_files_list'][] = $outputFile;
211
 
212
- $out = fopen($outputFile, 'w');
213
- }
214
- if ($data){
215
  if (($rowCount % $splitSize) == 0) {
216
  fputcsv($out, $headers);
217
- }
218
  fputcsv($out, $data);
219
  }
220
  $rowCount++;
221
  }
222
- fclose($in);
223
- fclose($out);
224
-
225
- // convert splitted files into XLS format
226
- if ( ! empty($exportOptions['split_files_list']) && ! empty($export->options['export_to_sheet']) and $export->options['export_to_sheet'] != 'csv' )
227
- {
228
- require_once PMXE_Plugin::ROOT_DIR . '/classes/PHPExcel/IOFactory.php';
229
-
230
- foreach ($exportOptions['split_files_list'] as $key => $file)
231
- {
232
- $objReader = PHPExcel_IOFactory::createReader('CSV');
233
- // If the files uses a delimiter other than a comma (e.g. a tab), then tell the reader
234
- $objReader->setDelimiter($export->options['delimiter']);
235
- // If the files uses an encoding other than UTF-8 or ASCII, then tell the reader
236
- $objPHPExcel = $objReader->load($file);
237
- switch ($export->options['export_to_sheet']){
238
- case 'xls':
239
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
240
- $objWriter->save(str_replace(".csv", ".xls", $file));
241
- $exportOptions['split_files_list'][$key] = str_replace(".csv", ".xls", $file);
242
- break;
243
- case 'xlsx':
244
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
245
- $objWriter->save(str_replace(".csv", ".xlsx", $file));
246
- $exportOptions['split_files_list'][$key] = str_replace(".csv", ".xlsx", $file);
247
- break;
248
- }
249
- @unlink($file);
250
- }
251
- }
252
 
253
  break;
254
-
255
  default:
256
-
257
  break;
258
- }
259
 
260
  $export->set(array('options' => $exportOptions))->save();
261
- }
262
- }
263
-
264
- // convert CSV to XLS
265
- if ( @file_exists($filepath) and $export->options['export_to'] == 'csv' && ! empty($export->options['export_to_sheet']) and $export->options['export_to_sheet'] != 'csv')
266
- {
267
-
268
- require_once PMXE_Plugin::ROOT_DIR . '/classes/PHPExcel/IOFactory.php';
269
-
270
- $objReader = PHPExcel_IOFactory::createReader('CSV');
271
- // If the files uses a delimiter other than a comma (e.g. a tab), then tell the reader
272
- $objReader->setDelimiter($export->options['delimiter']);
273
- // If the files uses an encoding other than UTF-8 or ASCII, then tell the reader
274
-
275
- $objPHPExcel = $objReader->load($filepath);
276
-
277
- switch ($export->options['export_to_sheet']) {
278
- case 'xls':
279
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
280
- $objWriter->save(str_replace(".csv", ".xls", $filepath));
281
- @unlink($filepath);
282
- $filepath = str_replace(".csv", ".xls", $filepath);
283
- break;
284
- case 'xlsx':
285
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
286
- $objWriter->save(str_replace(".csv", ".xlsx", $filepath));
287
- @unlink($filepath);
288
- $filepath = str_replace(".csv", ".xlsx", $filepath);
289
- break;
290
- }
291
-
292
- $exportOptions = $export->options;
293
- $exportOptions['filepath'] = wp_all_export_get_relative_path($filepath);
294
- $export->set(array('options' => $exportOptions))->save();
295
-
296
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
297
-
298
- if ( ! $is_secure_import ){
299
- $wp_uploads = wp_upload_dir();
300
- $wp_filetype = wp_check_filetype(basename($filepath), null );
301
- $attachment_data = array(
302
- 'guid' => $wp_uploads['baseurl'] . '/' . _wp_relative_upload_path( $filepath ),
303
- 'post_mime_type' => $wp_filetype['type'],
304
- 'post_title' => preg_replace('/\.[^.]+$/', '', basename($filepath)),
305
- 'post_content' => '',
306
- 'post_status' => 'inherit'
307
- );
308
- if ( ! empty($export->attch_id) )
309
- {
310
- $attach_id = $export->attch_id;
311
- $attachment = get_post($attach_id);
312
- if ($attachment)
313
- {
314
- update_attached_file( $attach_id, $filepath );
315
- wp_update_attachment_metadata( $attach_id, $attachment_data );
316
- }
317
- else
318
- {
319
- $attach_id = wp_insert_attachment( $attachment_data, PMXE_Plugin::$session->file );
320
- }
321
- }
322
  }
323
-
324
  }
325
 
326
  // make a temporary copy of current file
327
  if ( empty($export->parent_id) and @file_exists($filepath) and @copy($filepath, str_replace(basename($filepath), '', $filepath) . 'current-' . basename($filepath)))
328
  {
329
  $exportOptions = $export->options;
330
- $exportOptions['current_filepath'] = str_replace(basename($filepath), '', $filepath) . 'current-' . basename($filepath);
331
  $export->set(array('options' => $exportOptions))->save();
332
  }
333
-
334
  $generateBundle = apply_filters('wp_all_export_generate_bundle', true);
335
 
336
  if($generateBundle) {
@@ -349,69 +259,10 @@ function pmxe_pmxe_after_export($export_id, $export)
349
  }
350
  }
351
 
352
-
353
- // send exported data to zapier.com
354
- $subscriptions = get_option('zapier_subscribe', array());
355
- if ( ! empty($subscriptions) and empty($export->parent_id))
356
- {
357
-
358
- $wp_uploads = wp_upload_dir();
359
-
360
- $fileurl = str_replace($wp_uploads['basedir'], $wp_uploads['baseurl'], $filepath);
361
-
362
- $response = array(
363
- 'website_url' => home_url(),
364
- 'export_id' => $export->id,
365
- 'export_name' => $export->friendly_name,
366
- 'file_name' => basename($filepath),
367
- 'file_type' => wp_all_export_get_export_format($export->options),
368
- 'post_types_exported' => empty($export->options['cpt']) ? $export->options['wp_query'] : implode($export->options['cpt'], ','),
369
- 'export_created_date' => $export->registered_on,
370
- 'export_last_run_date' => date('Y-m-d H:i:s'),
371
- 'export_trigger_type' => empty($_GET['export_key']) ? 'manual' : 'cron',
372
- 'records_exported' => $export->exported,
373
- 'export_file' => ''
374
- );
375
-
376
- if (file_exists($filepath))
377
- {
378
- $response['export_file_url'] = $fileurl;
379
- $response['status'] = 200;
380
- $response['message'] = 'OK';
381
- }
382
- else
383
- {
384
- $response['export_file_url'] = '';
385
- $response['status'] = 300;
386
- $response['message'] = 'File doesn\'t exist';
387
- }
388
-
389
- $response = apply_filters('wp_all_export_zapier_response', $response);
390
-
391
- foreach ($subscriptions as $zapier)
392
- {
393
- if (empty($zapier['target_url'])) continue;
394
-
395
- wp_remote_post( $zapier['target_url'], array(
396
- 'method' => 'POST',
397
- 'timeout' => 45,
398
- 'redirection' => 5,
399
- 'httpversion' => '1.0',
400
- 'blocking' => true,
401
- 'headers' => array(
402
- 'Content-Type' => 'application/json'
403
- ),
404
- 'body' => "[".json_encode($response)."]",
405
- 'cookies' => array()
406
- )
407
- );
408
- }
409
- }
410
-
411
- // clean session
412
  if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
413
  {
414
- PMXE_Plugin::$session->clean_session( $export->id );
415
  }
416
- }
417
  }
110
  if ( $export->options['split_large_exports'] and $splitSize < $export->exported )
111
  {
112
 
113
+ $exportOptions['split_files_list'] = array();
114
 
115
  if ( @file_exists($filepath) )
116
+ {
117
 
118
+ switch ($export->options['export_to'])
119
  {
120
  case 'xml':
121
 
152
 
153
  }
154
 
155
+
156
  $records_count = 0;
157
  $chunk_records_count = 0;
158
  $fileCount = 1;
204
  if (($rowCount % $splitSize) == 0) {
205
  if ($rowCount > 0) {
206
  fclose($out);
207
+ }
208
  $outputFile = str_replace(basename($filepath), str_replace('.csv', '', basename($filepath)) . '-' . $fileCount++ . '.csv', $filepath);
209
  if ( ! in_array($outputFile, $exportOptions['split_files_list']))
210
  $exportOptions['split_files_list'][] = $outputFile;
211
 
212
+ $out = fopen($outputFile, 'w');
213
+ }
214
+ if ($data){
215
  if (($rowCount % $splitSize) == 0) {
216
  fputcsv($out, $headers);
217
+ }
218
  fputcsv($out, $data);
219
  }
220
  $rowCount++;
221
  }
222
+ fclose($in);
223
+ fclose($out);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
 
225
  break;
226
+
227
  default:
228
+
229
  break;
230
+ }
231
 
232
  $export->set(array('options' => $exportOptions))->save();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  }
 
234
  }
235
 
236
  // make a temporary copy of current file
237
  if ( empty($export->parent_id) and @file_exists($filepath) and @copy($filepath, str_replace(basename($filepath), '', $filepath) . 'current-' . basename($filepath)))
238
  {
239
  $exportOptions = $export->options;
240
+ $exportOptions['current_filepath'] = str_replace(basename($filepath), '', $filepath) . 'current-' . basename($filepath);
241
  $export->set(array('options' => $exportOptions))->save();
242
  }
243
+
244
  $generateBundle = apply_filters('wp_all_export_generate_bundle', true);
245
 
246
  if($generateBundle) {
259
  }
260
  }
261
 
262
+ // clean session
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
264
  {
265
+ PMXE_Plugin::$session->clean_session( $export->id );
266
  }
267
+ }
268
  }
actions/wp_ajax_save_scheduling.php CHANGED
@@ -10,11 +10,11 @@ function pmxe_wp_ajax_save_scheduling()
10
  {
11
 
12
  if (!check_ajax_referer('wp_all_export_secure', 'security', false)) {
13
- exit(__('Security check', 'wp_all_export_plugin'));
14
  }
15
 
16
  if (!current_user_can(PMXE_Plugin::$capabilities)) {
17
- exit(__('Security check', 'wp_all_export_plugin'));
18
  }
19
 
20
  $elementId = $_POST['element_id'];
10
  {
11
 
12
  if (!check_ajax_referer('wp_all_export_secure', 'security', false)) {
13
+ exit(esc_html__('Security check', 'wp_all_export_plugin'));
14
  }
15
 
16
  if (!current_user_can(PMXE_Plugin::$capabilities)) {
17
+ exit(esc_html__('Security check', 'wp_all_export_plugin'));
18
  }
19
 
20
  $elementId = $_POST['element_id'];
actions/wp_ajax_scheduling_dialog_content.php CHANGED
@@ -4,11 +4,11 @@ function pmxe_wp_ajax_scheduling_dialog_content()
4
  {
5
 
6
  if (!check_ajax_referer('wp_all_export_secure', 'security', false)) {
7
- exit(json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))));
8
  }
9
 
10
  if (!current_user_can(PMXE_Plugin::$capabilities)) {
11
- exit(json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))));
12
  }
13
 
14
  $export_id = $_POST['id'];
@@ -17,7 +17,7 @@ function pmxe_wp_ajax_scheduling_dialog_content()
17
  if (!$export) {
18
  throw new Exception('Export not found');
19
  }
20
- $post = $export->options;
21
 
22
  $hasActiveLicense = PMXE_Plugin::hasActiveSchedulingLicense();
23
 
@@ -27,20 +27,20 @@ function pmxe_wp_ajax_scheduling_dialog_content()
27
 
28
  $cron_job_key = PMXE_Plugin::getInstance()->getOption('cron_job_key');
29
 
30
- if (!isset($post['scheduling_enable'])) {
31
- $post['scheduling_enable'] = 0;
32
  }
33
 
34
- if (!isset($post['scheduling_timezone'])) {
35
- $post['scheduling_timezone'] = 'UTC';
36
  }
37
 
38
- if (!isset($post['scheduling_run_on'])) {
39
- $post['scheduling_run_on'] = 'weekly';
40
  }
41
 
42
- if (!isset($post['scheduling_times'])) {
43
- $post['scheduling_times'] = array();
44
  }
45
  ?>
46
 
@@ -195,7 +195,7 @@ function pmxe_wp_ajax_scheduling_dialog_content()
195
 
196
  #add-subscription-field {
197
  position: absolute;
198
- left: -155px;
199
  top: -1px;
200
  height: 46px;
201
  border-radius: 5px;
@@ -248,10 +248,15 @@ function pmxe_wp_ajax_scheduling_dialog_content()
248
  .manual-scheduling {
249
  margin-left: 26px;
250
  }
 
251
  .chosen-container .chosen-results {
252
 
253
  margin: 0 4px 4px 0 !important;
254
  }
 
 
 
 
255
  </style>
256
 
257
 
@@ -270,6 +275,23 @@ function pmxe_wp_ajax_scheduling_dialog_content()
270
  }
271
  }
272
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  window.pmxeValidateSchedulingForm = function () {
274
 
275
  var schedulingEnabled = $('input[name="scheduling_enable"]:checked').val() == 1;
@@ -426,7 +448,7 @@ function pmxe_wp_ajax_scheduling_dialog_content()
426
  if (!hasActiveLicense) {
427
  if (!$(this).data('iunderstand') && schedulingEnable) {
428
  $('#no-subscription').slideDown();
429
- $(this).find('.save-text').html('<?php echo _e('I Understand');?>');
430
  $(this).find('.save-text').css('left', '100px');
431
  $(this).data('iunderstand', 1);
432
 
@@ -490,18 +512,18 @@ function pmxe_wp_ajax_scheduling_dialog_content()
490
  });
491
  });
492
 
493
- <?php if($post['scheduling_timezone'] == 'UTC') {
494
  ?>
495
  var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
496
 
497
- if($('#timezone').find("option:contains('"+ timeZone +"')").length != 0){
498
  $('#timezone').trigger("chosen:updated");
499
  $('#timezone').val(timeZone);
500
  $('#timezone').trigger("chosen:updated");
501
- }else{
502
  var parts = timeZone.split('/');
503
- var lastPart = parts[parts.length-1];
504
- var opt = $('#timezone').find("option:contains('"+ lastPart +"')");
505
 
506
  $('#timezone').val(opt.val());
507
  $('#timezone').trigger("chosen:updated");
@@ -537,7 +559,7 @@ function pmxe_wp_ajax_scheduling_dialog_content()
537
 
538
  var license = $('#add-subscription-field').val();
539
  $.ajax({
540
- url: ajaxurl + '?action=wpae_api&q=schedulingLicense/saveSchedulingLicense&security=<?php echo wp_create_nonce("wp_all_export_secure");?>',
541
  type: "POST",
542
  data: {
543
  license: license
@@ -579,7 +601,7 @@ function pmxe_wp_ajax_scheduling_dialog_content()
579
 
580
  setTimeout(function () {
581
  $('#add-subscription-field').animate({width: '140px'}, 225);
582
- $('#add-subscription-field').animate({left: '-155px'}, 225);
583
  }, 300);
584
 
585
  $('#add-subscription-field').val('');
@@ -635,25 +657,26 @@ function pmxe_wp_ajax_scheduling_dialog_content()
635
  </script>
636
  <?php require __DIR__ . '/../src/Scheduling/views/CommonJs.php'; ?>
637
  <div id="post-preview" class="wpallexport-preview wpallexport-scheduling-dialog">
638
- <p class="wpallexport-preview-title"><strong>Scheduling Options</strong></p>
 
639
  <div class="wpallexport-preview-content" style="max-height: 700px; overflow: visible;">
640
 
641
  <div style="margin-bottom: 20px;">
642
  <label>
643
  <input type="radio" name="scheduling_enable"
644
- value="0" <?php if ((isset($post['scheduling_enable']) && $post['scheduling_enable'] == 0) || !isset($post['scheduling_enable'])) { ?> checked="checked" <?php } ?>/>
645
  <h4 style="display: inline-block;"><?php esc_html_e('Do Not Schedule'); ?></h4>
646
  </label>
647
  </div>
648
  <div>
649
  <label>
650
  <input type="radio" name="scheduling_enable"
651
- value="1" <?php if ($post['scheduling_enable'] == 1) { ?> checked="checked" <?php } ?>/>
652
  <h4 style="margin: 0; display: inline-flex; align-items: center;"><?php esc_html_e('Automatic Scheduling', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
653
  <span class="connection-icon" style="margin-left: 8px; height: 16px;">
654
- <?php include __DIR__ . '/../src/Scheduling/views/ConnectionIcon.php'; ?>
655
- </span>
656
- <?php if($post['scheduling_enable'] == 1) { ?>
657
  <?php if (!$scheduling->checkConnection()) { ?>
658
  <span class="wpai-license" style="margin-left: 8px; font-weight: normal; font-weight: normal; <?php if(!$hasActiveLicense) { ?> display: none; <?php }?>"><span class="unable-to-connect">Unable to connect, please contact support.</span></span>
659
  <?php } ?>
@@ -668,27 +691,28 @@ function pmxe_wp_ajax_scheduling_dialog_content()
668
  </label>
669
  </div>
670
  <div id="automatic-scheduling"
671
- style="margin-left: 21px; <?php if ($post['scheduling_enable'] != 1) { ?> display: none; <?php } ?>">
672
  <div>
673
  <div class="input">
674
  <label style="color: rgb(68,68,68);">
675
  <input
676
- type="radio" <?php if (isset($post['scheduling_run_on']) && $post['scheduling_run_on'] != 'monthly') { ?> checked="checked" <?php } ?>
677
  name="scheduling_run_on" value="weekly"
678
  checked="checked"/> <?php esc_html_e('Every week on...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
679
  </label>
680
  </div>
681
  <input type="hidden" style="width: 500px;" name="scheduling_weekly_days"
682
- value="<?php echo esc_attr($post['scheduling_weekly_days']); ?>" id="weekly_days"/>
 
683
  <?php
684
- if (isset($post['scheduling_weekly_days'])) {
685
- $weeklyArray = explode(',', $post['scheduling_weekly_days']);
686
  } else {
687
  $weeklyArray = array();
688
  }
689
  ?>
690
  <ul class="days-of-week" id="weekly"
691
- style="<?php if ($post['scheduling_run_on'] == 'monthly') { ?> display: none; <?php } ?>">
692
  <li data-day="0" <?php if (in_array('0', $weeklyArray)) { ?> class="selected" <?php } ?>>
693
  Mon
694
  </li>
@@ -717,22 +741,23 @@ function pmxe_wp_ajax_scheduling_dialog_content()
717
  <div class="input">
718
  <label style="color: rgb(68,68,68); margin-top: 5px;">
719
  <input
720
- type="radio" <?php if (isset($post['scheduling_run_on']) && $post['scheduling_run_on'] == 'monthly') { ?> checked="checked" <?php } ?>
721
  name="scheduling_run_on"
722
  value="monthly"/> <?php esc_html_e('Every month on the first...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
723
  </label>
724
  </div>
725
  <input type="hidden" name="scheduling_monthly_days"
726
- value="<?php if(isset($post['scheduling_monthly_days'])) echo esc_attr($post['scheduling_monthly_days']); ?>" id="monthly_days"/>
 
727
  <?php
728
- if (isset($post['scheduling_monthly_days'])) {
729
- $monthlyArray = explode(',', $post['scheduling_monthly_days']);
730
  } else {
731
  $monthlyArray = array();
732
  }
733
  ?>
734
  <ul class="days-of-week" id="monthly"
735
- style="<?php if ($post['scheduling_run_on'] != 'monthly') { ?> display: none; <?php } ?>">
736
  <li data-day="0" <?php if (in_array('0', $monthlyArray)) { ?> class="selected" <?php } ?>>
737
  Mon
738
  </li>
@@ -764,8 +789,8 @@ function pmxe_wp_ajax_scheduling_dialog_content()
764
  </div>
765
 
766
  <div id="times" style="margin-bottom: 10px;">
767
- <?php if (isset($post['scheduling_times']) && is_array($post['scheduling_times'])) {
768
- foreach ($post['scheduling_times'] as $time) { ?>
769
 
770
  <?php if ($time) { ?>
771
  <input class="timepicker" type="text" name="scheduling_times[]"
@@ -780,8 +805,8 @@ function pmxe_wp_ajax_scheduling_dialog_content()
780
  <?php
781
 
782
  $timezoneValue = false;
783
- if ($post['scheduling_timezone']) {
784
- $timezoneValue = $post['scheduling_timezone'];
785
  }
786
 
787
  $timezoneSelect = new \Wpae\Scheduling\Timezone\TimezoneSelect();
@@ -831,7 +856,7 @@ function pmxe_wp_ajax_scheduling_dialog_content()
831
  <p><?php esc_html_e('Get automatic scheduling for unlimited sites, just $9/mo.'); ?></p>
832
  <p><?php esc_html_e('Have a license?'); ?>
833
  <a href="#"
834
- id="add-subscription"><?php esc_html_e('Register this site.'); ?></a> <?php _e('Questions?'); ?>
835
  <a href="#" class="help_scheduling">Read more.</a>
836
  </p>
837
  <input type="password" id="add-subscription-field"
4
  {
5
 
6
  if (!check_ajax_referer('wp_all_export_secure', 'security', false)) {
7
+ exit(json_encode(array('html' => esc_html__('Security check', 'wp_all_export_plugin'))));
8
  }
9
 
10
  if (!current_user_can(PMXE_Plugin::$capabilities)) {
11
+ exit(json_encode(array('html' => esc_html__('Security check', 'wp_all_export_plugin'))));
12
  }
13
 
14
  $export_id = $_POST['id'];
17
  if (!$export) {
18
  throw new Exception('Export not found');
19
  }
20
+ $schedulingExportOptions = $export->options;
21
 
22
  $hasActiveLicense = PMXE_Plugin::hasActiveSchedulingLicense();
23
 
27
 
28
  $cron_job_key = PMXE_Plugin::getInstance()->getOption('cron_job_key');
29
 
30
+ if (!isset($schedulingExportOptions['scheduling_enable'])) {
31
+ $schedulingExportOptions['scheduling_enable'] = 0;
32
  }
33
 
34
+ if (!isset($schedulingExportOptions['scheduling_timezone'])) {
35
+ $schedulingExportOptions['scheduling_timezone'] = 'UTC';
36
  }
37
 
38
+ if (!isset($schedulingExportOptions['scheduling_run_on'])) {
39
+ $schedulingExportOptions['scheduling_run_on'] = 'weekly';
40
  }
41
 
42
+ if (!isset($schedulingExportOptions['scheduling_times'])) {
43
+ $schedulingExportOptions['scheduling_times'] = array();
44
  }
45
  ?>
46
 
195
 
196
  #add-subscription-field {
197
  position: absolute;
198
+ left: -152px;
199
  top: -1px;
200
  height: 46px;
201
  border-radius: 5px;
248
  .manual-scheduling {
249
  margin-left: 26px;
250
  }
251
+
252
  .chosen-container .chosen-results {
253
 
254
  margin: 0 4px 4px 0 !important;
255
  }
256
+
257
+ .unable-to-connect {
258
+ color: #f2b03d;
259
+ }
260
  </style>
261
 
262
 
275
  }
276
  }
277
 
278
+ updateSaveButtonState = function() {
279
+ var howToRun = $('input[name="scheduling_enable"]:checked').val();
280
+
281
+ if(parseInt(howToRun) === 1 && !hasActiveLicense) {
282
+ $('.save-changes').addClass('disabled');
283
+ } else {
284
+ $('.save-changes').removeClass('disabled');
285
+ }
286
+ };
287
+
288
+ updateSaveButtonState();
289
+
290
+ $('input[name="scheduling_enable"]').change(function(){
291
+ updateSaveButtonState();
292
+ });
293
+
294
+
295
  window.pmxeValidateSchedulingForm = function () {
296
 
297
  var schedulingEnabled = $('input[name="scheduling_enable"]:checked').val() == 1;
448
  if (!hasActiveLicense) {
449
  if (!$(this).data('iunderstand') && schedulingEnable) {
450
  $('#no-subscription').slideDown();
451
+ $(this).find('.save-text').html('<?php esc_html_e('I Understand');?>');
452
  $(this).find('.save-text').css('left', '100px');
453
  $(this).data('iunderstand', 1);
454
 
512
  });
513
  });
514
 
515
+ <?php if($schedulingExportOptions['scheduling_timezone'] == 'UTC') {
516
  ?>
517
  var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
518
 
519
+ if ($('#timezone').find("option:contains('" + timeZone + "')").length != 0) {
520
  $('#timezone').trigger("chosen:updated");
521
  $('#timezone').val(timeZone);
522
  $('#timezone').trigger("chosen:updated");
523
+ } else {
524
  var parts = timeZone.split('/');
525
+ var lastPart = parts[parts.length - 1];
526
+ var opt = $('#timezone').find("option:contains('" + lastPart + "')");
527
 
528
  $('#timezone').val(opt.val());
529
  $('#timezone').trigger("chosen:updated");
559
 
560
  var license = $('#add-subscription-field').val();
561
  $.ajax({
562
+ url: ajaxurl + '?action=wpae_api&q=schedulingLicense/saveSchedulingLicense&security=<?php echo esc_js(wp_create_nonce("wp_all_export_secure"));?>',
563
  type: "POST",
564
  data: {
565
  license: license
601
 
602
  setTimeout(function () {
603
  $('#add-subscription-field').animate({width: '140px'}, 225);
604
+ $('#add-subscription-field').animate({left: '-152px'}, 225);
605
  }, 300);
606
 
607
  $('#add-subscription-field').val('');
657
  </script>
658
  <?php require __DIR__ . '/../src/Scheduling/views/CommonJs.php'; ?>
659
  <div id="post-preview" class="wpallexport-preview wpallexport-scheduling-dialog">
660
+ <p class="wpallexport-preview-title"><strong>Scheduling Options for Export ID
661
+ #<?php echo intval($export_id); ?></strong></p>
662
  <div class="wpallexport-preview-content" style="max-height: 700px; overflow: visible;">
663
 
664
  <div style="margin-bottom: 20px;">
665
  <label>
666
  <input type="radio" name="scheduling_enable"
667
+ value="0" <?php if ((isset($schedulingExportOptions['scheduling_enable']) && $schedulingExportOptions['scheduling_enable'] == 0) || !isset($schedulingExportOptions['scheduling_enable'])) { ?> checked="checked" <?php } ?>/>
668
  <h4 style="display: inline-block;"><?php esc_html_e('Do Not Schedule'); ?></h4>
669
  </label>
670
  </div>
671
  <div>
672
  <label>
673
  <input type="radio" name="scheduling_enable"
674
+ value="1" <?php if ($schedulingExportOptions['scheduling_enable'] == 1) { ?> checked="checked" <?php } ?>/>
675
  <h4 style="margin: 0; display: inline-flex; align-items: center;"><?php esc_html_e('Automatic Scheduling', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
676
  <span class="connection-icon" style="margin-left: 8px; height: 16px;">
677
+ <?php include __DIR__ . '/../src/Scheduling/views/ConnectionIcon.php'; ?>
678
+ </span>
679
+ <?php if($schedulingExportOptions['scheduling_enable'] == 1) { ?>
680
  <?php if (!$scheduling->checkConnection()) { ?>
681
  <span class="wpai-license" style="margin-left: 8px; font-weight: normal; font-weight: normal; <?php if(!$hasActiveLicense) { ?> display: none; <?php }?>"><span class="unable-to-connect">Unable to connect, please contact support.</span></span>
682
  <?php } ?>
691
  </label>
692
  </div>
693
  <div id="automatic-scheduling"
694
+ style="margin-left: 21px; <?php if ($schedulingExportOptions['scheduling_enable'] != 1) { ?> display: none; <?php } ?>">
695
  <div>
696
  <div class="input">
697
  <label style="color: rgb(68,68,68);">
698
  <input
699
+ type="radio" <?php if (isset($schedulingExportOptions['scheduling_run_on']) && $schedulingExportOptions['scheduling_run_on'] != 'monthly') { ?> checked="checked" <?php } ?>
700
  name="scheduling_run_on" value="weekly"
701
  checked="checked"/> <?php esc_html_e('Every week on...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
702
  </label>
703
  </div>
704
  <input type="hidden" style="width: 500px;" name="scheduling_weekly_days"
705
+ value="<?php echo esc_attr($schedulingExportOptions['scheduling_weekly_days']); ?>"
706
+ id="weekly_days"/>
707
  <?php
708
+ if (isset($schedulingExportOptions['scheduling_weekly_days'])) {
709
+ $weeklyArray = explode(',', $schedulingExportOptions['scheduling_weekly_days']);
710
  } else {
711
  $weeklyArray = array();
712
  }
713
  ?>
714
  <ul class="days-of-week" id="weekly"
715
+ style="<?php if ($schedulingExportOptions['scheduling_run_on'] == 'monthly') { ?> display: none; <?php } ?>">
716
  <li data-day="0" <?php if (in_array('0', $weeklyArray)) { ?> class="selected" <?php } ?>>
717
  Mon
718
  </li>
741
  <div class="input">
742
  <label style="color: rgb(68,68,68); margin-top: 5px;">
743
  <input
744
+ type="radio" <?php if (isset($schedulingExportOptions['scheduling_run_on']) && $schedulingExportOptions['scheduling_run_on'] == 'monthly') { ?> checked="checked" <?php } ?>
745
  name="scheduling_run_on"
746
  value="monthly"/> <?php esc_html_e('Every month on the first...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
747
  </label>
748
  </div>
749
  <input type="hidden" name="scheduling_monthly_days"
750
+ value="<?php if (isset($schedulingExportOptions['scheduling_monthly_days'])) echo esc_attr($schedulingExportOptions['scheduling_monthly_days']); ?>"
751
+ id="monthly_days"/>
752
  <?php
753
+ if (isset($schedulingExportOptions['scheduling_monthly_days'])) {
754
+ $monthlyArray = explode(',', $schedulingExportOptions['scheduling_monthly_days']);
755
  } else {
756
  $monthlyArray = array();
757
  }
758
  ?>
759
  <ul class="days-of-week" id="monthly"
760
+ style="<?php if ($schedulingExportOptions['scheduling_run_on'] != 'monthly') { ?> display: none; <?php } ?>">
761
  <li data-day="0" <?php if (in_array('0', $monthlyArray)) { ?> class="selected" <?php } ?>>
762
  Mon
763
  </li>
789
  </div>
790
 
791
  <div id="times" style="margin-bottom: 10px;">
792
+ <?php if (isset($schedulingExportOptions['scheduling_times']) && is_array($schedulingExportOptions['scheduling_times'])) {
793
+ foreach ($schedulingExportOptions['scheduling_times'] as $time) { ?>
794
 
795
  <?php if ($time) { ?>
796
  <input class="timepicker" type="text" name="scheduling_times[]"
805
  <?php
806
 
807
  $timezoneValue = false;
808
+ if ($schedulingExportOptions['scheduling_timezone']) {
809
+ $timezoneValue = $schedulingExportOptions['scheduling_timezone'];
810
  }
811
 
812
  $timezoneSelect = new \Wpae\Scheduling\Timezone\TimezoneSelect();
856
  <p><?php esc_html_e('Get automatic scheduling for unlimited sites, just $9/mo.'); ?></p>
857
  <p><?php esc_html_e('Have a license?'); ?>
858
  <a href="#"
859
+ id="add-subscription"><?php esc_html_e('Register this site.'); ?></a> <?php esc_html_e('Questions?'); ?>
860
  <a href="#" class="help_scheduling">Read more.</a>
861
  </p>
862
  <input type="password" id="add-subscription-field"
actions/wp_ajax_wpae_filtering_count.php CHANGED
@@ -130,6 +130,15 @@ function pmxe_wp_ajax_wpae_filtering_count()
130
  add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
131
 
132
  $exportQuery = eval('return new WP_Query(array(' . PMXE_Plugin::$session->get('wp_query') . ', \'offset\' => 0, \'posts_per_page\' => 10 ));');
 
 
 
 
 
 
 
 
 
133
  if (!empty($exportQuery->found_posts)) {
134
  $foundRecords = $exportQuery->found_posts;
135
  }
130
  add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
131
 
132
  $exportQuery = eval('return new WP_Query(array(' . PMXE_Plugin::$session->get('wp_query') . ', \'offset\' => 0, \'posts_per_page\' => 10 ));');
133
+
134
+ // Clear LIKE, NOT LIKE, and 's' percent placeholders for request and orderby.
135
+ global $wpdb;
136
+ $exportQuery->request = $wpdb->remove_placeholder_escape($exportQuery->request);
137
+
138
+ foreach( $exportQuery->query_vars['search_orderby_title'] as $key => $value ){
139
+ $exportQuery->query_vars['search_orderby_title'][$key] = $wpdb->remove_placeholder_escape($value);
140
+ }
141
+
142
  if (!empty($exportQuery->found_posts)) {
143
  $foundRecords = $exportQuery->found_posts;
144
  }
config/options.php CHANGED
@@ -4,7 +4,7 @@
4
  * and can be changed by corresponding WordPress function calls
5
  */
6
  $config = array(
7
- "info_api_url" => "http://www.wpallimport.com",
8
  "dismiss" => 0,
9
  "dismiss_manage_top" => 0,
10
  "dismiss_manage_bottom" => 0,
4
  * and can be changed by corresponding WordPress function calls
5
  */
6
  $config = array(
7
+ "info_api_url" => "https://www.wpallimport.com",
8
  "dismiss" => 0,
9
  "dismiss_manage_top" => 0,
10
  "dismiss_manage_bottom" => 0,
libraries/XmlExportCustomRecord.php CHANGED
@@ -35,7 +35,7 @@ if (!class_exists('XmlExportCustomRecord')) {
35
  }
36
  }
37
 
38
- public static function prepare_data($record, $exportOptions, $xmlWriter = false, $implode_delimiter, $preview) {
39
  $article = array();
40
 
41
  if (wp_all_export_is_compatible() && isset($exportOptions['is_generate_import']) && $exportOptions['is_generate_import'] && $exportOptions['import_id']) {
35
  }
36
  }
37
 
38
+ public static function prepare_data($record, $exportOptions, $xmlWriter, $implode_delimiter, $preview) {
39
  $article = array();
40
 
41
  if (wp_all_export_is_compatible() && isset($exportOptions['is_generate_import']) && $exportOptions['is_generate_import'] && $exportOptions['import_id']) {
libraries/XmlExportMediaGallery.php CHANGED
@@ -282,7 +282,7 @@ final class XmlExportMediaGallery
282
  break;
283
  case 'image_title':
284
  $field_options = json_decode($options['cc_options'][$ID], true);
285
- if ( (int) $field_options['is_export_featured'] == (int) self::$is_include_feature_meta && (int) $field_options['is_export_attached'] == (int) self::$is_include_gallery_meta )
286
  {
287
  $templateOptions['set_image_meta_title'] = 1;
288
  $templateOptions['image_meta_title_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
@@ -296,7 +296,7 @@ final class XmlExportMediaGallery
296
  break;
297
  case 'image_caption':
298
  $field_options = json_decode($options['cc_options'][$ID], true);
299
- if ( (int) $field_options['is_export_featured'] == (int) self::$is_include_feature_meta && (int) $field_options['is_export_attached'] == (int) self::$is_include_gallery_meta )
300
  {
301
  $templateOptions['set_image_meta_caption'] = 1;
302
  $templateOptions['image_meta_caption_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
@@ -310,7 +310,7 @@ final class XmlExportMediaGallery
310
  break;
311
  case 'image_description':
312
  $field_options = json_decode($options['cc_options'][$ID], true);
313
- if ( (int) $field_options['is_export_featured'] == (int) self::$is_include_feature_meta && (int) $field_options['is_export_attached'] == (int) self::$is_include_gallery_meta )
314
  {
315
  $templateOptions['set_image_meta_description'] = 1;
316
  $templateOptions['image_meta_description_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
@@ -324,7 +324,7 @@ final class XmlExportMediaGallery
324
  break;
325
  case 'image_alt':
326
  $field_options = json_decode($options['cc_options'][$ID], true);
327
- if ( (int) $field_options['is_export_featured'] == (int) self::$is_include_feature_meta && (int) $field_options['is_export_attached'] == (int) self::$is_include_gallery_meta )
328
  {
329
  $templateOptions['set_image_meta_alt'] = 1;
330
  $templateOptions['image_meta_alt_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
282
  break;
283
  case 'image_title':
284
  $field_options = json_decode($options['cc_options'][$ID], true);
285
+ if ( isset($field_options['is_export_featured']) && (int) $field_options['is_export_featured'] == (int) self::$is_include_feature_meta && (int) $field_options['is_export_attached'] == (int) self::$is_include_gallery_meta )
286
  {
287
  $templateOptions['set_image_meta_title'] = 1;
288
  $templateOptions['image_meta_title_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
296
  break;
297
  case 'image_caption':
298
  $field_options = json_decode($options['cc_options'][$ID], true);
299
+ if ( isset($field_options['is_export_featured']) && (int) $field_options['is_export_featured'] == (int) self::$is_include_feature_meta && (int) $field_options['is_export_attached'] == (int) self::$is_include_gallery_meta )
300
  {
301
  $templateOptions['set_image_meta_caption'] = 1;
302
  $templateOptions['image_meta_caption_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
310
  break;
311
  case 'image_description':
312
  $field_options = json_decode($options['cc_options'][$ID], true);
313
+ if ( isset($field_options['is_export_featured']) && (int) $field_options['is_export_featured'] == (int) self::$is_include_feature_meta && (int) $field_options['is_export_attached'] == (int) self::$is_include_gallery_meta )
314
  {
315
  $templateOptions['set_image_meta_description'] = 1;
316
  $templateOptions['image_meta_description_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
324
  break;
325
  case 'image_alt':
326
  $field_options = json_decode($options['cc_options'][$ID], true);
327
+ if ( isset($field_options['is_export_featured']) && (int) $field_options['is_export_featured'] == (int) self::$is_include_feature_meta && (int) $field_options['is_export_attached'] == (int) self::$is_include_gallery_meta )
328
  {
329
  $templateOptions['set_image_meta_alt'] = 1;
330
  $templateOptions['image_meta_alt_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 5.0
4
  Tested up to: 6.1
5
- Stable tag: 1.3.7
6
  Tags: export, wordpress csv export, wordpress xml export, export woocommerce, 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
  Easily export any data from WordPress. Drag & drop to create a completely custom spreadsheet, CSV, or XML file.
@@ -39,13 +39,13 @@ For technical support from the developers, please consider purchasing WP All Exp
39
 
40
  * **Send your data to 500+ apps:** Full integration with Zapier allows you to send your exported WordPress data to services like Dropbox and Google Drive, to create and update reports in Google Sheets, send email updates, or anything else you can think of. This is especially useful when you export WooCommerce orders to CSV.
41
 
42
- [Read more about WP All Export Pro and Zapier.](https://zapier.com/zapbook/wp-all-export-pro/)
43
 
44
  * **Schedule exports to run automatically:** Exports can be configured to run on any schedule you like. You can export new sales every week, recent user sign ups, new affiliate products added to your site, daily product stock reports, etc. Scheduled exports are very powerful when combined with Zapier.
45
 
46
  * **Add rules to filter data:** WP All Export Pro makes it easy to export the exact posts/products/orders you need. Want to export all WooCommerce orders over $100? Want to export all of the green shirts from your WooCommerce store? Want to export all new posts from 2014, except the ones added by Steve?
47
 
48
- You can with a simple to use interface on the 'New Export' page in WP All Export Pro.
49
 
50
  * **Export WordPress users:** WP All Export Pro adds the ability to export WordPress users and all custom data associated with them. Available data is organized and cleaned up so you don’t need to know anything about how WordPress stores users in order to export them.
51
 
@@ -102,6 +102,10 @@ Either: -
102
 
103
  == Changelog ==
104
 
 
 
 
 
105
  = 1.3.7 =
106
  * bug fix: cannot save Scheduling service license key
107
 
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 5.0
4
  Tested up to: 6.1
5
+ Stable tag: 1.3.8
6
  Tags: export, wordpress csv export, wordpress xml export, export woocommerce, 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
  Easily export any data from WordPress. Drag & drop to create a completely custom spreadsheet, CSV, or XML file.
39
 
40
  * **Send your data to 500+ apps:** Full integration with Zapier allows you to send your exported WordPress data to services like Dropbox and Google Drive, to create and update reports in Google Sheets, send email updates, or anything else you can think of. This is especially useful when you export WooCommerce orders to CSV.
41
 
42
+ [Read more about WP All Export Pro and Zapier.](https://zapier.com/zapbook/wp-all-export-pro/)
43
 
44
  * **Schedule exports to run automatically:** Exports can be configured to run on any schedule you like. You can export new sales every week, recent user sign ups, new affiliate products added to your site, daily product stock reports, etc. Scheduled exports are very powerful when combined with Zapier.
45
 
46
  * **Add rules to filter data:** WP All Export Pro makes it easy to export the exact posts/products/orders you need. Want to export all WooCommerce orders over $100? Want to export all of the green shirts from your WooCommerce store? Want to export all new posts from 2014, except the ones added by Steve?
47
 
48
+ You can with a simple to use interface on the 'New Export' page in WP All Export Pro.
49
 
50
  * **Export WordPress users:** WP All Export Pro adds the ability to export WordPress users and all custom data associated with them. Available data is organized and cleaned up so you don’t need to know anything about how WordPress stores users in order to export them.
51
 
102
 
103
  == Changelog ==
104
 
105
+ = 1.3.8 =
106
+ * improvement: only contact Scheduling service if a Scheduling license is set
107
+ * bug fix: enable use of 's', 'LIKE' and 'NOT LIKE' in WP_Query exports
108
+
109
  = 1.3.7 =
110
  * bug fix: cannot save Scheduling service license key
111
 
src/App/Service/ScheduledExport.php CHANGED
@@ -3,6 +3,8 @@
3
  namespace Wpae\App\Service;
4
 
5
 
 
 
6
  class ScheduledExport
7
  {
8
  /**
@@ -26,7 +28,7 @@ class ScheduledExport
26
  if (!$export->processing and $export->triggered) {
27
  return new JsonResponse(array(
28
  'status' => 403,
29
- 'message' => sprintf(esc_html__('Export #%s already triggered. Request skipped.', 'wp_all_export_plugin'), $export->id)
30
  ));
31
  }
32
 
@@ -69,8 +71,11 @@ class ScheduledExport
69
  'message' => sprintf(esc_html__('Export #%s is currently in manually process. Request skipped.', 'wp_all_export_plugin'), $export->id)
70
  ));
71
  } elseif ((int)$export->triggered and !(int)$export->processing) {
72
- $response = $export->set(array('canceled' => 0))->execute($logger, true);
73
-
 
 
 
74
  if (!(int)$export->triggered and !(int)$export->processing) {
75
 
76
  // trigger update child exports with correct WHERE & JOIN filters
3
  namespace Wpae\App\Service;
4
 
5
 
6
+ use Wpae\App\Service\Addons\AddonNotFoundException;
7
+
8
  class ScheduledExport
9
  {
10
  /**
28
  if (!$export->processing and $export->triggered) {
29
  return new JsonResponse(array(
30
  'status' => 403,
31
+ 'message' => sprintf('Export #%s already triggered. Request skipped.', $export->id)
32
  ));
33
  }
34
 
71
  'message' => sprintf(esc_html__('Export #%s is currently in manually process. Request skipped.', 'wp_all_export_plugin'), $export->id)
72
  ));
73
  } elseif ((int)$export->triggered and !(int)$export->processing) {
74
+ try {
75
+ $response = $export->set(array('canceled' => 0))->execute($logger, true);
76
+ } catch (AddonNotFoundException $e) {
77
+ die($e->getMessage());
78
+ }
79
  if (!(int)$export->triggered and !(int)$export->processing) {
80
 
81
  // trigger update child exports with correct WHERE & JOIN filters
src/Scheduling/Scheduling.php CHANGED
@@ -83,6 +83,11 @@ class Scheduling
83
  */
84
  public function handleScheduling($id, $post)
85
  {
 
 
 
 
 
86
  $schedulingEnabled = $post['scheduling_enable'];
87
 
88
  if ($schedulingEnabled == 1) {
@@ -212,6 +217,15 @@ class Scheduling
212
  return $times;
213
  }
214
 
 
 
 
 
 
 
 
 
 
215
  /**
216
  * TODO: Uglier but simpler method, if this gets in the way, extract to a class
217
  *
83
  */
84
  public function handleScheduling($id, $post)
85
  {
86
+
87
+ if (!$this->checkLicense()) {
88
+ return false;
89
+ }
90
+
91
  $schedulingEnabled = $post['scheduling_enable'];
92
 
93
  if ($schedulingEnabled == 1) {
217
  return $times;
218
  }
219
 
220
+ public function updateApiKey($elementId, $newKey) {
221
+
222
+ $remoteSchedule = $this->getSchedule($elementId);
223
+
224
+ if ($remoteSchedule) {
225
+ $this->schedulingApi->updateScheduleKey($remoteSchedule->id, $newKey);
226
+ }
227
+ }
228
+
229
  /**
230
  * TODO: Uglier but simpler method, if this gets in the way, extract to a class
231
  *
src/Scheduling/SchedulingApi.php CHANGED
@@ -147,6 +147,19 @@ class SchedulingApi
147
  return $response;
148
  }
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  private function getHeaders()
151
  {
152
 
147
  return $response;
148
  }
149
 
150
+ public function updateScheduleKey($remoteScheduleId, $newKey)
151
+ {
152
+ wp_remote_request(
153
+ $this->getApiUrl('schedules/' . $remoteScheduleId . '/key'),
154
+ array(
155
+ 'method' => 'POST',
156
+ 'headers' => $this->getHeaders(),
157
+ 'body' => json_encode(['key' => $newKey])
158
+
159
+ )
160
+ );
161
+ }
162
+
163
  private function getHeaders()
164
  {
165
 
src/Scheduling/views/CommonJs.php CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  <script type="text/javascript">
2
  (function ($) {
3
  $(function () {
1
+ <?php
2
+ if(!defined('ABSPATH')) {
3
+ die();
4
+ }
5
+ ?>
6
  <script type="text/javascript">
7
  (function ($) {
8
  $(function () {
src/Scheduling/views/ConnectionIcon.php CHANGED
@@ -1,27 +1,34 @@
1
  <?php
 
 
 
2
  $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; margin-top: -4px; margin-left: 0;" class="wpallexport-help help_scheduling"
7
  title="Automatic Scheduling is a paid service from Soflyy. Click for more info.">
8
 
9
  </a>
10
  </span>
11
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
- <span class="wpai-license" <?php if (!$scheduling->checkLicense()) { ?> style="display: none;" <?php } ?> >
14
- <?php if ( $scheduling->checkConnection() ) {
15
  ?>
16
- <span class="wpallexport-help" title="Connection to WP All Export servers is stable and confirmed"
17
- style="background-image: none; width: 20px; height: 20px;;">
18
- <img src="<?php echo PMXE_ROOT_URL; ?>/static/img/s-check.png" style="width: 16px;"/>
19
  </span>
20
- <?php
21
- } else { ?>
22
- <img src="<?php echo PMXE_ROOT_URL; ?>/static/img/s-exclamation.png" style="width: 16px;"/>
23
 
24
- <?php
25
- }
26
- ?>
27
- </span>
1
  <?php
2
+ if(!defined('ABSPATH')) {
3
+ die();
4
+ }
5
  $scheduling = \Wpae\Scheduling\Scheduling::create();
6
  ?>
7
  <span class="wpai-no-license" <?php if ($scheduling->checkLicense()) { ?> style="display: none;" <?php } ?> >
8
 
9
+ <a href="#" style="z-index: 1000;" class="wpallexport-help help_scheduling"
10
  title="Automatic Scheduling is a paid service from Soflyy. Click for more info.">
11
 
12
  </a>
13
  </span>
14
 
15
+ <?php if ($scheduling->checkLicense()) { ?>
16
+ <span class="wpai-license">
17
+ <?php if ( $scheduling->checkConnection() ) {
18
+ ?>
19
+ <span class="wpallexport-help" title="Connection to WP All Export servers is stable and confirmed"
20
+ style="background-image: none; width: 20px; height: 20px;">
21
+ <img src="<?php echo esc_url(PMXE_ROOT_URL); ?>/static/img/s-check.png" style="width: 16px;"/>
22
+ </span>
23
+ <?php
24
+ } else { ?>
25
+ <img src="<?php echo esc_url(PMXE_ROOT_URL); ?>/static/img/s-exclamation.png" style="width: 16px;"/>
26
 
27
+ <?php
28
+ }
29
  ?>
 
 
 
30
  </span>
31
+ <?php
32
+ }
 
33
 
34
+ ?>
 
 
 
src/Scheduling/views/ManualScheduling.php CHANGED
@@ -2,11 +2,11 @@
2
 
3
  <label>
4
  <input type="radio" name="scheduling_enable"
5
- value="2" <?php if ($post['scheduling_enable'] == 2) { ?> checked="checked" <?php } ?>/>
6
  <h4 style="margin-top: 0;display: inline-block;"><?php esc_html_e('Manual Scheduling', PMXE_Plugin::LANGUAGE_DOMAIN); ?></h4>
7
  </label>
8
  <div style="margin-left: 26px; margin-bottom: 10px; font-size: 13px;"><?php esc_html_e('Run this export using cron jobs.'); ?></div>
9
- <div style="<?php if ($post['scheduling_enable'] != 2) { ?> display: none; <?php } ?>" class="manual-scheduling">
10
 
11
  <div class="wpallexport-free-edition-notice" style="margin: 15px 0; width: 90%; padding-left: 10px; padding-right: 10px;">
12
  <a style="font-size: 1.3em;" class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=manual-scheduling"><?php esc_html_e('Upgrade to the Pro edition of WP All Export for Manual Scheduling','wp_all_export_plugin');?></a>
2
 
3
  <label>
4
  <input type="radio" name="scheduling_enable"
5
+ value="2"/>
6
  <h4 style="margin-top: 0;display: inline-block;"><?php esc_html_e('Manual Scheduling', PMXE_Plugin::LANGUAGE_DOMAIN); ?></h4>
7
  </label>
8
  <div style="margin-left: 26px; margin-bottom: 10px; font-size: 13px;"><?php esc_html_e('Run this export using cron jobs.'); ?></div>
9
+ <div style="display: none;" class="manual-scheduling">
10
 
11
  <div class="wpallexport-free-edition-notice" style="margin: 15px 0; width: 90%; padding-left: 10px; padding-right: 10px;">
12
  <a style="font-size: 1.3em;" class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=manual-scheduling"><?php esc_html_e('Upgrade to the Pro edition of WP All Export for Manual Scheduling','wp_all_export_plugin');?></a>
src/Scheduling/views/SaveSchedulingButton.php CHANGED
@@ -1,20 +1,15 @@
 
 
 
 
 
1
  <div class="wpae-save-button button button-primary button-hero wpallexport-large-button"
2
- style="position: relative; width: 285px; margin-left: 5px;">
3
- <svg width="30" height="30" viewBox="0 0 1792 1792"
4
- xmlns="http://www.w3.org/2000/svg"
5
- style="fill: white; display: none;">
6
- <path
7
- d="M1671 566q0 40-28 68l-724 724-136 136q-28 28-68 28t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 295 656-657q28-28 68-28t68 28l136 136q28 28 28 68z"
8
- fill="white"/>
9
- </svg>
10
- <div class="easing-spinner" style="display: none;">
11
- <div class="double-bounce1"></div>
12
- <div class="double-bounce2"></div>
13
- </div>
14
  <div class="save-text"
15
- style="display: block; position:absolute; <?php if($this->isWizard) {?> left: 70px; <?php } else { ?> left: 60px; <?php } ?> top:0; user-select: none;">
16
- <?php if($this->isWizard) {?>
17
- <?php esc_html_e('Confirm & Run Export', 'wp_all_export_plugin'); ?>
18
  <?php } else { ?>
19
  <?php esc_html_e('Save Export Configuration', 'wp_all_export_plugin'); ?>
20
  <?php } ?>
1
+ <?php
2
+ if(!defined('ABSPATH')) {
3
+ die();
4
+ }
5
+ ?>
6
  <div class="wpae-save-button button button-primary button-hero wpallexport-large-button"
7
+ style="position: relative; width: 285px; margin-left: 5px; ">
8
+
 
 
 
 
 
 
 
 
 
 
9
  <div class="save-text"
10
+ style=" user-select: none; display: flex; align-content: center; justify-content: center;">
11
+ <?php if($this->isWizard || (isset($post['enable_real_time_exports']) && $post['enable_real_time_exports'])) {?>
12
+ <?php esc_html_e('Save & Run Export', 'wp_all_export_plugin'); ?>
13
  <?php } else { ?>
14
  <?php esc_html_e('Save Export Configuration', 'wp_all_export_plugin'); ?>
15
  <?php } ?>
src/Scheduling/views/SchedulingHelp.php CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  <div id="wp-all-export-scheduling-help-inner" class="wp_all_export_scheduling_help">
2
 
3
  <p style="margin-top:5px; padding-left: 0;"><?php esc_html_e('This service is provided by Soflyy, the company that makes WP All Export. Automatic Scheduling makes it very easy to run exports on a schedule.', 'wp_all_export_plugin'); ?></p>
1
+ <?php
2
+ if(!defined('ABSPATH')) {
3
+ die();
4
+ }
5
+ ?>
6
  <div id="wp-all-export-scheduling-help-inner" class="wp_all_export_scheduling_help">
7
 
8
  <p style="margin-top:5px; padding-left: 0;"><?php esc_html_e('This service is provided by Soflyy, the company that makes WP All Export. Automatic Scheduling makes it very easy to run exports on a schedule.', 'wp_all_export_plugin'); ?></p>
src/Scheduling/views/SchedulingOptions.php CHANGED
@@ -1,4 +1,8 @@
1
  <?php
 
 
 
 
2
  $scheduling = \Wpae\Scheduling\Scheduling::create();
3
  $schedulingExportOptions = $export->options;
4
  $hasActiveLicense = $scheduling->checkLicense();
@@ -376,7 +380,7 @@ $options = \PMXE_Plugin::getInstance()->getOption();
376
  if(!hasActiveLicense) {
377
  if (!$(this).data('iunderstand') && schedulingEnable) {
378
  $('#no-subscription').slideDown();
379
- $(this).find('.save-text').html('<?php esc_html_e('I Understand');?>');
380
  $(this).find('.save-text').css('left', '100px');
381
  $(this).data('iunderstand', 1);
382
 
@@ -419,26 +423,17 @@ $options = \PMXE_Plugin::getInstance()->getOption();
419
  formData.push({name: 'element_id', value: <?php echo intval($export_id); ?>});
420
  formData.push({name: 'scheduling_enable', value: $('input[name="scheduling_enable"]:checked').val()});
421
 
422
- $button.find('.easing-spinner').toggle();
423
-
424
  $.ajax({
425
  type: 'POST',
426
  url: ajaxurl,
427
  data: formData,
428
  success: function (response) {
429
- $button.find('.easing-spinner').toggle();
430
- $button.find('.save-text').html(initialValue);
431
- $button.find('svg').show();
432
 
433
- setTimeout(function(){
434
- var submitEvent = $.Event('wpae-scheduling-options-form:submit');
435
- $(document).trigger(submitEvent);
436
- }, 1000);
437
 
438
  },
439
  error: function () {
440
- $button.find('.easing-spinner').toggle();
441
- $button.find('.save-text').html(initialValue);
442
  }
443
  });
444
  });
@@ -455,7 +450,7 @@ $options = \PMXE_Plugin::getInstance()->getOption();
455
  if(!hasActiveLicense) {
456
  if (!$(this).data('iunderstand') && schedulingEnable) {
457
  $('#no-subscription').slideDown();
458
- $(this).find('.save-text').html('<?php esc_html_e('I Understand');?>');
459
  $(this).find('.save-text').css('left', '100px');
460
  $(this).data('iunderstand', 1);
461
 
@@ -526,20 +521,20 @@ $options = \PMXE_Plugin::getInstance()->getOption();
526
 
527
  <?php if($schedulingExportOptions['scheduling_timezone'] == 'UTC') {
528
  ?>
529
- var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
530
-
531
- if($('#timezone').find("option:contains('"+ timeZone +"')").length != 0){
532
- $('#timezone').trigger("chosen:updated");
533
- $('#timezone').val(timeZone);
534
- $('#timezone').trigger("chosen:updated");
535
- }else{
536
- var parts = timeZone.split('/');
537
- var lastPart = parts[parts.length-1];
538
- var opt = $('#timezone').find("option:contains('"+ lastPart +"')");
539
-
540
- $('#timezone').val(opt.val());
541
- $('#timezone').trigger("chosen:updated");
542
- }
543
 
544
  <?php
545
  }
@@ -572,7 +567,7 @@ $options = \PMXE_Plugin::getInstance()->getOption();
572
 
573
  var license = $('#add-subscription-field').val();
574
  $.ajax({
575
- url:ajaxurl+'?action=wpae_api&q=schedulingLicense/saveSchedulingLicense&security=<?php echo wp_create_nonce("wp_all_export_secure");?>',
576
  type:"POST",
577
  data: {
578
  license: license
@@ -653,8 +648,7 @@ $options = \PMXE_Plugin::getInstance()->getOption();
653
 
654
  </script>
655
  <?php require __DIR__.'/CommonJs.php'; ?>
656
- <div class="wpallexport-collapsed wpallexport-section wpallexport-file-options closed"
657
- style="margin-top: -10px; margin-bottom: 10px;">
658
  <div id="scheduling-form">
659
 
660
  <div class="wpallexport-content-section" style="padding-bottom: 15px; margin-bottom: 10px;">
@@ -674,14 +668,16 @@ $options = \PMXE_Plugin::getInstance()->getOption();
674
  </div>
675
  <div>
676
  <label>
677
- <input type="radio" name="scheduling_enable" value="1" <?php if($schedulingExportOptions['scheduling_enable'] == 1) {?> checked="checked" <?php }?>/>
678
 
679
  <h4 style="margin: 0; display: inline-flex; align-items: center;"><?php esc_html_e('Automatic Scheduling', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
680
- <span class="connection-icon" style="margin-left: 8px;">
681
  <?php include_once('ConnectionIcon.php'); ?>
682
  </span>
683
- <?php if (!$scheduling->checkConnection()) { ?>
684
- <span class="wpai-license" style="margin-left: 8px; font-weight: normal; <?php if(!$hasActiveLicense) { ?> display: none; <?php }?> color: #f2b03d; ">Unable to connect, please contact support.</span>
 
 
685
  <?php } ?>
686
  </h4>
687
  </label>
@@ -745,7 +741,7 @@ $options = \PMXE_Plugin::getInstance()->getOption();
745
  value="monthly"/> <?php esc_html_e('Every month on the first...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
746
  </label>
747
  </div>
748
- <input type="hidden" name="scheduling_monthly_days" value="<?php if (isset($schedulingExportOptions['scheduling_monthly_days'])) echo $schedulingExportOptions['scheduling_monthly_days']; ?>" id="monthly_days"/>
749
  <?php
750
  if (isset($schedulingExportOptions['scheduling_monthly_days'])) {
751
  $monthlyArray = explode(',', $schedulingExportOptions['scheduling_monthly_days']);
@@ -818,7 +814,7 @@ $options = \PMXE_Plugin::getInstance()->getOption();
818
  <div class="subscribe" style="margin-left: 5px; margin-top: 65px; margin-bottom: 130px; position: relative;">
819
  <div class="button-container">
820
 
821
- <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=515704&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=automatic-scheduling" target="_blank" id="subscribe-button">
822
  <div class="button button-primary button-hero wpallexport-large-button button-subscribe"
823
  style="background-image: none; width: 140px; text-align: center; position: absolute; z-index: 4;">
824
  <svg class="success" width="30" height="30" viewBox="0 0 1792 1792"
1
  <?php
2
+ if(!defined('ABSPATH')) {
3
+ die();
4
+ }
5
+
6
  $scheduling = \Wpae\Scheduling\Scheduling::create();
7
  $schedulingExportOptions = $export->options;
8
  $hasActiveLicense = $scheduling->checkLicense();
380
  if(!hasActiveLicense) {
381
  if (!$(this).data('iunderstand') && schedulingEnable) {
382
  $('#no-subscription').slideDown();
383
+ $(this).find('.save-text').html('<?php echo esc_html('I Understand');?>');
384
  $(this).find('.save-text').css('left', '100px');
385
  $(this).data('iunderstand', 1);
386
 
423
  formData.push({name: 'element_id', value: <?php echo intval($export_id); ?>});
424
  formData.push({name: 'scheduling_enable', value: $('input[name="scheduling_enable"]:checked').val()});
425
 
 
 
426
  $.ajax({
427
  type: 'POST',
428
  url: ajaxurl,
429
  data: formData,
430
  success: function (response) {
 
 
 
431
 
432
+ var submitEvent = $.Event('wpae-scheduling-options-form:submit');
433
+ $(document).trigger(submitEvent);
 
 
434
 
435
  },
436
  error: function () {
 
 
437
  }
438
  });
439
  });
450
  if(!hasActiveLicense) {
451
  if (!$(this).data('iunderstand') && schedulingEnable) {
452
  $('#no-subscription').slideDown();
453
+ $(this).find('.save-text').html('<?php echo esc_html('I Understand');?>');
454
  $(this).find('.save-text').css('left', '100px');
455
  $(this).data('iunderstand', 1);
456
 
521
 
522
  <?php if($schedulingExportOptions['scheduling_timezone'] == 'UTC') {
523
  ?>
524
+ var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
525
+
526
+ if($('#timezone').find("option:contains('"+ timeZone +"')").length != 0){
527
+ $('#timezone').trigger("chosen:updated");
528
+ $('#timezone').val(timeZone);
529
+ $('#timezone').trigger("chosen:updated");
530
+ }else{
531
+ var parts = timeZone.split('/');
532
+ var lastPart = parts[parts.length-1];
533
+ var opt = $('#timezone').find("option:contains('"+ lastPart +"')");
534
+
535
+ $('#timezone').val(opt.val());
536
+ $('#timezone').trigger("chosen:updated");
537
+ }
538
 
539
  <?php
540
  }
567
 
568
  var license = $('#add-subscription-field').val();
569
  $.ajax({
570
+ url:ajaxurl+'?action=wpae_api&q=schedulingLicense/saveSchedulingLicense&security=<?php echo esc_js(wp_create_nonce("wp_all_export_secure"));?>',
571
  type:"POST",
572
  data: {
573
  license: license
648
 
649
  </script>
650
  <?php require __DIR__.'/CommonJs.php'; ?>
651
+ <div class="wpallexport-collapsed wpallexport-section wpallexport-file-options closed wpallexport-scheduling" style="margin-top: -10px; margin-bottom: 10px;">
 
652
  <div id="scheduling-form">
653
 
654
  <div class="wpallexport-content-section" style="padding-bottom: 15px; margin-bottom: 10px;">
668
  </div>
669
  <div>
670
  <label>
671
+ <input type="radio" name="scheduling_enable" value="1" <?php if($schedulingExportOptions['scheduling_enable'] == 1) {?> checked="checked" <?php }?>/>
672
 
673
  <h4 style="margin: 0; display: inline-flex; align-items: center;"><?php esc_html_e('Automatic Scheduling', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
674
+ <span class="connection-icon" style="margin-left: 8px; height: 16px;">
675
  <?php include_once('ConnectionIcon.php'); ?>
676
  </span>
677
+ <?php if($schedulingExportOptions['scheduling_enable'] == 1) { ?>
678
+ <?php if (!$scheduling->checkConnection()) { ?>
679
+ <span class="wpai-license" style="margin-left: 8px; font-weight: normal; <?php if(!$hasActiveLicense) { ?> display: none; <?php }?>"><span class="unable-to-connect">Unable to connect, please contact support.</span></span>
680
+ <?php } ?>
681
  <?php } ?>
682
  </h4>
683
  </label>
741
  value="monthly"/> <?php esc_html_e('Every month on the first...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
742
  </label>
743
  </div>
744
+ <input type="hidden" name="scheduling_monthly_days" value="<?php if (isset($schedulingExportOptions['scheduling_monthly_days'])) echo esc_attr($schedulingExportOptions['scheduling_monthly_days']); ?>" id="monthly_days"/>
745
  <?php
746
  if (isset($schedulingExportOptions['scheduling_monthly_days'])) {
747
  $monthlyArray = explode(',', $schedulingExportOptions['scheduling_monthly_days']);
814
  <div class="subscribe" style="margin-left: 5px; margin-top: 65px; margin-bottom: 130px; position: relative;">
815
  <div class="button-container">
816
 
817
+ <a href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=515704" target="_blank" id="subscribe-button">
818
  <div class="button button-primary button-hero wpallexport-large-button button-subscribe"
819
  style="background-image: none; width: 140px; text-align: center; position: absolute; z-index: 4;">
820
  <svg class="success" width="30" height="30" viewBox="0 0 1792 1792"
src/Scheduling/views/SchedulingUI.php CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  <style type="text/css">
2
  .days-of-week {
3
  margin-left: 5px;
@@ -201,7 +206,7 @@
201
  </style>
202
  <?php
203
  $scheduling = \Wpae\Scheduling\Scheduling::create();
204
- $post = $export->options;
205
  $hasActiveLicense = $scheduling->checkLicense();
206
  $cron_job_key = PMXE_Plugin::getInstance()->getOption('cron_job_key');
207
  $options = \PMXE_Plugin::getInstance()->getOption();
@@ -416,7 +421,7 @@ $export_id = $export->id;
416
  });
417
  });
418
 
419
- <?php if($post['scheduling_timezone'] == 'UTC') {
420
  ?>
421
  var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
422
 
@@ -462,7 +467,7 @@ $export_id = $export->id;
462
  $('#subscribe-button .easing-spinner').show();
463
  var license = $('#add-subscription-field').val();
464
  $.ajax({
465
- url:ajaxurl+'?action=wpae_api&q=schedulingLicense/saveSchedulingLicense&security=<?php echo wp_create_nonce("wp_all_export_secure");?>',
466
  type:"POST",
467
  data: {
468
  license: license
@@ -473,7 +478,7 @@ $export_id = $export->id;
473
  $('#subscribe-button .button-subscribe').css('background-color','#425f9a');
474
  if(response.success) {
475
  hasActiveLicense = true;
476
- $('.wpae-save-button').slideDown().css('display','block');
477
  $('#subscribe-button .easing-spinner').hide();
478
  $('#subscribe-button svg.success').show();
479
  $('#subscribe-button svg.success').fadeOut(3000, function () {
@@ -499,7 +504,7 @@ $export_id = $export->id;
499
 
500
  setTimeout(function () {
501
  $('#add-subscription-field').animate({width:'140px'}, 225);
502
- $('#add-subscription-field').animate({left:'-155px'}, 225);
503
  }, 300);
504
 
505
  $('#add-subscription-field').val('');
@@ -550,15 +555,15 @@ $export_id = $export->id;
550
  <div class="wpallexport-collapsed-content-inner" style="padding-bottom: 0; overflow: auto; padding-right: 0;">
551
  <div style="margin-bottom: 20px;">
552
  <label>
553
- <input type="radio" name="scheduling_enable" value="0" <?php if($post['scheduling_enable'] == 0) { ?> checked="checked" <?php } ?>/>
554
  <h4 style="display: inline-block;"><?php esc_html_e('Do Not Schedule'); ?></h4>
555
  </label>
556
  </div>
557
  <div>
558
  <label>
559
- <input type="radio" name="scheduling_enable" value="1" <?php if($post['scheduling_enable'] == 1) {?> checked="checked" <?php }?>/>
560
  <h4 style="margin: 0; display: inline-flex; align-items: center;"><?php esc_html_e('Automatic Scheduling', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
561
- <span class="connection-icon" style="margin-left: 8px;">
562
  <?php include_once('ConnectionIcon.php'); ?>
563
  </span>
564
  <?php if($schedulingExportOptions['scheduling_enable'] == 1) { ?>
@@ -578,26 +583,26 @@ $export_id = $export->id;
578
  </label>
579
  </div>
580
  <div id="automatic-scheduling"
581
- style="margin-left: 21px; <?php if ($post['scheduling_enable'] != 1) { ?> display: none; <?php } ?>">
582
  <div>
583
  <div class="input">
584
  <label style="color: rgb(68,68,68);">
585
  <input
586
- type="radio" <?php if ($post['scheduling_run_on'] != 'monthly') { ?> checked="checked" <?php } ?>
587
  name="scheduling_run_on" value="weekly"
588
  checked="checked"/> <?php esc_html_e('Every week on...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
589
  </label>
590
  </div>
591
  <input type="hidden" style="width: 500px;" name="scheduling_weekly_days"
592
- value="<?php echo esc_attr($post['scheduling_weekly_days']); ?>" id="weekly_days"/>
593
  <?php
594
- if (isset($post['scheduling_weekly_days'])) {
595
- $weeklyArray = explode(',', $post['scheduling_weekly_days']);
596
  } else {
597
  $weeklyArray = array();
598
  }
599
  ?>
600
- <ul class="days-of-week" id="weekly" style="<?php if ($post['scheduling_run_on'] == 'monthly') { ?> display: none; <?php } ?>">
601
  <li data-day="0" <?php if (in_array('0', $weeklyArray)) { ?> class="selected" <?php } ?>>
602
  Mon
603
  </li>
@@ -626,21 +631,21 @@ $export_id = $export->id;
626
  <div class="input">
627
  <label style="color: rgb(68,68,68);">
628
  <input
629
- type="radio" <?php if ($post['scheduling_run_on'] == 'monthly') { ?> checked="checked" <?php } ?>
630
  name="scheduling_run_on"
631
  value="monthly"/> <?php esc_html_e('Every month on the first...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
632
  </label>
633
  </div>
634
- <input type="hidden" name="scheduling_monthly_days" value="<?php if(isset($post['scheduling_monthly_days'])) echo esc_attr($post['scheduling_monthly_days']); ?>" id="monthly_days"/>
635
  <?php
636
- if (isset($post['scheduling_monthly_days'])) {
637
- $monthlyArray = explode(',', $post['scheduling_monthly_days']);
638
  } else {
639
  $monthlyArray = array();
640
  }
641
  ?>
642
  <ul class="days-of-week" id="monthly"
643
- style="<?php if ($post['scheduling_run_on'] != 'monthly') { ?> display: none; <?php } ?>">
644
  <li data-day="0" <?php if (in_array('0', $monthlyArray)) { ?> class="selected" <?php } ?>>
645
  Mon
646
  </li>
@@ -672,8 +677,8 @@ $export_id = $export->id;
672
  </div>
673
 
674
  <div id="times" style="margin-bottom: 10px;">
675
- <?php if (is_array($post['scheduling_times'])) {
676
- foreach ($post['scheduling_times'] as $time) { ?>
677
 
678
  <?php if ($time) { ?>
679
  <input class="timepicker" type="text" name="scheduling_times[]"
@@ -688,8 +693,8 @@ $export_id = $export->id;
688
  <?php
689
 
690
  $timezoneValue = false;
691
- if ($post['scheduling_timezone']) {
692
- $timezoneValue = $post['scheduling_timezone'];
693
  }
694
 
695
  $timezoneSelect = new \Wpae\Scheduling\Timezone\TimezoneSelect();
@@ -748,8 +753,8 @@ $export_id = $export->id;
748
  <div style="clear: both;"></div>
749
  </div>
750
 
751
- <div class="wpae-save-button button button-primary button-hero wpallexport-large-button wpae-export-complete-save-button" id="save-scheduling-button"
752
- style="position: relative; width: 285px; <?php if($hasActiveLicense) { echo 'display: block;';} else { echo "display: none;";}?> margin:auto; background-image: none; margin-top: 25px;">
753
  <svg width="30" height="30" viewBox="0 0 1792 1792"
754
  xmlns="http://www.w3.org/2000/svg"
755
  style="fill: white;">
1
+ <?php
2
+ if(!defined('ABSPATH')) {
3
+ die();
4
+ }
5
+ ?>
6
  <style type="text/css">
7
  .days-of-week {
8
  margin-left: 5px;
206
  </style>
207
  <?php
208
  $scheduling = \Wpae\Scheduling\Scheduling::create();
209
+ $schedulingExportOptions = $export->options;
210
  $hasActiveLicense = $scheduling->checkLicense();
211
  $cron_job_key = PMXE_Plugin::getInstance()->getOption('cron_job_key');
212
  $options = \PMXE_Plugin::getInstance()->getOption();
421
  });
422
  });
423
 
424
+ <?php if($schedulingExportOptions['scheduling_timezone'] == 'UTC') {
425
  ?>
426
  var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
427
 
467
  $('#subscribe-button .easing-spinner').show();
468
  var license = $('#add-subscription-field').val();
469
  $.ajax({
470
+ url:ajaxurl+'?action=wpae_api&q=schedulingLicense/saveSchedulingLicense&security=<?php echo esc_js(wp_create_nonce("wp_all_export_secure"));?>',
471
  type:"POST",
472
  data: {
473
  license: license
478
  $('#subscribe-button .button-subscribe').css('background-color','#425f9a');
479
  if(response.success) {
480
  hasActiveLicense = true;
481
+ $('.wpae-save-button').removeClass('disabled');
482
  $('#subscribe-button .easing-spinner').hide();
483
  $('#subscribe-button svg.success').show();
484
  $('#subscribe-button svg.success').fadeOut(3000, function () {
504
 
505
  setTimeout(function () {
506
  $('#add-subscription-field').animate({width:'140px'}, 225);
507
+ $('#add-subscription-field').animate({left:'-152px'}, 225);
508
  }, 300);
509
 
510
  $('#add-subscription-field').val('');
555
  <div class="wpallexport-collapsed-content-inner" style="padding-bottom: 0; overflow: auto; padding-right: 0;">
556
  <div style="margin-bottom: 20px;">
557
  <label>
558
+ <input type="radio" name="scheduling_enable" value="0" <?php if($schedulingExportOptions['scheduling_enable'] == 0) { ?> checked="checked" <?php } ?>/>
559
  <h4 style="display: inline-block;"><?php esc_html_e('Do Not Schedule'); ?></h4>
560
  </label>
561
  </div>
562
  <div>
563
  <label>
564
+ <input type="radio" name="scheduling_enable" value="1" <?php if($schedulingExportOptions['scheduling_enable'] == 1) {?> checked="checked" <?php }?>/>
565
  <h4 style="margin: 0; display: inline-flex; align-items: center;"><?php esc_html_e('Automatic Scheduling', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
566
+ <span class="connection-icon" style="margin-left: 8px; height: 16px;">
567
  <?php include_once('ConnectionIcon.php'); ?>
568
  </span>
569
  <?php if($schedulingExportOptions['scheduling_enable'] == 1) { ?>
583
  </label>
584
  </div>
585
  <div id="automatic-scheduling"
586
+ style="margin-left: 21px; <?php if ($schedulingExportOptions['scheduling_enable'] != 1) { ?> display: none; <?php } ?>">
587
  <div>
588
  <div class="input">
589
  <label style="color: rgb(68,68,68);">
590
  <input
591
+ type="radio" <?php if ($schedulingExportOptions['scheduling_run_on'] != 'monthly') { ?> checked="checked" <?php } ?>
592
  name="scheduling_run_on" value="weekly"
593
  checked="checked"/> <?php esc_html_e('Every week on...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
594
  </label>
595
  </div>
596
  <input type="hidden" style="width: 500px;" name="scheduling_weekly_days"
597
+ value="<?php echo esc_attr($schedulingExportOptions['scheduling_weekly_days']); ?>" id="weekly_days"/>
598
  <?php
599
+ if (isset($schedulingExportOptions['scheduling_weekly_days'])) {
600
+ $weeklyArray = explode(',', $schedulingExportOptions['scheduling_weekly_days']);
601
  } else {
602
  $weeklyArray = array();
603
  }
604
  ?>
605
+ <ul class="days-of-week" id="weekly" style="<?php if ($schedulingExportOptions['scheduling_run_on'] == 'monthly') { ?> display: none; <?php } ?>">
606
  <li data-day="0" <?php if (in_array('0', $weeklyArray)) { ?> class="selected" <?php } ?>>
607
  Mon
608
  </li>
631
  <div class="input">
632
  <label style="color: rgb(68,68,68);">
633
  <input
634
+ type="radio" <?php if ($schedulingExportOptions['scheduling_run_on'] == 'monthly') { ?> checked="checked" <?php } ?>
635
  name="scheduling_run_on"
636
  value="monthly"/> <?php esc_html_e('Every month on the first...', PMXE_Plugin::LANGUAGE_DOMAIN); ?>
637
  </label>
638
  </div>
639
+ <input type="hidden" name="scheduling_monthly_days" value="<?php if(isset($schedulingExportOptions['scheduling_monthly_days'])) echo esc_attr($schedulingExportOptions['scheduling_monthly_days']); ?>" id="monthly_days"/>
640
  <?php
641
+ if (isset($schedulingExportOptions['scheduling_monthly_days'])) {
642
+ $monthlyArray = explode(',', $schedulingExportOptions['scheduling_monthly_days']);
643
  } else {
644
  $monthlyArray = array();
645
  }
646
  ?>
647
  <ul class="days-of-week" id="monthly"
648
+ style="<?php if ($schedulingExportOptions['scheduling_run_on'] != 'monthly') { ?> display: none; <?php } ?>">
649
  <li data-day="0" <?php if (in_array('0', $monthlyArray)) { ?> class="selected" <?php } ?>>
650
  Mon
651
  </li>
677
  </div>
678
 
679
  <div id="times" style="margin-bottom: 10px;">
680
+ <?php if (is_array($schedulingExportOptions['scheduling_times'])) {
681
+ foreach ($schedulingExportOptions['scheduling_times'] as $time) { ?>
682
 
683
  <?php if ($time) { ?>
684
  <input class="timepicker" type="text" name="scheduling_times[]"
693
  <?php
694
 
695
  $timezoneValue = false;
696
+ if ($schedulingExportOptions['scheduling_timezone']) {
697
+ $timezoneValue = $schedulingExportOptions['scheduling_timezone'];
698
  }
699
 
700
  $timezoneSelect = new \Wpae\Scheduling\Timezone\TimezoneSelect();
753
  <div style="clear: both;"></div>
754
  </div>
755
 
756
+ <div class="wpae-save-button button button-primary button-hero wpallexport-large-button wpae-export-complete-save-button <?php if(!$hasActiveLicense) { echo 'disabled'; }?>"
757
+ style="position: relative; width: 285px; display: block; margin:auto; background-image: none; margin-top: 25px;">
758
  <svg width="30" height="30" viewBox="0 0 1792 1792"
759
  xmlns="http://www.w3.org/2000/svg"
760
  style="fill: white;">
static/css/admin.css CHANGED
@@ -36,6 +36,11 @@
36
  /*max-height: 600px;*/
37
  overflow: auto;
38
  }
 
 
 
 
 
39
  .wpallexport-plugin .wp_all_export_custom_xml_help p,
40
  .wpallexport-plugin .wp_all_export_scheduling_help p
41
  {
@@ -147,6 +152,12 @@
147
  text-align: center;
148
  text-decoration: none;
149
  }
 
 
 
 
 
 
150
  .wpallexport-plugin .wpallexport-free-edition-notice{
151
  display: block;
152
  margin: 5px;
@@ -4499,3 +4510,62 @@ input label {
4499
  }
4500
 
4501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  /*max-height: 600px;*/
37
  overflow: auto;
38
  }
39
+
40
+ .wpallexport-plugin .wpallexport-step-4 .wpallexport-free-edition-notice a.upgrade_link {
41
+ font-size: 1.3em !important;
42
+ }
43
+
44
  .wpallexport-plugin .wp_all_export_custom_xml_help p,
45
  .wpallexport-plugin .wp_all_export_scheduling_help p
46
  {
152
  text-align: center;
153
  text-decoration: none;
154
  }
155
+
156
+ .wpallexport-plugin .connection-icon .help_scheduling {
157
+ margin: 0;
158
+ position: initial;
159
+ }
160
+
161
  .wpallexport-plugin .wpallexport-free-edition-notice{
162
  display: block;
163
  margin: 5px;
4510
  }
4511
 
4512
 
4513
+ .wpae-shake {
4514
+ -webkit-animation: wpae_shake 0.4s 1 linear;
4515
+ -moz-animation: wpae_shake 0.4s 1 linear;
4516
+ -o-animation: wpae_shake 0.4s 1 linear;
4517
+ }
4518
+ @-webkit-keyframes wpae_shake {
4519
+ 0% { -webkit-transform: translate(30px); }
4520
+ 20% { -webkit-transform: translate(-30px); }
4521
+ 40% { -webkit-transform: translate(15px); }
4522
+ 60% { -webkit-transform: translate(-15px); }
4523
+ 80% { -webkit-transform: translate(8px); }
4524
+ 100% { -webkit-transform: translate(0px); }
4525
+ }
4526
+ @-moz-keyframes wpae_shake {
4527
+ 0% { -moz-transform: translate(30px); }
4528
+ 20% { -moz-transform: translate(-30px); }
4529
+ 40% { -moz-transform: translate(15px); }
4530
+ 60% { -moz-transform: translate(-15px); }
4531
+ 80% { -moz-transform: translate(8px); }
4532
+ 100% { -moz-transform: translate(0px); }
4533
+ }
4534
+ @-o-keyframes wpae_shake {
4535
+ 0% { -o-transform: translate(30px); }
4536
+ 20% { -o-transform: translate(-30px); }
4537
+ 40% { -o-transform: translate(15px); }
4538
+ 60% { -o-transform: translate(-15px); }
4539
+ 80% { -o-transform: translate(8px); }
4540
+ 100% { -o-origin-transform: translate(0px); }
4541
+ }
4542
+
4543
+ .wpae-shake-small {
4544
+ -webkit-animation: wpae_shake_small 0.4s 1 linear;
4545
+ -moz-animation: wpae_shake_small 0.4s 1 linear;
4546
+ -o-animation: wpae_shake_small 0.4s 1 linear;
4547
+ }
4548
+ @-webkit-keyframes wpae_shake_small {
4549
+ 0% { -webkit-transform: translate(10px); }
4550
+ 20% { -webkit-transform: translate(-10px); }
4551
+ 40% { -webkit-transform: translate(5px); }
4552
+ 60% { -webkit-transform: translate(-5px); }
4553
+ 80% { -webkit-transform: translate(3px); }
4554
+ 100% { -webkit-transform: translate(0px); }
4555
+ }
4556
+ @-moz-keyframes wpae_shake_small {
4557
+ 0% { -moz-transform: translate(10px); }
4558
+ 20% { -moz-transform: translate(-10px); }
4559
+ 40% { -moz-transform: translate(5px); }
4560
+ 60% { -moz-transform: translate(-5px); }
4561
+ 80% { -moz-transform: translate(3px); }
4562
+ 100% { -moz-transform: translate(0px); }
4563
+ }
4564
+ @-o-keyframes wpae_shake_small {
4565
+ 0% { -o-transform: translate(10px); }
4566
+ 20% { -o-transform: translate(-10px); }
4567
+ 40% { -o-transform: translate(5px); }
4568
+ 60% { -o-transform: translate(-5px); }
4569
+ 80% { -o-transform: translate(3px); }
4570
+ 100% { -o-origin-transform: translate(0px); }
4571
+ }
static/js/admin.js CHANGED
@@ -384,8 +384,76 @@
384
  }).change();
385
 
386
 
 
 
387
 
388
- // swither show/hide logic
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  $('input.switcher-horizontal').change('change', function (e) {
390
 
391
  if ($(this).is(':checked')) {
@@ -693,10 +761,7 @@
693
 
694
  var postType = $('input[name=cpt]').length ? $('input[name=cpt]').val() : $('input[name=selected_post_type]').val();
695
 
696
- var $export_only_new_stuff = $('input[name=export_only_new_stuff]').val();
697
- if ($('#export_only_new_stuff').length){
698
- $export_only_new_stuff = $('#export_only_new_stuff').is(':checked') ? 1 : 0;
699
- }
700
 
701
  var $export_only_modified_stuff = $('input[name=export_only_modified_stuff]').val();
702
  if ($('#export_only_modified_stuff').length){
@@ -712,7 +777,7 @@
712
  'product_matching_mode' : $('select[name=product_matching_mode]').length ? $('select[name=product_matching_mode]').val() : '',
713
  'is_confirm_screen' : $('.wpallexport-step-4').length,
714
  'is_template_screen' : $('.wpallexport-step-3').length,
715
- 'export_only_new_stuff' : $export_only_new_stuff,
716
  'export_only_modified_stuff' : $export_only_modified_stuff,
717
  'export_type' : $('input[name=export_type]').val(),
718
  'taxonomy_to_export' : $('input[name=taxonomy_to_export]').val(),
@@ -2354,22 +2419,7 @@
2354
  }
2355
 
2356
  }
2357
- $('#export_only_new_stuff').click(function(){
2358
- $(this).attr('disabled','disabled');
2359
- $('label[for=export_only_new_stuff]').addClass('loading');
2360
- liveFiltering(null, function(){
2361
- $('label[for=export_only_new_stuff]').removeClass('loading');
2362
- $('#export_only_new_stuff').removeAttr('disabled');
2363
- });
2364
- });
2365
- $('#export_only_modified_stuff').click(function(){
2366
- $(this).attr('disabled','disabled');
2367
- $('label[for=export_only_modified_stuff]').addClass('loading');
2368
- liveFiltering(null, function(){
2369
- $('label[for=export_only_modified_stuff]').removeClass('loading');
2370
- $('#export_only_modified_stuff').removeAttr('disabled');
2371
- });
2372
- });
2373
  // [ \Step 3 ( export options ) ]
2374
 
2375
  $('#download-bundle').click(function(e){
384
  }).change();
385
 
386
 
387
+ $('input#enable_real_time_exports').click(function(e){
388
+ $('.wpallexport-free-edition-notice.php-rte-upgrade').slideDown();
389
 
390
+
391
+ $('input#enable_real_time_exports').addClass('wpae-shake-small');
392
+ setTimeout(function(){
393
+ $('input#enable_real_time_exports').prop('checked', false);
394
+ $('input#enable_real_time_exports').removeClass('wpae-shake-small');
395
+
396
+ return false;
397
+ },600);
398
+
399
+ e.preventDefault();
400
+ return false;
401
+
402
+ });
403
+
404
+ $('input#export_only_new_stuff').click(function(e){
405
+ $('.wpallexport-free-edition-notice.only-export-posts-once').slideDown();
406
+
407
+ $('input#export_only_new_stuff').addClass('wpae-shake-small');
408
+ setTimeout(function(){
409
+ $('input#export_only_new_stuff').prop('checked', false);
410
+ $('input#export_only_new_stuff').removeClass('wpae-shake-small');
411
+
412
+ return false;
413
+ },600);
414
+
415
+ e.preventDefault();
416
+ return false;
417
+
418
+ });
419
+
420
+ $('input#export_only_modified_stuff').click(function(e){
421
+ $('.wpallexport-free-edition-notice.only-export-modified-posts').slideDown();
422
+
423
+ $('input#export_only_modified_stuff').addClass('wpae-shake-small');
424
+ setTimeout(function(){
425
+ $('input#export_only_modified_stuff').prop('checked', false);
426
+ $('input#export_only_modified_stuff').removeClass('wpae-shake-small');
427
+
428
+ return false;
429
+ },600);
430
+
431
+ e.preventDefault();
432
+ return false;
433
+
434
+ });
435
+
436
+ $('input#allow_client_mode').click(function(e){
437
+ $('.wpallexport-free-edition-notice.client-mode-notice').slideDown();
438
+
439
+ $('input#allow_client_mode').addClass('wpae-shake-small');
440
+ setTimeout(function(){
441
+ $('input#allow_client_mode').prop('checked', false);
442
+ $('input#allow_client_mode').removeClass('wpae-shake-small');
443
+
444
+ return false;
445
+ },600);
446
+
447
+ e.preventDefault();
448
+ return false;
449
+
450
+ });
451
+
452
+
453
+
454
+
455
+
456
+ // swither show/hide logic
457
  $('input.switcher-horizontal').change('change', function (e) {
458
 
459
  if ($(this).is(':checked')) {
761
 
762
  var postType = $('input[name=cpt]').length ? $('input[name=cpt]').val() : $('input[name=selected_post_type]').val();
763
 
764
+
 
 
 
765
 
766
  var $export_only_modified_stuff = $('input[name=export_only_modified_stuff]').val();
767
  if ($('#export_only_modified_stuff').length){
777
  'product_matching_mode' : $('select[name=product_matching_mode]').length ? $('select[name=product_matching_mode]').val() : '',
778
  'is_confirm_screen' : $('.wpallexport-step-4').length,
779
  'is_template_screen' : $('.wpallexport-step-3').length,
780
+ 'export_only_new_stuff' : 0,
781
  'export_only_modified_stuff' : $export_only_modified_stuff,
782
  'export_type' : $('input[name=export_type]').val(),
783
  'taxonomy_to_export' : $('input[name=taxonomy_to_export]').val(),
2419
  }
2420
 
2421
  }
2422
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2423
  // [ \Step 3 ( export options ) ]
2424
 
2425
  $('#download-bundle').click(function(e){
views/admin/export/options.php CHANGED
@@ -35,7 +35,7 @@ $l10n = array(
35
 
36
  <?php do_action('pmxe_options_header', $this->isWizard, $post); ?>
37
 
38
- <div class="ajax-console">
39
  <?php if ($this->errors->get_error_codes()): ?>
40
  <?php $this->error() ?>
41
  <?php endif ?>
35
 
36
  <?php do_action('pmxe_options_header', $this->isWizard, $post); ?>
37
 
38
+ <div class="ajax-console">
39
  <?php if ($this->errors->get_error_codes()): ?>
40
  <?php $this->error() ?>
41
  <?php endif ?>
views/admin/export/options/settings.php CHANGED
@@ -12,23 +12,120 @@ if(!defined('ABSPATH')) {
12
  <div class="wpallexport-collapsed-content-inner">
13
  <table class="form-table" style="max-width:none;">
14
  <tr>
15
- <td colspan="3">
 
16
  <div class="input" style="margin:5px 0px;">
17
  <label for="records_per_request"><?php esc_html_e('In each iteration, process', 'wp_all_export_plugin');?> <input type="text" name="records_per_iteration" class="wp_all_export_sub_input" style="width: 40px;" value="<?php echo esc_attr($post['records_per_iteration']) ?>" /> <?php esc_html_e('records', 'wp_all_export_plugin'); ?></label>
18
  <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_html_e('WP All Export must be able to process this many records in less than your server\'s timeout settings. If your export fails before completion, to troubleshoot you should lower this number.', 'wp_all_export_plugin'); ?>">?</a>
19
  </div>
20
- <div class="input" style="margin:5px 0px;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  <input type="hidden" name="export_only_new_stuff" value="0" />
22
- <input type="checkbox" id="export_only_new_stuff" name="export_only_new_stuff" value="1" <?php echo $post['export_only_new_stuff'] ? 'checked="checked"': '' ?> disabled="disabled"/>
23
- <label for="export_only_new_stuff" disabled="disabled"><?php printf(esc_html__('Only export %s once', 'wp_all_export_plugin'), empty($post['cpt']) ? __('records', 'wp_all_export_plugin') : esc_html(wp_all_export_get_cpt_name($post['cpt']))); ?></label>
24
  <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_html_e('If re-run, this export will only include records that have not been previously exported.<br><br><strong>Upgrade to the Pro edition of WP All Export to use this option.</strong>', 'wp_all_export_plugin'); ?>">?</a>
25
- </div>
 
 
 
 
 
 
 
 
26
  <div class="input" style="margin:5px 0px;">
27
  <input type="hidden" name="export_only_modified_stuff" value="0" />
28
- <input type="checkbox" id="export_only_modified_stuff" name="export_only_modified_stuff" value="1" <?php echo $post['export_only_modified_stuff'] ? 'checked="checked"': '' ?> disabled="disabled"/>
29
  <label for="export_only_modified_stuff" disabled="disabled"><?php printf(esc_html__('Only export %s that have been modified since last export', 'wp_all_export_plugin'), empty($post['cpt']) ? __('records', 'wp_all_export_plugin') : esc_html(wp_all_export_get_cpt_name($post['cpt'], 2, $post))); ?></label>
30
- <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_html_e('If re-run, this export will only include records that have been modified since last export run.<br><br><strong>Upgrade to the Pro edition of WP All Export to use this option.</strong>', 'wp_all_export_plugin'); ?>">?</a>
31
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  <div class="input" style="margin:5px 0px;">
34
  <input type="hidden" name="include_bom" value="0" />
@@ -54,12 +151,20 @@ if(!defined('ABSPATH')) {
54
  </div>
55
  <div class="input" style="margin:5px 0px;">
56
  <input type="hidden" name="allow_client_mode" value="0"/>
57
- <input type="checkbox" disabled="disabled" id="allow_client_mode" name="allow_client_mode"
58
  value="1" <?php echo (isset($post['allow_client_mode']) && $post['allow_client_mode']) ? 'checked="checked"' : '' ?> />
59
  <label for="allow_client_mode"><?php esc_html_e('Allow non-admins to run this export in Client Mode', 'wp_all_export_plugin') ?></label>
60
  <span>
61
  <a href="#help" class="wpallexport-help" style="position: relative; top: 0;" title="<?php esc_html_e('When enabled, users with access to Client Mode will be able to run this export and download the export file. Go to All Export > Settings to give users access to Client Mode. <br><br><strong>Upgrade to the Pro edition of WP All Export to use this option.</strong>'); ?>">?</a>
62
  </span>
 
 
 
 
 
 
 
 
63
  </div>
64
  <br>
65
  <hr>
12
  <div class="wpallexport-collapsed-content-inner">
13
  <table class="form-table" style="max-width:none;">
14
  <tr>
15
+ <td colspan="3">
16
+
17
  <div class="input" style="margin:5px 0px;">
18
  <label for="records_per_request"><?php esc_html_e('In each iteration, process', 'wp_all_export_plugin');?> <input type="text" name="records_per_iteration" class="wp_all_export_sub_input" style="width: 40px;" value="<?php echo esc_attr($post['records_per_iteration']) ?>" /> <?php esc_html_e('records', 'wp_all_export_plugin'); ?></label>
19
  <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_html_e('WP All Export must be able to process this many records in less than your server\'s timeout settings. If your export fails before completion, to troubleshoot you should lower this number.', 'wp_all_export_plugin'); ?>">?</a>
20
  </div>
21
+
22
+ <?php
23
+ $cpt_initial = $post['cpt'];
24
+ $cpt_name = is_array($post['cpt']) ? reset($post['cpt']) : $post['cpt'];
25
+ if ('advanced' !== $post['export_type']) {
26
+ if ($cpt_name !== 'taxonomies') {
27
+
28
+ if ($cpt_name === 'users') {
29
+ $cpt_name = 'user';
30
+ }
31
+
32
+ $display_verb = 'created';
33
+ $display_cpt_name = $cpt_name;
34
+ $tooltip_cpt_name = strtolower(wp_all_export_get_cpt_name($cpt_initial));
35
+
36
+ if ($display_cpt_name === 'shop_order') {
37
+ $display_cpt_name = 'WooCommerce Order';
38
+ $display_verb = 'completed';
39
+ }
40
+
41
+ if ($display_cpt_name === 'shop_customer') {
42
+ $display_cpt_name = 'WooCommerce Customer';
43
+ $display_verb = 'created';
44
+ }
45
+
46
+ if ($display_cpt_name === 'custom_wpae-gf-addon') {
47
+ $display_cpt_name = 'Gravity Forms Entry';
48
+ }
49
+
50
+ if ($display_cpt_name === 'comments') {
51
+ $display_cpt_name = 'comment';
52
+ }
53
+ }
54
+ }
55
+
56
+ ?>
57
+ <div class="input">
58
+
59
+ <input type="hidden" id="wpae-post-name" value="<?php echo $display_cpt_name; ?>" />
60
+ <input type="hidden" name="enable_real_time_exports" value="0"/>
61
+ <input type="checkbox"
62
+ id="enable_real_time_exports" <?php if ((isset($post['xml_template_type']) && $post['xml_template_type'] == XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS) || $cpt_name === 'shop_customer') { ?> disabled="disabled" <?php } ?>
63
+ name="enable_real_time_exports"
64
+ value="1" />
65
+ <label for="enable_real_time_exports"><?php esc_html_e('Export each ' . esc_html($display_cpt_name) . ' in real time as they are ' . esc_html($display_verb), 'wp_all_export_plugin') ?></label>
66
+ <span>
67
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;"
68
+ <?php
69
+ if (isset($post['xml_template_type']) && $post['xml_template_type'] == XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS) { ?>
70
+ title="<?php esc_html_e('This feature it not available for Google Merchants Exports.', 'wp_all_export_plugin'); ?>"
71
+ <?php } else if ($cpt_name === 'shop_customer')
72
+ {
73
+ ?>
74
+
75
+ title="<?php esc_html_e('This feature it not available for Customer Exports.', 'wp_all_export_plugin'); ?>"
76
+ <?php } else { ?>
77
+ title="<?php esc_html_e('This will export ' . esc_html(strtolower($tooltip_cpt_name)) . ' one by one, in real time, as they are ' . esc_html($display_verb) . '.'); ?> <br/><br/><strong>Upgrade to the Pro edition of WP All Export to use this option.</strong>">
78
+ <?php } ?>>?</a>
79
+ </span>
80
+
81
+ <div class="wpallexport-free-edition-notice php-rte-upgrade" style="margin: 15px 0; padding: 20px; width: 600px; display: none;">
82
+ <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=real-time-exports"><?php esc_html_e('Upgrade to the Pro edition of WP All Export to export each '. $display_cpt_name .' in real time.','wp_all_export_plugin');?></a>
83
+ <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_export_plugin'); ?></p>
84
+ </div>
85
+ </div>
86
+
87
+
88
+
89
+ <div class="input" style="margin:5px 0px;">
90
  <input type="hidden" name="export_only_new_stuff" value="0" />
91
+ <input type="checkbox" id="export_only_new_stuff" name="export_only_new_stuff" value="1" />
92
+ <label for="export_only_new_stuff"><?php printf(esc_html__('Only export %s once', 'wp_all_export_plugin'), empty($post['cpt']) ? __('records', 'wp_all_export_plugin') : esc_html(wp_all_export_get_cpt_name($post['cpt']))); ?></label>
93
  <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_html_e('If re-run, this export will only include records that have not been previously exported.<br><br><strong>Upgrade to the Pro edition of WP All Export to use this option.</strong>', 'wp_all_export_plugin'); ?>">?</a>
94
+
95
+ <div class="wpallexport-free-edition-notice only-export-posts-once" style="margin: 15px 0; padding: 20px; width: 600px; display: none;">
96
+ <a class="upgrade_link" target="_blank"
97
+ href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-only-new-stuff">
98
+ <?php $noun = empty($post['cpt']) ? __('records', 'wp_all_export_plugin') : esc_html(wp_all_export_get_cpt_name($post['cpt'])); ?>
99
+ <?php esc_html_e('Upgrade to the Pro edition of WP All Export to only export '. $noun .' once.','wp_all_export_plugin');?></a>
100
+ <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_export_plugin'); ?></p>
101
+ </div>
102
+ </div>
103
  <div class="input" style="margin:5px 0px;">
104
  <input type="hidden" name="export_only_modified_stuff" value="0" />
105
+ <input type="checkbox" id="export_only_modified_stuff" name="export_only_modified_stuff" value="1" <?php echo $post['export_only_modified_stuff'] ? 'checked="checked"': '' ?> <?php if (is_array($post['cpt']) && $post['cpt'][0] === 'users') {?> disabled="disabled" <?php }?> />
106
  <label for="export_only_modified_stuff" disabled="disabled"><?php printf(esc_html__('Only export %s that have been modified since last export', 'wp_all_export_plugin'), empty($post['cpt']) ? __('records', 'wp_all_export_plugin') : esc_html(wp_all_export_get_cpt_name($post['cpt'], 2, $post))); ?></label>
107
+
108
+ <?php
109
+ if(is_array($post['cpt']) && $post['cpt'][0] === 'users') {
110
+ ?>
111
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_html_e('This feature is not available for user exports.', 'wp_all_export_plugin'); ?>">?</a>
112
+
113
+ <?php
114
+ } else {
115
+ ?>
116
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_html_e('If re-run, this export will only include records that have been modified since last export run.<br><br><strong>Upgrade to the Pro edition of WP All Export to use this option.</strong>', 'wp_all_export_plugin'); ?>">?</a>
117
+ <?php
118
+ }
119
+ ?>
120
+ <div class="wpallexport-free-edition-notice only-export-modified-posts" style="margin: 15px 0; padding: 20px; width: 600px; display: none;">
121
+ <a class="upgrade_link" target="_blank"
122
+ href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-only-modified-stuff">
123
+ <?php $noun = empty($post['cpt']) ? __('records', 'wp_all_export_plugin') : esc_html(wp_all_export_get_cpt_name($post['cpt'])); ?>
124
+ <?php esc_html_e('Upgrade to the Pro edition of WP All Export to only export '. $noun .' that have been modified since last export.','wp_all_export_plugin');?></a>
125
+ <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_export_plugin'); ?></p>
126
+ </div>
127
+
128
+ </div>
129
 
130
  <div class="input" style="margin:5px 0px;">
131
  <input type="hidden" name="include_bom" value="0" />
151
  </div>
152
  <div class="input" style="margin:5px 0px;">
153
  <input type="hidden" name="allow_client_mode" value="0"/>
154
+ <input type="checkbox" id="allow_client_mode" name="allow_client_mode"
155
  value="1" <?php echo (isset($post['allow_client_mode']) && $post['allow_client_mode']) ? 'checked="checked"' : '' ?> />
156
  <label for="allow_client_mode"><?php esc_html_e('Allow non-admins to run this export in Client Mode', 'wp_all_export_plugin') ?></label>
157
  <span>
158
  <a href="#help" class="wpallexport-help" style="position: relative; top: 0;" title="<?php esc_html_e('When enabled, users with access to Client Mode will be able to run this export and download the export file. Go to All Export > Settings to give users access to Client Mode. <br><br><strong>Upgrade to the Pro edition of WP All Export to use this option.</strong>'); ?>">?</a>
159
  </span>
160
+
161
+ <div class="wpallexport-free-edition-notice client-mode-notice" style="margin: 15px 0; padding: 20px; width: 600px; display: none;">
162
+ <a class="upgrade_link" target="_blank"
163
+ href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=2707173&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=client-mode">
164
+ <?php $noun = empty($post['cpt']) ? __('records', 'wp_all_export_plugin') : esc_html(wp_all_export_get_cpt_name($post['cpt'])); ?>
165
+ <?php esc_html_e('Upgrade to the Pro edition of WP All Export to allow non-admins to run this export in Client Mode.','wp_all_export_plugin');?></a>
166
+ <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_export_plugin'); ?></p>
167
+ </div>
168
  </div>
169
  <br>
170
  <hr>
views/admin/manage/index.php CHANGED
@@ -241,7 +241,7 @@ $columns = apply_filters('pmxe_manage_imports_columns', $columns);
241
  <?php
242
  // Disable scheduling options for ACF exports if ACF Export Add-On isn't enabled
243
  } else if (
244
- ((!in_array('comments', $item['options']['cpt']) || !in_array('shop_review', $item['options']['cpt'])) && in_array('acf', $item['options']['cc_type']) && !$addons->isAcfAddonActive()) ||
245
  ($item['options']['export_type'] == 'advanced' && $item['options']['wp_query_selector'] != 'wp_comment_query' && in_array('acf', $item['options']['cc_type']) && !$addons->isAcfAddonActive())
246
  ) {
247
  ?>
241
  <?php
242
  // Disable scheduling options for ACF exports if ACF Export Add-On isn't enabled
243
  } else if (
244
+ (isset($item['options']['cpt']) && (!in_array('comments', $item['options']['cpt']) || !in_array('shop_review', $item['options']['cpt'])) && isset($item['options']['cc_type']) && in_array('acf', $item['options']['cc_type']) && !$addons->isAcfAddonActive()) ||
245
  ($item['options']['export_type'] == 'advanced' && $item['options']['wp_query_selector'] != 'wp_comment_query' && in_array('acf', $item['options']['cc_type']) && !$addons->isAcfAddonActive())
246
  ) {
247
  ?>
views/admin/settings/index.php CHANGED
@@ -3,37 +3,6 @@ if(!defined('ABSPATH')) {
3
  die();
4
  }
5
  ?>
6
- <style type="text/css">
7
- .wpae-shake {
8
- -webkit-animation: wpae_shake 0.4s 1 linear;
9
- -moz-animation: wpae_shake 0.4s 1 linear;
10
- -o-animation: wpae_shake 0.4s 1 linear;
11
- }
12
- @-webkit-keyframes wpae_shake {
13
- 0% { -webkit-transform: translate(30px); }
14
- 20% { -webkit-transform: translate(-30px); }
15
- 40% { -webkit-transform: translate(15px); }
16
- 60% { -webkit-transform: translate(-15px); }
17
- 80% { -webkit-transform: translate(8px); }
18
- 100% { -webkit-transform: translate(0px); }
19
- }
20
- @-moz-keyframes wpae_shake {
21
- 0% { -moz-transform: translate(30px); }
22
- 20% { -moz-transform: translate(-30px); }
23
- 40% { -moz-transform: translate(15px); }
24
- 60% { -moz-transform: translate(-15px); }
25
- 80% { -moz-transform: translate(8px); }
26
- 100% { -moz-transform: translate(0px); }
27
- }
28
- @-o-keyframes wpae_shake {
29
- 0% { -o-transform: translate(30px); }
30
- 20% { -o-transform: translate(-30px); }
31
- 40% { -o-transform: translate(15px); }
32
- 60% { -o-transform: translate(-15px); }
33
- 80% { -o-transform: translate(8px); }
34
- 100% { -o-origin-transform: translate(0px); }
35
- }
36
- </style>
37
 
38
  <form class="settings" method="post" action="<?php echo esc_url($this->baseUrl); ?>" enctype="multipart/form-data">
39
 
3
  die();
4
  }
5
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  <form class="settings" method="post" action="<?php echo esc_url($this->baseUrl); ?>" enctype="multipart/form-data">
8
 
wp-all-export.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP All Export
4
  Plugin URI: http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=export-plugin-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
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.3.7
7
  Author: Soflyy
8
  */
9
 
@@ -59,7 +59,7 @@ else {
59
  */
60
  define('PMXE_PREFIX', 'pmxe_');
61
 
62
- define('PMXE_VERSION', '1.3.7');
63
 
64
  define('PMXE_ASSETS_VERSION', '-1.0.2');
65
 
3
  Plugin Name: WP All Export
4
  Plugin URI: http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=export-plugin-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
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.3.8
7
  Author: Soflyy
8
  */
9
 
59
  */
60
  define('PMXE_PREFIX', 'pmxe_');
61
 
62
+ define('PMXE_VERSION', '1.3.8');
63
 
64
  define('PMXE_ASSETS_VERSION', '-1.0.2');
65