Export WordPress data to XML/CSV - Version 1.3.2

Version Description

  • improvement: add support for exporting non-WooCommerce 'product' CPTs
  • improvement: initial PHP 8 support
  • improvement: only set max_execution_time on WPAE pages
  • bug fix
Download this release

Release Info

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

Code changes from version 1.3.1 to 1.3.2

actions/wp_ajax_wpae_filtering.php CHANGED
@@ -62,7 +62,7 @@ function pmxe_wp_ajax_wpae_filtering(){
62
  if (!$addons->isWooCommerceAddonActive() &&
63
  (
64
  in_array('shop_order', $cpt) || in_array('shop_review', $cpt) ||
65
- in_array('product', $cpt) || in_array('shop_coupon', $cpt)
66
  )
67
  )
68
  {
@@ -78,7 +78,6 @@ function pmxe_wp_ajax_wpae_filtering(){
78
  $return_empty_buttons = false;
79
  }
80
 
81
-
82
  if($return_empty_buttons) {
83
  exit(json_encode(['btns' => ''])); die;
84
  }
@@ -88,10 +87,16 @@ function pmxe_wp_ajax_wpae_filtering(){
88
  if ( XmlExportEngine::$is_auto_generate_enabled ):
89
  ?>
90
  <div class="wpallexport-free-edition-notice" id="migrate-orders-notice" style="padding: 20px; margin-bottom: 10px; display: none;">
91
- <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=migrate-orders"><?php _e('Upgrade to the Pro edition of WP All Export to Migrate Orders', PMXE_Plugin::LANGUAGE_DOMAIN);?></a>
92
- <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', PMXE_Plugin::LANGUAGE_DOMAIN);?></p>
 
 
 
 
 
93
  </div>
94
 
 
95
  <?php
96
  if($addons->isUserAddonActive() && PMUE_EDITION == 'paid') {
97
  ?>
@@ -99,6 +104,15 @@ function pmxe_wp_ajax_wpae_filtering(){
99
  <?php
100
  }
101
  ?>
 
 
 
 
 
 
 
 
 
102
  <div class="wpallexport-free-edition-notice" id="migrate-users-notice" style="padding: 20px; margin-bottom: 10px; display: none;">
103
  <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=migrate-users"><?php _e('Upgrade to the Pro edition of WP All Export to Migrate Users', PMXE_Plugin::LANGUAGE_DOMAIN);?></a>
104
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', PMXE_Plugin::LANGUAGE_DOMAIN);?></p>
62
  if (!$addons->isWooCommerceAddonActive() &&
63
  (
64
  in_array('shop_order', $cpt) || in_array('shop_review', $cpt) ||
65
+ (in_array('product', $cpt) && \class_exists('WooCommerce')) || in_array('shop_coupon', $cpt)
66
  )
67
  )
68
  {
78
  $return_empty_buttons = false;
79
  }
80
 
 
81
  if($return_empty_buttons) {
82
  exit(json_encode(['btns' => ''])); die;
83
  }
87
  if ( XmlExportEngine::$is_auto_generate_enabled ):
88
  ?>
89
  <div class="wpallexport-free-edition-notice" id="migrate-orders-notice" style="padding: 20px; margin-bottom: 10px; display: none;">
90
+ <p><?php _e('The WooCoommerce Export Package is Required to Migrate Orders.', PMXE_Plugin::LANGUAGE_DOMAIN);?></p><br/>
91
+ <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=4206899&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=migrate-orders"><?php _e('Purchase the WooCommerce Export Package', PMXE_Plugin::LANGUAGE_DOMAIN);?></a>
92
+ </div>
93
+
94
+ <div class="wpallexport-free-edition-notice" id="migrate-products-notice" style="padding: 20px; margin-bottom: 10px; display: none;">
95
+ <p><?php _e('The WooCoommerce Export Package is Required to Migrate Products.', PMXE_Plugin::LANGUAGE_DOMAIN);?></p><br/>
96
+ <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=4206899&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=migrate-products"><?php _e('Purchase the WooCommerce Export Package', PMXE_Plugin::LANGUAGE_DOMAIN);?></a>
97
  </div>
98
 
99
+
100
  <?php
101
  if($addons->isUserAddonActive() && PMUE_EDITION == 'paid') {
102
  ?>
104
  <?php
105
  }
106
  ?>
107
+
108
+ <?php
109
+ if($addons->isWooCommerceAddonActive()) {
110
+ ?>
111
+ <input type="hidden" id="woocommerce_add_on_pro_installed" value="1" />
112
+ <?php
113
+ }
114
+ ?>
115
+
116
  <div class="wpallexport-free-edition-notice" id="migrate-users-notice" style="padding: 20px; margin-bottom: 10px; display: none;">
117
  <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=migrate-users"><?php _e('Upgrade to the Pro edition of WP All Export to Migrate Users', PMXE_Plugin::LANGUAGE_DOMAIN);?></a>
118
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', PMXE_Plugin::LANGUAGE_DOMAIN);?></p>
actions/wp_ajax_wpae_filtering_count.php CHANGED
@@ -58,7 +58,12 @@ function pmxe_wp_ajax_wpae_filtering_count(){
58
  XmlExportEngine::$is_comment_export = ( 'comments' == $post['cpt'] ) ? true : false;
59
  XmlExportEngine::$is_taxonomy_export = ( 'taxonomies' == $post['cpt'] ) ? true : false;
60
  XmlExportEngine::$post_types = array($post['cpt']);
61
- XmlExportEngine::$exportOptions['export_variations'] = empty($post['export_variations']) ? XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT_AND_VARIATION : $post['export_variations'];
 
 
 
 
 
62
 
63
  $filters = \Wpae\Pro\Filtering\FilteringFactory::getFilterEngine();
64
  $filters->init($filter_args);
@@ -232,7 +237,12 @@ function pmxe_wp_ajax_wpae_filtering_count(){
232
  remove_all_actions('pre_get_posts');
233
  remove_all_filters('posts_clauses');
234
 
235
- $cpt = ($is_products_export) ? array('product', 'product_variation') : array($post['cpt']);
 
 
 
 
 
236
 
237
  // get total custom post type records
238
  $totalQuery = new WP_Query( array( 'post_type' => $cpt, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
@@ -244,7 +254,7 @@ function pmxe_wp_ajax_wpae_filtering_count(){
244
  wp_reset_postdata();
245
 
246
  ob_start();
247
- // get custom post type records depends on filters
248
  add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
249
  add_filter('posts_where', 'wp_all_export_numbering_where', 15, 1);
250
 
@@ -255,15 +265,24 @@ function pmxe_wp_ajax_wpae_filtering_count(){
255
 
256
  add_filter('posts_where', 'wp_all_export_numbering_where', 15, 1);
257
 
258
- $productsQuery = new WP_Query( array( 'post_type' => array('product', 'product_variation'), 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10));
259
- $variationsQuery = new WP_Query( array( 'post_type' => 'product_variation', 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10));
 
 
 
 
 
 
 
260
 
261
- $foundProducts = $productsQuery->found_posts;
 
 
262
 
263
- $foundVariations = $variationsQuery->found_posts;
264
 
265
- $foundRecords = $foundProducts;
266
- $hasVariations = !!$foundVariations;
 
267
 
268
  remove_filter('posts_where', 'wp_all_export_numbering_where');
269
 
58
  XmlExportEngine::$is_comment_export = ( 'comments' == $post['cpt'] ) ? true : false;
59
  XmlExportEngine::$is_taxonomy_export = ( 'taxonomies' == $post['cpt'] ) ? true : false;
60
  XmlExportEngine::$post_types = array($post['cpt']);
61
+
62
+ if(XmlExportEngine::get_addons_service()->isWooCommerceAddonActive()) {
63
+ XmlExportEngine::$exportOptions['export_variations'] = empty($post['export_variations']) ? XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT_AND_VARIATION : $post['export_variations'];
64
+ } else {
65
+ XmlExportEngine::$exportOptions['export_variations'] = XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT;
66
+ }
67
 
68
  $filters = \Wpae\Pro\Filtering\FilteringFactory::getFilterEngine();
69
  $filters->init($filter_args);
237
  remove_all_actions('pre_get_posts');
238
  remove_all_filters('posts_clauses');
239
 
240
+ if(XmlExportEngine::get_addons_service()->isWooCommerceAddonActive()) {
241
+ $custom_posts = ['product', 'product_variation'];
242
+ } else {
243
+ $custom_posts = ['product'];
244
+ }
245
+ $cpt = ($is_products_export) ? $custom_posts : array($post['cpt']);
246
 
247
  // get total custom post type records
248
  $totalQuery = new WP_Query( array( 'post_type' => $cpt, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
254
  wp_reset_postdata();
255
 
256
  ob_start();
257
+ // get custom post type records depends on filters
258
  add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
259
  add_filter('posts_where', 'wp_all_export_numbering_where', 15, 1);
260
 
265
 
266
  add_filter('posts_where', 'wp_all_export_numbering_where', 15, 1);
267
 
268
+ if(XmlExportEngine::get_addons_service()->isWooCommerceAddonActive()) {
269
+ $productsQuery = new WP_Query(array('post_type' => array('product', 'product_variation'), 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10));
270
+ $variationsQuery = new WP_Query(array('post_type' => 'product_variation', 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10));
271
+
272
+ $foundProducts = $productsQuery->found_posts;
273
+ $foundVariations = $variationsQuery->found_posts;
274
+
275
+ $foundRecords = $foundProducts;
276
+ $hasVariations = !!$foundVariations;
277
 
278
+ } else if (XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive()) {
279
+ $productsQuery = new WP_Query(array('post_type' => array('product'), 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10));
280
+ $foundProducts = $productsQuery->found_posts;
281
 
 
282
 
283
+ $foundRecords = $foundProducts;
284
+ $hasVariations = false;
285
+ }
286
 
287
  remove_filter('posts_where', 'wp_all_export_numbering_where');
288
 
actions/wp_ajax_wpallexport.php CHANGED
@@ -74,8 +74,6 @@ function pmxe_wp_ajax_wpallexport()
74
  } else {
75
  XmlExportEngine::$post_types = $exportOptions['cpt'];
76
 
77
- // $is_products_export = ($exportOptions['cpt'] == 'product' and class_exists('WooCommerce'));
78
-
79
  if (in_array('users', $exportOptions['cpt']) or in_array('shop_customer', $exportOptions['cpt'])) {
80
  add_action('pre_user_query', 'wp_all_export_pre_user_query', 10, 1);
81
  $exportQuery = new WP_User_Query(array('orderby' => 'ID', 'order' => 'ASC', 'number' => $posts_per_page, 'offset' => $export->exported));
74
  } else {
75
  XmlExportEngine::$post_types = $exportOptions['cpt'];
76
 
 
 
77
  if (in_array('users', $exportOptions['cpt']) or in_array('shop_customer', $exportOptions['cpt'])) {
78
  add_action('pre_user_query', 'wp_all_export_pre_user_query', 10, 1);
79
  $exportQuery = new WP_User_Query(array('orderby' => 'ID', 'order' => 'ASC', 'number' => $posts_per_page, 'offset' => $export->exported));
actions/wp_loaded.php CHANGED
@@ -4,145 +4,6 @@ function pmxe_wp_loaded() {
4
 
5
  @ini_set("max_input_time", PMXE_Plugin::getInstance()->getOption('max_input_time'));
6
 
7
- $maxExecutionTime = PMXE_Plugin::getInstance()->getOption('max_execution_time');
8
- if($maxExecutionTime == -1) {
9
- $maxExecutionTime = 0;
10
- }
11
-
12
- $scheduledExport = new \Wpae\Scheduling\Export();
13
-
14
- if ( ! empty($_GET['zapier_subscribe']) and ! empty($_GET['api_key']) )
15
- {
16
- pmxe_set_max_execution_time();
17
- $zapier_api_key = PMXE_Plugin::getInstance()->getOption('zapier_api_key');
18
-
19
- if ( ! empty($zapier_api_key) and $zapier_api_key == $_GET['api_key'] )
20
- {
21
- $subscriptions = get_option('zapier_subscribe', array());
22
-
23
- $body = json_decode(file_get_contents("php://input"), true);
24
-
25
- if ( ! empty($body))
26
- {
27
- $subscriptions[basename($body['target_url'])] = $body;
28
- }
29
-
30
- update_option('zapier_subscribe', $subscriptions);
31
-
32
- exit(json_encode(array('status' => 200)));
33
- }
34
- else
35
- {
36
- http_response_code(401);
37
- exit(json_encode(array('status' => 'error')));
38
- }
39
- }
40
-
41
- if ( ! empty($_GET['zapier_unsubscribe']) and ! empty($_GET['api_key']) )
42
- {
43
- pmxe_set_max_execution_time();
44
- $zapier_api_key = PMXE_Plugin::getInstance()->getOption('zapier_api_key');
45
-
46
- if ( ! empty($zapier_api_key) and $zapier_api_key == $_GET['api_key'] )
47
- {
48
- $subscriptions = get_option('zapier_subscribe', array());
49
-
50
- $body = json_decode(file_get_contents("php://input"), true);
51
-
52
- if ( ! empty($subscriptions[basename($body['target_url'])]) ) unset($subscriptions[basename($body['target_url'])]);
53
-
54
- update_option('zapier_subscribe', $subscriptions);
55
-
56
- exit(json_encode(array('status' => 200)));
57
- }
58
- else
59
- {
60
- http_response_code(401);
61
- exit(json_encode(array('status' => 'error')));
62
- }
63
- }
64
-
65
- if ( ! empty($_GET['export_completed']) and ! empty($_GET['api_key']))
66
- {
67
- pmxe_set_max_execution_time();
68
-
69
- $zapier_api_key = PMXE_Plugin::getInstance()->getOption('zapier_api_key');
70
-
71
- if ( ! empty($zapier_api_key) and $zapier_api_key == $_GET['api_key'] )
72
- {
73
-
74
- global $wpdb;
75
-
76
- $table_prefix = PMXE_Plugin::getInstance()->getTablePrefix();
77
-
78
- $export = $wpdb->get_row("SELECT * FROM {$table_prefix}exports ORDER BY `id` DESC LIMIT 1");
79
-
80
- if ( ! empty($export) and ! is_wp_error($export) )
81
- {
82
- $child_export = new PMXE_Export_Record();
83
- $child_export->getById( $export->id );
84
-
85
- if ( ! $child_export->isEmpty())
86
- {
87
- $wp_uploads = wp_upload_dir();
88
-
89
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
90
-
91
- if ( ! $is_secure_import)
92
- {
93
- $filepath = get_attached_file($child_export->attch_id);
94
- }
95
- else
96
- {
97
- $filepath = wp_all_export_get_absolute_path($child_export->options['filepath']);
98
- }
99
-
100
- $fileurl = str_replace($wp_uploads['basedir'], $wp_uploads['baseurl'], $filepath);
101
-
102
- $response = array(
103
- 'website_url' => home_url(),
104
- 'export_id' => $child_export->id,
105
- 'export_name' => $child_export->friendly_name,
106
- 'file_name' => basename($filepath),
107
- 'file_type' => $child_export->options['export_to'],
108
- 'post_types_exported' => empty($child_export->options['cpt']) ? $child_export->options['wp_query'] : implode($child_export->options['cpt'], ','),
109
- 'export_created_date' => $child_export->registered_on,
110
- 'export_last_run_date' => date('Y-m-d H:i:s'),
111
- 'export_trigger_type' => 'manual',
112
- 'records_exported' => $child_export->exported,
113
- 'export_file' => ''
114
- );
115
-
116
- if (file_exists($filepath))
117
- {
118
- $response['export_file_url'] = $fileurl;
119
- $response['status'] = 200;
120
- $response['message'] = 'OK';
121
- }
122
- else
123
- {
124
- $response['export_file_url'] = '';
125
- $response['status'] = 300;
126
- $response['message'] = 'File doesn\'t exist';
127
- }
128
-
129
- $response = apply_filters('wp_all_export_zapier_response', $response);
130
-
131
- wp_send_json(array($response));
132
- }
133
- }
134
-
135
- }
136
- else
137
- {
138
- http_response_code(401);
139
- exit(json_encode(array('status' => 'error')));
140
- }
141
- }
142
-
143
- /* Check if cron is manualy, then execute export */
144
- $cron_job_key = PMXE_Plugin::getInstance()->getOption('cron_job_key');
145
-
146
  if ( ! empty($_GET['action']) && ! empty($_GET['export_id']) && (!empty($_GET['export_hash']) || !empty($_GET['security_token'])))
147
  {
148
  pmxe_set_max_execution_time();
@@ -153,6 +14,8 @@ function pmxe_wp_loaded() {
153
  $securityToken = $_GET['export_hash'];
154
  }
155
 
 
 
156
  if ( $securityToken == substr(md5($cron_job_key . $_GET['export_id']), 0, 16) )
157
  {
158
  $export = new PMXE_Export_Record();
4
 
5
  @ini_set("max_input_time", PMXE_Plugin::getInstance()->getOption('max_input_time'));
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  if ( ! empty($_GET['action']) && ! empty($_GET['export_id']) && (!empty($_GET['export_hash']) || !empty($_GET['security_token'])))
8
  {
9
  pmxe_set_max_execution_time();
14
  $securityToken = $_GET['export_hash'];
15
  }
16
 
17
+ $cron_job_key = PMXE_Plugin::getInstance()->getOption('cron_job_key');
18
+
19
  if ( $securityToken == substr(md5($cron_job_key . $_GET['export_id']), 0, 16) )
20
  {
21
  $export = new PMXE_Export_Record();
classes/wpallimport.php CHANGED
@@ -505,7 +505,9 @@ final class PMXE_Wpallimport
505
  );
506
  }
507
 
508
- XmlExportWooCommerce::prepare_import_template( $options, self::$templateOptions, $cf_list, $attr_list, $element_name, $options['cc_label'][$ID] );
 
 
509
  }
510
 
511
  break;
@@ -548,7 +550,7 @@ final class PMXE_Wpallimport
548
 
549
  XmlExportTaxonomy::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
550
 
551
- if($addons->isWooCommerceAddonActive()) {
552
  XmlExportWooCommerceOrder::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
553
  }
554
 
505
  );
506
  }
507
 
508
+ if($addons->isWooCommerceAddonActive() || $addons->isWooCommerceProductAddonActive()) {
509
+ XmlExportWooCommerce::prepare_import_template( $options, self::$templateOptions, $cf_list, $attr_list, $element_name, $options['cc_label'][$ID] );
510
+ }
511
  }
512
 
513
  break;
550
 
551
  XmlExportTaxonomy::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
552
 
553
+ if($addons->isWooCommerceAddonActive() || $addons->isWooCommerceOrderAddonActive()) {
554
  XmlExportWooCommerceOrder::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
555
  }
556
 
helpers/pmxe_functions.php CHANGED
@@ -56,7 +56,7 @@
56
  {
57
  if (empty($post_type)) return array();
58
 
59
- $post_type = ($post_type == 'product' and class_exists('WooCommerce')) ? array('product', 'product_variation') : array($post_type);
60
 
61
  global $wpdb;
62
  $table_prefix = $wpdb->prefix;
56
  {
57
  if (empty($post_type)) return array();
58
 
59
+ $post_type = ($post_type == 'product' and class_exists('WooCommerce')) ? array('product') : array($post_type);
60
 
61
  global $wpdb;
62
  $table_prefix = $wpdb->prefix;
libraries/XmlCsvExport.php CHANGED
@@ -41,10 +41,6 @@ final Class XmlCsvExport
41
  $acfs = array();
42
  $articles = array();
43
 
44
- // self::$implode = (XmlExportEngine::$exportOptions['delimiter'] == ',') ? '|' : ',';
45
- //
46
- // self::$implode = apply_filters('wp_all_export_implode_delimiter', self::$implode, XmlExportEngine::$exportID);
47
-
48
  // [ Exporting requested data ]
49
 
50
  if ( XmlExportEngine::$is_user_export ) { // exporting WordPress users
@@ -91,7 +87,7 @@ final Class XmlCsvExport
91
  if (!$preview) do_action('pmxe_exported_post', $record->ID, XmlExportEngine::$exportRecord);
92
  }
93
 
94
- wp_reset_postdata();
95
  }
96
  // [ \Exporting requested data ]
97
 
@@ -504,11 +500,15 @@ final Class XmlCsvExport
504
  switch (XmlExportEngine::$exportOptions['cc_type'][$ID])
505
  {
506
  case 'woo':
507
- XmlExportEngine::$woo_export->get_element_header( $headers, XmlExportEngine::$exportOptions, $ID );
 
 
508
  break;
509
 
510
  case 'woo_order':
511
- XmlExportEngine::$woo_order_export->get_element_header( $headers, XmlExportEngine::$exportOptions, $ID );
 
 
512
  break;
513
 
514
  case 'acf':
@@ -761,7 +761,7 @@ final Class XmlCsvExport
761
  foreach ($available_sections as $slug => $section) {
762
  if (!empty($section['content']) and !empty($available_data[$section['content']])) {
763
  foreach ($available_data[$section['content']] as $field) {
764
- if (is_array($field) and (isset($field['auto']) or !in_array('product', $post['cpt']))) {
765
  $auto_generate['ids'][] = 1;
766
  $auto_generate['cc_label'][] = is_array($field) ? $field['label'] : $field;
767
  $auto_generate['cc_php'][] = 0;
@@ -809,7 +809,13 @@ final Class XmlCsvExport
809
  }
810
  }
811
 
812
- if (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() && XmlExportWooCommerceOrder::$is_active) {
 
 
 
 
 
 
813
  foreach (XmlExportWooCommerceOrder::$order_sections as $slug => $section) {
814
  if (!empty($section['meta'])) {
815
  foreach ($section['meta'] as $cur_meta_key => $field) {
41
  $acfs = array();
42
  $articles = array();
43
 
 
 
 
 
44
  // [ Exporting requested data ]
45
 
46
  if ( XmlExportEngine::$is_user_export ) { // exporting WordPress users
87
  if (!$preview) do_action('pmxe_exported_post', $record->ID, XmlExportEngine::$exportRecord);
88
  }
89
 
90
+ wp_reset_postdata();
91
  }
92
  // [ \Exporting requested data ]
93
 
500
  switch (XmlExportEngine::$exportOptions['cc_type'][$ID])
501
  {
502
  case 'woo':
503
+ if(XmlExportEngine::$woo_export) {
504
+ XmlExportEngine::$woo_export->get_element_header($headers, XmlExportEngine::$exportOptions, $ID);
505
+ }
506
  break;
507
 
508
  case 'woo_order':
509
+ if(XmlExportEngine::$woo_order_export) {
510
+ XmlExportEngine::$woo_order_export->get_element_header($headers, XmlExportEngine::$exportOptions, $ID);
511
+ }
512
  break;
513
 
514
  case 'acf':
761
  foreach ($available_sections as $slug => $section) {
762
  if (!empty($section['content']) and !empty($available_data[$section['content']])) {
763
  foreach ($available_data[$section['content']] as $field) {
764
+ if (is_array($field) and (isset($field['auto']) or (!in_array('product', $post['cpt']) || !\class_exists('WooCommerce')))) {
765
  $auto_generate['ids'][] = 1;
766
  $auto_generate['cc_label'][] = is_array($field) ? $field['label'] : $field;
767
  $auto_generate['cc_php'][] = 0;
809
  }
810
  }
811
 
812
+ if (
813
+ (
814
+ XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() ||
815
+ XmlExportEngine::get_addons_service()->isWooCommerceOrderAddonActive()
816
+ )
817
+ && XmlExportWooCommerceOrder::$is_active) {
818
+
819
  foreach (XmlExportWooCommerceOrder::$order_sections as $slug => $section) {
820
  if (!empty($section['meta'])) {
821
  foreach ($section['meta'] as $cur_meta_key => $field) {
libraries/XmlExportComment.php CHANGED
@@ -209,7 +209,7 @@ if (!class_exists('XmlExportComment')) {
209
  }
210
  }
211
 
212
- public static function prepare_data($comment, $exportOptions, $xmlWriter = false, $implode_delimiter, $preview)
213
  {
214
  $article = array();
215
 
209
  }
210
  }
211
 
212
+ public static function prepare_data($comment, $exportOptions, $xmlWriter, $implode_delimiter, $preview)
213
  {
214
  $article = array();
215
 
libraries/XmlExportCpt.php CHANGED
@@ -8,7 +8,7 @@ final class XmlExportCpt
8
  private static $userData = array();
9
 
10
  public static function prepare_data($entry, $exportOptions,
11
- $xmlWriter = false, &$acfs, &$woo, &$woo_order, $implode_delimiter, $preview, $is_item_data = false, $subID = false)
12
  {
13
  $variationOptionsFactory = new VariationOptionsFactory();
14
  $variationOptions = $variationOptionsFactory->createVariationOptions(PMXE_EDITION);
@@ -18,6 +18,7 @@ final class XmlExportCpt
18
 
19
  // associate exported post with import
20
  if (!$is_item_data and wp_all_export_is_compatible() && isset($exportOptions['is_generate_import']) && isset($exportOptions['import_id'])) {
 
21
  $postRecord = new PMXI_Post_Record();
22
  $postRecord->clear();
23
  $postRecord->getBy(array(
@@ -358,11 +359,11 @@ final class XmlExportCpt
358
  case 'woo':
359
 
360
  if ($is_xml_export) {
361
- if (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive()) {
362
  XmlExportEngine::$woo_export->export_xml($xmlWriter, $entry, $exportOptions, $ID);
363
  }
364
  } else {
365
- if (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive()) {
366
  XmlExportEngine::$woo_export->export_csv($article, $woo, $entry, $exportOptions, $ID);
367
  }
368
  }
@@ -372,11 +373,11 @@ final class XmlExportCpt
372
  case 'woo_order':
373
 
374
  if ($is_xml_export) {
375
- if (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive()) {
376
  XmlExportEngine::$woo_order_export->export_xml($xmlWriter, $entry, $exportOptions, $ID, $preview);
377
  }
378
  } else {
379
- if (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive()) {
380
  XmlExportEngine::$woo_order_export->export_csv($article, $woo_order, $entry, $exportOptions, $ID, $preview);
381
  }
382
  }
8
  private static $userData = array();
9
 
10
  public static function prepare_data($entry, $exportOptions,
11
+ $xmlWriter, &$acfs, &$woo, &$woo_order, $implode_delimiter, $preview, $is_item_data = false, $subID = false)
12
  {
13
  $variationOptionsFactory = new VariationOptionsFactory();
14
  $variationOptions = $variationOptionsFactory->createVariationOptions(PMXE_EDITION);
18
 
19
  // associate exported post with import
20
  if (!$is_item_data and wp_all_export_is_compatible() && isset($exportOptions['is_generate_import']) && isset($exportOptions['import_id'])) {
21
+
22
  $postRecord = new PMXI_Post_Record();
23
  $postRecord->clear();
24
  $postRecord->getBy(array(
359
  case 'woo':
360
 
361
  if ($is_xml_export) {
362
+ if (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() || XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive()) {
363
  XmlExportEngine::$woo_export->export_xml($xmlWriter, $entry, $exportOptions, $ID);
364
  }
365
  } else {
366
+ if (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() || XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive()) {
367
  XmlExportEngine::$woo_export->export_csv($article, $woo, $entry, $exportOptions, $ID);
368
  }
369
  }
373
  case 'woo_order':
374
 
375
  if ($is_xml_export) {
376
+ if (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() || XmlExportEngine::get_addons_service()->isWooCommerceOrderAddonActive()) {
377
  XmlExportEngine::$woo_order_export->export_xml($xmlWriter, $entry, $exportOptions, $ID, $preview);
378
  }
379
  } else {
380
+ if (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() || XmlExportEngine::get_addons_service()->isWooCommerceOrderAddonActive()) {
381
  XmlExportEngine::$woo_order_export->export_csv($article, $woo_order, $entry, $exportOptions, $ID, $preview);
382
  }
383
  }
libraries/XmlExportEngine.php CHANGED
@@ -380,7 +380,11 @@ if ( ! class_exists('XmlExportEngine') ){
380
 
381
  self::$post_types = ( ! is_array($this->post['cpt']) ) ? array($this->post['cpt']) : $this->post['cpt'];
382
 
383
- if ( in_array('product', self::$post_types) and ! in_array('product_variation', self::$post_types)) self::$post_types[] = 'product_variation';
 
 
 
 
384
 
385
  self::$is_user_export = ( in_array('users', self::$post_types) or in_array('shop_customer', self::$post_types) ) ? true : false;
386
 
@@ -470,7 +474,7 @@ if ( ! class_exists('XmlExportEngine') ){
470
  if( "" == $this->post['wp_query'] ){
471
  $this->errors->add('form-validation', __('WP Query field is required', 'pmxe_plugin'));
472
  }
473
- else if(!XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() && strpos($this->post['wp_query'], 'product') !== false) {
474
  $this->errors->add('form-validation', __('The WooCommerce Export Add-On Pro is required to Export WooCommerce Products', 'pmxe_plugin'));
475
  }
476
  else if(!XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() && strpos($this->post['wp_query'], 'shop_order') !== false) {
@@ -506,9 +510,12 @@ if ( ! class_exists('XmlExportEngine') ){
506
  public function init_additional_data(){
507
 
508
  if(self::$woo_export) {
509
- self::$woo_order_export->init_additional_data();
510
  self::$woo_export->init_additional_data();
511
  }
 
 
 
 
512
  }
513
 
514
  public function init_available_data(){
@@ -556,12 +563,17 @@ if ( ! class_exists('XmlExportEngine') ){
556
  // Prepare existing WooCommerce data
557
  self::$woo_export->init($this->_existing_meta_keys);
558
 
 
 
 
 
 
 
559
  // Prepare existing WooCommerce Order data
560
  self::$woo_order_export->init($this->_existing_meta_keys);
561
 
562
- // Prepare existing WooCommerce Coupon data
563
- self::$woo_coupon_export->init($this->_existing_meta_keys);
564
- }
565
 
566
  if(XmlExportEngine::$user_export) {
567
  // Prepare existing Users data
@@ -710,7 +722,7 @@ if ( ! class_exists('XmlExportEngine') ){
710
  $available_sections = apply_filters("wp_all_export_available_sections", $this->available_sections);
711
  self::$globalAvailableSections = $available_sections;
712
 
713
- if(self::$woo_export) {
714
  // Render Available WooCommerce Orders Data
715
  self::$woo_order_export->render($i);
716
  }
@@ -760,7 +772,7 @@ if ( ! class_exists('XmlExportEngine') ){
760
 
761
  if ( $field_type == 'cf' && $field_name == '_thumbnail_id' ) continue;
762
 
763
- $is_auto_field = ( ! empty($field['auto']) or self::$is_auto_generate_enabled and ('specific' != $this->post['export_type'] or 'specific' == $this->post['export_type'] and ! in_array(self::$post_types[0], array('product'))));
764
 
765
  ?>
766
  <li class="pmxe_<?php echo $slug; ?> <?php if ( $is_auto_field ) echo 'wp_all_export_auto_generate';?> <?php echo $elementClass;?>">
@@ -785,46 +797,67 @@ if ( ! class_exists('XmlExportEngine') ){
785
 
786
  if ( ! empty($section['additional']) )
787
  {
788
- foreach ($section['additional'] as $sub_slug => $sub_section)
789
  {
790
- ?>
791
- <li class="available_sub_section">
792
- <p class="wpae-available-fields-group"><?php echo $sub_section['title']; ?><span class="wpae-expander">+</span></p>
793
- <div class="wpae-custom-field">
794
- <ul>
795
- <li>
796
- <div class="default_column" rel="">
797
- <label class="wpallexport-element-label"><?php echo __("All", "wp_all_export_plugin") . ' ' . $sub_section['title']; ?></label>
798
- <input type="hidden" name="rules[]" value="pmxe_<?php echo $slug;?>_<?php echo $sub_slug;?>"/>
799
- </div>
800
- </li>
801
- <?php
802
- foreach ($sub_section['meta'] as $field) {
803
- $is_auto_field = empty($field['auto']) ? false : true;
804
- $field_options = ( in_array($sub_slug, array('images', 'attachments')) ) ? esc_attr('{"is_export_featured":true,"is_export_attached":true,"image_separator":"|"}') : '0';
805
- ?>
806
- <li class="pmxe_<?php echo $slug; ?>_<?php echo $sub_slug;?> <?php if ( $is_auto_field ) echo 'wp_all_export_auto_generate';?>">
807
- <div class="custom_column" rel="<?php echo ($i + 1);?>">
808
- <label class="wpallexport-xml-element"><?php echo (is_array($field)) ? XmlExportEngine::sanitizeFieldName($field['name']) : $field; ?></label>
809
- <input type="hidden" name="ids[]" value="1"/>
810
- <input type="hidden" name="cc_label[]" value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
811
- <input type="hidden" name="cc_php[]" value="0"/>
812
- <input type="hidden" name="cc_code[]" value="0"/>
813
- <input type="hidden" name="cc_sql[]" value="0"/>
814
- <input type="hidden" name="cc_options[]" value="<?php echo $field_options; ?>"/>
815
- <input type="hidden" name="cc_type[]" value="<?php echo (is_array($field)) ? $field['type'] : $sub_slug; ?>"/>
816
- <input type="hidden" name="cc_value[]" value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
817
- <input type="hidden" name="cc_name[]" value="<?php echo (is_array($field)) ? XmlExportEngine::sanitizeFieldName($field['name']) : $field;?>"/>
818
- <input type="hidden" name="cc_settings[]" value=""/>
819
- </div>
820
- </li>
821
- <?php
822
- $i++;
823
- }
824
- ?>
825
- </ul>
826
- </li>
827
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
828
  }
829
  }
830
  ?>
@@ -864,7 +897,7 @@ if ( ! class_exists('XmlExportEngine') ){
864
 
865
  $available_sections = apply_filters("wp_all_export_available_sections", apply_filters('wp_all_export_filters', $this->available_sections) );
866
 
867
- if(self::$woo_export) {
868
  // Render Filters for WooCommerce Orders
869
  self::$woo_order_export->render_filters();
870
  }
@@ -1004,22 +1037,23 @@ if ( ! class_exists('XmlExportEngine') ){
1004
  <optgroup label="<?php echo $sub_section['title']; ?>">
1005
  <?php
1006
  foreach ($sub_section['meta'] as $field) :
1007
-
1008
- switch ($field['type']) {
1009
- case 'attr':
1010
- ?>
1011
- <option value="<?php echo 'tx_' . $field['label']; ?>"><?php echo $field['name']; ?></option>
1012
- <?php
1013
- break;
1014
- case 'cf':
1015
- ?>
1016
- <option value="<?php echo 'cf_' . $field['label']; ?>"><?php echo $field['name']; ?></option>
1017
- <?php
1018
- break;
1019
- default:
1020
- # code...
1021
- break;
1022
- }
 
1023
 
1024
  endforeach;
1025
  ?>
@@ -1047,7 +1081,7 @@ if ( ! class_exists('XmlExportEngine') ){
1047
 
1048
  $available_sections = apply_filters("wp_all_export_available_sections", $this->available_sections);
1049
 
1050
- if(self::$woo_export) {
1051
  // Render Available WooCommerce Orders Data
1052
  self::$woo_order_export->render_new_field();
1053
  }
@@ -1058,8 +1092,12 @@ if ( ! class_exists('XmlExportEngine') ){
1058
 
1059
  <?php
1060
  foreach ($available_sections as $slug => $section)
1061
- {
1062
- if ( ! empty($this->available_data[$section['content']]) or ! empty($section['additional']) ):
 
 
 
 
1063
  ?>
1064
  <optgroup label="<?php echo $section['title']; ?>">
1065
 
380
 
381
  self::$post_types = ( ! is_array($this->post['cpt']) ) ? array($this->post['cpt']) : $this->post['cpt'];
382
 
383
+ if( \class_exists('WooCommerce') && XmlExportEngine::get_addons_service()->isWooCommerceAddonActive()) {
384
+ if (in_array('product', self::$post_types) and !in_array('product_variation', self::$post_types)) self::$post_types[] = 'product_variation';
385
+ } else if(\class_exists('WooCommerce') && in_array('product', self::$post_types) && XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive()) {
386
+ self::$post_types = ['product'];
387
+ }
388
 
389
  self::$is_user_export = ( in_array('users', self::$post_types) or in_array('shop_customer', self::$post_types) ) ? true : false;
390
 
474
  if( "" == $this->post['wp_query'] ){
475
  $this->errors->add('form-validation', __('WP Query field is required', 'pmxe_plugin'));
476
  }
477
+ else if(!XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() && strpos($this->post['wp_query'], 'product') !== false && \class_exists('WooCommerce')) {
478
  $this->errors->add('form-validation', __('The WooCommerce Export Add-On Pro is required to Export WooCommerce Products', 'pmxe_plugin'));
479
  }
480
  else if(!XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() && strpos($this->post['wp_query'], 'shop_order') !== false) {
510
  public function init_additional_data(){
511
 
512
  if(self::$woo_export) {
 
513
  self::$woo_export->init_additional_data();
514
  }
515
+
516
+ if(self::$woo_order_export) {
517
+ self::$woo_order_export->init_additional_data();
518
+ }
519
  }
520
 
521
  public function init_available_data(){
563
  // Prepare existing WooCommerce data
564
  self::$woo_export->init($this->_existing_meta_keys);
565
 
566
+ if(self::get_addons_service()->isWooCommerceAddonActive()) {
567
+ // Prepare existing WooCommerce Coupon data
568
+ self::$woo_coupon_export->init($this->_existing_meta_keys);
569
+ }
570
+ }
571
+ if(XmlExportEngine::$woo_order_export) {
572
  // Prepare existing WooCommerce Order data
573
  self::$woo_order_export->init($this->_existing_meta_keys);
574
 
575
+
576
+ }
 
577
 
578
  if(XmlExportEngine::$user_export) {
579
  // Prepare existing Users data
722
  $available_sections = apply_filters("wp_all_export_available_sections", $this->available_sections);
723
  self::$globalAvailableSections = $available_sections;
724
 
725
+ if(self::$woo_order_export) {
726
  // Render Available WooCommerce Orders Data
727
  self::$woo_order_export->render($i);
728
  }
772
 
773
  if ( $field_type == 'cf' && $field_name == '_thumbnail_id' ) continue;
774
 
775
+ $is_auto_field = ( ! empty($field['auto']) or self::$is_auto_generate_enabled and ('specific' != $this->post['export_type'] or 'specific' == $this->post['export_type'] and (! in_array(self::$post_types[0], array('product')) || !\class_exists('WooCommerce'))));
776
 
777
  ?>
778
  <li class="pmxe_<?php echo $slug; ?> <?php if ( $is_auto_field ) echo 'wp_all_export_auto_generate';?> <?php echo $elementClass;?>">
797
 
798
  if ( ! empty($section['additional']) )
799
  {
800
+ foreach ($section['additional'] as $sub_slug => $sub_section)
801
  {
802
+
803
+ ?>
804
+ <li class="available_sub_section">
805
+ <p class="wpae-available-fields-group"><?php echo $sub_section['title']; ?><span
806
+ class="wpae-expander">+</span></p>
807
+ <div class="wpae-custom-field">
808
+ <?php
809
+ $show_additional_subsection = apply_filters("wp_all_export_show_additional_subsection", true, $sub_slug, $sub_section);
810
+ do_action("wp_all_export_before_available_subsection", $sub_slug, $sub_section);
811
+
812
+
813
+ if($show_additional_subsection) { ?>
814
+
815
+ <ul>
816
+ <li>
817
+ <div class="default_column" rel="">
818
+ <label class="wpallexport-element-label"><?php echo __("All", "wp_all_export_plugin") . ' ' . $sub_section['title']; ?></label>
819
+ <input type="hidden" name="rules[]"
820
+ value="pmxe_<?php echo $slug; ?>_<?php echo $sub_slug; ?>"/>
821
+ </div>
822
+ </li>
823
+ <?php
824
+ foreach ($sub_section['meta'] as $field) {
825
+ $is_auto_field = empty($field['auto']) ? false : true;
826
+ $field_options = (in_array($sub_slug, array('images', 'attachments'))) ? esc_attr('{"is_export_featured":true,"is_export_attached":true,"image_separator":"|"}') : '0';
827
+ ?>
828
+ <li class="pmxe_<?php echo $slug; ?>_<?php echo $sub_slug; ?> <?php if ($is_auto_field) echo 'wp_all_export_auto_generate'; ?>">
829
+ <div class="custom_column" rel="<?php echo($i + 1); ?>">
830
+ <label class="wpallexport-xml-element"><?php echo (is_array($field)) ? XmlExportEngine::sanitizeFieldName($field['name']) : $field; ?></label>
831
+ <input type="hidden" name="ids[]" value="1"/>
832
+ <input type="hidden" name="cc_label[]"
833
+ value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
834
+ <input type="hidden" name="cc_php[]" value="0"/>
835
+ <input type="hidden" name="cc_code[]" value="0"/>
836
+ <input type="hidden" name="cc_sql[]" value="0"/>
837
+ <input type="hidden" name="cc_options[]"
838
+ value="<?php echo $field_options; ?>"/>
839
+ <input type="hidden" name="cc_type[]"
840
+ value="<?php echo (is_array($field)) ? $field['type'] : $sub_slug; ?>"/>
841
+ <input type="hidden" name="cc_value[]"
842
+ value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
843
+ <input type="hidden" name="cc_name[]"
844
+ value="<?php echo (is_array($field)) ? XmlExportEngine::sanitizeFieldName($field['name']) : $field; ?>"/>
845
+ <input type="hidden" name="cc_settings[]" value=""/>
846
+ </div>
847
+ </li>
848
+ <?php
849
+ $i++;
850
+
851
+ }
852
+ ?>
853
+ </ul>
854
+ <?php
855
+ }
856
+ ?>
857
+ </div>
858
+ </li>
859
+ <?php
860
+
861
  }
862
  }
863
  ?>
897
 
898
  $available_sections = apply_filters("wp_all_export_available_sections", apply_filters('wp_all_export_filters', $this->available_sections) );
899
 
900
+ if(self::$woo_order_export) {
901
  // Render Filters for WooCommerce Orders
902
  self::$woo_order_export->render_filters();
903
  }
1037
  <optgroup label="<?php echo $sub_section['title']; ?>">
1038
  <?php
1039
  foreach ($sub_section['meta'] as $field) :
1040
+ if ( isset( $field['type'] ) ) {
1041
+ switch ( $field['type'] ) {
1042
+ case 'attr':
1043
+ ?>
1044
+ <option value="<?php echo 'tx_' . $field['label']; ?>"><?php echo $field['name']; ?></option>
1045
+ <?php
1046
+ break;
1047
+ case 'cf':
1048
+ ?>
1049
+ <option value="<?php echo 'cf_' . $field['label']; ?>"><?php echo $field['name']; ?></option>
1050
+ <?php
1051
+ break;
1052
+ default:
1053
+ # code...
1054
+ break;
1055
+ }
1056
+ }
1057
 
1058
  endforeach;
1059
  ?>
1081
 
1082
  $available_sections = apply_filters("wp_all_export_available_sections", $this->available_sections);
1083
 
1084
+ if(self::$woo_order_export) {
1085
  // Render Available WooCommerce Orders Data
1086
  self::$woo_order_export->render_new_field();
1087
  }
1092
 
1093
  <?php
1094
  foreach ($available_sections as $slug => $section)
1095
+ {
1096
+ if($slug === 'product_data' && !self::get_addons_service()->isWooCommerceAddonActive()) {
1097
+ unset($section['additional']);
1098
+ }
1099
+
1100
+ if ( ! empty($this->available_data[$section['content']]) or ! empty($section['additional']) ):
1101
  ?>
1102
  <optgroup label="<?php echo $section['title']; ?>">
1103
 
libraries/XmlExportFiltering.php CHANGED
@@ -42,18 +42,6 @@ if ( ! class_exists('XmlExportFiltering') )
42
  $this->queryJoin = array();
43
 
44
  $this->queryWhere = " $wpdb->posts.post_type = 'product' AND (($wpdb->posts.post_status <> 'trash' AND $wpdb->posts.post_status <> 'auto-draft'))";
45
-
46
- // $where = $this->queryWhere;
47
- // $join = implode( ' ', array_unique( $this->queryJoin ) );
48
- //
49
- // $this->queryWhere = $tmp_queryWhere;
50
- // $this->queryJoin = $tmp_queryJoin;
51
- //
52
- // $this->queryWhere .= " AND $wpdb->posts.post_type = 'product' OR ($wpdb->posts.post_type = 'product_variation' AND $wpdb->posts.post_parent IN (
53
- // SELECT DISTINCT $wpdb->posts.ID
54
- // FROM $wpdb->posts $join
55
- // WHERE $where
56
- // )) GROUP BY $wpdb->posts.ID";
57
 
58
  $where = $this->queryWhere;
59
  $join = implode( ' ', array_unique( $this->queryJoin ) );
42
  $this->queryJoin = array();
43
 
44
  $this->queryWhere = " $wpdb->posts.post_type = 'product' AND (($wpdb->posts.post_status <> 'trash' AND $wpdb->posts.post_status <> 'auto-draft'))";
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  $where = $this->queryWhere;
47
  $join = implode( ' ', array_unique( $this->queryJoin ) );
libraries/XmlExportTaxonomy.php CHANGED
@@ -169,7 +169,7 @@ if ( ! class_exists('XmlExportTaxonomy') )
169
  }
170
  }
171
 
172
- public static function prepare_data( $term, $xmlWriter = false, &$acfs, $implode_delimiter, $preview )
173
  {
174
  $article = array();
175
 
169
  }
170
  }
171
 
172
+ public static function prepare_data( $term, $xmlWriter, &$acfs, $implode_delimiter, $preview )
173
  {
174
  $article = array();
175
 
models/export/record.php CHANGED
@@ -13,8 +13,10 @@ class PMXE_Export_Record extends PMXE_Model_Record {
13
 
14
  /**
15
  * Import all files matched by path
 
16
  * @param callable[optional] $logger Method where progress messages are submmitted
17
- * @return PMXI_Import_Record
 
18
  * @chainable
19
  */
20
  public function execute($logger = NULL, $cron = false) {
@@ -671,7 +673,7 @@ class PMXE_Export_Record extends PMXE_Model_Record {
671
  if ( $options['export_to'] == 'xml' && ! empty($options['xml_template_type']) && in_array($options['xml_template_type'], array('custom', 'XmlGoogleMerchants')) ) return false;
672
 
673
  // Export only parent product do not support import bundle
674
- if ( ! empty($options['cpt']) and in_array($options['cpt'][0], array('product', 'product_variation')) and class_exists('WooCommerce') and $options['export_variations'] != XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT_AND_VARIATION){
675
  return false;
676
  }
677
 
@@ -681,8 +683,8 @@ class PMXE_Export_Record extends PMXE_Model_Record {
681
 
682
  /**
683
  * Clear associations with posts
684
- * @return PMXE_Import_Record
685
- * @chainable
686
  */
687
  public function deletePosts() {
688
  $post = new PMXE_Post_List();
13
 
14
  /**
15
  * Import all files matched by path
16
+ *
17
  * @param callable[optional] $logger Method where progress messages are submmitted
18
+ *
19
+ * @return PMXE_Export_Record
20
  * @chainable
21
  */
22
  public function execute($logger = NULL, $cron = false) {
673
  if ( $options['export_to'] == 'xml' && ! empty($options['xml_template_type']) && in_array($options['xml_template_type'], array('custom', 'XmlGoogleMerchants')) ) return false;
674
 
675
  // Export only parent product do not support import bundle
676
+ if ( ! empty($options['cpt']) and in_array($options['cpt'][0], array('product', 'product_variation')) and class_exists('WooCommerce') and $options['export_variations'] == XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_VARIATION){
677
  return false;
678
  }
679
 
683
 
684
  /**
685
  * Clear associations with posts
686
+ * @return PMXE_Export_Record
687
+ * @chainable
688
  */
689
  public function deletePosts() {
690
  $post = new PMXE_Post_List();
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 5.0
4
  Tested up to: 5.8
5
- Stable tag: 1.3.1
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.
@@ -91,7 +91,13 @@ Either: -
91
 
92
  == Changelog ==
93
 
94
- = 1.3.1 =
 
 
 
 
 
 
95
  * improvement: only set max_execution_time on export pages
96
  * bugfix: error when using the ACF Export Add-On Pro
97
 
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 5.0
4
  Tested up to: 5.8
5
+ Stable tag: 1.3.2
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.
91
 
92
  == Changelog ==
93
 
94
+ = 1.3.2 =
95
+ * improvement: add support for exporting non-WooCommerce 'product' CPTs
96
+ * improvement: initial PHP 8 support
97
+ * improvement: only set max_execution_time on WPAE pages
98
+ * bug fix
99
+
100
+ = 1.3.1 =
101
  * improvement: only set max_execution_time on export pages
102
  * bugfix: error when using the ACF Export Add-On Pro
103
 
src/App/Service/Addons/AddonService.php CHANGED
@@ -82,7 +82,7 @@ class AddonService
82
  if (
83
  (
84
  (
85
- in_array('product', $item['options']['cpt']) ||
86
  in_array('product_variation', $item['options']['cpt']) ||
87
  in_array('shop_order', $item['options']['cpt']) ||
88
  in_array('shop_review', $item['options']['cpt']) ||
82
  if (
83
  (
84
  (
85
+ (in_array('product', $item['options']['cpt']) && \class_exists('WooCommerce')) ||
86
  in_array('product_variation', $item['options']['cpt']) ||
87
  in_array('shop_order', $item['options']['cpt']) ||
88
  in_array('shop_review', $item['options']['cpt']) ||
src/App/UnsecuredController/SchedulingController.php CHANGED
@@ -156,11 +156,15 @@ class SchedulingController extends BaseController
156
  die(\__('The User Export Add-On Pro is required to run this export. You can download the add-on here: <a href="http://www.wpallimport.com/portal/" target="_blank">http://www.wpallimport.com/portal/</a>', \PMXE_Plugin::LANGUAGE_DOMAIN));
157
  }
158
 
159
- if (
160
- (( (in_array('product', $cpt) && in_array('product_variation', $cpt)) || in_array('shop_order', $cpt) || in_array('shop_coupon', $cpt)) && !$addons->isWooCommerceAddonActive())
161
- ||
162
- ($export->options['export_type'] == 'advanced' && in_array($export->options['exportquery']->query['post_type'], array(array('product', 'product_variation'), 'shop_order', 'shop_coupon')) && !$addons->isWooCommerceAddonActive())
163
- ) {
 
 
 
 
164
  die(\__('The WooCommerce Export Add-On Pro is required to run this export. You can download the add-on here: <a href="http://www.wpallimport.com/portal/" target="_blank">http://www.wpallimport.com/portal/</a>', \PMXE_Plugin::LANGUAGE_DOMAIN));
165
  }
166
 
156
  die(\__('The User Export Add-On Pro is required to run this export. You can download the add-on here: <a href="http://www.wpallimport.com/portal/" target="_blank">http://www.wpallimport.com/portal/</a>', \PMXE_Plugin::LANGUAGE_DOMAIN));
157
  }
158
 
159
+ if (
160
+ (( (in_array('product', $cpt) && \class_exists('WooCommerce') && !$addons->isWooCommerceProductAddonActive()) || (in_array('shop_order', $cpt) && !$addons->isWooCommerceOrderAddonActive()) || in_array('shop_coupon', $cpt) || in_array('shop_review', $cpt) ) && !$addons->isWooCommerceAddonActive())
161
+ ||
162
+ ($export->options['export_type'] == 'advanced' && in_array($export->options['exportquery']->query['post_type'], array('shop_coupon')) && !$addons->isWooCommerceAddonActive())
163
+ ||
164
+ ($export->options['export_type'] == 'advanced' && in_array($export->options['exportquery']->query['post_type'], array('shop_order')) && !$addons->isWooCommerceAddonActive() && !$addons->isWooCommerceOrderAddonActive())
165
+ ||
166
+ ($export->options['export_type'] == 'advanced' && in_array($export->options['exportquery']->query['post_type'], array(array('product', 'product_variation'), )) && !$addons->isWooCommerceAddonActive() && !$addons->isWooCommerceProductAddonActive())
167
+ ) {
168
  die(\__('The WooCommerce Export Add-On Pro is required to run this export. You can download the add-on here: <a href="http://www.wpallimport.com/portal/" target="_blank">http://www.wpallimport.com/portal/</a>', \PMXE_Plugin::LANGUAGE_DOMAIN));
169
  }
170
 
src/Scheduling/Scheduling.php CHANGED
@@ -188,7 +188,7 @@ class Scheduling
188
  }
189
 
190
  $timeParts = explode(':', $time);
191
- $hour = $timeParts[0];
192
  $min = (int)$timeParts[1];
193
 
194
  if (strpos($time, 'pm') !== false && $hour < 12) {
188
  }
189
 
190
  $timeParts = explode(':', $time);
191
+ $hour = (int)$timeParts[0];
192
  $min = (int)$timeParts[1];
193
 
194
  if (strpos($time, 'pm') !== false && $hour < 12) {
static/css/admin.css CHANGED
@@ -190,7 +190,8 @@
190
  .wpallexport-plugin .wpallexport-reviews-export-notice,
191
  .wpallexport-plugin .wpallexport-comments-export-notice,
192
  .wpallexport-plugin .wpallexport-taxonomies-export-notice,
193
- .wpallexport-plugin .wpallexport-product-export-notice {
 
194
  padding: 20px;
195
  display: none;
196
  width: 558px;
@@ -3499,7 +3500,7 @@ a.wpallexport-import-to-format span.wpallexport-import-to-title {
3499
  border-spacing:0;
3500
  }
3501
  .product_variations {
3502
- display: none;
3503
  }
3504
 
3505
  .wpallexport-plugin .product_variations input {
190
  .wpallexport-plugin .wpallexport-reviews-export-notice,
191
  .wpallexport-plugin .wpallexport-comments-export-notice,
192
  .wpallexport-plugin .wpallexport-taxonomies-export-notice,
193
+ .wpallexport-plugin .wpallexport-product-export-notice,
194
+ .wpallexport-plugin .wpallexport-custom-product-export-notice{
195
  padding: 20px;
196
  display: none;
197
  width: 558px;
3500
  border-spacing:0;
3501
  }
3502
  .product_variations {
3503
+ display: block;
3504
  }
3505
 
3506
  .wpallexport-plugin .product_variations input {
static/js/admin.js CHANGED
@@ -688,19 +688,7 @@
688
  success: function(response) {
689
 
690
  $('.wpae-record-count').val(response.found_records);
691
-
692
- vm.hasVariations = response.hasVariations;
693
- if(vm.hasVariations) {
694
-
695
- if($('#export_to_sheet').val() == 'xls' || $('#export_to_sheet').val() == 'xlsx') {
696
- $('.csv_delimiter').hide();
697
- $('.export_to_csv').slideDown();
698
- }
699
-
700
- $('.product_variations').show();
701
-
702
- }
703
-
704
  $('.wp_all_export_filter_preloader').hide();
705
 
706
  $('#filtering_result').html(response.html);
@@ -856,6 +844,8 @@
856
  break;
857
  case 'advanced_type':
858
 
 
 
859
  $('.wpallexport-user-export-notice').hide();
860
  $('.wpallexport-comments-export-notice').hide();
861
  $('.wpallexport-shop_customer-export-notice').hide();
@@ -961,27 +951,29 @@
961
  $('.wpallexport-shop_customer-export-notice').show();
962
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
963
  }
964
- else if (postType == 'shop_coupon' && !$('#pmxe_woocommerce_addon_installed').val())
965
- {
966
- $('.wpallexport-shop_coupon-export-notice').show();
967
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
968
- }
969
- else if (postType == 'shop_order')
970
- {
971
- if(!($('#pmxe_woocommerce_addon_installed').val() || $('#pmxe_woocommerce_order_addon_installed').val())) {
972
- $('.wpallexport-shop_order-export-notice').show();
973
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
974
- }
975
- }
976
- else if (postType == 'product')
977
- {
978
- if(!($('#pmxe_woocommerce_addon_installed').val() || $('#pmxe_woocommerce_order_addon_installed').val())) {
979
 
980
- $('.wpallexport-product-export-notice').show();
981
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
982
- }
983
- }
984
- else
 
 
 
985
  {
986
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
987
  }
@@ -1025,8 +1017,8 @@
1025
  $('.wpallexport-submit-buttons').hide();
1026
  }
1027
 
1028
- if (value.indexOf('product') !== -1) {
1029
- $('.wpallexport-product-export-notice').show();
1030
  $('.wpallexport-submit-buttons').hide();
1031
  }
1032
 
@@ -1047,6 +1039,16 @@
1047
  return false;
1048
  }
1049
 
 
 
 
 
 
 
 
 
 
 
1050
  $('input[name^=auto_generate]').val('1');
1051
 
1052
  $('.hierarhy-output').each(function(){
@@ -1078,6 +1080,7 @@
1078
 
1079
  $('.wpallexport-user-export-notice').hide();
1080
  $('.wpallexport-comments-export-notice').hide();
 
1081
  $('.wpallexport-shop_customer-export-notice').hide();
1082
  $('.wpallexport-taxonomies-export-notice').hide();
1083
 
688
  success: function(response) {
689
 
690
  $('.wpae-record-count').val(response.found_records);
691
+
 
 
 
 
 
 
 
 
 
 
 
 
692
  $('.wp_all_export_filter_preloader').hide();
693
 
694
  $('#filtering_result').html(response.html);
844
  break;
845
  case 'advanced_type':
846
 
847
+ $('a.auto-generate-template').hide();
848
+
849
  $('.wpallexport-user-export-notice').hide();
850
  $('.wpallexport-comments-export-notice').hide();
851
  $('.wpallexport-shop_customer-export-notice').hide();
951
  $('.wpallexport-shop_customer-export-notice').show();
952
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
953
  }
954
+ else if (postType == 'shop_coupon' && !$('#pmxe_woocommerce_addon_installed').val())
955
+ {
956
+ $('.wpallexport-shop_coupon-export-notice').show();
957
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
958
+ }
959
+ else if (postType == 'shop_order')
960
+ {
961
+ if(!($('#pmxe_woocommerce_addon_installed').val() || $('#pmxe_woocommerce_order_addon_installed').val())) {
962
+ $('.wpallexport-shop_order-export-notice').show();
963
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
964
+ }
965
+ }
966
+ else if (postType == 'product' && !$('#pmxe_woocommerce_addon_installed').val() && $('#WooCommerce_Installed').length)
967
+ {
 
968
 
969
+ if(!($('#pmxe_woocommerce_addon_installed').val() || $('#pmxe_woocommerce_product_addon_installed').val())) {
970
+
971
+ $('.wpallexport-product-export-notice').show();
972
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
973
+
974
+ }
975
+ }
976
+ else
977
  {
978
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
979
  }
1017
  $('.wpallexport-submit-buttons').hide();
1018
  }
1019
 
1020
+ if (value.indexOf('product') !== -1 && $('#WooCommerce_Installed').length) {
1021
+ $('.wpallexport-custom-product-export-notice').show();
1022
  $('.wpallexport-submit-buttons').hide();
1023
  }
1024
 
1039
  return false;
1040
  }
1041
 
1042
+ if (export_type == 'shop_order' && !$('#woocommerce_add_on_pro_installed').length) {
1043
+ $('#migrate-orders-notice').slideDown();
1044
+ return false;
1045
+ }
1046
+
1047
+ if (export_type == 'product' && !$('#woocommerce_add_on_pro_installed').length) {
1048
+ $('#migrate-products-notice').slideDown();
1049
+ return false;
1050
+ }
1051
+
1052
  $('input[name^=auto_generate]').val('1');
1053
 
1054
  $('.hierarhy-output').each(function(){
1080
 
1081
  $('.wpallexport-user-export-notice').hide();
1082
  $('.wpallexport-comments-export-notice').hide();
1083
+ $('.wpallexport-custom-product-export-notice').hide();
1084
  $('.wpallexport-shop_customer-export-notice').hide();
1085
  $('.wpallexport-taxonomies-export-notice').hide();
1086
 
views/admin/export/index.php CHANGED
@@ -41,6 +41,10 @@ do_action('pmxe_addons_html');
41
  </div>
42
 
43
  <input type="hidden" value="<?php echo $post['export_type']; ?>" name="export_type"/>
 
 
 
 
44
 
45
  <div class="wpallexport-upload-type-container" rel="specific_type">
46
 
@@ -238,16 +242,24 @@ do_action('pmxe_addons_html');
238
 
239
  <div class="wpallexport-free-edition-notice wpallexport-user-export-notice" style="margin-bottom: 20px;">
240
  <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=4206903&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-users">
241
- <?php _e('The User Export Package is required to Export Users','wp_all_export_plugin');?></a>
242
  <p><?php _e('If you already own it, remove the WP All Export free edition and install the User Export Package\'s plugins.', 'wp_all_export_plugin'); ?></p>
243
  </div>
244
 
245
  <div class="wpallexport-free-edition-notice wpallexport-comments-export-notice" style="margin-bottom: 20px;">
246
  <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=export-comments">
247
- <?php _e('Upgrade to the Pro edition of WP All Export to Export Comments','wp_all_export_plugin');?></a>
248
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_export_plugin'); ?></p>
249
  </div>
250
 
 
 
 
 
 
 
 
 
251
  <input type="hidden" name="wp_query_selector" value="<?php echo $post['wp_query_selector'];?>">
252
  <textarea class="wp_query" rows="10" cols="80" name="wp_query" placeholder="'post_type' => 'post', 'post_status' => array( 'pending', 'draft', 'future' )" style="width: 600px;"><?php echo esc_html($post['wp_query']); ?></textarea>
253
 
41
  </div>
42
 
43
  <input type="hidden" value="<?php echo $post['export_type']; ?>" name="export_type"/>
44
+
45
+ <?php if (\class_exists('WooCommerce')): ?>
46
+ <input type="hidden" value="1" id="WooCommerce_Installed">
47
+ <?php endif; ?>
48
 
49
  <div class="wpallexport-upload-type-container" rel="specific_type">
50
 
242
 
243
  <div class="wpallexport-free-edition-notice wpallexport-user-export-notice" style="margin-bottom: 20px;">
244
  <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=4206903&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-users">
245
+ <?php _e('The User Export Package is required to Export Users','wp_all_export_plugin');?></a><br/>
246
  <p><?php _e('If you already own it, remove the WP All Export free edition and install the User Export Package\'s plugins.', 'wp_all_export_plugin'); ?></p>
247
  </div>
248
 
249
  <div class="wpallexport-free-edition-notice wpallexport-comments-export-notice" style="margin-bottom: 20px;">
250
  <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=export-comments">
251
+ <?php _e('Upgrade to the Pro edition of WP All Export to Export Comments','wp_all_export_plugin');?></a><br/>
252
  <p><?php _e('If you already own it, remove the free edition and install the Pro edition.', 'wp_all_export_plugin'); ?></p>
253
  </div>
254
 
255
+ <div class="wpallexport-free-edition-notice wpallexport-custom-product-export-notice" style="margin-bottom: 20px;">
256
+ <p><?php _e('The WooCommerce Export Package is Required to Export WooCommerce Products.', 'wp_all_export_plugin'); ?></p>
257
+ <br/>
258
+ <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=4206899&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-products"><?php
259
+ _e('Purchase the WooCommerce Export Package','wp_all_export_plugin');?></a>
260
+
261
+ </div>
262
+
263
  <input type="hidden" name="wp_query_selector" value="<?php echo $post['wp_query_selector'];?>">
264
  <textarea class="wp_query" rows="10" cols="80" name="wp_query" placeholder="'post_type' => 'post', 'post_status' => array( 'pending', 'draft', 'future' )" style="width: 600px;"><?php echo esc_html($post['wp_query']); ?></textarea>
265
 
views/admin/export/process.php CHANGED
@@ -36,7 +36,7 @@
36
  </div>
37
  </div>
38
  <?php
39
- if (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() && XmlExportWooCommerceOrder::$is_active && $update_previous->options['export_type'] == 'specific') {
40
 
41
  $exportList = new PMXE_Export_List();
42
  foreach ($exportList->getBy('parent_id', $update_previous->id)->convertRecords() as $child_export) {
@@ -48,8 +48,7 @@
48
  case 'shop_coupon':
49
  if (!$update_previous->options['order_include_coupons']) $is_render_child_progress = false;
50
  break;
51
- case 'shop_customer':
52
- if (!$update_previous->options['order_include_customers']) $is_render_child_progress = false;
53
  break;
54
  }
55
 
36
  </div>
37
  </div>
38
  <?php
39
+ if ((XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() || XmlExportEngine::get_addons_service()->isWooCommerceOrderAddonActive() ) && XmlExportWooCommerceOrder::$is_active && $update_previous->options['export_type'] == 'specific') {
40
 
41
  $exportList = new PMXE_Export_List();
42
  foreach ($exportList->getBy('parent_id', $update_previous->id)->convertRecords() as $child_export) {
48
  case 'shop_coupon':
49
  if (!$update_previous->options['order_include_coupons']) $is_render_child_progress = false;
50
  break;
51
+ case 'shop_customer':if (!$update_previous->options['order_include_customers']) $is_render_child_progress = false;
 
52
  break;
53
  }
54
 
views/admin/export/template.php CHANGED
@@ -160,7 +160,7 @@
160
  </div>
161
 
162
  <!-- Warning Messages -->
163
- <?php if ( $addons->isWooCommerceAddonActive() && ! XmlExportWooCommerceOrder::$is_active && ! XmlExportComment::$is_active && ! XmlExportTaxonomy::$is_active ) : ?>
164
  <div class="wp-all-export-warning" <?php if ( empty($post['ids']) or count($post['ids']) > 1 ) echo 'style="display:none;"'; ?>>
165
  <p></p>
166
  <input type="hidden" id="warning_template" value="<?php _e("Warning: without %s you won't be able to re-import this data back to this site using WP All Import.", "wp_all_export_plugin"); ?>"/>
@@ -168,7 +168,7 @@
168
  </div>
169
  <?php endif; ?>
170
 
171
- <?php if ( $addons->isWooCommerceAddonActive() && XmlExportWooCommerce::$is_active ) : ?>
172
  <input type="hidden" id="is_product_export" value="1"/>
173
  <?php endif; ?>
174
 
@@ -224,7 +224,14 @@
224
  </div>
225
  <input type="hidden" id="custom_xml_cdata_logic" value="<?php echo $post['custom_xml_cdata_logic']; ?>" name="custom_xml_cdata_logic" />
226
  <input type="hidden" id="show_cdata_in_preview" value="<?php echo $post['show_cdata_in_preview']; ?>" name="show_cdata_in_preview" />
227
- <div><?php include('variation_options.php'); ?></div>
 
 
 
 
 
 
 
228
  <div class="wp-all-export-product-bundle-warning warning-only-export-parent-products" style="display:none;">
229
  <p><?php _e("You will not be able to reimport data to the product variations, and you will not be able to import these products to another site.", 'wp_all_export_plugin'); ?></p>
230
  </div>
@@ -288,8 +295,10 @@
288
  </div>
289
  <?php endif; ?>
290
  <div style="margin-left:20px;">
291
- <?php
 
292
  include('variation_options.php');
 
293
  ?>
294
  </div>
295
  <div class="wp-all-export-product-bundle-warning" style="display:none;">
160
  </div>
161
 
162
  <!-- Warning Messages -->
163
+ <?php if ( ($addons->isWooCommerceAddonActive() || $addons->isWooCommerceOrderAddonActive()) && ! XmlExportWooCommerceOrder::$is_active && ! XmlExportComment::$is_active && ! XmlExportTaxonomy::$is_active ) : ?>
164
  <div class="wp-all-export-warning" <?php if ( empty($post['ids']) or count($post['ids']) > 1 ) echo 'style="display:none;"'; ?>>
165
  <p></p>
166
  <input type="hidden" id="warning_template" value="<?php _e("Warning: without %s you won't be able to re-import this data back to this site using WP All Import.", "wp_all_export_plugin"); ?>"/>
168
  </div>
169
  <?php endif; ?>
170
 
171
+ <?php if ( $addons->isWooCommerceAddonActive() || $addons->isWooCommerceProductAddonActive() && XmlExportWooCommerce::$is_active ) : ?>
172
  <input type="hidden" id="is_product_export" value="1"/>
173
  <?php endif; ?>
174
 
224
  </div>
225
  <input type="hidden" id="custom_xml_cdata_logic" value="<?php echo $post['custom_xml_cdata_logic']; ?>" name="custom_xml_cdata_logic" />
226
  <input type="hidden" id="show_cdata_in_preview" value="<?php echo $post['show_cdata_in_preview']; ?>" name="show_cdata_in_preview" />
227
+
228
+ <div>
229
+ <?php if( (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() || XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive()) && XmlExportWooCommerce::$is_active)
230
+ {
231
+ include('variation_options.php');
232
+ }
233
+ ?>
234
+ </div>
235
  <div class="wp-all-export-product-bundle-warning warning-only-export-parent-products" style="display:none;">
236
  <p><?php _e("You will not be able to reimport data to the product variations, and you will not be able to import these products to another site.", 'wp_all_export_plugin'); ?></p>
237
  </div>
295
  </div>
296
  <?php endif; ?>
297
  <div style="margin-left:20px;">
298
+ <?php if( (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() || XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive()) && XmlExportWooCommerce::$is_active)
299
+ {
300
  include('variation_options.php');
301
+ }
302
  ?>
303
  </div>
304
  <div class="wp-all-export-product-bundle-warning" style="display:none;">
views/admin/export/variation_options.php CHANGED
@@ -71,7 +71,7 @@ $random = uniqid();
71
  <div class="clear"></div>
72
  <div style="margin: 6px 0;">
73
  <label>
74
- <input type="radio" disabled class="export_variations <?php if (PMXE_EDITION != 'paid') {
75
  echo "variations_disabled";
76
  } ?>"
77
  value="<?php echo XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT; ?>"
@@ -79,9 +79,20 @@ $random = uniqid();
79
  </label>
80
  </div>
81
 
 
82
  <div class="wpallexport-free-edition-notice" style="padding: 20px; margin-bottom: 10px;">
83
- <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&amp;download_id=2707173&amp;edd_options%5Bprice_id%5D=1&amp;utm_source=export-plugin-free&amp;utm_medium=upgrade-notice&amp;utm_campaign=variation_options">Upgrade to the Pro edition of WP All Export to filter variable products</a>
 
84
  <p>If you already own it, remove the free edition and install the Pro edition.</p>
85
  </div>
 
 
 
 
 
 
 
 
 
86
  </div>
87
  </div>
71
  <div class="clear"></div>
72
  <div style="margin: 6px 0;">
73
  <label>
74
+ <input type="radio" checked="checked" disabled class="export_variations <?php if (PMXE_EDITION != 'paid') {
75
  echo "variations_disabled";
76
  } ?>"
77
  value="<?php echo XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT; ?>"
79
  </label>
80
  </div>
81
 
82
+ <?php if(XmlExportEngine::get_addons_service()->isWooCommerceAddonActive()) { ?>
83
  <div class="wpallexport-free-edition-notice" style="padding: 20px; margin-bottom: 10px;">
84
+ <a class="upgrade_link" style="font-size:15px !important;" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&amp;download_id=2707173&amp;edd_options%5Bprice_id%5D=1&amp;utm_source=export-plugin-free&amp;utm_medium=upgrade-notice&amp;utm_campaign=variation_options">
85
+ Upgrade to the Pro edition of WP All Export to filter variable products</a>
86
  <p>If you already own it, remove the free edition and install the Pro edition.</p>
87
  </div>
88
+ <?php } else { ?>
89
+ <div class="wpallexport-free-edition-notice" style="padding: 20px 20px 35px 20px; margin-bottom: 10px;">
90
+ <p>The WooCommerce Export Package is required to export variations.</p>
91
+ <p>
92
+ <a style="margin: 1em 0; font-size:1em !important" class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=4206899&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-variations">
93
+ Purchase the WooCommerce Export Package</a>
94
+ </p>
95
+ </div>
96
+ <?php } ?>
97
  </div>
98
  </div>
views/admin/export/variation_options_common.php CHANGED
@@ -1,3 +1,5 @@
 
 
1
  <script type="text/javascript">
2
  (function ($) {
3
  $(function () {
@@ -37,6 +39,6 @@
37
  });
38
  })(jQuery);
39
  </script>
40
-
41
  <input type="hidden" id="export_variations" name="export_variations" value="<?php echo XmlExportEngine::getProductVariationMode();?>" />
42
  <input type="hidden" id="export_variations_title" name="export_variations_title" value="<?php echo XmlExportEngine::getProductVariationTitleMode();?>" />
1
+ <?php
2
+ if(XmlExportEngine::get_addons_service()->isWooCommerceAddonActive()) { ?>
3
  <script type="text/javascript">
4
  (function ($) {
5
  $(function () {
39
  });
40
  })(jQuery);
41
  </script>
42
+ <?php } ?>
43
  <input type="hidden" id="export_variations" name="export_variations" value="<?php echo XmlExportEngine::getProductVariationMode();?>" />
44
  <input type="hidden" id="export_variations_title" name="export_variations_title" value="<?php echo XmlExportEngine::getProductVariationTitleMode();?>" />
views/admin/manage/index.php CHANGED
@@ -208,7 +208,12 @@ $columns = apply_filters('pmxe_manage_imports_columns', $columns);
208
  <?php
209
  // Disable scheduling options for WooCo exports if WooCo Export Add-On isn't enabled
210
  } else if (
211
- (( (in_array('product', $item['options']['cpt']) && in_array('product_variation', $item['options']['cpt'])) || in_array('shop_order', $item['options']['cpt']) || in_array('shop_coupon', $item['options']['cpt']) || in_array('shop_review', $item['options']['cpt']) ) && !$addons->isWooCommerceAddonActive())
 
 
 
 
 
212
  ||
213
  ($item['options']['export_type'] == 'advanced' && in_array($item['options']['exportquery']->query['post_type'], array(array('product', 'product_variation'), 'shop_order', 'shop_coupon')) && !$addons->isWooCommerceAddonActive())
214
  ) {
@@ -379,7 +384,7 @@ $columns = apply_filters('pmxe_manage_imports_columns', $columns);
379
  printf(__('Export Attempt at %s', 'wp_all_export_plugin'), get_date_from_gmt($item['canceled_on'], "m/d/Y g:i a")); echo '<br/>';
380
  _e('Export canceled', 'wp_all_export_plugin');
381
  }
382
- else{
383
  printf(__('Last run: %s', 'wp_all_export_plugin'), ($item['registered_on'] == '0000-00-00 00:00:00') ? __('never', 'wp_all_export_plugin') : get_date_from_gmt($item['registered_on'], "m/d/Y g:i a")); echo '<br/>';
384
  printf(__('%d Records Exported', 'wp_all_export_plugin'), $item['exported']); echo '<br/>';
385
  $export_to = ($item['options']['export_to'] == 'csv' && ! empty($item['options']['export_to_sheet'])) ? $item['options']['export_to_sheet'] : $item['options']['export_to'];
208
  <?php
209
  // Disable scheduling options for WooCo exports if WooCo Export Add-On isn't enabled
210
  } else if (
211
+ (( (
212
+ in_array('product', $item['options']['cpt']) &&
213
+ in_array('product_variation', $item['options']['cpt']) && !$addons->isWooCommerceProductAddonActive() ) ||
214
+ (in_array('shop_order', $item['options']['cpt']) && !$addons->isWooCommerceOrderAddonActive()) ||
215
+ in_array('shop_coupon', $item['options']['cpt']) ||
216
+ in_array('shop_review', $item['options']['cpt']) ) && !$addons->isWooCommerceAddonActive())
217
  ||
218
  ($item['options']['export_type'] == 'advanced' && in_array($item['options']['exportquery']->query['post_type'], array(array('product', 'product_variation'), 'shop_order', 'shop_coupon')) && !$addons->isWooCommerceAddonActive())
219
  ) {
384
  printf(__('Export Attempt at %s', 'wp_all_export_plugin'), get_date_from_gmt($item['canceled_on'], "m/d/Y g:i a")); echo '<br/>';
385
  _e('Export canceled', 'wp_all_export_plugin');
386
  }
387
+ else {
388
  printf(__('Last run: %s', 'wp_all_export_plugin'), ($item['registered_on'] == '0000-00-00 00:00:00') ? __('never', 'wp_all_export_plugin') : get_date_from_gmt($item['registered_on'], "m/d/Y g:i a")); echo '<br/>';
389
  printf(__('%d Records Exported', 'wp_all_export_plugin'), $item['exported']); echo '<br/>';
390
  $export_to = ($item['options']['export_to'] == 'csv' && ! empty($item['options']['export_to_sheet'])) ? $item['options']['export_to_sheet'] : $item['options']['export_to'];
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.1
7
  Author: Soflyy
8
  */
9
 
@@ -59,9 +59,9 @@ else {
59
  */
60
  define('PMXE_PREFIX', 'pmxe_');
61
 
62
- define('PMXE_VERSION', '1.3.1');
63
 
64
- define('PMXE_ASSETS_VERSION', '-1.0.1');
65
 
66
  define('PMXE_EDITION', 'free');
67
 
@@ -410,7 +410,7 @@ else {
410
  $this->showDismissibleNotice(__('<strong style="font-size:16px">A Configured Export Requires the User Export Add-On</strong><p>Your User exports will not be able to run until you install the User Export Add-On. That add-on is available from <a href="https://wordpress.org/plugins/export-wp-users-xml-csv/" target="_blank">wordpress.org</a>.</p>', PMXE_Plugin::LANGUAGE_DOMAIN), 'wpae_user_addon_not_installed_notice');
411
  }
412
 
413
- if (!$addons_not_included && $this->addons->wooCommerceExportsExistAndAddonNotInstalled() && current_user_can('manage_options')) {
414
  $this->showDismissibleNotice(__('<strong style="font-size:16px">A Configured Export Requires the WooCommerce Export Add-On Pro</strong><p>Your Products, Orders, and Coupons exports will not be able to run until you install the WooCommerce Export Add-On Pro. That add-on is available to those who were using WP All Export Free before this requirement.</p>', PMXE_Plugin::LANGUAGE_DOMAIN)
415
  . '<p><a class="button button-primary" href="https://wpallimport.com/portal/downloads" target="_blank">' . __('Download Add-On', PMXE_Plugin::LANGUAGE_DOMAIN) . '</a></p>', 'wpae_woocommerce_addon_not_installed_notice');
416
  }
@@ -475,10 +475,10 @@ else {
475
 
476
  if(isset($export->options['export_type']) && $export->options['export_type'] === 'advanced') {
477
 
478
- if(!XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() && strpos($export->options['wp_query'], 'product') !== false) {
479
  die(\__('The WooCommerce Export Add-On Pro is required to run this export. If you already own it, you can download the add-on here: <a href="http://www.wpallimport.com/portal/downloads" target="_blank">http://www.wpallimport.com/portal/downloads</a>', \PMXE_Plugin::LANGUAGE_DOMAIN));
480
  }
481
- else if(!XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() && strpos($export->options['wp_query'], 'shop_order') !== false) {
482
  die(\__('The WooCommerce Export Add-On Pro is required to run this export. If you already own it, you can download the add-on here: <a href="http://www.wpallimport.com/portal/downloads" target="_blank">http://www.wpallimport.com/portal/downloads</a>', \PMXE_Plugin::LANGUAGE_DOMAIN));
483
  }
484
  else if(!XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() && strpos($export->options['wp_query'], 'shop_coupon') !== false) {
@@ -494,11 +494,18 @@ else {
494
  }
495
 
496
  if (
497
- ((in_array('product', $cpt) || in_array('shop_order', $cpt) || in_array('shop_review', $cpt) || in_array('shop_coupon', $cpt)) && !$addons->isWooCommerceAddonActive()) ||
498
- ($export->options['export_type'] == 'advanced' && $export->options['wp_query_selector'] == 'wp_user_query' && !$addons->isUserAddonActive())
499
- ) {
500
- die(\__('The WooCommerce Export Add-On Pro is required to run this export. You can download the add-on here: <a href="http://www.wpallimport.com/portal/" target="_blank">http://www.wpallimport.com/portal/</a>', \PMXE_Plugin::LANGUAGE_DOMAIN));
501
- }
 
 
 
 
 
 
 
502
 
503
  if(in_array('acf', $export->options['cc_type']) && !$addons->isAcfAddonActive()) {
504
  die(\__('The ACF Export Add-On Pro is required to run this export. You can download the add-on here: <a href="http://www.wpallimport.com/portal/" target="_blank">http://www.wpallimport.com/portal/</a>', \PMXE_Plugin::LANGUAGE_DOMAIN));
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.2
7
  Author: Soflyy
8
  */
9
 
59
  */
60
  define('PMXE_PREFIX', 'pmxe_');
61
 
62
+ define('PMXE_VERSION', '1.3.2');
63
 
64
+ define('PMXE_ASSETS_VERSION', '-1.0.2');
65
 
66
  define('PMXE_EDITION', 'free');
67
 
410
  $this->showDismissibleNotice(__('<strong style="font-size:16px">A Configured Export Requires the User Export Add-On</strong><p>Your User exports will not be able to run until you install the User Export Add-On. That add-on is available from <a href="https://wordpress.org/plugins/export-wp-users-xml-csv/" target="_blank">wordpress.org</a>.</p>', PMXE_Plugin::LANGUAGE_DOMAIN), 'wpae_user_addon_not_installed_notice');
411
  }
412
 
413
+ if (!$addons_not_included && $this->addons->wooCommerceExportsExistAndAddonNotInstalled() && current_user_can('manage_options') && \class_exists('WooCommerce')) {
414
  $this->showDismissibleNotice(__('<strong style="font-size:16px">A Configured Export Requires the WooCommerce Export Add-On Pro</strong><p>Your Products, Orders, and Coupons exports will not be able to run until you install the WooCommerce Export Add-On Pro. That add-on is available to those who were using WP All Export Free before this requirement.</p>', PMXE_Plugin::LANGUAGE_DOMAIN)
415
  . '<p><a class="button button-primary" href="https://wpallimport.com/portal/downloads" target="_blank">' . __('Download Add-On', PMXE_Plugin::LANGUAGE_DOMAIN) . '</a></p>', 'wpae_woocommerce_addon_not_installed_notice');
416
  }
475
 
476
  if(isset($export->options['export_type']) && $export->options['export_type'] === 'advanced') {
477
 
478
+ if(!XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() && strpos($export->options['wp_query'], 'product') !== false && \class_exists('WooCommerce')) {
479
  die(\__('The WooCommerce Export Add-On Pro is required to run this export. If you already own it, you can download the add-on here: <a href="http://www.wpallimport.com/portal/downloads" target="_blank">http://www.wpallimport.com/portal/downloads</a>', \PMXE_Plugin::LANGUAGE_DOMAIN));
480
  }
481
+ else if( (!XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() || !XmlExportEngine::get_addons_service()->isWooCommerceOrderAddonActive() ) && strpos($export->options['wp_query'], 'shop_order') !== false) {
482
  die(\__('The WooCommerce Export Add-On Pro is required to run this export. If you already own it, you can download the add-on here: <a href="http://www.wpallimport.com/portal/downloads" target="_blank">http://www.wpallimport.com/portal/downloads</a>', \PMXE_Plugin::LANGUAGE_DOMAIN));
483
  }
484
  else if(!XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() && strpos($export->options['wp_query'], 'shop_coupon') !== false) {
494
  }
495
 
496
  if (
497
+ (
498
+ (
499
+ ( in_array( 'product', $cpt ) && \class_exists('WooCommerce') && ! XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive() ) ||
500
+ ( in_array( 'shop_order', $cpt ) && ! XmlExportEngine::get_addons_service()->isWooCommerceOrderAddonActive() ) ||
501
+ in_array( 'shop_review', $cpt ) ||
502
+ in_array( 'shop_coupon', $cpt )
503
+ ) && ! $addons->isWooCommerceAddonActive()
504
+ ) ||
505
+ ( $export->options['export_type'] == 'advanced' && $export->options['wp_query_selector'] == 'wp_user_query' && ! $addons->isUserAddonActive() )
506
+ ) {
507
+ die( \__( 'The WooCommerce Export Add-On Pro is required to run this export. You can download the add-on here: <a href="http://www.wpallimport.com/portal/" target="_blank">http://www.wpallimport.com/portal/</a>', \PMXE_Plugin::LANGUAGE_DOMAIN ) );
508
+ }
509
 
510
  if(in_array('acf', $export->options['cc_type']) && !$addons->isAcfAddonActive()) {
511
  die(\__('The ACF Export Add-On Pro is required to run this export. You can download the add-on here: <a href="http://www.wpallimport.com/portal/" target="_blank">http://www.wpallimport.com/portal/</a>', \PMXE_Plugin::LANGUAGE_DOMAIN));