Export WordPress data to XML/CSV - Version 1.0.5

Version Description

  • fixed misaligned columns on exporting product attributes
  • fixed export nested repeaters field in CSV format
  • fixed live records counting for advanced export mode
  • fixed Events Calendar conflict
  • added new filters 'wp_all_export_add_before_node', 'wp_all_export_add_after_node'
  • added possibility export repeater rows one per line
  • exclude orphaned variations from exprt file
  • changed UI for export media data ( images & attachments )
Download this release

Release Info

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

Code changes from version 1.0.4 to 1.0.5

Files changed (65) hide show
  1. actions/admin_menu.php +7 -7
  2. actions/pmxe_after_export.php +49 -19
  3. actions/pmxe_exported_post.php +19 -8
  4. actions/wp_ajax_export_available_rules.php +28 -8
  5. actions/wp_ajax_export_filtering.php +39 -106
  6. actions/wp_ajax_export_filtering_count.php +132 -48
  7. actions/wp_ajax_export_preview.php +61 -17
  8. actions/wp_ajax_generate_zapier_api_key.php +1 -1
  9. actions/wp_ajax_wpallexport.php +113 -289
  10. classes/handler.php +43 -74
  11. classes/wpallimport.php +476 -0
  12. controllers/admin/export.php +97 -155
  13. controllers/admin/manage.php +48 -69
  14. controllers/controller.php +1 -1
  15. filters/wpallexport_custom_types.php +47 -3
  16. helpers/pmxe_export_acf_field_csv.php +0 -446
  17. helpers/pmxe_export_acf_field_xml.php +0 -354
  18. helpers/pmxe_export_csv.php +0 -641
  19. helpers/pmxe_export_xml.php +0 -513
  20. helpers/pmxe_functions.php +48 -1
  21. helpers/wp_all_export_generate_export_file.php +3 -3
  22. helpers/wp_all_export_get_cpt_name.php +25 -11
  23. helpers/wp_all_export_get_export_format.php +6 -0
  24. helpers/wp_all_export_posts_join.php +21 -0
  25. helpers/wp_all_export_posts_where.php +18 -0
  26. helpers/wp_all_export_reverse_rules_html.php +7 -4
  27. helpers/wp_all_export_write_article.php +29 -0
  28. i18n/languages/wp_all_export_plugin-de_DE.mo +0 -0
  29. i18n/languages/wp_all_export_plugin-de_DE.po +449 -357
  30. i18n/languages/wp_all_export_plugin-es_ES.mo +0 -0
  31. i18n/languages/wp_all_export_plugin-es_ES.po +980 -643
  32. i18n/languages/wp_all_export_plugin-ru_RU.mo +0 -0
  33. i18n/languages/wp_all_export_plugin-ru_RU.po +1460 -676
  34. libraries/XmlCsvExport.php +717 -0
  35. libraries/XmlExportACF.php +1050 -34
  36. libraries/XmlExportComment.php +234 -0
  37. libraries/XmlExportCpt.php +596 -0
  38. libraries/XmlExportEngine.php +563 -184
  39. libraries/XmlExportFiltering.php +106 -0
  40. libraries/XmlExportMediaGallery.php +336 -0
  41. libraries/XmlExportUser.php +203 -100
  42. libraries/XmlExportWooCommerce.php +603 -190
  43. libraries/XmlExportWooCommerceCoupon.php +198 -0
  44. libraries/XmlExportWooCommerceOrder.php +725 -109
  45. libraries/XmlGoogleMerchants.php +59 -0
  46. models/export/record.php +243 -2
  47. readme.txt +12 -2
  48. schema.php +2 -0
  49. static/css/admin.css +266 -98
  50. static/js/admin.js +823 -545
  51. views/admin/export/blocks/filters.php +132 -0
  52. views/admin/export/index.php +25 -17
  53. views/admin/export/options.php +52 -151
  54. views/admin/export/options/settings.php +108 -55
  55. views/admin/export/process.php +110 -46
  56. views/admin/export/template.php +174 -119
  57. views/admin/export/template/add_new_field.php +27 -0
  58. views/admin/export/template/advanced_field_options.php +92 -0
  59. views/admin/export/template/new_field_cpt.php +0 -151
  60. views/admin/export/template/new_field_shop_order.php +0 -98
  61. views/admin/export/template/new_field_user.php +0 -122
  62. views/admin/manage/index.php +21 -18
  63. views/admin/manage/scheduling.php +8 -4
  64. views/admin/manage/update.php +25 -130
  65. wp-all-export.php +29 -8
actions/admin_menu.php CHANGED
@@ -6,16 +6,16 @@
6
  function pmxe_admin_menu() {
7
  global $menu, $submenu;
8
 
9
- if (current_user_can('manage_options')) { // admin management options
10
 
11
- add_menu_page(__('WP All Export', 'wp_all_export_plugin'), __('All Export', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-home', array(PMXE_Plugin::getInstance(), 'adminDispatcher'), PMXE_Plugin::ROOT_URL . '/static/img/xmlicon.png');
12
  // workaround to rename 1st option to `Home`
13
  $submenu['pmxe-admin-home'] = array();
14
- add_submenu_page('pmxe-admin-home', __('Export to XML', 'wp_all_export_plugin') . ' ‹ ' . __('WP All Export', 'wp_all_export_plugin'), __('New Export', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-export', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
15
- add_submenu_page('pmxe-admin-home', __('Manage Exports', 'wp_all_export_plugin') . ' ‹ ' . __('WP All Export', 'wp_all_export_plugin'), __('Manage Exports', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-manage', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
16
- add_submenu_page('pmxe-admin-home', __('Settings', 'wp_all_export_plugin') . ' ‹ ' . __('WP All Export', 'wp_all_export_plugin'), __('Settings', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-settings', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
17
- // add_submenu_page('pmxe-admin-home', __('Feedback', 'wp_all_export_plugin') . ' ‹ ' . __('WP All Export', 'wp_all_export_plugin'), __('Feedback', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-feedback', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
18
- add_submenu_page('pmxe-admin-home', __('Support', 'wp_all_export_plugin') . ' ‹ ' . __('WP All Export', 'wp_all_export_plugin'), __('Support', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-help', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
19
 
20
  }
21
  }
6
  function pmxe_admin_menu() {
7
  global $menu, $submenu;
8
 
9
+ if (current_user_can(PMXE_Plugin::$capabilities)) { // admin management options
10
 
11
+ add_menu_page(__('WP All Export', 'wp_all_export_plugin'), __('All Export', 'wp_all_export_plugin'), PMXE_Plugin::$capabilities, 'pmxe-admin-home', array(PMXE_Plugin::getInstance(), 'adminDispatcher'), PMXE_Plugin::ROOT_URL . '/static/img/xmlicon.png');
12
  // workaround to rename 1st option to `Home`
13
  $submenu['pmxe-admin-home'] = array();
14
+ add_submenu_page('pmxe-admin-home', __('Export to XML', 'wp_all_export_plugin') . ' ‹ ' . __('WP All Export', 'wp_all_export_plugin'), __('New Export', 'wp_all_export_plugin'), PMXE_Plugin::$capabilities, 'pmxe-admin-export', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
15
+ add_submenu_page('pmxe-admin-home', __('Manage Exports', 'wp_all_export_plugin') . ' ‹ ' . __('WP All Export', 'wp_all_export_plugin'), __('Manage Exports', 'wp_all_export_plugin'), PMXE_Plugin::$capabilities, 'pmxe-admin-manage', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
16
+ add_submenu_page('pmxe-admin-home', __('Settings', 'wp_all_export_plugin') . ' ‹ ' . __('WP All Export', 'wp_all_export_plugin'), __('Settings', 'wp_all_export_plugin'), PMXE_Plugin::$capabilities, 'pmxe-admin-settings', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
17
+ // add_submenu_page('pmxe-admin-home', __('Feedback', 'wp_all_export_plugin') . ' ‹ ' . __('WP All Export', 'wp_all_export_plugin'), __('Feedback', 'wp_all_export_plugin'), PMXE_Plugin::$capabilities, 'pmxe-admin-feedback', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
18
+ add_submenu_page('pmxe-admin-home', __('Support', 'wp_all_export_plugin') . ' ‹ ' . __('WP All Export', 'wp_all_export_plugin'), __('Support', 'wp_all_export_plugin'), PMXE_Plugin::$capabilities, 'pmxe-admin-help', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
19
 
20
  }
21
  }
actions/pmxe_after_export.php CHANGED
@@ -1,17 +1,16 @@
1
  <?php
2
 
3
- function pmxe_pmxe_after_export($export_id)
4
- {
5
- $export = new PMXE_Export_Record();
6
- $export->getById($export_id);
7
-
8
- $splitSize = $export->options['split_large_exports_count'];
9
-
 
10
  if ( ! $export->isEmpty())
11
- {
12
- $export->set(array(
13
- 'iteration' => $export->options['creata_a_new_export_file'] ? $export->iteration + 1 : 0
14
- ))->update();
15
 
16
  $exportOptions = $export->options;
17
  // remove previously genereted chunks
@@ -31,7 +30,7 @@ function pmxe_pmxe_after_export($export_id)
31
  else
32
  {
33
  $filepath = wp_all_export_get_absolute_path($export->options['filepath']);
34
- }
35
 
36
  // Split large exports into chunks
37
  if ( $export->options['split_large_exports'] and $splitSize < $export->exported )
@@ -46,13 +45,16 @@ function pmxe_pmxe_after_export($export_id)
46
  {
47
  case 'xml':
48
 
 
 
 
49
  $records_count = 0;
50
  $chunk_records_count = 0;
51
  $fileCount = 1;
52
 
53
- $feed = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" . "\n" . "<".$export->options['main_xml_tag'].">";
54
 
55
- $file = new PMXE_Chunk($filepath, array('element' => $export->options['record_xml_tag'], 'encoding' => 'UTF-8'));
56
  // loop through the file until all lines are read
57
  while ($xml = $file->read()) {
58
 
@@ -72,16 +74,16 @@ function pmxe_pmxe_after_export($export_id)
72
  }
73
 
74
  if ( $chunk_records_count == $splitSize or $records_count == $export->exported ){
75
- $feed .= "</".$export->options['main_xml_tag'].">";
76
  $outputFile = str_replace(basename($filepath), str_replace('.xml', '', basename($filepath)) . '-' . $fileCount++ . '.xml', $filepath);
77
  file_put_contents($outputFile, $feed);
78
  if ( ! in_array($outputFile, $exportOptions['split_files_list']))
79
  $exportOptions['split_files_list'][] = $outputFile;
80
  $chunk_records_count = 0;
81
- $feed = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" . "\n" . "<".$export->options['main_xml_tag'].">";
82
  }
83
 
84
- }
85
  break;
86
  case 'csv':
87
  $in = fopen($filepath, 'r');
@@ -110,8 +112,9 @@ function pmxe_pmxe_after_export($export_id)
110
  }
111
  $rowCount++;
112
  }
 
 
113
 
114
- fclose($out);
115
  break;
116
 
117
  default:
@@ -121,6 +124,33 @@ function pmxe_pmxe_after_export($export_id)
121
 
122
  $export->set(array('options' => $exportOptions))->save();
123
  }
124
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
126
  }
1
  <?php
2
 
3
+ function pmxe_pmxe_after_export($export_id, $export)
4
+ {
5
+ if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
6
+ {
7
+ PMXE_Plugin::$session->set('file', '');
8
+ PMXE_Plugin::$session->save_data();
9
+ }
10
+
11
  if ( ! $export->isEmpty())
12
+ {
13
+ $splitSize = $export->options['split_large_exports_count'];
 
 
14
 
15
  $exportOptions = $export->options;
16
  // remove previously genereted chunks
30
  else
31
  {
32
  $filepath = wp_all_export_get_absolute_path($export->options['filepath']);
33
+ }
34
 
35
  // Split large exports into chunks
36
  if ( $export->options['split_large_exports'] and $splitSize < $export->exported )
45
  {
46
  case 'xml':
47
 
48
+ $main_xml_tag = apply_filters('wp_all_export_main_xml_tag', $export->options['main_xml_tag'], $export->id);
49
+ $record_xml_tag = apply_filters('wp_all_export_record_xml_tag', $export->options['record_xml_tag'], $export->id);
50
+
51
  $records_count = 0;
52
  $chunk_records_count = 0;
53
  $fileCount = 1;
54
 
55
+ $feed = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" . "\n" . "<".$main_xml_tag.">";
56
 
57
+ $file = new PMXE_Chunk($filepath, array('element' => $record_xml_tag, 'encoding' => 'UTF-8'));
58
  // loop through the file until all lines are read
59
  while ($xml = $file->read()) {
60
 
74
  }
75
 
76
  if ( $chunk_records_count == $splitSize or $records_count == $export->exported ){
77
+ $feed .= "</".$main_xml_tag.">";
78
  $outputFile = str_replace(basename($filepath), str_replace('.xml', '', basename($filepath)) . '-' . $fileCount++ . '.xml', $filepath);
79
  file_put_contents($outputFile, $feed);
80
  if ( ! in_array($outputFile, $exportOptions['split_files_list']))
81
  $exportOptions['split_files_list'][] = $outputFile;
82
  $chunk_records_count = 0;
83
+ $feed = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" . "\n" . "<".$main_xml_tag.">";
84
  }
85
 
86
+ }
87
  break;
88
  case 'csv':
89
  $in = fopen($filepath, 'r');
112
  }
113
  $rowCount++;
114
  }
115
+ fclose($in);
116
+ fclose($out);
117
 
 
118
  break;
119
 
120
  default:
124
 
125
  $export->set(array('options' => $exportOptions))->save();
126
  }
127
+ }
128
+
129
+ // make a temporary copy of current file
130
+ if ( empty($export->parent_id) and @file_exists($filepath) and @copy($filepath, str_replace(basename($filepath), '', $filepath) . 'current-' . basename($filepath)))
131
+ {
132
+ $exportOptions = $export->options;
133
+ $exportOptions['current_filepath'] = str_replace(basename($filepath), '', $filepath) . 'current-' . basename($filepath);
134
+ $export->set(array('options' => $exportOptions))->save();
135
+ }
136
+
137
+ // genereta export bundle
138
+ $export->generate_bundle();
139
+
140
+ if ( ! empty($export->parent_id) )
141
+ {
142
+ $parent_export = new PMXE_Export_Record();
143
+ $parent_export->getById($export->parent_id);
144
+ if ( ! $parent_export->isEmpty() )
145
+ {
146
+ $parent_export->generate_bundle(true);
147
+ }
148
+ }
149
+
150
+ // clean session
151
+ if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
152
+ {
153
+ PMXE_Plugin::$session->clean_session( $export->id );
154
+ }
155
  }
156
  }
actions/pmxe_exported_post.php CHANGED
@@ -1,15 +1,26 @@
1
  <?php
2
- function pmxe_pmxe_exported_post( $pid ){
3
-
 
 
 
 
4
  $postRecord = new PMXE_Post_Record();
5
  $postRecord->getBy(array(
6
  'post_id' => $pid,
7
- 'export_id' => XmlExportEngine::$exportID
8
  ));
9
 
10
- $postRecord->isEmpty() and $postRecord->set(array(
11
- 'post_id' => $pid,
12
- 'export_id' => XmlExportEngine::$exportID
13
- ))->insert();
14
-
 
 
 
 
 
 
 
15
  }
1
  <?php
2
+
3
+ function pmxe_pmxe_exported_post( $pid, $exportRecord )
4
+ {
5
+ // do not associate exported record with child export
6
+ if ( ! empty($exportRecord->parent_id) ) return;
7
+
8
  $postRecord = new PMXE_Post_Record();
9
  $postRecord->getBy(array(
10
  'post_id' => $pid,
11
+ 'export_id' => XmlExportEngine::$exportID
12
  ));
13
 
14
+ if ($postRecord->isEmpty())
15
+ {
16
+ $postRecord->set(array(
17
+ 'post_id' => $pid,
18
+ 'export_id' => XmlExportEngine::$exportID,
19
+ 'iteration' => $exportRecord->iteration
20
+ ))->insert();
21
+ }
22
+ else
23
+ {
24
+ $postRecord->set(array('iteration' => $exportRecord->iteration))->update();
25
+ }
26
  }
actions/wp_ajax_export_available_rules.php CHANGED
@@ -6,7 +6,7 @@ function pmxe_wp_ajax_export_available_rules(){
6
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
  }
8
 
9
- if ( ! current_user_can('manage_options') ){
10
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
  }
12
 
@@ -24,15 +24,15 @@ function pmxe_wp_ajax_export_available_rules(){
24
  ?>
25
 
26
  <!-- Taxonomies -->
27
- <option value="in">IN</option>
28
- <option value="not_in">NOT IN</option>
29
 
30
  <!-- Custom Fields -->
31
  <!--option value="between">BETWEEN</option-->
32
 
33
  <?php
34
  }
35
- elseif($post['selected'] === 'post_date')
36
  {
37
  ?>
38
  <option value="equals"><?php _e('equals', 'wp_all_export_plugin'); ?></option>
@@ -48,18 +48,38 @@ function pmxe_wp_ajax_export_available_rules(){
48
  <option value="is_not_empty"><?php _e('is not empty', 'wp_all_export_plugin'); ?></option>
49
  <?php
50
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  else
52
  {
53
  ?>
54
  <option value="equals"><?php _e('equals', 'wp_all_export_plugin'); ?></option>
55
- <option value="not_equals"><?php _e('not equals', 'wp_all_export_plugin'); ?></option>
56
  <option value="greater"><?php _e('greater than', 'wp_all_export_plugin');?></option>
57
- <option value="equals_or_greater"><?php _e('equals or greater than', 'wp_all_export_plugin'); ?></option>
58
  <option value="less"><?php _e('less than', 'wp_all_export_plugin'); ?></option>
59
- <option value="equals_or_less"><?php _e('equals or less than', 'wp_all_export_plugin'); ?></option>
60
 
61
  <option value="contains"><?php _e('contains', 'wp_all_export_plugin'); ?></option>
62
- <option value="not_contains"><?php _e('not contains', 'wp_all_export_plugin'); ?></option>
63
  <option value="is_empty"><?php _e('is empty', 'wp_all_export_plugin'); ?></option>
64
  <option value="is_not_empty"><?php _e('is not empty', 'wp_all_export_plugin'); ?></option>
65
  <?php
6
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
  }
8
 
9
+ if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
10
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
  }
12
 
24
  ?>
25
 
26
  <!-- Taxonomies -->
27
+ <option value="in"><?php echo __('In', 'wp_all_export_plugin') . ' ' . ucwords(str_replace(array("tx_", "_"), array("", " "), $post['selected'])); ?></option>
28
+ <option value="not_in"><?php echo __('Not In', 'wp_all_export_plugin') . ' ' . ucwords(str_replace(array("tx_", "_"), array("", " "), $post['selected'])); ?></option>
29
 
30
  <!-- Custom Fields -->
31
  <!--option value="between">BETWEEN</option-->
32
 
33
  <?php
34
  }
35
+ elseif( in_array($post['selected'], array('post_date', 'user_registered', 'comment_date')) )
36
  {
37
  ?>
38
  <option value="equals"><?php _e('equals', 'wp_all_export_plugin'); ?></option>
48
  <option value="is_not_empty"><?php _e('is not empty', 'wp_all_export_plugin'); ?></option>
49
  <?php
50
  }
51
+ elseif( in_array($post['selected'], array('wp_capabilities')))
52
+ {
53
+ ?>
54
+ <option value="contains"><?php _e('contains', 'wp_all_export_plugin'); ?></option>
55
+ <option value="not_contains"><?php _e("doesn't contain", 'wp_all_export_plugin'); ?></option>
56
+ <?php
57
+ }
58
+ elseif ( in_array($post['selected'], array('user_login', 'user_nicename', 'user_role', 'user_email', 'display_name', 'first_name', 'last_name', 'nickname', 'description',
59
+ 'post_status', 'post_title', 'post_content', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_agent',
60
+ 'comment_type', 'comment_content') ) )
61
+ {
62
+ ?>
63
+ <option value="equals"><?php _e('equals', 'wp_all_export_plugin'); ?></option>
64
+ <option value="not_equals"><?php _e("doesn't equal", 'wp_all_export_plugin'); ?></option>
65
+ <option value="contains"><?php _e('contains', 'wp_all_export_plugin'); ?></option>
66
+ <option value="not_contains"><?php _e("doesn't contain", 'wp_all_export_plugin'); ?></option>
67
+ <option value="is_empty"><?php _e('is empty', 'wp_all_export_plugin'); ?></option>
68
+ <option value="is_not_empty"><?php _e('is not empty', 'wp_all_export_plugin'); ?></option>
69
+ <?php
70
+ }
71
  else
72
  {
73
  ?>
74
  <option value="equals"><?php _e('equals', 'wp_all_export_plugin'); ?></option>
75
+ <option value="not_equals"><?php _e("doesn't equal", 'wp_all_export_plugin'); ?></option>
76
  <option value="greater"><?php _e('greater than', 'wp_all_export_plugin');?></option>
77
+ <option value="equals_or_greater"><?php _e('equal to or greater than', 'wp_all_export_plugin'); ?></option>
78
  <option value="less"><?php _e('less than', 'wp_all_export_plugin'); ?></option>
79
+ <option value="equals_or_less"><?php _e('equal to or less than', 'wp_all_export_plugin'); ?></option>
80
 
81
  <option value="contains"><?php _e('contains', 'wp_all_export_plugin'); ?></option>
82
+ <option value="not_contains"><?php _e("doesn't contain", 'wp_all_export_plugin'); ?></option>
83
  <option value="is_empty"><?php _e('is empty', 'wp_all_export_plugin'); ?></option>
84
  <option value="is_not_empty"><?php _e('is not empty', 'wp_all_export_plugin'); ?></option>
85
  <?php
actions/wp_ajax_export_filtering.php CHANGED
@@ -6,10 +6,15 @@ function pmxe_wp_ajax_export_filtering(){
6
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
  }
8
 
9
- if ( ! current_user_can('manage_options') ){
10
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
  }
12
 
 
 
 
 
 
13
  ob_start();
14
 
15
  $errors = new WP_Error();
@@ -18,7 +23,7 @@ function pmxe_wp_ajax_export_filtering(){
18
 
19
  $post = $input->post('data', array());
20
 
21
- if ( ! empty($post['cpt'])):
22
 
23
  $engine = new XmlExportEngine($post, $errors);
24
 
@@ -30,116 +35,44 @@ function pmxe_wp_ajax_export_filtering(){
30
  <h3><?php _e('Add Filtering Options', 'wp_all_export_plugin'); ?></h3>
31
  </div>
32
  <div class="wpallexport-collapsed-content">
33
- <div class="wpallexport-free-edition-notice" style="padding: 20px; margin-bottom: 10px;">
34
- <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=filter-rules&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to add filtering rules.','wp_all_export_plugin');?></a>
35
- <p><?php _e('If you already own it, remove the free edition and install the professional edition.', 'wp_all_export_plugin'); ?></p>
36
- </div>
37
- <div class="wp_all_export_rule_inputs">
38
- <table>
39
- <tr>
40
- <th><?php _e('Element', 'wp_all_export_plugin'); ?></th>
41
- <th><?php _e('Rule', 'wp_all_export_plugin'); ?></th>
42
- <th><?php _e('Value', 'wp_all_export_plugin'); ?></th>
43
- <th>&nbsp;</th>
44
- </tr>
45
- <tr>
46
- <td style="width: 25%;">
47
- <select id="wp_all_export_xml_element">
48
- <option value=""><?php _e('Select Element', 'wp_all_export_plugin'); ?></option>
49
- <?php echo $engine->render_filters(); ?>
50
- </select>
51
- </td>
52
- <td style="width: 25%;" id="wp_all_export_available_rules">
53
- <select id="wp_all_export_rule">
54
- <option value=""><?php _e('Select Rule', 'wp_all_export_plugin'); ?></option>
55
- </select>
56
- </td>
57
- <td style="width: 25%;">
58
- <input id="wp_all_export_value" type="text" placeholder="value" value="" disabled="disabled"/>
59
- </td>
60
- <td style="width: 15%;">
61
- <a id="wp_all_export_add_rule" href="javascript:void(0);"><?php _e('Add Rule', 'wp_all_export_plugin');?></a>
62
- </td>
63
- </tr>
64
- </table>
65
- </div>
66
- <div id="wpallexport-filters" style="padding:0;">
67
- <div class="wpallexport-content-section" style="padding:0; border: none;">
68
- <fieldset id="wp_all_export_filtering_rules">
69
- <?php
70
- $filter_rules = PMXE_Plugin::$session->get('filter_rules_hierarhy');
71
- $filter_rules_hierarhy = json_decode($filter_rules);
72
- ?>
73
- <p style="margin:20px 0 5px; text-align:center; <?php if (!empty($filter_rules_hierarhy)):?> display:none;<?php endif; ?>"><?php _e('No filtering options. Add filtering options to only export records matching some specified criteria.', 'wp_all_export_plugin');?></p>
74
- <ol class="wp_all_export_filtering_rules">
75
- <?php
76
- if ( ! empty($filter_rules_hierarhy) and is_array($filter_rules_hierarhy) ):
77
- $rulenumber = 0;
78
- foreach ($filter_rules_hierarhy as $rule) {
79
-
80
- if ( is_null($rule->parent_id) )
81
- {
82
- $rulenumber++;
83
- ?>
84
- <li id="item_<?php echo $rulenumber;?>" class="dragging">
85
- <div class="drag-element">
86
- <input type="hidden" value="<?php echo $rule->element; ?>" class="wp_all_export_xml_element" name="wp_all_export_xml_element[<?php echo $rulenumber; ?>]"/>
87
- <input type="hidden" value="<?php echo $rule->title; ?>" class="wp_all_export_xml_element_title" name="wp_all_export_xml_element_title[<?php echo $rulenumber; ?>]"/>
88
- <input type="hidden" value="<?php echo $rule->condition; ?>" class="wp_all_export_rule" name="wp_all_export_rule[<?php echo $rulenumber; ?>]"/>
89
- <input type="hidden" value="<?php echo $rule->value; ?>" class="wp_all_export_value" name="wp_all_export_value[<?php echo $rulenumber; ?>]"/>
90
- <span class="rule_element"><?php echo $rule->title; ?></span>
91
- <span class="rule_as_is"><?php echo $rule->condition; ?></span>
92
- <span class="rule_condition_value"><?php echo $rule->value; ?></span>
93
- <span class="condition" <?php if ($rulenumber == count($filter_rules_hierarhy)):?>style="display:none;"<?php endif; ?>>
94
- <label for="rule_and_<?php echo $rulenumber; ?>">AND</label>
95
- <input id="rule_and_<?php echo $rulenumber; ?>" type="radio" value="and" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'AND'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
96
- <label for="rule_or_<?php echo $rulenumber; ?>">OR</label>
97
- <input id="rule_or_<?php echo $rulenumber; ?>" type="radio" value="or" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'OR'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
98
- </span>
99
- </div>
100
- <a href="javascript:void(0);" class="icon-item remove-ico"></a>
101
- <?php echo wp_all_export_reverse_rules_html($filter_rules_hierarhy, $rule, $rulenumber); ?>
102
- </li>
103
- <?php
104
- }
105
- }
106
- endif;
107
- ?>
108
- </ol>
109
- <div class="clear"></div>
110
- <div class="ajax-console" id="filtering_result">
111
-
112
- </div>
113
- <!--a href="javascript:void(0);" id="wp_all_export_apply_filters" <?php if (empty($filter_rules_hierarhy)):?>style="display:none;"<?php endif; ?>><?php _e('Apply Filters To Export Data', 'wp_all_export_plugin');?></a-->
114
- <div class="wp_all_export_filter_preloader"></div>
115
- </fieldset>
116
-
117
- <?php if ( "product" == $post["cpt"] and class_exists('WooCommerce')) : ?>
118
-
119
- <div class="input wp_all_export_product_matching_mode" <?php if (empty($filter_rules_hierarhy)): ?>style="display:none;"<?php endif; ?>>
120
- <?php $product_matching_mode = PMXE_Plugin::$session->get('product_matching_mode'); ?>
121
- <label><?php _e("Variable product matching rules: ", "wp_all_export_plugin"); ?></label>
122
- <select name="product_matching_mode">
123
- <option value="strict" <?php echo ( $product_matching_mode == 'strict' ) ? 'selected="selected"' : ''; ?>><?php _e("Strict", "wp_all_export_plugin"); ?></option>
124
- <option value="permissive" <?php echo ( $product_matching_mode == 'permissive' ) ? 'selected="selected"' : ''; ?>><?php _e("Permissive", "wp_all_export_plugin"); ?></option>
125
- <option value="parent" <?php echo ( $product_matching_mode == 'parent' ) ? 'selected="selected"' : ''; ?>><?php _e("Parent", "wp_all_export_plugin"); ?></option>
126
- </select>
127
- <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('Strict matching requires all variations to pass in order for the product to be exported. Permissive matching allows the product to be exported if any of the variations pass. Parent matching applies filters to parent products only.', 'wp_all_export_plugin'); ?>">?</a>
128
- </div>
129
-
130
- <?php endif; ?>
131
-
132
-
133
-
134
- </div>
135
- </div>
136
  </div>
137
  </div>
138
 
139
  <?php
140
 
141
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
143
- exit(json_encode(array('html' => ob_get_clean()))); die;
144
 
145
  }
6
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
  }
8
 
9
+ if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
10
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
  }
12
 
13
+ $response = array(
14
+ 'html' => '',
15
+ 'btns' => ''
16
+ );
17
+
18
  ob_start();
19
 
20
  $errors = new WP_Error();
23
 
24
  $post = $input->post('data', array());
25
 
26
+ if ( ! empty($post['cpt'])):
27
 
28
  $engine = new XmlExportEngine($post, $errors);
29
 
35
  <h3><?php _e('Add Filtering Options', 'wp_all_export_plugin'); ?></h3>
36
  </div>
37
  <div class="wpallexport-collapsed-content">
38
+ <?php include_once PMXE_ROOT_DIR . '/views/admin/export/blocks/filters.php'; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  </div>
40
  </div>
41
 
42
  <?php
43
 
44
  endif;
45
+
46
+ $response['html'] = ob_get_clean();
47
+
48
+ if ( XmlExportEngine::$is_user_export || XmlExportEngine::$is_comment_export )
49
+ {
50
+ $response['btns'] = '';
51
+ exit(json_encode($response)); die;
52
+ }
53
+
54
+ ob_start();
55
+
56
+ if ( XmlExportEngine::$is_auto_generate_enabled ):
57
+ ?>
58
+ <span class="wp_all_export_btn_with_note">
59
+ <a href="javascript:void(0);" class="back rad3 auto-generate-template" style="float:none; background: #425f9a; padding: 0 50px; margin-right: 10px; color: #fff; font-weight: normal;"><?php printf(__('Migrate %s', 'wp_all_export_plugin'), wp_all_export_get_cpt_name(array($post['cpt']), 2)); ?></a>
60
+ <span class="auto-generate-template">&nbsp;</span>
61
+ </span>
62
+ <span class="wp_all_export_btn_with_note">
63
+ <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Customize Export File', 'wp_all_export_plugin') ?>"/>
64
+ <span class="auto-generate-template">&nbsp;</span>
65
+ </span>
66
+ <?php
67
+ else:
68
+ ?>
69
+ <span class="wp_all_export_btn_with_note">
70
+ <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Customize Export File', 'wp_all_export_plugin') ?>"/>
71
+ </span>
72
+ <?php
73
+ endif;
74
+ $response['btns'] = ob_get_clean();
75
 
76
+ exit(json_encode($response)); die;
77
 
78
  }
actions/wp_ajax_export_filtering_count.php CHANGED
@@ -6,7 +6,7 @@ function pmxe_wp_ajax_export_filtering_count(){
6
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
  }
8
 
9
- if ( ! current_user_can('manage_options') ){
10
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
  }
12
 
@@ -14,11 +14,11 @@ function pmxe_wp_ajax_export_filtering_count(){
14
 
15
  $input = new PMXE_Input();
16
 
17
- $post = $input->post('data', array());
18
 
19
  $filter_args = array(
20
- 'filter_rules_hierarhy' => $post['filter_rules_hierarhy'],
21
- 'product_matching_mode' => $post['product_matching_mode']
22
  );
23
 
24
  $input = new PMXE_Input();
@@ -30,12 +30,14 @@ function pmxe_wp_ajax_export_filtering_count(){
30
 
31
  $export = new PMXE_Export_Record();
32
  $export->getById($export_id);
33
- if ( ! $export->isEmpty() ){
 
34
  XmlExportEngine::$exportOptions = $export->options + PMXE_Plugin::get_default_import_options();
35
  XmlExportEngine::$exportOptions['export_only_new_stuff'] = $post['export_only_new_stuff'];
36
  }
37
 
38
- XmlExportEngine::$is_user_export = ( 'users' == $post['cpt'] ) ? true : false;
 
39
  XmlExportEngine::$post_types = array($post['cpt']);
40
 
41
  $filters = new XmlExportFiltering($filter_args);
@@ -49,62 +51,139 @@ function pmxe_wp_ajax_export_filtering_count(){
49
  $found_records = 0;
50
  $total_records = 0;
51
 
52
- if ( 'users' == $post['cpt'] )
 
 
 
 
53
  {
54
- // get total users
55
- $totalQuery = new WP_User_Query( array( 'orderby' => 'ID', 'order' => 'ASC', 'number' => 10 ));
56
- if ( ! empty($totalQuery->results)){
57
- $total_records = $totalQuery->get_total();
 
 
 
58
  }
59
-
60
- // get users depends on filters
61
- add_action('pre_user_query', 'wp_all_export_pre_user_query', 10, 1);
62
- $exportQuery = new WP_User_Query( array( 'orderby' => 'ID', 'order' => 'ASC', 'number' => 10 ));
63
- if ( ! empty($exportQuery->results)){
64
- $found_records = $exportQuery->get_total();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
- remove_action('pre_user_query', 'wp_all_export_pre_user_query');
67
  }
68
  else
69
- {
70
- $cpt = ($post['cpt'] == 'product') ? array('product', 'product_variation') : $post['cpt'];
71
-
72
- // get total custom post type records
73
- $totalQuery = new WP_Query( array( 'post_type' => $cpt, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
74
- if ( ! empty($totalQuery->found_posts)){
75
- $total_records = $totalQuery->found_posts;
 
76
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
- // get custom post type records depends on filters
79
- add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
80
- add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
81
 
82
- $exportQuery = new WP_Query( array( 'post_type' => $cpt, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
83
- if ( ! empty($exportQuery->found_posts)){
84
- $found_records = $exportQuery->found_posts;
85
- }
86
 
87
- remove_filter('posts_join', 'wp_all_export_posts_join');
88
- remove_filter('posts_where', 'wp_all_export_posts_where');
89
- }
 
 
90
 
 
 
 
 
 
 
 
 
91
  if ( $post['is_confirm_screen'] )
92
  {
93
  ?>
94
 
95
  <?php if ($found_records > 0) :?>
96
- <h3><?php _e('Your export is ready to run.', 'wp_all_export_plugin'); ?></h3>
97
- <h4><?php printf(__('WP All Export will export %d %s.', 'wp_all_export_plugin'), $found_records, wp_all_export_get_cpt_name(array($post['cpt']), $found_records)); ?></h4>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  <?php else: ?>
99
  <?php if (! $export->isEmpty() and $export->options['export_only_new_stuff']): ?>
100
- <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
101
- <h4><?php printf(__("All %s have already been exported.", "wp_all_export_plugin"), wp_all_export_get_cpt_name(array($post['cpt']))); ?></h4>
102
  <?php elseif ($total_records > 0): ?>
103
- <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
104
- <h4><?php printf(__("No matching %s found for selected filter rules.", "wp_all_export_plugin"), wp_all_export_get_cpt_name(array($post['cpt']))); ?></h4>
105
  <?php else: ?>
106
- <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
107
- <h4><?php printf(__("There aren't any %s to export.", "wp_all_export_plugin"), wp_all_export_get_cpt_name(array($post['cpt']))); ?></h4>
108
  <?php endif; ?>
109
  <?php endif; ?>
110
 
@@ -114,13 +193,18 @@ function pmxe_wp_ajax_export_filtering_count(){
114
  {
115
  ?>
116
  <div class="founded_records">
117
- <?php if ($found_records > 0) :?>
118
- <h3><span class="matches_count"><?php echo $found_records; ?></span> <strong><?php echo wp_all_export_get_cpt_name(array($post['cpt']), $found_records); ?></strong> will be exported</h3>
119
- <h4><?php _e("Continue to Step 2 to choose data to include in the export file.", "wp_all_export_plugin"); ?></h4>
 
 
 
 
 
120
  <?php elseif ($total_records > 0): ?>
121
- <h4 style="line-height:60px;"><?php printf(__("No matching %s found for selected filter rules.", "wp_all_export_plugin"), wp_all_export_get_cpt_name(array($post['cpt']))); ?></h4>
122
  <?php else: ?>
123
- <h4 style="line-height:60px;"><?php printf(__("There aren't any %s to export.", "wp_all_export_plugin"), wp_all_export_get_cpt_name(array($post['cpt']))); ?></h4>
124
  <?php endif; ?>
125
  </div>
126
  <?php
6
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
  }
8
 
9
+ if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
10
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
  }
12
 
14
 
15
  $input = new PMXE_Input();
16
 
17
+ $post = $input->post('data', array());
18
 
19
  $filter_args = array(
20
+ 'filter_rules_hierarhy' => empty($post['filter_rules_hierarhy']) ? array() : $post['filter_rules_hierarhy'],
21
+ 'product_matching_mode' => empty($post['product_matching_mode']) ? 'strict' : $post['product_matching_mode']
22
  );
23
 
24
  $input = new PMXE_Input();
30
 
31
  $export = new PMXE_Export_Record();
32
  $export->getById($export_id);
33
+ if ( ! $export->isEmpty() )
34
+ {
35
  XmlExportEngine::$exportOptions = $export->options + PMXE_Plugin::get_default_import_options();
36
  XmlExportEngine::$exportOptions['export_only_new_stuff'] = $post['export_only_new_stuff'];
37
  }
38
 
39
+ XmlExportEngine::$is_user_export = ( 'users' == $post['cpt'] or 'shop_customer' == $post['cpt'] ) ? true : false;
40
+ XmlExportEngine::$is_comment_export = ( 'comments' == $post['cpt'] ) ? true : false;
41
  XmlExportEngine::$post_types = array($post['cpt']);
42
 
43
  $filters = new XmlExportFiltering($filter_args);
51
  $found_records = 0;
52
  $total_records = 0;
53
 
54
+ $cpt = array($post['cpt']);
55
+
56
+ $is_products_export = ($post['cpt'] == 'product' and class_exists('WooCommerce'));
57
+
58
+ if ($post['export_type'] == 'advanced')
59
  {
60
+ if (XmlExportEngine::$is_user_export)
61
+ {
62
+ // get total users
63
+ $totalQuery = eval('return new WP_User_Query(array(' . PMXE_Plugin::$session->get('wp_query') . ', \'offset\' => 0, \'number\' => 10 ));');
64
+ if ( ! empty($totalQuery->results)){
65
+ $found_records = $total_records = $totalQuery->get_total();
66
+ }
67
  }
68
+ elseif(XmlExportEngine::$is_comment_export)
69
+ {
70
+ // get total comments
71
+ $totalQuery = eval('return new WP_Comment_Query(array(' . PMXE_Plugin::$session->get('wp_query') . ', \'number\' => 10, \'count\' => true ));');
72
+ $found_records = $total_records = $totalQuery->get_comments();
73
+ }
74
+ else
75
+ {
76
+ remove_all_actions('parse_query');
77
+ remove_all_actions('pre_get_posts');
78
+
79
+ ob_start();
80
+ // get custom post type records depends on filters
81
+ add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
82
+ add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
83
+
84
+ // get total custom post type records
85
+ $totalQuery = eval('return new WP_Query(array(' . PMXE_Plugin::$session->get('wp_query') . ', \'offset\' => 0, \'posts_per_page\' => 10 ));');
86
+ if ( ! empty($totalQuery->found_posts)){
87
+ $found_records = $total_records = $totalQuery->found_posts;
88
+ }
89
+
90
+ wp_reset_postdata();
91
+
92
+ remove_filter('posts_join', 'wp_all_export_posts_join');
93
+ remove_filter('posts_where', 'wp_all_export_posts_where');
94
+ ob_get_clean();
95
  }
 
96
  }
97
  else
98
+ {
99
+ if ( 'users' == $post['cpt'] or 'shop_customer' == $post['cpt'] )
100
+ {
101
+ // get total users
102
+ $totalQuery = new WP_User_Query( array( 'orderby' => 'ID', 'order' => 'ASC', 'number' => 10 ));
103
+ if ( ! empty($totalQuery->results)){
104
+ $found_records = $total_records = $totalQuery->get_total();
105
+ }
106
  }
107
+ elseif( 'comments' == $post['cpt'] )
108
+ {
109
+ // get total comments
110
+ global $wp_version;
111
+
112
+ if ( version_compare($wp_version, '4.2.0', '>=') )
113
+ {
114
+ $totalQuery = new WP_Comment_Query( array( 'orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10, 'count' => true));
115
+ $found_records = $total_records = $totalQuery->get_comments();
116
+ }
117
+ else
118
+ {
119
+ $found_records = $total_records = get_comments( array( 'orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10, 'count' => true));
120
+ }
121
+ }
122
+ else
123
+ {
124
+ remove_all_actions('parse_query');
125
+ remove_all_actions('pre_get_posts');
126
 
127
+ $cpt = ($is_products_export) ? array('product', 'product_variation') : array($post['cpt']);
 
 
128
 
129
+ ob_start();
130
+ // get custom post type records depends on filters
131
+ add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
132
+ add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
133
 
134
+ // get total custom post type records
135
+ $totalQuery = new WP_Query( array( 'post_type' => $cpt, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
136
+ if ( ! empty($totalQuery->found_posts)){
137
+ $found_records = $total_records = $totalQuery->found_posts;
138
+ }
139
 
140
+ wp_reset_postdata();
141
+
142
+ remove_filter('posts_join', 'wp_all_export_posts_join');
143
+ remove_filter('posts_where', 'wp_all_export_posts_where');
144
+ ob_end_clean();
145
+ }
146
+ }
147
+
148
  if ( $post['is_confirm_screen'] )
149
  {
150
  ?>
151
 
152
  <?php if ($found_records > 0) :?>
153
+ <h3><?php _e('Your export is ready to run.', 'wp_all_export_plugin'); ?></h3>
154
+ <h4><?php printf(__('WP All Export will export %d %s.', 'wp_all_export_plugin'), $found_records, wp_all_export_get_cpt_name($cpt, $found_records)); ?></h4>
155
+ <?php else: ?>
156
+ <?php if (! $export->isEmpty() and $export->options['export_only_new_stuff']): ?>
157
+ <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
158
+ <h4><?php printf(__("All %s have already been exported.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt)); ?></h4>
159
+ <?php elseif ($total_records > 0): ?>
160
+ <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
161
+ <h4><?php printf(__("No matching %s found for selected filter rules.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt)); ?></h4>
162
+ <?php else: ?>
163
+ <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
164
+ <h4><?php printf(__("There aren't any %s to export.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt)); ?></h4>
165
+ <?php endif; ?>
166
+ <?php endif; ?>
167
+
168
+ <?php
169
+ }
170
+ elseif( $post['is_template_screen'] )
171
+ {
172
+ ?>
173
+
174
+ <?php if ($found_records > 0) :?>
175
+ <h3><span class="matches_count"><?php echo $found_records; ?></span> <strong><?php echo wp_all_export_get_cpt_name($cpt, $found_records); ?></strong> will be exported</h3>
176
+ <h4><?php _e("Choose data to include in the export file.", "wp_all_export_plugin"); ?></h4>
177
  <?php else: ?>
178
  <?php if (! $export->isEmpty() and $export->options['export_only_new_stuff']): ?>
179
+ <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
180
+ <h4><?php printf(__("All %s have already been exported.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt)); ?></h4>
181
  <?php elseif ($total_records > 0): ?>
182
+ <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
183
+ <h4><?php printf(__("No matching %s found for selected filter rules.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt)); ?></h4>
184
  <?php else: ?>
185
+ <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
186
+ <h4><?php printf(__("There aren't any %s to export.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt)); ?></h4>
187
  <?php endif; ?>
188
  <?php endif; ?>
189
 
193
  {
194
  ?>
195
  <div class="founded_records">
196
+ <?php if ($found_records > 0) :?>
197
+ <?php if (XmlExportEngine::$is_user_export || XmlExportEngine::$is_comment_export): ?>
198
+ <h3><span class="matches_count"><?php echo $found_records; ?></span> <strong><?php echo wp_all_export_get_cpt_name($cpt, $found_records); ?></strong> can be exported</h3>
199
+ <h4><?php printf(__('Upgrade to the professional edition of WP All Export to export %s.', 'wp_all_export_plugin'), wp_all_export_get_cpt_name($cpt)); ?></h4>
200
+ <?php else:?>
201
+ <h3><span class="matches_count"><?php echo $found_records; ?></span> <strong><?php echo wp_all_export_get_cpt_name($cpt, $found_records); ?></strong> will be exported</h3>
202
+ <h4><?php _e("Continue to configure and run your export.", "wp_all_export_plugin"); ?></h4>
203
+ <?php endif; ?>
204
  <?php elseif ($total_records > 0): ?>
205
+ <h4 style="line-height:60px;"><?php printf(__("No matching %s found for selected filter rules.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt)); ?></h4>
206
  <?php else: ?>
207
+ <h4 style="line-height:60px;"><?php printf(__("There aren't any %s to export.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($cpt)); ?></h4>
208
  <?php endif; ?>
209
  </div>
210
  <?php
actions/wp_ajax_export_preview.php CHANGED
@@ -8,7 +8,7 @@ function pmxe_wp_ajax_export_preview(){
8
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
9
  }
10
 
11
- if ( ! current_user_can('manage_options') ){
12
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
13
  }
14
 
@@ -18,16 +18,28 @@ function pmxe_wp_ajax_export_preview(){
18
 
19
  parse_str($_POST['data'], $values);
20
 
 
 
21
  $exportOptions = $values + (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + PMXE_Plugin::get_default_import_options();
22
 
23
- XmlExportEngine::$exportOptions = $exportOptions;
24
- XmlExportEngine::$is_user_export = $exportOptions['is_user_export'];
 
 
 
 
 
 
25
 
26
  if ( 'advanced' == $exportOptions['export_type'] )
27
  {
28
  if ( XmlExportEngine::$is_user_export )
29
  {
30
- exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export users.', 'wp_all_export_plugin'))) );
 
 
 
 
31
  }
32
  else
33
  {
@@ -38,13 +50,33 @@ function pmxe_wp_ajax_export_preview(){
38
  {
39
  XmlExportEngine::$post_types = $exportOptions['cpt'];
40
 
41
- if ( ! in_array('users', $exportOptions['cpt']))
42
- {
43
- $exportQuery = new WP_Query( array( 'post_type' => $exportOptions['cpt'], 'post_status' => 'any', 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => 10 ));
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
  else
46
- {
47
- exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export users.', 'wp_all_export_plugin'))) );
 
 
 
 
 
 
 
48
  }
49
  }
50
 
@@ -57,28 +89,40 @@ function pmxe_wp_ajax_export_preview(){
57
  <div class="wpallexport-preview-content">
58
 
59
  <?php
 
 
 
 
 
60
 
61
  switch ($exportOptions['export_to']) {
62
 
63
  case 'xml':
64
 
65
  $dom = new DOMDocument('1.0', $exportOptions['encoding']);
66
- $old = libxml_use_internal_errors(true);
67
- $xml = pmxe_export_xml($exportQuery, $exportOptions, true);
 
 
68
  $dom->loadXML($xml);
69
  libxml_use_internal_errors($old);
70
  $xpath = new DOMXPath($dom);
71
- if (($elements = @$xpath->query('/' . $exportOptions['main_xml_tag'])) and $elements->length){
 
 
 
72
  pmxe_render_xml_element($elements->item( 0 ), true);
73
- }
74
 
75
  break;
76
 
77
  case 'csv':
78
  ?>
79
  <small>
80
- <?php
81
- $csv = pmxe_export_csv($exportQuery, $exportOptions, true);
 
 
82
  if (!empty($csv)){
83
  $csv_rows = array_filter(explode("\n", $csv));
84
  if ($csv_rows){
@@ -111,7 +155,7 @@ function pmxe_wp_ajax_export_preview(){
111
  }
112
  }
113
  else{
114
- _e('Data not found.', 'pmxe_plugin');
115
  }
116
  ?>
117
  </small>
@@ -120,7 +164,7 @@ function pmxe_wp_ajax_export_preview(){
120
 
121
  default:
122
 
123
- _e('This format is not supported.', 'pmxe_plugin');
124
 
125
  break;
126
  }
8
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
9
  }
10
 
11
+ if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
12
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
13
  }
14
 
18
 
19
  parse_str($_POST['data'], $values);
20
 
21
+ $export_id = (isset($_GET['id'])) ? stripcslashes($_GET['id']) : 0;
22
+
23
  $exportOptions = $values + (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + PMXE_Plugin::get_default_import_options();
24
 
25
+ $errors = new WP_Error();
26
+
27
+ $engine = new XmlExportEngine($exportOptions, $errors);
28
+
29
+ XmlExportEngine::$exportOptions = $exportOptions;
30
+ XmlExportEngine::$is_user_export = $exportOptions['is_user_export'];
31
+ XmlExportEngine::$is_comment_export = $exportOptions['is_comment_export'];
32
+ XmlExportEngine::$exportID = $export_id;
33
 
34
  if ( 'advanced' == $exportOptions['export_type'] )
35
  {
36
  if ( XmlExportEngine::$is_user_export )
37
  {
38
+ $exportQuery = eval('return new WP_User_Query(array(' . $exportOptions['wp_query'] . ', \'offset\' => 0, \'number\' => 10));');
39
+ }
40
+ elseif ( XmlExportEngine::$is_comment_export )
41
+ {
42
+ $exportQuery = eval('return new WP_Comment_Query(array(' . $exportOptions['wp_query'] . ', \'offset\' => 0, \'number\' => 10));');
43
  }
44
  else
45
  {
50
  {
51
  XmlExportEngine::$post_types = $exportOptions['cpt'];
52
 
53
+ if ( in_array('users', $exportOptions['cpt']) or in_array('shop_customer', $exportOptions['cpt']))
54
+ {
55
+ $exportQuery = new WP_User_Query( array( 'orderby' => 'ID', 'order' => 'ASC', 'number' => 10 ));
56
+ }
57
+ elseif( in_array('comments', $exportOptions['cpt']))
58
+ {
59
+ global $wp_version;
60
+
61
+ if ( version_compare($wp_version, '4.2.0', '>=') )
62
+ {
63
+ $exportQuery = new WP_Comment_Query( array( 'orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10 ));
64
+ }
65
+ else
66
+ {
67
+ $exportQuery = get_comments( array( 'orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10 ));
68
+ }
69
  }
70
  else
71
+ {
72
+ remove_all_actions('parse_query');
73
+ remove_all_actions('pre_get_posts');
74
+
75
+ add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
76
+ add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
77
+ $exportQuery = new WP_Query( array( 'post_type' => $exportOptions['cpt'], 'post_status' => 'any', 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => 10 ));
78
+ remove_filter('posts_where', 'wp_all_export_posts_where');
79
+ remove_filter('posts_join', 'wp_all_export_posts_join');
80
  }
81
  }
82
 
89
  <div class="wpallexport-preview-content">
90
 
91
  <?php
92
+ $wp_uploads = wp_upload_dir();
93
+
94
+ $functions = $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
95
+ if ( @file_exists($functions) )
96
+ require_once $functions;
97
 
98
  switch ($exportOptions['export_to']) {
99
 
100
  case 'xml':
101
 
102
  $dom = new DOMDocument('1.0', $exportOptions['encoding']);
103
+ $old = libxml_use_internal_errors(true);
104
+
105
+ $xml = XmlCsvExport::export_xml( true );
106
+
107
  $dom->loadXML($xml);
108
  libxml_use_internal_errors($old);
109
  $xpath = new DOMXPath($dom);
110
+
111
+ $main_xml_tag = apply_filters('wp_all_export_main_xml_tag', $exportOptions['main_xml_tag'], XmlExportEngine::$exportID);
112
+
113
+ if (($elements = @$xpath->query('/' . $main_xml_tag)) and $elements->length){
114
  pmxe_render_xml_element($elements->item( 0 ), true);
115
+ }
116
 
117
  break;
118
 
119
  case 'csv':
120
  ?>
121
  <small>
122
+ <?php
123
+
124
+ $csv = XmlCsvExport::export_csv( true );
125
+
126
  if (!empty($csv)){
127
  $csv_rows = array_filter(explode("\n", $csv));
128
  if ($csv_rows){
155
  }
156
  }
157
  else{
158
+ _e('Data not found.', 'wp_all_export_plugin');
159
  }
160
  ?>
161
  </small>
164
 
165
  default:
166
 
167
+ _e('This format is not supported.', 'wp_all_export_plugin');
168
 
169
  break;
170
  }
actions/wp_ajax_generate_zapier_api_key.php CHANGED
@@ -6,7 +6,7 @@ function pmxe_wp_ajax_generate_zapier_api_key(){
6
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
  }
8
 
9
- if ( ! current_user_can('manage_options') ){
10
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
  }
12
 
6
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
  }
8
 
9
+ if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
10
  exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
  }
12
 
actions/wp_ajax_wpallexport.php CHANGED
@@ -8,7 +8,7 @@ function pmxe_wp_ajax_wpallexport(){
8
  exit( __('Security check', 'wp_all_export_plugin') );
9
  }
10
 
11
- if ( ! current_user_can('manage_options') ){
12
  exit( __('Security check', 'wp_all_export_plugin') );
13
  }
14
 
@@ -28,47 +28,84 @@ function pmxe_wp_ajax_wpallexport(){
28
  if ( $export->isEmpty() ){
29
  exit( __('Export is not defined.', 'wp_all_export_plugin') );
30
  }
31
-
32
  $exportOptions = $export->options + PMXE_Plugin::get_default_import_options();
33
 
34
  wp_reset_postdata();
35
 
36
- XmlExportEngine::$exportOptions = $exportOptions;
37
- XmlExportEngine::$is_user_export = $exportOptions['is_user_export'];
38
- XmlExportEngine::$exportID = $export_id;
 
 
 
 
 
39
 
40
- $posts_per_page = $exportOptions['records_per_iteration'];
41
 
42
  if ('advanced' == $exportOptions['export_type'])
43
- {
44
  if (XmlExportEngine::$is_user_export)
45
  {
46
  exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export users.', 'wp_all_export_plugin'))) );
47
  }
 
 
 
 
48
  else
49
- {
50
- $exportQuery = eval('return new WP_Query(array(' . $exportOptions['wp_query'] . ', \'offset\' => ' . $export->exported . ', \'posts_per_page\' => ' . $posts_per_page . ' ));');
 
 
 
 
 
 
 
51
  }
52
  }
53
  else
54
  {
55
  XmlExportEngine::$post_types = $exportOptions['cpt'];
56
 
57
- if ( ! in_array('users', $exportOptions['cpt']))
58
- {
59
- $exportQuery = new WP_Query( array( 'post_type' => $exportOptions['cpt'], 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'offset' => $export->exported, 'posts_per_page' => $posts_per_page ));
 
 
 
 
 
 
60
  }
61
  else
62
  {
63
- exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export users.', 'wp_all_export_plugin'))) );
 
 
 
 
 
 
 
64
  }
65
- }
66
 
67
  XmlExportEngine::$exportQuery = $exportQuery;
68
 
69
- $foundPosts = ( ! XmlExportEngine::$is_user_export ) ? $exportQuery->found_posts : $exportQuery->get_total();
70
-
71
- $postCount = ( ! XmlExportEngine::$is_user_export ) ? $exportQuery->post_count : count($exportQuery->get_results());
 
 
 
 
 
 
 
 
72
 
73
  if ( ! $export->exported )
74
  {
@@ -89,12 +126,7 @@ function pmxe_wp_ajax_wpallexport(){
89
 
90
  $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
91
 
92
- if ( $is_secure_import and ! empty($exportOptions['filepath'])){
93
-
94
- // if 'Create a new file each time export is run' disabled remove all previously generated source files
95
- // if ( ! $exportOptions['creata_a_new_export_file'] or ! $export->iteration ){
96
- // wp_all_export_remove_source(wp_all_export_get_absolute_path($exportOptions['filepath']));
97
- // }
98
 
99
  $exportOptions['filepath'] = '';
100
 
@@ -102,60 +134,47 @@ function pmxe_wp_ajax_wpallexport(){
102
 
103
  PMXE_Plugin::$session->set('count', $foundPosts);
104
  PMXE_Plugin::$session->save_data();
105
- }
106
 
107
  // if posts still exists then export them
108
  if ( $postCount )
109
- {
110
- switch ( $exportOptions['export_to'] ) {
111
-
112
- case 'xml':
113
-
114
- pmxe_export_xml($exportQuery, $exportOptions);
115
-
116
- break;
117
-
118
- case 'csv':
119
-
120
- pmxe_export_csv($exportQuery, $exportOptions);
121
-
122
- break;
123
-
124
- default:
125
- # code...
126
- break;
127
- }
128
-
129
- wp_reset_postdata();
130
-
131
- }
132
-
133
- if ($postCount){
134
 
135
  $export->set(array(
136
- 'exported' => $export->exported + $postCount
 
137
  ))->save();
138
-
139
- }
140
 
141
- if ($posts_per_page != -1 and $postCount){
142
 
 
 
143
  wp_send_json(array(
144
- 'exported' => $export->exported,
145
- 'percentage' => ceil(($export->exported/$foundPosts) * 100),
146
- 'done' => false,
 
 
147
  'records_per_request' => $exportOptions['records_per_iteration']
148
- ));
149
-
150
  }
151
  else
152
- {
153
-
154
- wp_reset_postdata();
155
 
156
  if ( file_exists(PMXE_Plugin::$session->file)){
157
 
158
- if ($exportOptions['export_to'] == 'xml') file_put_contents(PMXE_Plugin::$session->file, '</'.$exportOptions['main_xml_tag'].'>', FILE_APPEND);
 
 
 
 
 
 
 
 
 
 
159
 
160
  $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
161
 
@@ -176,7 +195,7 @@ function pmxe_wp_ajax_wpallexport(){
176
  {
177
  $attach_id = wp_insert_attachment( $attachment_data, PMXE_Plugin::$session->file );
178
  }
179
- elseif($export->options['creata_a_new_export_file'])
180
  {
181
  $attach_id = wp_insert_attachment( $attachment_data, PMXE_Plugin::$session->file );
182
  }
@@ -204,8 +223,8 @@ function pmxe_wp_ajax_wpallexport(){
204
  }
205
 
206
  }
207
- else{
208
-
209
  $exportOptions['filepath'] = wp_all_export_get_relative_path(PMXE_Plugin::$session->file);
210
 
211
  if ( ! $export->isEmpty() ){
@@ -214,239 +233,44 @@ function pmxe_wp_ajax_wpallexport(){
214
  ))->save();
215
  }
216
 
217
- }
218
-
219
- // Generate templa for WP All Import
220
- if ($exportOptions['is_generate_templates']){
221
-
222
- $custom_type = (empty($exportOptions['cpt'])) ? 'post' : $exportOptions['cpt'][0];
223
-
224
- $templateOptions = array(
225
- 'type' => ( ! empty($exportOptions['cpt']) and $exportOptions['cpt'][0] == 'page') ? 'page' : 'post',
226
- 'wizard_type' => 'new',
227
- 'deligate' => 'wpallexport',
228
- 'custom_type' => (XmlExportEngine::$is_user_export) ? 'import_users' : $custom_type,
229
- 'status' => 'xpath',
230
- 'is_multiple_page_parent' => 'no',
231
- 'unique_key' => '',
232
- 'acf' => array(),
233
- 'fields' => array(),
234
- 'is_multiple_field_value' => array(),
235
- 'multiple_value' => array(),
236
- 'fields_delimiter' => array(),
237
-
238
- 'update_all_data' => 'no',
239
- 'is_update_status' => 0,
240
- 'is_update_title' => 0,
241
- 'is_update_author' => 0,
242
- 'is_update_slug' => 0,
243
- 'is_update_content' => 0,
244
- 'is_update_excerpt' => 0,
245
- 'is_update_dates' => 0,
246
- 'is_update_menu_order' => 0,
247
- 'is_update_parent' => 0,
248
- 'is_update_attachments' => 0,
249
- 'is_update_acf' => 0,
250
- 'update_acf_logic' => 'only',
251
- 'acf_list' => '',
252
- 'is_update_product_type' => 1,
253
- 'is_update_attributes' => 0,
254
- 'update_attributes_logic' => 'only',
255
- 'attributes_list' => '',
256
- 'is_update_images' => 0,
257
- 'is_update_custom_fields' => 0,
258
- 'update_custom_fields_logic' => 'only',
259
- 'custom_fields_list' => '',
260
- 'is_update_categories' => 0,
261
- 'update_categories_logic' => 'only',
262
- 'taxonomies_list' => '',
263
- 'export_id' => $export->id
264
- );
265
-
266
- if ( in_array('product', $exportOptions['cpt']) )
267
- {
268
- $templateOptions['_virtual'] = 1;
269
- $templateOptions['_downloadable'] = 1;
270
- $templateOptions['put_variation_image_to_gallery'] = 1;
271
- $templateOptions['disable_auto_sku_generation'] = 1;
272
- }
273
-
274
- if ( XmlExportEngine::$is_user_export )
275
- {
276
- $templateOptions['is_update_first_name'] = 0;
277
- $templateOptions['is_update_last_name'] = 0;
278
- $templateOptions['is_update_role'] = 0;
279
- $templateOptions['is_update_nickname'] = 0;
280
- $templateOptions['is_update_description'] = 0;
281
- $templateOptions['is_update_login'] = 0;
282
- $templateOptions['is_update_password'] = 0;
283
- $templateOptions['is_update_nicename'] = 0;
284
- $templateOptions['is_update_email'] = 0;
285
- $templateOptions['is_update_registered'] = 0;
286
- $templateOptions['is_update_display_name'] = 0;
287
- $templateOptions['is_update_url'] = 0;
288
- }
289
-
290
- if ( 'xml' == $exportOptions['export_to'] )
291
- {
292
- wp_all_export_prepare_template_xml($exportOptions, $templateOptions);
293
- }
294
- else
295
- {
296
- wp_all_export_prepare_template_csv($exportOptions, $templateOptions);
297
- }
298
-
299
- //$template = new PMXI_Template_Record();
300
-
301
- $tpl_options = $templateOptions;
302
-
303
- if ( 'csv' == $exportOptions['export_to'] )
304
- {
305
- $tpl_options['delimiter'] = $exportOptions['delimiter'];
306
- }
307
-
308
- $tpl_options['update_all_data'] = 'yes';
309
- $tpl_options['is_update_status'] = 1;
310
- $tpl_options['is_update_title'] = 1;
311
- $tpl_options['is_update_author'] = 1;
312
- $tpl_options['is_update_slug'] = 1;
313
- $tpl_options['is_update_content'] = 1;
314
- $tpl_options['is_update_excerpt'] = 1;
315
- $tpl_options['is_update_dates'] = 1;
316
- $tpl_options['is_update_menu_order'] = 1;
317
- $tpl_options['is_update_parent'] = 1;
318
- $tpl_options['is_update_attachments'] = 1;
319
- $tpl_options['is_update_acf'] = 1;
320
- $tpl_options['update_acf_logic'] = 'full_update';
321
- $tpl_options['acf_list'] = '';
322
- $tpl_options['is_update_product_type'] = 1;
323
- $tpl_options['is_update_attributes'] = 1;
324
- $tpl_options['update_attributes_logic'] = 'full_update';
325
- $tpl_options['attributes_list'] = '';
326
- $tpl_options['is_update_images'] = 1;
327
- $tpl_options['is_update_custom_fields'] = 1;
328
- $tpl_options['update_custom_fields_logic'] = 'full_update';
329
- $tpl_options['custom_fields_list'] = '';
330
- $tpl_options['is_update_categories'] = 1;
331
- $tpl_options['update_categories_logic'] = 'full_update';
332
- $tpl_options['taxonomies_list'] = '';
333
-
334
- $tpl_data = array(
335
- 'name' => $exportOptions['template_name'],
336
- 'is_keep_linebreaks' => 0,
337
- 'is_leave_html' => 0,
338
- 'fix_characters' => 0,
339
- 'options' => $tpl_options,
340
- );
341
-
342
- $exportOptions['tpl_data'] = $tpl_data;
343
-
344
- $export->set(array(
345
- 'options' => $exportOptions
346
- ))->save();
347
-
348
- // if ( ! empty($exportOptions['template_name'])) { // save template in database
349
- // $template->getByName($exportOptions['template_name'])->set($tpl_data)->save();
350
- // }
351
-
352
- }
353
-
354
- // associate exported posts with new import
355
- if ( wp_all_export_is_compatible() and $exportOptions['is_generate_import']){
356
-
357
- $options = $templateOptions + PMXI_Plugin::get_default_import_options();
358
-
359
- $import = new PMXI_Import_Record();
360
 
361
- $import->getById($exportOptions['import_id']);
362
-
363
- if ( ! $import->isEmpty() and $import->parent_import_id == 99999 ){
364
-
365
- $xmlPath = PMXE_Plugin::$session->file;
366
-
367
- $root_element = '';
368
-
369
- $historyPath = PMXE_Plugin::$session->file;
370
-
371
- if ( 'csv' == $exportOptions['export_to'] )
372
- {
373
- $options['delimiter'] = $exportOptions['delimiter'];
374
-
375
- include_once( PMXI_Plugin::ROOT_DIR . '/libraries/XmlImportCsvParse.php' );
376
-
377
- $path_info = pathinfo($xmlPath);
378
-
379
- $path_parts = explode(DIRECTORY_SEPARATOR, $path_info['dirname']);
380
-
381
- $security_folder = array_pop($path_parts);
382
-
383
- $target = $is_secure_import ? $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::UPLOADS_DIRECTORY . DIRECTORY_SEPARATOR . $security_folder : $wp_uploads['path'];
384
 
385
- $csv = new PMXI_CsvParser( array( 'filename' => $xmlPath, 'targetDir' => $target ) );
386
-
387
- if ( ! in_array($xmlPath, $exportOptions['attachment_list']) )
388
- {
389
- $exportOptions['attachment_list'][] = $csv->xml_path;
390
- }
391
-
392
- $historyPath = $csv->xml_path;
393
 
394
- $root_element = 'node';
395
 
396
- }
397
- else
398
- {
399
- $root_element = 'post';
400
- }
401
 
402
- $import->set(array(
403
- 'xpath' => '/' . $root_element,
404
- 'type' => 'upload',
405
- 'options' => $options,
406
- 'root_element' => $root_element,
407
- 'path' => $xmlPath,
408
- 'name' => basename($xmlPath),
409
- 'imported' => 0,
410
- 'created' => 0,
411
- 'updated' => 0,
412
- 'skipped' => 0,
413
- 'deleted' => 0,
414
- 'iteration' => 1,
415
- 'count' => PMXE_Plugin::$session->count
416
- ))->save();
417
-
418
- $history_file = new PMXI_File_Record();
419
- $history_file->set(array(
420
- 'name' => $import->name,
421
- 'import_id' => $import->id,
422
- 'path' => $historyPath,
423
- 'registered_on' => date('Y-m-d H:i:s')
424
- ))->save();
425
-
426
- $exportOptions['import_id'] = $import->id;
427
-
428
- $export->set(array(
429
- 'options' => $exportOptions
430
- ))->save();
431
- }
432
- }
433
  }
434
 
435
- $export->set(array(
436
- 'executing' => 0,
437
- 'canceled' => 0
438
- ))->save();
439
-
440
- do_action('pmxe_after_export', $export->id);
 
 
441
 
442
  wp_send_json(array(
443
- 'exported' => $export->exported,
444
- 'percentage' => 100,
445
- 'done' => true,
446
- 'records_per_request' => $exportOptions['records_per_iteration'],
447
- 'file' => PMXE_Plugin::$session->file
 
448
  ));
449
-
450
  }
 
451
 
452
- }
8
  exit( __('Security check', 'wp_all_export_plugin') );
9
  }
10
 
11
+ if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
12
  exit( __('Security check', 'wp_all_export_plugin') );
13
  }
14
 
28
  if ( $export->isEmpty() ){
29
  exit( __('Export is not defined.', 'wp_all_export_plugin') );
30
  }
31
+
32
  $exportOptions = $export->options + PMXE_Plugin::get_default_import_options();
33
 
34
  wp_reset_postdata();
35
 
36
+ XmlExportEngine::$exportOptions = $exportOptions;
37
+ XmlExportEngine::$is_user_export = $exportOptions['is_user_export'];
38
+ XmlExportEngine::$is_comment_export = $exportOptions['is_comment_export'];
39
+ XmlExportEngine::$exportID = $export_id;
40
+ XmlExportEngine::$exportRecord = $export;
41
+
42
+ $errors = new WP_Error();
43
+ $engine = new XmlExportEngine($exportOptions, $errors);
44
 
45
+ $posts_per_page = $exportOptions['records_per_iteration'];
46
 
47
  if ('advanced' == $exportOptions['export_type'])
48
+ {
49
  if (XmlExportEngine::$is_user_export)
50
  {
51
  exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export users.', 'wp_all_export_plugin'))) );
52
  }
53
+ elseif(XmlExportEngine::$is_comment_export)
54
+ {
55
+ exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export comments.', 'wp_all_export_plugin'))) );
56
+ }
57
  else
58
+ {
59
+ remove_all_actions('parse_query');
60
+ remove_all_actions('pre_get_posts');
61
+
62
+ add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
63
+ add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
64
+ $exportQuery = eval('return new WP_Query(array(' . $exportOptions['wp_query'] . ', \'offset\' => ' . $export->exported . ', \'posts_per_page\' => ' . $posts_per_page . ' ));');
65
+ remove_filter('posts_where', 'wp_all_export_posts_where');
66
+ remove_filter('posts_join', 'wp_all_export_posts_join');
67
  }
68
  }
69
  else
70
  {
71
  XmlExportEngine::$post_types = $exportOptions['cpt'];
72
 
73
+ // $is_products_export = ($exportOptions['cpt'] == 'product' and class_exists('WooCommerce'));
74
+
75
+ if (in_array('users', $exportOptions['cpt']) or in_array('shop_customer', $exportOptions['cpt']))
76
+ {
77
+ exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export users.', 'wp_all_export_plugin'))) );
78
+ }
79
+ elseif(in_array('comments', $exportOptions['cpt']))
80
+ {
81
+ exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export comments.', 'wp_all_export_plugin'))) );
82
  }
83
  else
84
  {
85
+ remove_all_actions('parse_query');
86
+ remove_all_actions('pre_get_posts');
87
+
88
+ add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
89
+ add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
90
+ $exportQuery = new WP_Query( array( 'post_type' => $exportOptions['cpt'], 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'offset' => $export->exported, 'posts_per_page' => $posts_per_page ));
91
+ remove_filter('posts_where', 'wp_all_export_posts_where');
92
+ remove_filter('posts_join', 'wp_all_export_posts_join');
93
  }
94
+ }
95
 
96
  XmlExportEngine::$exportQuery = $exportQuery;
97
 
98
+ // get total founded records
99
+ if (XmlExportEngine::$is_comment_export)
100
+ {
101
+
102
+ }
103
+ else
104
+ {
105
+ $foundPosts = ( ! XmlExportEngine::$is_user_export ) ? $exportQuery->found_posts : $exportQuery->get_total();
106
+ $postCount = ( ! XmlExportEngine::$is_user_export ) ? $exportQuery->post_count : count($exportQuery->get_results());
107
+ }
108
+ // [ \get total founded records ]
109
 
110
  if ( ! $export->exported )
111
  {
126
 
127
  $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
128
 
129
+ if ( $is_secure_import and ! empty($exportOptions['filepath'])){
 
 
 
 
 
130
 
131
  $exportOptions['filepath'] = '';
132
 
134
 
135
  PMXE_Plugin::$session->set('count', $foundPosts);
136
  PMXE_Plugin::$session->save_data();
137
+ }
138
 
139
  // if posts still exists then export them
140
  if ( $postCount )
141
+ {
142
+ XmlCsvExport::export();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
 
144
  $export->set(array(
145
+ 'exported' => $export->exported + $postCount,
146
+ 'last_activity' => date('Y-m-d H:i:s')
147
  ))->save();
 
 
148
 
149
+ }
150
 
151
+ if ($posts_per_page != -1 and $postCount)
152
+ {
153
  wp_send_json(array(
154
+ 'export_id' => $export->id,
155
+ 'queue_export' => false,
156
+ 'exported' => $export->exported,
157
+ 'percentage' => ceil(($export->exported/$foundPosts) * 100),
158
+ 'done' => false,
159
  'records_per_request' => $exportOptions['records_per_iteration']
160
+ ));
 
161
  }
162
  else
163
+ {
 
 
164
 
165
  if ( file_exists(PMXE_Plugin::$session->file)){
166
 
167
+ if ($exportOptions['export_to'] == 'xml')
168
+ {
169
+
170
+ $main_xml_tag = apply_filters('wp_all_export_main_xml_tag', $exportOptions['main_xml_tag'], $export->id);
171
+
172
+ file_put_contents(PMXE_Plugin::$session->file, '</'.$main_xml_tag.'>', FILE_APPEND);
173
+
174
+ $xml_footer = apply_filters('wp_all_export_xml_footer', '', $export->id);
175
+
176
+ if ( ! empty($xml_footer) ) file_put_contents(PMXE_Plugin::$session->file, $xml_footer, FILE_APPEND);
177
+ }
178
 
179
  $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
180
 
195
  {
196
  $attach_id = wp_insert_attachment( $attachment_data, PMXE_Plugin::$session->file );
197
  }
198
+ elseif($export->options['creata_a_new_export_file'] and ( ! XmlExportWooCommerceOrder::$is_active || $export->options['export_type'] != 'specific') )
199
  {
200
  $attach_id = wp_insert_attachment( $attachment_data, PMXE_Plugin::$session->file );
201
  }
223
  }
224
 
225
  }
226
+ else
227
+ {
228
  $exportOptions['filepath'] = wp_all_export_get_relative_path(PMXE_Plugin::$session->file);
229
 
230
  if ( ! $export->isEmpty() ){
233
  ))->save();
234
  }
235
 
236
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
 
238
+ PMXE_Wpallimport::generateImportTemplate( $export, PMXE_Plugin::$session->file, PMXE_Plugin::$session->count );
239
+
240
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
 
242
+ $export->set(array(
243
+ 'executing' => 0,
244
+ 'canceled' => 0,
245
+ 'iteration' => ++$export->iteration
246
+ ))->save();
 
 
 
247
 
248
+ do_action('pmxe_after_export', $export->id, $export);
249
 
250
+ $queue_exports = empty($export->parent_id) ? array() : get_option( 'wp_all_export_queue_' . $export->parent_id );
 
 
 
 
251
 
252
+ if ( ! empty($queue_exports) and ! empty($export->parent_id))
253
+ {
254
+ array_shift($queue_exports);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  }
256
 
257
+ if ( empty($queue_exports) )
258
+ {
259
+ delete_option( 'wp_all_export_queue_' . ( empty($export->parent_id) ? $export->id : $export->parent_id ) );
260
+ }
261
+ else
262
+ {
263
+ update_option( 'wp_all_export_queue_' . ( empty($export->parent_id) ? $export->id : $export->parent_id ), $queue_exports );
264
+ }
265
 
266
  wp_send_json(array(
267
+ 'export_id' => $export->id,
268
+ 'queue_export' => empty($queue_exports) ? false : $queue_exports[0],
269
+ 'exported' => $export->exported,
270
+ 'percentage' => 100,
271
+ 'done' => true,
272
+ 'records_per_request' => $exportOptions['records_per_iteration']
273
  ));
 
274
  }
275
+ }
276
 
 
classes/handler.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
- class PMXE_Handler extends PMXE_Session {
4
-
5
  /** cookie name */
6
  private $_cookie;
7
 
@@ -20,7 +20,8 @@ class PMXE_Handler extends PMXE_Session {
20
  * @access public
21
  * @return void
22
  */
23
- public function __construct() {
 
24
 
25
  $this->set_session_expiration();
26
 
@@ -34,7 +35,8 @@ class PMXE_Handler extends PMXE_Session {
34
  * Return true if the current user has an active session, i.e. a cookie to retrieve values
35
  * @return boolean
36
  */
37
- public function has_session() {
 
38
  return isset( $_COOKIE[ $this->_cookie ] ) || $this->_has_cookie || is_user_logged_in();
39
  }
40
 
@@ -44,18 +46,18 @@ class PMXE_Handler extends PMXE_Session {
44
  * @access public
45
  * @return void
46
  */
47
- public function set_session_expiration() {
 
48
  $this->_session_expiring = time() + intval( apply_filters( 'wpallexport_session_expiring', 60 * 60 * 47 ) ); // 47 Hours
49
  $this->_session_expiration = time() + intval( apply_filters( 'wpallexport_session_expiration', 60 * 60 * 48 ) ); // 48 Hours
50
  }
51
 
52
- public function generate_import_id() {
53
-
54
  $input = new PMXE_Input();
55
  $import_id = $input->get('id', 'new');
56
 
57
  return $import_id;
58
-
59
  }
60
 
61
  /**
@@ -64,8 +66,13 @@ class PMXE_Handler extends PMXE_Session {
64
  * @access public
65
  * @return array
66
  */
67
- public function get_session_data() {
68
- return (array) get_option( '_wpallexport_session_' . $this->_import_id . '_', array() );
 
 
 
 
 
69
  }
70
 
71
  /**
@@ -74,7 +81,8 @@ class PMXE_Handler extends PMXE_Session {
74
  * @access public
75
  * @return array
76
  */
77
- public function get_clear_session_data() {
 
78
  $this->_data = $this->get_session_data();
79
  $clear_data = array();
80
  foreach ($this->_data as $key => $value) {
@@ -91,75 +99,36 @@ class PMXE_Handler extends PMXE_Session {
91
  * @access public
92
  * @return void
93
  */
94
- public function save_data() {
 
95
  // Dirty if something changed - prevents saving nothing new
96
- if ( $this->_dirty && $this->has_session() ) {
97
-
98
  $session_option = '_wpallexport_session_' . $this->_import_id . '_';
99
- $session_expiry_option = '_wpallexport_session_expires_' . $this->_import_id . '_';
100
-
101
- wp_cache_delete( 'notoptions', 'options' );
102
- wp_cache_delete( $session_option, 'options' );
103
- wp_cache_delete( $session_expiry_option, 'options' );
104
-
105
- if ( false === get_option( $session_option ) ) {
106
- add_option( $session_option, $this->_data, '', 'no' );
107
- add_option( $session_expiry_option, $this->_session_expiration, '', 'no' );
108
- } else {
109
- update_option( $session_option, $this->_data );
110
- }
111
- }
112
- }
113
-
114
- public function convertData( $import_id ){
115
 
116
- $this->_import_id = 'new';
117
 
118
- $this->_data = $this->get_session_data();
119
-
120
- $this->set_session_expiration();
121
-
122
- $this->_import_id = $import_id;
123
-
124
- $this->clean_session();
125
-
126
- $this->_dirty = true;
127
-
128
- $this->save_data();
129
- }
130
-
131
- public function clean_session( $import_id = 'new' ){
132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  global $wpdb;
134
-
135
- $now = time();
136
- $expired_sessions = array();
137
- $wpallimport_session_expires = $wpdb->get_results( $wpdb->prepare("SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE %s", "_wpallexport_session_expires_" . $import_id . "_%") );
138
-
139
- $expired_sessions[] = "_wpallexport_session_{$import_id}_"; // Session key
140
-
141
- foreach ( $wpallimport_session_expires as $wpallimport_session_expire ) {
142
- //if ( $now > intval( $wpallimport_session_expire->option_value ) ) {
143
- //$session_id = substr( $wpallimport_session_expire->option_name, 29 );
144
- $expired_sessions[] = $wpallimport_session_expire->option_name; // Expires key
145
- //$expired_sessions[] = "_wpallimport_session_$session_id"; // Session key
146
- //}
147
- }
148
-
149
- if ( ! empty( $expired_sessions ) ) {
150
- wp_cache_delete( 'notoptions', 'options' );
151
- foreach ($expired_sessions as $expired) {
152
- wp_cache_delete( $expired, 'options' );
153
- delete_option($expired);
154
- }
155
- $expired_sessions_chunked = array_chunk( $expired_sessions, 100 );
156
-
157
- foreach ( $expired_sessions_chunked as $chunk ) {
158
- $option_names = implode( "','", $chunk );
159
- $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name IN ('$option_names')" );
160
- }
161
- }
162
 
 
 
163
  }
164
-
165
  }
1
  <?php
2
 
3
+ class PMXE_Handler extends PMXE_Session
4
+ {
5
  /** cookie name */
6
  private $_cookie;
7
 
20
  * @access public
21
  * @return void
22
  */
23
+ public function __construct()
24
+ {
25
 
26
  $this->set_session_expiration();
27
 
35
  * Return true if the current user has an active session, i.e. a cookie to retrieve values
36
  * @return boolean
37
  */
38
+ public function has_session()
39
+ {
40
  return isset( $_COOKIE[ $this->_cookie ] ) || $this->_has_cookie || is_user_logged_in();
41
  }
42
 
46
  * @access public
47
  * @return void
48
  */
49
+ public function set_session_expiration()
50
+ {
51
  $this->_session_expiring = time() + intval( apply_filters( 'wpallexport_session_expiring', 60 * 60 * 47 ) ); // 47 Hours
52
  $this->_session_expiration = time() + intval( apply_filters( 'wpallexport_session_expiration', 60 * 60 * 48 ) ); // 48 Hours
53
  }
54
 
55
+ public function generate_import_id()
56
+ {
57
  $input = new PMXE_Input();
58
  $import_id = $input->get('id', 'new');
59
 
60
  return $import_id;
 
61
  }
62
 
63
  /**
66
  * @access public
67
  * @return array
68
  */
69
+ public function get_session_data()
70
+ {
71
+ global $wpdb;
72
+
73
+ $session = $wpdb->get_row( $wpdb->prepare("SELECT option_name, option_value FROM $wpdb->options WHERE option_name = %s", '_wpallexport_session_' . $this->_import_id . '_'), ARRAY_A );
74
+
75
+ return empty($session) ? array() : maybe_unserialize($session['option_value']);
76
  }
77
 
78
  /**
81
  * @access public
82
  * @return array
83
  */
84
+ public function get_clear_session_data()
85
+ {
86
  $this->_data = $this->get_session_data();
87
  $clear_data = array();
88
  foreach ($this->_data as $key => $value) {
99
  * @access public
100
  * @return void
101
  */
102
+ public function save_data()
103
+ {
104
  // Dirty if something changed - prevents saving nothing new
105
+ if ( $this->_dirty && $this->has_session() )
106
+ {
107
  $session_option = '_wpallexport_session_' . $this->_import_id . '_';
108
+ $session_expiry_option = '_wpallexport_session_expires_' . $this->_import_id . '_';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
+ global $wpdb;
111
 
112
+ $session = $wpdb->get_row( $wpdb->prepare("SELECT option_name, option_value FROM $wpdb->options WHERE option_name = %s", $session_option), ARRAY_A );
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
+ if ( empty($session) )
115
+ {
116
+ $wpdb->query($wpdb->prepare("INSERT INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, 'no')", $session_option, serialize($this->_data)));
117
+ $wpdb->query($wpdb->prepare("INSERT INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, 'no')", $session_expiry_option, $this->_session_expiration));
118
+ // add_option( $session_option, $this->_data, '', 'no' );
119
+ // add_option( $session_expiry_option, $this->_session_expiration, '', 'no' );
120
+ } else {
121
+ // update_option( $session_option, $this->_data );
122
+ $wpdb->query($wpdb->prepare("UPDATE `$wpdb->options` SET `option_value` = %s WHERE `option_name` = %s", serialize($this->_data), $session_option));
123
+ }
124
+ }
125
+ }
126
+
127
+ public function clean_session( $import_id = 'new' )
128
+ {
129
  global $wpdb;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->options WHERE option_name = %s", '_wpallexport_session_' . $import_id . '_') );
132
+ $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->options WHERE option_name = %s", '_wpallexport_session_expires_' . $import_id . '_') );
133
  }
 
134
  }
classes/wpallimport.php ADDED
@@ -0,0 +1,476 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ final class PMXE_Wpallimport
4
+ {
5
+ /**
6
+ * Singletone instance
7
+ * @var PMXE_Wpallimport
8
+ */
9
+ protected static $instance;
10
+
11
+ /**
12
+ * Return singletone instance
13
+ * @return PMXE_Wpallimport
14
+ */
15
+ static public function getInstance() {
16
+ if (self::$instance == NULL) {
17
+ self::$instance = new self();
18
+ }
19
+ return self::$instance;
20
+ }
21
+
22
+ private function __construct(){}
23
+
24
+ public static function create_an_import( & $export )
25
+ {
26
+
27
+ $custom_type = (empty($export->options['cpt'])) ? 'post' : $export->options['cpt'][0];
28
+
29
+ // Do not create an import for WooCommerce Orders & Refunds
30
+ // if ( in_array($custom_type, array('shop_order'))) return false;
31
+
32
+ if ( $export->options['is_generate_import'] and wp_all_export_is_compatible() ){
33
+
34
+ $import = new PMXI_Import_Record();
35
+
36
+ if ( ! empty($export->options['import_id']) ) $import->getById($export->options['import_id']);
37
+
38
+ if ($import->isEmpty())
39
+ {
40
+ $import->set(array(
41
+ 'parent_import_id' => 99999,
42
+ 'xpath' => '/',
43
+ 'type' => 'upload',
44
+ 'options' => array('empty'),
45
+ 'root_element' => 'root',
46
+ 'path' => 'path',
47
+ 'imported' => 0,
48
+ 'created' => 0,
49
+ 'updated' => 0,
50
+ 'skipped' => 0,
51
+ 'deleted' => 0,
52
+ 'iteration' => 1
53
+ ))->save();
54
+
55
+ if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
56
+ {
57
+ PMXE_Plugin::$session->set('import_id', $import->id);
58
+ }
59
+ $options = $export->options;
60
+ $options['import_id'] = $import->id;
61
+
62
+ $export->set(array(
63
+ 'options' => $options
64
+ ))->save();
65
+ }
66
+ else
67
+ {
68
+ if ( $import->parent_import_id != 99999 )
69
+ {
70
+ $newImport = new PMXI_Import_Record();
71
+
72
+ $newImport->set(array(
73
+ 'parent_import_id' => 99999,
74
+ 'xpath' => '/',
75
+ 'type' => 'upload',
76
+ 'options' => array('empty'),
77
+ 'root_element' => 'root',
78
+ 'path' => 'path',
79
+ 'imported' => 0,
80
+ 'created' => 0,
81
+ 'updated' => 0,
82
+ 'skipped' => 0,
83
+ 'deleted' => 0,
84
+ 'iteration' => 1
85
+ ))->save();
86
+
87
+ if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
88
+ {
89
+ PMXE_Plugin::$session->set('import_id', $newImport->id);
90
+ }
91
+
92
+ $options = $export->options;
93
+ $options['import_id'] = $newImport->id;
94
+
95
+ $export->set(array(
96
+ 'options' => $options
97
+ ))->save();
98
+ }
99
+ else
100
+ {
101
+ global $wpdb;
102
+ $post = new PMXI_Post_List();
103
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $post->getTable() . ' WHERE import_id = %s', $import->id));
104
+ }
105
+ }
106
+ }
107
+ }
108
+
109
+ public static $templateOptions = array();
110
+ public static function generateImportTemplate( & $export, $file_path = '', $foundPosts = 0, $link_to_import = true )
111
+ {
112
+ $exportOptions = $export->options;
113
+
114
+ $custom_type = (empty($exportOptions['cpt'])) ? 'post' : $exportOptions['cpt'][0];
115
+
116
+ // Do not create an import template for WooCommerce Refunds
117
+ // if ( empty($export->parent_id) and in_array($custom_type, array('shop_order_refund'))) return false;
118
+
119
+ // Generate template for WP All Import
120
+ if ($exportOptions['is_generate_templates'])
121
+ {
122
+ self::$templateOptions = array(
123
+ 'type' => ( ! empty($exportOptions['cpt']) and $exportOptions['cpt'][0] == 'page') ? 'page' : 'post',
124
+ 'wizard_type' => 'new',
125
+ 'deligate' => 'wpallexport',
126
+ 'custom_type' => (XmlExportEngine::$is_user_export) ? 'import_users' : $custom_type,
127
+ 'status' => 'xpath',
128
+ 'is_multiple_page_parent' => 'no',
129
+ 'unique_key' => '',
130
+ 'acf' => array(),
131
+ 'fields' => array(),
132
+ 'is_multiple_field_value' => array(),
133
+ 'multiple_value' => array(),
134
+ 'fields_delimiter' => array(),
135
+ 'update_all_data' => 'no',
136
+ 'is_update_status' => 0,
137
+ 'is_update_title' => 0,
138
+ 'is_update_author' => 0,
139
+ 'is_update_slug' => 0,
140
+ 'is_update_content' => 0,
141
+ 'is_update_excerpt' => 0,
142
+ 'is_update_dates' => 0,
143
+ 'is_update_menu_order' => 0,
144
+ 'is_update_parent' => 0,
145
+ 'is_update_attachments' => 0,
146
+ 'is_update_acf' => 0,
147
+ 'update_acf_logic' => 'only',
148
+ 'acf_list' => '',
149
+ 'is_update_product_type' => 1,
150
+ 'is_update_attributes' => 0,
151
+ 'update_attributes_logic' => 'only',
152
+ 'attributes_list' => '',
153
+ 'is_update_images' => 0,
154
+ 'is_update_custom_fields' => 0,
155
+ 'update_custom_fields_logic' => 'only',
156
+ 'custom_fields_list' => '',
157
+ 'is_update_categories' => 0,
158
+ 'update_categories_logic' => 'only',
159
+ 'taxonomies_list' => '',
160
+ 'export_id' => $export->id
161
+ );
162
+
163
+ if ( in_array('product', $exportOptions['cpt']) and class_exists('PMWI_Plugin'))
164
+ {
165
+ $default = PMWI_Plugin::get_default_import_options();
166
+
167
+ self::$templateOptions = array_replace_recursive(self::$templateOptions, $default);
168
+
169
+ self::$templateOptions['_virtual'] = 1;
170
+ self::$templateOptions['_downloadable'] = 1;
171
+ self::$templateOptions['put_variation_image_to_gallery'] = 1;
172
+ self::$templateOptions['disable_auto_sku_generation'] = 1;
173
+ }
174
+
175
+ if ( in_array('shop_order', $exportOptions['cpt']) and class_exists('PMWI_Plugin'))
176
+ {
177
+ self::$templateOptions['update_all_data'] = 'no';
178
+ self::$templateOptions['is_update_status'] = 0;
179
+ self::$templateOptions['is_update_dates'] = 0;
180
+ self::$templateOptions['is_update_excerpt'] = 0;
181
+
182
+ $default = PMWI_Plugin::get_default_import_options();
183
+
184
+ self::$templateOptions['pmwi_order'] = $default['pmwi_order'];
185
+
186
+ self::$templateOptions['pmwi_order']['is_update_billing_details'] = 0;
187
+ self::$templateOptions['pmwi_order']['is_update_shipping_details'] = 0;
188
+ self::$templateOptions['pmwi_order']['is_update_payment'] = 0;
189
+ self::$templateOptions['pmwi_order']['is_update_notes'] = 0;
190
+ self::$templateOptions['pmwi_order']['is_update_products'] = 0;
191
+ self::$templateOptions['pmwi_order']['is_update_fees'] = 0;
192
+ self::$templateOptions['pmwi_order']['is_update_coupons'] = 0;
193
+ self::$templateOptions['pmwi_order']['is_update_shipping'] = 0;
194
+ self::$templateOptions['pmwi_order']['is_update_taxes'] = 0;
195
+ self::$templateOptions['pmwi_order']['is_update_refunds'] = 0;
196
+ self::$templateOptions['pmwi_order']['is_update_total'] = 0;
197
+ }
198
+
199
+ if ( XmlExportEngine::$is_user_export )
200
+ {
201
+ self::$templateOptions['is_update_first_name'] = 0;
202
+ self::$templateOptions['is_update_last_name'] = 0;
203
+ self::$templateOptions['is_update_role'] = 0;
204
+ self::$templateOptions['is_update_nickname'] = 0;
205
+ self::$templateOptions['is_update_description'] = 0;
206
+ self::$templateOptions['is_update_login'] = 0;
207
+ self::$templateOptions['is_update_password'] = 0;
208
+ self::$templateOptions['is_update_nicename'] = 0;
209
+ self::$templateOptions['is_update_email'] = 0;
210
+ self::$templateOptions['is_update_registered'] = 0;
211
+ self::$templateOptions['is_update_display_name'] = 0;
212
+ self::$templateOptions['is_update_url'] = 0;
213
+ }
214
+
215
+ self::prepare_import_template( $exportOptions );
216
+
217
+ $tpl_options = self::$templateOptions;
218
+
219
+ if ( 'csv' == $exportOptions['export_to'] )
220
+ {
221
+ $tpl_options['delimiter'] = $exportOptions['delimiter'];
222
+ $tpl_options['root_element'] = 'node';
223
+ }
224
+ else
225
+ {
226
+ $tpl_options['root_element'] = $exportOptions['record_xml_tag'];
227
+ }
228
+
229
+ $tpl_options['update_all_data'] = 'yes';
230
+ $tpl_options['is_update_status'] = 1;
231
+ $tpl_options['is_update_title'] = 1;
232
+ $tpl_options['is_update_author'] = 1;
233
+ $tpl_options['is_update_slug'] = 1;
234
+ $tpl_options['is_update_content'] = 1;
235
+ $tpl_options['is_update_excerpt'] = 1;
236
+ $tpl_options['is_update_dates'] = 1;
237
+ $tpl_options['is_update_menu_order'] = 1;
238
+ $tpl_options['is_update_parent'] = 1;
239
+ $tpl_options['is_update_attachments'] = 1;
240
+ $tpl_options['is_update_acf'] = 1;
241
+ $tpl_options['update_acf_logic'] = 'full_update';
242
+ $tpl_options['acf_list'] = '';
243
+ $tpl_options['is_update_product_type'] = 1;
244
+ $tpl_options['is_update_attributes'] = 1;
245
+ $tpl_options['update_attributes_logic'] = 'full_update';
246
+ $tpl_options['attributes_list'] = '';
247
+ $tpl_options['is_update_images'] = 1;
248
+ $tpl_options['is_update_custom_fields'] = 1;
249
+ $tpl_options['update_custom_fields_logic'] = 'full_update';
250
+ $tpl_options['custom_fields_list'] = '';
251
+ $tpl_options['is_update_categories'] = 1;
252
+ $tpl_options['update_categories_logic'] = 'full_update';
253
+ $tpl_options['taxonomies_list'] = '';
254
+
255
+ $tpl_data = array(
256
+ 'name' => $exportOptions['template_name'],
257
+ 'is_keep_linebreaks' => 0,
258
+ 'is_leave_html' => 0,
259
+ 'fix_characters' => 0,
260
+ 'options' => $tpl_options,
261
+ );
262
+
263
+ $exportOptions['tpl_data'] = $tpl_data;
264
+
265
+ $export->set(array(
266
+ 'options' => $exportOptions
267
+ ))->save();
268
+
269
+ }
270
+
271
+ $link_to_import and $export->options['is_generate_import'] and self::link_template_to_import( $export, $file_path, $foundPosts );
272
+ }
273
+
274
+ public static function link_template_to_import( & $export, $file_path, $foundPosts )
275
+ {
276
+
277
+ $exportOptions = $export->options;
278
+
279
+ // associate exported posts with new import
280
+ if ( wp_all_export_is_compatible() )
281
+ {
282
+ $options = self::$templateOptions + PMXI_Plugin::get_default_import_options();
283
+
284
+ $import = new PMXI_Import_Record();
285
+
286
+ $import->getById($exportOptions['import_id']);
287
+
288
+ if ( ! $import->isEmpty() and $import->parent_import_id == 99999 ){
289
+
290
+ $xmlPath = $file_path;
291
+
292
+ $root_element = '';
293
+
294
+ $historyPath = $file_path;
295
+
296
+ if ( 'csv' == $exportOptions['export_to'] )
297
+ {
298
+ $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
299
+
300
+ $options['delimiter'] = $exportOptions['delimiter'];
301
+
302
+ include_once( PMXI_Plugin::ROOT_DIR . '/libraries/XmlImportCsvParse.php' );
303
+
304
+ $path_info = pathinfo($xmlPath);
305
+
306
+ $path_parts = explode(DIRECTORY_SEPARATOR, $path_info['dirname']);
307
+
308
+ $security_folder = array_pop($path_parts);
309
+
310
+ $wp_uploads = wp_upload_dir();
311
+
312
+ $target = $is_secure_import ? $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::UPLOADS_DIRECTORY . DIRECTORY_SEPARATOR . $security_folder : $wp_uploads['path'];
313
+
314
+ $csv = new PMXI_CsvParser( array( 'filename' => $xmlPath, 'targetDir' => $target ) );
315
+
316
+ if ( ! in_array($xmlPath, $exportOptions['attachment_list']) )
317
+ {
318
+ $exportOptions['attachment_list'][] = $csv->xml_path;
319
+ }
320
+
321
+ $historyPath = $csv->xml_path;
322
+
323
+ $root_element = 'node';
324
+
325
+ }
326
+ else
327
+ {
328
+ $root_element = apply_filters('wp_all_export_record_xml_tag', $exportOptions['record_xml_tag'], $export->id);
329
+ }
330
+
331
+ $import->set(array(
332
+ 'xpath' => '/' . $root_element,
333
+ 'type' => 'upload',
334
+ 'options' => $options,
335
+ 'root_element' => $root_element,
336
+ 'path' => $xmlPath,
337
+ 'name' => basename($xmlPath),
338
+ 'imported' => 0,
339
+ 'created' => 0,
340
+ 'updated' => 0,
341
+ 'skipped' => 0,
342
+ 'deleted' => 0,
343
+ 'iteration' => 1,
344
+ 'count' => $foundPosts
345
+ ))->save();
346
+
347
+ $history_file = new PMXI_File_Record();
348
+ $history_file->set(array(
349
+ 'name' => $import->name,
350
+ 'import_id' => $import->id,
351
+ 'path' => $historyPath,
352
+ 'registered_on' => date('Y-m-d H:i:s')
353
+ ))->save();
354
+
355
+ $exportOptions['import_id'] = $import->id;
356
+
357
+ $export->set(array(
358
+ 'options' => $exportOptions
359
+ ))->save();
360
+ }
361
+ }
362
+ }
363
+
364
+ public static function prepare_import_template( $exportOptions )
365
+ {
366
+ $options = $exportOptions;
367
+
368
+ $is_xml_template = $options['export_to'] == 'xml';
369
+
370
+ $required_add_ons = array();
371
+
372
+ $cf_list = array();
373
+ $attr_list = array();
374
+ $taxs_list = array();
375
+ $acf_list = array();
376
+
377
+ $implode_delimiter = ($options['delimiter'] == ',') ? '|' : ',';
378
+
379
+ if ( ! empty($options['is_user_export']) ) self::$templateOptions['pmui']['import_users'] = 1;
380
+
381
+ foreach ($options['ids'] as $ID => $value)
382
+ {
383
+ if (empty($options['cc_type'][$ID])) continue;
384
+
385
+ if ($is_xml_template)
386
+ {
387
+ $element_name = (!empty($options['cc_name'][$ID])) ? str_replace(':', '_', preg_replace('/[^a-z0-9_:-]/i', '', $options['cc_name'][$ID])) : 'untitled_' . $ID;
388
+ }
389
+ else
390
+ {
391
+ $element_name = strtolower((!empty($options['cc_name'][$ID])) ? preg_replace('/[^a-z0-9_]/i', '', $options['cc_name'][$ID]) : 'untitled_' . $ID);
392
+ }
393
+
394
+ $element_type = $options['cc_type'][$ID];
395
+
396
+ switch ($element_type)
397
+ {
398
+ case 'woo':
399
+
400
+ if ( ! empty($options['cc_value'][$ID]) )
401
+ {
402
+ if (empty($required_add_ons['PMWI_Plugin']))
403
+ {
404
+ $required_add_ons['PMWI_Plugin'] = array(
405
+ 'name' => 'WooCommerce Add-On Pro',
406
+ 'paid' => true,
407
+ 'url' => 'http://www.wpallimport.com/woocommerce-product-import/'
408
+ );
409
+ }
410
+
411
+ XmlExportWooCommerce::prepare_import_template( $options, self::$templateOptions, $cf_list, $attr_list, $element_name, $options['cc_label'][$ID] );
412
+ }
413
+
414
+ break;
415
+
416
+ case 'acf':
417
+
418
+ if (empty($required_add_ons['PMAI_Plugin']))
419
+ {
420
+ $required_add_ons['PMAI_Plugin'] = array(
421
+ 'name' => 'ACF Add-On Pro',
422
+ 'paid' => true,
423
+ 'url' => 'http://www.wpallimport.com/advanced-custom-fields/?utm_source=wordpress.org&utm_medium=wpai-import-template&utm_campaign=free+wp+all+export+plugin'
424
+ );
425
+ }
426
+
427
+ $field_options = unserialize($options['cc_options'][$ID]);
428
+
429
+ // add ACF group ID to the template options
430
+ if( ! empty($templateOptions['acf']) and ! in_array($field_options['group_id'], $templateOptions['acf'])){
431
+ $templateOptions['acf'][$field_options['group_id']] = 1;
432
+ }
433
+
434
+ $templateOptions['fields'][$field_options['key']] = XmlExportACF::prepare_import_template( $options, self::$templateOptions, $acf_list, $element_name, $field_options);
435
+
436
+ break;
437
+
438
+ default:
439
+
440
+ XmlExportCpt::prepare_import_template( $options, self::$templateOptions, $cf_list, $attr_list, $taxs_list, $element_name, $ID);
441
+
442
+ XmlExportMediaGallery::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
443
+
444
+ XmlExportWooCommerceOrder::prepare_import_template( $options, self::$templateOptions, $element_name, $ID);
445
+
446
+ break;
447
+ }
448
+ }
449
+
450
+ if ( ! empty($cf_list) )
451
+ {
452
+ self::$templateOptions['is_update_custom_fields'] = 1;
453
+ self::$templateOptions['custom_fields_list'] = $cf_list;
454
+ }
455
+ if ( ! empty($attr_list) )
456
+ {
457
+ self::$templateOptions['is_update_attributes'] = 1;
458
+ self::$templateOptions['attributes_list'] = $attr_list;
459
+ self::$templateOptions['attributes_only_list'] = implode(',', $attr_list);
460
+ }
461
+ if ( ! empty($taxs_list) )
462
+ {
463
+ self::$templateOptions['is_update_categories'] = 1;
464
+ self::$templateOptions['taxonomies_list'] = $taxs_list;
465
+ }
466
+ if ( ! empty($acf_list) )
467
+ {
468
+ self::$templateOptions['is_update_acf'] = 1;
469
+ self::$templateOptions['acf_list'] = $acf_list;
470
+ }
471
+
472
+ self::$templateOptions['required_add_ons'] = $required_add_ons;
473
+ }
474
+ }
475
+
476
+ PMXE_Wpallimport::getInstance();
controllers/admin/export.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Import configuration wizard
4
  *
5
- * @author Pavel Kulbakin <p.kulbakin@gmail.com>
6
  */
7
 
8
  class PMXE_Admin_Export extends PMXE_Controller_Admin {
@@ -20,7 +20,7 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
20
  wp_redirect(add_query_arg('page', 'pmxe-admin-manage', admin_url('admin.php'))); die();
21
  }
22
  $this->isWizard = false;
23
-
24
  } else {
25
  $action = PMXE_Plugin::getInstance()->getAdminCurrentScreen()->action;
26
  $this->_step_ready($action);
@@ -55,6 +55,11 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
55
 
56
  $update_previous->getById(PMXE_Plugin::$session->update_previous);
57
 
 
 
 
 
 
58
  if ('options' == $action) return true;
59
 
60
  if ( ! PMXE_Plugin::$session->has_session()){
@@ -70,11 +75,9 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
70
  */
71
  public function index() {
72
 
73
- PMXE_Plugin::$session->clean_session();
74
 
75
- $wp_uploads = wp_upload_dir();
76
-
77
- $this->data['post'] = $post = $this->input->post(array(
78
  'cpt' => '',
79
  'export_to' => 'xml',
80
  'export_type' => 'specific',
@@ -83,7 +86,24 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
83
  'product_matching_mode' => 'strict',
84
  'wp_query_selector' => 'wp_query',
85
  'auto_generate' => 0
86
- ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
  // Delete history
89
  $history_files = PMXE_Helper::safe_glob(PMXE_ROOT_DIR . '/history/*', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH);
@@ -93,66 +113,48 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
93
  }
94
  }
95
 
96
- if ($this->input->post('is_submitted')){
 
 
 
 
 
 
 
 
 
 
97
 
98
  PMXE_Plugin::$session->set('export_type', $post['export_type']);
99
  PMXE_Plugin::$session->set('filter_rules_hierarhy', $post['filter_rules_hierarhy']);
100
  PMXE_Plugin::$session->set('product_matching_mode', $post['product_matching_mode']);
101
- PMXE_Plugin::$session->set('wp_query_selector', $post['wp_query_selector']);
102
-
103
- $engine = new XmlExportEngine($post, $this->errors);
104
- $engine->init_additional_data();
105
 
106
  if ( ! empty($post['auto_generate']) )
107
  {
108
- $auto_generate = array(
109
- 'ids' => array(),
110
- 'cc_label' => array(),
111
- 'cc_php' => array(),
112
- 'cc_code' => array(),
113
- 'cc_sql' => array(),
114
- 'cc_type' => array(),
115
- 'cc_options' => array(),
116
- 'cc_value' => array(),
117
- 'cc_name' => array()
118
- );
119
-
120
- $available_data = $engine->init_available_data();
121
- $available_sections = apply_filters("wp_all_export_available_sections", $engine->get('available_sections'));
122
-
123
- foreach ($available_sections as $slug => $section)
124
- {
125
- foreach ($available_data[$section['content']] as $field)
126
- {
127
- if (is_array($field) and isset($field['auto']))
128
- {
129
- $auto_generate['ids'][] = 1;
130
- $auto_generate['cc_label'][] = $field['label'];
131
- $auto_generate['cc_php'][] = 0;
132
- $auto_generate['cc_code'][] = '';
133
- $auto_generate['cc_sql'][] = '';
134
- $auto_generate['cc_type'][] = $field['type'];
135
- $auto_generate['cc_options'][] = '';
136
- $auto_generate['cc_value'][] = $field['label'];
137
- $auto_generate['cc_name'][] = $field['name'];
138
- }
139
- }
140
- }
141
  foreach ($auto_generate as $key => $value)
142
  {
143
  PMXE_Plugin::$session->set($key, $value);
144
  }
 
145
  PMXE_Plugin::$session->save_data();
146
- }
 
 
 
 
 
147
 
148
  }
149
 
150
  if ($this->input->post('is_submitted') and ! $this->errors->get_error_codes()) {
151
 
152
- check_admin_referer('choose-cpt', '_wpnonce_choose-cpt');
153
 
154
  PMXE_Plugin::$session->save_data();
155
-
156
  if ( ! empty($post['auto_generate']) )
157
  {
158
  wp_redirect(add_query_arg('action', 'options', $this->baseUrl)); die();
@@ -160,7 +162,7 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
160
  else
161
  {
162
  wp_redirect(add_query_arg('action', 'template', $this->baseUrl)); die();
163
- }
164
 
165
  }
166
 
@@ -168,7 +170,7 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
168
  }
169
 
170
  /**
171
- * Step #2: Template
172
  */
173
  public function template(){
174
 
@@ -193,8 +195,8 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
193
 
194
  PMXE_Plugin::$session->save_data();
195
 
196
- $this->data['post'] =& $post;
197
-
198
  PMXE_Plugin::$session->set('is_loaded_template', '');
199
 
200
  if (($load_template = $this->input->post('load_template'))) { // init form with template selected
@@ -209,6 +211,7 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
209
  unset($template_options['wp_query_selector']);
210
  $this->data['post'] = array_merge($post, $template_options);
211
  PMXE_Plugin::$session->set('is_loaded_template', $load_template);
 
212
  }
213
 
214
  } elseif ($this->input->post('is_submitted')) {
@@ -223,7 +226,7 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
223
  $this->errors->add('form-validation', __('CSV delimiter must be specified.', 'wp_all_export_plugin'));
224
  }
225
 
226
- if ( ! $this->errors->get_error_codes()) {
227
 
228
  if ( ! empty($post['name']) and !empty($post['save_template_as']) ) { // save template in database
229
  $template->getByName($post['name'])->set(array(
@@ -231,7 +234,7 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
231
  'options' => $post
232
  ))->save();
233
  PMXE_Plugin::$session->set('saved_template', $template->id);
234
- }
235
 
236
  if ($this->isWizard) {
237
  foreach ($this->data['post'] as $key => $value) {
@@ -252,17 +255,22 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
252
 
253
  }
254
 
255
- $engine = new XmlExportEngine($post, $this->errors);
256
 
257
- $engine->init_additional_data();
258
 
259
- $this->data = array_merge($this->data, $engine->init_available_data());
260
 
261
- $this->data['available_data_view'] = $engine->render();
 
 
262
 
263
  $this->render();
264
  }
265
 
 
 
 
266
  public function options()
267
  {
268
 
@@ -279,13 +287,12 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
279
  foreach ($post as $key => $value) {
280
  PMXE_Plugin::$session->set($key, $value);
281
  }
282
- PMXE_Plugin::$session->save_data();
283
-
284
- $this->data['engine'] = new XmlExportEngine($post, $this->errors);
285
 
286
- $this->data['engine']->init_available_data();
287
 
288
- }
289
 
290
  $this->data['post'] =& $post;
291
 
@@ -326,8 +333,8 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
326
  $friendly_name = 'WP_Query Export - ' . date("Y F d H:i");
327
  }
328
  $post['template_name'] = $friendly_name;
329
- }
330
-
331
  if ($this->isWizard) {
332
  if ( ! $this->errors->get_error_codes()) {
333
  foreach ($this->data['post'] as $key => $value) {
@@ -346,20 +353,19 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
346
  }
347
  wp_redirect(add_query_arg(array('page' => 'pmxe-admin-manage', 'pmxe_nt' => urlencode(__('Options updated', 'wp_all_export_plugin'))) + array_intersect_key($_GET, array_flip($this->baseUrlParamNames)), admin_url('admin.php'))); die();
348
  }
349
- }
350
-
351
  }
352
 
353
  $this->render();
354
  }
355
 
356
  /**
357
- * Step #3: Export
358
  */
359
  public function process()
360
  {
361
 
362
- @set_time_limit(0);
363
 
364
  $export = $this->data['update_previous'];
365
 
@@ -370,13 +376,19 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
370
  $post_types = PMXE_Plugin::$session->get('cpt');
371
  if ( ! empty($post_types) )
372
  {
373
- if ( ! in_array('users', $post_types)){
374
- $post_type_details = get_post_type_object( array_shift($post_types) );
375
- $friendly_name = $post_type_details->labels->name . ' Export - ' . date("Y F d H:i");
 
 
 
 
 
376
  }
377
  else
378
  {
379
- $friendly_name = 'Users Export - ' . date("Y F d H:i");
 
380
  }
381
  }
382
  else
@@ -392,92 +404,23 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
392
 
393
  $export->set(
394
  array(
395
- 'triggered' => 0,
396
  'processing' => 0,
397
- 'exported' => 0,
398
- 'executing' => 1,
399
- 'canceled' => 0,
400
- 'options' => PMXE_Plugin::$session->get_clear_session_data(),
401
  'friendly_name' => PMXE_Plugin::$session->friendly_name,
402
- 'scheduled' => (PMXE_Plugin::$session->is_scheduled) ? PMXE_Plugin::$session->scheduled_period : '',
403
  'registered_on' => date('Y-m-d H:i:s'),
404
  'last_activity' => date('Y-m-d H:i:s')
405
  )
406
- )->save();
407
-
408
- $options = $export->options;
409
-
410
- if ( $options['is_generate_import'] and wp_all_export_is_compatible() ){
411
-
412
- $import = new PMXI_Import_Record();
413
-
414
- if ( ! empty($options['import_id']) ) $import->getById($options['import_id']);
415
-
416
- if ($import->isEmpty()){
417
-
418
- $import->set(array(
419
- 'parent_import_id' => 99999,
420
- 'xpath' => '/',
421
- 'type' => 'upload',
422
- 'options' => array('empty'),
423
- 'root_element' => 'root',
424
- 'path' => 'path',
425
- //'name' => '',
426
- 'imported' => 0,
427
- 'created' => 0,
428
- 'updated' => 0,
429
- 'skipped' => 0,
430
- 'deleted' => 0,
431
- 'iteration' => 1
432
- ))->save();
433
-
434
- PMXE_Plugin::$session->set('import_id', $import->id);
435
-
436
- $options['import_id'] = $import->id;
437
-
438
- $export->set(array(
439
- 'options' => $options
440
- ))->save();
441
- }
442
- else{
443
-
444
- if ( $import->parent_import_id != 99999 ){
445
-
446
- $newImport = new PMXI_Import_Record();
447
-
448
- $newImport->set(array(
449
- 'parent_import_id' => 99999,
450
- 'xpath' => '/',
451
- 'type' => 'upload',
452
- 'options' => array('empty'),
453
- 'root_element' => 'root',
454
- 'path' => 'path',
455
- //'name' => '',
456
- 'imported' => 0,
457
- 'created' => 0,
458
- 'updated' => 0,
459
- 'skipped' => 0,
460
- 'deleted' => 0,
461
- 'iteration' => 1
462
- ))->save();
463
-
464
- PMXE_Plugin::$session->set('import_id', $newImport->id);
465
-
466
- $options['import_id'] = $newImport->id;
467
-
468
- $export->set(array(
469
- 'options' => $options
470
- ))->save();
471
-
472
- }
473
-
474
- }
475
-
476
- }
477
 
 
 
478
  PMXE_Plugin::$session->set('update_previous', $export->id);
479
-
480
- PMXE_Plugin::$session->save_data();
481
 
482
  do_action('pmxe_before_export', $export->id);
483
 
@@ -485,6 +428,5 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
485
 
486
  $this->render();
487
 
488
- }
489
-
490
  }
1
  <?php
2
  /**
3
+ * Export configuration wizard
4
  *
5
+ * @author Max Tsiplyakov <makstsiplyakov@gmail.com>
6
  */
7
 
8
  class PMXE_Admin_Export extends PMXE_Controller_Admin {
20
  wp_redirect(add_query_arg('page', 'pmxe-admin-manage', admin_url('admin.php'))); die();
21
  }
22
  $this->isWizard = false;
23
+ $export->fix_template_options();
24
  } else {
25
  $action = PMXE_Plugin::getInstance()->getAdminCurrentScreen()->action;
26
  $this->_step_ready($action);
55
 
56
  $update_previous->getById(PMXE_Plugin::$session->update_previous);
57
 
58
+ if ( ! $update_previous->isEmpty() )
59
+ {
60
+ $update_previous->fix_template_options();
61
+ }
62
+
63
  if ('options' == $action) return true;
64
 
65
  if ( ! PMXE_Plugin::$session->has_session()){
75
  */
76
  public function index() {
77
 
78
+ $action = $this->input->get('action');
79
 
80
+ $DefaultOptions = array(
 
 
81
  'cpt' => '',
82
  'export_to' => 'xml',
83
  'export_type' => 'specific',
86
  'product_matching_mode' => 'strict',
87
  'wp_query_selector' => 'wp_query',
88
  'auto_generate' => 0
89
+ );
90
+
91
+ if ( ! in_array($action, array('index')))
92
+ {
93
+ PMXE_Plugin::$session->clean_session();
94
+ $this->data['preload'] = false;
95
+ }
96
+ else
97
+ {
98
+ $DefaultOptions = (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + $DefaultOptions;
99
+ $this->data['preload'] = true;
100
+ }
101
+
102
+ $wp_uploads = wp_upload_dir();
103
+
104
+ $this->data['post'] = $post = $this->input->post($DefaultOptions);
105
+
106
+ if ( is_array($this->data['post']['cpt']) ) $this->data['post']['cpt'] = $this->data['post']['cpt'][0];
107
 
108
  // Delete history
109
  $history_files = PMXE_Helper::safe_glob(PMXE_ROOT_DIR . '/history/*', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH);
113
  }
114
  }
115
 
116
+ if ( ! class_exists('ZipArchive') )
117
+ {
118
+ $this->errors->add('form-validation', __('ZipArchive class is missing on your server.<br/>Please contact your web hosting provider and ask them to install and activate ZipArchive.', 'wp_all_export_plugin'));
119
+ }
120
+ if ( ! class_exists('XMLReader') or ! class_exists('XMLWriter'))
121
+ {
122
+ $this->errors->add('form-validation', __('Required PHP components are missing.<br/><br/>WP All Export requires XMLReader, and XMLWriter PHP modules to be installed.<br/>These are standard features of PHP, and are necessary for WP All Export to write the files you are trying to export.<br/>Please contact your web hosting provider and ask them to install and activate the DOMDocument, XMLReader, and XMLWriter PHP modules.', 'wp_all_export_plugin'));
123
+ }
124
+
125
+ if ($this->input->post('is_submitted'))
126
+ {
127
 
128
  PMXE_Plugin::$session->set('export_type', $post['export_type']);
129
  PMXE_Plugin::$session->set('filter_rules_hierarhy', $post['filter_rules_hierarhy']);
130
  PMXE_Plugin::$session->set('product_matching_mode', $post['product_matching_mode']);
131
+ PMXE_Plugin::$session->set('wp_query_selector', $post['wp_query_selector']);
 
 
 
132
 
133
  if ( ! empty($post['auto_generate']) )
134
  {
135
+ $auto_generate = XmlCsvExport::auto_genetate_export_fields($post, $this->errors);
136
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  foreach ($auto_generate as $key => $value)
138
  {
139
  PMXE_Plugin::$session->set($key, $value);
140
  }
141
+
142
  PMXE_Plugin::$session->save_data();
143
+ }
144
+ else
145
+ {
146
+ $engine = new XmlExportEngine($post, $this->errors);
147
+ $engine->init_additional_data();
148
+ }
149
 
150
  }
151
 
152
  if ($this->input->post('is_submitted') and ! $this->errors->get_error_codes()) {
153
 
154
+ check_admin_referer('choose-cpt', '_wpnonce_choose-cpt');
155
 
156
  PMXE_Plugin::$session->save_data();
157
+
158
  if ( ! empty($post['auto_generate']) )
159
  {
160
  wp_redirect(add_query_arg('action', 'options', $this->baseUrl)); die();
162
  else
163
  {
164
  wp_redirect(add_query_arg('action', 'template', $this->baseUrl)); die();
165
+ }
166
 
167
  }
168
 
170
  }
171
 
172
  /**
173
+ * Step #2: Export Template
174
  */
175
  public function template(){
176
 
195
 
196
  PMXE_Plugin::$session->save_data();
197
 
198
+ $this->data['post'] =& $post;
199
+
200
  PMXE_Plugin::$session->set('is_loaded_template', '');
201
 
202
  if (($load_template = $this->input->post('load_template'))) { // init form with template selected
211
  unset($template_options['wp_query_selector']);
212
  $this->data['post'] = array_merge($post, $template_options);
213
  PMXE_Plugin::$session->set('is_loaded_template', $load_template);
214
+ //PMXE_Plugin::$session->set('options', $template_options);
215
  }
216
 
217
  } elseif ($this->input->post('is_submitted')) {
226
  $this->errors->add('form-validation', __('CSV delimiter must be specified.', 'wp_all_export_plugin'));
227
  }
228
 
229
+ if ( ! $this->errors->get_error_codes()) {
230
 
231
  if ( ! empty($post['name']) and !empty($post['save_template_as']) ) { // save template in database
232
  $template->getByName($post['name'])->set(array(
234
  'options' => $post
235
  ))->save();
236
  PMXE_Plugin::$session->set('saved_template', $template->id);
237
+ }
238
 
239
  if ($this->isWizard) {
240
  foreach ($this->data['post'] as $key => $value) {
255
 
256
  }
257
 
258
+ $this->data['engine'] = new XmlExportEngine($post, $this->errors);
259
 
260
+ $this->data['engine']->init_additional_data();
261
 
262
+ $this->data = array_merge($this->data, $this->data['engine']->init_available_data());
263
 
264
+ $this->data['available_data_view'] = $this->data['engine']->render();
265
+
266
+ $this->data['available_fields_view'] = $this->data['engine']->render_new_field();
267
 
268
  $this->render();
269
  }
270
 
271
+ /**
272
+ * Step #3: Export Options
273
+ */
274
  public function options()
275
  {
276
 
287
  foreach ($post as $key => $value) {
288
  PMXE_Plugin::$session->set($key, $value);
289
  }
290
+ PMXE_Plugin::$session->save_data();
291
+ }
 
292
 
293
+ $this->data['engine'] = new XmlExportEngine($post, $this->errors);
294
 
295
+ $this->data['engine']->init_available_data();
296
 
297
  $this->data['post'] =& $post;
298
 
333
  $friendly_name = 'WP_Query Export - ' . date("Y F d H:i");
334
  }
335
  $post['template_name'] = $friendly_name;
336
+ }
337
+
338
  if ($this->isWizard) {
339
  if ( ! $this->errors->get_error_codes()) {
340
  foreach ($this->data['post'] as $key => $value) {
353
  }
354
  wp_redirect(add_query_arg(array('page' => 'pmxe-admin-manage', 'pmxe_nt' => urlencode(__('Options updated', 'wp_all_export_plugin'))) + array_intersect_key($_GET, array_flip($this->baseUrlParamNames)), admin_url('admin.php'))); die();
355
  }
356
+ }
 
357
  }
358
 
359
  $this->render();
360
  }
361
 
362
  /**
363
+ * Step #4: Export Processing
364
  */
365
  public function process()
366
  {
367
 
368
+ @set_time_limit(0);
369
 
370
  $export = $this->data['update_previous'];
371
 
376
  $post_types = PMXE_Plugin::$session->get('cpt');
377
  if ( ! empty($post_types) )
378
  {
379
+ if ( in_array('users', $post_types)){
380
+ $friendly_name = 'Users Export - ' . date("Y F d H:i");
381
+ }
382
+ elseif ( in_array('shop_customer', $post_types)){
383
+ $friendly_name = 'Customers Export - ' . date("Y F d H:i");
384
+ }
385
+ elseif ( in_array('comments', $post_types)){
386
+ $friendly_name = 'Comments Export - ' . date("Y F d H:i");
387
  }
388
  else
389
  {
390
+ $post_type_details = get_post_type_object( array_shift($post_types) );
391
+ $friendly_name = $post_type_details->labels->name . ' Export - ' . date("Y F d H:i");
392
  }
393
  }
394
  else
404
 
405
  $export->set(
406
  array(
407
+ 'triggered' => 0,
408
  'processing' => 0,
409
+ 'exported' => 0,
410
+ 'executing' => 1,
411
+ 'canceled' => 0,
412
+ 'options' => PMXE_Plugin::$session->get_clear_session_data(),
413
  'friendly_name' => PMXE_Plugin::$session->friendly_name,
414
+ 'scheduled' => (PMXE_Plugin::$session->is_scheduled) ? PMXE_Plugin::$session->scheduled_period : '',
415
  'registered_on' => date('Y-m-d H:i:s'),
416
  'last_activity' => date('Y-m-d H:i:s')
417
  )
418
+ )->save();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
 
420
+ // create an import for this export
421
+ PMXE_Wpallimport::create_an_import( $export );
422
  PMXE_Plugin::$session->set('update_previous', $export->id);
423
+ PMXE_Plugin::$session->save_data();
 
424
 
425
  do_action('pmxe_before_export', $export->id);
426
 
428
 
429
  $this->render();
430
 
431
+ }
 
432
  }
controllers/admin/manage.php CHANGED
@@ -39,7 +39,7 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
39
  }
40
 
41
  $list = new PMXE_Export_List();
42
- $by = null;
43
  if ('' != $s) {
44
  $like = '%' . preg_replace('%\s+%', '%', preg_replace('/[%?]/', '\\\\$0', $s)) . '%';
45
  $by[] = array(array('name LIKE' => $like, 'type LIKE' => $like, 'path LIKE' => $like), 'OR');
@@ -99,9 +99,14 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
99
 
100
  $wp_uploads = wp_upload_dir();
101
 
102
- $to_dirname = $wp_uploads['baseurl'] . DIRECTORY_SEPARATOR . PMXE_Plugin::CRON_DIRECTORY . DIRECTORY_SEPARATOR . md5($this->data['cron_job_key'] . $item->id);
103
 
104
- $this->data['file_path'] = $to_dirname . DIRECTORY_SEPARATOR . ( ( ! empty($item->friendly_name)) ? sanitize_file_name($item->friendly_name) : 'feed' ) . '.' . $item->options['export_to'];
 
 
 
 
 
105
 
106
  $this->render();
107
  }
@@ -147,21 +152,24 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
147
  * Reexport
148
  */
149
  public function update() {
150
-
151
  $id = $this->input->get('id');
152
 
153
- PMXE_Plugin::$session->clean_session($id);
154
 
155
  $action_type = $this->input->get('type');
156
 
157
  $this->data['item'] = $item = new PMXE_Export_Record();
158
  if ( ! $id or $item->getById($id)->isEmpty()) {
159
  wp_redirect($this->baseUrl); die();
160
- }
 
 
161
 
162
  $default = PMXE_Plugin::get_default_import_options();
163
  $DefaultOptions = $item->options + $default;
164
- $this->data['post'] = $post = $this->input->post($DefaultOptions);
 
165
 
166
  if ($this->input->post('is_confirmed')) {
167
 
@@ -179,9 +187,11 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
179
 
180
  if ($post['main_xml_tag'] == $post['record_xml_tag']){
181
  $this->errors->add('form-validation', __('Main XML Tag equals to Single Record XML Tag.', 'wp_all_export_plugin'));
182
- }
 
 
183
 
184
- $item->set(array( 'options' => $post))->save();
185
  if ( ! empty($post['friendly_name']) ) {
186
  $item->set( array( 'friendly_name' => $post['friendly_name'], 'scheduled' => (($post['is_scheduled']) ? $post['scheduled_period'] : '') ) )->save();
187
  }
@@ -241,7 +251,7 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
241
  if ($this->input->post('is_confirmed')) {
242
  check_admin_referer('delete-export', '_wpnonce_delete-export');
243
  $item->delete();
244
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('Export deleted', 'pmxe_plugin')), $this->baseUrl)); die();
245
  }
246
 
247
  $this->render();
@@ -269,7 +279,7 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
269
 
270
  $item->delete();
271
  }
272
- wp_redirect(add_query_arg('pmxe_nt', urlencode(sprintf(__('%d %s deleted', 'pmxe_plugin'), $items->count(), _n('export', 'exports', $items->count(), 'pmxe_plugin'))), $this->baseUrl)); die();
273
  }
274
  $this->render();
275
  }
@@ -292,13 +302,13 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
292
 
293
  $export_data[] = $export->options['tpl_data'];
294
  $uploads = wp_upload_dir();
295
- $targetDir = $uploads['basedir'] . DIRECTORY_SEPARATOR . PMXI_Plugin::TEMP_DIRECTORY;
296
 
297
  $export_file_name = "WP All Import Template - " . sanitize_file_name($export->friendly_name) . ".txt";
298
 
299
  file_put_contents($targetDir . DIRECTORY_SEPARATOR . $export_file_name, json_encode($export_data));
300
 
301
- PMXI_download::csv($targetDir . DIRECTORY_SEPARATOR . $export_file_name);
302
 
303
  }
304
  }
@@ -308,74 +318,43 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
308
  * Download bundle for WP All Import
309
  *
310
  */
311
- public function bundle(){
312
-
313
  $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
314
- if ( ! wp_verify_nonce( $nonce, '_wpnonce-download_bundle' ) ) {
315
  die( __('Security check', 'wp_all_export_plugin') );
316
  } else {
317
 
318
  $uploads = wp_upload_dir();
 
 
319
 
320
- //generate temporary folder
321
- $tmp_dir = $uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::TEMP_DIRECTORY . DIRECTORY_SEPARATOR . md5($nonce) . DIRECTORY_SEPARATOR;
322
- $bundle_dir = $tmp_dir . 'bundle' . DIRECTORY_SEPARATOR;
323
-
324
- // clear tmp dir
325
- wp_all_export_rrmdir($tmp_dir);
326
-
327
- @mkdir($tmp_dir);
328
-
329
- $id = PMXE_Plugin::$session->update_previous;
330
-
331
- if (empty($id))
332
- $id = $this->input->get('id');
333
 
334
- $export = new PMXE_Export_Record();
335
-
336
  if ( ! $export->getById($id)->isEmpty())
337
- {
338
-
339
- $friendly_name = sanitize_file_name($export->friendly_name);
340
-
341
- @mkdir($bundle_dir);
342
-
343
- if ( ! empty($export->options['tpl_data']))
344
  {
345
- $template_data = array($export->options['tpl_data']);
346
- $template = "WP All Import Template - " . $friendly_name . ".txt";
347
 
348
- file_put_contents($bundle_dir . $template, json_encode($template_data));
349
-
350
- $readme = __("The other two files in this zip are the export file containing all of your data and the import template for WP All Import. \n\nTo import this data, create a new import with WP All Import and upload this zip file.", "wp_all_export_plugin");
351
-
352
- file_put_contents($bundle_dir . 'readme.txt', $readme);
353
- }
354
-
355
- $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
356
 
357
- if ( ! $is_secure_import)
358
- {
359
- $filepath = get_attached_file($export->attch_id);
360
  }
361
  else
362
  {
363
- $filepath = wp_all_export_get_absolute_path($export->options['filepath']);
364
- }
365
-
366
- @copy( $filepath, $bundle_dir . basename($filepath) );
367
-
368
- $bundle_path = $tmp_dir . $friendly_name . '.zip';
369
-
370
- PMXE_Zip::zipDir($bundle_dir, $bundle_path);
371
-
372
- $bundle_url = $uploads['baseurl'] . str_replace($uploads['basedir'], '', $bundle_path);
373
-
374
- PMXE_download::zip($bundle_path);
375
-
376
  }
377
  }
378
- }
379
 
380
  public function split_bundle(){
381
  $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
@@ -456,7 +435,7 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
456
  }
457
 
458
  if ( @file_exists($filepath) )
459
- {
460
  switch ($export->options['export_to'])
461
  {
462
  case 'xml':
@@ -467,18 +446,18 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
467
  break;
468
 
469
  default:
470
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('File format not supported', 'pmxe_plugin')), $this->baseUrl)); die();
471
  break;
472
  }
473
  }
474
  else
475
  {
476
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('The exported file is missing and can\'t be downloaded. Please re-run your export to re-generate it.', 'pmxe_plugin')), $this->baseUrl)); die();
477
  }
478
  }
479
  else
480
  {
481
- wp_redirect(add_query_arg('pmxe_nt', urlencode(__('The exported file is missing and can\'t be downloaded. Please re-run your export to re-generate it.', 'pmxe_plugin')), $this->baseUrl)); die();
482
  }
483
  }
484
  }
39
  }
40
 
41
  $list = new PMXE_Export_List();
42
+ $by = array('parent_id' => 0);
43
  if ('' != $s) {
44
  $like = '%' . preg_replace('%\s+%', '%', preg_replace('/[%?]/', '\\\\$0', $s)) . '%';
45
  $by[] = array(array('name LIKE' => $like, 'type LIKE' => $like, 'path LIKE' => $like), 'OR');
99
 
100
  $wp_uploads = wp_upload_dir();
101
 
102
+ $this->data['file_path'] = site_url() . '/wp-cron.php?export_hash=' . substr(md5($this->data['cron_job_key'] . $item['id']), 0, 16) . '&export_id=' . $item['id'] . '&action=get_data';
103
 
104
+ $this->data['bundle_url'] = '';
105
+
106
+ if ( ! empty($item['options']['bundlepath']) )
107
+ {
108
+ $this->data['bundle_url'] = site_url() . '/wp-cron.php?export_hash=' . substr(md5($this->data['cron_job_key'] . $item['id']), 0, 16) . '&export_id=' . $item['id'] . '&action=get_bundle';
109
+ }
110
 
111
  $this->render();
112
  }
152
  * Reexport
153
  */
154
  public function update() {
155
+
156
  $id = $this->input->get('id');
157
 
158
+ PMXE_Plugin::$session->clean_session($id);
159
 
160
  $action_type = $this->input->get('type');
161
 
162
  $this->data['item'] = $item = new PMXE_Export_Record();
163
  if ( ! $id or $item->getById($id)->isEmpty()) {
164
  wp_redirect($this->baseUrl); die();
165
+ }
166
+
167
+ $item->fix_template_options();
168
 
169
  $default = PMXE_Plugin::get_default_import_options();
170
  $DefaultOptions = $item->options + $default;
171
+ $this->data['post'] = $post = $this->input->post($DefaultOptions);
172
+ $this->data['iteration'] = $item->iteration;
173
 
174
  if ($this->input->post('is_confirmed')) {
175
 
187
 
188
  if ($post['main_xml_tag'] == $post['record_xml_tag']){
189
  $this->errors->add('form-validation', __('Main XML Tag equals to Single Record XML Tag.', 'wp_all_export_plugin'));
190
+ }
191
+
192
+ $iteration = ( empty($item->options['creata_a_new_export_file']) && ! empty($post['creata_a_new_export_file'])) ? 0 : $item->iteration;
193
 
194
+ $item->set(array( 'options' => $post, 'iteration' => $iteration))->save();
195
  if ( ! empty($post['friendly_name']) ) {
196
  $item->set( array( 'friendly_name' => $post['friendly_name'], 'scheduled' => (($post['is_scheduled']) ? $post['scheduled_period'] : '') ) )->save();
197
  }
251
  if ($this->input->post('is_confirmed')) {
252
  check_admin_referer('delete-export', '_wpnonce_delete-export');
253
  $item->delete();
254
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('Export deleted', 'wp_all_export_plugin')), $this->baseUrl)); die();
255
  }
256
 
257
  $this->render();
279
 
280
  $item->delete();
281
  }
282
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(sprintf(__('%d %s deleted', 'wp_all_export_plugin'), $items->count(), _n('export', 'exports', $items->count(), 'wp_all_export_plugin'))), $this->baseUrl)); die();
283
  }
284
  $this->render();
285
  }
302
 
303
  $export_data[] = $export->options['tpl_data'];
304
  $uploads = wp_upload_dir();
305
+ $targetDir = $uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::TEMP_DIRECTORY;
306
 
307
  $export_file_name = "WP All Import Template - " . sanitize_file_name($export->friendly_name) . ".txt";
308
 
309
  file_put_contents($targetDir . DIRECTORY_SEPARATOR . $export_file_name, json_encode($export_data));
310
 
311
+ PMXE_download::csv($targetDir . DIRECTORY_SEPARATOR . $export_file_name);
312
 
313
  }
314
  }
318
  * Download bundle for WP All Import
319
  *
320
  */
321
+ public function bundle()
322
+ {
323
  $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
324
+ if ( ! wp_verify_nonce( $nonce, '_wpnonce-download_bundle' ) ) {
325
  die( __('Security check', 'wp_all_export_plugin') );
326
  } else {
327
 
328
  $uploads = wp_upload_dir();
329
+
330
+ $id = $this->input->get('id');
331
 
332
+ $export = new PMXE_Export_Record();
 
 
 
 
 
 
 
 
 
 
 
 
333
 
 
 
334
  if ( ! $export->getById($id)->isEmpty())
335
+ {
336
+ if ( ! empty($export->options['bundlepath']) )
 
 
 
 
 
337
  {
338
+ $bundle_path = wp_all_export_get_absolute_path($export->options['bundlepath']);
 
339
 
340
+ if ( @file_exists($bundle_path) )
341
+ {
342
+ $bundle_url = $uploads['baseurl'] . str_replace($uploads['basedir'], '', $bundle_path);
 
 
 
 
 
343
 
344
+ PMXE_download::zip($bundle_path);
345
+ }
 
346
  }
347
  else
348
  {
349
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('The exported bundle is missing and can\'t be downloaded. Please re-run your export to re-generate it.', 'wp_all_export_plugin')), $this->baseUrl)); die();
350
+ }
351
+ }
352
+ else
353
+ {
354
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('This export doesn\'t exist.', 'wp_all_export_plugin')), $this->baseUrl)); die();
 
 
 
 
 
 
 
355
  }
356
  }
357
+ }
358
 
359
  public function split_bundle(){
360
  $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
435
  }
436
 
437
  if ( @file_exists($filepath) )
438
+ {
439
  switch ($export->options['export_to'])
440
  {
441
  case 'xml':
446
  break;
447
 
448
  default:
449
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('File format not supported', 'wp_all_export_plugin')), $this->baseUrl)); die();
450
  break;
451
  }
452
  }
453
  else
454
  {
455
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('The exported file is missing and can\'t be downloaded. Please re-run your export to re-generate it.', 'wp_all_export_plugin')), $this->baseUrl)); die();
456
  }
457
  }
458
  else
459
  {
460
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('The exported file is missing and can\'t be downloaded. Please re-run your export to re-generate it.', 'wp_all_export_plugin')), $this->baseUrl)); die();
461
  }
462
  }
463
  }
controllers/controller.php CHANGED
@@ -57,7 +57,7 @@ abstract class PMXE_Controller {
57
  */
58
  protected function render($viewPath = null) {
59
 
60
- if ( ! get_current_user_id() or ! current_user_can('manage_options')) {
61
  // This nonce is not valid.
62
  die( 'Security check' );
63
 
57
  */
58
  protected function render($viewPath = null) {
59
 
60
+ if ( ! get_current_user_id() or ! current_user_can(PMXE_Plugin::$capabilities)) {
61
  // This nonce is not valid.
62
  die( 'Security check' );
63
 
filters/wpallexport_custom_types.php CHANGED
@@ -1,7 +1,51 @@
1
  <?php
2
 
3
- function pmxe_wpallexport_custom_types($custom_types){
4
- if ( ! empty($custom_types['product']) and class_exists('WooCommerce')) $custom_types['product']->labels->name = __('WooCommerce Products','wp_all_export_plugin');
5
- if ( ! empty($custom_types['product_variation'])) unset($custom_types['product_variation']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  return $custom_types;
7
  }
1
  <?php
2
 
3
+ function pmxe_wpallexport_custom_types($custom_types)
4
+ {
5
+ if (class_exists('WooCommerce'))
6
+ {
7
+ if ( ! empty($custom_types['product'])) $custom_types['product']->labels->name = __('WooCommerce Products','wp_all_export_plugin');
8
+ if ( ! empty($custom_types['shop_order'])) $custom_types['shop_order']->labels->name = __('WooCommerce Orders','wp_all_export_plugin');
9
+ if ( ! empty($custom_types['shop_coupon'])) unset($custom_types['shop_coupon']);
10
+ if ( ! empty($custom_types['product_variation'])) unset($custom_types['product_variation']);
11
+ if ( ! empty($custom_types['shop_order_refund'])) unset($custom_types['shop_order_refund']);
12
+
13
+ $order = array('shop_order', 'shop_customer', 'product');
14
+
15
+ $ordered_custom_types = array();
16
+
17
+ foreach ($order as $type)
18
+ {
19
+
20
+ if (isset($ordered_custom_types[$type])) continue;
21
+
22
+ if ($type == 'shop_customer')
23
+ {
24
+ $ordered_custom_types['shop_customer'] = new stdClass();
25
+ $ordered_custom_types['shop_customer']->labels = new stdClass();
26
+ $ordered_custom_types['shop_customer']->labels->name = __('WooCommerce Customers','wp_all_export_plugin');
27
+ }
28
+ else
29
+ {
30
+ foreach ($custom_types as $key => $custom_type)
31
+ {
32
+ if (isset($ordered_custom_types[$key])) continue;
33
+
34
+ if (in_array($key, $order))
35
+ {
36
+ if ($key == $type)
37
+ {
38
+ $ordered_custom_types[$key] = $custom_type;
39
+ }
40
+ }
41
+ else
42
+ {
43
+ $ordered_custom_types[$key] = $custom_type;
44
+ }
45
+ }
46
+ }
47
+ }
48
+ return $ordered_custom_types;
49
+ }
50
  return $custom_types;
51
  }
helpers/pmxe_export_acf_field_csv.php DELETED
@@ -1,446 +0,0 @@
1
- <?php
2
-
3
- function pmxe_export_acf_field_csv($field_value, $exportOptions, $ID, $recordID, &$article, &$acfs, $element_name = '', $fieldSnipped = '', $group_id = '', $preview = false, $parent_field_name = '', $return_value = false){
4
-
5
- $put_to_csv = true;
6
-
7
- $field_name = ($ID) ? $exportOptions['cc_label'][$ID] : $exportOptions['name'];
8
-
9
- $field_options = ($ID) ? unserialize($exportOptions['cc_options'][$ID]) : $exportOptions;
10
-
11
- if ( ! empty($field_value) ) {
12
-
13
- global $acf;
14
-
15
- $field_value = maybe_unserialize($field_value);
16
-
17
- $implode_delimiter = ($exportOptions['delimiter'] == ',') ? '|' : ',';
18
-
19
- // switch ACF field type
20
- switch ($field_options['type']) {
21
-
22
- case 'date_time_picker':
23
- case 'date_picker':
24
-
25
- $field_value = date('Ymd', strtotime($field_value));
26
-
27
- break;
28
-
29
- case 'file':
30
- case 'image':
31
-
32
- if (is_numeric($field_value)){
33
- $field_value = wp_get_attachment_url($field_value);
34
- }
35
- elseif(is_array($field_value)){
36
- $field_value = $field_value['url'];
37
- }
38
-
39
- break;
40
-
41
- case 'gallery':
42
-
43
- $v = array();
44
- foreach ($field_value as $key => $item) {
45
- $v[] = $item['url'];
46
- }
47
- $field_value = implode($implode_delimiter, $v);
48
-
49
- break;
50
- case 'location-field':
51
-
52
- $localion_parts = explode("|", $field_value);
53
-
54
- $acfs[] = $element_name . '_address';
55
- $acfs[] = $element_name . '_lat';
56
- $acfs[] = $element_name . '_lng';
57
-
58
- if (!empty($localion_parts)){
59
-
60
- $article[$element_name . '_address'] = $localion_parts[0];
61
-
62
- if (!empty($localion_parts[1])){
63
- $coordinates = explode(",", $localion_parts[1]);
64
- if (!empty($coordinates)){
65
- $article[$element_name . '_lat'] = $coordinates[0];
66
- $article[$element_name . '_lng'] = $coordinates[1];
67
- }
68
- }
69
- }
70
-
71
- $put_to_csv = false;
72
-
73
- break;
74
- case 'paypal_item':
75
-
76
- $acfs[] = array($element_name . '_item_name', $element_name . '_item_description', $element_name . '_price');
77
-
78
- if ( is_array($field_value) ){
79
- foreach ($field_value as $key => $value) {
80
- $article[$element_name . '_' . $key] = $value;
81
- }
82
- }
83
-
84
- $put_to_csv = false;
85
-
86
- break;
87
- case 'google_map':
88
-
89
- $acfs[] = array($element_name . '_address', $element_name . '_lat', $element_name . '_lng');
90
-
91
- $article[$element_name . '_address'] = $field_value['address'];
92
- $article[$element_name . '_lat'] = $field_value['lat'];
93
- $article[$element_name . '_lng'] = $field_value['lng'];
94
-
95
- $put_to_csv = false;
96
-
97
- break;
98
-
99
- case 'acf_cf7':
100
- case 'gravity_forms_field':
101
-
102
- if ( ! empty($field_options['multiple']) )
103
- $field_value = implode($implode_delimiter, $field_value);
104
-
105
- break;
106
-
107
- case 'page_link':
108
-
109
- if (is_array($field_value))
110
- $field_value = implode($implode_delimiter, $field_value);
111
-
112
- break;
113
- case 'post_object':
114
-
115
- if ( ! empty($field_options['multiple'])){
116
- $v = array();
117
- foreach ($field_value as $key => $pid) {
118
-
119
- if (is_numeric($pid)){
120
- $entry = get_post($pid);
121
- if ($entry)
122
- {
123
- $v[] = $entry->post_name;
124
- }
125
- }
126
- else{
127
- $v[] = $pid->post_name;
128
- }
129
- }
130
- $field_value = implode($implode_delimiter, $v);
131
- }
132
- else{
133
- if (is_numeric($field_value)){
134
- $entry = get_post($field_value);
135
- if ($entry)
136
- {
137
- $field_value = $entry->post_name;
138
- }
139
- }
140
- else{
141
- $field_value = $field_value->post_name;
142
- }
143
- }
144
-
145
- break;
146
- case 'relationship':
147
-
148
- $v = array();
149
- foreach ($field_value as $key => $pid) {
150
- $entry = get_post($pid);
151
- if ($entry)
152
- {
153
- $v[] = $entry->post_title;
154
- }
155
- }
156
- $field_value = implode($implode_delimiter, $v);
157
-
158
- break;
159
- case 'user':
160
-
161
- if ( ! empty($field_options['multiple'])){
162
- $v = array();
163
- foreach ($field_value as $key => $user) {
164
- if (is_numeric($user)){
165
- $entry = get_user_by('ID', $user);
166
- if ($entry)
167
- {
168
- $v[] = $entry->user_email;
169
- }
170
- }
171
- else{
172
- $v[] = $user['user_email'];
173
- }
174
- }
175
- $field_value = implode($implode_delimiter, $v);
176
- }
177
- else{
178
- if (is_numeric($field_value)){
179
- $entry = get_user_by('ID', $field_value);
180
- if ($entry)
181
- {
182
- $field_value = $entry->user_email;
183
- }
184
- }
185
- else{
186
- $field_value = $field_value['user_email'];
187
- }
188
- }
189
-
190
- break;
191
- case 'taxonomy':
192
-
193
- if ( ! in_array($field_options['field_type'], array('radio', 'select'))){
194
- $v = array();
195
- foreach ($field_value as $key => $tid) {
196
- $entry = get_term($tid , $field_options['taxonomy']);
197
- if ($entry and !is_wp_error($entry))
198
- {
199
- $v[] = $entry->name;
200
- }
201
- }
202
- $field_value = implode($implode_delimiter, $v);
203
- }
204
- else{
205
- $entry = get_term($field_value, $field_options['taxonomy']);
206
- if ($entry)
207
- {
208
- $field_value = $entry->name;
209
- }
210
- }
211
-
212
- break;
213
- case 'select':
214
-
215
- if ( ! empty($field_options['multiple'])){
216
- $field_value = implode($implode_delimiter, $field_value);
217
- }
218
-
219
- break;
220
- case 'checkbox':
221
-
222
- $field_value = implode($implode_delimiter, $field_value);
223
-
224
- break;
225
-
226
- case 'repeater':
227
-
228
- if( have_rows($field_name, $recordID) ){
229
-
230
- // $repeater_element_name = empty($ID) ? $parent_field_name : $element_name;
231
-
232
- // if ( ! empty($ID))
233
- // $acfs[$repeater_element_name] = array();
234
-
235
- $rowValues = array();
236
-
237
- $repeater_sub_field_names = array();
238
-
239
- while( have_rows($field_name, $recordID) ): the_row();
240
-
241
- $row = XmlExportACF::acf_get_row();
242
-
243
- foreach ($row['field']['sub_fields'] as $sub_field) {
244
-
245
- if ($acf and version_compare($acf->settings['version'], '5.0.0') >= 0)
246
- {
247
- // get
248
- $v = $row['value'][ $row['i'] ][ $sub_field['key'] ];//acf_format_value($row['value'][ $row['i'] ][ $sub_field['key'] ], $row['post_id'], $sub_field);
249
- }
250
- else
251
- {
252
- $v = get_sub_field($sub_field['name']);
253
- }
254
-
255
- $sub_field['delimiter'] = $exportOptions['delimiter'];
256
-
257
- switch ($sub_field['type']) {
258
- case 'repeater':
259
- pmxe_export_acf_field_csv($v, $sub_field, false, $recordID, $article, $acfs, str_replace('acf' . $group_id, '', $element_name) . '_' . $sub_field['name'], '', '', false, $element_name);
260
- break;
261
- case 'google_map':
262
- case 'paypal_item':
263
- case 'location-field':
264
- $rowValues[$sub_field['name']][] = (is_array($v)) ? implode($exportOptions['delimiter'], $v) : $v;
265
- break;
266
-
267
- default:
268
-
269
- $sub_field_value = pmxe_export_acf_field_csv($v, $sub_field, false, $recordID, $article, $acfs, str_replace('acf' . $group_id, '', $element_name) . '_' . $sub_field['name'], '', '', false, $element_name, true);
270
-
271
- $rowValues[$sub_field['name']][] = (is_array($sub_field_value)) ? implode($exportOptions['delimiter'], $sub_field_value) : $sub_field_value;
272
- break;
273
- }
274
-
275
- // if ($sub_field['type'] == 'repeater')
276
- // {
277
- // $sub_field['delimiter'] = $exportOptions['delimiter'];
278
- // pmxe_export_acf_field_csv($v, $sub_field, false, $recordID, $article, $acfs, str_replace('acf' . $group_id, '', $element_name) . '_' . $sub_field['name'], '', '', false, $element_name);
279
- // }
280
- // else
281
- // {
282
- // $rowValues[$sub_field['name']][] = (is_array($v)) ? implode($exportOptions['delimiter'], $v) : $v;
283
- // }
284
-
285
- }
286
-
287
- endwhile;
288
-
289
- foreach ($rowValues as $key => $values) {
290
- $article[$element_name . '_' . $key] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars(implode($exportOptions['delimiter'], $values)))) : implode($exportOptions['delimiter'], $values);
291
- if ( ! in_array($element_name . '_' . $key, $repeater_sub_field_names)) $repeater_sub_field_names[] = $element_name . '_' . $key;
292
- }
293
-
294
- if ( ! empty($repeater_sub_field_names)) $acfs[] = $repeater_sub_field_names;
295
-
296
- }
297
-
298
- $put_to_csv = false;
299
-
300
- break;
301
-
302
- case 'flexible_content':
303
-
304
- // check if the flexible content field has rows of data
305
- if( have_rows($field_name) ):
306
-
307
- // loop through the rows of data
308
- while ( have_rows($field_name) ) : the_row();
309
-
310
- $row = XmlExportACF::acf_get_row();
311
-
312
- foreach ($row['field']['layouts'] as $layout) {
313
-
314
- if ($layout['name'] == $row['value'][ $row['i'] ]['acf_fc_layout']){
315
-
316
- foreach ($layout['sub_fields'] as $sub_field) {
317
-
318
- if (isset($row['value'][ $row['i'] ][ $sub_field['key'] ])){
319
- // get
320
- $v = $row['value'][ $row['i'] ][ $sub_field['key'] ]; //acf_format_value($row['value'][ $row['i'] ][ $sub_field['key'] ], $row['post_id'], $sub_field);
321
-
322
- $article[$element_name . '_' . $layout['name'] . '_' . $row['i'] . '_' . $sub_field['name']] = $v;
323
- $acfs[] = $element_name . '_' . $layout['name'] . '_' . $row['i'] . '_' . $sub_field['name'];
324
-
325
- //pmxe_export_acf_field_csv($v, $sub_field, false, $recordID, $article, $acfs, str_replace('acf' . $group_id, '', $element_name) . '_' . $row['value'][ $row['i'] ]['acf_fc_layout'] . '_' . $row['i'] . '_' . $sub_field['name'], '', '', true);
326
- }
327
-
328
- }
329
- }
330
- }
331
-
332
- endwhile;
333
-
334
- else :
335
-
336
- // no layouts found
337
-
338
- endif;
339
-
340
- $put_to_csv = false;
341
-
342
- break;
343
-
344
- default:
345
-
346
- break;
347
- }
348
-
349
- }
350
-
351
- if ($return_value) return $field_value;
352
-
353
- if ($put_to_csv){
354
-
355
- switch ($field_options['type']) {
356
-
357
- case 'repeater':
358
-
359
- global $acf;
360
-
361
- if ($acf->settings['version'] and version_compare($acf->settings['version'], '5.0.0') >= 0){
362
-
363
- if ( is_numeric($field_options['ID']))
364
- {
365
- $acf_fields = get_posts(array('posts_per_page' => -1, 'post_type' => 'acf-field', 'post_parent' => $field_options['ID'], 'post_status' => 'publish', 'orderby' => 'menu_order', 'order' => 'ASC'));
366
-
367
- if ( ! empty($acf_fields) )
368
- {
369
- $repeater_sub_field_names = array();
370
-
371
- foreach ($acf_fields as $field) {
372
-
373
- $sub_name = $element_name . '_' . $field->post_excerpt;
374
-
375
- if ( ! in_array($sub_name, $acfs) and ! in_array($sub_name, $repeater_sub_field_names)) $repeater_sub_field_names[] = $sub_name;
376
-
377
- }
378
-
379
- if ( ! empty($repeater_sub_field_names)) $acfs[] = $repeater_sub_field_names;
380
- }
381
- }
382
- else
383
- {
384
- $acf_fields = acf_local()->fields;
385
-
386
- if ( ! empty($acf_fields) )
387
- {
388
- $repeater_sub_field_names = array();
389
-
390
- foreach ($acf_fields as $field_key => $field)
391
- {
392
- if ($field['parent'] == $field_options['key'])
393
- {
394
- $sub_name = $element_name . '_' . $field['name'];
395
-
396
- if ( ! in_array($sub_name, $acfs) and ! in_array($sub_name, $repeater_sub_field_names)) $repeater_sub_field_names[] = $sub_name;
397
- }
398
- }
399
-
400
- if ( ! empty($repeater_sub_field_names)) $acfs[] = $repeater_sub_field_names;
401
- }
402
- }
403
- }
404
- else
405
- {
406
- if ( ! empty($field_options['sub_fields']))
407
- {
408
- $repeater_sub_field_names = array();
409
-
410
- foreach ($field_options['sub_fields'] as $n => $sub_field)
411
- {
412
- $sub_name = $element_name . '_' . $sub_field['name'];
413
-
414
- if ( ! in_array($sub_name, $acfs) and ! in_array($sub_name, $repeater_sub_field_names)) $repeater_sub_field_names[] = $sub_name;
415
- }
416
- if ( ! empty($repeater_sub_field_names)) $acfs[] = $repeater_sub_field_names;
417
- }
418
- }
419
-
420
- break;
421
-
422
- case 'google_map':
423
- case 'location-field':
424
-
425
- $acfs[] = array($element_name . '_address', $element_name . '_lat', $element_name . '_lng');
426
-
427
- break;
428
- case 'paypal_item':
429
-
430
- $acfs[] = array($element_name . '_item_name', $element_name . '_item_description', $element_name . '_price');
431
-
432
- break;
433
-
434
- default:
435
-
436
- $val = apply_filters('pmxe_acf_field', pmxe_filter( ( ! empty($field_value) ) ? maybe_serialize($field_value) : '', $fieldSnipped), $field_name, $recordID);
437
- $article[$element_name] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($val))) : $val;
438
- $acfs[] = $element_name;
439
-
440
- break;
441
-
442
- }
443
-
444
- }
445
- }
446
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
helpers/pmxe_export_acf_field_xml.php DELETED
@@ -1,354 +0,0 @@
1
- <?php
2
-
3
- function pmxe_export_acf_field_xml($field_value, $exportOptions, $ID, $recordID, &$xmlWriter, $element_name = '', $element_name_ns = '', $fieldSnipped = '', $group_id = ''){
4
-
5
- if ( ! empty($field_value) ) {
6
-
7
- global $acf;
8
-
9
- $field_value = maybe_unserialize($field_value);
10
-
11
- $field_name = ($ID) ? $exportOptions['cc_label'][$ID] : $exportOptions['name'];
12
-
13
- $field_options = ($ID) ? unserialize($exportOptions['cc_options'][$ID]) : $exportOptions;
14
-
15
- //$element_name = 'acf_' . $element_name;
16
-
17
- $put_to_xml = true;
18
-
19
- // switch ACF field type
20
- switch ($field_options['type']) {
21
-
22
- case 'date_time_picker':
23
- case 'date_picker':
24
-
25
- $field_value = date('Ymd', strtotime($field_value));
26
-
27
- break;
28
-
29
- case 'file':
30
- case 'image':
31
-
32
- if (is_numeric($field_value)){
33
- $field_value = wp_get_attachment_url($field_value);
34
- }
35
- elseif(is_array($field_value)){
36
- $field_value = $field_value['url'];
37
- }
38
-
39
- break;
40
-
41
- case 'gallery':
42
-
43
- $v = array();
44
- foreach ($field_value as $key => $item) {
45
- $v[] = $item['url'];
46
- }
47
- $field_value = implode(",", $v);
48
-
49
- break;
50
- case 'location-field':
51
-
52
- $localion_parts = explode("|", $field_value);
53
-
54
- if (!empty($localion_parts)){
55
-
56
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
57
- $xmlWriter->startElement('address');
58
- $xmlWriter->writeData($localion_parts[0]);
59
- $xmlWriter->endElement();
60
-
61
- if (!empty($localion_parts[1])){
62
- $coordinates = explode(",", $localion_parts[1]);
63
- if (!empty($coordinates)){
64
- $xmlWriter->startElement('lat');
65
- $xmlWriter->writeData($coordinates[0]);
66
- $xmlWriter->endElement();
67
- $xmlWriter->startElement('lng');
68
- $xmlWriter->writeData($coordinates[1]);
69
- $xmlWriter->endElement();
70
- }
71
- }
72
- $xmlWriter->endElement();
73
-
74
- }
75
-
76
- $put_to_xml = false;
77
-
78
- break;
79
- case 'paypal_item':
80
-
81
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
82
- if ( is_array($field_value) ){
83
- foreach ($field_value as $key => $value) {
84
- $xmlWriter->beginElement($element_name_ns, $key, null);
85
- $xmlWriter->writeData($value);
86
- $xmlWriter->endElement();
87
- }
88
- }
89
- $xmlWriter->endElement();
90
-
91
- $put_to_xml = false;
92
-
93
- break;
94
- case 'google_map':
95
-
96
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
97
- $xmlWriter->startElement('address');
98
- $xmlWriter->writeData($field_value['address']);
99
- $xmlWriter->endElement();
100
- $xmlWriter->startElement('lat');
101
- $xmlWriter->writeData($field_value['lat']);
102
- $xmlWriter->endElement();
103
- $xmlWriter->startElement('lng');
104
- $xmlWriter->writeData($field_value['lng']);
105
- $xmlWriter->endElement();
106
- $xmlWriter->endElement();
107
-
108
- $put_to_xml = false;
109
-
110
- break;
111
-
112
- case 'acf_cf7':
113
- case 'gravity_forms_field':
114
-
115
- if ( ! empty($field_options['multiple']) )
116
- $field_value = implode(",", $field_value);
117
-
118
- break;
119
-
120
- case 'page_link':
121
-
122
- if (is_array($field_value))
123
- $field_value = implode(",", $field_value);
124
-
125
- break;
126
- case 'post_object':
127
-
128
- if ( ! empty($field_options['multiple'])){
129
- $v = array();
130
- foreach ($field_value as $key => $pid) {
131
-
132
- if (is_numeric($pid)){
133
- $entry = get_post($pid);
134
- if ($entry)
135
- {
136
- $v[] = $entry->post_name;
137
- }
138
- }
139
- else{
140
- $v[] = $pid->post_name;
141
- }
142
- }
143
- $field_value = implode(",", $v);
144
- }
145
- else{
146
- if (is_numeric($field_value)){
147
- $entry = get_post($field_value);
148
- if ($entry)
149
- {
150
- $field_value = $entry->post_name;
151
- }
152
- }
153
- else{
154
- $field_value = $field_value->post_name;
155
- }
156
- }
157
-
158
- break;
159
- case 'relationship':
160
-
161
- $v = array();
162
- foreach ($field_value as $key => $pid) {
163
- $entry = get_post($pid);
164
- if ($entry)
165
- {
166
- $v[] = $entry->post_title;
167
- }
168
- }
169
- $field_value = implode(",", $v);
170
-
171
- break;
172
- case 'user':
173
-
174
- if ( ! empty($field_options['multiple'])){
175
- $v = array();
176
- foreach ($field_value as $key => $user) {
177
- if (is_numeric($user)){
178
- $entry = get_user_by('ID', $user);
179
- if ($entry)
180
- {
181
- $v[] = $entry->user_email;
182
- }
183
- }
184
- else{
185
- $v[] = $user['user_email'];
186
- }
187
- }
188
- $field_value = implode(",", $v);
189
- }
190
- else{
191
- if (is_numeric($field_value)){
192
- $entry = get_user_by('ID', $field_value);
193
- if ($entry)
194
- {
195
- $field_value = $entry->user_email;
196
- }
197
- }
198
- else{
199
- $field_value = $field_value['user_email'];
200
- }
201
- }
202
-
203
- break;
204
- case 'taxonomy':
205
-
206
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
207
-
208
- if ( ! in_array($field_options['field_type'], array('radio', 'select'))){
209
- foreach ($field_value as $key => $tid) {
210
- $entry = get_term($tid , $field_options['taxonomy']);
211
- if ($entry and !is_wp_error($entry))
212
- {
213
- $xmlWriter->startElement('term');
214
- $xmlWriter->writeData($entry->name);
215
- $xmlWriter->endElement();
216
- }
217
- }
218
- }
219
- else{
220
- $entry = get_term($field_value, $field_options['taxonomy']);
221
- if ($entry)
222
- {
223
- $xmlWriter->startElement('term');
224
- $xmlWriter->writeData($entry->name);
225
- $xmlWriter->endElement();
226
- }
227
- }
228
-
229
- $xmlWriter->endElement();
230
-
231
- $put_to_xml = false;
232
-
233
- break;
234
- case 'select':
235
-
236
- if ( ! empty($field_options['multiple'])){
237
- $field_value = implode(",", $field_value);
238
- }
239
-
240
- break;
241
- case 'checkbox':
242
-
243
- $field_value = implode(",", $field_value);
244
-
245
- //var_dump($field_value);
246
-
247
- break;
248
-
249
- case 'repeater':
250
-
251
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
252
-
253
- if( have_rows($field_name, $recordID) ):
254
-
255
- while( have_rows($field_name, $recordID) ):
256
-
257
- the_row();
258
-
259
- $row = XmlExportACF::acf_get_row();
260
-
261
- $xmlWriter->startElement('row');
262
-
263
- foreach ($row['field']['sub_fields'] as $sub_field) {
264
-
265
- if ($acf and version_compare($acf->settings['version'], '5.0.0') >= 0)
266
- {
267
- // get
268
- $v = acf_format_value($row['value'][ $row['i'] ][ $sub_field['key'] ], $row['post_id'], $sub_field);
269
- }
270
- else
271
- {
272
- $v = get_sub_field($sub_field['name']);
273
- }
274
-
275
- pmxe_export_acf_field_xml($v, $sub_field, false, $recordID, $xmlWriter, $sub_field['name'], $element_name_ns, '', '');
276
-
277
- }
278
-
279
- $xmlWriter->endElement();
280
-
281
- endwhile;
282
-
283
- endif;
284
-
285
- $xmlWriter->endElement();
286
-
287
- $put_to_xml = false;
288
-
289
- break;
290
-
291
- case 'flexible_content':
292
-
293
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
294
-
295
- // check if the flexible content field has rows of data
296
- if( have_rows($field_name) ):
297
-
298
- // loop through the rows of data
299
- while ( have_rows($field_name) ) : the_row();
300
-
301
- $row = XmlExportACF::acf_get_row();
302
-
303
- foreach ($row['field']['layouts'] as $layout) {
304
-
305
- if ($layout['name'] == $row['value'][ $row['i'] ]['acf_fc_layout']){
306
-
307
- $xmlWriter->startElement($row['value'][ $row['i'] ]['acf_fc_layout'] . '_' . $row['i']);
308
-
309
- foreach ($layout['sub_fields'] as $sub_field) {
310
-
311
- if (isset($row['value'][ $row['i'] ][ $sub_field['key'] ])){
312
- // get
313
- $v = acf_format_value($row['value'][ $row['i'] ][ $sub_field['key'] ], $row['post_id'], $sub_field);
314
-
315
- pmxe_export_acf_field_xml($v, $sub_field, false, $recordID, $xmlWriter, $sub_field['name'], $element_name_ns, '', '');
316
- }
317
-
318
- }
319
-
320
- $xmlWriter->endElement();
321
- }
322
-
323
- }
324
-
325
- endwhile;
326
-
327
- else :
328
-
329
- // no layouts found
330
-
331
- endif;
332
-
333
- $xmlWriter->endElement();
334
-
335
- $put_to_xml = false;
336
-
337
- break;
338
-
339
- default:
340
-
341
- break;
342
- }
343
-
344
- if ($put_to_xml){
345
-
346
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
347
- $xmlWriter->writeData(apply_filters('pmxe_acf_field', pmxe_filter( maybe_serialize($field_value), $fieldSnipped), $field_name, $recordID));
348
- $xmlWriter->endElement();
349
-
350
- }
351
-
352
- }
353
-
354
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
helpers/pmxe_export_csv.php DELETED
@@ -1,641 +0,0 @@
1
- <?php
2
- /**
3
- * Export CSV helper
4
- */
5
- function pmxe_export_csv($exportQuery, $exportOptions, $preview = false, $is_cron = false, $file_path = false, $exported_by_cron = 0){
6
-
7
- ob_start();
8
-
9
- // Prepare headers
10
-
11
- $headers = array();
12
-
13
- $stream = fopen("php://output", 'w');
14
-
15
- $max_attach_count = 0;
16
- $max_images_count = 0;
17
-
18
- $cf = array();
19
- $woo = array();
20
- $woo_order = array();
21
- $acfs = array();
22
- $taxes = array();
23
- $attributes = array();
24
- $articles = array();
25
-
26
- $implode_delimiter = ($exportOptions['delimiter'] == ',') ? '|' : ',';
27
-
28
- while ( $exportQuery->have_posts() ) :
29
-
30
- $attach_count = 0;
31
- $images_count = 0;
32
-
33
- $exportQuery->the_post();
34
-
35
- $record = get_post( get_the_ID() );
36
-
37
- $article = array();
38
-
39
- $article['post_type'] = $record->post_type;
40
- $article['ID'] = apply_filters('pmxe_post_id', get_the_ID());
41
- $article['permalink'] = get_permalink();
42
-
43
- global $wpdb;
44
- $table_prefix = $wpdb->prefix;
45
-
46
- if ($exportOptions['ids']):
47
-
48
- if ( wp_all_export_is_compatible() and $exportOptions['is_generate_import'] and $exportOptions['import_id']){
49
- $postRecord = new PMXI_Post_Record();
50
- $postRecord->clear();
51
- $postRecord->getBy(array(
52
- 'post_id' => $record->ID,
53
- 'import_id' => $exportOptions['import_id'],
54
- ));
55
-
56
- if ($postRecord->isEmpty()){
57
- $postRecord->set(array(
58
- 'post_id' => $record->ID,
59
- 'import_id' => $exportOptions['import_id'],
60
- 'unique_key' => $record->ID,
61
- 'product_key' => $record->ID
62
- ))->save();
63
- }
64
- unset($postRecord);
65
- }
66
-
67
- foreach ($exportOptions['ids'] as $ID => $value) {
68
-
69
- if (is_numeric($ID)){
70
-
71
- if ( empty($exportOptions['cc_name'][$ID]) or empty($exportOptions['cc_type'][$ID]) ) continue;
72
-
73
- $element_name = ( ! empty($exportOptions['cc_name'][$ID]) ) ? $exportOptions['cc_name'][$ID] : 'untitled_' . $ID;
74
- $fieldSnipped = ( ! empty($exportOptions['cc_php'][$ID] ) and ! empty($exportOptions['cc_code'][$ID])) ? $exportOptions['cc_code'][$ID] : false;
75
-
76
- switch ($exportOptions['cc_type'][$ID]){
77
- case 'id':
78
- $article[$element_name] = apply_filters('pmxe_post_id', pmxe_filter(get_the_ID(), $fieldSnipped), get_the_ID());
79
- break;
80
- case 'permalink':
81
- $article[$element_name] = apply_filters('pmxe_post_guid', pmxe_filter(get_permalink(), $fieldSnipped), get_the_ID());
82
- break;
83
- case 'post_type':
84
- $pType = get_post_type();
85
- if ($pType == 'product_variation') $pType = 'product';
86
- $article[$element_name] = apply_filters('pmxe_post_type', pmxe_filter($pType, $fieldSnipped), get_the_ID());
87
- break;
88
- case 'title':
89
- $article[$element_name] = apply_filters('pmxe_post_title', pmxe_filter($record->post_title, $fieldSnipped), get_the_ID());
90
- break;
91
- case 'content':
92
- $val = apply_filters('pmxe_post_content', pmxe_filter($record->post_content, $fieldSnipped), get_the_ID());
93
- $article[$element_name] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($val))) : $val;
94
- break;
95
- case 'media':
96
-
97
- $attachment_ids = array();
98
-
99
- $_featured_image = get_post_meta(get_the_ID(), '_thumbnail_id', true);
100
-
101
- if ( ! empty($_featured_image)) $attachment_ids[] = $_featured_image;
102
-
103
- $_gallery = get_post_meta(get_the_ID(), '_product_image_gallery', true);
104
-
105
- if (!empty($_gallery)){
106
- $gallery = explode(',', $_gallery);
107
- if (!empty($gallery) and is_array($gallery)){
108
- foreach ($gallery as $aid) {
109
- if (!in_array($aid, $attachment_ids)) $attachment_ids[] = $aid;
110
- }
111
- }
112
- }
113
-
114
- $attachment_imgs = get_posts( array(
115
- 'post_type' => 'attachment',
116
- 'posts_per_page' => -1,
117
- 'post_parent' => $record->ID,
118
- ) );
119
-
120
- if ( ! empty($attachment_imgs)):
121
-
122
- foreach ($attachment_imgs as $attach) {
123
- if ( wp_attachment_is_image( $attach->ID ) and ! in_array($attach->ID, $attachment_ids)){
124
- $attachment_ids[] = $attach->ID;
125
- }
126
- }
127
-
128
- endif;
129
-
130
- if ( ! empty($attachment_ids)):
131
- $img_urls = array();
132
- $img_titles = array();
133
- $img_captions = array();
134
- $img_alts = array();
135
- $img_descriptions = array();
136
- foreach ($attachment_ids as $key => $attach_id) {
137
-
138
- $attach = get_post($attach_id);
139
-
140
- if ( $attach and ! is_wp_error($attach) and wp_attachment_is_image( $attach->ID ) ){
141
-
142
- $val = wp_get_attachment_url( $attach->ID );
143
-
144
- if (!empty($exportOptions['cc_options'][$ID])){
145
- switch ($exportOptions['cc_options'][$ID]) {
146
- case 'filenames':
147
- $val = basename(wp_get_attachment_url( $attach->ID ));
148
- break;
149
- case 'filepaths':
150
- $val = get_attached_file( $attach->ID );
151
- break;
152
-
153
- default:
154
- # code...
155
- break;
156
- }
157
- }
158
-
159
- $img_urls[] = apply_filters('pmxe_attachment_url', $val, get_the_ID(), $attach->ID);
160
- $img_titles[] = apply_filters('pmxe_attachment_title', $attach->post_title, get_the_ID(), $attach->ID);
161
- $img_captions[] = apply_filters('pmxe_attachment_caption', $attach->post_excerpt, get_the_ID(), $attach->ID);
162
- $img_descriptions[] = apply_filters('pmxe_attachment_content', $attach->post_content, get_the_ID(), $attach->ID);
163
- $img_alts[] = apply_filters('pmxe_attachment_alt', get_post_meta($attach->ID, '_wp_attachment_image_alt', true), get_the_ID(), $attach->ID);
164
-
165
- $images_count++;
166
- }
167
- }
168
- if (! empty($img_urls))
169
- $article[$element_name . '_images'] = implode($implode_delimiter, $img_urls);
170
-
171
- if (!empty($img_titles)) $article[$element_name. '_titles'] = implode($implode_delimiter, $img_titles);
172
- if (!empty($img_captions)) $article[$element_name . '_captions'] = implode($implode_delimiter, $img_captions);
173
- if (!empty($img_alts)) $article[$element_name . '_alts'] = implode($implode_delimiter, $img_alts);
174
- if (!empty($img_descriptions)) $article[$element_name . '_descriptions'] = implode($implode_delimiter, $img_descriptions);
175
-
176
- if ($max_images_count > $images_count) $max_images_count = $images_count;
177
-
178
- endif;
179
-
180
- break;
181
-
182
- case 'date':
183
-
184
- if (!empty($exportOptions['cc_options'][$ID])){
185
- switch ($exportOptions['cc_options'][$ID]) {
186
- case 'unix':
187
- $post_date = get_post_time('U', true);
188
- break;
189
- default:
190
- $post_date = date($exportOptions['cc_options'][$ID], get_post_time('U', true));
191
- break;
192
- }
193
- }
194
- else{
195
- $post_date = date("Ymd", get_post_time('U', true));
196
- }
197
-
198
- $article[$element_name] = apply_filters('pmxe_post_date', pmxe_filter($post_date, $fieldSnipped), get_the_ID());
199
-
200
- break;
201
-
202
- case 'attachments':
203
-
204
- $attachment_imgs = get_posts( array(
205
- 'post_type' => 'attachment',
206
- 'posts_per_page' => -1,
207
- 'post_parent' => $record->ID,
208
- ) );
209
-
210
- if ( ! empty($attachment_imgs)):
211
- $attachment_urls = array();
212
- foreach ($attachment_imgs as $key => $attach) {
213
- if ( ! wp_attachment_is_image( $attach->ID ) ){
214
- $attachment_urls[] = apply_filters('pmxe_attachment_url', pmxe_filter(wp_get_attachment_url( $attach->ID ), $fieldSnipped), get_the_ID(), $attach->ID);
215
- $attach_count++;
216
- }
217
- }
218
- if (!empty($attachment_urls)) $article[$element_name . '_attachments'] = implode($implode_delimiter, $attachment_urls);
219
-
220
- if ($attach_count > $max_attach_count) $max_attach_count = $attach_count;
221
-
222
- endif;
223
-
224
- break;
225
-
226
- case 'parent':
227
-
228
- $article[$element_name] = apply_filters('pmxe_post_parent', pmxe_filter($record->post_parent, $fieldSnipped), get_the_ID());
229
-
230
- break;
231
-
232
- case 'comment_status':
233
-
234
- $article[$element_name] = apply_filters('pmxe_comment_status', pmxe_filter($record->comment_status, $fieldSnipped), get_the_ID());
235
-
236
- break;
237
-
238
- case 'ping_status':
239
-
240
- $article[$element_name] = apply_filters('pmxe_ping_status', pmxe_filter($record->ping_status, $fieldSnipped), get_the_ID());
241
-
242
- break;
243
-
244
- case 'template':
245
-
246
- $article[$element_name] = apply_filters('pmxe_post_template', pmxe_filter(get_post_meta($record->ID, '_wp_page_template', true), $fieldSnipped), get_the_ID());
247
-
248
- break;
249
-
250
- case 'order':
251
-
252
- $article[$element_name] = apply_filters('pmxe_menu_order', pmxe_filter($record->menu_order, $fieldSnipped), get_the_ID());
253
-
254
- break;
255
-
256
- case 'status':
257
-
258
- $article[$element_name] = apply_filters('pmxe_post_status', pmxe_filter($record->post_status, $fieldSnipped), get_the_ID());
259
-
260
- break;
261
-
262
- case 'format':
263
-
264
- $article[$element_name] = apply_filters('pmxe_post_format', pmxe_filter(get_post_format($record->ID), $fieldSnipped), get_the_ID());
265
-
266
- break;
267
-
268
- case 'author':
269
-
270
- $article[$element_name] = apply_filters('pmxe_post_author', pmxe_filter($record->post_author, $fieldSnipped), get_the_ID());
271
-
272
- break;
273
-
274
- case 'slug':
275
-
276
- $article[$element_name] = apply_filters('pmxe_post_slug', pmxe_filter($record->post_name, $fieldSnipped), get_the_ID());
277
-
278
- break;
279
-
280
- case 'excerpt':
281
-
282
- $val = apply_filters('pmxe_post_excerpt', pmxe_filter($record->post_excerpt, $fieldSnipped), get_the_ID());
283
- $article[$element_name] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($val))) : $val;
284
-
285
- break;
286
-
287
- case 'cf':
288
- if ( ! empty($exportOptions['cc_value'][$ID]) ){
289
- $cur_meta_values = get_post_meta($record->ID, $exportOptions['cc_value'][$ID]);
290
- if (!empty($cur_meta_values) and is_array($cur_meta_values)){
291
- foreach ($cur_meta_values as $key => $cur_meta_value) {
292
- if (empty($article[$element_name])){
293
- $article[$element_name] = apply_filters('pmxe_custom_field', pmxe_filter(maybe_serialize($cur_meta_value), $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID());
294
- if (!in_array($element_name, $cf)) $cf[] = $element_name;
295
- }
296
- else{
297
- $article[$element_name] = apply_filters('pmxe_custom_field', pmxe_filter($article[$element_name] . $implode_delimiter . maybe_serialize($cur_meta_value), $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID());
298
- }
299
- }
300
- }
301
-
302
- if (empty($cur_meta_values)){
303
- if (empty($article[$element_name])){
304
- $article[$element_name] = apply_filters('pmxe_custom_field', pmxe_filter('', $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID());
305
- if (!in_array($element_name, $cf)) $cf[] = $element_name;
306
- }
307
- // else{
308
- // $article[$element_name . '_' . $key] = apply_filters('pmxe_custom_field', pmxe_filter('', $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID());
309
- // if (!in_array($element_name . '_' . $key, $cf)) $cf[] = $element_name . '_' . $key;
310
- // }
311
- }
312
- }
313
- break;
314
-
315
- case 'acf':
316
-
317
- if ( ! empty($exportOptions['cc_label'][$ID]) and class_exists( 'acf' ) ){
318
-
319
- global $acf;
320
-
321
- $field_options = unserialize($exportOptions['cc_options'][$ID]);
322
-
323
- switch ($field_options['type']) {
324
- case 'textarea':
325
- case 'oembed':
326
- case 'wysiwyg':
327
- case 'wp_wysiwyg':
328
- case 'date_time_picker':
329
- case 'date_picker':
330
-
331
- $field_value = get_field($exportOptions['cc_label'][$ID], $record->ID, false);
332
-
333
- break;
334
-
335
- default:
336
-
337
- $field_value = get_field($exportOptions['cc_label'][$ID], $record->ID);
338
-
339
- break;
340
- }
341
-
342
- pmxe_export_acf_field_csv($field_value, $exportOptions, $ID, $record->ID, $article, $acfs, $element_name, $fieldSnipped, $field_options['group_id'], $preview);
343
-
344
- }
345
-
346
- break;
347
-
348
- case 'woo':
349
-
350
- XmlExportWooCommerce::getInstance()->export_csv($article, $woo, $record, $exportOptions, $ID);
351
-
352
- break;
353
-
354
- case 'woo_order':
355
-
356
- XmlExportWooCommerceOrder::getInstance()->export_csv($article, $woo_order, $record, $exportOptions, $ID);
357
-
358
- break;
359
-
360
- case 'attr':
361
-
362
- if ( ! empty($exportOptions['cc_value'][$ID])){
363
- if ($record->post_parent == 0){
364
- $txes_list = get_the_terms($record->ID, $exportOptions['cc_value'][$ID]);
365
- if ( ! is_wp_error($txes_list) and ! empty($txes_list)) {
366
- $attr_new = array();
367
- foreach ($txes_list as $t) {
368
- $attr_new[] = $t->name;
369
- }
370
- $article[$element_name] = apply_filters('pmxe_woo_attribute', pmxe_filter(implode($implode_delimiter, $attr_new), $fieldSnipped), get_the_ID(), $exportOptions['cc_value'][$ID]);
371
- }
372
- if ( ! in_array($element_name, $attributes)) $attributes[] = $element_name;
373
- }
374
- else
375
- {
376
- $attribute_pa = apply_filters('pmxe_woo_attribute', get_post_meta($record->ID, 'attribute_' . $exportOptions['cc_value'][$ID], true), get_the_ID(), $exportOptions['cc_value'][$ID]);
377
- $article['attribute_' . $element_name] = $attribute_pa;
378
- if ( ! in_array('attribute_' . $element_name, $attributes)) $attributes[] = 'attribute_' . $element_name;
379
- }
380
- }
381
- break;
382
-
383
- case 'cats':
384
- if ( ! empty($exportOptions['cc_value'][$ID]) ){
385
- $article[$element_name] = '';
386
- $txes_list = get_the_terms($record->ID, $exportOptions['cc_value'][$ID]);
387
- if ( ! is_wp_error($txes_list) and ! empty($txes_list) ) {
388
-
389
- $txes_ids = array();
390
- $hierarchy_groups = array();
391
-
392
- foreach ($txes_list as $t) {
393
- $txes_ids[] = $t->term_id;
394
- }
395
-
396
- foreach ($txes_list as $t) {
397
- if ( wp_all_export_check_children_assign($t->term_id, $exportOptions['cc_value'][$ID], $txes_ids) ){
398
- $ancestors = get_ancestors( $t->term_id, $exportOptions['cc_value'][$ID] );
399
- if (count($ancestors) > 0){
400
- $hierarchy_group = array();
401
- for ( $i = count($ancestors) - 1; $i >= 0; $i-- ) {
402
- $term = get_term_by('id', $ancestors[$i], $exportOptions['cc_value'][$ID]);
403
- if ($term){
404
- $hierarchy_group[] = $term->name;
405
- }
406
- }
407
- $hierarchy_group[] = $t->name;
408
- $hierarchy_groups[] = implode('>', $hierarchy_group);
409
- }
410
- else{
411
- $hierarchy_groups[] = $t->name;
412
- }
413
- }
414
- }
415
-
416
- if ( ! empty($hierarchy_groups) ){
417
- $article[$element_name] = apply_filters('pmxe_post_taxonomy', pmxe_filter(implode($implode_delimiter, $hierarchy_groups), $fieldSnipped), get_the_ID());
418
- }
419
-
420
- }
421
-
422
- if ( ! in_array($element_name, $taxes)) $taxes[] = $element_name;
423
-
424
- if ($exportOptions['cc_label'][$ID] == 'product_type' and get_post_type() == 'product_variation'){
425
-
426
- $article[$element_name] = 'variable';
427
-
428
- }
429
-
430
- if ($exportOptions['cc_label'][$ID] == 'product_type') $article['parent_id'] = $record->post_parent;
431
- //if ( ! in_array('parent_sku', $taxes)) $taxes[] = 'parent_sku';
432
-
433
- }
434
- break;
435
-
436
- case 'sql':
437
- if ( ! empty($exportOptions['cc_sql'][$ID]) ) {
438
- $val = $wpdb->get_var( $wpdb->prepare( stripcslashes(str_replace("%%ID%%", "%d", $exportOptions['cc_sql'][$ID])), get_the_ID() ));
439
- if ( ! empty($exportOptions['cc_php'][$ID]) and !empty($exportOptions['cc_code'][$ID]) ){
440
- // if shortcode defined
441
- if (strpos($exportOptions['cc_code'][$ID], '[') === 0){
442
- $val = do_shortcode(str_replace("%%VALUE%%", $val, $exportOptions['cc_code'][$ID]));
443
- }
444
- else{
445
- $val = eval('return ' . stripcslashes(str_replace("%%VALUE%%", $val, $exportOptions['cc_code'][$ID])) . ';');
446
- }
447
- }
448
- $article[$element_name] = apply_filters('pmxe_sql_field', $val, $element_name, get_the_ID());
449
- }
450
- break;
451
-
452
- default:
453
- # code...
454
- break;
455
- }
456
- }
457
- }
458
- endif;
459
-
460
- $articles[] = $article;
461
-
462
- $articles = apply_filters('wp_all_export_csv_rows', $articles, $exportOptions);
463
-
464
- if ($preview) break;
465
-
466
- do_action('pmxe_exported_post', $record->ID );
467
-
468
- endwhile;
469
-
470
- if ($exportOptions['ids']):
471
-
472
- foreach ($exportOptions['ids'] as $ID => $value) {
473
-
474
- if (is_numeric($ID)){
475
-
476
- if (empty($exportOptions['cc_name'][$ID]) or empty($exportOptions['cc_type'][$ID])) continue;
477
-
478
- $element_name = ( ! empty($exportOptions['cc_name'][$ID]) ) ? $exportOptions['cc_name'][$ID] : 'untitled_' . $ID;
479
-
480
- switch ($exportOptions['cc_type'][$ID]) {
481
- case 'media':
482
-
483
- $headers[] = $element_name . '_images';
484
- $headers[] = $element_name . '_titles';
485
- $headers[] = $element_name . '_captions';
486
- $headers[] = $element_name . '_descriptions';
487
- $headers[] = $element_name . '_alts';
488
-
489
- break;
490
-
491
- case 'attachments':
492
-
493
- $headers[] = $element_name . '_attachments';
494
-
495
- break;
496
- case 'cats':
497
- if ( ! empty($taxes) )
498
- {
499
-
500
- $tx = array_shift($taxes);
501
- $headers[] = $tx;
502
-
503
- if ( $exportOptions['cc_label'][$ID] == 'product_type' ) $headers[] = 'parent_id';
504
-
505
- }
506
- break;
507
- case 'attr':
508
- if ( ! empty($attributes) ){
509
- $headers[] = array_shift($attributes);
510
- if (in_array('attribute_' . $element_name, $attributes)) {
511
- $headers[] = 'attribute_' . $element_name;
512
- foreach ($attributes as $akey => $avalue) {
513
- if ($avalue == 'attribute_' . $element_name){
514
- unset($attributes[$akey]);
515
- break;
516
- }
517
- }
518
- }
519
- }
520
- break;
521
- case 'cf':
522
-
523
- if ( ! empty($cf) ){
524
- $headers[] = array_shift($cf);
525
- }
526
-
527
- break;
528
- case 'woo':
529
-
530
- XmlExportWooCommerce::getInstance()->get_element_header( $headers, $exportOptions, $ID );
531
-
532
- break;
533
-
534
- case 'woo_order':
535
-
536
- XmlExportWooCommerceOrder::getInstance()->get_element_header( $headers, $exportOptions, $ID );
537
-
538
- break;
539
-
540
- case 'acf':
541
-
542
- if ( ! empty($acfs) ){
543
- $single_acf_field = array_shift($acfs);
544
- if ( is_array($single_acf_field))
545
- {
546
- foreach ($single_acf_field as $acf_header) {
547
- $headers[] = $acf_header;
548
- }
549
- }
550
- else
551
- {
552
- $headers[] = $single_acf_field;
553
- }
554
- }
555
-
556
- break;
557
-
558
- default:
559
- $headers[] = $element_name;
560
- break;
561
- }
562
-
563
- }
564
- }
565
-
566
- endif;
567
-
568
- if ($is_cron)
569
- {
570
- if ( ! $exported_by_cron ) fputcsv($stream, $headers, $exportOptions['delimiter']);
571
- }
572
- else
573
- {
574
- if ($preview or empty(PMXE_Plugin::$session->file)) fputcsv($stream, $headers, $exportOptions['delimiter']);
575
- }
576
-
577
-
578
- foreach ($articles as $article) {
579
- $line = array();
580
- foreach ($headers as $header) {
581
- $line[$header] = ( isset($article[$header]) ) ? $article[$header] : '';
582
- }
583
- fputcsv($stream, $line, $exportOptions['delimiter']);
584
-
585
- }
586
-
587
- if ($preview) return ob_get_clean();
588
-
589
- if ($is_cron)
590
- {
591
- if ( ! $exported_by_cron )
592
- {
593
- // The BOM will help some programs like Microsoft Excel read your export file if it includes non-English characters.
594
- if ($exportOptions['include_bom'])
595
- {
596
- file_put_contents($file_path, chr(0xEF).chr(0xBB).chr(0xBF).ob_get_clean());
597
- }
598
- else
599
- {
600
- file_put_contents($file_path, ob_get_clean());
601
- }
602
- }
603
- else
604
- {
605
- file_put_contents($file_path, ob_get_clean(), FILE_APPEND);
606
- }
607
-
608
- return $file_path;
609
-
610
- }
611
- else
612
- {
613
- if ( empty(PMXE_Plugin::$session->file) ){
614
-
615
- // generate export file name
616
- $export_file = wp_all_export_generate_export_file( XmlExportEngine::$exportID );
617
-
618
- // The BOM will help some programs like Microsoft Excel read your export file if it includes non-English characters.
619
- if ($exportOptions['include_bom'])
620
- {
621
- file_put_contents($export_file, chr(0xEF).chr(0xBB).chr(0xBF).ob_get_clean());
622
- }
623
- else
624
- {
625
- file_put_contents($export_file, ob_get_clean());
626
- }
627
-
628
- PMXE_Plugin::$session->set('file', $export_file);
629
-
630
- PMXE_Plugin::$session->save_data();
631
-
632
- }
633
- else
634
- {
635
- file_put_contents(PMXE_Plugin::$session->file, ob_get_clean(), FILE_APPEND);
636
- }
637
-
638
- return true;
639
- }
640
-
641
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
helpers/pmxe_export_xml.php DELETED
@@ -1,513 +0,0 @@
1
- <?php
2
- // Export XML helper
3
- function pmxe_export_xml($exportQuery, $exportOptions, $preview = false, $is_cron = false, $file_path = false, $exported_by_cron = 0){
4
-
5
- require_once PMXE_ROOT_DIR . '/classes/XMLWriter.php';
6
-
7
- $xmlWriter = new PMXE_XMLWriter();
8
- $xmlWriter->openMemory();
9
- $xmlWriter->setIndent(true);
10
- $xmlWriter->setIndentString("\t");
11
- $xmlWriter->startDocument('1.0', $exportOptions['encoding']);
12
- $xmlWriter->startElement($exportOptions['main_xml_tag']);
13
-
14
- if ($is_cron)
15
- {
16
- if ( ! $exported_by_cron )
17
- {
18
- $additional_data = apply_filters('wp_all_export_additional_data', array(), $exportOptions);
19
-
20
- if ( ! empty($additional_data))
21
- {
22
- foreach ($additional_data as $key => $value)
23
- {
24
- $xmlWriter->startElement(preg_replace('/[^a-z0-9_-]/i', '', $key));
25
- $xmlWriter->writeData($value);
26
- $xmlWriter->endElement();
27
- }
28
- }
29
- }
30
- }
31
- else
32
- {
33
-
34
- if ( empty(PMXE_Plugin::$session->file) ){
35
-
36
- $additional_data = apply_filters('wp_all_export_additional_data', array(), $exportOptions);
37
-
38
- if ( ! empty($additional_data))
39
- {
40
- foreach ($additional_data as $key => $value)
41
- {
42
- $xmlWriter->startElement(preg_replace('/[^a-z0-9_-]/i', '', $key));
43
- $xmlWriter->writeData($value);
44
- $xmlWriter->endElement();
45
- }
46
- }
47
- }
48
- }
49
-
50
- global $wpdb;
51
-
52
- while ( $exportQuery->have_posts() ) :
53
-
54
- $exportQuery->the_post(); $record = get_post( get_the_ID() );
55
-
56
- $is_export_record = apply_filters('wp_all_export_xml_rows', true, $record, $exportOptions);
57
-
58
- if ( ! $is_export_record ) continue;
59
-
60
- $xmlWriter->startElement($exportOptions['record_xml_tag']);
61
-
62
- if ($exportOptions['ids']):
63
-
64
- if ( wp_all_export_is_compatible() and $exportOptions['is_generate_import'] and $exportOptions['import_id']){
65
- $postRecord = new PMXI_Post_Record();
66
- $postRecord->clear();
67
- $postRecord->getBy(array(
68
- 'post_id' => $record->ID,
69
- 'import_id' => $exportOptions['import_id'],
70
- ));
71
-
72
- if ($postRecord->isEmpty()){
73
- $postRecord->set(array(
74
- 'post_id' => $record->ID,
75
- 'import_id' => $exportOptions['import_id'],
76
- 'unique_key' => $record->ID,
77
- 'product_key' => $record->ID
78
- ))->save();
79
- }
80
- unset($postRecord);
81
- }
82
-
83
- foreach ($exportOptions['ids'] as $ID => $value) {
84
-
85
- if (is_numeric($ID)){
86
-
87
- if (empty($exportOptions['cc_name'][$ID]) or empty($exportOptions['cc_type'][$ID])) continue;
88
-
89
- $element_name_ns = '';
90
- $element_name = ( ! empty($exportOptions['cc_name'][$ID]) ) ? preg_replace('/[^a-z0-9_:-]/i', '', $exportOptions['cc_name'][$ID]) : 'untitled_' . $ID;
91
- $fieldSnipped = ( ! empty($exportOptions['cc_php'][$ID]) and ! empty($exportOptions['cc_code'][$ID]) ) ? $exportOptions['cc_code'][$ID] : false;
92
-
93
- if (strpos($element_name, ":") !== false)
94
- {
95
- $element_name_parts = explode(":", $element_name);
96
- $element_name_ns = (empty($element_name_parts[0])) ? '' : $element_name_parts[0];
97
- $element_name = (empty($element_name_parts[1])) ? 'untitled_' . $ID : preg_replace('/[^a-z0-9_-]/i', '', $element_name_parts[1]);
98
- }
99
-
100
- switch ($exportOptions['cc_type'][$ID]) {
101
- case 'id':
102
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_post_id', pmxe_filter(get_the_ID(), $fieldSnipped), get_the_ID()));
103
- break;
104
- case 'permalink':
105
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_post_guid', pmxe_filter(get_permalink(), $fieldSnipped), get_the_ID()));
106
- break;
107
- case 'post_type':
108
- $pType = get_post_type();
109
- if ($pType == 'product_variation') $pType = 'product';
110
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_post_type', pmxe_filter($pType, $fieldSnipped), get_the_ID()));
111
- break;
112
- case 'title':
113
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
114
- $xmlWriter->writeData(apply_filters('pmxe_post_title', pmxe_filter($record->post_title, $fieldSnipped) , get_the_ID()));
115
- $xmlWriter->endElement();
116
- break;
117
- case 'content':
118
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
119
- $xmlWriter->writeData(apply_filters('pmxe_post_content', pmxe_filter($record->post_content, $fieldSnipped), get_the_ID()));
120
- $xmlWriter->endElement();
121
- break;
122
- case 'media':
123
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
124
-
125
- $attachment_ids = array();
126
-
127
- $_featured_image = get_post_meta(get_the_ID(), '_thumbnail_id', true);
128
-
129
- if ( ! empty($_featured_image)) $attachment_ids[] = $_featured_image;
130
-
131
- $_gallery = get_post_meta(get_the_ID(), '_product_image_gallery', true);
132
-
133
- if (!empty($_gallery)){
134
- $gallery = explode(',', $_gallery);
135
- if (!empty($gallery) and is_array($gallery)){
136
- foreach ($gallery as $aid) {
137
- if (!in_array($aid, $attachment_ids)) $attachment_ids[] = $aid;
138
- }
139
- }
140
- }
141
-
142
- $attachment_imgs = get_posts( array(
143
- 'post_type' => 'attachment',
144
- 'posts_per_page' => -1,
145
- 'post_parent' => $record->ID,
146
- ) );
147
-
148
- if ( ! empty($attachment_imgs)):
149
-
150
- foreach ($attachment_imgs as $attach) {
151
- if ( wp_attachment_is_image( $attach->ID ) and ! in_array($attach->ID, $attachment_ids)){
152
- $attachment_ids[] = $attach->ID;
153
- }
154
- }
155
-
156
- endif;
157
-
158
- if ( ! empty($attachment_ids)):
159
-
160
- foreach ($attachment_ids as $attach_id) {
161
-
162
- $attach = get_post($attach_id);
163
-
164
- if ( $attach and ! is_wp_error($attach) and wp_attachment_is_image( $attach->ID ) ) {
165
-
166
- $xmlWriter->startElement('image');
167
-
168
- $val = wp_get_attachment_url( $attach->ID );
169
-
170
- if (!empty($exportOptions['cc_options'][$ID])){
171
- switch ($exportOptions['cc_options'][$ID]) {
172
- case 'filenames':
173
- $val = basename(wp_get_attachment_url( $attach->ID ));
174
- break;
175
- case 'filepaths':
176
- $val = get_attached_file( $attach->ID );
177
- break;
178
-
179
- default:
180
- # code...
181
- break;
182
- }
183
- }
184
-
185
- $xmlWriter->writeElement('file', apply_filters('pmxe_attachment_url', $val, get_the_ID(), $attach->ID));
186
- $xmlWriter->writeElement('title', apply_filters('pmxe_attachment_title', $attach->post_title, get_the_ID(), $attach->ID));
187
- $xmlWriter->writeElement('caption', apply_filters('pmxe_attachment_caption', $attach->post_excerpt, get_the_ID(), $attach->ID));
188
- $xmlWriter->writeElement('description', apply_filters('pmxe_attachment_content', $attach->post_content, get_the_ID(), $attach->ID));
189
- $xmlWriter->writeElement('alt', apply_filters('pmxe_attachment_alt', get_post_meta($attach->ID, '_wp_attachment_image_alt', true), get_the_ID(), $attach->ID));
190
-
191
- $xmlWriter->endElement();
192
- }
193
- }
194
-
195
- endif;
196
- $xmlWriter->endElement();
197
- break;
198
-
199
- case 'date':
200
- if (!empty($exportOptions['cc_options'][$ID])){
201
- switch ($exportOptions['cc_options'][$ID]) {
202
- case 'unix':
203
- $post_date = get_post_time('U', true);
204
- break;
205
- default:
206
- $post_date = date($exportOptions['cc_options'][$ID], get_post_time('U', true));
207
- break;
208
- }
209
- }
210
- else{
211
- $post_date = date("Ymd", get_post_time('U', true));
212
- }
213
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_post_date', pmxe_filter($post_date, $fieldSnipped), get_the_ID()));
214
- break;
215
-
216
- case 'attachments':
217
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
218
- $attachment_imgs = get_posts( array(
219
- 'post_type' => 'attachment',
220
- 'posts_per_page' => -1,
221
- 'post_parent' => $record->ID,
222
- ) );
223
-
224
- if ( ! empty($attachment_imgs)):
225
-
226
- foreach ($attachment_imgs as $attach) {
227
- if ( ! wp_attachment_is_image( $attach->ID ) ){
228
- $xmlWriter->startElement('attach');
229
- $xmlWriter->writeElement('url', apply_filters('pmxe_attachment_url', pmxe_filter(wp_get_attachment_url( $attach->ID ), $fieldSnipped), get_the_ID(), $attach->ID));
230
- $xmlWriter->endElement();
231
- }
232
- }
233
-
234
- endif;
235
- $xmlWriter->endElement(); // end attachments
236
- break;
237
-
238
- case 'parent':
239
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_post_parent', pmxe_filter($record->post_parent, $fieldSnipped), get_the_ID()));
240
- break;
241
-
242
- case 'comment_status':
243
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_comment_status', pmxe_filter($record->comment_status, $fieldSnipped), get_the_ID()));
244
- break;
245
-
246
- case 'ping_status':
247
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_ping_status', pmxe_filter($record->ping_status, $fieldSnipped), get_the_ID()));
248
- break;
249
-
250
- case 'template':
251
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_post_template', pmxe_filter(get_post_meta($record->ID, '_wp_page_template', true), $fieldSnipped), get_the_ID()));
252
- break;
253
-
254
- case 'order':
255
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_menu_order', pmxe_filter($record->menu_order, $fieldSnipped), get_the_ID()));
256
- break;
257
-
258
- case 'status':
259
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_post_status', pmxe_filter($record->post_status, $fieldSnipped), get_the_ID()));
260
- break;
261
-
262
- case 'format':
263
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_post_format', pmxe_filter(get_post_format($record->ID), $fieldSnipped), get_the_ID()));
264
- break;
265
-
266
- case 'author':
267
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_post_author', pmxe_filter($record->post_author, $fieldSnipped), get_the_ID()));
268
- break;
269
-
270
- case 'slug':
271
- $xmlWriter->putElement($element_name_ns, $element_name, null, apply_filters('pmxe_post_slug', pmxe_filter($record->post_name, $fieldSnipped), get_the_ID()));
272
- break;
273
-
274
- case 'excerpt':
275
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
276
- $xmlWriter->writeData(apply_filters('pmxe_post_excerpt', pmxe_filter($record->post_excerpt, $fieldSnipped) , get_the_ID()));
277
- $xmlWriter->endElement();
278
- break;
279
-
280
- case 'cf':
281
- if ( ! empty($exportOptions['cc_value'][$ID]) ){
282
- $cur_meta_values = get_post_meta($record->ID, $exportOptions['cc_value'][$ID]);
283
- if (!empty($cur_meta_values) and is_array($cur_meta_values)){
284
- foreach ($cur_meta_values as $key => $cur_meta_value) {
285
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
286
- $xmlWriter->writeData(apply_filters('pmxe_custom_field', pmxe_filter(maybe_serialize($cur_meta_value), $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID()));
287
- $xmlWriter->endElement();
288
- }
289
- }
290
-
291
- if (empty($cur_meta_values)){
292
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
293
- $xmlWriter->writeData(apply_filters('pmxe_custom_field', pmxe_filter('', $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID()));
294
- $xmlWriter->endElement();
295
- }
296
- }
297
- break;
298
- case 'acf':
299
-
300
- if ( ! empty($exportOptions['cc_label'][$ID]) and class_exists( 'acf' ) ){
301
-
302
- global $acf;
303
-
304
- $field_value = get_field($exportOptions['cc_label'][$ID], $record->ID);
305
-
306
- $field_options = unserialize($exportOptions['cc_options'][$ID]);
307
-
308
- pmxe_export_acf_field_xml($field_value, $exportOptions, $ID, $record->ID, $xmlWriter, $element_name, $element_name_ns, $fieldSnipped, $field_options['group_id']);
309
-
310
- }
311
-
312
- break;
313
- case 'woo':
314
-
315
- XmlExportWooCommerce::getInstance()->export_xml($xmlWriter, $record, $exportOptions, $ID);
316
-
317
- break;
318
- case 'woo_order':
319
-
320
- XmlExportWooCommerceOrder::getInstance()->export_xml($xmlWriter, $record, $exportOptions, $ID);
321
-
322
- break;
323
- case 'attr':
324
- if ( ! empty($exportOptions['cc_value'][$ID])){
325
- if ($record->post_parent == 0){
326
- $is_variable_product = false;
327
- $product_terms = wp_get_post_terms( $record->ID, 'product_type' );
328
- if( ! empty($product_terms)){
329
- if( ! is_wp_error( $product_terms )){
330
- foreach($product_terms as $term){
331
- if ('variable' == $term->slug){
332
- $is_variable_product = true;
333
- break;
334
- }
335
- }
336
- }
337
- }
338
- $txes_list = get_the_terms($record->ID, $exportOptions['cc_value'][$ID]);
339
- if ( ! is_wp_error($txes_list)) {
340
- $attr_new = array();
341
- if (!empty($txes_list)):
342
- foreach ($txes_list as $t) {
343
- $attr_new[] = $t->name;
344
- }
345
- $xmlWriter->beginElement($element_name_ns, $is_variable_product ? $element_name : 'attribute_' . $element_name, null);
346
- $xmlWriter->writeData(apply_filters('pmxe_woo_attribute', pmxe_filter(implode('|', $attr_new), $fieldSnipped), get_the_ID(), $exportOptions['cc_value'][$ID]));
347
- $xmlWriter->endElement();
348
- endif;
349
- }
350
- }
351
- else{
352
- $attribute_pa = apply_filters('pmxe_woo_attribute', get_post_meta($record->ID, 'attribute_' . $exportOptions['cc_value'][$ID], true), get_the_ID(), $exportOptions['cc_value'][$ID]);
353
- if ( ! empty($attribute_pa)){
354
- $xmlWriter->beginElement($element_name_ns, 'attribute_' . $element_name, null);
355
- $xmlWriter->writeData(apply_filters('woo_field', $attribute_pa));
356
- $xmlWriter->endElement();
357
- }
358
- }
359
- }
360
- break;
361
- case 'cats':
362
- if ( ! empty($exportOptions['cc_value'][$ID]) )
363
- {
364
- if ($exportOptions['cc_label'][$ID] == 'product_type' and get_post_type() == 'product_variation')
365
- {
366
- $xmlWriter->writeElement('parent_id', $record->post_parent);
367
- $xmlWriter->writeElement($element_name, 'variable');
368
- }
369
- else
370
- {
371
- $txes_list = get_the_terms($record->ID, $exportOptions['cc_value'][$ID]);
372
- if ( ! is_wp_error($txes_list)) {
373
-
374
- $txes_ids = array();
375
- $hierarchy_groups = array();
376
-
377
- if ( ! empty($txes_list) ):
378
- foreach ($txes_list as $t) {
379
- $txes_ids[] = $t->term_id;
380
- }
381
-
382
- foreach ($txes_list as $t) {
383
- if ( wp_all_export_check_children_assign($t->term_id, $exportOptions['cc_value'][$ID], $txes_ids) ){
384
- $ancestors = get_ancestors( $t->term_id, $exportOptions['cc_value'][$ID] );
385
- if (count($ancestors) > 0){
386
- $hierarchy_group = array();
387
- for ( $i = count($ancestors) - 1; $i >= 0; $i-- ) {
388
- $term = get_term_by('id', $ancestors[$i], $exportOptions['cc_value'][$ID]);
389
- if ($term){
390
- $hierarchy_group[] = $term->name;
391
- }
392
- }
393
- $hierarchy_group[] = $t->name;
394
- $hierarchy_groups[] = implode(">", $hierarchy_group);
395
- }
396
- else{
397
- $hierarchy_groups[] = $t->name;
398
- }
399
- }
400
- }
401
-
402
- if ( ! empty($hierarchy_groups) ){
403
-
404
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
405
- $xmlWriter->writeData(apply_filters('pmxe_post_taxonomy', pmxe_filter(implode('|', $hierarchy_groups), $fieldSnipped), get_the_ID()));
406
- $xmlWriter->endElement();
407
-
408
- }
409
-
410
- endif;
411
-
412
- }
413
- }
414
- }
415
- break;
416
-
417
- case 'sql':
418
-
419
- if ( ! empty($exportOptions['cc_sql'][$ID]) ){
420
- $val = $wpdb->get_var( $wpdb->prepare( stripcslashes(str_replace("%%ID%%", "%d", $exportOptions['cc_sql'][$ID])), get_the_ID() ));
421
- if ( ! empty($exportOptions['cc_php'][$ID]) and !empty($exportOptions['cc_code'][$ID])){
422
- // if shortcode defined
423
- if (strpos($exportOptions['cc_code'][$ID], '[') === 0){
424
- $val = do_shortcode(str_replace("%%VALUE%%", $val, $exportOptions['cc_code'][$ID]));
425
- }
426
- else{
427
- $val = eval('return ' . stripcslashes(str_replace("%%VALUE%%", $val, $exportOptions['cc_code'][$ID])) . ';');
428
- }
429
- }
430
- $xmlWriter->beginElement($element_name_ns, $element_name, null);
431
- $xmlWriter->writeData(apply_filters('pmxe_sql_field', $val, $element_name, get_the_ID()));
432
- $xmlWriter->endElement();
433
- }
434
- break;
435
-
436
- default:
437
- # code...
438
- break;
439
- }
440
- }
441
- }
442
- endif;
443
-
444
- $xmlWriter->endElement(); // end post
445
-
446
- if ($preview) break;
447
-
448
- do_action('pmxe_exported_post', $record->ID );
449
-
450
- endwhile;
451
-
452
- $xmlWriter->endElement(); // end data
453
-
454
- if ($preview) return $xmlWriter->flush(true);//wp_all_export_remove_colons($xmlWriter->flush(true));
455
-
456
- if ($is_cron)
457
- {
458
-
459
- $xml = $xmlWriter->flush(true);
460
-
461
- if ( ! $exported_by_cron )
462
- {
463
- // The BOM will help some programs like Microsoft Excel read your export file if it includes non-English characters.
464
- if ($exportOptions['include_bom'])
465
- {
466
- file_put_contents($file_path, chr(0xEF).chr(0xBB).chr(0xBF).substr($xml, 0, (strlen($exportOptions['main_xml_tag']) + 4) * (-1)));
467
- }
468
- else
469
- {
470
- file_put_contents($file_path, substr($xml, 0, (strlen($exportOptions['main_xml_tag']) + 4) * (-1)));
471
- }
472
- }
473
- else
474
- {
475
- file_put_contents($file_path, substr(substr($xml, 41 + strlen($exportOptions['main_xml_tag'])), 0, (strlen($exportOptions['main_xml_tag']) + 4) * (-1)), FILE_APPEND);
476
- }
477
-
478
- return $file_path;
479
-
480
- }
481
- else
482
- {
483
-
484
- if ( empty(PMXE_Plugin::$session->file) ){
485
-
486
- // generate export file name
487
- $export_file = wp_all_export_generate_export_file( XmlExportEngine::$exportID );
488
-
489
- // The BOM will help some programs like Microsoft Excel read your export file if it includes non-English characters.
490
- if ($exportOptions['include_bom'])
491
- {
492
- file_put_contents($export_file, chr(0xEF).chr(0xBB).chr(0xBF).substr($xmlWriter->flush(true), 0, (strlen($exportOptions['main_xml_tag']) + 4) * (-1)));
493
- }
494
- else
495
- {
496
- file_put_contents($export_file, substr($xmlWriter->flush(true), 0, (strlen($exportOptions['main_xml_tag']) + 4) * (-1)));
497
- }
498
-
499
- PMXE_Plugin::$session->set('file', $export_file);
500
-
501
- PMXE_Plugin::$session->save_data();
502
-
503
- }
504
- else
505
- {
506
- file_put_contents(PMXE_Plugin::$session->file, substr(substr($xmlWriter->flush(true), 41 + strlen($exportOptions['main_xml_tag'])), 0, (strlen($exportOptions['main_xml_tag']) + 4) * (-1)), FILE_APPEND);
507
- }
508
-
509
- return true;
510
-
511
- }
512
-
513
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
helpers/pmxe_functions.php CHANGED
@@ -48,4 +48,51 @@
48
  $ext = substr($str,$i+1,$l);
49
  return (strlen($ext) <= 4) ? $ext : "";
50
  }
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  $ext = substr($str,$i+1,$l);
49
  return (strlen($ext) <= 4) ? $ext : "";
50
  }
51
+ }
52
+
53
+ if ( ! function_exists('wp_all_export_get_existing_meta_by_cpt'))
54
+ {
55
+ function wp_all_export_get_existing_meta_by_cpt( $post_type = false )
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;
63
+ $meta_keys = $wpdb->get_results("SELECT DISTINCT {$table_prefix}postmeta.meta_key FROM {$table_prefix}postmeta, {$table_prefix}posts WHERE {$table_prefix}postmeta.post_id = {$table_prefix}posts.ID AND {$table_prefix}posts.post_type IN ('" . implode('\',\'', $post_type) . "') AND {$table_prefix}postmeta.meta_key NOT LIKE '_edit%' LIMIT 500");
64
+
65
+ $_existing_meta_keys = array();
66
+ if ( ! empty($meta_keys)){
67
+ $exclude_keys = array('_first_variation_attributes', '_is_first_variation_created', '_thumbnail_id');
68
+ foreach ($meta_keys as $meta_key) {
69
+ if ( strpos($meta_key->meta_key, "_tmp") === false && strpos($meta_key->meta_key, "_v_") === false && ! in_array($meta_key->meta_key, $exclude_keys))
70
+ $_existing_meta_keys[] = $meta_key->meta_key;
71
+ }
72
+ }
73
+ return $_existing_meta_keys;
74
+ }
75
+ }
76
+
77
+ if ( ! function_exists('wp_all_export_get_existing_taxonomies_by_cpt'))
78
+ {
79
+ function wp_all_export_get_existing_taxonomies_by_cpt( $post_type = false )
80
+ {
81
+ if (empty($post_type)) return array();
82
+
83
+ $post_taxonomies = array_diff_key(get_taxonomies_by_object_type(array($post_type), 'object'), array_flip(array('post_format')));
84
+ $_existing_taxonomies = array();
85
+ if ( ! empty($post_taxonomies)){
86
+ foreach ($post_taxonomies as $tx) {
87
+ if (strpos($tx->name, "pa_") !== 0)
88
+ $_existing_taxonomies[] = array(
89
+ 'name' => $tx->label,
90
+ 'label' => $tx->name,
91
+ 'type' => 'cats'
92
+ );
93
+ }
94
+ }
95
+ return $_existing_taxonomies;
96
+ }
97
+ }
98
+
helpers/wp_all_export_generate_export_file.php CHANGED
@@ -15,13 +15,13 @@ if ( ! function_exists('wp_all_export_generate_export_file') )
15
 
16
  if ( ! $export->isEmpty())
17
  {
18
- if ($export->options['creata_a_new_export_file'] )
19
  {
20
- $export_file_name = sanitize_file_name($export->options['friendly_name']) . ' - ' . ($export->iteration + 1) . '.' . $export->options['export_to'];
21
  }
22
  else
23
  {
24
- $export_file_name = sanitize_file_name($export->options['friendly_name']) . '.' . $export->options['export_to'];
25
  }
26
  }
27
 
15
 
16
  if ( ! $export->isEmpty())
17
  {
18
+ if ( $export->options['creata_a_new_export_file'] and ( ! XmlExportWooCommerceOrder::$is_active || $export->options['export_type'] != 'specific') )
19
  {
20
+ $export_file_name = sanitize_file_name($export->friendly_name) . ' - ' . ($export->iteration + 1) . '.' . $export->options['export_to'];
21
  }
22
  else
23
  {
24
+ $export_file_name = sanitize_file_name($export->friendly_name) . '.' . $export->options['export_to'];
25
  }
26
  }
27
 
helpers/wp_all_export_get_cpt_name.php CHANGED
@@ -3,23 +3,37 @@
3
  function wp_all_export_get_cpt_name($cpt = array(), $count = 2)
4
  {
5
  $cptName = '';
6
- if ( ! empty($cpt)){
7
- if ( ! in_array('users', $cpt)){
8
- if (in_array('product_variation', $cpt)){
9
- $cptName = ucfirst( ( ! empty($cpt) ) ? str_replace("product_variation", __("Product Variations"), implode(", ", $cpt)) : 'record');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
  else
12
  {
13
  $post_type_details = get_post_type_object( $cpt[0] );
14
- $cptName = ($count > 1) ? $post_type_details->labels->name : $post_type_details->labels->singular_name;
15
- }
16
- }
17
- else
18
- {
19
- $cptName = ($count > 1) ? __('Users', 'wp_all_export_plugin') : __('User', 'wp_all_export_plugin');
20
  }
21
  }
22
- else{
 
23
  $cptName = ($count > 1) ? __('Records', 'wp_all_export_plugin') : __('Record', 'wp_all_export_plugin');
24
  }
25
 
3
  function wp_all_export_get_cpt_name($cpt = array(), $count = 2)
4
  {
5
  $cptName = '';
6
+ if ( ! empty($cpt))
7
+ {
8
+ if (in_array('users', $cpt))
9
+ {
10
+ $cptName = ($count > 1) ? __('Users', 'wp_all_export_plugin') : __('User', 'wp_all_export_plugin');
11
+ }
12
+ elseif (in_array('shop_customer', $cpt))
13
+ {
14
+ $cptName = ($count > 1) ? __('Customers', 'wp_all_export_plugin') : __('Customer', 'wp_all_export_plugin');
15
+ }
16
+ elseif (in_array('comments', $cpt))
17
+ {
18
+ $cptName = ($count > 1) ? __('Comments', 'wp_all_export_plugin') : __('Comment', 'wp_all_export_plugin');
19
+ }
20
+ else
21
+ {
22
+ if (count($cpt) === 1 and in_array('product_variation', $cpt) and class_exists('WooCommerce')){
23
+ $cptName = ($count > 1) ? 'Variations' : 'Variation';
24
  }
25
  else
26
  {
27
  $post_type_details = get_post_type_object( $cpt[0] );
28
+ if ($post_type_details)
29
+ {
30
+ $cptName = ($count > 1) ? $post_type_details->labels->name : $post_type_details->labels->singular_name;
31
+ }
32
+ }
 
33
  }
34
  }
35
+ if (empty($cptName))
36
+ {
37
  $cptName = ($count > 1) ? __('Records', 'wp_all_export_plugin') : __('Record', 'wp_all_export_plugin');
38
  }
39
 
helpers/wp_all_export_get_export_format.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wp_all_export_get_export_format($options)
4
+ {
5
+ return ($options['export_to'] == 'xml') ? 'xml' : 'csv';
6
+ }
helpers/wp_all_export_posts_join.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wp_all_export_posts_join($join){
4
+
5
+ // cron job execution
6
+ if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
7
+ {
8
+ $customJoin = PMXE_Plugin::$session->get('joinClause');
9
+ if ( ! empty( $customJoin ) ) {
10
+ $join .= implode( ' ', array_unique( $customJoin ) );
11
+ }
12
+ }
13
+ else
14
+ {
15
+ if ( ! empty(XmlExportEngine::$exportOptions['joinclause']) ) {
16
+ $join .= implode( ' ', array_unique( XmlExportEngine::$exportOptions['joinclause'] ) );
17
+ }
18
+ }
19
+
20
+ return $join;
21
+ }
helpers/wp_all_export_posts_where.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wp_all_export_posts_where($where)
4
+ {
5
+ if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
6
+ {
7
+ // manual export run
8
+ $customWhere = PMXE_Plugin::$session->get('whereclause');
9
+ $where .= $customWhere;
10
+ }
11
+ else
12
+ {
13
+ // cron job execution
14
+ if ( ! empty(XmlExportEngine::$exportOptions['whereclause']) ) $where .= XmlExportEngine::$exportOptions['whereclause'];
15
+ }
16
+
17
+ return $where;
18
+ }
helpers/wp_all_export_reverse_rules_html.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  if ( ! function_exists('wp_all_export_reverse_rules_html') ) {
4
- function wp_all_export_reverse_rules_html($filter_rules_hierarhy, $parent_rule, &$rulenumber){
5
  $child_rules = array();
6
  foreach ($filter_rules_hierarhy as $j => $rule) if ($rule->parent_id == $parent_rule->item_id and $rule->item_id != $parent_rule->item_id) { $child_rules[] = $rule; }
7
 
@@ -10,6 +10,9 @@ if ( ! function_exists('wp_all_export_reverse_rules_html') ) {
10
  <ol>
11
  <?php
12
  foreach ($child_rules as $rule){
 
 
 
13
  $rulenumber++;
14
  ?>
15
  <li id="item_<?php echo $rulenumber;?>" class="dragging">
@@ -18,9 +21,9 @@ if ( ! function_exists('wp_all_export_reverse_rules_html') ) {
18
  <input type="hidden" value="<?php echo $rule->condition; ?>" class="wp_all_export_rule" name="wp_all_export_rule[<?php echo $rulenumber; ?>]"/>
19
  <input type="hidden" value="<?php echo $rule->value; ?>" class="wp_all_export_value" name="wp_all_export_value[<?php echo $rulenumber; ?>]"/>
20
  <span class="rule_element"><?php echo $rule->element; ?></span>
21
- <span class="rule_as_is"><?php echo $rule->condition; ?></span>
22
  <span class="rule_condition_value"><?php echo $rule->value; ?></span>
23
- <span class="condition" <?php if ($rulenumber == count($filter_rules_hierarhy)):?>style="display:none;"<?php endif; ?>>
24
  <label for="rule_and_<?php echo $rulenumber; ?>">AND</label>
25
  <input id="rule_and_<?php echo $rulenumber; ?>" type="radio" value="and" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'AND'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
26
  <label for="rule_or_<?php echo $rulenumber; ?>">OR</label>
@@ -28,7 +31,7 @@ if ( ! function_exists('wp_all_export_reverse_rules_html') ) {
28
  </span>
29
  </div>
30
  <a href="javascript:void(0);" class="icon-item remove-ico"></a>
31
- <?php echo wp_all_export_reverse_rules_html($filter_rules_hierarhy, $rule, $rulenumber); ?>
32
  </li>
33
  <?php
34
  }
1
  <?php
2
 
3
  if ( ! function_exists('wp_all_export_reverse_rules_html') ) {
4
+ function wp_all_export_reverse_rules_html($filter_rules_hierarhy, $parent_rule, &$rulenumber, $condition_labels){
5
  $child_rules = array();
6
  foreach ($filter_rules_hierarhy as $j => $rule) if ($rule->parent_id == $parent_rule->item_id and $rule->item_id != $parent_rule->item_id) { $child_rules[] = $rule; }
7
 
10
  <ol>
11
  <?php
12
  foreach ($child_rules as $rule){
13
+
14
+ $condition_label = in_array($rule->element, array('post_date', 'user_registered', 'comment_date')) ? $condition_labels['date'][$rule->condition] : $condition_labels['default'][$rule->condition];
15
+
16
  $rulenumber++;
17
  ?>
18
  <li id="item_<?php echo $rulenumber;?>" class="dragging">
21
  <input type="hidden" value="<?php echo $rule->condition; ?>" class="wp_all_export_rule" name="wp_all_export_rule[<?php echo $rulenumber; ?>]"/>
22
  <input type="hidden" value="<?php echo $rule->value; ?>" class="wp_all_export_value" name="wp_all_export_value[<?php echo $rulenumber; ?>]"/>
23
  <span class="rule_element"><?php echo $rule->element; ?></span>
24
+ <span class="rule_as_is"><?php echo $condition_label; ?></span>
25
  <span class="rule_condition_value"><?php echo $rule->value; ?></span>
26
+ <span class="condition <?php if ($rulenumber == count($filter_rules_hierarhy)):?>last_condition<?php endif; ?>">
27
  <label for="rule_and_<?php echo $rulenumber; ?>">AND</label>
28
  <input id="rule_and_<?php echo $rulenumber; ?>" type="radio" value="and" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'AND'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
29
  <label for="rule_or_<?php echo $rulenumber; ?>">OR</label>
31
  </span>
32
  </div>
33
  <a href="javascript:void(0);" class="icon-item remove-ico"></a>
34
+ <?php echo wp_all_export_reverse_rules_html($filter_rules_hierarhy, $rule, $rulenumber, $condition_labels); ?>
35
  </li>
36
  <?php
37
  }
helpers/wp_all_export_write_article.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wp_all_export_write_article( &$article, &$element_name, $element_value )
4
+ {
5
+ $base_name = $element_name;
6
+
7
+ if ( ! isset($article[$element_name]) )
8
+ {
9
+ $article[$element_name] = $element_value;
10
+ }
11
+ else
12
+ {
13
+ $is_added = false;
14
+ $i = 0;
15
+ do
16
+ {
17
+ $element_name = $base_name . '_' . md5($i);
18
+
19
+ if ( ! isset($article[$element_name]))
20
+ {
21
+ $article[$element_name] = $element_value;
22
+ $is_added = true;
23
+ }
24
+
25
+ $i++;
26
+ }
27
+ while ( ! $is_added );
28
+ }
29
+ }
i18n/languages/wp_all_export_plugin-de_DE.mo CHANGED
Binary file
i18n/languages/wp_all_export_plugin-de_DE.po CHANGED
@@ -3,42 +3,99 @@ msgstr ""
3
  "Project-Id-Version: WP All Export Pro\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: Mon Nov 09 2015 10:39:03 GMT+0200 (EET)\n"
6
- "PO-Revision-Date: 2015-11-13 11:18+0200\n"
7
  "Last-Translator: admin <makstsiplyskov@gmail.loc>\n"
8
  "Language-Team: \n"
9
- "Language: de\n"
10
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
11
  "MIME-Version: 1.0\n"
12
  "Content-Type: text/plain; charset=UTF-8\n"
13
  "Content-Transfer-Encoding: 8bit\n"
14
  "X-Poedit-SourceCharset: UTF-8\n"
15
  "X-Poedit-Basepath: .\n"
16
- "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;__:1;"
17
- "_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;_x:1,2c;"
18
- "_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;esc_attr__:1;"
19
- "esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;esc_html_x:1,2c;"
20
- "comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
21
  "X-Loco-Target-Locale: de_DE\n"
22
- "X-Generator: Poedit 1.8.4\n"
23
- "X-Poedit-SearchPath-0: ../..\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
- #. Name of the plugin
26
  msgid "WP All Export Pro"
27
  msgstr "WP All Export Pro"
28
 
29
- #. URI of the plugin
30
  msgid "http://www.wpallimport.com/export"
31
  msgstr "http://www.wpallimport.com/export"
32
 
33
- #. Description of the plugin
34
  msgid ""
35
- "Export any post type to a CSV or XML file. Edit the exported data, and then re-"
36
- "import it later using WP All Import."
37
  msgstr ""
38
- "Exportiere jeden post typ in eine CSV oder XML Datei. Editiere die exportierten "
39
- "Daten und importieren Sie sie später mit WP All Import."
40
 
41
- #. Author of the plugin
42
  msgid "Soflyy"
43
  msgstr "Soflyy"
44
 
@@ -47,20 +104,20 @@ msgid ""
47
  "Please de-activate and remove the free version of the WP All Export before "
48
  "activating the paid version."
49
  msgstr ""
50
- "Bitte deaktivieren und entfernen Sie die freie Version von WP All Export bevor Sie "
51
- "die bezahlte Version aktivieren."
52
 
53
- #: ../../wp-all-export-pro.php:321 ../../wp-all-export-pro.php:325
54
  #, php-format
55
  msgid "Uploads folder %s must be writable"
56
  msgstr "Uploads Ordner%s muss schreibbar sein"
57
 
58
  #: ../../actions/admin_menu.php:11 ../../actions/admin_menu.php:14 ../..
59
- #: /actions/admin_menu.php:15 ../../actions/admin_menu.php:16
60
- #: /actions/admin_menu.php:17 ../../models/export/record.php:528
61
- #: /views/admin/export/index.php:9 ../../views/admin/export/options.php:15
62
- #: /views/admin/export/process.php:9 ../../views/admin/export/template.php:7
63
- #: /views/admin/manage/index.php:4 ../../views/admin/manage/update.php:25
64
  #: /views/admin/settings/index.php:6
65
  msgid "WP All Export"
66
  msgstr "WP All Export"
@@ -77,43 +134,45 @@ msgstr "Export zu XML"
77
  msgid "New Export"
78
  msgstr "Neuer Export"
79
 
80
- #: ../../actions/admin_menu.php:15 ../.. /views/admin/export/process.php:57
81
- #: ../../views/admin/manage/index.php:5
82
  msgid "Manage Exports"
83
  msgstr "Exports Verwalten"
84
 
85
- #: ../../actions/admin_menu.php:16 ../.. /views/admin/settings/index.php:7
 
86
  msgid "Settings"
87
  msgstr "Einstellungen"
88
 
89
- #: ../../actions/admin_menu.php:17
90
  msgid "Feedback"
91
  msgstr "Feedback"
92
 
93
  #: ../../actions/init.php:19 ../../actions/init.php:25
94
  msgid "Error. Incorrect API key, check the WP All Export Pro settings page."
95
  msgstr ""
96
- "Fehler. Falscher API Schlüssel, bitte kontrollieren Sie die WP All Export Pro "
97
- "Einstellungen."
98
 
99
  #: ../../actions/wp_ajax_export_available_rules.php:6 ../..
100
- #: /actions/wp_ajax_export_available_rules.php:10
101
  #: /actions/wp_ajax_export_filtering.php:6 ../../actions/wp_ajax_export_filtering.
102
- #: php:10 ../../actions/wp_ajax_export_filtering_count.php:6
103
- #: /actions/wp_ajax_export_filtering_count.php:10
104
- #: /actions/wp_ajax_export_preview.php:8 ../../actions/wp_ajax_export_preview.php:12
105
- #: ../../actions/wp_ajax_generate_zapier_api_key.php:6
106
- #: /actions/wp_ajax_generate_zapier_api_key.php:10
107
- #: /actions/wp_ajax_save_functions.php:6 ../../actions/wp_ajax_save_functions.php:10
108
- #: ../../actions/wp_ajax_wpallexport.php:8 ../../actions/wp_ajax_wpallexport. php:12
109
- #: ../../controllers/controller.php:117 ../../controllers/admin/manage.php:290
110
- #: ../../controllers/admin/manage.php:325 406 ../../controllers/admin/manage.php:459
 
111
  msgid "Security check"
112
  msgstr "Sicherheitskontrolle"
113
 
114
  #: ../../actions/wp_ajax_export_available_rules.php:21 ../..
115
- #: /actions/wp_ajax_export_filtering.php:50 ../../views/admin/export/options.php:92
116
- #: ../../views/admin/manage/update.php:100
117
  msgid "Select Rule"
118
  msgstr "Wähle Regel"
119
 
@@ -211,8 +270,8 @@ msgstr "Regel hinzufügen"
211
  #: ../../actions/wp_ajax_export_filtering.php:69 ../../views/admin/export/options.
212
  #: php:112 ../../views/admin/manage/update.php:120
213
  msgid ""
214
- "No filtering options. Add filtering options to only export records matching some "
215
- "specified criteria."
216
  msgstr ""
217
  "Keine Filteroptionen. Fügen Sie Filteroptionen hinzu um nur Datensätze zu "
218
  "exportieren die bestimmte Kriterien erfüllen."
@@ -239,51 +298,52 @@ msgstr "Großzügig"
239
  #: ../../actions/wp_ajax_export_filtering.php:119 ../..
240
  #: /views/admin/export/options.php:164 ../../views/admin/manage/update.php:172
241
  msgid ""
242
- "Strict matching requires all variations to pass in order for the product to be "
243
- "exported. Permissive matching allows the product to be exported if any of the "
244
- "variations pass."
245
  msgstr ""
246
- "Bei strenger Übereinstimmung müssen alle Variationen des Produkts für den Export "
247
- "übereinstimmen. Bei der großzügigen Übereinstimmung muss nur eine Variation "
248
- "übereinstimmen."
249
 
250
- #: ../../actions/wp_ajax_export_filtering_count.php:83 ../..
251
  #: /views/admin/export/options.php:43 ../../views/admin/manage/update.php:54
252
  msgid "Your export is ready to run."
253
  msgstr "Ihr Export ist bereit zum Start."
254
 
255
- #: ../../actions/wp_ajax_export_filtering_count.php:84 ../..
256
  #: /views/admin/export/options.php:45 ../../views/admin/manage/update.php:55
257
  #, php-format
258
  msgid "WP All Export will export %d %s."
259
  msgstr "WP All Export wird folgende exportieren %d %s."
260
 
261
- #: ../../actions/wp_ajax_export_filtering_count.php:87 ../..
262
- #: /actions/wp_ajax_export_filtering_count.php:90 ../../views/admin/manage/update.
263
  #: php:51
264
  msgid "Nothing to export."
265
  msgstr "Nichts zu exportieren"
266
 
267
- #: ../../actions/wp_ajax_export_filtering_count.php:88
268
  #, php-format
269
  msgid "All %s have already been exported."
270
  msgstr "Alle %s wurden bereits exportiert."
271
 
272
- #: ../../actions/wp_ajax_export_filtering_count.php:91 ../..
273
- #: /actions/wp_ajax_export_filtering_count.php:105 /views/admin/manage/update.php:52
 
274
  #, php-format
275
  msgid "No matching %s found for selected filter rules."
276
  msgstr "Keine Übereinstimmung %s gefunden für die gewählten Filterregeln."
277
 
278
- #: ../../actions/wp_ajax_export_filtering_count.php:103
279
  msgid "Continue to Step 2 to choose data to include in the export file."
280
  msgstr "Weiter zu Schritt 2 um die Daten für die Exportdatei zu wählen."
281
 
282
- #: ../../actions/wp_ajax_export_preview.php:125
283
  msgid "Data not found."
284
  msgstr "Dateien nicht gefunden"
285
 
286
- #: ../../actions/wp_ajax_export_preview.php:134
287
  msgid "This format is not supported."
288
  msgstr "Dieses Format wird nicht unterstützt."
289
 
@@ -350,21 +410,22 @@ msgstr "Export hash ist nicht gültig."
350
  #: ../../classes/updater.php:238
351
  #, php-format
352
  msgid ""
353
- "There is a new version of %1$s available. <a target=\"_blank\" class=\"thickbox\" "
354
- "href=\"%2$s\">View version %3$s details</a>."
355
  msgstr ""
356
- "Eine neue Version von %1$s ist verfügbar. <a target=\"_blank\" class=\"thickbox\" "
357
- "href=\"%2$s\">Details ansehen von %3$s</a>."
358
 
359
  #: ../../classes/updater.php:245
360
  #, php-format
361
  msgid ""
362
- "There is a new version of %1$s available. <a target=\"_blank\" class=\"thickbox\" "
363
- "href=\"%2$s\">View version %3$s details</a> or <a href=\"%4$s\">update now</a>."
 
364
  msgstr ""
365
- "Eine neue Version von %1$s ist verfügbar. <a target=\"_blank\" class=\"thickbox\" "
366
- "href=\"%2$s\">Details ansehen von %3$s</a> oder <a href=\"%4$s\">jetzt "
367
- "aktualisieren</a>."
368
 
369
  #: ../../classes/updater.php:428
370
  msgid "You do not have permission to install plugin updates"
@@ -383,7 +444,7 @@ msgid "CSV delimiter must be specified."
383
  msgstr "Setze Beschränkung für CSV Felder:"
384
 
385
  #: ../../controllers/admin/export.php:250 ../../controllers/admin/export.php:349 .
386
- #: ../controllers/admin/manage.php:226
387
  msgid "Options updated"
388
  msgstr "Optionen Aktualisiert"
389
 
@@ -428,17 +489,17 @@ msgstr[1] "Exporte"
428
 
429
  #: ../../controllers/admin/manage.php:376
430
  msgid ""
431
- "The other two files in this zip are the export file containing all of your data "
432
- "and the import template for WP All Import. \n"
433
  "\n"
434
- "To import this data, create a new import with WP All Import and upload this zip "
435
- "file."
436
  msgstr ""
437
- "Die anderen beiden Dateien in diesem .zip sind die Export Dateien die alle Ihre "
438
- "Daten und die Import Vorlage für WP All Import enthalten.\n"
439
  "\n"
440
- "Um diese Daten zu importieren, erstellen Sie einen neuen Import mit WP All Import "
441
- "und laden Sie dieses .zip hoch."
442
 
443
  #: ../../controllers/admin/manage.php:493
444
  msgid "File format not supported"
@@ -446,11 +507,11 @@ msgstr "Dieses Format wird nicht unterstützt."
446
 
447
  #: ../../controllers/admin/manage.php:499 ../../controllers/admin/manage.php:504
448
  msgid ""
449
- "The exported file is missing and can't be downloaded. Please re-run your export to "
450
- "re-generate it."
451
  msgstr ""
452
- "Die exportierte Datei fehlt und kann nicht heruntergeladen werden. Bitte starten "
453
- "Sie den Export erneut zur erneuten Erzeugung."
454
 
455
  #: ../../controllers/admin/settings.php:28
456
  msgid "Settings saved"
@@ -515,93 +576,95 @@ msgstr[1] "Elemente"
515
  msgid "more"
516
  msgstr "mehr"
517
 
518
- #: ../../helpers/wp_all_export_get_cpt_name.php:9
519
- msgid "Product Variations"
520
- msgstr "Produkt Variationen"
521
-
522
- #: ../../helpers/wp_all_export_get_cpt_name.php:19 ../../views/admin/export/index.
523
  #: php:67
524
  msgid "Users"
525
  msgstr "Benutzer"
526
 
527
- #: ../../helpers/wp_all_export_get_cpt_name.php:19
528
  msgid "User"
529
  msgstr "Benutzer"
530
 
531
- #: ../../helpers/wp_all_export_get_cpt_name.php:23
 
 
 
 
532
  msgid "Records"
533
  msgstr "Datensätze"
534
 
535
- #: ../../helpers/wp_all_export_get_cpt_name.php:23
536
  msgid "Record"
537
  msgstr "Datensatz"
538
 
539
- #: ../../libraries/XmlExportACF.php:156 ../../libraries/XmlExportACF.php:206
540
  msgid "ACF"
541
  msgstr "ACF"
542
 
543
- #: ../../libraries/XmlExportEngine.php:169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
544
  msgid "Standard"
545
  msgstr "Standard"
546
 
547
- #: ../../libraries/XmlExportEngine.php:173
548
  msgid "Taxonomies"
549
  msgstr "Taxonomien"
550
 
551
- #: ../../libraries/XmlExportEngine.php:177
552
  msgid "Custom Fields"
553
  msgstr "Individuelle Felder"
554
 
555
- #: ../../libraries/XmlExportEngine.php:181
556
  msgid "Other"
557
  msgstr "Sonstige"
558
 
559
- #: ../../libraries/XmlExportEngine.php:188 ../../libraries/XmlExportUser.php:199
560
- msgid "General"
561
- msgstr "Allgemein"
562
-
563
- #: ../../libraries/XmlExportEngine.php:243
564
  msgid "WP Query field is required"
565
  msgstr "WP Abfrage Feld wird benötigt"
566
 
567
- #: ../../libraries/XmlExportEngine.php:251
568
  msgid "No matching users found."
569
  msgstr "Keine passenden Benutzer gefunden."
570
 
571
- #: ../../libraries/XmlExportEngine.php:264
572
  msgid "Invalid query"
573
  msgstr "Ungültige Abfrage"
574
 
575
- #: ../../libraries/XmlExportEngine.php:267
576
  msgid "No matching posts found for WP_Query expression specified."
577
  msgstr "Keine passenden Posts für den WP_Query Ausdruck gefunden."
578
 
579
- #: ../../libraries/XmlExportEngine.php:294 ../../libraries/XmlExportEngine.php:312
580
  msgid "No matching posts found for selected post types."
581
  msgstr "Keine passenden Posts für die gewählten post typen gefunden."
582
 
583
- #: ../../libraries/XmlExportEngine.php:430 ../..
584
  #: /libraries/XmlExportWooCommerceOrder.php:886
585
  msgid "All"
586
  msgstr "Alle"
587
 
588
- #: ../../libraries/XmlExportEngine.php:449 ../../views/admin/export/template.php:73
589
- #: ../../views/admin/export/template.php:106 ../../views/admin/export/template.
590
  #: php:133
591
  msgid "Delete field"
592
  msgstr "Lösche Feld"
593
 
594
- #: ../../libraries/XmlExportUser.php:218 ../../libraries/XmlExportUser.php:292 ..
595
- #: /../libraries/XmlExportWooCommerce.php:111 ../..
596
- #: /libraries/XmlExportWooCommerce.php:279
597
- #: /libraries/XmlExportWooCommerceOrder.php:130
598
- #: /libraries/XmlExportWooCommerceOrder.php:945
599
- #: /views/admin/export/template/new_field_cpt.php:78
600
- #: /views/admin/export/template/new_field_shop_order.php:33
601
- #: /views/admin/export/template/new_field_user.php:57
602
- msgid "Advanced"
603
- msgstr "Erweitert"
604
-
605
  #: ../../libraries/XmlExportUser.php:231
606
  msgid "Network"
607
  msgstr "Netzwerk"
@@ -637,7 +700,7 @@ msgid "Completed Date"
637
  msgstr "Fertigstellungstermin"
638
 
639
  #: ../../libraries/XmlExportWooCommerceOrder.php:71 ../..
640
- #: /libraries/XmlExportWooCommerceOrder.php:964
641
  #: /views/admin/export/template/new_field_cpt.php:9
642
  msgid "Title"
643
  msgstr "Titel"
@@ -764,20 +827,20 @@ msgid "Customer Note"
764
  msgstr "Kunden Notiz"
765
 
766
  #: ../../views/admin/export/index.php:10 ../../views/admin/export/options.php:16 .
767
- #: ../views/admin/export/process.php:10 ../../views/admin/export/template.php:8
768
  #: ../../views/admin/manage/update.php:26
769
  msgid "Export to XML / CSV"
770
  msgstr "Exportiere zu XML / CSV"
771
 
772
  #: ../../views/admin/export/index.php:13 ../../views/admin/export/options.php:19 .
773
- #: ../views/admin/export/process.php:13 ../../views/admin/export/template.php:11
774
- #: ../../views/admin/manage/update.php:29
775
  msgid "Support"
776
  msgstr "Support"
777
 
778
  #: ../../views/admin/export/index.php:13 ../../views/admin/export/options.php:19 .
779
- #: ../views/admin/export/process.php:13 ../../views/admin/export/template.php:11
780
- #: ../../views/admin/manage/update.php:29
781
  msgid "Documentation"
782
  msgstr "Dokumentation"
783
 
@@ -797,37 +860,38 @@ msgstr "WP_Abfrage Ergebnisse"
797
  msgid "Choose a post type..."
798
  msgstr "Wählen Sie einen Post Typ..."
799
 
800
- #: ../../views/admin/export/index.php:79
801
  msgid "Post Type Query"
802
  msgstr "Post Typ Abfrage"
803
 
804
- #: ../../views/admin/export/index.php:80
805
  msgid "User Query"
806
  msgstr "Benutzer Abfrage"
807
 
808
- #: ../../views/admin/export/index.php:112
809
  msgid "Skip to Step 3"
810
  msgstr "Überspringe zu Schritt 3"
811
 
812
- #: ../../views/admin/export/index.php:114
813
  msgid "Continue to Step 2"
814
  msgstr "Weiter zu Schritt 2"
815
 
816
- #: ../../views/admin/export/index.php:116
817
  msgid "Auto Generate Export Template"
818
  msgstr "Export Vorlage automatisch erzeugen"
819
 
820
- #: ../../views/admin/export/index.php:123 ../../views/admin/export/options.php:202
821
- #: ../../views/admin/export/process.php:62 ../../views/admin/export/template. php:248
822
- #: ../../views/admin/manage/index.php:367 ../.. /views/admin/manage/scheduling.php:57
823
- #: ../../views/admin/manage/templates.php:19 ../../views/admin/manage/update.php:206
824
- #: ../../views/admin/settings/index. php:167
 
825
  msgid "Created by"
826
  msgstr "Erstellt von"
827
 
828
- #: ../../views/admin/export/options.php:54 ../../views/admin/export/options.php:191
829
- #: ../../views/admin/manage/update.php:6 ../../views/admin/manage/update.php:64
830
- #: ../../views/admin/manage/update.php:199
831
  msgid "Confirm & Run Export"
832
  msgstr "Bestätigen & Export starten"
833
 
@@ -844,7 +908,7 @@ msgstr "Zurück zu Schritt 2"
844
  msgid "Back to Manage Exports"
845
  msgstr "Zurück zu Exports Verwalten"
846
 
847
- #: ../../views/admin/export/options.php:195 ../../views/admin/manage/update.php:7
848
  #: ../../views/admin/manage/update.php:197
849
  msgid "Save Export Configuration"
850
  msgstr "Speichere Export Einstellungen"
@@ -855,11 +919,11 @@ msgstr "Export <span id=\"status\">in Bearbeitung</span>"
855
 
856
  #: ../../views/admin/export/process.php:23
857
  msgid ""
858
- "Exporting may take some time. Please do not close your browser or refresh the page "
859
- "until the process is complete."
860
  msgstr ""
861
- "Der Export wird einige Zeit benötigen. Bitte den Browser nicht schließen oder "
862
- "aktualisieren während die Bearbeitung läuft."
863
 
864
  #: ../../views/admin/export/process.php:29
865
  msgid "Time Elapsed"
@@ -890,7 +954,7 @@ msgstr "Teile %ss"
890
  msgid "Settings & Data for WP All Import"
891
  msgstr "Einstellungen & Daten für WP All Import"
892
 
893
- #: ../../views/admin/export/process.php:51 ../../views/admin/manage/index.php:140
894
  #: ../../views/admin/manage/index.php:147
895
  msgid "Bundle"
896
  msgstr "Paket"
@@ -901,35 +965,35 @@ msgstr "Wählen Sie die Daten die in die Exportdatei sollen."
901
 
902
  #: ../../views/admin/export/template.php:115
903
  msgid ""
904
- "Drag & drop data from \"Available Data\" on the right to include it in the export "
905
- "or click \"Add Field To Export\" below."
906
  msgstr ""
907
- "Drag & Drop Daten von \"Verfügbaren Daten\" auf der rechten Seite, um diese zum "
908
- "Export hinzuzufügen. Oder klicken Sie auf \"Füge Feld zum Export hinzu\"."
909
 
910
  #: ../../views/admin/export/template.php:139
911
  msgid ""
912
- "Warning: without an ID column, you won't be able to re-import this data using WP "
913
- "All Import."
914
  msgstr ""
915
- "Warnung: Ohne ID Spalte wird es nicht möglich sein diese Daten mit WP All Import "
916
- "erneut zu importieren."
917
 
918
  #: ../../views/admin/export/template.php:145
919
  msgid ""
920
- "Warning: without _sku and product_type columns, you won't be able to re-import "
921
- "this data using WP All Import."
922
  msgstr ""
923
- "Warnung: Ohne _sku und product_type Spalten wird es nicht möglich sein diese Daten "
924
- "mit WP All Import erneut zu importieren."
925
 
926
  #: ../../views/admin/export/template.php:151
927
  msgid ""
928
- "Warning: without post_type column, you won't be able to re-import this data using "
929
- "WP All Import."
930
  msgstr ""
931
- "Warnung: Ohne die post_typ Spalte wird es nicht möglich sein diese Daten mit WP "
932
- "All Import erneut zu importieren."
933
 
934
  #: ../../views/admin/export/template.php:157 ../../views/admin/export/template.
935
  #: php:283
@@ -942,11 +1006,12 @@ msgstr "Jedes Produkt in eigener Zeile anzeigen"
942
 
943
  #: ../../views/admin/export/template.php:163
944
  msgid ""
945
- "If an order contains multiple products, each product will have its own row. If "
946
- "disabled, each product will have its own column."
947
  msgstr ""
948
- "Wenn eine Bestellung mehrere Produkte enthält, wird jedes Produkt seine eigene "
949
- "Zeile haben. Wenn deaktiviert, wird jedes Produkt seine eigene Spalte haben."
 
950
 
951
  #: ../../views/admin/export/template.php:167
952
  msgid "Fill in empty columns"
@@ -954,12 +1019,12 @@ msgstr "Fülle leere Spalten"
954
 
955
  #: ../../views/admin/export/template.php:168
956
  msgid ""
957
- "If enabled, each order item will appear as its own row with all order info filled "
958
- "in for every column. If disabled, order info will only display on one row with "
959
- "only the order item info displaying in additional rows."
960
  msgstr ""
961
- "Wenn aktiviert, wird jeder bestellte Artikel als eigene Zeile erscheinen mit allen "
962
- "Bestellinformationen in jeder Spalte. Wenn deaktiviert, wird die "
963
  "Bestellinformation nur in einer Zeile angezeigt mit der Info des bestellten "
964
  "Artikels in zusätzlichen Zeilen."
965
 
@@ -1022,13 +1087,13 @@ msgstr "Datensätze"
1022
 
1023
  #: ../../views/admin/export/options/settings.php:14
1024
  msgid ""
1025
- "WP All Export must be able to process this many records in less than your server's "
1026
- "timeout settings. If your export fails before completion, to troubleshoot you "
1027
- "should lower this number."
1028
  msgstr ""
1029
  "WP All Export muss alle Datensätze innerhalb Ihres Servertimeouts bearbeiten "
1030
- "können. Wenn Ihr Export vor Fertigstellung fehlschlägt, sollten Sie die Anzahl der "
1031
- "Datensätze verringern."
1032
 
1033
  #: ../../views/admin/export/options/settings.php:19
1034
  #, php-format
@@ -1037,11 +1102,11 @@ msgstr "%s nur einmal exportieren"
1037
 
1038
  #: ../../views/admin/export/options/settings.php:20
1039
  msgid ""
1040
- "If re-run, this export will only include records that have not been previously "
1041
- "exported."
1042
  msgstr ""
1043
- "Bei erneutem Start wird dieser Export nur diese Datensätze einschließen die vorher "
1044
- "noch nicht exportiert wurden."
1045
 
1046
  #: ../../views/admin/export/options/settings.php:25
1047
  msgid "Include BOM in export file"
@@ -1049,8 +1114,8 @@ msgstr "Schließe BOM Datei in Exportdatei ein"
1049
 
1050
  #: ../../views/admin/export/options/settings.php:26
1051
  msgid ""
1052
- "The BOM will help some programs like Microsoft Excel read your export file if it "
1053
- "includes non-English characters."
1054
  msgstr ""
1055
  "Die BOM Datei wird einigen Programmen ( wie Microsoft Excel) helfen Ihre "
1056
  "Exportdatei zu lesen wenn diese nicht Englische Buchstaben enthält."
@@ -1091,29 +1156,163 @@ msgstr "Benutzerfreundlicher Name"
1091
  msgid "Save friendly name..."
1092
  msgstr "Benutzerfreundlicher Name speichern..."
1093
 
1094
- #: ../../views/admin/export/template/new_field_cpt.php:4 ../..
1095
- #: /views/admin/export/template/new_field_shop_order.php:4
 
1096
  #: /views/admin/export/template/new_field_user.php:4
1097
  msgid "What field would you like to export?"
1098
  msgstr "Welches Feld wollen Sie exportieren?"
1099
 
1100
- #: ../../views/admin/export/template/new_field_cpt.php:8 ../..
1101
- #: /views/admin/export/template/new_field_user.php:8 /views/admin/manage/index.php:27
 
 
1102
  msgid "ID"
1103
  msgstr "ID"
1104
 
1105
- #: ../../views/admin/export/template/new_field_cpt.php:10
 
 
 
 
 
 
 
 
 
 
 
1106
  msgid "Content"
1107
  msgstr "Inhalt"
1108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1109
  #: ../../views/admin/export/template/new_field_cpt.php:11
1110
  msgid "Excerpt"
1111
  msgstr "Ausschnitt"
1112
 
1113
- #: ../../views/admin/export/template/new_field_cpt.php:12
1114
- msgid "Date"
1115
- msgstr "Datum"
1116
-
1117
  #: ../../views/admin/export/template/new_field_cpt.php:13
1118
  msgid "Post Type"
1119
  msgstr "Post Typ:"
@@ -1138,10 +1337,6 @@ msgstr "Anhang"
1138
  msgid "Post Status"
1139
  msgstr "Post Status"
1140
 
1141
- #: ../../views/admin/export/template/new_field_cpt.php:21
1142
- msgid "Author"
1143
- msgstr "Autor "
1144
-
1145
  #: ../../views/admin/export/template/new_field_cpt.php:22
1146
  msgid "Post Slug"
1147
  msgstr "Post Slug"
@@ -1183,39 +1378,6 @@ msgstr "WooCommerce Bestellungen"
1183
  msgid "Advanced Custom Fields"
1184
  msgstr "Erweiterte benutzerdefinierte Felder"
1185
 
1186
- #: ../../views/admin/export/template/new_field_cpt.php:44 ../..
1187
- #: /views/admin/export/template/new_field_shop_order.php:19
1188
- #: /views/admin/export/template/new_field_user.php:35
1189
- msgid "SQL Query"
1190
- msgstr "SQL Abfrage"
1191
-
1192
- #: ../../views/admin/export/template/new_field_cpt.php:52 ../..
1193
- #: /views/admin/export/template/new_field_cpt.php:56
1194
- #: /views/admin/export/template/new_field_cpt.php:60
1195
- #: /views/admin/export/template/new_field_cpt.php:64
1196
- #: /views/admin/export/template/new_field_cpt.php:68
1197
- #: /views/admin/export/template/new_field_user.php:43
1198
- #: /views/admin/export/template/new_field_user.php:47
1199
- msgid "Field Name"
1200
- msgstr "Feld Name"
1201
-
1202
- #: ../../views/admin/export/template/new_field_cpt.php:73 ../..
1203
- #: /views/admin/export/template/new_field_shop_order.php:26
1204
- #: /views/admin/export/template/new_field_user.php:52
1205
- msgid "What would you like to name the column/element in your exported file?"
1206
- msgstr "Wie soll die Spalte oder das Element in Ihrer Exportdatei heißen?"
1207
-
1208
- #: ../../views/admin/export/template/new_field_cpt.php:82 ../..
1209
- #: /views/admin/export/template/new_field_shop_order.php:37
1210
- #: /views/admin/export/template/new_field_user.php:61
1211
- #, php-format
1212
- msgid ""
1213
- "%%ID%% will be replaced with the ID of the post being exported, example: SELECT "
1214
- "meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND meta_key='your_meta_key';"
1215
- msgstr ""
1216
- "%%ID%% wird ersetzt mit der ID des exportierten Posts, Beispielsweise: SELECT "
1217
- "meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND meta_key='your_meta_key';"
1218
-
1219
  #: ../../views/admin/export/template/new_field_cpt.php:87
1220
  msgid "Export Image URLs"
1221
  msgstr "Exportiere Bild URLs"
@@ -1228,80 +1390,6 @@ msgstr "Exportiere Bild Dateinamen"
1228
  msgid "Export Image File Paths"
1229
  msgstr "Exportiere Bild Dateipfade"
1230
 
1231
- #: ../../views/admin/export/template/new_field_cpt.php:94 ../..
1232
- #: /views/admin/export/template/new_field_shop_order.php:42
1233
- #: /views/admin/export/template/new_field_user.php:66
1234
- msgid "UNIX timestamp - PHP time()"
1235
- msgstr "UNIX Zeitstempel - PHP time()"
1236
-
1237
- #: ../../views/admin/export/template/new_field_cpt.php:95 ../..
1238
- #: /views/admin/export/template/new_field_shop_order.php:43
1239
- #: /views/admin/export/template/new_field_user.php:67
1240
- msgid "Natural Language PHP date()"
1241
- msgstr "Natürliche Sprache PHP date()"
1242
-
1243
- #: ../../views/admin/export/template/new_field_cpt.php:98 ../..
1244
- #: /views/admin/export/template/new_field_shop_order.php:46
1245
- #: /views/admin/export/template/new_field_user.php:70
1246
- msgid "date() Format"
1247
- msgstr "date() Format"
1248
-
1249
- #: ../../views/admin/export/template/new_field_cpt.php:105 ../..
1250
- #: /views/admin/export/template/new_field_shop_order.php:53
1251
- #: /views/admin/export/template/new_field_user.php:77
1252
- msgid "Export the value returned by a PHP function"
1253
- msgstr "Exportiere den Wert der von einer PHP Funktion zurückgegeben wurde"
1254
-
1255
- #: ../../views/admin/export/template/new_field_cpt.php:106 ../..
1256
- #: /views/admin/export/template/new_field_shop_order.php:54
1257
- #: /views/admin/export/template/new_field_user.php:78
1258
- msgid "The value of the field chosen for export will be passed to the PHP function."
1259
- msgstr "Der Wert des ausgewählten Feldes wird an die PHP Funktion weitergeleitet."
1260
-
1261
- #: ../../views/admin/export/template/new_field_cpt.php:120 ../..
1262
- #: /views/admin/export/template/new_field_shop_order.php:68
1263
- #: /views/admin/export/template/new_field_user.php:92
1264
- #: /views/admin/settings/index.php:150
1265
- msgid "Function Editor"
1266
- msgstr "Funktion Editor"
1267
-
1268
- #: ../../views/admin/export/template/new_field_cpt.php:120 ../..
1269
- #: /views/admin/export/template/new_field_shop_order.php:68
1270
- #: /views/admin/export/template/new_field_user.php:92
1271
- #: /views/admin/settings/index.php:158
1272
- #, php-format
1273
- msgid "Add functions here for use during your export. You can access this file at %s"
1274
- msgstr ""
1275
- "Füge hier Funktionen für den Export ein. Sie können auf diese Datei zugreifen bei "
1276
- "%s"
1277
-
1278
- #: ../../views/admin/export/template/new_field_cpt.php:129 ../..
1279
- #: /views/admin/export/template/new_field_shop_order.php:77
1280
- #: /views/admin/export/template/new_field_user.php:101
1281
- #: /views/admin/settings/index.php:157
1282
- msgid "Save Functions"
1283
- msgstr "Speichere Funktionen"
1284
-
1285
- #: ../../views/admin/export/template/new_field_cpt.php:144 ../..
1286
- #: /views/admin/export/template/new_field_shop_order.php:91
1287
- #: /views/admin/export/template/new_field_user.php:115
1288
- #: /views/admin/manage/index.php:52 ../../views/admin/manage/index.php:155
1289
- #: /views/admin/manage/index.php:356
1290
- msgid "Delete"
1291
- msgstr "Löschen"
1292
-
1293
- #: ../../views/admin/export/template/new_field_cpt.php:145 ../..
1294
- #: /views/admin/export/template/new_field_shop_order.php:92
1295
- #: /views/admin/export/template/new_field_user.php:116
1296
- msgid "Done"
1297
- msgstr "Fertig"
1298
-
1299
- #: ../../views/admin/export/template/new_field_cpt.php:146 ../..
1300
- #: /views/admin/export/template/new_field_shop_order.php:93
1301
- #: /views/admin/export/template/new_field_user.php:117
1302
- msgid "Close"
1303
- msgstr "Schließen "
1304
-
1305
  #: ../../views/admin/export/template/new_field_user.php:9
1306
  msgid "Login"
1307
  msgstr "Login"
@@ -1370,7 +1458,8 @@ msgstr "WP All Export Support"
1370
  #, php-format
1371
  msgid "Are you sure you want to delete <strong>%s</strong> selected %s?"
1372
  msgstr ""
1373
- "Sind Sie sicher dass Sie das selektierte <strong>%s</strong> löschen wollen %s?"
 
1374
 
1375
  #: ../../views/admin/manage/delete.php:1
1376
  msgid "Delete Export"
@@ -1451,7 +1540,7 @@ msgid "triggered with cron"
1451
  msgstr "Ausgelöst von cron"
1452
 
1453
  #: ../../views/admin/manage/index.php:263 ../../views/admin/manage/index.php:278 .
1454
- #: ../views/admin/manage/index.php:292
1455
  #, php-format
1456
  msgid "last activity %s ago"
1457
  msgstr "Letzte Aktivität vor %s "
@@ -1518,13 +1607,13 @@ msgstr "Permanent Löschen"
1518
 
1519
  #: ../../views/admin/manage/scheduling.php:6
1520
  msgid ""
1521
- "To schedule an export, you must create two cron jobs in your web hosting control "
1522
- "panel. One cron job will be used to run the Trigger script, the other to run the "
1523
- "Execution script."
1524
  msgstr ""
1525
  "Um einen Export zu planen, müssen Sie zwei Cron Jobs in Ihrem web Hosting "
1526
- "Bedienfeld erstellen. Ein Cron Job wird genutzt um das auslöse Skript zu starten, "
1527
- "das andere um das Ausführende Skript zu starten."
1528
 
1529
  #: ../../views/admin/manage/scheduling.php:17
1530
  msgid "Export File URL"
@@ -1544,13 +1633,13 @@ msgstr "Jedes mal wenn Sie den Export planen wollen, starten Sie das Auslöse Sk
1544
 
1545
  #: ../../views/admin/manage/scheduling.php:29
1546
  msgid ""
1547
- "To schedule the export to run once every 24 hours, run the trigger script every 24 "
1548
- "hours. Most hosts require you to use “wget” to access a URL. Ask your host for "
1549
- "details."
1550
  msgstr ""
1551
- "Um den Export einmal in 24 Stunden zu planen, starten Sie das Auslöse Skript alle "
1552
- "24 Stunden. Die meisten Hosts erlauben \"wget\" für den Zugriff auf eine URL. "
1553
- "Fragen Sie Ihren Host für Details."
1554
 
1555
  #: ../../views/admin/manage/scheduling.php:31 ../../views/admin/manage/scheduling.
1556
  #: php:43
@@ -1563,31 +1652,31 @@ msgstr "Ausführende Skript"
1563
 
1564
  #: ../../views/admin/manage/scheduling.php:37
1565
  msgid ""
1566
- "The Execution script actually executes the export, once it has been triggered with "
1567
- "the Trigger script."
1568
  msgstr ""
1569
  "Das ausführende Skript erledigt den Export, wenn es vom auslösenden Skript "
1570
  "gestartet wurde."
1571
 
1572
  #: ../../views/admin/manage/scheduling.php:39
1573
  msgid ""
1574
- "It processes in iteration (only exporting a few records each time it runs) to "
1575
- "optimize server load. It is recommended you run the execution script every 2 "
1576
- "minutes."
1577
  msgstr ""
1578
- "Es bearbeitet in Schleifendurchläufen (importiert nur ein paar Datensätze mit "
1579
- "jedem Durchlauf) zur Optimierung der Serverlast. Es wird empfohlen das Ausführende "
1580
- "Skript alle 2 Minuten zu starten."
1581
 
1582
  #: ../../views/admin/manage/scheduling.php:41
1583
  msgid ""
1584
- "It also operates this way in case of unexpected crashes by your web host. If it "
1585
- "crashes before the export is finished, the next run of the cron job two minutes "
1586
- "later will continue it where it left off, ensuring reliability."
1587
  msgstr ""
1588
- "So funktioniert es auch, wenn unerwartete Abstürze Ihres Hosts auftreten. Wenn es "
1589
- "abstürzt bevor der Export fertig ist, wird der nächste Lauf des cron Jobs zwei "
1590
- "Minuten später dort weiter machen, wo der vorherige aufgehört hat."
1591
 
1592
  #: ../../views/admin/manage/scheduling.php:47
1593
  msgid "Notes"
@@ -1595,29 +1684,32 @@ msgstr "Hinweis"
1595
 
1596
  #: ../../views/admin/manage/scheduling.php:50
1597
  msgid ""
1598
- "Your web host may require you to use a command other than wget, although wget is "
1599
- "most common. In this case, you must asking your web hosting provider for help."
 
1600
  msgstr ""
1601
  "Ihr Webhost benötigt evtl einen anderen Befehl als \"wget\", obwohl \"wget\" das "
1602
- "am häufigsten genutzte ist. In diesem Fall müssen Sie Ihren Webhost Anbieter um "
1603
- "Hilfe fragen."
1604
 
1605
  #: ../../views/admin/manage/templates.php:6
1606
  msgid ""
1607
- "Download your import templates and use them to import your exported file to a "
1608
- "separate WordPress/WP All Import installation."
1609
  msgstr ""
1610
- "Laden Sie Ihre Importvorlagen herunter und benutzen Sie diese für einen Import der "
1611
- "exportierten Daten in einer andere WordPress/WP All Import Installation."
 
1612
 
1613
  #: ../../views/admin/manage/templates.php:10
1614
  msgid ""
1615
- "Install these import templates in your separate WP All Import installation from "
1616
- "the All Import -> Settings page by clicking the \"Import Templates\" button."
 
1617
  msgstr ""
1618
- "Installieren Sie diese Importvorlagen in einer anderen WP All Import Installation "
1619
- "von All Import -> Einstellungen durch klicken auf den \"Importiere Vorlagen\" "
1620
- "Button."
1621
 
1622
  #: ../../views/admin/settings/index.php:17
1623
  msgid "Import/Export Templates"
@@ -1666,13 +1758,13 @@ msgstr "Verzeichnis Namen zufällig anordnen"
1666
  #: ../../views/admin/settings/index.php:81
1667
  #, php-format
1668
  msgid ""
1669
- "If enabled, exported files and temporary files will be saved in a folder with a "
1670
- "randomized name in %s.<br/><br/>If disabled, exported files will be saved in the "
1671
- "Media Library."
1672
  msgstr ""
1673
  "Wenn aktiviert werden exportierte Dateien und temporäre Dateien in einem "
1674
- "Verzeichnis mit zufälliger Namensgebung gespeichert %s.<br/><br/>Wenn deaktiviert "
1675
- "werden die Dateien in der Medien Bibliothek gespeichert."
1676
 
1677
  #: ../../views/admin/settings/index.php:88
1678
  msgid "Licenses"
@@ -1692,16 +1784,16 @@ msgstr "Aktiviere Lizenz"
1692
 
1693
  #: ../../views/admin/settings/index.php:106
1694
  msgid ""
1695
- "A license key is required to access plugin updates. You can use your license key "
1696
- "on an unlimited number of websites. Do not distribute your license key to 3rd "
1697
- "parties. You can get your license key in the <a target=\"_blank\" href=\"http://"
1698
- "www.wpallimport.com/portal\">customer portal</a>."
1699
  msgstr ""
1700
- "Ein Lizenz Schlüssel wird benötigt um Zugang auf Plugin Updates zu haben. Sie "
1701
- "können Ihren Lizenz Schlüssel auf einer unbestimmten Anzahl von Webseiten nutzen. "
1702
- "Geben Sie Ihren Schlüssel nicht an dritte weiter. Sie können Ihren Lizenz "
1703
- "Schlüssel im <a target=\"_blank\" href=\"http://www.wpallimport.com/portal"
1704
- "\">Kunden Portal</a> bekommen."
1705
 
1706
  #: ../../views/admin/settings/index.php:112
1707
  msgid "Zapier Integration"
@@ -1718,8 +1810,8 @@ msgstr "Erzeuge neuen API Schlüssel"
1718
  #: ../../views/admin/settings/index.php:121
1719
  msgid "Changing the key will require you to update your existing Zaps on Zapier."
1720
  msgstr ""
1721
- "Eine Änderung des Schlüssels wird eine Aktualisierung der Bestehenden Zaps auf "
1722
- "Zapier benötigen."
1723
 
1724
  #: ../../views/admin/settings/index.php:125
1725
  msgid "Zapier beta invitation URL"
3
  "Project-Id-Version: WP All Export Pro\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: Mon Nov 09 2015 10:39:03 GMT+0200 (EET)\n"
6
+ "PO-Revision-Date: Mon Dec 21 2015 20:10:37 GMT+0200 (EET)\n"
7
  "Last-Translator: admin <makstsiplyskov@gmail.loc>\n"
8
  "Language-Team: \n"
9
+ "Language: German\n"
10
+ "Plural-Forms: nplurals=2; plural=n != 1\n"
11
  "MIME-Version: 1.0\n"
12
  "Content-Type: text/plain; charset=UTF-8\n"
13
  "Content-Transfer-Encoding: 8bit\n"
14
  "X-Poedit-SourceCharset: UTF-8\n"
15
  "X-Poedit-Basepath: .\n"
16
+ "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
17
+ "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
18
+ "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
19
+ "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
20
+ "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
21
  "X-Loco-Target-Locale: de_DE\n"
22
+ "X-Generator: Loco - https://localise.biz/\n"
23
+ "X-Poedit-SearchPath-0: ../.."
24
+
25
+ #: ../../helpers/wp_all_export_get_cpt_name.php:13 ../../views/admin/export/index.
26
+ #: php:68
27
+ msgid "Comments"
28
+ msgstr ""
29
+
30
+ #: ../../helpers/wp_all_export_get_cpt_name.php:13
31
+ msgid "Comment"
32
+ msgstr ""
33
+
34
+ #: ../../libraries/XmlExportEngine.php:275 ../../libraries/XmlExportEngine.php:335
35
+ msgid "No matching comments found."
36
+ msgstr ""
37
+
38
+ #: ../../views/admin/export/index.php:82
39
+ msgid "Comment Query"
40
+ msgstr ""
41
+
42
+ #: ../../views/admin/export/template/new_field_comment.php:9
43
+ msgid "Post ID"
44
+ msgstr ""
45
+
46
+ #: ../../views/admin/export/template/new_field_comment.php:11
47
+ msgid "Author Name"
48
+ msgstr ""
49
+
50
+ #: ../../views/admin/export/template/new_field_comment.php:12
51
+ msgid "Author URL"
52
+ msgstr ""
53
+
54
+ #: ../../views/admin/export/template/new_field_comment.php:13
55
+ msgid "Author IP"
56
+ msgstr ""
57
+
58
+ #: ../../views/admin/export/template/new_field_comment.php:16
59
+ msgid "Karma"
60
+ msgstr ""
61
+
62
+ #: ../../views/admin/export/template/new_field_comment.php:17
63
+ msgid "Approved"
64
+ msgstr ""
65
+
66
+ #: ../../views/admin/export/template/new_field_comment.php:18
67
+ msgid "Agent"
68
+ msgstr ""
69
+
70
+ #: ../../views/admin/export/template/new_field_comment.php:19
71
+ msgid "Type"
72
+ msgstr ""
73
+
74
+ #: ../../views/admin/export/template/new_field_comment.php:20
75
+ msgid "Comment Parent"
76
+ msgstr ""
77
+
78
+ #: ../../views/admin/export/template/new_field_comment.php:21
79
+ msgid "User ID"
80
+ msgstr ""
81
+
82
+ #: ../../views/admin/export/template/new_field_comment.php:24
83
+ msgid "Custom Field / Comment Meta"
84
+ msgstr ""
85
 
 
86
  msgid "WP All Export Pro"
87
  msgstr "WP All Export Pro"
88
 
 
89
  msgid "http://www.wpallimport.com/export"
90
  msgstr "http://www.wpallimport.com/export"
91
 
 
92
  msgid ""
93
+ "Export any post type to a CSV or XML file. Edit the exported data, and then "
94
+ "re-import it later using WP All Import."
95
  msgstr ""
96
+ "Exportiere jeden post typ in eine CSV oder XML Datei. Editiere die "
97
+ "exportierten Daten und importieren Sie sie später mit WP All Import."
98
 
 
99
  msgid "Soflyy"
100
  msgstr "Soflyy"
101
 
104
  "Please de-activate and remove the free version of the WP All Export before "
105
  "activating the paid version."
106
  msgstr ""
107
+ "Bitte deaktivieren und entfernen Sie die freie Version von WP All Export "
108
+ "bevor Sie die bezahlte Version aktivieren."
109
 
110
+ #: ../../wp-all-export-pro.php:323 ../../wp-all-export-pro.php:327
111
  #, php-format
112
  msgid "Uploads folder %s must be writable"
113
  msgstr "Uploads Ordner%s muss schreibbar sein"
114
 
115
  #: ../../actions/admin_menu.php:11 ../../actions/admin_menu.php:14 ../..
116
+ #: /actions/admin_menu.php:15 ../../actions/admin_menu.php:16 ../..
117
+ #: /actions/admin_menu.php:17 ../../models/export/record.php:573 ../..
118
+ #: /views/admin/export/index.php:9 ../../views/admin/export/options.php:15 ../..
119
+ #: /views/admin/export/process.php:9 ../../views/admin/export/template.php:7 ../..
120
+ #: /views/admin/manage/index.php:4 ../../views/admin/manage/update.php:25 ../..
121
  #: /views/admin/settings/index.php:6
122
  msgid "WP All Export"
123
  msgstr "WP All Export"
134
  msgid "New Export"
135
  msgstr "Neuer Export"
136
 
137
+ #: ../../actions/admin_menu.php:15 ../../actions/admin_menu.php:15 ../..
138
+ #: /views/admin/export/process.php:57 ../../views/admin/manage/index.php:5
139
  msgid "Manage Exports"
140
  msgstr "Exports Verwalten"
141
 
142
+ #: ../../actions/admin_menu.php:16 ../../actions/admin_menu.php:16 ../..
143
+ #: /views/admin/settings/index.php:7
144
  msgid "Settings"
145
  msgstr "Einstellungen"
146
 
147
+ #: ../../actions/admin_menu.php:17 ../../actions/admin_menu.php:17
148
  msgid "Feedback"
149
  msgstr "Feedback"
150
 
151
  #: ../../actions/init.php:19 ../../actions/init.php:25
152
  msgid "Error. Incorrect API key, check the WP All Export Pro settings page."
153
  msgstr ""
154
+ "Fehler. Falscher API Schlüssel, bitte kontrollieren Sie die WP All Export "
155
+ "Pro Einstellungen."
156
 
157
  #: ../../actions/wp_ajax_export_available_rules.php:6 ../..
158
+ #: /actions/wp_ajax_export_available_rules.php:10 ../..
159
  #: /actions/wp_ajax_export_filtering.php:6 ../../actions/wp_ajax_export_filtering.
160
+ #: php:10 ../../actions/wp_ajax_export_filtering_count.php:6 ../..
161
+ #: /actions/wp_ajax_export_filtering_count.php:10 ../..
162
+ #: /actions/wp_ajax_export_preview.php:8 ../../actions/wp_ajax_export_preview.php:
163
+ #: 12 ../../actions/wp_ajax_generate_zapier_api_key.php:6 ../..
164
+ #: /actions/wp_ajax_generate_zapier_api_key.php:10 ../..
165
+ #: /actions/wp_ajax_save_functions.php:6 ../../actions/wp_ajax_save_functions.php:
166
+ #: 10 ../../actions/wp_ajax_wpallexport.php:8 ../../actions/wp_ajax_wpallexport.
167
+ #: php:12 ../../controllers/controller.php:117 ../../controllers/admin/manage.php:
168
+ #: 290 ../../controllers/admin/manage.php:325 ../../controllers/admin/manage.php:
169
+ #: 406 ../../controllers/admin/manage.php:459
170
  msgid "Security check"
171
  msgstr "Sicherheitskontrolle"
172
 
173
  #: ../../actions/wp_ajax_export_available_rules.php:21 ../..
174
+ #: /actions/wp_ajax_export_filtering.php:50 ../../views/admin/export/options.php:
175
+ #: 92 ../../views/admin/manage/update.php:100
176
  msgid "Select Rule"
177
  msgstr "Wähle Regel"
178
 
270
  #: ../../actions/wp_ajax_export_filtering.php:69 ../../views/admin/export/options.
271
  #: php:112 ../../views/admin/manage/update.php:120
272
  msgid ""
273
+ "No filtering options. Add filtering options to only export records matching "
274
+ "some specified criteria."
275
  msgstr ""
276
  "Keine Filteroptionen. Fügen Sie Filteroptionen hinzu um nur Datensätze zu "
277
  "exportieren die bestimmte Kriterien erfüllen."
298
  #: ../../actions/wp_ajax_export_filtering.php:119 ../..
299
  #: /views/admin/export/options.php:164 ../../views/admin/manage/update.php:172
300
  msgid ""
301
+ "Strict matching requires all variations to pass in order for the product to "
302
+ "be exported. Permissive matching allows the product to be exported if any of "
303
+ "the variations pass."
304
  msgstr ""
305
+ "Bei strenger Übereinstimmung müssen alle Variationen des Produkts für den "
306
+ "Export übereinstimmen. Bei der großzügigen Übereinstimmung muss nur eine "
307
+ "Variation übereinstimmen."
308
 
309
+ #: ../../actions/wp_ajax_export_filtering_count.php:91 ../..
310
  #: /views/admin/export/options.php:43 ../../views/admin/manage/update.php:54
311
  msgid "Your export is ready to run."
312
  msgstr "Ihr Export ist bereit zum Start."
313
 
314
+ #: ../../actions/wp_ajax_export_filtering_count.php:92 ../..
315
  #: /views/admin/export/options.php:45 ../../views/admin/manage/update.php:55
316
  #, php-format
317
  msgid "WP All Export will export %d %s."
318
  msgstr "WP All Export wird folgende exportieren %d %s."
319
 
320
+ #: ../../actions/wp_ajax_export_filtering_count.php:95 ../..
321
+ #: /actions/wp_ajax_export_filtering_count.php:98 ../../views/admin/manage/update.
322
  #: php:51
323
  msgid "Nothing to export."
324
  msgstr "Nichts zu exportieren"
325
 
326
+ #: ../../actions/wp_ajax_export_filtering_count.php:96
327
  #, php-format
328
  msgid "All %s have already been exported."
329
  msgstr "Alle %s wurden bereits exportiert."
330
 
331
+ #: ../../actions/wp_ajax_export_filtering_count.php:99 ../..
332
+ #: /actions/wp_ajax_export_filtering_count.php:113 ../..
333
+ #: /views/admin/manage/update.php:52
334
  #, php-format
335
  msgid "No matching %s found for selected filter rules."
336
  msgstr "Keine Übereinstimmung %s gefunden für die gewählten Filterregeln."
337
 
338
+ #: ../../actions/wp_ajax_export_filtering_count.php:111
339
  msgid "Continue to Step 2 to choose data to include in the export file."
340
  msgstr "Weiter zu Schritt 2 um die Daten für die Exportdatei zu wählen."
341
 
342
+ #: ../../actions/wp_ajax_export_preview.php:160
343
  msgid "Data not found."
344
  msgstr "Dateien nicht gefunden"
345
 
346
+ #: ../../actions/wp_ajax_export_preview.php:169
347
  msgid "This format is not supported."
348
  msgstr "Dieses Format wird nicht unterstützt."
349
 
410
  #: ../../classes/updater.php:238
411
  #, php-format
412
  msgid ""
413
+ "There is a new version of %1$s available. <a target=\"_blank\" "
414
+ "class=\"thickbox\" href=\"%2$s\">View version %3$s details</a>."
415
  msgstr ""
416
+ "Eine neue Version von %1$s ist verfügbar. <a target=\"_blank\" "
417
+ "class=\"thickbox\" href=\"%2$s\">Details ansehen von %3$s</a>."
418
 
419
  #: ../../classes/updater.php:245
420
  #, php-format
421
  msgid ""
422
+ "There is a new version of %1$s available. <a target=\"_blank\" "
423
+ "class=\"thickbox\" href=\"%2$s\">View version %3$s details</a> or <a "
424
+ "href=\"%4$s\">update now</a>."
425
  msgstr ""
426
+ "Eine neue Version von %1$s ist verfügbar. <a target=\"_blank\" "
427
+ "class=\"thickbox\" href=\"%2$s\">Details ansehen von %3$s</a> oder <a "
428
+ "href=\"%4$s\">jetzt aktualisieren</a>."
429
 
430
  #: ../../classes/updater.php:428
431
  msgid "You do not have permission to install plugin updates"
444
  msgstr "Setze Beschränkung für CSV Felder:"
445
 
446
  #: ../../controllers/admin/export.php:250 ../../controllers/admin/export.php:349 .
447
+ #: ./../controllers/admin/manage.php:226
448
  msgid "Options updated"
449
  msgstr "Optionen Aktualisiert"
450
 
489
 
490
  #: ../../controllers/admin/manage.php:376
491
  msgid ""
492
+ "The other two files in this zip are the export file containing all of your "
493
+ "data and the import template for WP All Import. \n"
494
  "\n"
495
+ "To import this data, create a new import with WP All Import and upload this "
496
+ "zip file."
497
  msgstr ""
498
+ "Die anderen beiden Dateien in diesem .zip sind die Export Dateien die alle "
499
+ "Ihre Daten und die Import Vorlage für WP All Import enthalten.\n"
500
  "\n"
501
+ "Um diese Daten zu importieren, erstellen Sie einen neuen Import mit WP All "
502
+ "Import und laden Sie dieses .zip hoch."
503
 
504
  #: ../../controllers/admin/manage.php:493
505
  msgid "File format not supported"
507
 
508
  #: ../../controllers/admin/manage.php:499 ../../controllers/admin/manage.php:504
509
  msgid ""
510
+ "The exported file is missing and can't be downloaded. Please re-run your "
511
+ "export to re-generate it."
512
  msgstr ""
513
+ "Die exportierte Datei fehlt und kann nicht heruntergeladen werden. Bitte "
514
+ "starten Sie den Export erneut zur erneuten Erzeugung."
515
 
516
  #: ../../controllers/admin/settings.php:28
517
  msgid "Settings saved"
576
  msgid "more"
577
  msgstr "mehr"
578
 
579
+ #: ../../helpers/wp_all_export_get_cpt_name.php:9 ../../views/admin/export/index.
 
 
 
 
580
  #: php:67
581
  msgid "Users"
582
  msgstr "Benutzer"
583
 
584
+ #: ../../helpers/wp_all_export_get_cpt_name.php:9
585
  msgid "User"
586
  msgstr "Benutzer"
587
 
588
+ #: ../../helpers/wp_all_export_get_cpt_name.php:18
589
+ msgid "Product Variations"
590
+ msgstr "Produkt Variationen"
591
+
592
+ #: ../../helpers/wp_all_export_get_cpt_name.php:28
593
  msgid "Records"
594
  msgstr "Datensätze"
595
 
596
+ #: ../../helpers/wp_all_export_get_cpt_name.php:28
597
  msgid "Record"
598
  msgstr "Datensatz"
599
 
600
+ #: ../../libraries/XmlExportACF.php:218 ../../libraries/XmlExportACF.php:268
601
  msgid "ACF"
602
  msgstr "ACF"
603
 
604
+ #: ../../libraries/XmlExportComment.php:136 ../../libraries/XmlExportEngine.php:
605
+ #: 191 ../../libraries/XmlExportUser.php:199
606
+ msgid "General"
607
+ msgstr "Allgemein"
608
+
609
+ #: ../../libraries/XmlExportComment.php:229 ../../libraries/XmlExportUser.php:218
610
+ #: ../../libraries/XmlExportUser.php:292 ../../libraries/XmlExportWooCommerce.php:
611
+ #: 111 ../../libraries/XmlExportWooCommerce.php:279 ../..
612
+ #: /libraries/XmlExportWooCommerceOrder.php:130 ../..
613
+ #: /libraries/XmlExportWooCommerceOrder.php:945 ../..
614
+ #: /views/admin/export/template/new_field_comment.php:43 ../..
615
+ #: /views/admin/export/template/new_field_cpt.php:78 ../..
616
+ #: /views/admin/export/template/new_field_shop_order.php:33 ../..
617
+ #: /views/admin/export/template/new_field_user.php:57
618
+ msgid "Advanced"
619
+ msgstr "Erweitert"
620
+
621
+ #: ../../libraries/XmlExportEngine.php:172
622
  msgid "Standard"
623
  msgstr "Standard"
624
 
625
+ #: ../../libraries/XmlExportEngine.php:176
626
  msgid "Taxonomies"
627
  msgstr "Taxonomien"
628
 
629
+ #: ../../libraries/XmlExportEngine.php:180
630
  msgid "Custom Fields"
631
  msgstr "Individuelle Felder"
632
 
633
+ #: ../../libraries/XmlExportEngine.php:184
634
  msgid "Other"
635
  msgstr "Sonstige"
636
 
637
+ #: ../../libraries/XmlExportEngine.php:253
 
 
 
 
638
  msgid "WP Query field is required"
639
  msgstr "WP Abfrage Feld wird benötigt"
640
 
641
+ #: ../../libraries/XmlExportEngine.php:261 ../../libraries/XmlExportEngine.php:318
642
  msgid "No matching users found."
643
  msgstr "Keine passenden Benutzer gefunden."
644
 
645
+ #: ../../libraries/XmlExportEngine.php:288
646
  msgid "Invalid query"
647
  msgstr "Ungültige Abfrage"
648
 
649
+ #: ../../libraries/XmlExportEngine.php:291
650
  msgid "No matching posts found for WP_Query expression specified."
651
  msgstr "Keine passenden Posts für den WP_Query Ausdruck gefunden."
652
 
653
+ #: ../../libraries/XmlExportEngine.php:353
654
  msgid "No matching posts found for selected post types."
655
  msgstr "Keine passenden Posts für die gewählten post typen gefunden."
656
 
657
+ #: ../../libraries/XmlExportEngine.php:474 ../..
658
  #: /libraries/XmlExportWooCommerceOrder.php:886
659
  msgid "All"
660
  msgstr "Alle"
661
 
662
+ #: ../../libraries/XmlExportEngine.php:493 ../../views/admin/export/template.php:
663
+ #: 73 ../../views/admin/export/template.php:106 ../../views/admin/export/template.
664
  #: php:133
665
  msgid "Delete field"
666
  msgstr "Lösche Feld"
667
 
 
 
 
 
 
 
 
 
 
 
 
668
  #: ../../libraries/XmlExportUser.php:231
669
  msgid "Network"
670
  msgstr "Netzwerk"
700
  msgstr "Fertigstellungstermin"
701
 
702
  #: ../../libraries/XmlExportWooCommerceOrder.php:71 ../..
703
+ #: /libraries/XmlExportWooCommerceOrder.php:964 ../..
704
  #: /views/admin/export/template/new_field_cpt.php:9
705
  msgid "Title"
706
  msgstr "Titel"
827
  msgstr "Kunden Notiz"
828
 
829
  #: ../../views/admin/export/index.php:10 ../../views/admin/export/options.php:16 .
830
+ #: ./../views/admin/export/process.php:10 ../../views/admin/export/template.php:8
831
  #: ../../views/admin/manage/update.php:26
832
  msgid "Export to XML / CSV"
833
  msgstr "Exportiere zu XML / CSV"
834
 
835
  #: ../../views/admin/export/index.php:13 ../../views/admin/export/options.php:19 .
836
+ #: ./../views/admin/export/process.php:13 ../../views/admin/export/template.php:
837
+ #: 11 ../../views/admin/manage/update.php:29
838
  msgid "Support"
839
  msgstr "Support"
840
 
841
  #: ../../views/admin/export/index.php:13 ../../views/admin/export/options.php:19 .
842
+ #: ./../views/admin/export/process.php:13 ../../views/admin/export/template.php:
843
+ #: 11 ../../views/admin/manage/update.php:29
844
  msgid "Documentation"
845
  msgstr "Dokumentation"
846
 
860
  msgid "Choose a post type..."
861
  msgstr "Wählen Sie einen Post Typ..."
862
 
863
+ #: ../../views/admin/export/index.php:80
864
  msgid "Post Type Query"
865
  msgstr "Post Typ Abfrage"
866
 
867
+ #: ../../views/admin/export/index.php:81
868
  msgid "User Query"
869
  msgstr "Benutzer Abfrage"
870
 
871
+ #: ../../views/admin/export/index.php:114
872
  msgid "Skip to Step 3"
873
  msgstr "Überspringe zu Schritt 3"
874
 
875
+ #: ../../views/admin/export/index.php:116
876
  msgid "Continue to Step 2"
877
  msgstr "Weiter zu Schritt 2"
878
 
879
+ #: ../../views/admin/export/index.php:118
880
  msgid "Auto Generate Export Template"
881
  msgstr "Export Vorlage automatisch erzeugen"
882
 
883
+ #: ../../views/admin/export/index.php:125 ../../views/admin/export/options.php:
884
+ #: 202 ../../views/admin/export/process.php:62 ../../views/admin/export/template.
885
+ #: php:248 ../../views/admin/manage/index.php:367 ../..
886
+ #: /views/admin/manage/scheduling.php:57 ../../views/admin/manage/templates.php:
887
+ #: 19 ../../views/admin/manage/update.php:206 ../../views/admin/settings/index.
888
+ #: php:167
889
  msgid "Created by"
890
  msgstr "Erstellt von"
891
 
892
+ #: ../../views/admin/export/options.php:54 ../../views/admin/export/options.php:
893
+ #: 191 ../../views/admin/manage/update.php:6 ../../views/admin/manage/update.php:
894
+ #: 64 ../../views/admin/manage/update.php:199
895
  msgid "Confirm & Run Export"
896
  msgstr "Bestätigen & Export starten"
897
 
908
  msgid "Back to Manage Exports"
909
  msgstr "Zurück zu Exports Verwalten"
910
 
911
+ #: ../../views/admin/export/options.php:195 ../../views/admin/manage/update.php:7
912
  #: ../../views/admin/manage/update.php:197
913
  msgid "Save Export Configuration"
914
  msgstr "Speichere Export Einstellungen"
919
 
920
  #: ../../views/admin/export/process.php:23
921
  msgid ""
922
+ "Exporting may take some time. Please do not close your browser or refresh "
923
+ "the page until the process is complete."
924
  msgstr ""
925
+ "Der Export wird einige Zeit benötigen. Bitte den Browser nicht schließen "
926
+ "oder aktualisieren während die Bearbeitung läuft."
927
 
928
  #: ../../views/admin/export/process.php:29
929
  msgid "Time Elapsed"
954
  msgid "Settings & Data for WP All Import"
955
  msgstr "Einstellungen & Daten für WP All Import"
956
 
957
+ #: ../../views/admin/export/process.php:51 ../../views/admin/manage/index.php:140
958
  #: ../../views/admin/manage/index.php:147
959
  msgid "Bundle"
960
  msgstr "Paket"
965
 
966
  #: ../../views/admin/export/template.php:115
967
  msgid ""
968
+ "Drag & drop data from \"Available Data\" on the right to include it in the "
969
+ "export or click \"Add Field To Export\" below."
970
  msgstr ""
971
+ "Drag & Drop Daten von \"Verfügbaren Daten\" auf der rechten Seite, um diese "
972
+ "zum Export hinzuzufügen. Oder klicken Sie auf \"Füge Feld zum Export hinzu\"."
973
 
974
  #: ../../views/admin/export/template.php:139
975
  msgid ""
976
+ "Warning: without an ID column, you won't be able to re-import this data "
977
+ "using WP All Import."
978
  msgstr ""
979
+ "Warnung: Ohne ID Spalte wird es nicht möglich sein diese Daten mit WP All "
980
+ "Import erneut zu importieren."
981
 
982
  #: ../../views/admin/export/template.php:145
983
  msgid ""
984
+ "Warning: without _sku and product_type columns, you won't be able to re-"
985
+ "import this data using WP All Import."
986
  msgstr ""
987
+ "Warnung: Ohne _sku und product_type Spalten wird es nicht möglich sein diese "
988
+ "Daten mit WP All Import erneut zu importieren."
989
 
990
  #: ../../views/admin/export/template.php:151
991
  msgid ""
992
+ "Warning: without post_type column, you won't be able to re-import this data "
993
+ "using WP All Import."
994
  msgstr ""
995
+ "Warnung: Ohne die post_typ Spalte wird es nicht möglich sein diese Daten mit "
996
+ "WP All Import erneut zu importieren."
997
 
998
  #: ../../views/admin/export/template.php:157 ../../views/admin/export/template.
999
  #: php:283
1006
 
1007
  #: ../../views/admin/export/template.php:163
1008
  msgid ""
1009
+ "If an order contains multiple products, each product will have its own row. "
1010
+ "If disabled, each product will have its own column."
1011
  msgstr ""
1012
+ "Wenn eine Bestellung mehrere Produkte enthält, wird jedes Produkt seine "
1013
+ "eigene Zeile haben. Wenn deaktiviert, wird jedes Produkt seine eigene Spalte "
1014
+ "haben."
1015
 
1016
  #: ../../views/admin/export/template.php:167
1017
  msgid "Fill in empty columns"
1019
 
1020
  #: ../../views/admin/export/template.php:168
1021
  msgid ""
1022
+ "If enabled, each order item will appear as its own row with all order info "
1023
+ "filled in for every column. If disabled, order info will only display on one "
1024
+ "row with only the order item info displaying in additional rows."
1025
  msgstr ""
1026
+ "Wenn aktiviert, wird jeder bestellte Artikel als eigene Zeile erscheinen mit "
1027
+ "allen Bestellinformationen in jeder Spalte. Wenn deaktiviert, wird die "
1028
  "Bestellinformation nur in einer Zeile angezeigt mit der Info des bestellten "
1029
  "Artikels in zusätzlichen Zeilen."
1030
 
1087
 
1088
  #: ../../views/admin/export/options/settings.php:14
1089
  msgid ""
1090
+ "WP All Export must be able to process this many records in less than your "
1091
+ "server's timeout settings. If your export fails before completion, to "
1092
+ "troubleshoot you should lower this number."
1093
  msgstr ""
1094
  "WP All Export muss alle Datensätze innerhalb Ihres Servertimeouts bearbeiten "
1095
+ "können. Wenn Ihr Export vor Fertigstellung fehlschlägt, sollten Sie die "
1096
+ "Anzahl der Datensätze verringern."
1097
 
1098
  #: ../../views/admin/export/options/settings.php:19
1099
  #, php-format
1102
 
1103
  #: ../../views/admin/export/options/settings.php:20
1104
  msgid ""
1105
+ "If re-run, this export will only include records that have not been "
1106
+ "previously exported."
1107
  msgstr ""
1108
+ "Bei erneutem Start wird dieser Export nur diese Datensätze einschließen die "
1109
+ "vorher noch nicht exportiert wurden."
1110
 
1111
  #: ../../views/admin/export/options/settings.php:25
1112
  msgid "Include BOM in export file"
1114
 
1115
  #: ../../views/admin/export/options/settings.php:26
1116
  msgid ""
1117
+ "The BOM will help some programs like Microsoft Excel read your export file "
1118
+ "if it includes non-English characters."
1119
  msgstr ""
1120
  "Die BOM Datei wird einigen Programmen ( wie Microsoft Excel) helfen Ihre "
1121
  "Exportdatei zu lesen wenn diese nicht Englische Buchstaben enthält."
1156
  msgid "Save friendly name..."
1157
  msgstr "Benutzerfreundlicher Name speichern..."
1158
 
1159
+ #: ../../views/admin/export/template/new_field_comment.php:4 ../..
1160
+ #: /views/admin/export/template/new_field_cpt.php:4 ../..
1161
+ #: /views/admin/export/template/new_field_shop_order.php:4 ../..
1162
  #: /views/admin/export/template/new_field_user.php:4
1163
  msgid "What field would you like to export?"
1164
  msgstr "Welches Feld wollen Sie exportieren?"
1165
 
1166
+ #: ../../views/admin/export/template/new_field_comment.php:8 ../..
1167
+ #: /views/admin/export/template/new_field_cpt.php:8 ../..
1168
+ #: /views/admin/export/template/new_field_user.php:8 ../..
1169
+ #: /views/admin/manage/index.php:27
1170
  msgid "ID"
1171
  msgstr "ID"
1172
 
1173
+ #: ../../views/admin/export/template/new_field_comment.php:10 ../..
1174
+ #: /views/admin/export/template/new_field_cpt.php:21
1175
+ msgid "Author"
1176
+ msgstr "Autor "
1177
+
1178
+ #: ../../views/admin/export/template/new_field_comment.php:14 ../..
1179
+ #: /views/admin/export/template/new_field_cpt.php:12
1180
+ msgid "Date"
1181
+ msgstr "Datum"
1182
+
1183
+ #: ../../views/admin/export/template/new_field_comment.php:15 ../..
1184
+ #: /views/admin/export/template/new_field_cpt.php:10
1185
  msgid "Content"
1186
  msgstr "Inhalt"
1187
 
1188
+ #: ../../views/admin/export/template/new_field_comment.php:25 ../..
1189
+ #: /views/admin/export/template/new_field_cpt.php:44 ../..
1190
+ #: /views/admin/export/template/new_field_shop_order.php:19 ../..
1191
+ #: /views/admin/export/template/new_field_user.php:35
1192
+ msgid "SQL Query"
1193
+ msgstr "SQL Abfrage"
1194
+
1195
+ #: ../../views/admin/export/template/new_field_comment.php:33 ../..
1196
+ #: /views/admin/export/template/new_field_cpt.php:52 ../..
1197
+ #: /views/admin/export/template/new_field_cpt.php:56 ../..
1198
+ #: /views/admin/export/template/new_field_cpt.php:60 ../..
1199
+ #: /views/admin/export/template/new_field_cpt.php:64 ../..
1200
+ #: /views/admin/export/template/new_field_cpt.php:68 ../..
1201
+ #: /views/admin/export/template/new_field_user.php:43 ../..
1202
+ #: /views/admin/export/template/new_field_user.php:47
1203
+ msgid "Field Name"
1204
+ msgstr "Feld Name"
1205
+
1206
+ #: ../../views/admin/export/template/new_field_comment.php:38 ../..
1207
+ #: /views/admin/export/template/new_field_cpt.php:73 ../..
1208
+ #: /views/admin/export/template/new_field_shop_order.php:26 ../..
1209
+ #: /views/admin/export/template/new_field_user.php:52
1210
+ msgid "What would you like to name the column/element in your exported file?"
1211
+ msgstr "Wie soll die Spalte oder das Element in Ihrer Exportdatei heißen?"
1212
+
1213
+ #: ../../views/admin/export/template/new_field_comment.php:47 ../..
1214
+ #: /views/admin/export/template/new_field_cpt.php:82 ../..
1215
+ #: /views/admin/export/template/new_field_shop_order.php:37 ../..
1216
+ #: /views/admin/export/template/new_field_user.php:61
1217
+ #, php-format
1218
+ msgid ""
1219
+ "%%ID%% will be replaced with the ID of the post being exported, example: "
1220
+ "SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND "
1221
+ "meta_key='your_meta_key';"
1222
+ msgstr ""
1223
+ "%%ID%% wird ersetzt mit der ID des exportierten Posts, Beispielsweise: "
1224
+ "SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND "
1225
+ "meta_key='your_meta_key';"
1226
+
1227
+ #: ../../views/admin/export/template/new_field_comment.php:52 ../..
1228
+ #: /views/admin/export/template/new_field_cpt.php:94 ../..
1229
+ #: /views/admin/export/template/new_field_shop_order.php:42 ../..
1230
+ #: /views/admin/export/template/new_field_user.php:66
1231
+ msgid "UNIX timestamp - PHP time()"
1232
+ msgstr "UNIX Zeitstempel - PHP time()"
1233
+
1234
+ #: ../../views/admin/export/template/new_field_comment.php:53 ../..
1235
+ #: /views/admin/export/template/new_field_cpt.php:95 ../..
1236
+ #: /views/admin/export/template/new_field_shop_order.php:43 ../..
1237
+ #: /views/admin/export/template/new_field_user.php:67
1238
+ msgid "Natural Language PHP date()"
1239
+ msgstr "Natürliche Sprache PHP date()"
1240
+
1241
+ #: ../../views/admin/export/template/new_field_comment.php:56 ../..
1242
+ #: /views/admin/export/template/new_field_cpt.php:98 ../..
1243
+ #: /views/admin/export/template/new_field_shop_order.php:46 ../..
1244
+ #: /views/admin/export/template/new_field_user.php:70
1245
+ msgid "date() Format"
1246
+ msgstr "date() Format"
1247
+
1248
+ #: ../../views/admin/export/template/new_field_comment.php:63 ../..
1249
+ #: /views/admin/export/template/new_field_cpt.php:105 ../..
1250
+ #: /views/admin/export/template/new_field_shop_order.php:53 ../..
1251
+ #: /views/admin/export/template/new_field_user.php:77
1252
+ msgid "Export the value returned by a PHP function"
1253
+ msgstr "Exportiere den Wert der von einer PHP Funktion zurückgegeben wurde"
1254
+
1255
+ #: ../../views/admin/export/template/new_field_comment.php:64 ../..
1256
+ #: /views/admin/export/template/new_field_cpt.php:106 ../..
1257
+ #: /views/admin/export/template/new_field_shop_order.php:54 ../..
1258
+ #: /views/admin/export/template/new_field_user.php:78
1259
+ msgid "The value of the field chosen for export will be passed to the PHP function."
1260
+ msgstr "Der Wert des ausgewählten Feldes wird an die PHP Funktion weitergeleitet."
1261
+
1262
+ #: ../../views/admin/export/template/new_field_comment.php:78 ../..
1263
+ #: /views/admin/export/template/new_field_cpt.php:120 ../..
1264
+ #: /views/admin/export/template/new_field_shop_order.php:68 ../..
1265
+ #: /views/admin/export/template/new_field_user.php:92 ../..
1266
+ #: /views/admin/settings/index.php:150
1267
+ msgid "Function Editor"
1268
+ msgstr "Funktion Editor"
1269
+
1270
+ #: ../../views/admin/export/template/new_field_comment.php:78 ../..
1271
+ #: /views/admin/export/template/new_field_cpt.php:120 ../..
1272
+ #: /views/admin/export/template/new_field_shop_order.php:68 ../..
1273
+ #: /views/admin/export/template/new_field_user.php:92 ../..
1274
+ #: /views/admin/settings/index.php:158
1275
+ #, php-format
1276
+ msgid "Add functions here for use during your export. You can access this file at %s"
1277
+ msgstr ""
1278
+ "Füge hier Funktionen für den Export ein. Sie können auf diese Datei "
1279
+ "zugreifen bei %s"
1280
+
1281
+ #: ../../views/admin/export/template/new_field_comment.php:87 ../..
1282
+ #: /views/admin/export/template/new_field_cpt.php:129 ../..
1283
+ #: /views/admin/export/template/new_field_shop_order.php:77 ../..
1284
+ #: /views/admin/export/template/new_field_user.php:101 ../..
1285
+ #: /views/admin/settings/index.php:157
1286
+ msgid "Save Functions"
1287
+ msgstr "Speichere Funktionen"
1288
+
1289
+ #: ../../views/admin/export/template/new_field_comment.php:101 ../..
1290
+ #: /views/admin/export/template/new_field_cpt.php:144 ../..
1291
+ #: /views/admin/export/template/new_field_shop_order.php:91 ../..
1292
+ #: /views/admin/export/template/new_field_user.php:115 ../..
1293
+ #: /views/admin/manage/index.php:52 ../../views/admin/manage/index.php:155 ../..
1294
+ #: /views/admin/manage/index.php:356
1295
+ msgid "Delete"
1296
+ msgstr "Löschen"
1297
+
1298
+ #: ../../views/admin/export/template/new_field_comment.php:102 ../..
1299
+ #: /views/admin/export/template/new_field_cpt.php:145 ../..
1300
+ #: /views/admin/export/template/new_field_shop_order.php:92 ../..
1301
+ #: /views/admin/export/template/new_field_user.php:116
1302
+ msgid "Done"
1303
+ msgstr "Fertig"
1304
+
1305
+ #: ../../views/admin/export/template/new_field_comment.php:103 ../..
1306
+ #: /views/admin/export/template/new_field_cpt.php:146 ../..
1307
+ #: /views/admin/export/template/new_field_shop_order.php:93 ../..
1308
+ #: /views/admin/export/template/new_field_user.php:117
1309
+ msgid "Close"
1310
+ msgstr "Schließen "
1311
+
1312
  #: ../../views/admin/export/template/new_field_cpt.php:11
1313
  msgid "Excerpt"
1314
  msgstr "Ausschnitt"
1315
 
 
 
 
 
1316
  #: ../../views/admin/export/template/new_field_cpt.php:13
1317
  msgid "Post Type"
1318
  msgstr "Post Typ:"
1337
  msgid "Post Status"
1338
  msgstr "Post Status"
1339
 
 
 
 
 
1340
  #: ../../views/admin/export/template/new_field_cpt.php:22
1341
  msgid "Post Slug"
1342
  msgstr "Post Slug"
1378
  msgid "Advanced Custom Fields"
1379
  msgstr "Erweiterte benutzerdefinierte Felder"
1380
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1381
  #: ../../views/admin/export/template/new_field_cpt.php:87
1382
  msgid "Export Image URLs"
1383
  msgstr "Exportiere Bild URLs"
1390
  msgid "Export Image File Paths"
1391
  msgstr "Exportiere Bild Dateipfade"
1392
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1393
  #: ../../views/admin/export/template/new_field_user.php:9
1394
  msgid "Login"
1395
  msgstr "Login"
1458
  #, php-format
1459
  msgid "Are you sure you want to delete <strong>%s</strong> selected %s?"
1460
  msgstr ""
1461
+ "Sind Sie sicher dass Sie das selektierte <strong>%s</strong> löschen wollen "
1462
+ "%s?"
1463
 
1464
  #: ../../views/admin/manage/delete.php:1
1465
  msgid "Delete Export"
1540
  msgstr "Ausgelöst von cron"
1541
 
1542
  #: ../../views/admin/manage/index.php:263 ../../views/admin/manage/index.php:278 .
1543
+ #: ./../views/admin/manage/index.php:292
1544
  #, php-format
1545
  msgid "last activity %s ago"
1546
  msgstr "Letzte Aktivität vor %s "
1607
 
1608
  #: ../../views/admin/manage/scheduling.php:6
1609
  msgid ""
1610
+ "To schedule an export, you must create two cron jobs in your web hosting "
1611
+ "control panel. One cron job will be used to run the Trigger script, the "
1612
+ "other to run the Execution script."
1613
  msgstr ""
1614
  "Um einen Export zu planen, müssen Sie zwei Cron Jobs in Ihrem web Hosting "
1615
+ "Bedienfeld erstellen. Ein Cron Job wird genutzt um das auslöse Skript zu "
1616
+ "starten, das andere um das Ausführende Skript zu starten."
1617
 
1618
  #: ../../views/admin/manage/scheduling.php:17
1619
  msgid "Export File URL"
1633
 
1634
  #: ../../views/admin/manage/scheduling.php:29
1635
  msgid ""
1636
+ "To schedule the export to run once every 24 hours, run the trigger script "
1637
+ "every 24 hours. Most hosts require you to use “wget” to access a URL. Ask "
1638
+ "your host for details."
1639
  msgstr ""
1640
+ "Um den Export einmal in 24 Stunden zu planen, starten Sie das Auslöse Skript "
1641
+ "alle 24 Stunden. Die meisten Hosts erlauben \"wget\" für den Zugriff auf eine "
1642
+ "URL. Fragen Sie Ihren Host für Details."
1643
 
1644
  #: ../../views/admin/manage/scheduling.php:31 ../../views/admin/manage/scheduling.
1645
  #: php:43
1652
 
1653
  #: ../../views/admin/manage/scheduling.php:37
1654
  msgid ""
1655
+ "The Execution script actually executes the export, once it has been "
1656
+ "triggered with the Trigger script."
1657
  msgstr ""
1658
  "Das ausführende Skript erledigt den Export, wenn es vom auslösenden Skript "
1659
  "gestartet wurde."
1660
 
1661
  #: ../../views/admin/manage/scheduling.php:39
1662
  msgid ""
1663
+ "It processes in iteration (only exporting a few records each time it runs) "
1664
+ "to optimize server load. It is recommended you run the execution script "
1665
+ "every 2 minutes."
1666
  msgstr ""
1667
+ "Es bearbeitet in Schleifendurchläufen (importiert nur ein paar Datensätze "
1668
+ "mit jedem Durchlauf) zur Optimierung der Serverlast. Es wird empfohlen das "
1669
+ "Ausführende Skript alle 2 Minuten zu starten."
1670
 
1671
  #: ../../views/admin/manage/scheduling.php:41
1672
  msgid ""
1673
+ "It also operates this way in case of unexpected crashes by your web host. If "
1674
+ "it crashes before the export is finished, the next run of the cron job two "
1675
+ "minutes later will continue it where it left off, ensuring reliability."
1676
  msgstr ""
1677
+ "So funktioniert es auch, wenn unerwartete Abstürze Ihres Hosts auftreten. "
1678
+ "Wenn es abstürzt bevor der Export fertig ist, wird der nächste Lauf des cron "
1679
+ "Jobs zwei Minuten später dort weiter machen, wo der vorherige aufgehört hat."
1680
 
1681
  #: ../../views/admin/manage/scheduling.php:47
1682
  msgid "Notes"
1684
 
1685
  #: ../../views/admin/manage/scheduling.php:50
1686
  msgid ""
1687
+ "Your web host may require you to use a command other than wget, although "
1688
+ "wget is most common. In this case, you must asking your web hosting provider "
1689
+ "for help."
1690
  msgstr ""
1691
  "Ihr Webhost benötigt evtl einen anderen Befehl als \"wget\", obwohl \"wget\" das "
1692
+ "am häufigsten genutzte ist. In diesem Fall müssen Sie Ihren Webhost Anbieter "
1693
+ "um Hilfe fragen."
1694
 
1695
  #: ../../views/admin/manage/templates.php:6
1696
  msgid ""
1697
+ "Download your import templates and use them to import your exported file to "
1698
+ "a separate WordPress/WP All Import installation."
1699
  msgstr ""
1700
+ "Laden Sie Ihre Importvorlagen herunter und benutzen Sie diese für einen "
1701
+ "Import der exportierten Daten in einer andere WordPress/WP All Import "
1702
+ "Installation."
1703
 
1704
  #: ../../views/admin/manage/templates.php:10
1705
  msgid ""
1706
+ "Install these import templates in your separate WP All Import installation "
1707
+ "from the All Import -> Settings page by clicking the \"Import Templates\" "
1708
+ "button."
1709
  msgstr ""
1710
+ "Installieren Sie diese Importvorlagen in einer anderen WP All Import "
1711
+ "Installation von All Import -> Einstellungen durch klicken auf den "
1712
+ "\"Importiere Vorlagen\" Button."
1713
 
1714
  #: ../../views/admin/settings/index.php:17
1715
  msgid "Import/Export Templates"
1758
  #: ../../views/admin/settings/index.php:81
1759
  #, php-format
1760
  msgid ""
1761
+ "If enabled, exported files and temporary files will be saved in a folder "
1762
+ "with a randomized name in %s.<br/><br/>If disabled, exported files will be "
1763
+ "saved in the Media Library."
1764
  msgstr ""
1765
  "Wenn aktiviert werden exportierte Dateien und temporäre Dateien in einem "
1766
+ "Verzeichnis mit zufälliger Namensgebung gespeichert %s.<br/><br/>Wenn "
1767
+ "deaktiviert werden die Dateien in der Medien Bibliothek gespeichert."
1768
 
1769
  #: ../../views/admin/settings/index.php:88
1770
  msgid "Licenses"
1784
 
1785
  #: ../../views/admin/settings/index.php:106
1786
  msgid ""
1787
+ "A license key is required to access plugin updates. You can use your license "
1788
+ "key on an unlimited number of websites. Do not distribute your license key "
1789
+ "to 3rd parties. You can get your license key in the <a target=\"_blank\" "
1790
+ "href=\"http://www.wpallimport.com/portal\">customer portal</a>."
1791
  msgstr ""
1792
+ "Ein Lizenz Schlüssel wird benötigt um Zugang auf Plugin Updates zu haben. "
1793
+ "Sie können Ihren Lizenz Schlüssel auf einer unbestimmten Anzahl von "
1794
+ "Webseiten nutzen. Geben Sie Ihren Schlüssel nicht an dritte weiter. Sie "
1795
+ "können Ihren Lizenz Schlüssel im <a target=\"_blank\" href=\"http://www."
1796
+ "wpallimport.com/portal\">Kunden Portal</a> bekommen."
1797
 
1798
  #: ../../views/admin/settings/index.php:112
1799
  msgid "Zapier Integration"
1810
  #: ../../views/admin/settings/index.php:121
1811
  msgid "Changing the key will require you to update your existing Zaps on Zapier."
1812
  msgstr ""
1813
+ "Eine Änderung des Schlüssels wird eine Aktualisierung der Bestehenden Zaps "
1814
+ "auf Zapier benötigen."
1815
 
1816
  #: ../../views/admin/settings/index.php:125
1817
  msgid "Zapier beta invitation URL"
i18n/languages/wp_all_export_plugin-es_ES.mo CHANGED
Binary file
i18n/languages/wp_all_export_plugin-es_ES.po CHANGED
@@ -1,145 +1,569 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP All Export\n"
 
4
  "POT-Creation-Date: 2015-10-05 22:42-0600\n"
5
- "PO-Revision-Date: 2015-11-13 11:18+0200\n"
 
6
  "Language-Team: \n"
 
 
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
- "X-Generator: Poedit 1.8.4\n"
11
- "X-Poedit-Basepath: .\n"
12
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
  "X-Poedit-SourceCharset: UTF-8\n"
14
- "X-Poedit-KeywordsList: __;_e;_ngettext;_n;_ngettext_noop;_n_noop;_x;_nx;"
15
- "_nx_noop;_ex;esc_attr__;esc_attr_e;esc_attr_x;esc_html__;esc_html_e;"
16
- "esc_html_x;_c;_nc\n"
17
- "Last-Translator: \n"
18
- "Language: es_419\n"
 
 
19
  "X-Poedit-SearchPath-0: .\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
- #: static/js/jquery/moment.js:6
22
- msgid "year"
23
- msgstr "año"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
- #: actions/admin_menu.php:11 actions/admin_menu.php:14
26
- #: actions/admin_menu.php:15 actions/admin_menu.php:16
27
- #: actions/admin_menu.php:17 models/export/record.php:487
28
- #: views/admin/export/index.php:9 views/admin/export/options.php:15
29
- #: views/admin/export/process.php:9 views/admin/export/template.php:7
30
- #: views/admin/manage/index.php:4 views/admin/settings/index.php:6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  msgid "WP All Export"
32
  msgstr "WP All Export"
33
 
34
- #: actions/admin_menu.php:11
35
  msgid "All Export"
36
  msgstr "All Export"
37
 
38
- #: actions/admin_menu.php:14
39
  msgid "Export to XML"
40
  msgstr "Exportar a XML"
41
 
42
- #: actions/admin_menu.php:14
43
  msgid "New Export"
44
  msgstr "Nueva Exportación"
45
 
46
- #: actions/admin_menu.php:15 views/admin/export/process.php:51
47
- #: views/admin/manage/index.php:5
48
  msgid "Manage Exports"
49
  msgstr "Manejar Exportaciones"
50
 
51
- #: actions/admin_menu.php:16 views/admin/settings/index.php:7
 
52
  msgid "Settings"
53
  msgstr "Configuración "
54
 
55
- #: actions/admin_menu.php:17
56
  msgid "Feedback"
57
  msgstr "Retroalimentación"
58
 
59
- #: actions/wp_ajax_export_available_rules.php:6
60
- #: actions/wp_ajax_export_available_rules.php:10
61
- #: actions/wp_ajax_export_filtering.php:6
62
- #: actions/wp_ajax_export_filtering.php:10
63
- #: actions/wp_ajax_export_filtering_count.php:6
64
- #: actions/wp_ajax_export_filtering_count.php:10
65
- #: actions/wp_ajax_export_preview.php:8 actions/wp_ajax_export_preview.php:12
66
- #: actions/wp_ajax_save_functions.php:6 actions/wp_ajax_save_functions.php:10
67
- #: actions/wp_ajax_wpallexport.php:8 actions/wp_ajax_wpallexport.php:12
68
- #: controllers/admin/manage.php:257 controllers/admin/manage.php:292
69
- #: controllers/admin/manage.php:378 controllers/controller.php:114
 
 
70
  msgid "Security check"
71
  msgstr "Contol de Seguridad"
72
 
73
- #: actions/wp_ajax_export_available_rules.php:21
74
- #: actions/wp_ajax_export_filtering.php:50 views/admin/export/options.php:92
 
75
  msgid "Select Rule"
76
  msgstr "Seleccionar Regla"
77
 
78
- #: actions/wp_ajax_export_available_rules.php:38
 
79
  msgid "equals"
80
  msgstr "es igual a"
81
 
82
- #: actions/wp_ajax_export_available_rules.php:39
 
83
  msgid "doesn't equal"
84
  msgstr "no es igual a"
85
 
86
- #: actions/wp_ajax_export_available_rules.php:40
87
- msgid "greater than"
88
- msgstr "mayor que"
89
-
90
- #: actions/wp_ajax_export_available_rules.php:41
91
- msgid "equal to or greater than"
92
- msgstr "es igual o mayor que"
93
-
94
- #: actions/wp_ajax_export_available_rules.php:42
95
- msgid "less than"
96
- msgstr "menor que"
97
-
98
- #: actions/wp_ajax_export_available_rules.php:43
99
- msgid "equal to or less than"
100
- msgstr "es igual a o menor que"
101
-
102
- #: actions/wp_ajax_export_available_rules.php:45
103
  msgid "contains"
104
  msgstr "contiene"
105
 
106
- #: actions/wp_ajax_export_available_rules.php:46
 
107
  msgid "doesn't contain"
108
  msgstr "no contiene"
109
 
110
- #: actions/wp_ajax_export_available_rules.php:47
 
111
  msgid "is empty"
112
  msgstr "esta vacío"
113
 
114
- #: actions/wp_ajax_export_available_rules.php:48
 
115
  msgid "is not empty"
116
  msgstr "no está vacío"
117
 
118
- #: actions/wp_ajax_export_filtering.php:30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  msgid "Add Filtering Options"
120
  msgstr "Agregar opciones de filtrado"
121
 
122
- #: actions/wp_ajax_export_filtering.php:36 views/admin/export/options.php:78
 
123
  msgid "Element"
124
  msgstr "Elemento"
125
 
126
- #: actions/wp_ajax_export_filtering.php:37 views/admin/export/options.php:79
 
127
  msgid "Rule"
128
  msgstr "Regla"
129
 
130
- #: actions/wp_ajax_export_filtering.php:38 views/admin/export/options.php:80
 
131
  msgid "Value"
132
  msgstr "Valor"
133
 
134
- #: actions/wp_ajax_export_filtering.php:44 views/admin/export/options.php:86
 
135
  msgid "Select Element"
136
  msgstr "Seleccionar Elemento"
137
 
138
- #: actions/wp_ajax_export_filtering.php:57 views/admin/export/options.php:99
 
139
  msgid "Add Rule"
140
  msgstr "Agregar Regla"
141
 
142
- #: actions/wp_ajax_export_filtering.php:69 views/admin/export/options.php:112
 
143
  msgid ""
144
  "No filtering options. Add filtering options to only export records matching "
145
  "some specified criteria."
@@ -147,23 +571,27 @@ msgstr ""
147
  "Sin opciones de filtrado. Agregue opciones de filtrado solo para exportar "
148
  "registros que coincidan algún criterio especificado."
149
 
150
- #: actions/wp_ajax_export_filtering.php:106
151
  msgid "Apply Filters To Export Data"
152
  msgstr "Aplicar Filtros Para Exportar Datos"
153
 
154
- #: actions/wp_ajax_export_filtering.php:114 views/admin/export/options.php:159
 
155
  msgid "Variable product matching rules: "
156
  msgstr "Reglas de coincidencia de producto variable:"
157
 
158
- #: actions/wp_ajax_export_filtering.php:116 views/admin/export/options.php:161
 
159
  msgid "Strict"
160
  msgstr "Estricto"
161
 
162
- #: actions/wp_ajax_export_filtering.php:117 views/admin/export/options.php:162
 
163
  msgid "Permissive"
164
  msgstr "Permisivo"
165
 
166
- #: actions/wp_ajax_export_filtering.php:119 views/admin/export/options.php:164
 
167
  msgid ""
168
  "Strict matching requires all variations to pass in order for the product to "
169
  "be exported. Permissive matching allows the product to be exported if any of "
@@ -173,142 +601,139 @@ msgstr ""
173
  "para el producto a ser exportado. Emparejamiento permisivo, permite que el "
174
  "producto sea exportado si ninguna de las variaciones pasan."
175
 
176
- #: actions/wp_ajax_export_filtering_count.php:68
 
 
 
 
 
 
 
 
 
 
 
177
  msgid "Continue to Step 2 to choose data to include in the export file."
178
  msgstr ""
179
  "Continúe al paso 2 para escoger la información para incluir al archivo de "
180
  "exportación"
181
 
182
- #: actions/wp_ajax_export_filtering_count.php:70
183
- #, php-format
184
- msgid "No matching %s found for selected filter rules"
185
- msgstr "No se encontró %s que coincidan para reglas de filtro seleccionadas"
186
-
187
- #: actions/wp_ajax_export_preview.php:125
188
  msgid "Data not found."
189
  msgstr "Datos no encontrados"
190
 
191
- #: actions/wp_ajax_export_preview.php:134
192
  msgid "This format is not supported."
193
  msgstr "Este formato no es soportado"
194
 
195
- #: actions/wp_ajax_save_functions.php:43
196
  msgid "PHP code must be wrapped in \"&lt;?php\" and \"?&gt;\""
197
  msgstr "El código PHP debe de estar envuelto en \"&lt;?php\" y \"?&gt;\""
198
 
199
- #: actions/wp_ajax_save_functions.php:52
200
  msgid "File has been successfully updated."
201
  msgstr "El archivo ha sido actualizado satisfactoriamente"
202
 
203
- #: actions/wp_loaded.php:32 actions/wp_loaded.php:67
204
  #, php-format
205
  msgid "Export #%s is currently in manually process. Request skipped."
206
  msgstr ""
207
  "Exportación #%s se encuentra actualmente en proceso manual. Solicitud "
208
  "omitida."
209
 
210
- #: actions/wp_loaded.php:42
211
  #, php-format
212
  msgid "#%s Cron job triggered."
213
  msgstr "#%s Trabajo cron desencadenado."
214
 
215
- #: actions/wp_loaded.php:46
216
  #, php-format
217
  msgid "Export #%s currently in process. Request skipped."
218
- msgstr ""
219
- "Exportación #%s se encuentra actualmente en proceso. Solicitud omitida."
220
 
221
- #: actions/wp_loaded.php:49
222
  #, php-format
223
  msgid "Export #%s already triggered. Request skipped."
224
  msgstr "Exportación #%s desencadenada. Solicitud omitida."
225
 
226
- #: actions/wp_loaded.php:64
227
  #, php-format
228
  msgid "Export #%s is not triggered. Request skipped."
229
  msgstr "Exportación #%s no ha sido desencadenada. Solicitud omitida."
230
 
231
- #: actions/wp_loaded.php:77
232
  #, php-format
233
  msgid "Export #%s complete"
234
  msgstr "Exportación #%s completada"
235
 
236
- #: actions/wp_loaded.php:82
237
- #, php-format
238
- msgid "Records Processed %s"
239
- msgstr "Registros Procesados %s"
240
-
241
- #: actions/wp_loaded.php:88
242
  #, php-format
243
  msgid "Export #%s already processing. Request skipped."
244
  msgstr "Exportación #%s esta siendo procesada. Solicitud omitida"
245
 
246
- #: classes/updater.php:187
247
  #, php-format
248
  msgid ""
249
- "There is a new version of %1$s available. <a target=\"_blank\" class="
250
- "\"thickbox\" href=\"%2$s\">View version %3$s details</a>."
251
  msgstr ""
252
- "Hay una nueva versión de %1$s disponible. <a target=\"_blank\" class="
253
- "\"thickbox\" href=\"%2$s\">Ver detalles de versión %3$s details</a>."
254
 
255
- #: classes/updater.php:194
256
  #, php-format
257
  msgid ""
258
- "There is a new version of %1$s available. <a target=\"_blank\" class="
259
- "\"thickbox\" href=\"%2$s\">View version %3$s details</a> or <a href=\"%4$s"
260
- "\">update now</a>."
261
  msgstr ""
262
- "Hay una nueva versión de %1$s disponible. <a target=\"_blank\" class="
263
- "\"thickbox\" href=\"%2$s\">Ver detalles de versión %3$s </a> o <a href=\"%4$s"
264
- "\">actualizar ahora</a>."
265
 
266
- #: classes/updater.php:346
267
  msgid "You do not have permission to install plugin updates"
268
  msgstr "Usted no tiene permisos para instalar actualizaciones de plugin"
269
 
270
- #: classes/updater.php:346
271
  msgid "Error"
272
  msgstr "Error"
273
 
274
- #: controllers/admin/export.php:202
275
  msgid "You haven't selected any columns for export."
276
  msgstr "No ha seleccionado ninguna columna para exportar."
277
 
278
- #: controllers/admin/export.php:206
279
- msgid "CSV delimiter must be specified"
280
- msgstr "Delimitador CSV debe de ser especificado"
281
-
282
- #: controllers/admin/export.php:223 controllers/admin/export.php:305
283
  msgid "Options updated"
284
  msgstr "Opciones actualizadas"
285
 
286
- #: controllers/admin/manage.php:56
287
  msgid "&laquo;"
288
  msgstr "&laquo;"
289
 
290
- #: controllers/admin/manage.php:57
291
  msgid "&raquo;"
292
  msgstr "&raquo;"
293
 
294
- #: controllers/admin/manage.php:155 views/admin/manage/index.php:292
295
  msgid "Export canceled"
296
  msgstr "Exportación cancelada"
297
 
298
- #: controllers/admin/manage.php:221
299
  msgid "Export deleted"
300
  msgstr "Exportación eliminada"
301
 
302
- #: controllers/admin/manage.php:249
303
  #, php-format
304
  msgid "%d %s deleted"
305
  msgstr "%d %s eliminada"
306
 
307
- #: controllers/admin/manage.php:249 views/admin/manage/bulk.php:10
308
  msgid "export"
309
  msgstr "exportar"
310
 
311
- #: controllers/admin/manage.php:343
312
  msgid ""
313
  "The other two files in this zip are the export file containing all of your "
314
  "data and the import template for WP All Import. \n"
@@ -317,17 +742,16 @@ msgid ""
317
  "zip file."
318
  msgstr ""
319
  "Los otros dos archivos en este zip son el archivo contenedor de la "
320
- "exportación de su datos y la plantilla de exportación para El Importador "
321
- "WP.\n"
322
  "\n"
323
  "Para importar esta información, cree una nueva importación con El Importador "
324
  "WP y cargue este archivo zip."
325
 
326
- #: controllers/admin/manage.php:412
327
  msgid "File format not supported"
328
  msgstr "El forma del archivo no es soportado"
329
 
330
- #: controllers/admin/manage.php:418 controllers/admin/manage.php:423
331
  msgid ""
332
  "The exported file is missing and can't be downloaded. Please re-run your "
333
  "export to re-generate it."
@@ -335,406 +759,359 @@ msgstr ""
335
  "El archivo exportado no puede ser encontrado y no puede ser descargado. Por "
336
  "favor ejecute nuevamente su exportación para volver a generarla."
337
 
338
- #: controllers/admin/settings.php:21
339
  msgid "Settings saved"
340
  msgstr "Configuraciones guardadas"
341
 
342
- #: filters/wpallexport_custom_types.php:4
343
  msgid "WooCommerce Products"
344
  msgstr "Productos de Woocommerce"
345
 
346
- #: helpers/pmxe_render_xml_element.php:44 helpers/pmxe_render_xml_text.php:9
 
347
  #, php-format
348
  msgid "<strong>%s</strong> %s more"
349
  msgstr "<strong>%s</strong> %s más"
350
 
351
- #: helpers/pmxe_render_xml_element.php:44 helpers/pmxe_render_xml_text.php:9
 
352
  msgid "element"
353
  msgstr "elemento"
354
 
355
- #: helpers/pmxe_render_xml_text.php:15
356
  msgid "more"
357
  msgstr "más"
358
 
359
- #: helpers/wp_all_export_get_cpt_name.php:9
360
- msgid "Product Variations"
361
- msgstr "Variaciones del Producto"
362
-
363
- #: helpers/wp_all_export_get_cpt_name.php:19 views/admin/export/index.php:67
364
  msgid "Users"
365
  msgstr "Usuarios"
366
 
367
- #: helpers/wp_all_export_get_cpt_name.php:19
368
  msgid "User"
369
  msgstr "Usuario"
370
 
371
- #: helpers/wp_all_export_get_cpt_name.php:23
 
 
 
 
372
  msgid "Records"
373
  msgstr "Registros"
374
 
375
- #: helpers/wp_all_export_get_cpt_name.php:23
376
  msgid "Record"
377
  msgstr "Registro"
378
 
379
- #: libraries/XmlExportACF.php:156 libraries/XmlExportACF.php:206
380
  msgid "ACF"
381
  msgstr "Campos Personalizados Avanzados (ACF)"
382
 
383
- #: libraries/XmlExportEngine.php:168
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  msgid "Standard"
385
  msgstr "Estándar"
386
 
387
- #: libraries/XmlExportEngine.php:172
388
  msgid "Taxonomies"
389
  msgstr "Taxonomías"
390
 
391
- #: libraries/XmlExportEngine.php:176
392
  msgid "Custom Fields"
393
  msgstr "Campos Personalizados"
394
 
395
- #: libraries/XmlExportEngine.php:180
396
  msgid "Other"
397
  msgstr "Otro"
398
 
399
- #: libraries/XmlExportEngine.php:187 libraries/XmlExportUser.php:199
400
- msgid "General"
401
- msgstr "General"
402
-
403
- #: libraries/XmlExportEngine.php:242
404
  msgid "WP Query field is required"
405
  msgstr "El campo de WP Query es requerido"
406
 
407
- #: libraries/XmlExportEngine.php:250
408
- msgid "No matching users found"
409
- msgstr "No se encontró usuarios que coincidan"
410
-
411
- #: libraries/XmlExportEngine.php:262
412
  msgid "Invalid query"
413
  msgstr "Consulta no válida"
414
 
415
- #: libraries/XmlExportEngine.php:265
416
- msgid "No matching posts found for WP_Query expression specified"
417
- msgstr ""
418
- "No se encontraron entradas que coincidan para la expresión especificada "
419
- "WP_Query"
420
-
421
- #: libraries/XmlExportEngine.php:289 libraries/XmlExportEngine.php:305
422
- msgid "No matching posts found for selected post types"
423
- msgstr ""
424
- "No se encontraron entradas que coincidan para el tipo de entradas elegido"
425
-
426
- #: libraries/XmlExportEngine.php:423
427
- #: libraries/XmlExportWooCommerceOrder.php:875
428
  msgid "All"
429
  msgstr "Todo"
430
 
431
- #: libraries/XmlExportEngine.php:442 views/admin/export/template.php:73
432
- #: views/admin/export/template.php:106 views/admin/export/template.php:133
 
433
  msgid "Delete field"
434
  msgstr "Eliminar campo"
435
 
436
- #: libraries/XmlExportUser.php:218 libraries/XmlExportUser.php:292
437
- #: libraries/XmlExportWooCommerce.php:111
438
- #: libraries/XmlExportWooCommerce.php:279
439
- #: libraries/XmlExportWooCommerceOrder.php:130
440
- #: libraries/XmlExportWooCommerceOrder.php:934
441
- #: views/admin/export/template/new_field_cpt.php:78
442
- #: views/admin/export/template/new_field_shop_order.php:33
443
- #: views/admin/export/template/new_field_user.php:57
444
- msgid "Advanced"
445
- msgstr "Avanzado"
446
-
447
- #: libraries/XmlExportUser.php:231
448
  msgid "Network"
449
  msgstr "Red"
450
 
451
- #: libraries/XmlExportWooCommerce.php:98 libraries/XmlExportWooCommerce.php:283
 
452
  msgid "Product Data"
453
  msgstr "Datos del Producto"
454
 
455
- #: libraries/XmlExportWooCommerceOrder.php:65
456
- #: libraries/XmlExportWooCommerceOrder.php:914
457
  msgid "Order"
458
  msgstr "Orden"
459
 
460
- #: libraries/XmlExportWooCommerceOrder.php:67
461
- #: libraries/XmlExportWooCommerceOrder.php:949
462
  msgid "Order ID"
463
  msgstr "ID orden"
464
 
465
- #: libraries/XmlExportWooCommerceOrder.php:68
466
- #: libraries/XmlExportWooCommerceOrder.php:950
467
  msgid "Order Key"
468
  msgstr "Clave de Orden "
469
 
470
- #: libraries/XmlExportWooCommerceOrder.php:69
471
- #: libraries/XmlExportWooCommerceOrder.php:951
472
  msgid "Order Date"
473
  msgstr "Fecha de Orden"
474
 
475
- #: libraries/XmlExportWooCommerceOrder.php:70
476
- #: libraries/XmlExportWooCommerceOrder.php:952
477
  msgid "Completed Date"
478
  msgstr "Fecha Completada"
479
 
480
- #: libraries/XmlExportWooCommerceOrder.php:71
481
- #: libraries/XmlExportWooCommerceOrder.php:953
482
- #: views/admin/export/template/new_field_cpt.php:9
483
  msgid "Title"
484
  msgstr "Título"
485
 
486
- #: libraries/XmlExportWooCommerceOrder.php:72
487
- #: libraries/XmlExportWooCommerceOrder.php:954
488
  msgid "Order Status"
489
  msgstr "Estado de Orden"
490
 
491
- #: libraries/XmlExportWooCommerceOrder.php:73
492
- #: libraries/XmlExportWooCommerceOrder.php:955
493
  msgid "Order Currency"
494
  msgstr "Moneda de Orden"
495
 
496
- #: libraries/XmlExportWooCommerceOrder.php:74
497
- #: libraries/XmlExportWooCommerceOrder.php:956
498
  msgid "Payment Method"
499
  msgstr "Método de Pago"
500
 
501
- #: libraries/XmlExportWooCommerceOrder.php:75
502
- #: libraries/XmlExportWooCommerceOrder.php:957
503
  msgid "Order Total"
504
  msgstr "Orden Total"
505
 
506
- #: libraries/XmlExportWooCommerceOrder.php:79
507
- #: libraries/XmlExportWooCommerceOrder.php:918
508
  msgid "Customer"
509
  msgstr "Cliente"
510
 
511
- #: libraries/XmlExportWooCommerceOrder.php:875
512
  msgid "Data"
513
  msgstr "Datos"
514
 
515
- #: libraries/XmlExportWooCommerceOrder.php:922
516
  msgid "Items"
517
  msgstr "Articulos"
518
 
519
- #: libraries/XmlExportWooCommerceOrder.php:926
520
  msgid "Taxes & Shipping"
521
  msgstr "Impuestos y Envíos"
522
 
523
- #: libraries/XmlExportWooCommerceOrder.php:930
524
  msgid "Fees & Discounts"
525
  msgstr "Comisiones y Descuentos"
526
 
527
- #: libraries/XmlExportWooCommerceOrder.php:970
528
  msgid "Product ID"
529
  msgstr "ID Producto"
530
 
531
- #: libraries/XmlExportWooCommerceOrder.php:971
532
  msgid "SKU"
533
  msgstr "SKU"
534
 
535
- #: libraries/XmlExportWooCommerceOrder.php:972
536
  msgid "Product Name"
537
  msgstr "Nombre del Producto"
538
 
539
- #: libraries/XmlExportWooCommerceOrder.php:973
540
  msgid "Product Variation Details"
541
  msgstr "Detalles de Variación de Productos "
542
 
543
- #: libraries/XmlExportWooCommerceOrder.php:974
544
  msgid "Quantity"
545
  msgstr "Cantidad "
546
 
547
- #: libraries/XmlExportWooCommerceOrder.php:975
548
  msgid "Item Cost"
549
  msgstr "Costo del Artículo"
550
 
551
- #: libraries/XmlExportWooCommerceOrder.php:976
552
  msgid "Item Total"
553
  msgstr "Total de Artículos"
554
 
555
- #: libraries/XmlExportWooCommerceOrder.php:985
556
  msgid "Rate Code (per tax)"
557
  msgstr "Código de Tarifa (por impuesto)"
558
 
559
- #: libraries/XmlExportWooCommerceOrder.php:986
560
  msgid "Rate Percentage (per tax)"
561
  msgstr "Porcentaje de tasa (por impuesto)"
562
 
563
- #: libraries/XmlExportWooCommerceOrder.php:987
564
  msgid "Amount (per tax)"
565
  msgstr "Monto (por impuesto)"
566
 
567
- #: libraries/XmlExportWooCommerceOrder.php:988
568
  msgid "Total Tax Amount"
569
  msgstr "Cantidad Total de Impuestos"
570
 
571
- #: libraries/XmlExportWooCommerceOrder.php:989
572
  msgid "Shipping Method"
573
  msgstr "Método de Envío"
574
 
575
- #: libraries/XmlExportWooCommerceOrder.php:990
576
  msgid "Shipping Cost"
577
  msgstr "Costo de Envío"
578
 
579
- #: libraries/XmlExportWooCommerceOrder.php:999
580
  msgid "Discount Amount (per coupon)"
581
  msgstr "Monto de Descuento (per coupon)"
582
 
583
- #: libraries/XmlExportWooCommerceOrder.php:1000
584
  msgid "Coupons Used"
585
  msgstr "Cupones Utilizado"
586
 
587
- #: libraries/XmlExportWooCommerceOrder.php:1001
588
  msgid "Total Discount Amount"
589
  msgstr "Monto Total de Descuento"
590
 
591
- #: libraries/XmlExportWooCommerceOrder.php:1002
592
  msgid "Fee Amount (per surcharge)"
593
  msgstr "Importe de la Cuenta (por recargo)"
594
 
595
- #: libraries/XmlExportWooCommerceOrder.php:1003
596
  msgid "Total Fee Amount"
597
  msgstr "Monto Total de Cuota"
598
 
599
- #: libraries/XmlExportWooCommerceOrder.php:1013
600
  msgid "Customer User ID"
601
  msgstr "ID del Cliente Usuario"
602
 
603
- #: libraries/XmlExportWooCommerceOrder.php:1014
604
  msgid "Customer Note"
605
  msgstr "Nota de Cliente"
606
 
607
- #: views/admin/export/index.php:10 views/admin/export/options.php:16
608
- #: views/admin/export/process.php:10 views/admin/export/template.php:8
 
609
  msgid "Export to XML / CSV"
610
  msgstr "Exportar a XML / CSV"
611
 
612
- #: views/admin/export/index.php:13 views/admin/export/options.php:19
613
- #: views/admin/export/process.php:13 views/admin/export/template.php:11
 
614
  msgid "Support"
615
  msgstr "Soporte"
616
 
617
- #: views/admin/export/index.php:13 views/admin/export/options.php:19
618
- #: views/admin/export/process.php:13 views/admin/export/template.php:11
 
619
  msgid "Documentation"
620
  msgstr "Documentación "
621
 
622
- #: views/admin/export/index.php:30
623
  msgid "First, choose what to export."
624
  msgstr "Primer, escoja que va a exportar."
625
 
626
- #: views/admin/export/index.php:33
627
  msgid "Specific Post Type"
628
  msgstr "Especifique tipo de entrada"
629
 
630
- #: views/admin/export/index.php:37
631
  msgid "WP_Query Results"
632
  msgstr "Resultados WP_Query"
633
 
634
- #: views/admin/export/index.php:56
635
  msgid "Choose a post type..."
636
  msgstr "Escoja un tipo de entrada...."
637
 
638
- #: views/admin/export/index.php:79
639
  msgid "Post Type Query"
640
  msgstr "Consulta del Tipo de Entrada"
641
 
642
- #: views/admin/export/index.php:80
643
  msgid "User Query"
644
  msgstr "Consulta de usuario"
645
 
646
- #: views/admin/export/index.php:112
647
  msgid "Skip to Step 3"
648
  msgstr "Vaya al paso 3"
649
 
650
- #: views/admin/export/index.php:114
651
  msgid "Continue to Step 2"
652
  msgstr "Continuar al paso 2"
653
 
654
- #: views/admin/export/index.php:116
655
  msgid "Auto Generate Export Template"
656
  msgstr "Auto generar plantilla de exportación"
657
 
658
- #: views/admin/export/index.php:123 views/admin/export/options.php:238
659
- #: views/admin/export/process.php:56 views/admin/export/template.php:214
660
- #: views/admin/manage/index.php:359 views/admin/manage/scheduling.php:57
661
- #: views/admin/manage/templates.php:19 views/admin/settings/index.php:91
 
 
662
  msgid "Created by"
663
  msgstr "Creado por"
664
 
665
- #: views/admin/export/options.php:43
666
- msgid "Your export is ready to run."
667
- msgstr "Su exportación está lista para ejecutar."
668
-
669
- #: views/admin/export/options.php:45
670
- #, php-format
671
- msgid "WP All Export will export %d %s."
672
- msgstr "WP All Export exportará %d %s."
673
-
674
- #: views/admin/export/options.php:54 views/admin/export/options.php:227
675
  msgid "Confirm & Run Export"
676
  msgstr "Confirmar y ejecutar exportación"
677
 
678
- #: views/admin/export/options.php:70
679
  msgid "Filters"
680
  msgstr "Filtros"
681
 
682
- #: views/admin/export/options.php:185
683
- msgid "Advanced Export"
684
- msgstr "Exportación avanzada"
685
-
686
- #: views/admin/export/options.php:195
687
- msgid "Include BOM in export file"
688
- msgstr "Incluyen BOM en archivo de exportación"
689
-
690
- #: views/admin/export/options.php:196
691
- msgid ""
692
- "The BOM will help some programs like Microsoft Excel read your export file "
693
- "if it includes non-English characters."
694
- msgstr ""
695
- "El BOM le ayudará a algunos programas como Microsoft Excel leer el archivo "
696
- "de exportación si incluye caracteres no ingleses."
697
-
698
- #: views/admin/export/options.php:199
699
- msgid "In each iteration, process"
700
- msgstr "En cada iteración, proceso de"
701
-
702
- #: views/admin/export/options.php:199
703
- msgid "records"
704
- msgstr "registros"
705
-
706
- #: views/admin/export/options.php:200
707
- msgid ""
708
- "WP All Export must be able to process this many records in less than your "
709
- "server's timeout settings. If your export fails before completion, to "
710
- "troubleshoot you should lower this number."
711
- msgstr "El Exportador WP debe ser capaz de procesar "
712
-
713
- #: views/admin/export/options.php:206
714
- msgid "Friendly Name:"
715
- msgstr "Nombre descriptivo:"
716
-
717
- #: views/admin/export/options.php:207
718
- msgid "Save friendly name..."
719
- msgstr "Guardar nombre descriptivo..."
720
-
721
- #: views/admin/export/options.php:225
722
  msgid "Back to Step 2"
723
  msgstr "Regresar al paso 2"
724
 
725
- #: views/admin/export/options.php:230 views/admin/export/template.php:207
 
726
  msgid "Back to Manage Exports"
727
  msgstr "Regresar a gestionar las exportaciones"
728
 
729
- #: views/admin/export/options.php:231
 
730
  msgid "Save Export Configuration"
731
  msgstr "Guardar configuración de exportación"
732
 
733
- #: views/admin/export/process.php:22
734
  msgid "Export <span id=\"status\">in Progress...</span>"
735
  msgstr "Exportación <span id=\"status\">en progreso...</span>"
736
 
737
- #: views/admin/export/process.php:23
738
  msgid ""
739
  "Exporting may take some time. Please do not close your browser or refresh "
740
  "the page until the process is complete."
@@ -742,40 +1119,40 @@ msgstr ""
742
  "Exportar puede tomar algún tiempo. Por favor, no cierre su navegador o "
743
  "actualizar la página hasta que finalice el proceso."
744
 
745
- #: views/admin/export/process.php:29
746
  msgid "Time Elapsed"
747
  msgstr "Tiempo Transcurrido"
748
 
749
- #: views/admin/export/process.php:31
750
  msgid "Exported"
751
  msgstr "Exportado"
752
 
753
- #: views/admin/export/process.php:36
754
  msgid "Export Complete!"
755
  msgstr "Exportación completa!"
756
 
757
- #: views/admin/export/process.php:37
758
  msgid "WP All Export successfully exported your data!"
759
  msgstr "¡WP All Export ha exportado con éxito sus datos!"
760
 
761
- #: views/admin/export/process.php:38
762
  msgid "Download Data"
763
  msgstr "Descargar datos"
764
 
765
- #: views/admin/export/process.php:45 views/admin/manage/index.php:139
766
- #: views/admin/manage/index.php:145
767
- msgid "Bundle"
768
- msgstr "Bulto"
769
-
770
- #: views/admin/export/process.php:46
771
  msgid "Settings & Data for WP All Import"
772
  msgstr "Ajustes y datos para WP All Import"
773
 
774
- #: views/admin/export/template.php:23
 
 
 
 
 
775
  msgid "Choose data to include in the export file."
776
  msgstr "Elegir los datos a incluir en el archivo de exportación."
777
 
778
- #: views/admin/export/template.php:115
779
  msgid ""
780
  "Drag & drop data from \"Available Data\" on the right to include it in the "
781
  "export or click \"Add Field To Export\" below."
@@ -784,7 +1161,7 @@ msgstr ""
784
  "incluir en la exportación o haga clic en \"Agregar campo a exportar\" a "
785
  "continuación."
786
 
787
- #: views/admin/export/template.php:139
788
  msgid ""
789
  "Warning: without an ID column, you won't be able to re-import this data "
790
  "using WP All Import."
@@ -792,7 +1169,7 @@ msgstr ""
792
  "ADVERTENCIA: sin una identificación de columna, usted no podrá re-importar "
793
  "estos datos usando El Importador WP."
794
 
795
- #: views/admin/export/template.php:145
796
  msgid ""
797
  "Warning: without _sku and product_type columns, you won't be able to re-"
798
  "import this data using WP All Import."
@@ -800,7 +1177,7 @@ msgstr ""
800
  "ADVERTENCIA: sin columnas _sku y product_type, usted no podrá re-importar "
801
  "estos datos usando El Importador WP."
802
 
803
- #: views/admin/export/template.php:151
804
  msgid ""
805
  "Warning: without post_type column, you won't be able to re-import this data "
806
  "using WP All Import."
@@ -808,564 +1185,556 @@ msgstr ""
808
  "ADVERTENCIA: sin columna post_type, usted no podrá re-importar estos datos "
809
  "usando El Importador WP."
810
 
811
- #: views/admin/export/template.php:157 views/admin/export/template.php:249
 
812
  msgid "Add Field To Export"
813
  msgstr "Agregar Campo para Exportar"
814
 
815
- #: views/admin/export/template.php:162
816
  msgid "Display each product in its own row"
817
  msgstr "Mostrar cada producto en su propia fila"
818
 
819
- #: views/admin/export/template.php:163
820
- msgid "If an order contains multiple products, each product have its own row."
821
- msgstr ""
822
- "Si un pedido contiene varios productos, cada producto tiene su propia fila."
823
-
824
- #: views/admin/export/template.php:170
825
  msgid "Preview A Row"
826
  msgstr "Vista previa de Fila"
827
 
828
- #: views/admin/export/template.php:176
829
  msgid "Export File Format:"
830
  msgstr "Formato de archivo de exportación:"
831
 
832
- #: views/admin/export/template.php:181
833
  msgid "XML"
834
  msgstr "XML"
835
 
836
- #: views/admin/export/template.php:185
837
  msgid "CSV"
838
  msgstr "CSV"
839
 
840
- #: views/admin/export/template.php:188
841
  msgid "Delimiter:"
842
  msgstr "Delimitador:"
843
 
844
- #: views/admin/export/template.php:209
845
- msgid "Continue to Step 3"
846
- msgstr "Continuar al paso 3"
847
-
848
- #: views/admin/export/template.php:224
849
  msgid "Available Data"
850
  msgstr "Datos disponibles"
851
 
852
- #: views/admin/export/template.php:230
853
  msgid "Auto Generate"
854
  msgstr "Auto generar"
855
 
856
- #: views/admin/export/template.php:249
857
  msgid "Edit Export Field"
858
  msgstr "Editar campo de exportación"
859
 
860
- #: views/admin/export/template/new_field_cpt.php:4
861
- #: views/admin/export/template/new_field_shop_order.php:4
862
- #: views/admin/export/template/new_field_user.php:4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
863
  msgid "What field would you like to export?"
864
  msgstr "¿Qué campo quieres exportar?"
865
 
866
- #: views/admin/export/template/new_field_cpt.php:8
867
- #: views/admin/export/template/new_field_user.php:8
868
- #: views/admin/manage/index.php:27
 
869
  msgid "ID"
870
  msgstr "ID"
871
 
872
- #: views/admin/export/template/new_field_cpt.php:10
 
 
 
 
 
 
 
 
 
 
 
873
  msgid "Content"
874
  msgstr "Contenido"
875
 
876
- #: views/admin/export/template/new_field_cpt.php:11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
877
  msgid "Excerpt"
878
  msgstr "Extracto"
879
 
880
- #: views/admin/export/template/new_field_cpt.php:12
881
- msgid "Date"
882
- msgstr "Fecha"
883
-
884
- #: views/admin/export/template/new_field_cpt.php:13
885
  msgid "Post Type"
886
  msgstr "Tipo de Entrada"
887
 
888
- #: views/admin/export/template/new_field_cpt.php:14
889
  msgid "Categories / Taxonomies"
890
  msgstr "Categorías / taxonomías"
891
 
892
- #: views/admin/export/template/new_field_cpt.php:15
893
  msgid "Custom Field / Post Meta"
894
  msgstr "Campo personalizado / poste de Meta"
895
 
896
- #: views/admin/export/template/new_field_cpt.php:16
897
  msgid "Images / Media"
898
  msgstr "Imágenes / Media"
899
 
900
- #: views/admin/export/template/new_field_cpt.php:17
901
  msgid "Attachment"
902
  msgstr "Archivo Adjunto"
903
 
904
- #: views/admin/export/template/new_field_cpt.php:20
905
  msgid "Post Status"
906
  msgstr "Estado de Entrada"
907
 
908
- #: views/admin/export/template/new_field_cpt.php:21
909
- msgid "Author"
910
- msgstr "Autor"
911
-
912
- #: views/admin/export/template/new_field_cpt.php:22
913
  msgid "Post Slug"
914
  msgstr "Slug de Entrada"
915
 
916
- #: views/admin/export/template/new_field_cpt.php:23
917
  msgid "Post Format"
918
  msgstr "Formato de Entrada"
919
 
920
- #: views/admin/export/template/new_field_cpt.php:24
921
  msgid "Template"
922
  msgstr "Plantilla"
923
 
924
- #: views/admin/export/template/new_field_cpt.php:25
925
  msgid "Parent"
926
  msgstr "Padre"
927
 
928
- #: views/admin/export/template/new_field_cpt.php:26
929
  msgid "Menu Order"
930
  msgstr "Orden de Menús"
931
 
932
- #: views/admin/export/template/new_field_cpt.php:27
933
  msgid "Permalink"
934
  msgstr "Enlace permanente"
935
 
936
- #: views/admin/export/template/new_field_cpt.php:32
937
  msgid "WooCommerce Data"
938
  msgstr "Datos WooCommerce "
939
 
940
- #: views/admin/export/template/new_field_cpt.php:33
941
  msgid "WooCommerce Taxonomies"
942
  msgstr "Taxonomías WooCommerce "
943
 
944
- #: views/admin/export/template/new_field_cpt.php:36
945
  msgid "WooCommerce Order"
946
  msgstr "Orden WooCommerce "
947
 
948
- #: views/admin/export/template/new_field_cpt.php:39
949
- #: views/admin/export/template/new_field_user.php:30
950
  msgid "Advanced Custom Fields"
951
  msgstr "Campos Avanzados Personalizados"
952
 
953
- #: views/admin/export/template/new_field_cpt.php:44
954
- #: views/admin/export/template/new_field_shop_order.php:19
955
- #: views/admin/export/template/new_field_user.php:35
956
- msgid "SQL Query"
957
- msgstr "Consulta SQL"
958
-
959
- #: views/admin/export/template/new_field_cpt.php:52
960
- #: views/admin/export/template/new_field_cpt.php:56
961
- #: views/admin/export/template/new_field_cpt.php:60
962
- #: views/admin/export/template/new_field_cpt.php:64
963
- #: views/admin/export/template/new_field_cpt.php:68
964
- #: views/admin/export/template/new_field_user.php:43
965
- #: views/admin/export/template/new_field_user.php:47
966
- msgid "Field Name"
967
- msgstr "Nombre del Campo"
968
-
969
- #: views/admin/export/template/new_field_cpt.php:73
970
- #: views/admin/export/template/new_field_shop_order.php:26
971
- #: views/admin/export/template/new_field_user.php:52
972
- msgid "What would you like to name the column/element in your exported file?"
973
- msgstr "¿Cómo te gustaría nombrar la columna/elemento en el archivo exportado?"
974
-
975
- #: views/admin/export/template/new_field_cpt.php:82
976
- #: views/admin/export/template/new_field_shop_order.php:37
977
- #: views/admin/export/template/new_field_user.php:61
978
- #, php-format
979
- msgid ""
980
- "%%ID%% will be replaced with the ID of the post being exported, example: "
981
- "SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND "
982
- "meta_key='your_meta_key';"
983
- msgstr ""
984
- "%%ID%% será reemplazado por el ID de la entrada exportada, ejemplo: "
985
- "SELECCIONAR meta_value DESDE wp_postmeta DONDE post_id =%%ID%% Y meta_key "
986
- "= 'your_meta_key';"
987
-
988
- #: views/admin/export/template/new_field_cpt.php:87
989
  msgid "Export Image URLs"
990
  msgstr "Exportar URL de imagen"
991
 
992
- #: views/admin/export/template/new_field_cpt.php:88
993
  msgid "Export Image Filenames"
994
  msgstr "Exportar los nombres de archivo de imagenes"
995
 
996
- #: views/admin/export/template/new_field_cpt.php:89
997
  msgid "Export Image File Paths"
998
  msgstr "Exportar rutas de archivo de imagen"
999
 
1000
- #: views/admin/export/template/new_field_cpt.php:94
1001
- #: views/admin/export/template/new_field_shop_order.php:42
1002
- #: views/admin/export/template/new_field_user.php:66
1003
- msgid "UNIX timestamp - PHP time()"
1004
- msgstr "Marca de tiempo UNIX - PHP time()"
1005
-
1006
- #: views/admin/export/template/new_field_cpt.php:95
1007
- #: views/admin/export/template/new_field_shop_order.php:43
1008
- #: views/admin/export/template/new_field_user.php:67
1009
- msgid "Natural Language PHP date()"
1010
- msgstr "Lenguaje natural PHP date()"
1011
-
1012
- #: views/admin/export/template/new_field_cpt.php:98
1013
- #: views/admin/export/template/new_field_shop_order.php:46
1014
- #: views/admin/export/template/new_field_user.php:70
1015
- msgid "date() Format"
1016
- msgstr "Format date()"
1017
-
1018
- #: views/admin/export/template/new_field_cpt.php:105
1019
- #: views/admin/export/template/new_field_shop_order.php:53
1020
- #: views/admin/export/template/new_field_user.php:77
1021
- msgid "Export the value returned by a PHP function"
1022
- msgstr "Exportar el valor devuelto por una función PHP"
1023
-
1024
- #: views/admin/export/template/new_field_cpt.php:106
1025
- #: views/admin/export/template/new_field_shop_order.php:54
1026
- #: views/admin/export/template/new_field_user.php:78
1027
- msgid ""
1028
- "The value of the field chosen for export will be passed to the PHP function."
1029
- msgstr ""
1030
- "El valor del campo seleccionado para la exportar se pasará a la función PHP."
1031
-
1032
- #: views/admin/export/template/new_field_cpt.php:120
1033
- #: views/admin/export/template/new_field_shop_order.php:68
1034
- #: views/admin/export/template/new_field_user.php:92
1035
- #: views/admin/settings/index.php:69
1036
- msgid "Function Editor"
1037
- msgstr "Editor de funciones"
1038
-
1039
- #: views/admin/export/template/new_field_cpt.php:120
1040
- #: views/admin/export/template/new_field_shop_order.php:68
1041
- #: views/admin/export/template/new_field_user.php:92
1042
- #, php-format
1043
- msgid ""
1044
- "Add functions here for use during your export. You can access this file at %s"
1045
- msgstr ""
1046
- "Añadir funciones aquí para su uso durante la exportación. Puede acceder a "
1047
- "este archivo en %s"
1048
-
1049
- #: views/admin/export/template/new_field_cpt.php:129
1050
- #: views/admin/export/template/new_field_shop_order.php:77
1051
- #: views/admin/export/template/new_field_user.php:101
1052
- #: views/admin/settings/index.php:82
1053
- msgid "Save Functions"
1054
- msgstr "Guardar las funciones"
1055
-
1056
- #: views/admin/export/template/new_field_cpt.php:144
1057
- #: views/admin/export/template/new_field_shop_order.php:91
1058
- #: views/admin/export/template/new_field_user.php:115
1059
- #: views/admin/manage/index.php:52 views/admin/manage/index.php:148
1060
- #: views/admin/manage/index.php:348
1061
- msgid "Delete"
1062
- msgstr "Eliminar"
1063
-
1064
- #: views/admin/export/template/new_field_cpt.php:145
1065
- #: views/admin/export/template/new_field_shop_order.php:92
1066
- #: views/admin/export/template/new_field_user.php:116
1067
- msgid "Done"
1068
- msgstr "Terminado"
1069
-
1070
- #: views/admin/export/template/new_field_cpt.php:146
1071
- #: views/admin/export/template/new_field_shop_order.php:93
1072
- #: views/admin/export/template/new_field_user.php:117
1073
- msgid "Close"
1074
- msgstr "Cerrar"
1075
-
1076
- #: views/admin/export/template/new_field_user.php:9
1077
  msgid "Login"
1078
  msgstr "Iniciar sesión"
1079
 
1080
- #: views/admin/export/template/new_field_user.php:10
1081
  msgid "Email"
1082
  msgstr "Correo electrónico"
1083
 
1084
- #: views/admin/export/template/new_field_user.php:11
1085
  msgid "First Name"
1086
  msgstr "Primer Nombre"
1087
 
1088
- #: views/admin/export/template/new_field_user.php:12
1089
  msgid "Last Name"
1090
  msgstr "Apellido"
1091
 
1092
- #: views/admin/export/template/new_field_user.php:13
1093
  msgid "Registered Date"
1094
  msgstr "Fecha de registro"
1095
 
1096
- #: views/admin/export/template/new_field_user.php:14
1097
  msgid "Nicename"
1098
  msgstr "El nombre amigable"
1099
 
1100
- #: views/admin/export/template/new_field_user.php:15
1101
  msgid "URL"
1102
  msgstr "URL"
1103
 
1104
- #: views/admin/export/template/new_field_user.php:16
1105
  msgid "Display Name"
1106
  msgstr "Nombre para Mostrar"
1107
 
1108
- #: views/admin/export/template/new_field_user.php:17
1109
  msgid "Nickname"
1110
  msgstr "Sobrenombre"
1111
 
1112
- #: views/admin/export/template/new_field_user.php:18
1113
  msgid "Description"
1114
  msgstr "Descripción"
1115
 
1116
- #: views/admin/export/template/new_field_user.php:21
1117
  msgid "Password"
1118
  msgstr "Contraseña"
1119
 
1120
- #: views/admin/export/template/new_field_user.php:22
1121
  msgid "Activation Key"
1122
  msgstr "Clave de activación"
1123
 
1124
- #: views/admin/export/template/new_field_user.php:23
1125
  msgid "Status"
1126
  msgstr "Estado"
1127
 
1128
- #: views/admin/export/template/new_field_user.php:24
1129
  msgid "Roles"
1130
  msgstr "Roles"
1131
 
1132
- #: views/admin/export/template/new_field_user.php:25
1133
  msgid "Custom Field / User Meta"
1134
  msgstr "Campo personalizado / Usuario Meta"
1135
 
1136
- #: views/admin/help/index.php:1
1137
  msgid "WP All Export Support"
1138
  msgstr "Soporte para WP All Export"
1139
 
1140
- #: views/admin/manage/bulk.php:10
1141
  #, php-format
1142
  msgid "Are you sure you want to delete <strong>%s</strong> selected %s?"
1143
  msgstr "¿Está seguro que desea eliminar <strong>%s</strong> seleccionado %s?"
1144
 
1145
- #: views/admin/manage/delete.php:1
1146
  msgid "Delete Export"
1147
  msgstr "Eliminar de la exportación"
1148
 
1149
- #: views/admin/manage/delete.php:4
1150
  #, php-format
1151
  msgid "Are you sure you want to delete <strong>%s</strong> export?"
1152
  msgstr "¿Está seguro que desea eliminar <strong>%s</strong> de exportación?"
1153
 
1154
- #: views/admin/manage/index.php:18 views/admin/manage/index.php:20
1155
  msgid "Search Exports"
1156
  msgstr "Buscar Exportaciones "
1157
 
1158
- #: views/admin/manage/index.php:28
1159
  msgid "Name"
1160
  msgstr "Nombre"
1161
 
1162
- #: views/admin/manage/index.php:30
1163
  msgid "Query"
1164
  msgstr "Consulta"
1165
 
1166
- #: views/admin/manage/index.php:32
1167
  msgid "Summary"
1168
  msgstr "Resumen"
1169
 
1170
- #: views/admin/manage/index.php:34
1171
  msgid "Info & Options"
1172
  msgstr "Información y opciones"
1173
 
1174
- #: views/admin/manage/index.php:51 views/admin/manage/index.php:346
1175
  msgid "Bulk Actions"
1176
  msgstr "Acciones en Bloque"
1177
 
1178
- #: views/admin/manage/index.php:54 views/admin/manage/index.php:354
1179
  msgid "Apply"
1180
  msgstr "Aplicar"
1181
 
1182
- #: views/admin/manage/index.php:60
1183
  #, php-format
1184
  msgid "Displaying %s&#8211;%s of %s"
1185
  msgstr "Mostrando %s&#8211;%s de %s"
1186
 
1187
- #: views/admin/manage/index.php:104
1188
  msgid "No previous exports found."
1189
  msgstr "No se encontró exportaciones previas."
1190
 
1191
- #: views/admin/manage/index.php:134
1192
  msgid "Edit Template"
1193
  msgstr "Editar plantilla"
1194
 
1195
- #: views/admin/manage/index.php:135
1196
  msgid "Edit Options"
1197
  msgstr "Editar Opciones"
1198
 
1199
- #: views/admin/manage/index.php:156 views/admin/manage/scheduling.php:2
1200
  msgid "Cron Scheduling"
1201
  msgstr "Programación de Cron"
1202
 
1203
- #: views/admin/manage/index.php:199
1204
  msgid "Import with WP All Import"
1205
  msgstr "Importar con WP All Import"
1206
 
1207
- #: views/admin/manage/index.php:209 views/admin/manage/templates.php:2
1208
  msgid "Download Import Templates"
1209
  msgstr "Descargar plantillas de importación"
1210
 
1211
- #: views/admin/manage/index.php:221
1212
  msgid "Post Types: "
1213
  msgstr "Tipos de Entradas:"
1214
 
1215
- #: views/admin/manage/index.php:238
1216
  msgid "Y/m/d g:i a"
1217
  msgstr "Y/m/d g:i:s A"
1218
 
1219
- #: views/admin/manage/index.php:248
1220
  msgid "triggered with cron"
1221
  msgstr "desencadenado con cron "
1222
 
1223
- #: views/admin/manage/index.php:255 views/admin/manage/index.php:270
1224
- #: views/admin/manage/index.php:284
1225
  #, php-format
1226
  msgid "last activity %s ago"
1227
  msgstr "útima actividad hace %s "
1228
 
1229
- #: views/admin/manage/index.php:262
1230
  msgid "currently processing with cron"
1231
  msgstr "actualmente procesando con cron"
1232
 
1233
- #: views/admin/manage/index.php:277
1234
  msgid "Export currently in progress"
1235
  msgstr "Exportación actualmente en progreso"
1236
 
1237
- #: views/admin/manage/index.php:291
1238
  #, php-format
1239
  msgid "Export Attempt at %s"
1240
  msgstr "Intento de Exportación a %s"
1241
 
1242
- #: views/admin/manage/index.php:295
1243
  #, php-format
1244
  msgid "Last run: %s"
1245
  msgstr "Última ejecución: %s"
1246
 
1247
- #: views/admin/manage/index.php:295
1248
  msgid "never"
1249
  msgstr "nunca"
1250
 
1251
- #: views/admin/manage/index.php:296
1252
  #, php-format
1253
  msgid "%d Records Exported"
1254
  msgstr "%d registros exportados"
1255
 
1256
- #: views/admin/manage/index.php:297
1257
  #, php-format
1258
  msgid "Format: %s"
1259
  msgstr "Formato: %s"
1260
 
1261
- #: views/admin/manage/index.php:303
1262
  msgid "settings edited since last run"
1263
  msgstr "configuraciones editadas desde la ultima ejecución"
1264
 
1265
- #: views/admin/manage/index.php:315
1266
  msgid "Edit"
1267
  msgstr "Editar"
1268
 
1269
- #: views/admin/manage/index.php:316
1270
  msgid "Run Export"
1271
  msgstr "Ejecutar Exportación"
1272
 
1273
- #: views/admin/manage/index.php:318
1274
  msgid "Cancel Cron"
1275
  msgstr "Cancelar Cron"
1276
 
1277
- #: views/admin/manage/index.php:320
1278
  msgid "Cancel"
1279
  msgstr "Cancelar"
1280
 
1281
- #: views/admin/manage/index.php:350
1282
  msgid "Restore"
1283
  msgstr "Restaurar"
1284
 
1285
- #: views/admin/manage/index.php:351
1286
  msgid "Delete Permanently"
1287
  msgstr "Borrar permanentemente"
1288
 
1289
- #: views/admin/manage/scheduling.php:6
1290
- msgid ""
1291
- "To schedule an import, you must create two cron jobs in your web hosting "
1292
- "control panel. One cron job will be used to run the Trigger script, the "
1293
- "other to run the Execution script."
1294
- msgstr ""
1295
- "Para programar una importación, debe de crear dos trabajos cron en su panel "
1296
- "de control de alojamiento web. Un trabajo cron será utilizado para ejecutar "
1297
- "la guía desencadenante, el otro ejecutara la guía de ejecución."
1298
-
1299
- #: views/admin/manage/scheduling.php:17
1300
  msgid "Export File URL"
1301
  msgstr "Exportar Archivo URL"
1302
 
1303
- #: views/admin/manage/scheduling.php:20
1304
- msgid "Import Bundle URL"
1305
- msgstr "Importar URL de Paquete"
1306
-
1307
- #: views/admin/manage/scheduling.php:25
1308
  msgid "Trigger Script"
1309
  msgstr "Guía desencandenante"
1310
 
1311
- #: views/admin/manage/scheduling.php:27
1312
- msgid "Every time you want to schedule the import, run the trigger script."
1313
- msgstr ""
1314
- "Cada vez que quiera programar la importación, ejecute la guía "
1315
- "desencadenante. "
1316
-
1317
- #: views/admin/manage/scheduling.php:29
1318
- msgid ""
1319
- "To schedule the import to run once every 24 hours, run the trigger script "
1320
- "every 24 hours. Most hosts require you to use “wget” to access a URL. Ask "
1321
- "your host for details."
1322
- msgstr ""
1323
- "Para programar la importación cada 24 horas, ejecute la guía desencadenante "
1324
- "cada 24 horas. La mayoría de los alojadores web requiere que utilice \"wget"
1325
- "\" para ingresar a un URL. Consulte a su alojador web para mas detalles."
1326
-
1327
- #: views/admin/manage/scheduling.php:31 views/admin/manage/scheduling.php:43
1328
  msgid "Example:"
1329
  msgstr "Ejemplo:"
1330
 
1331
- #: views/admin/manage/scheduling.php:35
1332
  msgid "Execution Script"
1333
  msgstr "Guía (script) de Ejecución"
1334
 
1335
- #: views/admin/manage/scheduling.php:37
1336
- msgid ""
1337
- "The Execution script actually executes the import, once it has been "
1338
- "triggered with the Trigger script."
1339
- msgstr ""
1340
- "La guía de ejecución ejecuta la importación, una vez ha sido desencadenada "
1341
- "con la guía de desencadenamiento. "
1342
-
1343
- #: views/admin/manage/scheduling.php:39
1344
- msgid ""
1345
- "It processes in iteration (only importing a few records each time it runs) "
1346
- "to optimize server load. It is recommended you run the execution script "
1347
- "every 2 minutes."
1348
- msgstr ""
1349
- "Lo procesa en iteraciones (solamente importando unos cuantos registros cada "
1350
- "vez que ejecuta) para optimizar la carga del servidor. Es recomendable que "
1351
- "ejecute la guía de ejecución cada 2 minutos."
1352
-
1353
- #: views/admin/manage/scheduling.php:41
1354
- msgid ""
1355
- "It also operates this way in case of unexpected crashes by your web host. If "
1356
- "it crashes before the import is finished, the next run of the cron job two "
1357
- "minutes later will continue it where it left off, ensuring reliability."
1358
- msgstr ""
1359
- "También opera en esta forma en caso de caídas inesperadas de su alojador "
1360
- "web. Si se cae antes de que la importación termine, la siguiente vez que "
1361
- "ejecute el trabajo cron dos minutos después va a continuar donde quedo, "
1362
- "asegurando confiabilidad"
1363
-
1364
- #: views/admin/manage/scheduling.php:47
1365
  msgid "Notes"
1366
  msgstr "Notas"
1367
 
1368
- #: views/admin/manage/scheduling.php:50
1369
  msgid ""
1370
  "Your web host may require you to use a command other than wget, although "
1371
  "wget is most common. In this case, you must asking your web hosting provider "
@@ -1375,7 +1744,7 @@ msgstr ""
1375
  "es más común el wget. En este caso, usted debe pedir su proveedor de "
1376
  "alojamiento web ayuda."
1377
 
1378
- #: views/admin/manage/templates.php:6
1379
  msgid ""
1380
  "Download your import templates and use them to import your exported file to "
1381
  "a separate WordPress/WP All Import installation."
@@ -1383,7 +1752,7 @@ msgstr ""
1383
  "Descargar las plantillas de importación y utilizarlos para importar el "
1384
  "archivo exportado a una instalación de WordPress/WP All Import."
1385
 
1386
- #: views/admin/manage/templates.php:10
1387
  msgid ""
1388
  "Install these import templates in your separate WP All Import installation "
1389
  "from the All Import -> Settings page by clicking the \"Import Templates\" "
@@ -1393,58 +1762,26 @@ msgstr ""
1393
  "pagina de -> Configuración haciendo clic en el botón \"Importar plantillas\" "
1394
  "de importación."
1395
 
1396
- #: views/admin/manage/update.php:1
1397
- msgid "Re-run Export"
1398
- msgstr "Vuelva a ejecutar exportación"
1399
-
1400
- #: views/admin/manage/update.php:8
1401
- #, php-format
1402
- msgid "Are you sure you want to re-run <strong>%s</strong> export?"
1403
- msgstr ""
1404
- "¿Está seguro que desea volver a ejecutar la exportación <strong>%s</strong> ?"
1405
-
1406
- #: views/admin/settings/index.php:20
1407
  msgid "Cron Exports"
1408
  msgstr "Exportaciones de cron"
1409
 
1410
- #: views/admin/settings/index.php:25
1411
  msgid "Secret Key"
1412
  msgstr "Clave Secreta"
1413
 
1414
- #: views/admin/settings/index.php:28
1415
  msgid "Changing this will require you to re-create your existing cron jobs."
1416
  msgstr "Cambiar esto exigirá volver a crear tus trabajos cron existentes."
1417
 
1418
- #: views/admin/settings/index.php:36
1419
  msgid "Files"
1420
  msgstr "Archivos"
1421
 
1422
- #: views/admin/settings/index.php:41 views/admin/settings/index.php:44
1423
  msgid "Secure Mode"
1424
  msgstr "Modo seguro"
1425
 
1426
- #: views/admin/settings/index.php:46
1427
  msgid "Randomize folder names"
1428
  msgstr "Aleatorizar los nombres de las carpetas"
1429
-
1430
- #: views/admin/settings/index.php:52
1431
- #, php-format
1432
- msgid ""
1433
- "Exported files and temporary files will be placed in a folder with a "
1434
- "randomized name inside of %s."
1435
- msgstr ""
1436
- "Archivos exportados y archivos temporales serán puestos en una carpeta con "
1437
- "nombres al azar dentro de %s."
1438
-
1439
- #: wp-all-export-pro.php:30
1440
- msgid ""
1441
- "Please de-activate and remove the free version of the WP All Export before "
1442
- "activating the paid version."
1443
- msgstr ""
1444
- "Por favor, desactivar y quitar la versión gratis de WP All Export antes de "
1445
- "activar la versión de pago."
1446
-
1447
- #: wp-all-export-pro.php:313 wp-all-export-pro.php:317
1448
- #, php-format
1449
- msgid "Uploads folder %s must be writable"
1450
- msgstr "La carpeta de cargas %s debe tener permisos de escritura."
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP All Export\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2015-10-05 22:42-0600\n"
6
+ "PO-Revision-Date: Mon Dec 21 2015 20:10:52 GMT+0200 (EET)\n"
7
+ "Last-Translator: admin <makstsiplyskov@gmail.loc>\n"
8
  "Language-Team: \n"
9
+ "Language: Spanish (Spain)\n"
10
+ "Plural-Forms: nplurals=2; plural=n != 1\n"
11
  "MIME-Version: 1.0\n"
12
  "Content-Type: text/plain; charset=UTF-8\n"
13
  "Content-Transfer-Encoding: 8bit\n"
 
 
 
14
  "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Generator: Loco - https://localise.biz/\n"
16
+ "X-Poedit-Basepath: .\n"
17
+ "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
18
+ "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
19
+ "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
20
+ "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
21
+ "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
22
  "X-Poedit-SearchPath-0: .\n"
23
+ "X-Loco-Target-Locale: es_ES"
24
+
25
+ #. Name of the plugin
26
+ msgid "WP All Export Pro"
27
+ msgstr ""
28
+
29
+ #. URI of the plugin
30
+ msgid "http://www.wpallimport.com/export"
31
+ msgstr ""
32
+
33
+ #. Description of the plugin
34
+ msgid ""
35
+ "Export any post type to a CSV or XML file. Edit the exported data, and then "
36
+ "re-import it later using WP All Import."
37
+ msgstr ""
38
+
39
+ #. Author of the plugin
40
+ msgid "Soflyy"
41
+ msgstr ""
42
+
43
+ #: ../../actions/init.php:19 ../../actions/init.php:25
44
+ msgid "Error. Incorrect API key, check the WP All Export Pro settings page."
45
+ msgstr ""
46
+
47
+ #: ../../actions/wp_ajax_export_available_rules.php:40
48
+ msgid "newer than"
49
+ msgstr ""
50
+
51
+ #: ../../actions/wp_ajax_export_available_rules.php:41
52
+ msgid "equal to or newer than"
53
+ msgstr ""
54
+
55
+ #: ../../actions/wp_ajax_export_available_rules.php:42
56
+ msgid "older than"
57
+ msgstr ""
58
+
59
+ #: ../../actions/wp_ajax_export_available_rules.php:43
60
+ msgid "equal to or older than"
61
+ msgstr ""
62
+
63
+ #: ../../actions/wp_ajax_export_filtering_count.php:95 ../..
64
+ #: /actions/wp_ajax_export_filtering_count.php:98 ../../views/admin/manage/update.
65
+ #: php:51
66
+ msgid "Nothing to export."
67
+ msgstr ""
68
+
69
+ #: ../../actions/wp_ajax_export_filtering_count.php:96
70
+ #, php-format
71
+ msgid "All %s have already been exported."
72
+ msgstr ""
73
+
74
+ #: ../../actions/wp_ajax_export_filtering_count.php:99 ../..
75
+ #: /actions/wp_ajax_export_filtering_count.php:113 ../..
76
+ #: /views/admin/manage/update.php:52
77
+ #, php-format
78
+ msgid "No matching %s found for selected filter rules."
79
+ msgstr ""
80
+
81
+ #: ../../actions/wp_ajax_wpallexport.php:29
82
+ msgid "Export is not defined."
83
+ msgstr ""
84
+
85
+ #: ../../actions/wp_loaded.php:155
86
+ #, php-format
87
+ msgid "Records Processed %s."
88
+ msgstr ""
89
+
90
+ #: ../../actions/wp_loaded.php:209
91
+ msgid "File doesn't exist"
92
+ msgstr ""
93
+
94
+ #: ../../actions/wp_loaded.php:218
95
+ msgid "Export hash is not valid."
96
+ msgstr ""
97
+
98
+ #: ../../controllers/admin/export.php:225
99
+ msgid "CSV delimiter must be specified."
100
+ msgstr ""
101
+
102
+ #: ../../controllers/admin/export.php:300 ../../controllers/admin/manage.php:182
103
+ msgid "Main XML Tag is required."
104
+ msgstr ""
105
+
106
+ #: ../../controllers/admin/export.php:305 ../../controllers/admin/manage.php:187
107
+ msgid "Single Record XML Tag is required."
108
+ msgstr ""
109
+
110
+ #: ../../controllers/admin/export.php:309 ../../controllers/admin/manage.php:191
111
+ msgid "Main XML Tag equals to Single Record XML Tag."
112
+ msgstr ""
113
+
114
+ #: ../../controllers/admin/settings.php:51
115
+ msgid "Unknown File extension. Only txt files are permitted"
116
+ msgstr ""
117
+
118
+ #: ../../controllers/admin/settings.php:64
119
+ #, php-format
120
+ msgid "%d template imported"
121
+ msgid_plural "%d templates imported"
122
+ msgstr[0] ""
123
+ msgstr[1] ""
124
+
125
+ #: ../../controllers/admin/settings.php:66
126
+ msgid "Wrong imported data format"
127
+ msgstr ""
128
+
129
+ #: ../../controllers/admin/settings.php:68
130
+ msgid "File is empty or doesn't exests"
131
+ msgstr ""
132
+
133
+ #: ../../controllers/admin/settings.php:71
134
+ msgid "Undefined entry!"
135
+ msgstr ""
136
+
137
+ #: ../../controllers/admin/settings.php:73
138
+ msgid "Please select file."
139
+ msgstr ""
140
+
141
+ #: ../../controllers/admin/settings.php:79
142
+ msgid "Templates must be selected"
143
+ msgstr ""
144
+
145
+ #: ../../controllers/admin/settings.php:88
146
+ #, php-format
147
+ msgid "%d template deleted"
148
+ msgid_plural "%d templates deleted"
149
+ msgstr[0] ""
150
+ msgstr[1] ""
151
+
152
+ #: ../../helpers/wp_all_export_get_cpt_name.php:13 ../../views/admin/export/index.
153
+ #: php:68
154
+ msgid "Comments"
155
+ msgstr ""
156
+
157
+ #: ../../helpers/wp_all_export_get_cpt_name.php:13
158
+ msgid "Comment"
159
+ msgstr ""
160
 
161
+ #: ../../libraries/XmlExportEngine.php:261 ../../libraries/XmlExportEngine.php:318
162
+ msgid "No matching users found."
163
+ msgstr ""
164
+
165
+ #: ../../libraries/XmlExportEngine.php:275 ../../libraries/XmlExportEngine.php:335
166
+ msgid "No matching comments found."
167
+ msgstr ""
168
+
169
+ #: ../../libraries/XmlExportEngine.php:291
170
+ msgid "No matching posts found for WP_Query expression specified."
171
+ msgstr ""
172
+
173
+ #: ../../libraries/XmlExportEngine.php:353
174
+ msgid "No matching posts found for selected post types."
175
+ msgstr ""
176
+
177
+ #: ../../views/admin/export/index.php:82
178
+ msgid "Comment Query"
179
+ msgstr ""
180
+
181
+ #: ../../views/admin/export/process.php:45 ../../views/admin/manage/index.php:152
182
+ #, php-format
183
+ msgid "Split %ss"
184
+ msgstr ""
185
+
186
+ #: ../../views/admin/export/template.php:163
187
+ msgid ""
188
+ "If an order contains multiple products, each product will have its own row. "
189
+ "If disabled, each product will have its own column."
190
+ msgstr ""
191
+
192
+ #: ../../views/admin/export/template.php:167
193
+ msgid "Fill in empty columns"
194
+ msgstr ""
195
+
196
+ #: ../../views/admin/export/template.php:168
197
+ msgid ""
198
+ "If enabled, each order item will appear as its own row with all order info "
199
+ "filled in for every column. If disabled, order info will only display on one "
200
+ "row with only the order item info displaying in additional rows."
201
+ msgstr ""
202
+
203
+ #: ../../views/admin/export/template.php:211
204
+ msgid "Save settings as a template"
205
+ msgstr ""
206
+
207
+ #: ../../views/admin/export/template.php:214
208
+ msgid "Template name..."
209
+ msgstr ""
210
+
211
+ #: ../../views/admin/export/template.php:219
212
+ msgid "Load Template..."
213
+ msgstr ""
214
+
215
+ #: ../../views/admin/export/options/settings.php:19
216
+ #, php-format
217
+ msgid "Only export %s once"
218
+ msgstr ""
219
+
220
+ #: ../../views/admin/export/options/settings.php:20
221
+ msgid ""
222
+ "If re-run, this export will only include records that have not been "
223
+ "previously exported."
224
+ msgstr ""
225
+
226
+ #: ../../views/admin/export/options/settings.php:31
227
+ msgid "Create a new file each time export is run"
228
+ msgstr ""
229
+
230
+ #: ../../views/admin/export/options/settings.php:32
231
+ msgid "If disabled, the export file will be overwritten every time this export run."
232
+ msgstr ""
233
+
234
+ #: ../../views/admin/export/options/settings.php:37
235
+ msgid "Split large exports into multiple files"
236
+ msgstr ""
237
+
238
+ #: ../../views/admin/export/options/settings.php:40
239
+ msgid "Limit export to"
240
+ msgstr ""
241
+
242
+ #: ../../views/admin/export/options/settings.php:40
243
+ msgid "records per file"
244
+ msgstr ""
245
+
246
+ #: ../../views/admin/export/options/settings.php:46
247
+ msgid "Main XML Tag:"
248
+ msgstr ""
249
+
250
+ #: ../../views/admin/export/options/settings.php:50
251
+ msgid "Single Record XML Tag:"
252
+ msgstr ""
253
+
254
+ #: ../../views/admin/export/template/new_field_comment.php:9
255
+ msgid "Post ID"
256
+ msgstr ""
257
+
258
+ #: ../../views/admin/export/template/new_field_comment.php:11
259
+ msgid "Author Name"
260
+ msgstr ""
261
+
262
+ #: ../../views/admin/export/template/new_field_comment.php:12
263
+ msgid "Author URL"
264
+ msgstr ""
265
+
266
+ #: ../../views/admin/export/template/new_field_comment.php:13
267
+ msgid "Author IP"
268
+ msgstr ""
269
+
270
+ #: ../../views/admin/export/template/new_field_comment.php:16
271
+ msgid "Karma"
272
+ msgstr ""
273
+
274
+ #: ../../views/admin/export/template/new_field_comment.php:17
275
+ msgid "Approved"
276
+ msgstr ""
277
+
278
+ #: ../../views/admin/export/template/new_field_comment.php:18
279
+ msgid "Agent"
280
+ msgstr ""
281
+
282
+ #: ../../views/admin/export/template/new_field_comment.php:19
283
+ msgid "Type"
284
+ msgstr ""
285
+
286
+ #: ../../views/admin/export/template/new_field_comment.php:20
287
+ msgid "Comment Parent"
288
+ msgstr ""
289
 
290
+ #: ../../views/admin/export/template/new_field_comment.php:21
291
+ msgid "User ID"
292
+ msgstr ""
293
+
294
+ #: ../../views/admin/export/template/new_field_comment.php:24
295
+ msgid "Custom Field / Comment Meta"
296
+ msgstr ""
297
+
298
+ #: ../../views/admin/manage/scheduling.php:6
299
+ msgid ""
300
+ "To schedule an export, you must create two cron jobs in your web hosting "
301
+ "control panel. One cron job will be used to run the Trigger script, the "
302
+ "other to run the Execution script."
303
+ msgstr ""
304
+
305
+ #: ../../views/admin/manage/scheduling.php:20
306
+ msgid "Export Bundle URL"
307
+ msgstr ""
308
+
309
+ #: ../../views/admin/manage/scheduling.php:27
310
+ msgid "Every time you want to schedule the export, run the trigger script."
311
+ msgstr ""
312
+
313
+ #: ../../views/admin/manage/scheduling.php:29
314
+ msgid ""
315
+ "To schedule the export to run once every 24 hours, run the trigger script "
316
+ "every 24 hours. Most hosts require you to use “wget” to access a URL. Ask "
317
+ "your host for details."
318
+ msgstr ""
319
+
320
+ #: ../../views/admin/manage/scheduling.php:37
321
+ msgid ""
322
+ "The Execution script actually executes the export, once it has been "
323
+ "triggered with the Trigger script."
324
+ msgstr ""
325
+
326
+ #: ../../views/admin/manage/scheduling.php:39
327
+ msgid ""
328
+ "It processes in iteration (only exporting a few records each time it runs) "
329
+ "to optimize server load. It is recommended you run the execution script "
330
+ "every 2 minutes."
331
+ msgstr ""
332
+
333
+ #: ../../views/admin/manage/scheduling.php:41
334
+ msgid ""
335
+ "It also operates this way in case of unexpected crashes by your web host. If "
336
+ "it crashes before the export is finished, the next run of the cron job two "
337
+ "minutes later will continue it where it left off, ensuring reliability."
338
+ msgstr ""
339
+
340
+ #: ../../views/admin/settings/index.php:17
341
+ msgid "Import/Export Templates"
342
+ msgstr ""
343
+
344
+ #: ../../views/admin/settings/index.php:31
345
+ msgid "Delete Selected"
346
+ msgstr ""
347
+
348
+ #: ../../views/admin/settings/index.php:32
349
+ msgid "Export Selected"
350
+ msgstr ""
351
+
352
+ #: ../../views/admin/settings/index.php:35
353
+ msgid "There are no templates saved"
354
+ msgstr ""
355
+
356
+ #: ../../views/admin/settings/index.php:40
357
+ msgid "Import Templates"
358
+ msgstr ""
359
+
360
+ #: ../../views/admin/settings/index.php:81
361
+ #, php-format
362
+ msgid ""
363
+ "If enabled, exported files and temporary files will be saved in a folder "
364
+ "with a randomized name in %s.<br/><br/>If disabled, exported files will be "
365
+ "saved in the Media Library."
366
+ msgstr ""
367
+
368
+ #: ../../views/admin/settings/index.php:88
369
+ msgid "Licenses"
370
+ msgstr ""
371
+
372
+ #: ../../views/admin/settings/index.php:93
373
+ msgid "License Key"
374
+ msgstr ""
375
+
376
+ #: ../../views/admin/settings/index.php:99
377
+ msgid "Active"
378
+ msgstr ""
379
+
380
+ #: ../../views/admin/settings/index.php:101
381
+ msgid "Activate License"
382
+ msgstr ""
383
+
384
+ #: ../../views/admin/settings/index.php:106
385
+ msgid ""
386
+ "A license key is required to access plugin updates. You can use your license "
387
+ "key on an unlimited number of websites. Do not distribute your license key "
388
+ "to 3rd parties. You can get your license key in the <a target=\"_blank\" "
389
+ "href=\"http://www.wpallimport.com/portal\">customer portal</a>."
390
+ msgstr ""
391
+
392
+ #: ../../views/admin/settings/index.php:112
393
+ msgid "Zapier Integration"
394
+ msgstr ""
395
+
396
+ #: ../../views/admin/settings/index.php:117
397
+ msgid "API Key"
398
+ msgstr ""
399
+
400
+ #: ../../views/admin/settings/index.php:120
401
+ msgid "Generate New API Key"
402
+ msgstr ""
403
+
404
+ #: ../../views/admin/settings/index.php:121
405
+ msgid "Changing the key will require you to update your existing Zaps on Zapier."
406
+ msgstr ""
407
+
408
+ #: ../../views/admin/settings/index.php:125
409
+ msgid "Zapier beta invitation URL"
410
+ msgstr ""
411
+
412
+ #: ../../views/admin/settings/index.php:127
413
+ #, php-format
414
+ msgid ""
415
+ "You can get the invitation URL in the <a href=\"%s\" target=\"_blank\">customer "
416
+ "portal</a>."
417
+ msgstr ""
418
+
419
+ #: ../../wp-all-export-pro.php:30
420
+ msgid ""
421
+ "Please de-activate and remove the free version of the WP All Export before "
422
+ "activating the paid version."
423
+ msgstr ""
424
+ "Por favor, desactivar y quitar la versión gratis de WP All Export antes de "
425
+ "activar la versión de pago."
426
+
427
+ #: ../../wp-all-export-pro.php:323 ../../wp-all-export-pro.php:327
428
+ #, php-format
429
+ msgid "Uploads folder %s must be writable"
430
+ msgstr "La carpeta de cargas %s debe tener permisos de escritura."
431
+
432
+ #: ../../actions/admin_menu.php:11 ../../actions/admin_menu.php:14 ../..
433
+ #: /actions/admin_menu.php:15 ../../actions/admin_menu.php:16 ../..
434
+ #: /actions/admin_menu.php:17 ../../models/export/record.php:573 ../..
435
+ #: /views/admin/export/index.php:9 ../../views/admin/export/options.php:15 ../..
436
+ #: /views/admin/export/process.php:9 ../../views/admin/export/template.php:7 ../..
437
+ #: /views/admin/manage/index.php:4 ../../views/admin/manage/update.php:25 ../..
438
+ #: /views/admin/settings/index.php:6
439
  msgid "WP All Export"
440
  msgstr "WP All Export"
441
 
442
+ #: ../../actions/admin_menu.php:11
443
  msgid "All Export"
444
  msgstr "All Export"
445
 
446
+ #: ../../actions/admin_menu.php:14
447
  msgid "Export to XML"
448
  msgstr "Exportar a XML"
449
 
450
+ #: ../../actions/admin_menu.php:14
451
  msgid "New Export"
452
  msgstr "Nueva Exportación"
453
 
454
+ #: ../../actions/admin_menu.php:15 ../../actions/admin_menu.php:15 ../..
455
+ #: /views/admin/export/process.php:57 ../../views/admin/manage/index.php:5
456
  msgid "Manage Exports"
457
  msgstr "Manejar Exportaciones"
458
 
459
+ #: ../../actions/admin_menu.php:16 ../../actions/admin_menu.php:16 ../..
460
+ #: /views/admin/settings/index.php:7
461
  msgid "Settings"
462
  msgstr "Configuración "
463
 
464
+ #: ../../actions/admin_menu.php:17 ../../actions/admin_menu.php:17
465
  msgid "Feedback"
466
  msgstr "Retroalimentación"
467
 
468
+ #: ../../actions/wp_ajax_export_available_rules.php:6 ../..
469
+ #: /actions/wp_ajax_export_available_rules.php:10 ../..
470
+ #: /actions/wp_ajax_export_filtering.php:6 ../../actions/wp_ajax_export_filtering.
471
+ #: php:10 ../../actions/wp_ajax_export_filtering_count.php:6 ../..
472
+ #: /actions/wp_ajax_export_filtering_count.php:10 ../..
473
+ #: /actions/wp_ajax_export_preview.php:8 ../../actions/wp_ajax_export_preview.php:
474
+ #: 12 ../../actions/wp_ajax_generate_zapier_api_key.php:6 ../..
475
+ #: /actions/wp_ajax_generate_zapier_api_key.php:10 ../..
476
+ #: /actions/wp_ajax_save_functions.php:6 ../../actions/wp_ajax_save_functions.php:
477
+ #: 10 ../../actions/wp_ajax_wpallexport.php:8 ../../actions/wp_ajax_wpallexport.
478
+ #: php:12 ../../controllers/controller.php:117 ../../controllers/admin/manage.php:
479
+ #: 290 ../../controllers/admin/manage.php:325 ../../controllers/admin/manage.php:
480
+ #: 406 ../../controllers/admin/manage.php:459
481
  msgid "Security check"
482
  msgstr "Contol de Seguridad"
483
 
484
+ #: ../../actions/wp_ajax_export_available_rules.php:21 ../..
485
+ #: /actions/wp_ajax_export_filtering.php:50 ../../views/admin/export/options.php:
486
+ #: 92 ../../views/admin/manage/update.php:100
487
  msgid "Select Rule"
488
  msgstr "Seleccionar Regla"
489
 
490
+ #: ../../actions/wp_ajax_export_available_rules.php:38 ../..
491
+ #: /actions/wp_ajax_export_available_rules.php:54
492
  msgid "equals"
493
  msgstr "es igual a"
494
 
495
+ #: ../../actions/wp_ajax_export_available_rules.php:39 ../..
496
+ #: /actions/wp_ajax_export_available_rules.php:55
497
  msgid "doesn't equal"
498
  msgstr "no es igual a"
499
 
500
+ #: ../../actions/wp_ajax_export_available_rules.php:45 ../..
501
+ #: /actions/wp_ajax_export_available_rules.php:61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
502
  msgid "contains"
503
  msgstr "contiene"
504
 
505
+ #: ../../actions/wp_ajax_export_available_rules.php:46 ../..
506
+ #: /actions/wp_ajax_export_available_rules.php:62
507
  msgid "doesn't contain"
508
  msgstr "no contiene"
509
 
510
+ #: ../../actions/wp_ajax_export_available_rules.php:47 ../..
511
+ #: /actions/wp_ajax_export_available_rules.php:63
512
  msgid "is empty"
513
  msgstr "esta vacío"
514
 
515
+ #: ../../actions/wp_ajax_export_available_rules.php:48 ../..
516
+ #: /actions/wp_ajax_export_available_rules.php:64
517
  msgid "is not empty"
518
  msgstr "no está vacío"
519
 
520
+ #: ../../actions/wp_ajax_export_available_rules.php:56
521
+ msgid "greater than"
522
+ msgstr "mayor que"
523
+
524
+ #: ../../actions/wp_ajax_export_available_rules.php:57
525
+ msgid "equal to or greater than"
526
+ msgstr "es igual o mayor que"
527
+
528
+ #: ../../actions/wp_ajax_export_available_rules.php:58
529
+ msgid "less than"
530
+ msgstr "menor que"
531
+
532
+ #: ../../actions/wp_ajax_export_available_rules.php:59
533
+ msgid "equal to or less than"
534
+ msgstr "es igual a o menor que"
535
+
536
+ #: ../../actions/wp_ajax_export_filtering.php:30
537
  msgid "Add Filtering Options"
538
  msgstr "Agregar opciones de filtrado"
539
 
540
+ #: ../../actions/wp_ajax_export_filtering.php:36 ../../views/admin/export/options.
541
+ #: php:78 ../../views/admin/manage/update.php:86
542
  msgid "Element"
543
  msgstr "Elemento"
544
 
545
+ #: ../../actions/wp_ajax_export_filtering.php:37 ../../views/admin/export/options.
546
+ #: php:79 ../../views/admin/manage/update.php:87
547
  msgid "Rule"
548
  msgstr "Regla"
549
 
550
+ #: ../../actions/wp_ajax_export_filtering.php:38 ../../views/admin/export/options.
551
+ #: php:80 ../../views/admin/manage/update.php:88
552
  msgid "Value"
553
  msgstr "Valor"
554
 
555
+ #: ../../actions/wp_ajax_export_filtering.php:44 ../../views/admin/export/options.
556
+ #: php:86 ../../views/admin/manage/update.php:94
557
  msgid "Select Element"
558
  msgstr "Seleccionar Elemento"
559
 
560
+ #: ../../actions/wp_ajax_export_filtering.php:57 ../../views/admin/export/options.
561
+ #: php:99 ../../views/admin/manage/update.php:107
562
  msgid "Add Rule"
563
  msgstr "Agregar Regla"
564
 
565
+ #: ../../actions/wp_ajax_export_filtering.php:69 ../../views/admin/export/options.
566
+ #: php:112 ../../views/admin/manage/update.php:120
567
  msgid ""
568
  "No filtering options. Add filtering options to only export records matching "
569
  "some specified criteria."
571
  "Sin opciones de filtrado. Agregue opciones de filtrado solo para exportar "
572
  "registros que coincidan algún criterio especificado."
573
 
574
+ #: ../../actions/wp_ajax_export_filtering.php:106
575
  msgid "Apply Filters To Export Data"
576
  msgstr "Aplicar Filtros Para Exportar Datos"
577
 
578
+ #: ../../actions/wp_ajax_export_filtering.php:114 ../..
579
+ #: /views/admin/export/options.php:159 ../../views/admin/manage/update.php:167
580
  msgid "Variable product matching rules: "
581
  msgstr "Reglas de coincidencia de producto variable:"
582
 
583
+ #: ../../actions/wp_ajax_export_filtering.php:116 ../..
584
+ #: /views/admin/export/options.php:161 ../../views/admin/manage/update.php:169
585
  msgid "Strict"
586
  msgstr "Estricto"
587
 
588
+ #: ../../actions/wp_ajax_export_filtering.php:117 ../..
589
+ #: /views/admin/export/options.php:162 ../../views/admin/manage/update.php:170
590
  msgid "Permissive"
591
  msgstr "Permisivo"
592
 
593
+ #: ../../actions/wp_ajax_export_filtering.php:119 ../..
594
+ #: /views/admin/export/options.php:164 ../../views/admin/manage/update.php:172
595
  msgid ""
596
  "Strict matching requires all variations to pass in order for the product to "
597
  "be exported. Permissive matching allows the product to be exported if any of "
601
  "para el producto a ser exportado. Emparejamiento permisivo, permite que el "
602
  "producto sea exportado si ninguna de las variaciones pasan."
603
 
604
+ #: ../../actions/wp_ajax_export_filtering_count.php:91 ../..
605
+ #: /views/admin/export/options.php:43 ../../views/admin/manage/update.php:54
606
+ msgid "Your export is ready to run."
607
+ msgstr "Su exportación está lista para ejecutar."
608
+
609
+ #: ../../actions/wp_ajax_export_filtering_count.php:92 ../..
610
+ #: /views/admin/export/options.php:45 ../../views/admin/manage/update.php:55
611
+ #, php-format
612
+ msgid "WP All Export will export %d %s."
613
+ msgstr "WP All Export exportará %d %s."
614
+
615
+ #: ../../actions/wp_ajax_export_filtering_count.php:111
616
  msgid "Continue to Step 2 to choose data to include in the export file."
617
  msgstr ""
618
  "Continúe al paso 2 para escoger la información para incluir al archivo de "
619
  "exportación"
620
 
621
+ #: ../../actions/wp_ajax_export_preview.php:160
 
 
 
 
 
622
  msgid "Data not found."
623
  msgstr "Datos no encontrados"
624
 
625
+ #: ../../actions/wp_ajax_export_preview.php:169
626
  msgid "This format is not supported."
627
  msgstr "Este formato no es soportado"
628
 
629
+ #: ../../actions/wp_ajax_save_functions.php:43
630
  msgid "PHP code must be wrapped in \"&lt;?php\" and \"?&gt;\""
631
  msgstr "El código PHP debe de estar envuelto en \"&lt;?php\" y \"?&gt;\""
632
 
633
+ #: ../../actions/wp_ajax_save_functions.php:52
634
  msgid "File has been successfully updated."
635
  msgstr "El archivo ha sido actualizado satisfactoriamente"
636
 
637
+ #: ../../actions/wp_loaded.php:84 ../../actions/wp_loaded.php:137
638
  #, php-format
639
  msgid "Export #%s is currently in manually process. Request skipped."
640
  msgstr ""
641
  "Exportación #%s se encuentra actualmente en proceso manual. Solicitud "
642
  "omitida."
643
 
644
+ #: ../../actions/wp_loaded.php:97
645
  #, php-format
646
  msgid "#%s Cron job triggered."
647
  msgstr "#%s Trabajo cron desencadenado."
648
 
649
+ #: ../../actions/wp_loaded.php:104
650
  #, php-format
651
  msgid "Export #%s currently in process. Request skipped."
652
+ msgstr "Exportación #%s se encuentra actualmente en proceso. Solicitud omitida."
 
653
 
654
+ #: ../../actions/wp_loaded.php:111
655
  #, php-format
656
  msgid "Export #%s already triggered. Request skipped."
657
  msgstr "Exportación #%s desencadenada. Solicitud omitida."
658
 
659
+ #: ../../actions/wp_loaded.php:130
660
  #, php-format
661
  msgid "Export #%s is not triggered. Request skipped."
662
  msgstr "Exportación #%s no ha sido desencadenada. Solicitud omitida."
663
 
664
+ #: ../../actions/wp_loaded.php:148
665
  #, php-format
666
  msgid "Export #%s complete"
667
  msgstr "Exportación #%s completada"
668
 
669
+ #: ../../actions/wp_loaded.php:164
 
 
 
 
 
670
  #, php-format
671
  msgid "Export #%s already processing. Request skipped."
672
  msgstr "Exportación #%s esta siendo procesada. Solicitud omitida"
673
 
674
+ #: ../../classes/updater.php:238
675
  #, php-format
676
  msgid ""
677
+ "There is a new version of %1$s available. <a target=\"_blank\" "
678
+ "class=\"thickbox\" href=\"%2$s\">View version %3$s details</a>."
679
  msgstr ""
680
+ "Hay una nueva versión de %1$s disponible. <a target=\"_blank\" "
681
+ "class=\"thickbox\" href=\"%2$s\">Ver detalles de versión %3$s details</a>."
682
 
683
+ #: ../../classes/updater.php:245
684
  #, php-format
685
  msgid ""
686
+ "There is a new version of %1$s available. <a target=\"_blank\" "
687
+ "class=\"thickbox\" href=\"%2$s\">View version %3$s details</a> or <a "
688
+ "href=\"%4$s\">update now</a>."
689
  msgstr ""
690
+ "Hay una nueva versión de %1$s disponible. <a target=\"_blank\" "
691
+ "class=\"thickbox\" href=\"%2$s\">Ver detalles de versión %3$s </a> o <a "
692
+ "href=\"%4$s\">actualizar ahora</a>."
693
 
694
+ #: ../../classes/updater.php:428
695
  msgid "You do not have permission to install plugin updates"
696
  msgstr "Usted no tiene permisos para instalar actualizaciones de plugin"
697
 
698
+ #: ../../classes/updater.php:428
699
  msgid "Error"
700
  msgstr "Error"
701
 
702
+ #: ../../controllers/admin/export.php:221
703
  msgid "You haven't selected any columns for export."
704
  msgstr "No ha seleccionado ninguna columna para exportar."
705
 
706
+ #: ../../controllers/admin/export.php:250 ../../controllers/admin/export.php:349 .
707
+ #: ./../controllers/admin/manage.php:226
 
 
 
708
  msgid "Options updated"
709
  msgstr "Opciones actualizadas"
710
 
711
+ #: ../../controllers/admin/manage.php:56
712
  msgid "&laquo;"
713
  msgstr "&laquo;"
714
 
715
+ #: ../../controllers/admin/manage.php:57
716
  msgid "&raquo;"
717
  msgstr "&raquo;"
718
 
719
+ #: ../../controllers/admin/manage.php:153 ../../views/admin/manage/index.php:300
720
  msgid "Export canceled"
721
  msgstr "Exportación cancelada"
722
 
723
+ #: ../../controllers/admin/manage.php:254
724
  msgid "Export deleted"
725
  msgstr "Exportación eliminada"
726
 
727
+ #: ../../controllers/admin/manage.php:282
728
  #, php-format
729
  msgid "%d %s deleted"
730
  msgstr "%d %s eliminada"
731
 
732
+ #: ../../controllers/admin/manage.php:282 ../../views/admin/manage/bulk.php:10
733
  msgid "export"
734
  msgstr "exportar"
735
 
736
+ #: ../../controllers/admin/manage.php:376
737
  msgid ""
738
  "The other two files in this zip are the export file containing all of your "
739
  "data and the import template for WP All Import. \n"
742
  "zip file."
743
  msgstr ""
744
  "Los otros dos archivos en este zip son el archivo contenedor de la "
745
+ "exportación de su datos y la plantilla de exportación para El Importador WP.\n"
 
746
  "\n"
747
  "Para importar esta información, cree una nueva importación con El Importador "
748
  "WP y cargue este archivo zip."
749
 
750
+ #: ../../controllers/admin/manage.php:493
751
  msgid "File format not supported"
752
  msgstr "El forma del archivo no es soportado"
753
 
754
+ #: ../../controllers/admin/manage.php:499 ../../controllers/admin/manage.php:504
755
  msgid ""
756
  "The exported file is missing and can't be downloaded. Please re-run your "
757
  "export to re-generate it."
759
  "El archivo exportado no puede ser encontrado y no puede ser descargado. Por "
760
  "favor ejecute nuevamente su exportación para volver a generarla."
761
 
762
+ #: ../../controllers/admin/settings.php:28
763
  msgid "Settings saved"
764
  msgstr "Configuraciones guardadas"
765
 
766
+ #: ../../filters/wpallexport_custom_types.php:4
767
  msgid "WooCommerce Products"
768
  msgstr "Productos de Woocommerce"
769
 
770
+ #: ../../helpers/pmxe_render_xml_element.php:44 ../..
771
+ #: /helpers/pmxe_render_xml_text.php:9
772
  #, php-format
773
  msgid "<strong>%s</strong> %s more"
774
  msgstr "<strong>%s</strong> %s más"
775
 
776
+ #: ../../helpers/pmxe_render_xml_element.php:44 ../..
777
+ #: /helpers/pmxe_render_xml_text.php:9
778
  msgid "element"
779
  msgstr "elemento"
780
 
781
+ #: ../../helpers/pmxe_render_xml_text.php:15
782
  msgid "more"
783
  msgstr "más"
784
 
785
+ #: ../../helpers/wp_all_export_get_cpt_name.php:9 ../../views/admin/export/index.
786
+ #: php:67
 
 
 
787
  msgid "Users"
788
  msgstr "Usuarios"
789
 
790
+ #: ../../helpers/wp_all_export_get_cpt_name.php:9
791
  msgid "User"
792
  msgstr "Usuario"
793
 
794
+ #: ../../helpers/wp_all_export_get_cpt_name.php:18
795
+ msgid "Product Variations"
796
+ msgstr "Variaciones del Producto"
797
+
798
+ #: ../../helpers/wp_all_export_get_cpt_name.php:28
799
  msgid "Records"
800
  msgstr "Registros"
801
 
802
+ #: ../../helpers/wp_all_export_get_cpt_name.php:28
803
  msgid "Record"
804
  msgstr "Registro"
805
 
806
+ #: ../../libraries/XmlExportACF.php:218 ../../libraries/XmlExportACF.php:268
807
  msgid "ACF"
808
  msgstr "Campos Personalizados Avanzados (ACF)"
809
 
810
+ #: ../../libraries/XmlExportComment.php:136 ../../libraries/XmlExportEngine.php:
811
+ #: 191 ../../libraries/XmlExportUser.php:199
812
+ msgid "General"
813
+ msgstr "General"
814
+
815
+ #: ../../libraries/XmlExportComment.php:229 ../../libraries/XmlExportUser.php:218
816
+ #: ../../libraries/XmlExportUser.php:292 ../../libraries/XmlExportWooCommerce.php:
817
+ #: 111 ../../libraries/XmlExportWooCommerce.php:279 ../..
818
+ #: /libraries/XmlExportWooCommerceOrder.php:130 ../..
819
+ #: /libraries/XmlExportWooCommerceOrder.php:945 ../..
820
+ #: /views/admin/export/template/new_field_comment.php:43 ../..
821
+ #: /views/admin/export/template/new_field_cpt.php:78 ../..
822
+ #: /views/admin/export/template/new_field_shop_order.php:33 ../..
823
+ #: /views/admin/export/template/new_field_user.php:57
824
+ msgid "Advanced"
825
+ msgstr "Avanzado"
826
+
827
+ #: ../../libraries/XmlExportEngine.php:172
828
  msgid "Standard"
829
  msgstr "Estándar"
830
 
831
+ #: ../../libraries/XmlExportEngine.php:176
832
  msgid "Taxonomies"
833
  msgstr "Taxonomías"
834
 
835
+ #: ../../libraries/XmlExportEngine.php:180
836
  msgid "Custom Fields"
837
  msgstr "Campos Personalizados"
838
 
839
+ #: ../../libraries/XmlExportEngine.php:184
840
  msgid "Other"
841
  msgstr "Otro"
842
 
843
+ #: ../../libraries/XmlExportEngine.php:253
 
 
 
 
844
  msgid "WP Query field is required"
845
  msgstr "El campo de WP Query es requerido"
846
 
847
+ #: ../../libraries/XmlExportEngine.php:288
 
 
 
 
848
  msgid "Invalid query"
849
  msgstr "Consulta no válida"
850
 
851
+ #: ../../libraries/XmlExportEngine.php:474 ../..
852
+ #: /libraries/XmlExportWooCommerceOrder.php:886
 
 
 
 
 
 
 
 
 
 
 
853
  msgid "All"
854
  msgstr "Todo"
855
 
856
+ #: ../../libraries/XmlExportEngine.php:493 ../../views/admin/export/template.php:
857
+ #: 73 ../../views/admin/export/template.php:106 ../../views/admin/export/template.
858
+ #: php:133
859
  msgid "Delete field"
860
  msgstr "Eliminar campo"
861
 
862
+ #: ../../libraries/XmlExportUser.php:231
 
 
 
 
 
 
 
 
 
 
 
863
  msgid "Network"
864
  msgstr "Red"
865
 
866
+ #: ../../libraries/XmlExportWooCommerce.php:98 ../..
867
+ #: /libraries/XmlExportWooCommerce.php:283
868
  msgid "Product Data"
869
  msgstr "Datos del Producto"
870
 
871
+ #: ../../libraries/XmlExportWooCommerceOrder.php:65 ../..
872
+ #: /libraries/XmlExportWooCommerceOrder.php:925
873
  msgid "Order"
874
  msgstr "Orden"
875
 
876
+ #: ../../libraries/XmlExportWooCommerceOrder.php:67 ../..
877
+ #: /libraries/XmlExportWooCommerceOrder.php:960
878
  msgid "Order ID"
879
  msgstr "ID orden"
880
 
881
+ #: ../../libraries/XmlExportWooCommerceOrder.php:68 ../..
882
+ #: /libraries/XmlExportWooCommerceOrder.php:961
883
  msgid "Order Key"
884
  msgstr "Clave de Orden "
885
 
886
+ #: ../../libraries/XmlExportWooCommerceOrder.php:69 ../..
887
+ #: /libraries/XmlExportWooCommerceOrder.php:962
888
  msgid "Order Date"
889
  msgstr "Fecha de Orden"
890
 
891
+ #: ../../libraries/XmlExportWooCommerceOrder.php:70 ../..
892
+ #: /libraries/XmlExportWooCommerceOrder.php:963
893
  msgid "Completed Date"
894
  msgstr "Fecha Completada"
895
 
896
+ #: ../../libraries/XmlExportWooCommerceOrder.php:71 ../..
897
+ #: /libraries/XmlExportWooCommerceOrder.php:964 ../..
898
+ #: /views/admin/export/template/new_field_cpt.php:9
899
  msgid "Title"
900
  msgstr "Título"
901
 
902
+ #: ../../libraries/XmlExportWooCommerceOrder.php:72 ../..
903
+ #: /libraries/XmlExportWooCommerceOrder.php:965
904
  msgid "Order Status"
905
  msgstr "Estado de Orden"
906
 
907
+ #: ../../libraries/XmlExportWooCommerceOrder.php:73 ../..
908
+ #: /libraries/XmlExportWooCommerceOrder.php:966
909
  msgid "Order Currency"
910
  msgstr "Moneda de Orden"
911
 
912
+ #: ../../libraries/XmlExportWooCommerceOrder.php:74 ../..
913
+ #: /libraries/XmlExportWooCommerceOrder.php:967
914
  msgid "Payment Method"
915
  msgstr "Método de Pago"
916
 
917
+ #: ../../libraries/XmlExportWooCommerceOrder.php:75 ../..
918
+ #: /libraries/XmlExportWooCommerceOrder.php:968
919
  msgid "Order Total"
920
  msgstr "Orden Total"
921
 
922
+ #: ../../libraries/XmlExportWooCommerceOrder.php:79 ../..
923
+ #: /libraries/XmlExportWooCommerceOrder.php:929
924
  msgid "Customer"
925
  msgstr "Cliente"
926
 
927
+ #: ../../libraries/XmlExportWooCommerceOrder.php:886
928
  msgid "Data"
929
  msgstr "Datos"
930
 
931
+ #: ../../libraries/XmlExportWooCommerceOrder.php:933
932
  msgid "Items"
933
  msgstr "Articulos"
934
 
935
+ #: ../../libraries/XmlExportWooCommerceOrder.php:937
936
  msgid "Taxes & Shipping"
937
  msgstr "Impuestos y Envíos"
938
 
939
+ #: ../../libraries/XmlExportWooCommerceOrder.php:941
940
  msgid "Fees & Discounts"
941
  msgstr "Comisiones y Descuentos"
942
 
943
+ #: ../../libraries/XmlExportWooCommerceOrder.php:981
944
  msgid "Product ID"
945
  msgstr "ID Producto"
946
 
947
+ #: ../../libraries/XmlExportWooCommerceOrder.php:982
948
  msgid "SKU"
949
  msgstr "SKU"
950
 
951
+ #: ../../libraries/XmlExportWooCommerceOrder.php:983
952
  msgid "Product Name"
953
  msgstr "Nombre del Producto"
954
 
955
+ #: ../../libraries/XmlExportWooCommerceOrder.php:984
956
  msgid "Product Variation Details"
957
  msgstr "Detalles de Variación de Productos "
958
 
959
+ #: ../../libraries/XmlExportWooCommerceOrder.php:985
960
  msgid "Quantity"
961
  msgstr "Cantidad "
962
 
963
+ #: ../../libraries/XmlExportWooCommerceOrder.php:986
964
  msgid "Item Cost"
965
  msgstr "Costo del Artículo"
966
 
967
+ #: ../../libraries/XmlExportWooCommerceOrder.php:987
968
  msgid "Item Total"
969
  msgstr "Total de Artículos"
970
 
971
+ #: ../../libraries/XmlExportWooCommerceOrder.php:996
972
  msgid "Rate Code (per tax)"
973
  msgstr "Código de Tarifa (por impuesto)"
974
 
975
+ #: ../../libraries/XmlExportWooCommerceOrder.php:997
976
  msgid "Rate Percentage (per tax)"
977
  msgstr "Porcentaje de tasa (por impuesto)"
978
 
979
+ #: ../../libraries/XmlExportWooCommerceOrder.php:998
980
  msgid "Amount (per tax)"
981
  msgstr "Monto (por impuesto)"
982
 
983
+ #: ../../libraries/XmlExportWooCommerceOrder.php:999
984
  msgid "Total Tax Amount"
985
  msgstr "Cantidad Total de Impuestos"
986
 
987
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1000
988
  msgid "Shipping Method"
989
  msgstr "Método de Envío"
990
 
991
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1001
992
  msgid "Shipping Cost"
993
  msgstr "Costo de Envío"
994
 
995
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1010
996
  msgid "Discount Amount (per coupon)"
997
  msgstr "Monto de Descuento (per coupon)"
998
 
999
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1011
1000
  msgid "Coupons Used"
1001
  msgstr "Cupones Utilizado"
1002
 
1003
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1012
1004
  msgid "Total Discount Amount"
1005
  msgstr "Monto Total de Descuento"
1006
 
1007
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1013
1008
  msgid "Fee Amount (per surcharge)"
1009
  msgstr "Importe de la Cuenta (por recargo)"
1010
 
1011
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1014
1012
  msgid "Total Fee Amount"
1013
  msgstr "Monto Total de Cuota"
1014
 
1015
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1024
1016
  msgid "Customer User ID"
1017
  msgstr "ID del Cliente Usuario"
1018
 
1019
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1025
1020
  msgid "Customer Note"
1021
  msgstr "Nota de Cliente"
1022
 
1023
+ #: ../../views/admin/export/index.php:10 ../../views/admin/export/options.php:16 .
1024
+ #: ./../views/admin/export/process.php:10 ../../views/admin/export/template.php:8
1025
+ #: ../../views/admin/manage/update.php:26
1026
  msgid "Export to XML / CSV"
1027
  msgstr "Exportar a XML / CSV"
1028
 
1029
+ #: ../../views/admin/export/index.php:13 ../../views/admin/export/options.php:19 .
1030
+ #: ./../views/admin/export/process.php:13 ../../views/admin/export/template.php:
1031
+ #: 11 ../../views/admin/manage/update.php:29
1032
  msgid "Support"
1033
  msgstr "Soporte"
1034
 
1035
+ #: ../../views/admin/export/index.php:13 ../../views/admin/export/options.php:19 .
1036
+ #: ./../views/admin/export/process.php:13 ../../views/admin/export/template.php:
1037
+ #: 11 ../../views/admin/manage/update.php:29
1038
  msgid "Documentation"
1039
  msgstr "Documentación "
1040
 
1041
+ #: ../../views/admin/export/index.php:30
1042
  msgid "First, choose what to export."
1043
  msgstr "Primer, escoja que va a exportar."
1044
 
1045
+ #: ../../views/admin/export/index.php:33
1046
  msgid "Specific Post Type"
1047
  msgstr "Especifique tipo de entrada"
1048
 
1049
+ #: ../../views/admin/export/index.php:37
1050
  msgid "WP_Query Results"
1051
  msgstr "Resultados WP_Query"
1052
 
1053
+ #: ../../views/admin/export/index.php:56
1054
  msgid "Choose a post type..."
1055
  msgstr "Escoja un tipo de entrada...."
1056
 
1057
+ #: ../../views/admin/export/index.php:80
1058
  msgid "Post Type Query"
1059
  msgstr "Consulta del Tipo de Entrada"
1060
 
1061
+ #: ../../views/admin/export/index.php:81
1062
  msgid "User Query"
1063
  msgstr "Consulta de usuario"
1064
 
1065
+ #: ../../views/admin/export/index.php:114
1066
  msgid "Skip to Step 3"
1067
  msgstr "Vaya al paso 3"
1068
 
1069
+ #: ../../views/admin/export/index.php:116
1070
  msgid "Continue to Step 2"
1071
  msgstr "Continuar al paso 2"
1072
 
1073
+ #: ../../views/admin/export/index.php:118
1074
  msgid "Auto Generate Export Template"
1075
  msgstr "Auto generar plantilla de exportación"
1076
 
1077
+ #: ../../views/admin/export/index.php:125 ../../views/admin/export/options.php:
1078
+ #: 202 ../../views/admin/export/process.php:62 ../../views/admin/export/template.
1079
+ #: php:248 ../../views/admin/manage/index.php:367 ../..
1080
+ #: /views/admin/manage/scheduling.php:57 ../../views/admin/manage/templates.php:
1081
+ #: 19 ../../views/admin/manage/update.php:206 ../../views/admin/settings/index.
1082
+ #: php:167
1083
  msgid "Created by"
1084
  msgstr "Creado por"
1085
 
1086
+ #: ../../views/admin/export/options.php:54 ../../views/admin/export/options.php:
1087
+ #: 191 ../../views/admin/manage/update.php:6 ../../views/admin/manage/update.php:
1088
+ #: 64 ../../views/admin/manage/update.php:199
 
 
 
 
 
 
 
1089
  msgid "Confirm & Run Export"
1090
  msgstr "Confirmar y ejecutar exportación"
1091
 
1092
+ #: ../../views/admin/export/options.php:70 ../../views/admin/manage/update.php:78
1093
  msgid "Filters"
1094
  msgstr "Filtros"
1095
 
1096
+ #: ../../views/admin/export/options.php:189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1097
  msgid "Back to Step 2"
1098
  msgstr "Regresar al paso 2"
1099
 
1100
+ #: ../../views/admin/export/options.php:194 ../../views/admin/export/template.php:
1101
+ #: 241
1102
  msgid "Back to Manage Exports"
1103
  msgstr "Regresar a gestionar las exportaciones"
1104
 
1105
+ #: ../../views/admin/export/options.php:195 ../../views/admin/manage/update.php:7
1106
+ #: ../../views/admin/manage/update.php:197
1107
  msgid "Save Export Configuration"
1108
  msgstr "Guardar configuración de exportación"
1109
 
1110
+ #: ../../views/admin/export/process.php:22
1111
  msgid "Export <span id=\"status\">in Progress...</span>"
1112
  msgstr "Exportación <span id=\"status\">en progreso...</span>"
1113
 
1114
+ #: ../../views/admin/export/process.php:23
1115
  msgid ""
1116
  "Exporting may take some time. Please do not close your browser or refresh "
1117
  "the page until the process is complete."
1119
  "Exportar puede tomar algún tiempo. Por favor, no cierre su navegador o "
1120
  "actualizar la página hasta que finalice el proceso."
1121
 
1122
+ #: ../../views/admin/export/process.php:29
1123
  msgid "Time Elapsed"
1124
  msgstr "Tiempo Transcurrido"
1125
 
1126
+ #: ../../views/admin/export/process.php:31
1127
  msgid "Exported"
1128
  msgstr "Exportado"
1129
 
1130
+ #: ../../views/admin/export/process.php:36
1131
  msgid "Export Complete!"
1132
  msgstr "Exportación completa!"
1133
 
1134
+ #: ../../views/admin/export/process.php:37
1135
  msgid "WP All Export successfully exported your data!"
1136
  msgstr "¡WP All Export ha exportado con éxito sus datos!"
1137
 
1138
+ #: ../../views/admin/export/process.php:38
1139
  msgid "Download Data"
1140
  msgstr "Descargar datos"
1141
 
1142
+ #: ../../views/admin/export/process.php:46 ../../views/admin/export/process.php:52
 
 
 
 
 
1143
  msgid "Settings & Data for WP All Import"
1144
  msgstr "Ajustes y datos para WP All Import"
1145
 
1146
+ #: ../../views/admin/export/process.php:51 ../../views/admin/manage/index.php:140
1147
+ #: ../../views/admin/manage/index.php:147
1148
+ msgid "Bundle"
1149
+ msgstr "Bulto"
1150
+
1151
+ #: ../../views/admin/export/template.php:23
1152
  msgid "Choose data to include in the export file."
1153
  msgstr "Elegir los datos a incluir en el archivo de exportación."
1154
 
1155
+ #: ../../views/admin/export/template.php:115
1156
  msgid ""
1157
  "Drag & drop data from \"Available Data\" on the right to include it in the "
1158
  "export or click \"Add Field To Export\" below."
1161
  "incluir en la exportación o haga clic en \"Agregar campo a exportar\" a "
1162
  "continuación."
1163
 
1164
+ #: ../../views/admin/export/template.php:139
1165
  msgid ""
1166
  "Warning: without an ID column, you won't be able to re-import this data "
1167
  "using WP All Import."
1169
  "ADVERTENCIA: sin una identificación de columna, usted no podrá re-importar "
1170
  "estos datos usando El Importador WP."
1171
 
1172
+ #: ../../views/admin/export/template.php:145
1173
  msgid ""
1174
  "Warning: without _sku and product_type columns, you won't be able to re-"
1175
  "import this data using WP All Import."
1177
  "ADVERTENCIA: sin columnas _sku y product_type, usted no podrá re-importar "
1178
  "estos datos usando El Importador WP."
1179
 
1180
+ #: ../../views/admin/export/template.php:151
1181
  msgid ""
1182
  "Warning: without post_type column, you won't be able to re-import this data "
1183
  "using WP All Import."
1185
  "ADVERTENCIA: sin columna post_type, usted no podrá re-importar estos datos "
1186
  "usando El Importador WP."
1187
 
1188
+ #: ../../views/admin/export/template.php:157 ../../views/admin/export/template.
1189
+ #: php:283
1190
  msgid "Add Field To Export"
1191
  msgstr "Agregar Campo para Exportar"
1192
 
1193
+ #: ../../views/admin/export/template.php:162
1194
  msgid "Display each product in its own row"
1195
  msgstr "Mostrar cada producto en su propia fila"
1196
 
1197
+ #: ../../views/admin/export/template.php:176
 
 
 
 
 
1198
  msgid "Preview A Row"
1199
  msgstr "Vista previa de Fila"
1200
 
1201
+ #: ../../views/admin/export/template.php:182
1202
  msgid "Export File Format:"
1203
  msgstr "Formato de archivo de exportación:"
1204
 
1205
+ #: ../../views/admin/export/template.php:187
1206
  msgid "XML"
1207
  msgstr "XML"
1208
 
1209
+ #: ../../views/admin/export/template.php:191
1210
  msgid "CSV"
1211
  msgstr "CSV"
1212
 
1213
+ #: ../../views/admin/export/template.php:194
1214
  msgid "Delimiter:"
1215
  msgstr "Delimitador:"
1216
 
1217
+ #: ../../views/admin/export/template.php:258
 
 
 
 
1218
  msgid "Available Data"
1219
  msgstr "Datos disponibles"
1220
 
1221
+ #: ../../views/admin/export/template.php:264
1222
  msgid "Auto Generate"
1223
  msgstr "Auto generar"
1224
 
1225
+ #: ../../views/admin/export/template.php:283
1226
  msgid "Edit Export Field"
1227
  msgstr "Editar campo de exportación"
1228
 
1229
+ #: ../../views/admin/export/options/settings.php:5
1230
+ msgid "Advanced Export"
1231
+ msgstr "Exportación avanzada"
1232
+
1233
+ #: ../../views/admin/export/options/settings.php:13
1234
+ msgid "In each iteration, process"
1235
+ msgstr "En cada iteración, proceso de"
1236
+
1237
+ #: ../../views/admin/export/options/settings.php:13 ../..
1238
+ #: /views/admin/export/options/settings.php:19
1239
+ msgid "records"
1240
+ msgstr "registros"
1241
+
1242
+ #: ../../views/admin/export/options/settings.php:14
1243
+ msgid ""
1244
+ "WP All Export must be able to process this many records in less than your "
1245
+ "server's timeout settings. If your export fails before completion, to "
1246
+ "troubleshoot you should lower this number."
1247
+ msgstr "El Exportador WP debe ser capaz de procesar "
1248
+
1249
+ #: ../../views/admin/export/options/settings.php:25
1250
+ msgid "Include BOM in export file"
1251
+ msgstr "Incluyen BOM en archivo de exportación"
1252
+
1253
+ #: ../../views/admin/export/options/settings.php:26
1254
+ msgid ""
1255
+ "The BOM will help some programs like Microsoft Excel read your export file "
1256
+ "if it includes non-English characters."
1257
+ msgstr ""
1258
+ "El BOM le ayudará a algunos programas como Microsoft Excel leer el archivo "
1259
+ "de exportación si incluye caracteres no ingleses."
1260
+
1261
+ #: ../../views/admin/export/options/settings.php:58
1262
+ msgid "Friendly Name:"
1263
+ msgstr "Nombre descriptivo:"
1264
+
1265
+ #: ../../views/admin/export/options/settings.php:59
1266
+ msgid "Save friendly name..."
1267
+ msgstr "Guardar nombre descriptivo..."
1268
+
1269
+ #: ../../views/admin/export/template/new_field_comment.php:4 ../..
1270
+ #: /views/admin/export/template/new_field_cpt.php:4 ../..
1271
+ #: /views/admin/export/template/new_field_shop_order.php:4 ../..
1272
+ #: /views/admin/export/template/new_field_user.php:4
1273
  msgid "What field would you like to export?"
1274
  msgstr "¿Qué campo quieres exportar?"
1275
 
1276
+ #: ../../views/admin/export/template/new_field_comment.php:8 ../..
1277
+ #: /views/admin/export/template/new_field_cpt.php:8 ../..
1278
+ #: /views/admin/export/template/new_field_user.php:8 ../..
1279
+ #: /views/admin/manage/index.php:27
1280
  msgid "ID"
1281
  msgstr "ID"
1282
 
1283
+ #: ../../views/admin/export/template/new_field_comment.php:10 ../..
1284
+ #: /views/admin/export/template/new_field_cpt.php:21
1285
+ msgid "Author"
1286
+ msgstr "Autor"
1287
+
1288
+ #: ../../views/admin/export/template/new_field_comment.php:14 ../..
1289
+ #: /views/admin/export/template/new_field_cpt.php:12
1290
+ msgid "Date"
1291
+ msgstr "Fecha"
1292
+
1293
+ #: ../../views/admin/export/template/new_field_comment.php:15 ../..
1294
+ #: /views/admin/export/template/new_field_cpt.php:10
1295
  msgid "Content"
1296
  msgstr "Contenido"
1297
 
1298
+ #: ../../views/admin/export/template/new_field_comment.php:25 ../..
1299
+ #: /views/admin/export/template/new_field_cpt.php:44 ../..
1300
+ #: /views/admin/export/template/new_field_shop_order.php:19 ../..
1301
+ #: /views/admin/export/template/new_field_user.php:35
1302
+ msgid "SQL Query"
1303
+ msgstr "Consulta SQL"
1304
+
1305
+ #: ../../views/admin/export/template/new_field_comment.php:33 ../..
1306
+ #: /views/admin/export/template/new_field_cpt.php:52 ../..
1307
+ #: /views/admin/export/template/new_field_cpt.php:56 ../..
1308
+ #: /views/admin/export/template/new_field_cpt.php:60 ../..
1309
+ #: /views/admin/export/template/new_field_cpt.php:64 ../..
1310
+ #: /views/admin/export/template/new_field_cpt.php:68 ../..
1311
+ #: /views/admin/export/template/new_field_user.php:43 ../..
1312
+ #: /views/admin/export/template/new_field_user.php:47
1313
+ msgid "Field Name"
1314
+ msgstr "Nombre del Campo"
1315
+
1316
+ #: ../../views/admin/export/template/new_field_comment.php:38 ../..
1317
+ #: /views/admin/export/template/new_field_cpt.php:73 ../..
1318
+ #: /views/admin/export/template/new_field_shop_order.php:26 ../..
1319
+ #: /views/admin/export/template/new_field_user.php:52
1320
+ msgid "What would you like to name the column/element in your exported file?"
1321
+ msgstr "¿Cómo te gustaría nombrar la columna/elemento en el archivo exportado?"
1322
+
1323
+ #: ../../views/admin/export/template/new_field_comment.php:47 ../..
1324
+ #: /views/admin/export/template/new_field_cpt.php:82 ../..
1325
+ #: /views/admin/export/template/new_field_shop_order.php:37 ../..
1326
+ #: /views/admin/export/template/new_field_user.php:61
1327
+ #, php-format
1328
+ msgid ""
1329
+ "%%ID%% will be replaced with the ID of the post being exported, example: "
1330
+ "SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND "
1331
+ "meta_key='your_meta_key';"
1332
+ msgstr ""
1333
+ "%%ID%% será reemplazado por el ID de la entrada exportada, ejemplo: "
1334
+ "SELECCIONAR meta_value DESDE wp_postmeta DONDE post_id =%%ID%% Y meta_key "
1335
+ "= 'your_meta_key';"
1336
+
1337
+ #: ../../views/admin/export/template/new_field_comment.php:52 ../..
1338
+ #: /views/admin/export/template/new_field_cpt.php:94 ../..
1339
+ #: /views/admin/export/template/new_field_shop_order.php:42 ../..
1340
+ #: /views/admin/export/template/new_field_user.php:66
1341
+ msgid "UNIX timestamp - PHP time()"
1342
+ msgstr "Marca de tiempo UNIX - PHP time()"
1343
+
1344
+ #: ../../views/admin/export/template/new_field_comment.php:53 ../..
1345
+ #: /views/admin/export/template/new_field_cpt.php:95 ../..
1346
+ #: /views/admin/export/template/new_field_shop_order.php:43 ../..
1347
+ #: /views/admin/export/template/new_field_user.php:67
1348
+ msgid "Natural Language PHP date()"
1349
+ msgstr "Lenguaje natural PHP date()"
1350
+
1351
+ #: ../../views/admin/export/template/new_field_comment.php:56 ../..
1352
+ #: /views/admin/export/template/new_field_cpt.php:98 ../..
1353
+ #: /views/admin/export/template/new_field_shop_order.php:46 ../..
1354
+ #: /views/admin/export/template/new_field_user.php:70
1355
+ msgid "date() Format"
1356
+ msgstr "Format date()"
1357
+
1358
+ #: ../../views/admin/export/template/new_field_comment.php:63 ../..
1359
+ #: /views/admin/export/template/new_field_cpt.php:105 ../..
1360
+ #: /views/admin/export/template/new_field_shop_order.php:53 ../..
1361
+ #: /views/admin/export/template/new_field_user.php:77
1362
+ msgid "Export the value returned by a PHP function"
1363
+ msgstr "Exportar el valor devuelto por una función PHP"
1364
+
1365
+ #: ../../views/admin/export/template/new_field_comment.php:64 ../..
1366
+ #: /views/admin/export/template/new_field_cpt.php:106 ../..
1367
+ #: /views/admin/export/template/new_field_shop_order.php:54 ../..
1368
+ #: /views/admin/export/template/new_field_user.php:78
1369
+ msgid "The value of the field chosen for export will be passed to the PHP function."
1370
+ msgstr "El valor del campo seleccionado para la exportar se pasará a la función PHP."
1371
+
1372
+ #: ../../views/admin/export/template/new_field_comment.php:78 ../..
1373
+ #: /views/admin/export/template/new_field_cpt.php:120 ../..
1374
+ #: /views/admin/export/template/new_field_shop_order.php:68 ../..
1375
+ #: /views/admin/export/template/new_field_user.php:92 ../..
1376
+ #: /views/admin/settings/index.php:150
1377
+ msgid "Function Editor"
1378
+ msgstr "Editor de funciones"
1379
+
1380
+ #: ../../views/admin/export/template/new_field_comment.php:78 ../..
1381
+ #: /views/admin/export/template/new_field_cpt.php:120 ../..
1382
+ #: /views/admin/export/template/new_field_shop_order.php:68 ../..
1383
+ #: /views/admin/export/template/new_field_user.php:92 ../..
1384
+ #: /views/admin/settings/index.php:158
1385
+ #, php-format
1386
+ msgid "Add functions here for use during your export. You can access this file at %s"
1387
+ msgstr ""
1388
+ "Añadir funciones aquí para su uso durante la exportación. Puede acceder a "
1389
+ "este archivo en %s"
1390
+
1391
+ #: ../../views/admin/export/template/new_field_comment.php:87 ../..
1392
+ #: /views/admin/export/template/new_field_cpt.php:129 ../..
1393
+ #: /views/admin/export/template/new_field_shop_order.php:77 ../..
1394
+ #: /views/admin/export/template/new_field_user.php:101 ../..
1395
+ #: /views/admin/settings/index.php:157
1396
+ msgid "Save Functions"
1397
+ msgstr "Guardar las funciones"
1398
+
1399
+ #: ../../views/admin/export/template/new_field_comment.php:101 ../..
1400
+ #: /views/admin/export/template/new_field_cpt.php:144 ../..
1401
+ #: /views/admin/export/template/new_field_shop_order.php:91 ../..
1402
+ #: /views/admin/export/template/new_field_user.php:115 ../..
1403
+ #: /views/admin/manage/index.php:52 ../../views/admin/manage/index.php:155 ../..
1404
+ #: /views/admin/manage/index.php:356
1405
+ msgid "Delete"
1406
+ msgstr "Eliminar"
1407
+
1408
+ #: ../../views/admin/export/template/new_field_comment.php:102 ../..
1409
+ #: /views/admin/export/template/new_field_cpt.php:145 ../..
1410
+ #: /views/admin/export/template/new_field_shop_order.php:92 ../..
1411
+ #: /views/admin/export/template/new_field_user.php:116
1412
+ msgid "Done"
1413
+ msgstr "Terminado"
1414
+
1415
+ #: ../../views/admin/export/template/new_field_comment.php:103 ../..
1416
+ #: /views/admin/export/template/new_field_cpt.php:146 ../..
1417
+ #: /views/admin/export/template/new_field_shop_order.php:93 ../..
1418
+ #: /views/admin/export/template/new_field_user.php:117
1419
+ msgid "Close"
1420
+ msgstr "Cerrar"
1421
+
1422
+ #: ../../views/admin/export/template/new_field_cpt.php:11
1423
  msgid "Excerpt"
1424
  msgstr "Extracto"
1425
 
1426
+ #: ../../views/admin/export/template/new_field_cpt.php:13
 
 
 
 
1427
  msgid "Post Type"
1428
  msgstr "Tipo de Entrada"
1429
 
1430
+ #: ../../views/admin/export/template/new_field_cpt.php:14
1431
  msgid "Categories / Taxonomies"
1432
  msgstr "Categorías / taxonomías"
1433
 
1434
+ #: ../../views/admin/export/template/new_field_cpt.php:15
1435
  msgid "Custom Field / Post Meta"
1436
  msgstr "Campo personalizado / poste de Meta"
1437
 
1438
+ #: ../../views/admin/export/template/new_field_cpt.php:16
1439
  msgid "Images / Media"
1440
  msgstr "Imágenes / Media"
1441
 
1442
+ #: ../../views/admin/export/template/new_field_cpt.php:17
1443
  msgid "Attachment"
1444
  msgstr "Archivo Adjunto"
1445
 
1446
+ #: ../../views/admin/export/template/new_field_cpt.php:20
1447
  msgid "Post Status"
1448
  msgstr "Estado de Entrada"
1449
 
1450
+ #: ../../views/admin/export/template/new_field_cpt.php:22
 
 
 
 
1451
  msgid "Post Slug"
1452
  msgstr "Slug de Entrada"
1453
 
1454
+ #: ../../views/admin/export/template/new_field_cpt.php:23
1455
  msgid "Post Format"
1456
  msgstr "Formato de Entrada"
1457
 
1458
+ #: ../../views/admin/export/template/new_field_cpt.php:24
1459
  msgid "Template"
1460
  msgstr "Plantilla"
1461
 
1462
+ #: ../../views/admin/export/template/new_field_cpt.php:25
1463
  msgid "Parent"
1464
  msgstr "Padre"
1465
 
1466
+ #: ../../views/admin/export/template/new_field_cpt.php:26
1467
  msgid "Menu Order"
1468
  msgstr "Orden de Menús"
1469
 
1470
+ #: ../../views/admin/export/template/new_field_cpt.php:27
1471
  msgid "Permalink"
1472
  msgstr "Enlace permanente"
1473
 
1474
+ #: ../../views/admin/export/template/new_field_cpt.php:32
1475
  msgid "WooCommerce Data"
1476
  msgstr "Datos WooCommerce "
1477
 
1478
+ #: ../../views/admin/export/template/new_field_cpt.php:33
1479
  msgid "WooCommerce Taxonomies"
1480
  msgstr "Taxonomías WooCommerce "
1481
 
1482
+ #: ../../views/admin/export/template/new_field_cpt.php:36
1483
  msgid "WooCommerce Order"
1484
  msgstr "Orden WooCommerce "
1485
 
1486
+ #: ../../views/admin/export/template/new_field_cpt.php:39 ../..
1487
+ #: /views/admin/export/template/new_field_user.php:30
1488
  msgid "Advanced Custom Fields"
1489
  msgstr "Campos Avanzados Personalizados"
1490
 
1491
+ #: ../../views/admin/export/template/new_field_cpt.php:87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1492
  msgid "Export Image URLs"
1493
  msgstr "Exportar URL de imagen"
1494
 
1495
+ #: ../../views/admin/export/template/new_field_cpt.php:88
1496
  msgid "Export Image Filenames"
1497
  msgstr "Exportar los nombres de archivo de imagenes"
1498
 
1499
+ #: ../../views/admin/export/template/new_field_cpt.php:89
1500
  msgid "Export Image File Paths"
1501
  msgstr "Exportar rutas de archivo de imagen"
1502
 
1503
+ #: ../../views/admin/export/template/new_field_user.php:9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1504
  msgid "Login"
1505
  msgstr "Iniciar sesión"
1506
 
1507
+ #: ../../views/admin/export/template/new_field_user.php:10
1508
  msgid "Email"
1509
  msgstr "Correo electrónico"
1510
 
1511
+ #: ../../views/admin/export/template/new_field_user.php:11
1512
  msgid "First Name"
1513
  msgstr "Primer Nombre"
1514
 
1515
+ #: ../../views/admin/export/template/new_field_user.php:12
1516
  msgid "Last Name"
1517
  msgstr "Apellido"
1518
 
1519
+ #: ../../views/admin/export/template/new_field_user.php:13
1520
  msgid "Registered Date"
1521
  msgstr "Fecha de registro"
1522
 
1523
+ #: ../../views/admin/export/template/new_field_user.php:14
1524
  msgid "Nicename"
1525
  msgstr "El nombre amigable"
1526
 
1527
+ #: ../../views/admin/export/template/new_field_user.php:15
1528
  msgid "URL"
1529
  msgstr "URL"
1530
 
1531
+ #: ../../views/admin/export/template/new_field_user.php:16
1532
  msgid "Display Name"
1533
  msgstr "Nombre para Mostrar"
1534
 
1535
+ #: ../../views/admin/export/template/new_field_user.php:17
1536
  msgid "Nickname"
1537
  msgstr "Sobrenombre"
1538
 
1539
+ #: ../../views/admin/export/template/new_field_user.php:18
1540
  msgid "Description"
1541
  msgstr "Descripción"
1542
 
1543
+ #: ../../views/admin/export/template/new_field_user.php:21
1544
  msgid "Password"
1545
  msgstr "Contraseña"
1546
 
1547
+ #: ../../views/admin/export/template/new_field_user.php:22
1548
  msgid "Activation Key"
1549
  msgstr "Clave de activación"
1550
 
1551
+ #: ../../views/admin/export/template/new_field_user.php:23
1552
  msgid "Status"
1553
  msgstr "Estado"
1554
 
1555
+ #: ../../views/admin/export/template/new_field_user.php:24
1556
  msgid "Roles"
1557
  msgstr "Roles"
1558
 
1559
+ #: ../../views/admin/export/template/new_field_user.php:25
1560
  msgid "Custom Field / User Meta"
1561
  msgstr "Campo personalizado / Usuario Meta"
1562
 
1563
+ #: ../../views/admin/help/index.php:1
1564
  msgid "WP All Export Support"
1565
  msgstr "Soporte para WP All Export"
1566
 
1567
+ #: ../../views/admin/manage/bulk.php:10
1568
  #, php-format
1569
  msgid "Are you sure you want to delete <strong>%s</strong> selected %s?"
1570
  msgstr "¿Está seguro que desea eliminar <strong>%s</strong> seleccionado %s?"
1571
 
1572
+ #: ../../views/admin/manage/delete.php:1
1573
  msgid "Delete Export"
1574
  msgstr "Eliminar de la exportación"
1575
 
1576
+ #: ../../views/admin/manage/delete.php:4
1577
  #, php-format
1578
  msgid "Are you sure you want to delete <strong>%s</strong> export?"
1579
  msgstr "¿Está seguro que desea eliminar <strong>%s</strong> de exportación?"
1580
 
1581
+ #: ../../views/admin/manage/index.php:18 ../../views/admin/manage/index.php:20
1582
  msgid "Search Exports"
1583
  msgstr "Buscar Exportaciones "
1584
 
1585
+ #: ../../views/admin/manage/index.php:28
1586
  msgid "Name"
1587
  msgstr "Nombre"
1588
 
1589
+ #: ../../views/admin/manage/index.php:30
1590
  msgid "Query"
1591
  msgstr "Consulta"
1592
 
1593
+ #: ../../views/admin/manage/index.php:32
1594
  msgid "Summary"
1595
  msgstr "Resumen"
1596
 
1597
+ #: ../../views/admin/manage/index.php:34
1598
  msgid "Info & Options"
1599
  msgstr "Información y opciones"
1600
 
1601
+ #: ../../views/admin/manage/index.php:51 ../../views/admin/manage/index.php:354
1602
  msgid "Bulk Actions"
1603
  msgstr "Acciones en Bloque"
1604
 
1605
+ #: ../../views/admin/manage/index.php:54 ../../views/admin/manage/index.php:362
1606
  msgid "Apply"
1607
  msgstr "Aplicar"
1608
 
1609
+ #: ../../views/admin/manage/index.php:60
1610
  #, php-format
1611
  msgid "Displaying %s&#8211;%s of %s"
1612
  msgstr "Mostrando %s&#8211;%s de %s"
1613
 
1614
+ #: ../../views/admin/manage/index.php:104
1615
  msgid "No previous exports found."
1616
  msgstr "No se encontró exportaciones previas."
1617
 
1618
+ #: ../../views/admin/manage/index.php:134 ../../views/admin/manage/update.php:195
1619
  msgid "Edit Template"
1620
  msgstr "Editar plantilla"
1621
 
1622
+ #: ../../views/admin/manage/index.php:135
1623
  msgid "Edit Options"
1624
  msgstr "Editar Opciones"
1625
 
1626
+ #: ../../views/admin/manage/index.php:163 ../../views/admin/manage/scheduling.php:2
1627
  msgid "Cron Scheduling"
1628
  msgstr "Programación de Cron"
1629
 
1630
+ #: ../../views/admin/manage/index.php:207
1631
  msgid "Import with WP All Import"
1632
  msgstr "Importar con WP All Import"
1633
 
1634
+ #: ../../views/admin/manage/index.php:217 ../../views/admin/manage/templates.php:2
1635
  msgid "Download Import Templates"
1636
  msgstr "Descargar plantillas de importación"
1637
 
1638
+ #: ../../views/admin/manage/index.php:229
1639
  msgid "Post Types: "
1640
  msgstr "Tipos de Entradas:"
1641
 
1642
+ #: ../../views/admin/manage/index.php:246
1643
  msgid "Y/m/d g:i a"
1644
  msgstr "Y/m/d g:i:s A"
1645
 
1646
+ #: ../../views/admin/manage/index.php:256
1647
  msgid "triggered with cron"
1648
  msgstr "desencadenado con cron "
1649
 
1650
+ #: ../../views/admin/manage/index.php:263 ../../views/admin/manage/index.php:278 .
1651
+ #: ./../views/admin/manage/index.php:292
1652
  #, php-format
1653
  msgid "last activity %s ago"
1654
  msgstr "útima actividad hace %s "
1655
 
1656
+ #: ../../views/admin/manage/index.php:270
1657
  msgid "currently processing with cron"
1658
  msgstr "actualmente procesando con cron"
1659
 
1660
+ #: ../../views/admin/manage/index.php:285
1661
  msgid "Export currently in progress"
1662
  msgstr "Exportación actualmente en progreso"
1663
 
1664
+ #: ../../views/admin/manage/index.php:299
1665
  #, php-format
1666
  msgid "Export Attempt at %s"
1667
  msgstr "Intento de Exportación a %s"
1668
 
1669
+ #: ../../views/admin/manage/index.php:303
1670
  #, php-format
1671
  msgid "Last run: %s"
1672
  msgstr "Última ejecución: %s"
1673
 
1674
+ #: ../../views/admin/manage/index.php:303
1675
  msgid "never"
1676
  msgstr "nunca"
1677
 
1678
+ #: ../../views/admin/manage/index.php:304
1679
  #, php-format
1680
  msgid "%d Records Exported"
1681
  msgstr "%d registros exportados"
1682
 
1683
+ #: ../../views/admin/manage/index.php:305
1684
  #, php-format
1685
  msgid "Format: %s"
1686
  msgstr "Formato: %s"
1687
 
1688
+ #: ../../views/admin/manage/index.php:311
1689
  msgid "settings edited since last run"
1690
  msgstr "configuraciones editadas desde la ultima ejecución"
1691
 
1692
+ #: ../../views/admin/manage/index.php:323
1693
  msgid "Edit"
1694
  msgstr "Editar"
1695
 
1696
+ #: ../../views/admin/manage/index.php:324
1697
  msgid "Run Export"
1698
  msgstr "Ejecutar Exportación"
1699
 
1700
+ #: ../../views/admin/manage/index.php:326
1701
  msgid "Cancel Cron"
1702
  msgstr "Cancelar Cron"
1703
 
1704
+ #: ../../views/admin/manage/index.php:328
1705
  msgid "Cancel"
1706
  msgstr "Cancelar"
1707
 
1708
+ #: ../../views/admin/manage/index.php:358
1709
  msgid "Restore"
1710
  msgstr "Restaurar"
1711
 
1712
+ #: ../../views/admin/manage/index.php:359
1713
  msgid "Delete Permanently"
1714
  msgstr "Borrar permanentemente"
1715
 
1716
+ #: ../../views/admin/manage/scheduling.php:17
 
 
 
 
 
 
 
 
 
 
1717
  msgid "Export File URL"
1718
  msgstr "Exportar Archivo URL"
1719
 
1720
+ #: ../../views/admin/manage/scheduling.php:25
 
 
 
 
1721
  msgid "Trigger Script"
1722
  msgstr "Guía desencandenante"
1723
 
1724
+ #: ../../views/admin/manage/scheduling.php:31 ../../views/admin/manage/scheduling.
1725
+ #: php:43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1726
  msgid "Example:"
1727
  msgstr "Ejemplo:"
1728
 
1729
+ #: ../../views/admin/manage/scheduling.php:35
1730
  msgid "Execution Script"
1731
  msgstr "Guía (script) de Ejecución"
1732
 
1733
+ #: ../../views/admin/manage/scheduling.php:47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1734
  msgid "Notes"
1735
  msgstr "Notas"
1736
 
1737
+ #: ../../views/admin/manage/scheduling.php:50
1738
  msgid ""
1739
  "Your web host may require you to use a command other than wget, although "
1740
  "wget is most common. In this case, you must asking your web hosting provider "
1744
  "es más común el wget. En este caso, usted debe pedir su proveedor de "
1745
  "alojamiento web ayuda."
1746
 
1747
+ #: ../../views/admin/manage/templates.php:6
1748
  msgid ""
1749
  "Download your import templates and use them to import your exported file to "
1750
  "a separate WordPress/WP All Import installation."
1752
  "Descargar las plantillas de importación y utilizarlos para importar el "
1753
  "archivo exportado a una instalación de WordPress/WP All Import."
1754
 
1755
+ #: ../../views/admin/manage/templates.php:10
1756
  msgid ""
1757
  "Install these import templates in your separate WP All Import installation "
1758
  "from the All Import -> Settings page by clicking the \"Import Templates\" "
1762
  "pagina de -> Configuración haciendo clic en el botón \"Importar plantillas\" "
1763
  "de importación."
1764
 
1765
+ #: ../../views/admin/settings/index.php:49
 
 
 
 
 
 
 
 
 
 
1766
  msgid "Cron Exports"
1767
  msgstr "Exportaciones de cron"
1768
 
1769
+ #: ../../views/admin/settings/index.php:54
1770
  msgid "Secret Key"
1771
  msgstr "Clave Secreta"
1772
 
1773
+ #: ../../views/admin/settings/index.php:57
1774
  msgid "Changing this will require you to re-create your existing cron jobs."
1775
  msgstr "Cambiar esto exigirá volver a crear tus trabajos cron existentes."
1776
 
1777
+ #: ../../views/admin/settings/index.php:65
1778
  msgid "Files"
1779
  msgstr "Archivos"
1780
 
1781
+ #: ../../views/admin/settings/index.php:70 ../../views/admin/settings/index.php:73
1782
  msgid "Secure Mode"
1783
  msgstr "Modo seguro"
1784
 
1785
+ #: ../../views/admin/settings/index.php:75
1786
  msgid "Randomize folder names"
1787
  msgstr "Aleatorizar los nombres de las carpetas"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
i18n/languages/wp_all_export_plugin-ru_RU.mo CHANGED
Binary file
i18n/languages/wp_all_export_plugin-ru_RU.po CHANGED
@@ -3,883 +3,1207 @@ msgstr ""
3
  "Project-Id-Version: WP All Export Pro v1.1.0 RC7\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2015-11-13 11:18+0200\n"
7
- "Last-Translator: \n"
8
  "Language-Team: \n"
 
 
 
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
13
- "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
14
- "X-Generator: Poedit 1.8.4\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
- "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
 
 
 
 
18
  "X-Poedit-Basepath: .\n"
19
  "X-Textdomain-Support: yes\n"
20
- "Language: ru\n"
21
  "X-Poedit-SearchPath-0: .\n"
 
22
 
23
- msgid "#%s Cron job triggered."
24
- msgstr "#%s Cron задача запущена."
 
25
 
26
- msgid ""
27
- "%%ID%% will be replaced with the ID of the post being exported, example: "
28
- "SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND "
29
- "meta_key='your_meta_key';"
30
  msgstr ""
31
- "%%ID%% будет замещен экспортируемым постом, например: SELECT meta_value FROM "
32
- "wp_postmeta WHERE post_id=%%ID%% AND meta_key='your_meta_key';"
33
 
34
- msgid "%d %s deleted"
35
- msgstr "%d %s удален"
 
 
 
36
 
37
- msgid "%d Records Exported"
38
- msgstr "%d записей экспортировано"
 
39
 
40
- msgid "&laquo;"
41
- msgstr "&laquo;"
 
42
 
43
- msgid "&raquo;"
44
- msgstr "&raquo;"
 
 
45
 
46
- msgid "<strong>%s</strong> %s more"
47
- msgstr "<strong>%s</strong> %s еще"
 
48
 
49
- msgid "ACF"
50
- msgstr "ACF"
 
51
 
52
- msgid "Activation Key"
53
- msgstr "Код активации"
 
54
 
55
- msgid "Add Field To Export"
56
- msgstr "Добавить поле к экспорту"
 
57
 
58
- msgid "Add Filtering Options"
59
- msgstr "Добавить параметры фильтрации"
 
 
60
 
61
- msgid "Add Rule"
62
- msgstr "Добавить правило"
 
63
 
64
- msgid "Advanced"
65
- msgstr "Дополнительно"
 
66
 
67
- msgid "Advanced Custom Fields"
68
- msgstr "Дополнительные пользовательские поля (ACF)"
 
 
 
69
 
70
- msgid "Advanced Export"
71
- msgstr "Расширенный экспорт"
 
 
72
 
73
- msgid "All"
74
- msgstr "Все"
 
 
 
 
75
 
76
- msgid "All Export"
77
- msgstr "All Export"
 
78
 
79
- msgid "Amount (per tax)"
80
- msgstr "Сумма (per tax)"
 
81
 
82
- msgid "Apply"
83
- msgstr "Принять"
 
84
 
85
- msgid "Apply Filters To Export Data"
86
- msgstr "Применить фильтры к экспортируемым данным"
 
 
87
 
88
- msgid "Are you sure you want to delete <strong>%s</strong> export?"
89
- msgstr "Вы уверены, что хотите удалить <strong>%s</strong> экспорт?"
 
90
 
91
- msgid "Are you sure you want to delete <strong>%s</strong> selected %s?"
92
- msgstr "Вы уверены, что хотите удалить <strong>%s</strong> выбранные %s?"
 
93
 
94
- msgid "Are you sure you want to re-run <strong>%s</strong> export?"
95
- msgstr "Вы уверены, что хотите перезапустить <strong>%s</strong> экспорт?"
 
96
 
97
- msgid "Attachment"
98
- msgstr "Вложение"
 
99
 
100
- msgid "Author"
101
- msgstr "Автор"
 
102
 
103
- msgid "Auto Generate"
104
- msgstr "Авто создание"
 
105
 
106
- msgid "Auto Generate Export Template"
107
- msgstr "Автосоздание шаблона экспорта"
 
108
 
109
- msgid "Available Data"
110
- msgstr "Доступные данные"
 
 
 
 
111
 
112
- msgid "Back to Manage Exports"
113
- msgstr "Вернуться к управлению экспортами"
 
114
 
115
- msgid "Back to Step 2"
116
- msgstr "Вернуться к шагу 2"
 
117
 
118
- msgid "Bulk Actions"
119
- msgstr "Массовое действие"
 
120
 
121
- msgid "Bundle"
122
- msgstr "Связка"
 
123
 
124
- msgid "CSV"
125
- msgstr "CSV"
 
126
 
127
- msgid "CSV delimiter must be specified"
128
- msgstr "CSV разделитель должен быть указан"
 
 
 
 
129
 
130
- msgid "Cancel"
131
- msgstr "Отменить"
 
 
132
 
133
- msgid "Cancel Cron"
134
- msgstr "Отменить Cron"
 
135
 
136
- msgid "Categories / Taxonomies"
137
- msgstr "Категории / Таксономии"
 
138
 
139
- msgid "Changing this will require you to re-create your existing cron jobs."
140
- msgstr "Изменение этого потребует пересоздать существующие задания cron."
 
141
 
142
- msgid "Choose a post type..."
143
- msgstr "Выберите тип поста..."
 
144
 
145
- msgid "Choose data to include in the export file."
146
- msgstr "Выбрать данные для включения в файл экспорта."
 
147
 
148
- msgid "Close"
149
- msgstr "Закрыть"
 
150
 
151
- msgid "Completed Date"
152
- msgstr "Дата завершения"
 
 
153
 
154
- msgid "Confirm & Run Export"
155
- msgstr "Подтвердить и запустить экспорт"
 
156
 
157
- msgid "Content"
158
- msgstr "Содержание"
 
 
 
159
 
160
- msgid "Continue to Step 2"
161
- msgstr "Перейти к шагу 2"
 
162
 
163
- msgid "Continue to Step 2 to choose data to include in the export file."
164
- msgstr "Перейти к шагу 2, чтобы выбрать данные для включения в файл экспорта."
 
 
 
 
165
 
166
- msgid "Coupons Used"
167
- msgstr "Используемые купоны"
 
168
 
169
- msgid "Created by"
170
- msgstr "Создано"
 
171
 
172
- msgid "Cron Exports"
173
- msgstr "Cron экспорт"
 
174
 
175
- msgid "Cron Scheduling"
176
- msgstr "Планирование Cron"
 
 
177
 
178
- msgid "Custom Field / Post Meta"
179
- msgstr "Пользовательские поля / Мета записи"
 
 
 
180
 
181
- msgid "Custom Field / User Meta"
182
- msgstr "Пользовательское поле / Пользовательские Meta"
 
183
 
184
- msgid "Custom Fields"
185
- msgstr "Пользовательские поля"
 
 
 
186
 
187
- msgid "Custom Types: "
188
- msgstr "Пользовательские типы: "
 
189
 
190
- msgid "Customer"
191
- msgstr "Покупатель"
 
192
 
193
- msgid "Customer Note"
194
- msgstr "Примечание к покупателю"
 
195
 
196
- msgid "Customer User ID"
197
- msgstr "ID покупателя"
 
198
 
199
- msgid "Data"
200
- msgstr "Данные"
 
201
 
202
- msgid "Data not found."
203
- msgstr "Данные не найдены."
 
204
 
205
- msgid "Date"
206
- msgstr "Дата"
 
207
 
208
- msgid "Delete"
209
- msgstr "Удалить"
 
210
 
211
- msgid "Delete Export"
212
- msgstr "Удалить экспорт"
 
213
 
214
- msgid "Delete Permanently"
215
- msgstr "Удалить навсегда"
 
216
 
217
- msgid "Delete field"
218
- msgstr "Удалить поле"
 
219
 
220
- msgid "Delimiter:"
221
- msgstr "Разделитель:"
 
222
 
223
- msgid "Description"
224
- msgstr "Описание"
 
225
 
226
- msgid "Discount Amount (per coupon)"
227
- msgstr "Сумма скидки (по купону)"
 
228
 
229
- msgid "Display Name"
230
- msgstr "Отображаемое имя"
 
231
 
232
- msgid "Display each product in its own row"
233
- msgstr "Отображать каждый товар на отдельной строке"
 
234
 
235
- msgid "Displaying %s&#8211;%s of %s"
236
- msgstr "Отображение %s&#8211;%s из %s"
 
237
 
238
- msgid "Documentation"
239
- msgstr "Документация"
 
240
 
241
- msgid "Done"
242
- msgstr "Готово"
 
 
 
 
 
243
 
244
- msgid "Download Data"
245
- msgstr "Загрузить данные"
 
 
 
 
 
 
246
 
247
- msgid "Download Import Templates"
248
- msgstr "Загрузить шаблоны импорта"
 
 
 
 
 
249
 
250
- msgid ""
251
- "Download your import templates and use them to import your exported file to "
252
- "a separate WordPress/WP All Import installation."
253
  msgstr ""
254
- "Загрузите свои шаблоны импорта и используйте их, чтобы импортировать Ваш "
255
- "экспортируемый файл на другой сайт WordPress."
256
 
 
257
  msgid ""
258
- "Drag & drop data from \"Available Data\" on the right to include it in the "
259
- "export or click \"Add Field To Export\" below."
 
260
  msgstr ""
261
- "Перетащите данные из \"Доступные данные\" справа для включения в экспорт или "
262
- "нажмите \"Добавить поле к экспорту\" ниже."
263
 
264
- msgid "Edit"
265
- msgstr "Редактировать"
 
266
 
267
- msgid "Edit Export Field"
268
- msgstr "Правка поля экспорта"
 
269
 
270
- msgid "Edit Options"
271
- msgstr "Редактировать опции"
 
 
 
 
272
 
273
- msgid "Edit Template"
274
- msgstr "Редактировать шаблон"
 
 
 
275
 
276
- msgid "Element"
277
- msgstr "Элемент"
 
 
 
 
278
 
279
- msgid "Email"
280
- msgstr "Email"
281
-
282
- msgid "Error"
283
- msgstr "Ошибка"
284
-
285
- msgid "Every time you want to schedule the import, run the trigger script."
286
  msgstr ""
287
- "Каждый раз, когда Вы хотите запланировать импорт - запускайте скрипт "
288
- "триггера."
289
 
290
- msgid "Example:"
291
- msgstr "Пример:"
 
292
 
293
- msgid "Excerpt"
294
- msgstr "Отрывок"
 
295
 
296
- msgid "Execution Script"
297
- msgstr "Скрипт исполнения"
 
298
 
299
- msgid "Export #%s already processing. Request skipped."
300
- msgstr "Экспорт #%s уже в процесее. Запрос пропущен."
 
301
 
302
- msgid "Export #%s already triggered. Request skipped."
303
- msgstr "Экспорт #%s уже вызван. Запрос пропущен."
 
304
 
305
- msgid "Export #%s complete"
306
- msgstr "Экспорт #%s завершен"
 
 
 
 
 
307
 
308
- msgid "Export #%s currently in process. Request skipped."
309
- msgstr "Экспорт #%s в настоящее время запущен. Запрос пропущен."
 
310
 
311
- msgid "Export #%s is currently in manually process. Request skipped."
312
- msgstr "Экспорт #%s в настоящее время в ручном режиме. Запрос пропущен."
 
313
 
314
- msgid "Export #%s is not triggered. Request skipped."
315
- msgstr "Экспорт #%s не вызван. Запрос пропущен."
 
316
 
317
- msgid "Export <span id=\"status\">in Progress...</span>"
318
- msgstr "Экспорт <span id=\"status\">в процессе...</span>"
 
319
 
320
- msgid "Export Attempt at %s"
321
- msgstr "Попытка экспорта в %s"
 
 
 
 
 
322
 
323
- msgid "Export Complete!"
324
- msgstr "Экспорт завершен!"
 
325
 
326
- msgid "Export File Format:"
327
- msgstr "Формат файла экспорта:"
 
328
 
329
- msgid "Export File URL"
330
- msgstr "Экспортировать URL файла"
 
331
 
332
- msgid "Export Image File Paths"
333
- msgstr "Экспортировать пути файлов изображений"
 
334
 
335
- msgid "Export Image Filenames"
336
- msgstr "Экспортировать названия файлов изображений"
 
337
 
338
- msgid "Export Image URLs"
339
- msgstr "Экспортировать URL изображений"
 
 
 
 
340
 
341
- msgid "Export canceled"
342
- msgstr "Экспорт отменен"
 
 
 
 
 
343
 
344
- msgid "Export currently in progress"
345
- msgstr "Экспорт в процессе в настоящее время"
 
 
346
 
347
- msgid "Export deleted"
348
- msgstr "Экспорт удален"
 
 
 
 
 
 
 
349
 
350
- msgid "Export the value returned by a PHP function"
351
- msgstr "Экспорт значения, возвращаемого PHP функцией"
 
352
 
 
353
  msgid "Export to XML"
354
  msgstr "Экспорт в XML"
355
 
356
- msgid "Export to XML / CSV"
357
- msgstr "Экспорт в XML / CSV"
358
-
359
- msgid "Exported"
360
- msgstr "Экспортируемый"
361
-
362
- msgid ""
363
- "Exported files and temporary files will be placed in a folder with a "
364
- "randomized name inside of %s."
365
- msgstr ""
366
- "Экспортированные файлы и временные файлы будут помещены в папку со случайным "
367
- "именем внутри %s."
368
 
369
- msgid ""
370
- "Exporting may take some time. Please do not close your browser or refresh "
371
- "the page until the process is complete."
372
- msgstr ""
373
- "Экспорт может занять некоторое время. Пожалуйста, не закрывайте браузер и не "
374
- "обновляйте страницу пока процесс не завершится."
375
 
376
- msgid "Fee Amount (per surcharge)"
377
- msgstr "Сумма сбора (дополнительный сбор)"
 
 
378
 
 
379
  msgid "Feedback"
380
  msgstr "Обратная связь"
381
 
382
- msgid "Fees & Discounts"
383
- msgstr "Тарифы и скидки"
384
-
385
- msgid "Field Name"
386
- msgstr "Имя поля"
387
-
388
- msgid "File format not supported"
389
- msgstr "Формат файла не поддерживается"
390
-
391
- msgid "Files"
392
- msgstr "Файлы"
 
 
 
 
393
 
394
- msgid "Filters"
395
- msgstr "Фильтры"
 
 
 
396
 
397
- msgid "First Name"
398
- msgstr "Имя"
 
 
399
 
400
- msgid "First, choose what to export."
401
- msgstr "Во-первых, выберите, что экспортировать."
 
 
402
 
403
- msgid "For WP All Import"
404
- msgstr "для WP All Import"
 
 
405
 
406
- msgid "Format: %s"
407
- msgstr "Формат: %s"
 
 
408
 
409
- msgid "Friendly Name:"
410
- msgstr "Понятное имя:"
 
411
 
412
- msgid "General"
413
- msgstr "Общее"
 
414
 
415
- msgid "ID"
416
- msgstr "ID"
 
417
 
418
- msgid "If an order contains multiple products, each product have its own row."
419
- msgstr ""
420
- "Если заказ содержит несколько товаров, каждый товар расположен на отдельной "
421
- "строке."
422
 
423
- msgid "Images / Media"
424
- msgstr "Картинки / Медиа"
 
 
425
 
426
- msgid "Import with WP All Import"
427
- msgstr "Импорт с WP All Import"
 
 
428
 
429
- msgid "In each iteration, process"
430
- msgstr каждом повторении обрабатывать"
 
 
431
 
432
- msgid "Info & Options"
433
- msgstr "Инфо и Опции"
 
 
434
 
 
 
435
  msgid ""
436
- "Install these import templates in your separate WP All Import installation "
437
- "from the All Import -> Settings page by clicking the \"Import Templates\" "
438
- "button."
439
  msgstr ""
440
- "Установите эти шаблоны импорта на отдельном сайте с помощью WP All Import из "
441
- "All Import -> Страница настроек, нажав на \"Импорт шаблонов\"."
442
 
443
- msgid "Invalid query"
444
- msgstr "Недопустимый запрос"
 
445
 
446
- msgid ""
447
- "It also operates this way in case of unexpected crashes by your web host. If "
448
- "it crashes before the import is finished, the next run of the cron job two "
449
- "minutes later will continue it where it left off, ensuring reliability."
450
- msgstr ""
451
- "Это также помогает в случае непредвиденных сбоев на Вашем хостинге. Если "
452
- "выдается ошибку раньше окончания импорта, то при следующем запуске через "
453
- "cron (через две минуты) операция продолжается там, где была завершена."
454
 
455
- msgid ""
456
- "It processes in iteration (only importing a few records each time it runs) "
457
- "to optimize server load. It is recommended you run the execution script "
458
- "every 2 minutes."
459
- msgstr ""
460
- "Это осуществляется итерациями (импорт только нескольких записей при каждом "
461
- "запуске), чтобы оптимизировать нагрузку на сервер. Рекомендуется запускать "
462
- "выполнение скрипта каждые 2 минуты."
463
 
464
- msgid "Item Cost"
465
- msgstr "Стоимость за единицу"
 
 
466
 
467
- msgid "Item Total"
468
- msgstr "Штук всего"
 
 
 
 
 
 
 
 
469
 
470
- msgid "Items"
471
- msgstr "Штуки"
 
 
472
 
473
- msgid "Last Name"
474
- msgstr "Фамилия"
 
 
 
475
 
476
- msgid "Last run: %s"
477
- msgstr "Последний запуск: %s"
 
478
 
479
- msgid "Login"
480
- msgstr "Логин"
 
481
 
482
- msgid "Manage Exports"
483
- msgstr "Управление экспортами"
 
484
 
485
- msgid "Menu Order"
486
- msgstr "Порядок меню"
 
 
487
 
488
- msgid "Name"
489
- msgstr "Название"
 
 
490
 
491
- msgid "Natural Language PHP date()"
492
- msgstr "Естесственный язык PHP date()"
 
 
493
 
494
- msgid "Network"
495
- msgstr "Сеть"
 
 
496
 
497
- msgid "New Export"
498
- msgstr "Новый экспорт"
 
 
499
 
500
- msgid "Nicename"
501
- msgstr "Ник"
 
 
502
 
503
- msgid "Nickname"
504
- msgstr "Ник"
 
 
505
 
 
 
506
  msgid ""
507
- "No filtering options. Add filtering options to only export records matching "
508
- "some specified criteria."
509
  msgstr ""
510
- "Нет параметров фильтрации. Добавить параметры фильтрации, чтобы "
511
- "экспортировать только записи, удовлетворяющие заданным условиям."
512
-
513
- msgid "No matching %s found for selected filter rules"
514
- msgstr "Не найдено подходящих %s для выбранных правил фильтрации"
515
-
516
- msgid "No matching posts found for WP_Query expression specified"
517
- msgstr "Не найдены подходящие записи для указанного выражения WP_Query"
518
 
519
- msgid "No matching posts found for selected post types"
520
- msgstr "Не найдены подходящие записи для выбранных типов записей"
 
 
 
 
 
 
 
 
521
 
522
- msgid "No matching users found"
523
- msgstr "Подходящие пользователи не найдены"
 
524
 
525
- msgid "No previous exports found."
526
- msgstr "Предыдущие экспорты не найдены."
 
527
 
528
- msgid "Notes"
529
- msgstr "Примечания"
 
530
 
 
 
531
  msgid "Options updated"
532
  msgstr "Параметры обновлены"
533
 
534
- msgid "Order"
535
- msgstr "Заказ"
536
-
537
- msgid "Order Currency"
538
- msgstr "Валюта заказа"
539
-
540
- msgid "Order Date"
541
- msgstr "Дата заказа"
542
-
543
- msgid "Order ID"
544
- msgstr "ID заказа"
545
-
546
- msgid "Order Key"
547
- msgstr "Ключ заказа"
548
-
549
- msgid "Order Status"
550
- msgstr "Статус заказа"
551
-
552
- msgid "Order Total"
553
- msgstr "Сумма заказа"
554
-
555
- msgid "Other"
556
- msgstr "Другие"
557
 
558
- msgid "Parent"
559
- msgstr "Родитель"
 
560
 
561
- msgid "Password"
562
- msgstr "Пароль"
 
563
 
564
- msgid "Payment Method"
565
- msgstr "Метод оплаты"
 
566
 
567
- msgid "Permalink"
568
- msgstr "Постоянная ссылка"
 
 
569
 
570
- msgid "Permissive"
571
- msgstr "Разрешающее"
 
 
 
 
572
 
 
573
  msgid ""
574
- "Please de-activate and remove the free version of the WP All Export before "
575
- "activating the paid version."
 
 
 
576
  msgstr ""
577
- "Пожалуйста, деактивируйте и удалите бесплатную версию WP All Export перед "
578
- "активацией платной версии."
579
-
580
- msgid "Post Format"
581
- msgstr "Формат поста"
582
 
583
- msgid "Post Slug"
584
- msgstr "Короткое имя поста (slug)"
 
585
 
586
- msgid "Post Status"
587
- msgstr "Статус записи"
 
 
 
 
 
588
 
589
- msgid "Post Type"
590
- msgstr "Тип записи"
 
591
 
592
- msgid "Post Type Query"
593
- msgstr "Запрос типа поста"
 
594
 
595
- msgid "Preview A Row"
596
- msgstr "Предпросмотр строки"
 
 
 
597
 
598
- msgid "Product Data"
599
- msgstr "Данные о продукте"
 
 
 
 
 
600
 
601
- msgid "Product ID"
602
- msgstr "ID товара"
 
603
 
604
- msgid "Product Name"
605
- msgstr "Наименование товара"
 
 
606
 
607
- msgid "Product Variation Details"
608
- msgstr "Вариационные детали товара"
 
609
 
 
610
  msgid "Product Variations"
611
  msgstr "Вариации товара"
612
 
613
- msgid "Quantity"
614
- msgstr "Количество"
 
615
 
616
- msgid "Query"
617
- msgstr "Запрос"
 
618
 
619
- msgid "Randomize folder names"
620
- msgstr "Случайные имена папок"
 
621
 
622
- msgid "Rate Code (per tax)"
623
- msgstr "Код тарифа (per tax)"
 
 
624
 
625
- msgid "Rate Percentage (per tax)"
626
- msgstr "Процентная ставка (per tax)"
 
 
 
 
 
 
 
 
 
627
 
628
- msgid "Re-run Export"
629
- msgstr "Перезапустить экспорт"
 
630
 
631
- msgid "Record"
632
- msgstr "Запись"
 
633
 
634
- msgid "Records"
635
- msgstr "Записи"
 
636
 
637
- msgid "Records Processed %s"
638
- msgstr "Записей обработано %s"
 
639
 
640
- msgid "Registered Date"
641
- msgstr "Дата регистрации"
 
642
 
643
- msgid "Restore"
644
- msgstr "Восстановить"
 
645
 
646
- msgid "Roles"
647
- msgstr "Роли"
 
 
648
 
649
- msgid "Rule"
650
- msgstr "Правило"
 
 
 
651
 
652
- msgid "Run Export"
653
- msgstr "Запустить экспорт"
 
654
 
655
- msgid "SKU"
656
- msgstr "SKU (артикул)"
 
 
657
 
658
- msgid "SQL Query"
659
- msgstr "SQL запрос"
 
 
660
 
661
- msgid "Save Export Configuration"
662
- msgstr "Сохранить конфигурацию экспорта"
 
 
663
 
664
- msgid "Save friendly name..."
665
- msgstr "Сохранить понятое имя..."
 
 
666
 
667
- msgid "Search Exports"
668
- msgstr "Поиск экспортов"
 
 
669
 
670
- msgid "Secret Key"
671
- msgstr "Секретный ключ"
 
 
672
 
673
- msgid "Secure Mode"
674
- msgstr "Безопасный режим"
 
 
 
675
 
676
- msgid "Security check"
677
- msgstr "Проверка безопасности"
 
 
678
 
679
- msgid "Select Element"
680
- msgstr "Выберите элемент"
 
 
681
 
682
- msgid "Select Rule"
683
- msgstr "Выберите правило"
 
 
684
 
685
- msgid "Settings"
686
- msgstr "Настройки"
 
 
687
 
688
- msgid "Settings saved"
689
- msgstr "Настройки сохранены"
 
 
690
 
691
- msgid "Shipping Cost"
692
- msgstr "Стоимость доставки"
 
693
 
694
- msgid "Shipping Method"
695
- msgstr "Способ доставки"
 
696
 
697
- msgid "Skip to Step 3"
698
- msgstr "Перейти к шагу 3"
 
699
 
700
- msgid "Specific Post Type"
701
- msgstr "Определить тип поста"
 
702
 
703
- msgid "Standard"
704
- msgstr "Стандартные"
 
705
 
706
- msgid "Status"
707
- msgstr "Статус"
 
708
 
709
- msgid "Strict"
710
- msgstr "Строгое"
 
711
 
712
- msgid ""
713
- "Strict matching requires all variations to pass in order for the product to "
714
- "be exported. Permissive matching allows the product to be exported if any of "
715
- "the variations pass."
716
- msgstr ""
717
- "Строгое соответствие требует, чтобы все условия соблюдались для "
718
- "экспортируемого продукта. Разрешающее соответствие позволяет продукту "
719
- "экспортироваться, если одно из условий соблюдается."
720
 
721
- msgid "Summary"
722
- msgstr "Итого"
 
723
 
724
- msgid "Support"
725
- msgstr "Поддержка"
 
726
 
727
- msgid "Taxes & Shipping"
728
- msgstr "Налоги и доставка"
 
729
 
730
- msgid "Taxonomies"
731
- msgstr "Таксономии"
 
732
 
733
- msgid "Template"
734
- msgstr "Шаблон"
 
735
 
736
- msgid ""
737
- "The Execution script actually executes the import, once it has been "
738
- "triggered with the Trigger script."
739
- msgstr ""
740
- "Скрипт исполнения фактически выполняет импорт, после того, как он запущен "
741
- "триггер-скриптом."
742
 
743
- msgid ""
744
- "The exported file is missing and can't be downloaded. Please re-run your "
745
- "export to re-generate it."
746
- msgstr ""
747
- "Экспортируемый файл отсутствует и не может быть загружен. Пожалуйста, "
748
- "перезапустите свой экспорт для его повторного создания."
749
 
750
- msgid ""
751
- "The other two files in this zip are the export file containing all of your "
752
- "data and the import template for WP All Import. \n"
753
- "\n"
754
- "To import this data, create a new import with WP All Import and upload this "
755
- "zip file."
756
- msgstr ""
757
- "Два других файла в этом архиве - это файлы экспорта, содержащие все Ваши "
758
- "данные и шаблон импорта для WP All Import. \n"
759
- "\n"
760
- "Чтобы импортировать эти данные, создайте новый импорт с WP All Import и "
761
- "загрузить этот архив."
762
 
763
- msgid ""
764
- "The value of the field chosen for export will be passed to the PHP function."
765
- msgstr "Значение поля, выбранного для экспорта, будет передано в PHP функцию."
766
 
767
- msgid ""
768
- "There is a new version of %1$s available. <a target=\"_blank\" class="
769
- "\"thickbox\" href=\"%2$s\">View version %3$s details</a> or <a href=\"%4$s"
770
- "\">update now</a>."
771
- msgstr ""
772
- "Новая версия %1$s доступна. <a target=\"_blank\" class=\"thickbox\" href="
773
- "\"%2$s\">Посмотреть детали версии %3$s </a> или <a href=\"%4$s\">обновить "
774
- "сейчас</a>."
775
 
776
- msgid ""
777
- "There is a new version of %1$s available. <a target=\"_blank\" class="
778
- "\"thickbox\" href=\"%2$s\">View version %3$s details</a>."
779
- msgstr ""
780
- "Новая версия %1$s доступна. <a target=\"_blank\" class=\"thickbox\" href="
781
- "\"%2$s\">Посмотреть детали версии %3$s </a>."
782
 
783
- msgid "This format is not supported."
784
- msgstr "Этот формат не поддерживается."
 
785
 
786
- msgid "Time Elapsed"
787
- msgstr "Времени прошло"
 
788
 
789
- msgid "Title"
790
- msgstr "Заголовок (Title)"
 
791
 
792
- msgid ""
793
- "To schedule an import, you must create two cron jobs in your web hosting "
794
- "control panel. One cron job will be used to run the Trigger script, the "
795
- "other to run the Execution script."
796
- msgstr ""
797
- "Чтобы запланировать импорт, необходимо создать два cron задания в панели "
798
- "управления хостингом. Одно задание будет использоваться для запуска скрипта "
799
- "триггера, другое для запуска скрипта исполнения."
800
 
801
- msgid ""
802
- "To schedule the import to run once every 24 hours, run the trigger script "
803
- "every 24 hours. Most hosts require you to use “wget” to access a URL. Ask "
804
- "your host for details."
805
- msgstr ""
806
- "Чтобы запланировать импорт для запуска каждые 24 часа, запускайте скрипт "
807
- "триггера каждые 24 часа. Большинство хостов требуют использовать “wget” для "
808
- "доступа к URL. Узнайте подробности у Вашего провайдера."
809
 
810
- msgid "Total Discount Amount"
811
- msgstr "Общая сумма скидки"
 
 
 
812
 
813
- msgid "Total Fee Amount"
814
- msgstr "Общая сумма платежей"
 
 
 
815
 
816
- msgid "Total Tax Amount"
817
- msgstr "Общая сумма налогов"
 
 
 
818
 
819
- msgid "Trigger Script"
820
- msgstr "Скрипт триггера"
 
821
 
822
- msgid "UNIX timestamp - PHP time()"
823
- msgstr "UNIX timestamp - PHP time()"
 
824
 
825
- msgid "URL"
826
- msgstr "URL"
 
827
 
828
- msgid "Uploads folder %s must be writable"
829
- msgstr "Папка загрузки %s должна быть доступна для записи"
 
830
 
831
- msgid "User"
832
- msgstr "Пользователь"
 
833
 
 
834
  msgid "User Query"
835
  msgstr "Пользовательский запрос"
836
 
837
- msgid "Users"
838
- msgstr "Пользователи"
 
839
 
840
- msgid "Value"
841
- msgstr "Значение"
 
842
 
843
- msgid "Variable product matching rules: "
844
- msgstr "Вариативный продукт, соответствующий правилам: "
 
845
 
846
- msgid "WP All Export"
847
- msgstr "WP All Export"
 
 
 
 
 
 
848
 
849
- msgid "WP All Export Settings"
850
- msgstr "WP All Export настройки"
 
 
 
851
 
852
- msgid "WP All Export Support"
853
- msgstr "WP All Export поддержка"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
854
 
 
855
  msgid ""
856
- "WP All Export must be able to process this many records in less than your "
857
- "server's timeout settings. If your export fails before completion, to "
858
- "troubleshoot you should lower this number."
859
  msgstr ""
860
- "WP All Export должен быть в состоянии обработать это количество записей "
861
- "быстрее, чем установленный тайм-аут Вашего сервера. Если экспорт не "
862
- "выполняется до завершения, для устранения ошибки следует уменьшить это число."
 
 
 
 
 
 
 
 
 
 
 
863
 
 
864
  msgid "WP All Export successfully exported your data!"
865
  msgstr "WP All Export успешно экспортировал Ваши данные!"
866
 
867
- msgid "WP All Export will export %d %s."
868
- msgstr "WP All Export будет экспортировать %d %s."
 
869
 
870
- msgid "WP Query field is required"
871
- msgstr "WP поле запроса требуется"
 
 
872
 
873
- msgid "WP_Query Results"
874
- msgstr "Результаты WP_Query"
 
875
 
 
876
  msgid ""
877
- "Warning: without _sku and product_type columns, you won't be able to re-"
878
- "import this data using WP All Import."
879
  msgstr ""
880
- "Внимание: без столбцов _sku и product_type Вы не сможете повторно "
881
- "импортировать эти данные через WP All Import."
882
 
 
883
  msgid ""
884
  "Warning: without an ID column, you won't be able to re-import this data "
885
  "using WP All Import."
@@ -887,6 +1211,15 @@ msgstr ""
887
  "Внимание: без ID столбца Вы не сможете повторно импортировать эти данные "
888
  "через WP All Import."
889
 
 
 
 
 
 
 
 
 
 
890
  msgid ""
891
  "Warning: without post_type column, you won't be able to re-import this data "
892
  "using WP All Import."
@@ -894,110 +1227,561 @@ msgstr ""
894
  "Внимание: без столбца post_type Вы не сможете повторно экспортировать эти "
895
  "данные через WP All Import."
896
 
897
- msgid "What field would you like to export?"
898
- msgstr "Какие поля Вы хотите экспортировать?"
899
-
900
- msgid "What would you like to name the column/element in your exported file?"
901
- msgstr "Как бы Вы хотели назвать столбец/элемент в файле эспорта?"
902
-
903
- msgid "WooCommerce Data"
904
- msgstr "WooCommerce данные"
905
 
906
- msgid "WooCommerce Order"
907
- msgstr "WooCommerce заказ"
 
908
 
909
- msgid "WooCommerce Products"
910
- msgstr "WooCommerce товары"
 
911
 
912
- msgid "WooCommerce Taxonomies"
913
- msgstr "WooCommerce таксономии"
 
914
 
 
915
  msgid "XML"
916
  msgstr "XML"
917
 
918
- msgid "Y/m/d g:i a"
919
- msgstr "Г/м/д g:i a"
 
920
 
921
- msgid "You do not have permission to install plugin updates"
922
- msgstr "У вас нет разрешения для установки обновлений плагина"
 
923
 
924
- msgid "You haven't selected any columns for export."
925
- msgstr "Вы не отметили никакие столбцы для экспорта."
 
926
 
927
- msgid "Your export is ready to run."
928
- msgstr "Ваш экспорт готов к запуску"
 
929
 
930
- msgid ""
931
- "Your web host may require you to use a command other than wget, although "
932
- "wget is most common. In this case, you must asking your web hosting provider "
933
- "for help."
934
- msgstr ""
935
- "Ваш провайдер может требовать использования команды, отличной от wget, хотя "
936
- "wget является наиболее распространенной. В этом случае, Вы должны обратиться "
937
- "за помощью к Вашему провайдеру."
938
 
939
- msgid "contains"
940
- msgstr "содержат"
 
941
 
942
- msgid "currently processing with cron"
943
- msgstr "в настоящее время обработка с помощью cron"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
944
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
945
  msgid "date() Format"
946
  msgstr "date() формат"
947
 
948
- msgid "element"
949
- msgid_plural "elements"
950
- msgstr[0] "элемент"
951
- msgstr[1] "элемента"
952
- msgstr[2] "элементов"
 
953
 
954
- msgid "equals"
955
- msgstr "равны"
 
 
 
 
956
 
957
- msgid "equals or greater than"
958
- msgstr "равны или больше, чем"
 
 
 
 
 
 
959
 
960
- msgid "equals or less than"
961
- msgstr "равны или меньше, чем"
 
 
 
 
962
 
963
- msgid "export"
964
- msgid_plural "exports"
965
- msgstr[0] "экспорт"
966
- msgstr[1] "экспорта"
967
- msgstr[2] "экспортов"
 
968
 
969
- msgid "greater than"
970
- msgstr "больше, чем"
 
971
 
972
- msgid "is empty"
973
- msgstr "пустые"
 
974
 
975
- msgid "is not empty"
976
- msgstr "не пустые"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
977
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
978
  msgid "last activity %s ago"
979
  msgstr "последняя активность %s назад"
980
 
981
- msgid "less than"
982
- msgstr "меньше, чем"
 
983
 
984
- msgid "more"
985
- msgstr "еще"
 
 
 
 
 
 
986
 
 
 
 
 
 
 
987
  msgid "never"
988
  msgstr "никогда"
989
 
990
- msgid "not contains"
991
- msgstr "не содержат"
992
-
993
- msgid "not equals"
994
- msgstr "не равны"
995
 
996
- msgid "records"
997
- msgstr "записей"
 
 
998
 
 
999
  msgid "settings edited since last run"
1000
  msgstr "параметры изменены с момента последнего запуска"
1001
 
1002
- msgid "triggered with cron"
1003
- msgstr "запускается с помощью cron"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  "Project-Id-Version: WP All Export Pro v1.1.0 RC7\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: Mon Dec 21 2015 20:11:03 GMT+0200 (EET)\n"
7
+ "Last-Translator: admin <makstsiplyskov@gmail.loc>\n"
8
  "Language-Team: \n"
9
+ "Language: Russian\n"
10
+ "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10 >= 2 && "
11
+ "n%10<=4 &&(n%100<10||n%100 >= 20)? 1 : 2)\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
 
 
 
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Generator: Loco - https://localise.biz/\n"
17
+ "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
18
+ "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
19
+ "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
20
+ "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
21
+ "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
22
  "X-Poedit-Basepath: .\n"
23
  "X-Textdomain-Support: yes\n"
 
24
  "X-Poedit-SearchPath-0: .\n"
25
+ "X-Loco-Target-Locale: ru_RU"
26
 
27
+ #. Name of the plugin
28
+ msgid "WP All Export Pro"
29
+ msgstr ""
30
 
31
+ #. URI of the plugin
32
+ msgid "http://www.wpallimport.com/export"
 
 
33
  msgstr ""
 
 
34
 
35
+ #. Description of the plugin
36
+ msgid ""
37
+ "Export any post type to a CSV or XML file. Edit the exported data, and then "
38
+ "re-import it later using WP All Import."
39
+ msgstr ""
40
 
41
+ #. Author of the plugin
42
+ msgid "Soflyy"
43
+ msgstr ""
44
 
45
+ #: ../../actions/init.php:19 ../../actions/init.php:25
46
+ msgid "Error. Incorrect API key, check the WP All Export Pro settings page."
47
+ msgstr ""
48
 
49
+ #: ../../actions/wp_ajax_export_available_rules.php:39 ../..
50
+ #: /actions/wp_ajax_export_available_rules.php:55
51
+ msgid "doesn't equal"
52
+ msgstr ""
53
 
54
+ #: ../../actions/wp_ajax_export_available_rules.php:40
55
+ msgid "newer than"
56
+ msgstr ""
57
 
58
+ #: ../../actions/wp_ajax_export_available_rules.php:41
59
+ msgid "equal to or newer than"
60
+ msgstr ""
61
 
62
+ #: ../../actions/wp_ajax_export_available_rules.php:42
63
+ msgid "older than"
64
+ msgstr ""
65
 
66
+ #: ../../actions/wp_ajax_export_available_rules.php:43
67
+ msgid "equal to or older than"
68
+ msgstr ""
69
 
70
+ #: ../../actions/wp_ajax_export_available_rules.php:46 ../..
71
+ #: /actions/wp_ajax_export_available_rules.php:62
72
+ msgid "doesn't contain"
73
+ msgstr ""
74
 
75
+ #: ../../actions/wp_ajax_export_available_rules.php:57
76
+ msgid "equal to or greater than"
77
+ msgstr ""
78
 
79
+ #: ../../actions/wp_ajax_export_available_rules.php:59
80
+ msgid "equal to or less than"
81
+ msgstr ""
82
 
83
+ #: ../../actions/wp_ajax_export_filtering_count.php:95 ../..
84
+ #: /actions/wp_ajax_export_filtering_count.php:98 ../../views/admin/manage/update.
85
+ #: php:51
86
+ msgid "Nothing to export."
87
+ msgstr ""
88
 
89
+ #: ../../actions/wp_ajax_export_filtering_count.php:96
90
+ #, php-format
91
+ msgid "All %s have already been exported."
92
+ msgstr ""
93
 
94
+ #: ../../actions/wp_ajax_export_filtering_count.php:99 ../..
95
+ #: /actions/wp_ajax_export_filtering_count.php:113 ../..
96
+ #: /views/admin/manage/update.php:52
97
+ #, php-format
98
+ msgid "No matching %s found for selected filter rules."
99
+ msgstr ""
100
 
101
+ #: ../../actions/wp_ajax_save_functions.php:43
102
+ msgid "PHP code must be wrapped in \"&lt;?php\" and \"?&gt;\""
103
+ msgstr ""
104
 
105
+ #: ../../actions/wp_ajax_save_functions.php:52
106
+ msgid "File has been successfully updated."
107
+ msgstr ""
108
 
109
+ #: ../../actions/wp_ajax_wpallexport.php:29
110
+ msgid "Export is not defined."
111
+ msgstr ""
112
 
113
+ #: ../../actions/wp_loaded.php:155
114
+ #, php-format
115
+ msgid "Records Processed %s."
116
+ msgstr ""
117
 
118
+ #: ../../actions/wp_loaded.php:209
119
+ msgid "File doesn't exist"
120
+ msgstr ""
121
 
122
+ #: ../../actions/wp_loaded.php:218
123
+ msgid "Export hash is not valid."
124
+ msgstr ""
125
 
126
+ #: ../../controllers/admin/export.php:225
127
+ msgid "CSV delimiter must be specified."
128
+ msgstr ""
129
 
130
+ #: ../../controllers/admin/export.php:300 ../../controllers/admin/manage.php:182
131
+ msgid "Main XML Tag is required."
132
+ msgstr ""
133
 
134
+ #: ../../controllers/admin/export.php:305 ../../controllers/admin/manage.php:187
135
+ msgid "Single Record XML Tag is required."
136
+ msgstr ""
137
 
138
+ #: ../../controllers/admin/export.php:309 ../../controllers/admin/manage.php:191
139
+ msgid "Main XML Tag equals to Single Record XML Tag."
140
+ msgstr ""
141
 
142
+ #: ../../controllers/admin/settings.php:51
143
+ msgid "Unknown File extension. Only txt files are permitted"
144
+ msgstr ""
145
 
146
+ #: ../../controllers/admin/settings.php:64
147
+ #, php-format
148
+ msgid "%d template imported"
149
+ msgid_plural "%d templates imported"
150
+ msgstr[0] ""
151
+ msgstr[1] ""
152
 
153
+ #: ../../controllers/admin/settings.php:66
154
+ msgid "Wrong imported data format"
155
+ msgstr ""
156
 
157
+ #: ../../controllers/admin/settings.php:68
158
+ msgid "File is empty or doesn't exests"
159
+ msgstr ""
160
 
161
+ #: ../../controllers/admin/settings.php:71
162
+ msgid "Undefined entry!"
163
+ msgstr ""
164
 
165
+ #: ../../controllers/admin/settings.php:73
166
+ msgid "Please select file."
167
+ msgstr ""
168
 
169
+ #: ../../controllers/admin/settings.php:79
170
+ msgid "Templates must be selected"
171
+ msgstr ""
172
 
173
+ #: ../../controllers/admin/settings.php:88
174
+ #, php-format
175
+ msgid "%d template deleted"
176
+ msgid_plural "%d templates deleted"
177
+ msgstr[0] ""
178
+ msgstr[1] ""
179
 
180
+ #: ../../helpers/wp_all_export_get_cpt_name.php:13 ../../views/admin/export/index.
181
+ #: php:68
182
+ msgid "Comments"
183
+ msgstr ""
184
 
185
+ #: ../../helpers/wp_all_export_get_cpt_name.php:13
186
+ msgid "Comment"
187
+ msgstr ""
188
 
189
+ #: ../../libraries/XmlExportEngine.php:261 ../../libraries/XmlExportEngine.php:318
190
+ msgid "No matching users found."
191
+ msgstr ""
192
 
193
+ #: ../../libraries/XmlExportEngine.php:275 ../../libraries/XmlExportEngine.php:335
194
+ msgid "No matching comments found."
195
+ msgstr ""
196
 
197
+ #: ../../libraries/XmlExportEngine.php:291
198
+ msgid "No matching posts found for WP_Query expression specified."
199
+ msgstr ""
200
 
201
+ #: ../../libraries/XmlExportEngine.php:353
202
+ msgid "No matching posts found for selected post types."
203
+ msgstr ""
204
 
205
+ #: ../../views/admin/export/index.php:82
206
+ msgid "Comment Query"
207
+ msgstr ""
208
 
209
+ #: ../../views/admin/export/process.php:45 ../../views/admin/manage/index.php:152
210
+ #, php-format
211
+ msgid "Split %ss"
212
+ msgstr ""
213
 
214
+ #: ../../views/admin/export/process.php:46 ../../views/admin/export/process.php:52
215
+ msgid "Settings & Data for WP All Import"
216
+ msgstr ""
217
 
218
+ #: ../../views/admin/export/template.php:163
219
+ msgid ""
220
+ "If an order contains multiple products, each product will have its own row. "
221
+ "If disabled, each product will have its own column."
222
+ msgstr ""
223
 
224
+ #: ../../views/admin/export/template.php:167
225
+ msgid "Fill in empty columns"
226
+ msgstr ""
227
 
228
+ #: ../../views/admin/export/template.php:168
229
+ msgid ""
230
+ "If enabled, each order item will appear as its own row with all order info "
231
+ "filled in for every column. If disabled, order info will only display on one "
232
+ "row with only the order item info displaying in additional rows."
233
+ msgstr ""
234
 
235
+ #: ../../views/admin/export/template.php:211
236
+ msgid "Save settings as a template"
237
+ msgstr ""
238
 
239
+ #: ../../views/admin/export/template.php:214
240
+ msgid "Template name..."
241
+ msgstr ""
242
 
243
+ #: ../../views/admin/export/template.php:219
244
+ msgid "Load Template..."
245
+ msgstr ""
246
 
247
+ #: ../../views/admin/export/options/settings.php:19
248
+ #, php-format
249
+ msgid "Only export %s once"
250
+ msgstr ""
251
 
252
+ #: ../../views/admin/export/options/settings.php:20
253
+ msgid ""
254
+ "If re-run, this export will only include records that have not been "
255
+ "previously exported."
256
+ msgstr ""
257
 
258
+ #: ../../views/admin/export/options/settings.php:25
259
+ msgid "Include BOM in export file"
260
+ msgstr ""
261
 
262
+ #: ../../views/admin/export/options/settings.php:26
263
+ msgid ""
264
+ "The BOM will help some programs like Microsoft Excel read your export file "
265
+ "if it includes non-English characters."
266
+ msgstr ""
267
 
268
+ #: ../../views/admin/export/options/settings.php:31
269
+ msgid "Create a new file each time export is run"
270
+ msgstr ""
271
 
272
+ #: ../../views/admin/export/options/settings.php:32
273
+ msgid "If disabled, the export file will be overwritten every time this export run."
274
+ msgstr ""
275
 
276
+ #: ../../views/admin/export/options/settings.php:37
277
+ msgid "Split large exports into multiple files"
278
+ msgstr ""
279
 
280
+ #: ../../views/admin/export/options/settings.php:40
281
+ msgid "Limit export to"
282
+ msgstr ""
283
 
284
+ #: ../../views/admin/export/options/settings.php:40
285
+ msgid "records per file"
286
+ msgstr ""
287
 
288
+ #: ../../views/admin/export/options/settings.php:46
289
+ msgid "Main XML Tag:"
290
+ msgstr ""
291
 
292
+ #: ../../views/admin/export/options/settings.php:50
293
+ msgid "Single Record XML Tag:"
294
+ msgstr ""
295
 
296
+ #: ../../views/admin/export/template/new_field_comment.php:9
297
+ msgid "Post ID"
298
+ msgstr ""
299
 
300
+ #: ../../views/admin/export/template/new_field_comment.php:11
301
+ msgid "Author Name"
302
+ msgstr ""
303
 
304
+ #: ../../views/admin/export/template/new_field_comment.php:12
305
+ msgid "Author URL"
306
+ msgstr ""
307
 
308
+ #: ../../views/admin/export/template/new_field_comment.php:13
309
+ msgid "Author IP"
310
+ msgstr ""
311
 
312
+ #: ../../views/admin/export/template/new_field_comment.php:16
313
+ msgid "Karma"
314
+ msgstr ""
315
 
316
+ #: ../../views/admin/export/template/new_field_comment.php:17
317
+ msgid "Approved"
318
+ msgstr ""
319
 
320
+ #: ../../views/admin/export/template/new_field_comment.php:18
321
+ msgid "Agent"
322
+ msgstr ""
323
 
324
+ #: ../../views/admin/export/template/new_field_comment.php:19
325
+ msgid "Type"
326
+ msgstr ""
327
 
328
+ #: ../../views/admin/export/template/new_field_comment.php:20
329
+ msgid "Comment Parent"
330
+ msgstr ""
331
 
332
+ #: ../../views/admin/export/template/new_field_comment.php:21
333
+ msgid "User ID"
334
+ msgstr ""
335
 
336
+ #: ../../views/admin/export/template/new_field_comment.php:24
337
+ msgid "Custom Field / Comment Meta"
338
+ msgstr ""
339
 
340
+ #: ../../views/admin/export/template/new_field_comment.php:78 ../..
341
+ #: /views/admin/export/template/new_field_cpt.php:120 ../..
342
+ #: /views/admin/export/template/new_field_shop_order.php:68 ../..
343
+ #: /views/admin/export/template/new_field_user.php:92 ../..
344
+ #: /views/admin/settings/index.php:150
345
+ msgid "Function Editor"
346
+ msgstr ""
347
 
348
+ #: ../../views/admin/export/template/new_field_comment.php:78 ../..
349
+ #: /views/admin/export/template/new_field_cpt.php:120 ../..
350
+ #: /views/admin/export/template/new_field_shop_order.php:68 ../..
351
+ #: /views/admin/export/template/new_field_user.php:92 ../..
352
+ #: /views/admin/settings/index.php:158
353
+ #, php-format
354
+ msgid "Add functions here for use during your export. You can access this file at %s"
355
+ msgstr ""
356
 
357
+ #: ../../views/admin/export/template/new_field_comment.php:87 ../..
358
+ #: /views/admin/export/template/new_field_cpt.php:129 ../..
359
+ #: /views/admin/export/template/new_field_shop_order.php:77 ../..
360
+ #: /views/admin/export/template/new_field_user.php:101 ../..
361
+ #: /views/admin/settings/index.php:157
362
+ msgid "Save Functions"
363
+ msgstr ""
364
 
365
+ #: ../../views/admin/manage/index.php:229
366
+ msgid "Post Types: "
 
367
  msgstr ""
 
 
368
 
369
+ #: ../../views/admin/manage/scheduling.php:6
370
  msgid ""
371
+ "To schedule an export, you must create two cron jobs in your web hosting "
372
+ "control panel. One cron job will be used to run the Trigger script, the "
373
+ "other to run the Execution script."
374
  msgstr ""
 
 
375
 
376
+ #: ../../views/admin/manage/scheduling.php:20
377
+ msgid "Export Bundle URL"
378
+ msgstr ""
379
 
380
+ #: ../../views/admin/manage/scheduling.php:27
381
+ msgid "Every time you want to schedule the export, run the trigger script."
382
+ msgstr ""
383
 
384
+ #: ../../views/admin/manage/scheduling.php:29
385
+ msgid ""
386
+ "To schedule the export to run once every 24 hours, run the trigger script "
387
+ "every 24 hours. Most hosts require you to use “wget” to access a URL. Ask "
388
+ "your host for details."
389
+ msgstr ""
390
 
391
+ #: ../../views/admin/manage/scheduling.php:37
392
+ msgid ""
393
+ "The Execution script actually executes the export, once it has been "
394
+ "triggered with the Trigger script."
395
+ msgstr ""
396
 
397
+ #: ../../views/admin/manage/scheduling.php:39
398
+ msgid ""
399
+ "It processes in iteration (only exporting a few records each time it runs) "
400
+ "to optimize server load. It is recommended you run the execution script "
401
+ "every 2 minutes."
402
+ msgstr ""
403
 
404
+ #: ../../views/admin/manage/scheduling.php:41
405
+ msgid ""
406
+ "It also operates this way in case of unexpected crashes by your web host. If "
407
+ "it crashes before the export is finished, the next run of the cron job two "
408
+ "minutes later will continue it where it left off, ensuring reliability."
 
 
409
  msgstr ""
 
 
410
 
411
+ #: ../../views/admin/settings/index.php:17
412
+ msgid "Import/Export Templates"
413
+ msgstr ""
414
 
415
+ #: ../../views/admin/settings/index.php:31
416
+ msgid "Delete Selected"
417
+ msgstr ""
418
 
419
+ #: ../../views/admin/settings/index.php:32
420
+ msgid "Export Selected"
421
+ msgstr ""
422
 
423
+ #: ../../views/admin/settings/index.php:35
424
+ msgid "There are no templates saved"
425
+ msgstr ""
426
 
427
+ #: ../../views/admin/settings/index.php:40
428
+ msgid "Import Templates"
429
+ msgstr ""
430
 
431
+ #: ../../views/admin/settings/index.php:81
432
+ #, php-format
433
+ msgid ""
434
+ "If enabled, exported files and temporary files will be saved in a folder "
435
+ "with a randomized name in %s.<br/><br/>If disabled, exported files will be "
436
+ "saved in the Media Library."
437
+ msgstr ""
438
 
439
+ #: ../../views/admin/settings/index.php:88
440
+ msgid "Licenses"
441
+ msgstr ""
442
 
443
+ #: ../../views/admin/settings/index.php:93
444
+ msgid "License Key"
445
+ msgstr ""
446
 
447
+ #: ../../views/admin/settings/index.php:99
448
+ msgid "Active"
449
+ msgstr ""
450
 
451
+ #: ../../views/admin/settings/index.php:101
452
+ msgid "Activate License"
453
+ msgstr ""
454
 
455
+ #: ../../views/admin/settings/index.php:106
456
+ msgid ""
457
+ "A license key is required to access plugin updates. You can use your license "
458
+ "key on an unlimited number of websites. Do not distribute your license key "
459
+ "to 3rd parties. You can get your license key in the <a target=\"_blank\" "
460
+ "href=\"http://www.wpallimport.com/portal\">customer portal</a>."
461
+ msgstr ""
462
 
463
+ #: ../../views/admin/settings/index.php:112
464
+ msgid "Zapier Integration"
465
+ msgstr ""
466
 
467
+ #: ../../views/admin/settings/index.php:117
468
+ msgid "API Key"
469
+ msgstr ""
470
 
471
+ #: ../../views/admin/settings/index.php:120
472
+ msgid "Generate New API Key"
473
+ msgstr ""
474
 
475
+ #: ../../views/admin/settings/index.php:121
476
+ msgid "Changing the key will require you to update your existing Zaps on Zapier."
477
+ msgstr ""
478
 
479
+ #: ../../views/admin/settings/index.php:125
480
+ msgid "Zapier beta invitation URL"
481
+ msgstr ""
482
 
483
+ #: ../../views/admin/settings/index.php:127
484
+ #, php-format
485
+ msgid ""
486
+ "You can get the invitation URL in the <a href=\"%s\" target=\"_blank\">customer "
487
+ "portal</a>."
488
+ msgstr ""
489
 
490
+ #: ../../wp-all-export-pro.php:30
491
+ msgid ""
492
+ "Please de-activate and remove the free version of the WP All Export before "
493
+ "activating the paid version."
494
+ msgstr ""
495
+ "Пожалуйста, деактивируйте и удалите бесплатную версию WP All Export перед "
496
+ "активацией платной версии."
497
 
498
+ #: ../../wp-all-export-pro.php:323 ../../wp-all-export-pro.php:327
499
+ #, php-format
500
+ msgid "Uploads folder %s must be writable"
501
+ msgstr "Папка загрузки %s должна быть доступна для записи"
502
 
503
+ #: ../../actions/admin_menu.php:11 ../../actions/admin_menu.php:14 ../..
504
+ #: /actions/admin_menu.php:15 ../../actions/admin_menu.php:16 ../..
505
+ #: /actions/admin_menu.php:17 ../../models/export/record.php:573 ../..
506
+ #: /views/admin/export/index.php:9 ../../views/admin/export/options.php:15 ../..
507
+ #: /views/admin/export/process.php:9 ../../views/admin/export/template.php:7 ../..
508
+ #: /views/admin/manage/index.php:4 ../../views/admin/manage/update.php:25 ../..
509
+ #: /views/admin/settings/index.php:6
510
+ msgid "WP All Export"
511
+ msgstr "WP All Export"
512
 
513
+ #: ../../actions/admin_menu.php:11
514
+ msgid "All Export"
515
+ msgstr "All Export"
516
 
517
+ #: ../../actions/admin_menu.php:14
518
  msgid "Export to XML"
519
  msgstr "Экспорт в XML"
520
 
521
+ #: ../../actions/admin_menu.php:14
522
+ msgid "New Export"
523
+ msgstr "Новый экспорт"
 
 
 
 
 
 
 
 
 
524
 
525
+ #: ../../actions/admin_menu.php:15 ../../actions/admin_menu.php:15 ../..
526
+ #: /views/admin/export/process.php:57 ../../views/admin/manage/index.php:5
527
+ msgid "Manage Exports"
528
+ msgstr "Управление экспортами"
 
 
529
 
530
+ #: ../../actions/admin_menu.php:16 ../../actions/admin_menu.php:16 ../..
531
+ #: /views/admin/settings/index.php:7
532
+ msgid "Settings"
533
+ msgstr "Настройки"
534
 
535
+ #: ../../actions/admin_menu.php:17 ../../actions/admin_menu.php:17
536
  msgid "Feedback"
537
  msgstr "Обратная связь"
538
 
539
+ #: ../../actions/wp_ajax_export_available_rules.php:6 ../..
540
+ #: /actions/wp_ajax_export_available_rules.php:10 ../..
541
+ #: /actions/wp_ajax_export_filtering.php:6 ../../actions/wp_ajax_export_filtering.
542
+ #: php:10 ../../actions/wp_ajax_export_filtering_count.php:6 ../..
543
+ #: /actions/wp_ajax_export_filtering_count.php:10 ../..
544
+ #: /actions/wp_ajax_export_preview.php:8 ../../actions/wp_ajax_export_preview.php:
545
+ #: 12 ../../actions/wp_ajax_generate_zapier_api_key.php:6 ../..
546
+ #: /actions/wp_ajax_generate_zapier_api_key.php:10 ../..
547
+ #: /actions/wp_ajax_save_functions.php:6 ../../actions/wp_ajax_save_functions.php:
548
+ #: 10 ../../actions/wp_ajax_wpallexport.php:8 ../../actions/wp_ajax_wpallexport.
549
+ #: php:12 ../../controllers/controller.php:117 ../../controllers/admin/manage.php:
550
+ #: 290 ../../controllers/admin/manage.php:325 ../../controllers/admin/manage.php:
551
+ #: 406 ../../controllers/admin/manage.php:459
552
+ msgid "Security check"
553
+ msgstr "Проверка безопасности"
554
 
555
+ #: ../../actions/wp_ajax_export_available_rules.php:21 ../..
556
+ #: /actions/wp_ajax_export_filtering.php:50 ../../views/admin/export/options.php:
557
+ #: 92 ../../views/admin/manage/update.php:100
558
+ msgid "Select Rule"
559
+ msgstr "Выберите правило"
560
 
561
+ #: ../../actions/wp_ajax_export_available_rules.php:38 ../..
562
+ #: /actions/wp_ajax_export_available_rules.php:54
563
+ msgid "equals"
564
+ msgstr "равны"
565
 
566
+ #: ../../actions/wp_ajax_export_available_rules.php:45 ../..
567
+ #: /actions/wp_ajax_export_available_rules.php:61
568
+ msgid "contains"
569
+ msgstr "содержат"
570
 
571
+ #: ../../actions/wp_ajax_export_available_rules.php:47 ../..
572
+ #: /actions/wp_ajax_export_available_rules.php:63
573
+ msgid "is empty"
574
+ msgstr "пустые"
575
 
576
+ #: ../../actions/wp_ajax_export_available_rules.php:48 ../..
577
+ #: /actions/wp_ajax_export_available_rules.php:64
578
+ msgid "is not empty"
579
+ msgstr "не пустые"
580
 
581
+ #: ../../actions/wp_ajax_export_available_rules.php:56
582
+ msgid "greater than"
583
+ msgstr "больше, чем"
584
 
585
+ #: ../../actions/wp_ajax_export_available_rules.php:58
586
+ msgid "less than"
587
+ msgstr "меньше, чем"
588
 
589
+ #: ../../actions/wp_ajax_export_filtering.php:30
590
+ msgid "Add Filtering Options"
591
+ msgstr "Добавить параметры фильтрации"
592
 
593
+ #: ../../actions/wp_ajax_export_filtering.php:36 ../../views/admin/export/options.
594
+ #: php:78 ../../views/admin/manage/update.php:86
595
+ msgid "Element"
596
+ msgstr "Элемент"
597
 
598
+ #: ../../actions/wp_ajax_export_filtering.php:37 ../../views/admin/export/options.
599
+ #: php:79 ../../views/admin/manage/update.php:87
600
+ msgid "Rule"
601
+ msgstr "Правило"
602
 
603
+ #: ../../actions/wp_ajax_export_filtering.php:38 ../../views/admin/export/options.
604
+ #: php:80 ../../views/admin/manage/update.php:88
605
+ msgid "Value"
606
+ msgstr "Значение"
607
 
608
+ #: ../../actions/wp_ajax_export_filtering.php:44 ../../views/admin/export/options.
609
+ #: php:86 ../../views/admin/manage/update.php:94
610
+ msgid "Select Element"
611
+ msgstr "Выберите элемент"
612
 
613
+ #: ../../actions/wp_ajax_export_filtering.php:57 ../../views/admin/export/options.
614
+ #: php:99 ../../views/admin/manage/update.php:107
615
+ msgid "Add Rule"
616
+ msgstr "Добавить правило"
617
 
618
+ #: ../../actions/wp_ajax_export_filtering.php:69 ../../views/admin/export/options.
619
+ #: php:112 ../../views/admin/manage/update.php:120
620
  msgid ""
621
+ "No filtering options. Add filtering options to only export records matching "
622
+ "some specified criteria."
 
623
  msgstr ""
624
+ "Нет параметров фильтрации. Добавить параметры фильтрации, чтобы "
625
+ "экспортировать только записи, удовлетворяющие заданным условиям."
626
 
627
+ #: ../../actions/wp_ajax_export_filtering.php:106
628
+ msgid "Apply Filters To Export Data"
629
+ msgstr "Применить фильтры к экспортируемым данным"
630
 
631
+ #: ../../actions/wp_ajax_export_filtering.php:114 ../..
632
+ #: /views/admin/export/options.php:159 ../../views/admin/manage/update.php:167
633
+ msgid "Variable product matching rules: "
634
+ msgstr "Вариативный продукт, соответствующий правилам: "
 
 
 
 
635
 
636
+ #: ../../actions/wp_ajax_export_filtering.php:116 ../..
637
+ #: /views/admin/export/options.php:161 ../../views/admin/manage/update.php:169
638
+ msgid "Strict"
639
+ msgstr "Строгое"
 
 
 
 
640
 
641
+ #: ../../actions/wp_ajax_export_filtering.php:117 ../..
642
+ #: /views/admin/export/options.php:162 ../../views/admin/manage/update.php:170
643
+ msgid "Permissive"
644
+ msgstr "Разрешающее"
645
 
646
+ #: ../../actions/wp_ajax_export_filtering.php:119 ../..
647
+ #: /views/admin/export/options.php:164 ../../views/admin/manage/update.php:172
648
+ msgid ""
649
+ "Strict matching requires all variations to pass in order for the product to "
650
+ "be exported. Permissive matching allows the product to be exported if any of "
651
+ "the variations pass."
652
+ msgstr ""
653
+ "Строгое соответствие требует, чтобы все условия соблюдались для "
654
+ "экспортируемого продукта. Разрешающее соответствие позволяет продукту "
655
+ "экспортироваться, если одно из условий соблюдается."
656
 
657
+ #: ../../actions/wp_ajax_export_filtering_count.php:91 ../..
658
+ #: /views/admin/export/options.php:43 ../../views/admin/manage/update.php:54
659
+ msgid "Your export is ready to run."
660
+ msgstr "Ваш экспорт готов к запуску"
661
 
662
+ #: ../../actions/wp_ajax_export_filtering_count.php:92 ../..
663
+ #: /views/admin/export/options.php:45 ../../views/admin/manage/update.php:55
664
+ #, php-format
665
+ msgid "WP All Export will export %d %s."
666
+ msgstr "WP All Export будет экспортировать %d %s."
667
 
668
+ #: ../../actions/wp_ajax_export_filtering_count.php:111
669
+ msgid "Continue to Step 2 to choose data to include in the export file."
670
+ msgstr "Перейти к шагу 2, чтобы выбрать данные для включения в файл экспорта."
671
 
672
+ #: ../../actions/wp_ajax_export_preview.php:160
673
+ msgid "Data not found."
674
+ msgstr "Данные не найдены."
675
 
676
+ #: ../../actions/wp_ajax_export_preview.php:169
677
+ msgid "This format is not supported."
678
+ msgstr "Этот формат не поддерживается."
679
 
680
+ #: ../../actions/wp_loaded.php:84 ../../actions/wp_loaded.php:137
681
+ #, php-format
682
+ msgid "Export #%s is currently in manually process. Request skipped."
683
+ msgstr "Экспорт #%s в настоящее время в ручном режиме. Запрос пропущен."
684
 
685
+ #: ../../actions/wp_loaded.php:97
686
+ #, php-format
687
+ msgid "#%s Cron job triggered."
688
+ msgstr "#%s Cron задача запущена."
689
 
690
+ #: ../../actions/wp_loaded.php:104
691
+ #, php-format
692
+ msgid "Export #%s currently in process. Request skipped."
693
+ msgstr "Экспорт #%s в настоящее время запущен. Запрос пропущен."
694
 
695
+ #: ../../actions/wp_loaded.php:111
696
+ #, php-format
697
+ msgid "Export #%s already triggered. Request skipped."
698
+ msgstr "Экспорт #%s уже вызван. Запрос пропущен."
699
 
700
+ #: ../../actions/wp_loaded.php:130
701
+ #, php-format
702
+ msgid "Export #%s is not triggered. Request skipped."
703
+ msgstr "Экспорт #%s не вызван. Запрос пропущен."
704
 
705
+ #: ../../actions/wp_loaded.php:148
706
+ #, php-format
707
+ msgid "Export #%s complete"
708
+ msgstr "Экспорт #%s завершен"
709
 
710
+ #: ../../actions/wp_loaded.php:164
711
+ #, php-format
712
+ msgid "Export #%s already processing. Request skipped."
713
+ msgstr "Экспорт #%s уже в процесее. Запрос пропущен."
714
 
715
+ #: ../../classes/updater.php:238
716
+ #, php-format
717
  msgid ""
718
+ "There is a new version of %1$s available. <a target=\"_blank\" "
719
+ "class=\"thickbox\" href=\"%2$s\">View version %3$s details</a>."
720
  msgstr ""
721
+ "Новая версия %1$s доступна. <a target=\"_blank\" class=\"thickbox\" "
722
+ "href=\"%2$s\">Посмотреть детали версии %3$s </a>."
 
 
 
 
 
 
723
 
724
+ #: ../../classes/updater.php:245
725
+ #, php-format
726
+ msgid ""
727
+ "There is a new version of %1$s available. <a target=\"_blank\" "
728
+ "class=\"thickbox\" href=\"%2$s\">View version %3$s details</a> or <a "
729
+ "href=\"%4$s\">update now</a>."
730
+ msgstr ""
731
+ "Новая версия %1$s доступна. <a target=\"_blank\" class=\"thickbox\" "
732
+ "href=\"%2$s\">Посмотреть детали версии %3$s </a> или <a href=\"%4$s\">обновить "
733
+ "сейчас</a>."
734
 
735
+ #: ../../classes/updater.php:428
736
+ msgid "You do not have permission to install plugin updates"
737
+ msgstr "У вас нет разрешения для установки обновлений плагина"
738
 
739
+ #: ../../classes/updater.php:428
740
+ msgid "Error"
741
+ msgstr "Ошибка"
742
 
743
+ #: ../../controllers/admin/export.php:221
744
+ msgid "You haven't selected any columns for export."
745
+ msgstr "Вы не отметили никакие столбцы для экспорта."
746
 
747
+ #: ../../controllers/admin/export.php:250 ../../controllers/admin/export.php:349 .
748
+ #: ./../controllers/admin/manage.php:226
749
  msgid "Options updated"
750
  msgstr "Параметры обновлены"
751
 
752
+ #: ../../controllers/admin/manage.php:56
753
+ msgid "&laquo;"
754
+ msgstr "&laquo;"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
755
 
756
+ #: ../../controllers/admin/manage.php:57
757
+ msgid "&raquo;"
758
+ msgstr "&raquo;"
759
 
760
+ #: ../../controllers/admin/manage.php:153 ../../views/admin/manage/index.php:300
761
+ msgid "Export canceled"
762
+ msgstr "Экспорт отменен"
763
 
764
+ #: ../../controllers/admin/manage.php:254
765
+ msgid "Export deleted"
766
+ msgstr "Экспорт удален"
767
 
768
+ #: ../../controllers/admin/manage.php:282
769
+ #, php-format
770
+ msgid "%d %s deleted"
771
+ msgstr "%d %s удален"
772
 
773
+ #: ../../controllers/admin/manage.php:282 ../../views/admin/manage/bulk.php:10
774
+ msgid "export"
775
+ msgid_plural "exports"
776
+ msgstr[0] "экспорт"
777
+ msgstr[1] "экспорта"
778
+ msgstr[2] "экспортов"
779
 
780
+ #: ../../controllers/admin/manage.php:376
781
  msgid ""
782
+ "The other two files in this zip are the export file containing all of your "
783
+ "data and the import template for WP All Import. \n"
784
+ "\n"
785
+ "To import this data, create a new import with WP All Import and upload this "
786
+ "zip file."
787
  msgstr ""
788
+ "Два других файла в этом архиве - это файлы экспорта, содержащие все Ваши "
789
+ "данные и шаблон импорта для WP All Import. \n"
790
+ "\n"
791
+ "Чтобы импортировать эти данные, создайте новый импорт с WP All Import и "
792
+ "загрузить этот архив."
793
 
794
+ #: ../../controllers/admin/manage.php:493
795
+ msgid "File format not supported"
796
+ msgstr "Формат файла не поддерживается"
797
 
798
+ #: ../../controllers/admin/manage.php:499 ../../controllers/admin/manage.php:504
799
+ msgid ""
800
+ "The exported file is missing and can't be downloaded. Please re-run your "
801
+ "export to re-generate it."
802
+ msgstr ""
803
+ "Экспортируемый файл отсутствует и не может быть загружен. Пожалуйста, "
804
+ "перезапустите свой экспорт для его повторного создания."
805
 
806
+ #: ../../controllers/admin/settings.php:28
807
+ msgid "Settings saved"
808
+ msgstr "Настройки сохранены"
809
 
810
+ #: ../../filters/wpallexport_custom_types.php:4
811
+ msgid "WooCommerce Products"
812
+ msgstr "WooCommerce товары"
813
 
814
+ #: ../../helpers/pmxe_render_xml_element.php:44 ../..
815
+ #: /helpers/pmxe_render_xml_text.php:9
816
+ #, php-format
817
+ msgid "<strong>%s</strong> %s more"
818
+ msgstr "<strong>%s</strong> %s еще"
819
 
820
+ #: ../../helpers/pmxe_render_xml_element.php:44 ../..
821
+ #: /helpers/pmxe_render_xml_text.php:9
822
+ msgid "element"
823
+ msgid_plural "elements"
824
+ msgstr[0] "элемент"
825
+ msgstr[1] "элемента"
826
+ msgstr[2] "элементов"
827
 
828
+ #: ../../helpers/pmxe_render_xml_text.php:15
829
+ msgid "more"
830
+ msgstr "еще"
831
 
832
+ #: ../../helpers/wp_all_export_get_cpt_name.php:9 ../../views/admin/export/index.
833
+ #: php:67
834
+ msgid "Users"
835
+ msgstr "Пользователи"
836
 
837
+ #: ../../helpers/wp_all_export_get_cpt_name.php:9
838
+ msgid "User"
839
+ msgstr "Пользователь"
840
 
841
+ #: ../../helpers/wp_all_export_get_cpt_name.php:18
842
  msgid "Product Variations"
843
  msgstr "Вариации товара"
844
 
845
+ #: ../../helpers/wp_all_export_get_cpt_name.php:28
846
+ msgid "Records"
847
+ msgstr "Записи"
848
 
849
+ #: ../../helpers/wp_all_export_get_cpt_name.php:28
850
+ msgid "Record"
851
+ msgstr "Запись"
852
 
853
+ #: ../../libraries/XmlExportACF.php:218 ../../libraries/XmlExportACF.php:268
854
+ msgid "ACF"
855
+ msgstr "ACF"
856
 
857
+ #: ../../libraries/XmlExportComment.php:136 ../../libraries/XmlExportEngine.php:
858
+ #: 191 ../../libraries/XmlExportUser.php:199
859
+ msgid "General"
860
+ msgstr "Общее"
861
 
862
+ #: ../../libraries/XmlExportComment.php:229 ../../libraries/XmlExportUser.php:218
863
+ #: ../../libraries/XmlExportUser.php:292 ../../libraries/XmlExportWooCommerce.php:
864
+ #: 111 ../../libraries/XmlExportWooCommerce.php:279 ../..
865
+ #: /libraries/XmlExportWooCommerceOrder.php:130 ../..
866
+ #: /libraries/XmlExportWooCommerceOrder.php:945 ../..
867
+ #: /views/admin/export/template/new_field_comment.php:43 ../..
868
+ #: /views/admin/export/template/new_field_cpt.php:78 ../..
869
+ #: /views/admin/export/template/new_field_shop_order.php:33 ../..
870
+ #: /views/admin/export/template/new_field_user.php:57
871
+ msgid "Advanced"
872
+ msgstr "Дополнительно"
873
 
874
+ #: ../../libraries/XmlExportEngine.php:172
875
+ msgid "Standard"
876
+ msgstr "Стандартные"
877
 
878
+ #: ../../libraries/XmlExportEngine.php:176
879
+ msgid "Taxonomies"
880
+ msgstr "Таксономии"
881
 
882
+ #: ../../libraries/XmlExportEngine.php:180
883
+ msgid "Custom Fields"
884
+ msgstr "Пользовательские поля"
885
 
886
+ #: ../../libraries/XmlExportEngine.php:184
887
+ msgid "Other"
888
+ msgstr "Другие"
889
 
890
+ #: ../../libraries/XmlExportEngine.php:253
891
+ msgid "WP Query field is required"
892
+ msgstr "WP поле запроса требуется"
893
 
894
+ #: ../../libraries/XmlExportEngine.php:288
895
+ msgid "Invalid query"
896
+ msgstr "Недопустимый запрос"
897
 
898
+ #: ../../libraries/XmlExportEngine.php:474 ../..
899
+ #: /libraries/XmlExportWooCommerceOrder.php:886
900
+ msgid "All"
901
+ msgstr "Все"
902
 
903
+ #: ../../libraries/XmlExportEngine.php:493 ../../views/admin/export/template.php:
904
+ #: 73 ../../views/admin/export/template.php:106 ../../views/admin/export/template.
905
+ #: php:133
906
+ msgid "Delete field"
907
+ msgstr "Удалить поле"
908
 
909
+ #: ../../libraries/XmlExportUser.php:231
910
+ msgid "Network"
911
+ msgstr "Сеть"
912
 
913
+ #: ../../libraries/XmlExportWooCommerce.php:98 ../..
914
+ #: /libraries/XmlExportWooCommerce.php:283
915
+ msgid "Product Data"
916
+ msgstr "Данные о продукте"
917
 
918
+ #: ../../libraries/XmlExportWooCommerceOrder.php:65 ../..
919
+ #: /libraries/XmlExportWooCommerceOrder.php:925
920
+ msgid "Order"
921
+ msgstr "Заказ"
922
 
923
+ #: ../../libraries/XmlExportWooCommerceOrder.php:67 ../..
924
+ #: /libraries/XmlExportWooCommerceOrder.php:960
925
+ msgid "Order ID"
926
+ msgstr "ID заказа"
927
 
928
+ #: ../../libraries/XmlExportWooCommerceOrder.php:68 ../..
929
+ #: /libraries/XmlExportWooCommerceOrder.php:961
930
+ msgid "Order Key"
931
+ msgstr "Ключ заказа"
932
 
933
+ #: ../../libraries/XmlExportWooCommerceOrder.php:69 ../..
934
+ #: /libraries/XmlExportWooCommerceOrder.php:962
935
+ msgid "Order Date"
936
+ msgstr "Дата заказа"
937
 
938
+ #: ../../libraries/XmlExportWooCommerceOrder.php:70 ../..
939
+ #: /libraries/XmlExportWooCommerceOrder.php:963
940
+ msgid "Completed Date"
941
+ msgstr "Дата завершения"
942
 
943
+ #: ../../libraries/XmlExportWooCommerceOrder.php:71 ../..
944
+ #: /libraries/XmlExportWooCommerceOrder.php:964 ../..
945
+ #: /views/admin/export/template/new_field_cpt.php:9
946
+ msgid "Title"
947
+ msgstr "Заголовок (Title)"
948
 
949
+ #: ../../libraries/XmlExportWooCommerceOrder.php:72 ../..
950
+ #: /libraries/XmlExportWooCommerceOrder.php:965
951
+ msgid "Order Status"
952
+ msgstr "Статус заказа"
953
 
954
+ #: ../../libraries/XmlExportWooCommerceOrder.php:73 ../..
955
+ #: /libraries/XmlExportWooCommerceOrder.php:966
956
+ msgid "Order Currency"
957
+ msgstr "Валюта заказа"
958
 
959
+ #: ../../libraries/XmlExportWooCommerceOrder.php:74 ../..
960
+ #: /libraries/XmlExportWooCommerceOrder.php:967
961
+ msgid "Payment Method"
962
+ msgstr "Метод оплаты"
963
 
964
+ #: ../../libraries/XmlExportWooCommerceOrder.php:75 ../..
965
+ #: /libraries/XmlExportWooCommerceOrder.php:968
966
+ msgid "Order Total"
967
+ msgstr "Сумма заказа"
968
 
969
+ #: ../../libraries/XmlExportWooCommerceOrder.php:79 ../..
970
+ #: /libraries/XmlExportWooCommerceOrder.php:929
971
+ msgid "Customer"
972
+ msgstr "Покупатель"
973
 
974
+ #: ../../libraries/XmlExportWooCommerceOrder.php:886
975
+ msgid "Data"
976
+ msgstr "Данные"
977
 
978
+ #: ../../libraries/XmlExportWooCommerceOrder.php:933
979
+ msgid "Items"
980
+ msgstr "Штуки"
981
 
982
+ #: ../../libraries/XmlExportWooCommerceOrder.php:937
983
+ msgid "Taxes & Shipping"
984
+ msgstr "Налоги и доставка"
985
 
986
+ #: ../../libraries/XmlExportWooCommerceOrder.php:941
987
+ msgid "Fees & Discounts"
988
+ msgstr "Тарифы и скидки"
989
 
990
+ #: ../../libraries/XmlExportWooCommerceOrder.php:981
991
+ msgid "Product ID"
992
+ msgstr "ID товара"
993
 
994
+ #: ../../libraries/XmlExportWooCommerceOrder.php:982
995
+ msgid "SKU"
996
+ msgstr "SKU (артикул)"
997
 
998
+ #: ../../libraries/XmlExportWooCommerceOrder.php:983
999
+ msgid "Product Name"
1000
+ msgstr "Наименование товара"
1001
 
1002
+ #: ../../libraries/XmlExportWooCommerceOrder.php:984
1003
+ msgid "Product Variation Details"
1004
+ msgstr "Вариационные детали товара"
 
 
 
 
 
1005
 
1006
+ #: ../../libraries/XmlExportWooCommerceOrder.php:985
1007
+ msgid "Quantity"
1008
+ msgstr "Количество"
1009
 
1010
+ #: ../../libraries/XmlExportWooCommerceOrder.php:986
1011
+ msgid "Item Cost"
1012
+ msgstr "Стоимость за единицу"
1013
 
1014
+ #: ../../libraries/XmlExportWooCommerceOrder.php:987
1015
+ msgid "Item Total"
1016
+ msgstr "Штук всего"
1017
 
1018
+ #: ../../libraries/XmlExportWooCommerceOrder.php:996
1019
+ msgid "Rate Code (per tax)"
1020
+ msgstr "Код тарифа (per tax)"
1021
 
1022
+ #: ../../libraries/XmlExportWooCommerceOrder.php:997
1023
+ msgid "Rate Percentage (per tax)"
1024
+ msgstr "Процентная ставка (per tax)"
1025
 
1026
+ #: ../../libraries/XmlExportWooCommerceOrder.php:998
1027
+ msgid "Amount (per tax)"
1028
+ msgstr "Сумма (per tax)"
 
 
 
1029
 
1030
+ #: ../../libraries/XmlExportWooCommerceOrder.php:999
1031
+ msgid "Total Tax Amount"
1032
+ msgstr "Общая сумма налогов"
 
 
 
1033
 
1034
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1000
1035
+ msgid "Shipping Method"
1036
+ msgstr "Способ доставки"
 
 
 
 
 
 
 
 
 
1037
 
1038
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1001
1039
+ msgid "Shipping Cost"
1040
+ msgstr "Стоимость доставки"
1041
 
1042
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1010
1043
+ msgid "Discount Amount (per coupon)"
1044
+ msgstr "Сумма скидки (по купону)"
 
 
 
 
 
1045
 
1046
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1011
1047
+ msgid "Coupons Used"
1048
+ msgstr "Используемые купоны"
 
 
 
1049
 
1050
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1012
1051
+ msgid "Total Discount Amount"
1052
+ msgstr "Общая сумма скидки"
1053
 
1054
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1013
1055
+ msgid "Fee Amount (per surcharge)"
1056
+ msgstr "Сумма сбора (дополнительный сбор)"
1057
 
1058
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1014
1059
+ msgid "Total Fee Amount"
1060
+ msgstr "Общая сумма платежей"
1061
 
1062
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1024
1063
+ msgid "Customer User ID"
1064
+ msgstr "ID покупателя"
 
 
 
 
 
1065
 
1066
+ #: ../../libraries/XmlExportWooCommerceOrder.php:1025
1067
+ msgid "Customer Note"
1068
+ msgstr "Примечание к покупателю"
 
 
 
 
 
1069
 
1070
+ #: ../../views/admin/export/index.php:10 ../../views/admin/export/options.php:16 .
1071
+ #: ./../views/admin/export/process.php:10 ../../views/admin/export/template.php:8
1072
+ #: ../../views/admin/manage/update.php:26
1073
+ msgid "Export to XML / CSV"
1074
+ msgstr "Экспорт в XML / CSV"
1075
 
1076
+ #: ../../views/admin/export/index.php:13 ../../views/admin/export/options.php:19 .
1077
+ #: ./../views/admin/export/process.php:13 ../../views/admin/export/template.php:
1078
+ #: 11 ../../views/admin/manage/update.php:29
1079
+ msgid "Support"
1080
+ msgstr "Поддержка"
1081
 
1082
+ #: ../../views/admin/export/index.php:13 ../../views/admin/export/options.php:19 .
1083
+ #: ./../views/admin/export/process.php:13 ../../views/admin/export/template.php:
1084
+ #: 11 ../../views/admin/manage/update.php:29
1085
+ msgid "Documentation"
1086
+ msgstr "Документация"
1087
 
1088
+ #: ../../views/admin/export/index.php:30
1089
+ msgid "First, choose what to export."
1090
+ msgstr "Во-первых, выберите, что экспортировать."
1091
 
1092
+ #: ../../views/admin/export/index.php:33
1093
+ msgid "Specific Post Type"
1094
+ msgstr "Определить тип поста"
1095
 
1096
+ #: ../../views/admin/export/index.php:37
1097
+ msgid "WP_Query Results"
1098
+ msgstr "Результаты WP_Query"
1099
 
1100
+ #: ../../views/admin/export/index.php:56
1101
+ msgid "Choose a post type..."
1102
+ msgstr "Выберите тип поста..."
1103
 
1104
+ #: ../../views/admin/export/index.php:80
1105
+ msgid "Post Type Query"
1106
+ msgstr "Запрос типа поста"
1107
 
1108
+ #: ../../views/admin/export/index.php:81
1109
  msgid "User Query"
1110
  msgstr "Пользовательский запрос"
1111
 
1112
+ #: ../../views/admin/export/index.php:114
1113
+ msgid "Skip to Step 3"
1114
+ msgstr "Перейти к шагу 3"
1115
 
1116
+ #: ../../views/admin/export/index.php:116
1117
+ msgid "Continue to Step 2"
1118
+ msgstr "Перейти к шагу 2"
1119
 
1120
+ #: ../../views/admin/export/index.php:118
1121
+ msgid "Auto Generate Export Template"
1122
+ msgstr "Автосоздание шаблона экспорта"
1123
 
1124
+ #: ../../views/admin/export/index.php:125 ../../views/admin/export/options.php:
1125
+ #: 202 ../../views/admin/export/process.php:62 ../../views/admin/export/template.
1126
+ #: php:248 ../../views/admin/manage/index.php:367 ../..
1127
+ #: /views/admin/manage/scheduling.php:57 ../../views/admin/manage/templates.php:
1128
+ #: 19 ../../views/admin/manage/update.php:206 ../../views/admin/settings/index.
1129
+ #: php:167
1130
+ msgid "Created by"
1131
+ msgstr "Создано"
1132
 
1133
+ #: ../../views/admin/export/options.php:54 ../../views/admin/export/options.php:
1134
+ #: 191 ../../views/admin/manage/update.php:6 ../../views/admin/manage/update.php:
1135
+ #: 64 ../../views/admin/manage/update.php:199
1136
+ msgid "Confirm & Run Export"
1137
+ msgstr "Подтвердить и запустить экспорт"
1138
 
1139
+ #: ../../views/admin/export/options.php:70 ../../views/admin/manage/update.php:78
1140
+ msgid "Filters"
1141
+ msgstr "Фильтры"
1142
+
1143
+ #: ../../views/admin/export/options.php:189
1144
+ msgid "Back to Step 2"
1145
+ msgstr "Вернуться к шагу 2"
1146
+
1147
+ #: ../../views/admin/export/options.php:194 ../../views/admin/export/template.php:
1148
+ #: 241
1149
+ msgid "Back to Manage Exports"
1150
+ msgstr "Вернуться к управлению экспортами"
1151
+
1152
+ #: ../../views/admin/export/options.php:195 ../../views/admin/manage/update.php:7
1153
+ #: ../../views/admin/manage/update.php:197
1154
+ msgid "Save Export Configuration"
1155
+ msgstr "Сохранить конфигурацию экспорта"
1156
+
1157
+ #: ../../views/admin/export/process.php:22
1158
+ msgid "Export <span id=\"status\">in Progress...</span>"
1159
+ msgstr "Экспорт <span id=\"status\">в процессе...</span>"
1160
 
1161
+ #: ../../views/admin/export/process.php:23
1162
  msgid ""
1163
+ "Exporting may take some time. Please do not close your browser or refresh "
1164
+ "the page until the process is complete."
 
1165
  msgstr ""
1166
+ "Экспорт может занять некоторое время. Пожалуйста, не закрывайте браузер и не "
1167
+ "обновляйте страницу пока процесс не завершится."
1168
+
1169
+ #: ../../views/admin/export/process.php:29
1170
+ msgid "Time Elapsed"
1171
+ msgstr "Времени прошло"
1172
+
1173
+ #: ../../views/admin/export/process.php:31
1174
+ msgid "Exported"
1175
+ msgstr "Экспортируемый"
1176
+
1177
+ #: ../../views/admin/export/process.php:36
1178
+ msgid "Export Complete!"
1179
+ msgstr "Экспорт завершен!"
1180
 
1181
+ #: ../../views/admin/export/process.php:37
1182
  msgid "WP All Export successfully exported your data!"
1183
  msgstr "WP All Export успешно экспортировал Ваши данные!"
1184
 
1185
+ #: ../../views/admin/export/process.php:38
1186
+ msgid "Download Data"
1187
+ msgstr "Загрузить данные"
1188
 
1189
+ #: ../../views/admin/export/process.php:51 ../../views/admin/manage/index.php:140
1190
+ #: ../../views/admin/manage/index.php:147
1191
+ msgid "Bundle"
1192
+ msgstr "Связка"
1193
 
1194
+ #: ../../views/admin/export/template.php:23
1195
+ msgid "Choose data to include in the export file."
1196
+ msgstr "Выбрать данные для включения в файл экспорта."
1197
 
1198
+ #: ../../views/admin/export/template.php:115
1199
  msgid ""
1200
+ "Drag & drop data from \"Available Data\" on the right to include it in the "
1201
+ "export or click \"Add Field To Export\" below."
1202
  msgstr ""
1203
+ "Перетащите данные из \"Доступные данные\" справа для включения в экспорт или "
1204
+ "нажмите \"Добавить поле к экспорту\" ниже."
1205
 
1206
+ #: ../../views/admin/export/template.php:139
1207
  msgid ""
1208
  "Warning: without an ID column, you won't be able to re-import this data "
1209
  "using WP All Import."
1211
  "Внимание: без ID столбца Вы не сможете повторно импортировать эти данные "
1212
  "через WP All Import."
1213
 
1214
+ #: ../../views/admin/export/template.php:145
1215
+ msgid ""
1216
+ "Warning: without _sku and product_type columns, you won't be able to re-"
1217
+ "import this data using WP All Import."
1218
+ msgstr ""
1219
+ "Внимание: без столбцов _sku и product_type Вы не сможете повторно "
1220
+ "импортировать эти данные через WP All Import."
1221
+
1222
+ #: ../../views/admin/export/template.php:151
1223
  msgid ""
1224
  "Warning: without post_type column, you won't be able to re-import this data "
1225
  "using WP All Import."
1227
  "Внимание: без столбца post_type Вы не сможете повторно экспортировать эти "
1228
  "данные через WP All Import."
1229
 
1230
+ #: ../../views/admin/export/template.php:157 ../../views/admin/export/template.
1231
+ #: php:283
1232
+ msgid "Add Field To Export"
1233
+ msgstr "Добавить поле к экспорту"
 
 
 
 
1234
 
1235
+ #: ../../views/admin/export/template.php:162
1236
+ msgid "Display each product in its own row"
1237
+ msgstr "Отображать каждый товар на отдельной строке"
1238
 
1239
+ #: ../../views/admin/export/template.php:176
1240
+ msgid "Preview A Row"
1241
+ msgstr "Предпросмотр строки"
1242
 
1243
+ #: ../../views/admin/export/template.php:182
1244
+ msgid "Export File Format:"
1245
+ msgstr "Формат файла экспорта:"
1246
 
1247
+ #: ../../views/admin/export/template.php:187
1248
  msgid "XML"
1249
  msgstr "XML"
1250
 
1251
+ #: ../../views/admin/export/template.php:191
1252
+ msgid "CSV"
1253
+ msgstr "CSV"
1254
 
1255
+ #: ../../views/admin/export/template.php:194
1256
+ msgid "Delimiter:"
1257
+ msgstr "Разделитель:"
1258
 
1259
+ #: ../../views/admin/export/template.php:258
1260
+ msgid "Available Data"
1261
+ msgstr "Доступные данные"
1262
 
1263
+ #: ../../views/admin/export/template.php:264
1264
+ msgid "Auto Generate"
1265
+ msgstr "Авто создание"
1266
 
1267
+ #: ../../views/admin/export/template.php:283
1268
+ msgid "Edit Export Field"
1269
+ msgstr "Правка поля экспорта"
 
 
 
 
 
1270
 
1271
+ #: ../../views/admin/export/options/settings.php:5
1272
+ msgid "Advanced Export"
1273
+ msgstr "Расширенный экспорт"
1274
 
1275
+ #: ../../views/admin/export/options/settings.php:13
1276
+ msgid "In each iteration, process"
1277
+ msgstr "В каждом повторении обрабатывать"
1278
+
1279
+ #: ../../views/admin/export/options/settings.php:13 ../..
1280
+ #: /views/admin/export/options/settings.php:19
1281
+ msgid "records"
1282
+ msgstr "записей"
1283
+
1284
+ #: ../../views/admin/export/options/settings.php:14
1285
+ msgid ""
1286
+ "WP All Export must be able to process this many records in less than your "
1287
+ "server's timeout settings. If your export fails before completion, to "
1288
+ "troubleshoot you should lower this number."
1289
+ msgstr ""
1290
+ "WP All Export должен быть в состоянии обработать это количество записей "
1291
+ "быстрее, чем установленный тайм-аут Вашего сервера. Если экспорт не "
1292
+ "выполняется до завершения, для устранения ошибки следует уменьшить это число."
1293
+
1294
+ #: ../../views/admin/export/options/settings.php:58
1295
+ msgid "Friendly Name:"
1296
+ msgstr "Понятное имя:"
1297
+
1298
+ #: ../../views/admin/export/options/settings.php:59
1299
+ msgid "Save friendly name..."
1300
+ msgstr "Сохранить понятое имя..."
1301
+
1302
+ #: ../../views/admin/export/template/new_field_comment.php:4 ../..
1303
+ #: /views/admin/export/template/new_field_cpt.php:4 ../..
1304
+ #: /views/admin/export/template/new_field_shop_order.php:4 ../..
1305
+ #: /views/admin/export/template/new_field_user.php:4
1306
+ msgid "What field would you like to export?"
1307
+ msgstr "Какие поля Вы хотите экспортировать?"
1308
+
1309
+ #: ../../views/admin/export/template/new_field_comment.php:8 ../..
1310
+ #: /views/admin/export/template/new_field_cpt.php:8 ../..
1311
+ #: /views/admin/export/template/new_field_user.php:8 ../..
1312
+ #: /views/admin/manage/index.php:27
1313
+ msgid "ID"
1314
+ msgstr "ID"
1315
+
1316
+ #: ../../views/admin/export/template/new_field_comment.php:10 ../..
1317
+ #: /views/admin/export/template/new_field_cpt.php:21
1318
+ msgid "Author"
1319
+ msgstr "Автор"
1320
+
1321
+ #: ../../views/admin/export/template/new_field_comment.php:14 ../..
1322
+ #: /views/admin/export/template/new_field_cpt.php:12
1323
+ msgid "Date"
1324
+ msgstr "Дата"
1325
 
1326
+ #: ../../views/admin/export/template/new_field_comment.php:15 ../..
1327
+ #: /views/admin/export/template/new_field_cpt.php:10
1328
+ msgid "Content"
1329
+ msgstr "Содержание"
1330
+
1331
+ #: ../../views/admin/export/template/new_field_comment.php:25 ../..
1332
+ #: /views/admin/export/template/new_field_cpt.php:44 ../..
1333
+ #: /views/admin/export/template/new_field_shop_order.php:19 ../..
1334
+ #: /views/admin/export/template/new_field_user.php:35
1335
+ msgid "SQL Query"
1336
+ msgstr "SQL запрос"
1337
+
1338
+ #: ../../views/admin/export/template/new_field_comment.php:33 ../..
1339
+ #: /views/admin/export/template/new_field_cpt.php:52 ../..
1340
+ #: /views/admin/export/template/new_field_cpt.php:56 ../..
1341
+ #: /views/admin/export/template/new_field_cpt.php:60 ../..
1342
+ #: /views/admin/export/template/new_field_cpt.php:64 ../..
1343
+ #: /views/admin/export/template/new_field_cpt.php:68 ../..
1344
+ #: /views/admin/export/template/new_field_user.php:43 ../..
1345
+ #: /views/admin/export/template/new_field_user.php:47
1346
+ msgid "Field Name"
1347
+ msgstr "Имя поля"
1348
+
1349
+ #: ../../views/admin/export/template/new_field_comment.php:38 ../..
1350
+ #: /views/admin/export/template/new_field_cpt.php:73 ../..
1351
+ #: /views/admin/export/template/new_field_shop_order.php:26 ../..
1352
+ #: /views/admin/export/template/new_field_user.php:52
1353
+ msgid "What would you like to name the column/element in your exported file?"
1354
+ msgstr "Как бы Вы хотели назвать столбец/элемент в файле эспорта?"
1355
+
1356
+ #: ../../views/admin/export/template/new_field_comment.php:47 ../..
1357
+ #: /views/admin/export/template/new_field_cpt.php:82 ../..
1358
+ #: /views/admin/export/template/new_field_shop_order.php:37 ../..
1359
+ #: /views/admin/export/template/new_field_user.php:61
1360
+ #, php-format
1361
+ msgid ""
1362
+ "%%ID%% will be replaced with the ID of the post being exported, example: "
1363
+ "SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND "
1364
+ "meta_key='your_meta_key';"
1365
+ msgstr ""
1366
+ "%%ID%% будет замещен экспортируемым постом, например: SELECT meta_value FROM "
1367
+ "wp_postmeta WHERE post_id=%%ID%% AND meta_key='your_meta_key';"
1368
+
1369
+ #: ../../views/admin/export/template/new_field_comment.php:52 ../..
1370
+ #: /views/admin/export/template/new_field_cpt.php:94 ../..
1371
+ #: /views/admin/export/template/new_field_shop_order.php:42 ../..
1372
+ #: /views/admin/export/template/new_field_user.php:66
1373
+ msgid "UNIX timestamp - PHP time()"
1374
+ msgstr "UNIX timestamp - PHP time()"
1375
+
1376
+ #: ../../views/admin/export/template/new_field_comment.php:53 ../..
1377
+ #: /views/admin/export/template/new_field_cpt.php:95 ../..
1378
+ #: /views/admin/export/template/new_field_shop_order.php:43 ../..
1379
+ #: /views/admin/export/template/new_field_user.php:67
1380
+ msgid "Natural Language PHP date()"
1381
+ msgstr "Естесственный язык PHP date()"
1382
+
1383
+ #: ../../views/admin/export/template/new_field_comment.php:56 ../..
1384
+ #: /views/admin/export/template/new_field_cpt.php:98 ../..
1385
+ #: /views/admin/export/template/new_field_shop_order.php:46 ../..
1386
+ #: /views/admin/export/template/new_field_user.php:70
1387
  msgid "date() Format"
1388
  msgstr "date() формат"
1389
 
1390
+ #: ../../views/admin/export/template/new_field_comment.php:63 ../..
1391
+ #: /views/admin/export/template/new_field_cpt.php:105 ../..
1392
+ #: /views/admin/export/template/new_field_shop_order.php:53 ../..
1393
+ #: /views/admin/export/template/new_field_user.php:77
1394
+ msgid "Export the value returned by a PHP function"
1395
+ msgstr "Экспорт значения, возвращаемого PHP функцией"
1396
 
1397
+ #: ../../views/admin/export/template/new_field_comment.php:64 ../..
1398
+ #: /views/admin/export/template/new_field_cpt.php:106 ../..
1399
+ #: /views/admin/export/template/new_field_shop_order.php:54 ../..
1400
+ #: /views/admin/export/template/new_field_user.php:78
1401
+ msgid "The value of the field chosen for export will be passed to the PHP function."
1402
+ msgstr "Значение поля, выбранного для экспорта, будет передано в PHP функцию."
1403
 
1404
+ #: ../../views/admin/export/template/new_field_comment.php:101 ../..
1405
+ #: /views/admin/export/template/new_field_cpt.php:144 ../..
1406
+ #: /views/admin/export/template/new_field_shop_order.php:91 ../..
1407
+ #: /views/admin/export/template/new_field_user.php:115 ../..
1408
+ #: /views/admin/manage/index.php:52 ../../views/admin/manage/index.php:155 ../..
1409
+ #: /views/admin/manage/index.php:356
1410
+ msgid "Delete"
1411
+ msgstr "Удалить"
1412
 
1413
+ #: ../../views/admin/export/template/new_field_comment.php:102 ../..
1414
+ #: /views/admin/export/template/new_field_cpt.php:145 ../..
1415
+ #: /views/admin/export/template/new_field_shop_order.php:92 ../..
1416
+ #: /views/admin/export/template/new_field_user.php:116
1417
+ msgid "Done"
1418
+ msgstr "Готово"
1419
 
1420
+ #: ../../views/admin/export/template/new_field_comment.php:103 ../..
1421
+ #: /views/admin/export/template/new_field_cpt.php:146 ../..
1422
+ #: /views/admin/export/template/new_field_shop_order.php:93 ../..
1423
+ #: /views/admin/export/template/new_field_user.php:117
1424
+ msgid "Close"
1425
+ msgstr "Закрыть"
1426
 
1427
+ #: ../../views/admin/export/template/new_field_cpt.php:11
1428
+ msgid "Excerpt"
1429
+ msgstr "Отрывок"
1430
 
1431
+ #: ../../views/admin/export/template/new_field_cpt.php:13
1432
+ msgid "Post Type"
1433
+ msgstr "Тип записи"
1434
 
1435
+ #: ../../views/admin/export/template/new_field_cpt.php:14
1436
+ msgid "Categories / Taxonomies"
1437
+ msgstr "Категории / Таксономии"
1438
+
1439
+ #: ../../views/admin/export/template/new_field_cpt.php:15
1440
+ msgid "Custom Field / Post Meta"
1441
+ msgstr "Пользовательские поля / Мета записи"
1442
+
1443
+ #: ../../views/admin/export/template/new_field_cpt.php:16
1444
+ msgid "Images / Media"
1445
+ msgstr "Картинки / Медиа"
1446
+
1447
+ #: ../../views/admin/export/template/new_field_cpt.php:17
1448
+ msgid "Attachment"
1449
+ msgstr "Вложение"
1450
+
1451
+ #: ../../views/admin/export/template/new_field_cpt.php:20
1452
+ msgid "Post Status"
1453
+ msgstr "Статус записи"
1454
+
1455
+ #: ../../views/admin/export/template/new_field_cpt.php:22
1456
+ msgid "Post Slug"
1457
+ msgstr "Короткое имя поста (slug)"
1458
+
1459
+ #: ../../views/admin/export/template/new_field_cpt.php:23
1460
+ msgid "Post Format"
1461
+ msgstr "Формат поста"
1462
+
1463
+ #: ../../views/admin/export/template/new_field_cpt.php:24
1464
+ msgid "Template"
1465
+ msgstr "Шаблон"
1466
+
1467
+ #: ../../views/admin/export/template/new_field_cpt.php:25
1468
+ msgid "Parent"
1469
+ msgstr "Родитель"
1470
+
1471
+ #: ../../views/admin/export/template/new_field_cpt.php:26
1472
+ msgid "Menu Order"
1473
+ msgstr "Порядок меню"
1474
+
1475
+ #: ../../views/admin/export/template/new_field_cpt.php:27
1476
+ msgid "Permalink"
1477
+ msgstr "Постоянная ссылка"
1478
+
1479
+ #: ../../views/admin/export/template/new_field_cpt.php:32
1480
+ msgid "WooCommerce Data"
1481
+ msgstr "WooCommerce данные"
1482
+
1483
+ #: ../../views/admin/export/template/new_field_cpt.php:33
1484
+ msgid "WooCommerce Taxonomies"
1485
+ msgstr "WooCommerce таксономии"
1486
+
1487
+ #: ../../views/admin/export/template/new_field_cpt.php:36
1488
+ msgid "WooCommerce Order"
1489
+ msgstr "WooCommerce заказ"
1490
+
1491
+ #: ../../views/admin/export/template/new_field_cpt.php:39 ../..
1492
+ #: /views/admin/export/template/new_field_user.php:30
1493
+ msgid "Advanced Custom Fields"
1494
+ msgstr "Дополнительные пользовательские поля (ACF)"
1495
+
1496
+ #: ../../views/admin/export/template/new_field_cpt.php:87
1497
+ msgid "Export Image URLs"
1498
+ msgstr "Экспортировать URL изображений"
1499
+
1500
+ #: ../../views/admin/export/template/new_field_cpt.php:88
1501
+ msgid "Export Image Filenames"
1502
+ msgstr "Экспортировать названия файлов изображений"
1503
+
1504
+ #: ../../views/admin/export/template/new_field_cpt.php:89
1505
+ msgid "Export Image File Paths"
1506
+ msgstr "Экспортировать пути файлов изображений"
1507
+
1508
+ #: ../../views/admin/export/template/new_field_user.php:9
1509
+ msgid "Login"
1510
+ msgstr "Логин"
1511
+
1512
+ #: ../../views/admin/export/template/new_field_user.php:10
1513
+ msgid "Email"
1514
+ msgstr "Email"
1515
+
1516
+ #: ../../views/admin/export/template/new_field_user.php:11
1517
+ msgid "First Name"
1518
+ msgstr "Имя"
1519
+
1520
+ #: ../../views/admin/export/template/new_field_user.php:12
1521
+ msgid "Last Name"
1522
+ msgstr "Фамилия"
1523
+
1524
+ #: ../../views/admin/export/template/new_field_user.php:13
1525
+ msgid "Registered Date"
1526
+ msgstr "Дата регистрации"
1527
+
1528
+ #: ../../views/admin/export/template/new_field_user.php:14
1529
+ msgid "Nicename"
1530
+ msgstr "Ник"
1531
+
1532
+ #: ../../views/admin/export/template/new_field_user.php:15
1533
+ msgid "URL"
1534
+ msgstr "URL"
1535
+
1536
+ #: ../../views/admin/export/template/new_field_user.php:16
1537
+ msgid "Display Name"
1538
+ msgstr "Отображаемое имя"
1539
+
1540
+ #: ../../views/admin/export/template/new_field_user.php:17
1541
+ msgid "Nickname"
1542
+ msgstr "Ник"
1543
+
1544
+ #: ../../views/admin/export/template/new_field_user.php:18
1545
+ msgid "Description"
1546
+ msgstr "Описание"
1547
 
1548
+ #: ../../views/admin/export/template/new_field_user.php:21
1549
+ msgid "Password"
1550
+ msgstr "Пароль"
1551
+
1552
+ #: ../../views/admin/export/template/new_field_user.php:22
1553
+ msgid "Activation Key"
1554
+ msgstr "Код активации"
1555
+
1556
+ #: ../../views/admin/export/template/new_field_user.php:23
1557
+ msgid "Status"
1558
+ msgstr "Статус"
1559
+
1560
+ #: ../../views/admin/export/template/new_field_user.php:24
1561
+ msgid "Roles"
1562
+ msgstr "Роли"
1563
+
1564
+ #: ../../views/admin/export/template/new_field_user.php:25
1565
+ msgid "Custom Field / User Meta"
1566
+ msgstr "Пользовательское поле / Пользовательские Meta"
1567
+
1568
+ #: ../../views/admin/help/index.php:1
1569
+ msgid "WP All Export Support"
1570
+ msgstr "WP All Export поддержка"
1571
+
1572
+ #: ../../views/admin/manage/bulk.php:10
1573
+ #, php-format
1574
+ msgid "Are you sure you want to delete <strong>%s</strong> selected %s?"
1575
+ msgstr "Вы уверены, что хотите удалить <strong>%s</strong> выбранные %s?"
1576
+
1577
+ #: ../../views/admin/manage/delete.php:1
1578
+ msgid "Delete Export"
1579
+ msgstr "Удалить экспорт"
1580
+
1581
+ #: ../../views/admin/manage/delete.php:4
1582
+ #, php-format
1583
+ msgid "Are you sure you want to delete <strong>%s</strong> export?"
1584
+ msgstr "Вы уверены, что хотите удалить <strong>%s</strong> экспорт?"
1585
+
1586
+ #: ../../views/admin/manage/index.php:18 ../../views/admin/manage/index.php:20
1587
+ msgid "Search Exports"
1588
+ msgstr "Поиск экспортов"
1589
+
1590
+ #: ../../views/admin/manage/index.php:28
1591
+ msgid "Name"
1592
+ msgstr "Название"
1593
+
1594
+ #: ../../views/admin/manage/index.php:30
1595
+ msgid "Query"
1596
+ msgstr "Запрос"
1597
+
1598
+ #: ../../views/admin/manage/index.php:32
1599
+ msgid "Summary"
1600
+ msgstr "Итого"
1601
+
1602
+ #: ../../views/admin/manage/index.php:34
1603
+ msgid "Info & Options"
1604
+ msgstr "Инфо и Опции"
1605
+
1606
+ #: ../../views/admin/manage/index.php:51 ../../views/admin/manage/index.php:354
1607
+ msgid "Bulk Actions"
1608
+ msgstr "Массовое действие"
1609
+
1610
+ #: ../../views/admin/manage/index.php:54 ../../views/admin/manage/index.php:362
1611
+ msgid "Apply"
1612
+ msgstr "Принять"
1613
+
1614
+ #: ../../views/admin/manage/index.php:60
1615
+ #, php-format
1616
+ msgid "Displaying %s&#8211;%s of %s"
1617
+ msgstr "Отображение %s&#8211;%s из %s"
1618
+
1619
+ #: ../../views/admin/manage/index.php:104
1620
+ msgid "No previous exports found."
1621
+ msgstr "Предыдущие экспорты не найдены."
1622
+
1623
+ #: ../../views/admin/manage/index.php:134 ../../views/admin/manage/update.php:195
1624
+ msgid "Edit Template"
1625
+ msgstr "Редактировать шаблон"
1626
+
1627
+ #: ../../views/admin/manage/index.php:135
1628
+ msgid "Edit Options"
1629
+ msgstr "Редактировать опции"
1630
+
1631
+ #: ../../views/admin/manage/index.php:163 ../../views/admin/manage/scheduling.php:2
1632
+ msgid "Cron Scheduling"
1633
+ msgstr "Планирование Cron"
1634
+
1635
+ #: ../../views/admin/manage/index.php:207
1636
+ msgid "Import with WP All Import"
1637
+ msgstr "Импорт с WP All Import"
1638
+
1639
+ #: ../../views/admin/manage/index.php:217 ../../views/admin/manage/templates.php:2
1640
+ msgid "Download Import Templates"
1641
+ msgstr "Загрузить шаблоны импорта"
1642
+
1643
+ #: ../../views/admin/manage/index.php:246
1644
+ msgid "Y/m/d g:i a"
1645
+ msgstr "Г/м/д g:i a"
1646
+
1647
+ #: ../../views/admin/manage/index.php:256
1648
+ msgid "triggered with cron"
1649
+ msgstr "запускается с помощью cron"
1650
+
1651
+ #: ../../views/admin/manage/index.php:263 ../../views/admin/manage/index.php:278 .
1652
+ #: ./../views/admin/manage/index.php:292
1653
+ #, php-format
1654
  msgid "last activity %s ago"
1655
  msgstr "последняя активность %s назад"
1656
 
1657
+ #: ../../views/admin/manage/index.php:270
1658
+ msgid "currently processing with cron"
1659
+ msgstr "в настоящее время обработка с помощью cron"
1660
 
1661
+ #: ../../views/admin/manage/index.php:285
1662
+ msgid "Export currently in progress"
1663
+ msgstr "Экспорт в процессе в настоящее время"
1664
+
1665
+ #: ../../views/admin/manage/index.php:299
1666
+ #, php-format
1667
+ msgid "Export Attempt at %s"
1668
+ msgstr "Попытка экспорта в %s"
1669
 
1670
+ #: ../../views/admin/manage/index.php:303
1671
+ #, php-format
1672
+ msgid "Last run: %s"
1673
+ msgstr "Последний запуск: %s"
1674
+
1675
+ #: ../../views/admin/manage/index.php:303
1676
  msgid "never"
1677
  msgstr "никогда"
1678
 
1679
+ #: ../../views/admin/manage/index.php:304
1680
+ #, php-format
1681
+ msgid "%d Records Exported"
1682
+ msgstr "%d записей экспортировано"
 
1683
 
1684
+ #: ../../views/admin/manage/index.php:305
1685
+ #, php-format
1686
+ msgid "Format: %s"
1687
+ msgstr "Формат: %s"
1688
 
1689
+ #: ../../views/admin/manage/index.php:311
1690
  msgid "settings edited since last run"
1691
  msgstr "параметры изменены с момента последнего запуска"
1692
 
1693
+ #: ../../views/admin/manage/index.php:323
1694
+ msgid "Edit"
1695
+ msgstr "Редактировать"
1696
+
1697
+ #: ../../views/admin/manage/index.php:324
1698
+ msgid "Run Export"
1699
+ msgstr "Запустить экспорт"
1700
+
1701
+ #: ../../views/admin/manage/index.php:326
1702
+ msgid "Cancel Cron"
1703
+ msgstr "Отменить Cron"
1704
+
1705
+ #: ../../views/admin/manage/index.php:328
1706
+ msgid "Cancel"
1707
+ msgstr "Отменить"
1708
+
1709
+ #: ../../views/admin/manage/index.php:358
1710
+ msgid "Restore"
1711
+ msgstr "Восстановить"
1712
+
1713
+ #: ../../views/admin/manage/index.php:359
1714
+ msgid "Delete Permanently"
1715
+ msgstr "Удалить навсегда"
1716
+
1717
+ #: ../../views/admin/manage/scheduling.php:17
1718
+ msgid "Export File URL"
1719
+ msgstr "Экспортировать URL файла"
1720
+
1721
+ #: ../../views/admin/manage/scheduling.php:25
1722
+ msgid "Trigger Script"
1723
+ msgstr "Скрипт триггера"
1724
+
1725
+ #: ../../views/admin/manage/scheduling.php:31 ../../views/admin/manage/scheduling.
1726
+ #: php:43
1727
+ msgid "Example:"
1728
+ msgstr "Пример:"
1729
+
1730
+ #: ../../views/admin/manage/scheduling.php:35
1731
+ msgid "Execution Script"
1732
+ msgstr "Скрипт исполнения"
1733
+
1734
+ #: ../../views/admin/manage/scheduling.php:47
1735
+ msgid "Notes"
1736
+ msgstr "Примечания"
1737
+
1738
+ #: ../../views/admin/manage/scheduling.php:50
1739
+ msgid ""
1740
+ "Your web host may require you to use a command other than wget, although "
1741
+ "wget is most common. In this case, you must asking your web hosting provider "
1742
+ "for help."
1743
+ msgstr ""
1744
+ "Ваш провайдер может требовать использования команды, отличной от wget, хотя "
1745
+ "wget является наиболее распространенной. В этом случае, Вы должны обратиться "
1746
+ "за помощью к Вашему провайдеру."
1747
+
1748
+ #: ../../views/admin/manage/templates.php:6
1749
+ msgid ""
1750
+ "Download your import templates and use them to import your exported file to "
1751
+ "a separate WordPress/WP All Import installation."
1752
+ msgstr ""
1753
+ "Загрузите свои шаблоны импорта и используйте их, чтобы импортировать Ваш "
1754
+ "экспортируемый файл на другой сайт WordPress."
1755
+
1756
+ #: ../../views/admin/manage/templates.php:10
1757
+ msgid ""
1758
+ "Install these import templates in your separate WP All Import installation "
1759
+ "from the All Import -> Settings page by clicking the \"Import Templates\" "
1760
+ "button."
1761
+ msgstr ""
1762
+ "Установите эти шаблоны импорта на отдельном сайте с помощью WP All Import из "
1763
+ "All Import -> Страница настроек, нажав на \"Импорт шаблонов\"."
1764
+
1765
+ #: ../../views/admin/settings/index.php:49
1766
+ msgid "Cron Exports"
1767
+ msgstr "Cron экспорт"
1768
+
1769
+ #: ../../views/admin/settings/index.php:54
1770
+ msgid "Secret Key"
1771
+ msgstr "Секретный ключ"
1772
+
1773
+ #: ../../views/admin/settings/index.php:57
1774
+ msgid "Changing this will require you to re-create your existing cron jobs."
1775
+ msgstr "Изменение этого потребует пересоздать существующие задания cron."
1776
+
1777
+ #: ../../views/admin/settings/index.php:65
1778
+ msgid "Files"
1779
+ msgstr "Файлы"
1780
+
1781
+ #: ../../views/admin/settings/index.php:70 ../../views/admin/settings/index.php:73
1782
+ msgid "Secure Mode"
1783
+ msgstr "Безопасный режим"
1784
+
1785
+ #: ../../views/admin/settings/index.php:75
1786
+ msgid "Randomize folder names"
1787
+ msgstr "Случайные имена папок"
libraries/XmlCsvExport.php ADDED
@@ -0,0 +1,717 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ final Class XmlCsvExport
4
+ {
5
+ /**
6
+ * Singletone instance
7
+ * @var XmlCsvExport
8
+ */
9
+ protected static $instance;
10
+
11
+ /**
12
+ * Return singletone instance
13
+ * @return XmlCsvExport
14
+ */
15
+ static public function getInstance() {
16
+ if ( self::$instance == NULL ) {
17
+ self::$instance = new self();
18
+ }
19
+ return self::$instance;
20
+ }
21
+
22
+ private function __construct(){}
23
+
24
+ public static function export()
25
+ {
26
+ switch ( XmlExportEngine::$exportOptions['export_to'] )
27
+ {
28
+ case 'xml':
29
+ self::export_xml();
30
+ break;
31
+
32
+ case 'csv':
33
+ self::export_csv();
34
+ break;
35
+
36
+ default:
37
+ # code...
38
+ break;
39
+ }
40
+ }
41
+
42
+ public static function export_csv( $preview = false, $is_cron = false, $file_path = false, $exported_by_cron = 0 )
43
+ {
44
+ ob_start();
45
+
46
+ $stream = fopen("php://output", 'w');
47
+
48
+ $headers = array();
49
+ $woo = array();
50
+ $woo_order = array();
51
+ $acfs = array();
52
+ $taxes = array();
53
+ $attributes = array();
54
+ $articles = array();
55
+
56
+ $implode_delimiter = (XmlExportEngine::$exportOptions['delimiter'] == ',') ? '|' : ',';
57
+
58
+ // [ Exporting requested data ]
59
+
60
+ if ( XmlExportEngine::$is_user_export ) // exporting WordPress users
61
+ {
62
+ foreach ( XmlExportEngine::$exportQuery->results as $user ) :
63
+ $articles[] = XmlExportUser::prepare_data( $user, false, $acfs, $implode_delimiter, $preview );
64
+ $articles = apply_filters('wp_all_export_csv_rows', $articles, XmlExportEngine::$exportOptions, XmlExportEngine::$exportID);
65
+ if ($preview) break;
66
+ do_action('pmxe_exported_post', $user->ID, XmlExportEngine::$exportRecord );
67
+ endforeach;
68
+ }
69
+ elseif ( XmlExportEngine::$is_comment_export ) // exporting comments
70
+ {
71
+ global $wp_version;
72
+
73
+ if ( version_compare($wp_version, '4.2.0', '>=') )
74
+ {
75
+ $comments = XmlExportEngine::$exportQuery->get_comments();
76
+ }
77
+ else
78
+ {
79
+ $comments = XmlExportEngine::$exportQuery;
80
+ }
81
+
82
+ foreach ( $comments as $comment ) :
83
+ $articles[] = XmlExportComment::prepare_data( $comment, false, $implode_delimiter, $preview );
84
+ $articles = apply_filters('wp_all_export_csv_rows', $articles, XmlExportEngine::$exportOptions, XmlExportEngine::$exportID);
85
+ if ($preview) break;
86
+ do_action('pmxe_exported_post', $comment->comment_ID, XmlExportEngine::$exportRecord );
87
+ endforeach;
88
+ }
89
+ else // exporting custom post types
90
+ {
91
+ while ( XmlExportEngine::$exportQuery->have_posts() ) :
92
+ XmlExportEngine::$exportQuery->the_post();
93
+ $record = get_post( get_the_ID() );
94
+ $articles[] = XmlExportCpt::prepare_data( $record, false, $acfs, $woo, $woo_order, $implode_delimiter, $preview );
95
+ $articles = apply_filters('wp_all_export_csv_rows', $articles, XmlExportEngine::$exportOptions, XmlExportEngine::$exportID);
96
+ if ($preview) break;
97
+ do_action('pmxe_exported_post', $record->ID, XmlExportEngine::$exportRecord );
98
+ endwhile;
99
+ wp_reset_postdata();
100
+ }
101
+ // [ \Exporting requested data ]
102
+
103
+ // [ Prepare CSV headers ]
104
+ if (XmlExportEngine::$exportOptions['ids']):
105
+
106
+ foreach (XmlExportEngine::$exportOptions['ids'] as $ID => $value)
107
+ {
108
+ if ( empty(XmlExportEngine::$exportOptions['cc_name'][$ID]) or empty(XmlExportEngine::$exportOptions['cc_type'][$ID]) or ! is_numeric($ID) ) continue;
109
+
110
+ self::prepare_csv_headers( $headers, $ID, $taxes, $attributes, $acfs );
111
+ }
112
+
113
+ endif;
114
+
115
+ if ($is_cron)
116
+ {
117
+ if ( ! $exported_by_cron )
118
+ {
119
+ fputcsv($stream, array_map(array('XmlCsvExport', '_get_valid_header_name'), $headers), XmlExportEngine::$exportOptions['delimiter']);
120
+ }
121
+ else
122
+ {
123
+ self::merge_headers( $file_path, $headers );
124
+ }
125
+ }
126
+ else
127
+ {
128
+ if ($preview or empty(PMXE_Plugin::$session->file))
129
+ {
130
+ fputcsv($stream, array_map(array('XmlCsvExport', '_get_valid_header_name'), $headers), XmlExportEngine::$exportOptions['delimiter']);
131
+ }
132
+ else
133
+ {
134
+ self::merge_headers( PMXE_Plugin::$session->file, $headers );
135
+ }
136
+ }
137
+ // [ \Prepare CSV headers ]
138
+
139
+ foreach ($articles as $article) {
140
+ $line = array();
141
+ foreach ($headers as $header) {
142
+ $line[$header] = ( isset($article[$header]) ) ? $article[$header] : '';
143
+ }
144
+ fputcsv($stream, $line, XmlExportEngine::$exportOptions['delimiter']);
145
+ }
146
+
147
+ if ($preview) return ob_get_clean();
148
+
149
+ return self::save_csv_to_file( $file_path, $is_cron, $exported_by_cron );
150
+
151
+ }
152
+
153
+ public static $main_xml_tag = '';
154
+ public static $node_xml_tag = '';
155
+ public static function export_xml( $preview = false, $is_cron = false, $file_path = false, $exported_by_cron = 0 )
156
+ {
157
+ require_once PMXE_ROOT_DIR . '/classes/XMLWriter.php';
158
+
159
+ $woo = array();
160
+ $woo_order = array();
161
+ $acfs = array();
162
+ $taxes = array();
163
+ $attributes = array();
164
+
165
+ self::$main_xml_tag = apply_filters('wp_all_export_main_xml_tag', XmlExportEngine::$exportOptions['main_xml_tag'], XmlExportEngine::$exportID);
166
+ self::$node_xml_tag = apply_filters('wp_all_export_record_xml_tag', XmlExportEngine::$exportOptions['record_xml_tag'], XmlExportEngine::$exportID);
167
+
168
+ $implode_delimiter = (XmlExportEngine::$exportOptions['delimiter'] == ',') ? '|' : ',';
169
+
170
+ $xmlWriter = new PMXE_XMLWriter();
171
+ $xmlWriter->openMemory();
172
+ $xmlWriter->setIndent(true);
173
+ $xmlWriter->setIndentString("\t");
174
+ $xmlWriter->startDocument('1.0', XmlExportEngine::$exportOptions['encoding']);
175
+ $xmlWriter->startElement(self::$main_xml_tag);
176
+
177
+ // add additional data after XML root element
178
+ self::xml_header( $xmlWriter, $is_cron, $exported_by_cron );
179
+
180
+ // [ Exporting requested data ]
181
+
182
+ if ( XmlExportEngine::$is_user_export ) // exporting WordPress users
183
+ {
184
+ foreach ( XmlExportEngine::$exportQuery->results as $user ) :
185
+
186
+ $is_export_record = apply_filters('wp_all_export_xml_rows', true, $user, XmlExportEngine::$exportOptions, XmlExportEngine::$exportID);
187
+
188
+ if ( ! $is_export_record ) continue;
189
+
190
+ // add additional information before each node
191
+ self::before_xml_node( $xmlWriter, $user->ID);
192
+
193
+ $xmlWriter->startElement(self::$node_xml_tag);
194
+
195
+ XmlExportUser::prepare_data( $user, $xmlWriter, $acfs, $implode_delimiter, $preview );
196
+
197
+ $xmlWriter->endElement(); // end post
198
+
199
+ // add additional information after each node
200
+ self::after_xml_node( $xmlWriter, $user->ID);
201
+
202
+ if ($preview) break;
203
+
204
+ do_action('pmxe_exported_post', $user->ID, XmlExportEngine::$exportRecord );
205
+
206
+ endforeach;
207
+
208
+ }
209
+ elseif ( XmlExportEngine::$is_comment_export ) // exporting comments
210
+ {
211
+ global $wp_version;
212
+
213
+ if ( version_compare($wp_version, '4.2.0', '>=') )
214
+ {
215
+ $comments = XmlExportEngine::$exportQuery->get_comments();
216
+ }
217
+ else
218
+ {
219
+ $comments = XmlExportEngine::$exportQuery;
220
+ }
221
+
222
+ foreach ( $comments as $comment ) :
223
+
224
+ $is_export_record = apply_filters('wp_all_export_xml_rows', true, $comment, XmlExportEngine::$exportOptions, XmlExportEngine::$exportID);
225
+
226
+ if ( ! $is_export_record ) continue;
227
+
228
+ // add additional information before each node
229
+ self::before_xml_node( $xmlWriter, $comment->comment_ID);
230
+
231
+ $xmlWriter->startElement(self::$node_xml_tag);
232
+
233
+ XmlExportComment::prepare_data( $comment, $xmlWriter, $implode_delimiter, $preview );
234
+
235
+ $xmlWriter->endElement(); // end post
236
+
237
+ // add additional information after each node
238
+ self::after_xml_node( $xmlWriter, $comment->comment_ID);
239
+
240
+ if ($preview) break;
241
+
242
+ do_action('pmxe_exported_post', $comment->comment_ID, XmlExportEngine::$exportRecord );
243
+
244
+ endforeach;
245
+ }
246
+ else // exporting custom post types
247
+ {
248
+ while ( XmlExportEngine::$exportQuery->have_posts() ) :
249
+
250
+ XmlExportEngine::$exportQuery->the_post();
251
+
252
+ $record = get_post( get_the_ID() );
253
+
254
+ $is_export_record = apply_filters('wp_all_export_xml_rows', true, $record, XmlExportEngine::$exportOptions, XmlExportEngine::$exportID);
255
+
256
+ if ( ! $is_export_record ) continue;
257
+
258
+ // add additional information before each node
259
+ self::before_xml_node( $xmlWriter, $record->ID);
260
+
261
+ $xmlWriter->startElement(self::$node_xml_tag);
262
+
263
+ XmlExportCpt::prepare_data( $record, $xmlWriter, $acfs, $woo, $woo_order, $implode_delimiter, $preview );
264
+
265
+ $xmlWriter->endElement(); // end post
266
+
267
+ // add additional information after each node
268
+ self::after_xml_node( $xmlWriter, $record->ID);
269
+
270
+ if ($preview) break;
271
+
272
+ do_action('pmxe_exported_post', $record->ID, XmlExportEngine::$exportRecord );
273
+
274
+ endwhile;
275
+ wp_reset_postdata();
276
+ }
277
+ // [ \Exporting requested data ]
278
+
279
+ $xmlWriter->endElement(); // close root XML element
280
+
281
+ if ($preview) return $xmlWriter->flush(true);
282
+
283
+ return self::save_xml_to_file( $xmlWriter, $file_path, $is_cron, $exported_by_cron );
284
+
285
+ }
286
+
287
+ // [ XML Export Helpers ]
288
+ private static function xml_header($xmlWriter, $is_cron, $exported_by_cron)
289
+ {
290
+ if ($is_cron)
291
+ {
292
+ if ( ! $exported_by_cron )
293
+ {
294
+ $additional_data = apply_filters('wp_all_export_additional_data', array(), XmlExportEngine::$exportOptions, XmlExportEngine::$exportID);
295
+
296
+ if ( ! empty($additional_data))
297
+ {
298
+ foreach ($additional_data as $key => $value)
299
+ {
300
+ $xmlWriter->startElement(preg_replace('/[^a-z0-9_-]/i', '', $key));
301
+ $xmlWriter->writeData($value);
302
+ $xmlWriter->endElement();
303
+ }
304
+ }
305
+ }
306
+ }
307
+ else
308
+ {
309
+
310
+ if ( empty(PMXE_Plugin::$session->file) ){
311
+
312
+ $additional_data = apply_filters('wp_all_export_additional_data', array(), XmlExportEngine::$exportOptions, XmlExportEngine::$exportID);
313
+
314
+ if ( ! empty($additional_data))
315
+ {
316
+ foreach ($additional_data as $key => $value)
317
+ {
318
+ $xmlWriter->startElement(preg_replace('/[^a-z0-9_-]/i', '', $key));
319
+ $xmlWriter->writeData($value);
320
+ $xmlWriter->endElement();
321
+ }
322
+ }
323
+ }
324
+ }
325
+ }
326
+
327
+ private static function before_xml_node( $xmlWriter, $pid )
328
+ {
329
+ $add_before_node = apply_filters('wp_all_export_add_before_node', array(), XmlExportEngine::$exportOptions, XmlExportEngine::$exportID, $pid);
330
+
331
+ if ( ! empty($add_before_node))
332
+ {
333
+ foreach ($add_before_node as $key => $value)
334
+ {
335
+ $xmlWriter->startElement(preg_replace('/[^a-z0-9_-]/i', '', $key));
336
+ $xmlWriter->writeData($value);
337
+ $xmlWriter->endElement();
338
+ }
339
+ }
340
+ }
341
+
342
+ private static function after_xml_node( $xmlWriter, $pid )
343
+ {
344
+ $add_after_node = apply_filters('wp_all_export_add_after_node', array(), XmlExportEngine::$exportOptions, XmlExportEngine::$exportID, $pid);
345
+
346
+ if ( ! empty($add_after_node))
347
+ {
348
+ foreach ($add_after_node as $key => $value)
349
+ {
350
+ $xmlWriter->startElement(preg_replace('/[^a-z0-9_-]/i', '', $key));
351
+ $xmlWriter->writeData($value);
352
+ $xmlWriter->endElement();
353
+ }
354
+ }
355
+ }
356
+
357
+ private static function save_xml_to_file( $xmlWriter, $file_path, $is_cron, $exported_by_cron )
358
+ {
359
+ if ($is_cron)
360
+ {
361
+ $xml_header = apply_filters('wp_all_export_xml_header', '<?xml version="1.0" encoding="UTF-8"?>', XmlExportEngine::$exportID);
362
+
363
+ $xml = str_replace('<?xml version="1.0" encoding="UTF-8"?>', $xml_header, $xmlWriter->flush(true));
364
+
365
+ if ( ! $exported_by_cron )
366
+ {
367
+ // The BOM will help some programs like Microsoft Excel read your export file if it includes non-English characters.
368
+ if (XmlExportEngine::$exportOptions['include_bom'])
369
+ {
370
+ file_put_contents($file_path, chr(0xEF).chr(0xBB).chr(0xBF).substr($xml, 0, (strlen(self::$main_xml_tag) + 4) * (-1)));
371
+ }
372
+ else
373
+ {
374
+ file_put_contents($file_path, substr($xml, 0, (strlen(self::$main_xml_tag) + 4) * (-1)));
375
+ }
376
+ }
377
+ else
378
+ {
379
+ file_put_contents($file_path, substr(substr($xml, 41 + strlen(self::$main_xml_tag)), 0, (strlen(self::$main_xml_tag) + 4) * (-1)), FILE_APPEND);
380
+ }
381
+
382
+ return $file_path;
383
+
384
+ }
385
+ else
386
+ {
387
+
388
+ if ( empty(PMXE_Plugin::$session->file) ){
389
+
390
+ // generate export file name
391
+ $export_file = wp_all_export_generate_export_file( XmlExportEngine::$exportID );
392
+
393
+ $xml_header = apply_filters('wp_all_export_xml_header', '<?xml version="1.0" encoding="UTF-8"?>', XmlExportEngine::$exportID);
394
+
395
+ $xml = str_replace('<?xml version="1.0" encoding="UTF-8"?>', $xml_header, $xmlWriter->flush(true));
396
+
397
+ // The BOM will help some programs like Microsoft Excel read your export file if it includes non-English characters.
398
+ if (XmlExportEngine::$exportOptions['include_bom'])
399
+ {
400
+ file_put_contents($export_file, chr(0xEF).chr(0xBB).chr(0xBF).substr($xml, 0, (strlen(self::$main_xml_tag) + 4) * (-1)));
401
+ }
402
+ else
403
+ {
404
+ file_put_contents($export_file, substr($xml, 0, (strlen(self::$main_xml_tag) + 4) * (-1)));
405
+ }
406
+
407
+ PMXE_Plugin::$session->set('file', $export_file);
408
+
409
+ PMXE_Plugin::$session->save_data();
410
+
411
+ }
412
+ else
413
+ {
414
+ file_put_contents(PMXE_Plugin::$session->file, substr(substr($xmlWriter->flush(true), 41 + strlen(self::$main_xml_tag)), 0, (strlen(self::$main_xml_tag) + 4) * (-1)), FILE_APPEND);
415
+ }
416
+
417
+ return true;
418
+
419
+ }
420
+ }
421
+ // [ \XML Export Helpers ]
422
+
423
+ // [ CSV Export Helpers ]
424
+ public static function prepare_csv_headers( & $headers, $ID, & $taxes, & $attributes, & $acfs )
425
+ {
426
+ $element_name = ( ! empty(XmlExportEngine::$exportOptions['cc_name'][$ID]) ) ? XmlExportEngine::$exportOptions['cc_name'][$ID] : 'untitled_' . $ID;
427
+
428
+ if ( strpos(XmlExportEngine::$exportOptions['cc_label'][$ID], "item_data__") !== false )
429
+ {
430
+ XmlExportEngine::$woo_order_export->get_element_header( $headers, XmlExportEngine::$exportOptions, $ID );
431
+ return;
432
+ }
433
+
434
+ switch (XmlExportEngine::$exportOptions['cc_type'][$ID])
435
+ {
436
+ case 'woo':
437
+
438
+ XmlExportEngine::$woo_export->get_element_header( $headers, XmlExportEngine::$exportOptions, $ID );
439
+
440
+ break;
441
+
442
+ case 'woo_order':
443
+
444
+ XmlExportEngine::$woo_order_export->get_element_header( $headers, XmlExportEngine::$exportOptions, $ID );
445
+
446
+ break;
447
+
448
+ case 'acf':
449
+
450
+ if ( ! empty($acfs) )
451
+ {
452
+ $single_acf_field = array_shift($acfs);
453
+
454
+ if ( is_array($single_acf_field))
455
+ {
456
+ foreach ($single_acf_field as $acf_header) {
457
+ if ( ! in_array($acf_header, $headers)) $headers[] = $acf_header;
458
+ }
459
+ }
460
+ else
461
+ {
462
+ if ( ! in_array($single_acf_field, $headers)) $headers[] = $single_acf_field;
463
+ }
464
+ }
465
+
466
+ break;
467
+
468
+ default:
469
+
470
+ if ($element_name == 'ID') $element_name = 'id';
471
+
472
+ if ( ! in_array($element_name, $headers))
473
+ {
474
+ $headers[] = $element_name;
475
+ }
476
+ else
477
+ {
478
+ $is_added = false;
479
+ $i = 0;
480
+ do
481
+ {
482
+ $new_element_name = $element_name . '_' . md5($i);
483
+
484
+ if ( ! in_array($new_element_name, $headers) )
485
+ {
486
+ $headers[] = $new_element_name;
487
+ $is_added = true;
488
+ }
489
+
490
+ $i++;
491
+ }
492
+ while ( ! $is_added );
493
+ }
494
+
495
+ if ( XmlExportEngine::$exportOptions['cc_label'][$ID] == 'product_type' and ! in_array('parent_id', $headers)) $headers[] = 'parent_id';
496
+
497
+ break;
498
+ }
499
+
500
+ }
501
+
502
+ public static function _get_valid_header_name( $element_name )
503
+ {
504
+ $element_name_parts = explode("_", $element_name);
505
+
506
+ $elementIndex = array_pop($element_name_parts);
507
+
508
+ if (wp_all_export_isValidMd5($elementIndex))
509
+ {
510
+ $element_name_in_file = str_replace("_" . $elementIndex, "", $element_name);
511
+ }
512
+ else
513
+ {
514
+ $element_name_in_file = $element_name;
515
+ }
516
+
517
+ return $element_name_in_file;
518
+ }
519
+
520
+
521
+ public static function merge_headers( $file, &$headers )
522
+ {
523
+
524
+ $in = fopen($file, 'r');
525
+
526
+ $clear_old_headers = fgetcsv($in);
527
+
528
+ fclose($in);
529
+
530
+ $old_headers = array();
531
+
532
+ foreach ($clear_old_headers as $i => $header)
533
+ {
534
+ $header = str_replace("'", "", str_replace('"', "", str_replace(chr(0xEF).chr(0xBB).chr(0xBF), "", $header)));
535
+
536
+ if ( ! in_array($header, $old_headers))
537
+ {
538
+ $old_headers[] = $header;
539
+ }
540
+ else
541
+ {
542
+ $is_added = false;
543
+ $i = 0;
544
+ do
545
+ {
546
+ $new_element_name = $header . '_' . md5($i);
547
+
548
+ if ( ! in_array($new_element_name, $old_headers) )
549
+ {
550
+ $old_headers[] = $new_element_name;
551
+ $is_added = true;
552
+ }
553
+
554
+ $i++;
555
+ }
556
+ while ( ! $is_added );
557
+ }
558
+ }
559
+
560
+ $is_update_headers = false;
561
+ foreach ($headers as $header)
562
+ {
563
+ if ( ! in_array($header, $old_headers))
564
+ {
565
+ $is_update_headers = true;
566
+ break;
567
+ }
568
+ }
569
+
570
+ if ($is_update_headers)
571
+ {
572
+
573
+ $headers = $old_headers + $headers;
574
+
575
+ $tmp_file = str_replace(basename($file), 'iteration_' . basename($file), $file);
576
+
577
+ copy($file, $tmp_file);
578
+
579
+ $in = fopen($tmp_file, 'r');
580
+
581
+ $out = fopen($file, 'w');
582
+
583
+ if ( XmlExportEngine::$exportOptions['include_bom'] )
584
+ {
585
+ fputcsv($out, chr(0xEF).chr(0xBB).chr(0xBF) . array_map(array('XmlCsvExport', '_get_valid_header_name'), $headers));
586
+ }
587
+ else
588
+ {
589
+ fputcsv($out, array_map(array('XmlCsvExport', '_get_valid_header_name'), $headers));
590
+ }
591
+
592
+ $exclude_old_headers = fgetcsv($in);
593
+
594
+ while ( ! feof($in) ) {
595
+ $data = fgetcsv($in, 0, XmlExportEngine::$exportOptions['delimiter']);
596
+ if ( empty($data) ) continue;
597
+ $data_assoc = array_combine($old_headers, array_values($data));
598
+ $line = array();
599
+ foreach ($headers as $header) {
600
+ $line[$header] = ( isset($data_assoc[$header]) ) ? $data_assoc[$header] : '';
601
+ }
602
+ fputcsv($out, $line, XmlExportEngine::$exportOptions['delimiter']);
603
+ }
604
+ fclose($in);
605
+ fclose($out);
606
+ @unlink($tmp_file);
607
+ }
608
+ }
609
+
610
+ private static function save_csv_to_file( $file_path, $is_cron, $exported_by_cron )
611
+ {
612
+ if ($is_cron)
613
+ {
614
+ if ( ! $exported_by_cron )
615
+ {
616
+ // The BOM will help some programs like Microsoft Excel read your export file if it includes non-English characters.
617
+ if (XmlExportEngine::$exportOptions['include_bom'])
618
+ {
619
+ file_put_contents($file_path, chr(0xEF).chr(0xBB).chr(0xBF).ob_get_clean());
620
+ }
621
+ else
622
+ {
623
+ file_put_contents($file_path, ob_get_clean());
624
+ }
625
+ }
626
+ else
627
+ {
628
+ file_put_contents($file_path, ob_get_clean(), FILE_APPEND);
629
+ }
630
+
631
+ return $file_path;
632
+
633
+ }
634
+ else
635
+ {
636
+ if ( empty(PMXE_Plugin::$session->file) ){
637
+
638
+ // generate export file name
639
+ $export_file = wp_all_export_generate_export_file( XmlExportEngine::$exportID );
640
+
641
+ // The BOM will help some programs like Microsoft Excel read your export file if it includes non-English characters.
642
+ if (XmlExportEngine::$exportOptions['include_bom'])
643
+ {
644
+ file_put_contents($export_file, chr(0xEF).chr(0xBB).chr(0xBF).ob_get_clean());
645
+ }
646
+ else
647
+ {
648
+ file_put_contents($export_file, ob_get_clean());
649
+ }
650
+
651
+ PMXE_Plugin::$session->set('file', $export_file);
652
+
653
+ PMXE_Plugin::$session->save_data();
654
+
655
+ }
656
+ else
657
+ {
658
+ file_put_contents(PMXE_Plugin::$session->file, ob_get_clean(), FILE_APPEND);
659
+ }
660
+
661
+ return true;
662
+ }
663
+ }
664
+ // [ \CSV Export Helpers ]
665
+
666
+ public static function auto_genetate_export_fields( $post, $errors = false )
667
+ {
668
+ $errors or $errors = new WP_Error();
669
+
670
+ remove_all_filters( "wp_all_export_init_fields", 10 );
671
+ remove_all_filters( "wp_all_export_default_fields", 10 );
672
+ remove_all_filters( "wp_all_export_other_fields", 10 );
673
+ remove_all_filters( "wp_all_export_available_sections", 10 );
674
+ remove_all_filters( "wp_all_export_available_data", 10 );
675
+
676
+ $engine = new XmlExportEngine($post, $errors);
677
+ $engine->init_additional_data();
678
+
679
+ $auto_generate = array(
680
+ 'ids' => array(),
681
+ 'cc_label' => array(),
682
+ 'cc_php' => array(),
683
+ 'cc_code' => array(),
684
+ 'cc_sql' => array(),
685
+ 'cc_type' => array(),
686
+ 'cc_options' => array(),
687
+ 'cc_value' => array(),
688
+ 'cc_name' => array()
689
+ );
690
+
691
+ $available_data = $engine->init_available_data();
692
+ $available_sections = apply_filters("wp_all_export_available_sections", $engine->get('available_sections'));
693
+
694
+ foreach ($available_sections as $slug => $section)
695
+ {
696
+ if ( ! empty($section['content']) and ! empty($available_data[$section['content']]))
697
+ {
698
+ foreach ($available_data[$section['content']] as $field)
699
+ {
700
+ if (isset($field['auto']) or ! in_array('product', $post['cpt']) )
701
+ {
702
+ $auto_generate['ids'][] = 1;
703
+ $auto_generate['cc_label'][] = is_array($field) ? $field['label'] : $field;
704
+ $auto_generate['cc_php'][] = 0;
705
+ $auto_generate['cc_code'][] = '';
706
+ $auto_generate['cc_sql'][] = '';
707
+ $auto_generate['cc_type'][] = is_array($field) ? $field['type'] : $slug;
708
+ $auto_generate['cc_options'][] = '';
709
+ $auto_generate['cc_value'][] = is_array($field) ? $field['label'] : $field;
710
+ $auto_generate['cc_name'][] = is_array($field) ? $field['name'] : $field;
711
+ }
712
+ }
713
+ }
714
+ }
715
+ return $auto_generate;
716
+ }
717
+ }
libraries/XmlExportACF.php CHANGED
@@ -1,33 +1,16 @@
1
  <?php
2
 
3
- if ( ! class_exists('XmlExportACF') ){
4
-
5
  final class XmlExportACF
6
- {
7
-
8
- /**
9
- * Singletone instance
10
- * @var XmlExportACF
11
- */
12
- protected static $instance;
13
-
14
- /**
15
- * Return singletone instance
16
- * @return XmlExportACF
17
- */
18
- static public function getInstance() {
19
- if (self::$instance == NULL) {
20
- self::$instance = new self();
21
- }
22
- return self::$instance;
23
- }
24
-
25
  private $_existing_acf_meta_keys = array();
26
 
27
  private $_acf_groups = array();
28
 
29
- private function __construct() {
30
-
 
31
  }
32
 
33
  public function init( & $existing_meta_keys = array() ){
@@ -206,19 +189,700 @@ if ( ! class_exists('XmlExportACF') ){
206
  }
207
  }
208
  }
 
 
209
 
210
- }
211
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  }
213
 
214
  public function render( & $i ){
215
 
216
- if ( ! empty($this->_acf_groups) ){
 
217
  ?>
218
  <p class="wpae-available-fields-group"><?php _e("ACF", "wp_all_export_plugin"); ?><span class="wpae-expander">+</span></p>
219
  <div class="wp-all-export-acf-wrapper wpae-custom-field">
220
  <?php
221
- foreach ($this->_acf_groups as $key => $group) {
 
222
  ?>
223
  <div class="wpae-acf-field">
224
  <ul>
@@ -229,12 +893,14 @@ if ( ! class_exists('XmlExportACF') ){
229
  </div>
230
  </li>
231
  <?php
232
- if ( ! empty($group['fields'])){
233
- foreach ($group['fields'] as $field) {
 
 
234
  ?>
235
  <li class="pmxe_acf_<?php echo (!empty($group['ID'])) ? $group['ID'] : $group['id'];?>">
236
  <div class="custom_column" rel="<?php echo ($i + 1);?>">
237
- <label class="wpallexport-xml-element">&lt;<?php echo $field['label']; ?>&gt;</label>
238
  <input type="hidden" name="ids[]" value="1"/>
239
  <input type="hidden" name="cc_label[]" value="<?php echo $field['name']; ?>"/>
240
  <input type="hidden" name="cc_php[]" value=""/>
@@ -244,6 +910,7 @@ if ( ! class_exists('XmlExportACF') ){
244
  <input type="hidden" name="cc_type[]" value="acf"/>
245
  <input type="hidden" name="cc_value[]" value="<?php echo $field['name']; ?>"/>
246
  <input type="hidden" name="cc_name[]" value="<?php echo str_replace(" ", "_", $field['label']);?>"/>
 
247
  </div>
248
  </li>
249
  <?php
@@ -261,6 +928,38 @@ if ( ! class_exists('XmlExportACF') ){
261
  }
262
  }
263
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  public function render_filters(){
265
 
266
  if ( ! empty($this->_acf_groups) ){
@@ -283,6 +982,318 @@ if ( ! class_exists('XmlExportACF') ){
283
 
284
  }
285
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  /**
287
  * __get function.
288
  *
@@ -306,15 +1317,20 @@ if ( ! class_exists('XmlExportACF') ){
306
  }
307
 
308
  public static function acf_get_row() {
309
-
 
 
 
 
 
 
310
  // check and return row
311
- if( !empty($GLOBALS['acf_field']) ) {
312
 
313
  return end( $GLOBALS['acf_field'] );
314
 
315
  }
316
-
317
-
318
  // return
319
  return false;
320
 
1
  <?php
2
 
3
+ if ( ! class_exists('XmlExportACF') )
4
+ {
5
  final class XmlExportACF
6
+ {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  private $_existing_acf_meta_keys = array();
8
 
9
  private $_acf_groups = array();
10
 
11
+ public function __construct()
12
+ {
13
+ add_filter("wp_all_export_csv_rows", array( &$this, "filter_csv_rows"), 10, 3);
14
  }
15
 
16
  public function init( & $existing_meta_keys = array() ){
189
  }
190
  }
191
  }
192
+ }
193
+ }
194
 
195
+ private static $additional_articles = array();
196
+
197
+ public static function export_acf_field($field_value = '', $exportOptions, $ID, $pid, &$article, $xmlWriter = false, &$acfs, $element_name = '', $element_name_ns = '', $fieldSnipped = '', $group_id = '', $preview = false, $return_value = false )
198
+ {
199
+ global $acf;
200
+
201
+ $put_to_csv = true;
202
+
203
+ $field_name = ($ID) ? $exportOptions['cc_label'][$ID] : $exportOptions['name'];
204
+ $field_options = ($ID) ? unserialize($exportOptions['cc_options'][$ID]) : $exportOptions;
205
+ $field_settings = ($ID) ? json_decode($exportOptions['cc_settings'][$ID], true) : false;
206
+
207
+ $is_xml_export = $xmlWriter and XmlExportEngine::$exportOptions['export_to'] == 'xml';
208
+
209
+ if ( ! empty($field_value) )
210
+ {
211
+ $field_value = maybe_unserialize($field_value);
212
+
213
+ $implode_delimiter = (isset($exportOptions['delimiter']) and $exportOptions['delimiter'] == ',') ? '|' : ',';
214
+
215
+ switch ($field_options['type'])
216
+ {
217
+ case 'date_time_picker':
218
+ case 'date_picker':
219
+ $field_value = date('Ymd', strtotime($field_value));
220
+ break;
221
+
222
+ case 'file':
223
+ case 'image':
224
+ if (is_numeric($field_value))
225
+ {
226
+ $field_value = wp_get_attachment_url($field_value);
227
+ }
228
+ elseif(is_array($field_value))
229
+ {
230
+ $field_value = $field_value['url'];
231
+ }
232
+ break;
233
+
234
+ case 'gallery':
235
+ $v = array();
236
+ foreach ($field_value as $key => $item)
237
+ {
238
+ $v[] = $item['url'];
239
+ }
240
+ $field_value = implode($implode_delimiter, $v);
241
+ break;
242
+ case 'location-field':
243
+ $localion_parts = explode("|", $field_value);
244
+
245
+ if ($is_xml_export)
246
+ {
247
+ if ( ! empty($localion_parts) ){
248
+
249
+ $xmlWriter->beginElement($element_name_ns, $element_name, null);
250
+ $xmlWriter->startElement('address');
251
+ $xmlWriter->writeData($localion_parts[0]);
252
+ $xmlWriter->endElement();
253
+
254
+ if (!empty($localion_parts[1])){
255
+ $coordinates = explode(",", $localion_parts[1]);
256
+ if (!empty($coordinates)){
257
+ $xmlWriter->startElement('lat');
258
+ $xmlWriter->writeData($coordinates[0]);
259
+ $xmlWriter->endElement();
260
+ $xmlWriter->startElement('lng');
261
+ $xmlWriter->writeData($coordinates[1]);
262
+ $xmlWriter->endElement();
263
+ }
264
+ }
265
+ $xmlWriter->endElement();
266
+
267
+ }
268
+ }
269
+ else
270
+ {
271
+ if ( ! $return_value )
272
+ {
273
+ $acfs[$element_name] = array(
274
+ $element_name . '_address',
275
+ $element_name . '_lat',
276
+ $element_name . '_lng'
277
+ );
278
+
279
+ if ( ! empty($localion_parts) )
280
+ {
281
+ $article[$element_name . '_address'] = $localion_parts[0];
282
+ if (!empty($localion_parts[1]))
283
+ {
284
+ $coordinates = explode(",", $localion_parts[1]);
285
+ if (!empty($coordinates))
286
+ {
287
+ $article[$element_name . '_lat'] = $coordinates[0];
288
+ $article[$element_name . '_lng'] = $coordinates[1];
289
+ }
290
+ }
291
+ }
292
+ }
293
+ else
294
+ {
295
+ if ( ! empty($localion_parts) )
296
+ {
297
+ $return_value = array(
298
+ 'address' => $localion_parts[0],
299
+ );
300
+ if (!empty($localion_parts[1]))
301
+ {
302
+ $coordinates = explode(",", $localion_parts[1]);
303
+ if (!empty($coordinates))
304
+ {
305
+ $return_value['lat'] = $coordinates[0];
306
+ $return_value['lng'] = $coordinates[1];
307
+ }
308
+ }
309
+ }
310
+ }
311
+ }
312
+
313
+ $put_to_csv = false;
314
+ break;
315
+
316
+ case 'paypal_item':
317
+
318
+ if ($is_xml_export)
319
+ {
320
+ $xmlWriter->beginElement($element_name_ns, $element_name, null);
321
+ if ( is_array($field_value) ){
322
+ foreach ($field_value as $key => $value) {
323
+ $xmlWriter->beginElement($element_name_ns, $key, null);
324
+ $xmlWriter->writeData($value);
325
+ $xmlWriter->endElement();
326
+ }
327
+ }
328
+ $xmlWriter->endElement();
329
+ }
330
+ else
331
+ {
332
+ if ( ! $return_value )
333
+ {
334
+ $acfs[$element_name] = array($element_name . '_item_name', $element_name . '_item_description', $element_name . '_price');
335
+
336
+ if ( is_array($field_value) )
337
+ {
338
+ foreach ($field_value as $key => $value)
339
+ {
340
+ $article[$element_name . '_' . $key] = $value;
341
+ }
342
+ }
343
+ }
344
+ }
345
+
346
+ $put_to_csv = false;
347
+
348
+ break;
349
+
350
+ case 'google_map':
351
+
352
+ if ($is_xml_export)
353
+ {
354
+ $xmlWriter->beginElement($element_name_ns, $element_name, null);
355
+ $xmlWriter->startElement('address');
356
+ $xmlWriter->writeData($field_value['address']);
357
+ $xmlWriter->endElement();
358
+ $xmlWriter->startElement('lat');
359
+ $xmlWriter->writeData($field_value['lat']);
360
+ $xmlWriter->endElement();
361
+ $xmlWriter->startElement('lng');
362
+ $xmlWriter->writeData($field_value['lng']);
363
+ $xmlWriter->endElement();
364
+ $xmlWriter->endElement();
365
+ }
366
+ else
367
+ {
368
+ if ( ! $return_value )
369
+ {
370
+ $acfs[$element_name] = array($element_name . '_address', $element_name . '_lat', $element_name . '_lng');
371
+
372
+ $article[$element_name . '_address'] = $field_value['address'];
373
+ $article[$element_name . '_lat'] = $field_value['lat'];
374
+ $article[$element_name . '_lng'] = $field_value['lng'];
375
+ }
376
+ }
377
+ $put_to_csv = false;
378
+
379
+ break;
380
+
381
+ case 'acf_cf7':
382
+ case 'gravity_forms_field':
383
+
384
+ if ( ! empty($field_options['multiple']) )
385
+ {
386
+ $field_value = implode($implode_delimiter, $field_value);
387
+ }
388
+
389
+ break;
390
+
391
+ case 'page_link':
392
+
393
+ if (is_array($field_value))
394
+ {
395
+ $field_value = implode($implode_delimiter, $field_value);
396
+ }
397
+
398
+ break;
399
+
400
+ case 'post_object':
401
+
402
+ if ( ! empty($field_options['multiple'])){
403
+ $v = array();
404
+ foreach ($field_value as $key => $pid) {
405
+
406
+ if (is_numeric($pid)){
407
+ $entry = get_post($pid);
408
+ if ($entry)
409
+ {
410
+ $v[] = $entry->post_name;
411
+ }
412
+ }
413
+ else{
414
+ $v[] = $pid->post_name;
415
+ }
416
+ }
417
+ $field_value = implode($implode_delimiter, $v);
418
+ }
419
+ else{
420
+ if (is_numeric($field_value)){
421
+ $entry = get_post($field_value);
422
+ if ($entry)
423
+ {
424
+ $field_value = $entry->post_name;
425
+ }
426
+ }
427
+ else{
428
+ $field_value = $field_value->post_name;
429
+ }
430
+ }
431
+
432
+ break;
433
+
434
+ case 'relationship':
435
+
436
+ $v = array();
437
+ foreach ($field_value as $key => $pid) {
438
+ $entry = get_post($pid);
439
+ if ($entry)
440
+ {
441
+ $v[] = $entry->post_title;
442
+ }
443
+ }
444
+ $field_value = implode($implode_delimiter, $v);
445
+
446
+ break;
447
+
448
+ case 'user':
449
+
450
+ if ( ! empty($field_options['multiple'])){
451
+ $v = array();
452
+ foreach ($field_value as $key => $user) {
453
+ if (is_numeric($user)){
454
+ $entry = get_user_by('ID', $user);
455
+ if ($entry)
456
+ {
457
+ $v[] = $entry->user_email;
458
+ }
459
+ }
460
+ else{
461
+ $v[] = $user['user_email'];
462
+ }
463
+ }
464
+ $field_value = implode($implode_delimiter, $v);
465
+ }
466
+ else{
467
+ if (is_numeric($field_value)){
468
+ $entry = get_user_by('ID', $field_value);
469
+ if ($entry)
470
+ {
471
+ $field_value = $entry->user_email;
472
+ }
473
+ }
474
+ else{
475
+ $field_value = $field_value['user_email'];
476
+ }
477
+ }
478
+
479
+ break;
480
+
481
+ case 'taxonomy':
482
+
483
+ if ($is_xml_export)
484
+ {
485
+ $xmlWriter->beginElement($element_name_ns, $element_name, null);
486
+
487
+ if ( ! in_array($field_options['field_type'], array('radio', 'select'))){
488
+ foreach ($field_value as $key => $tid) {
489
+ $entry = get_term($tid , $field_options['taxonomy']);
490
+ if ($entry and !is_wp_error($entry))
491
+ {
492
+ $xmlWriter->startElement('term');
493
+ $xmlWriter->writeData($entry->name);
494
+ $xmlWriter->endElement();
495
+ }
496
+ }
497
+ }
498
+ else{
499
+ $entry = get_term($field_value, $field_options['taxonomy']);
500
+ if ($entry)
501
+ {
502
+ $xmlWriter->startElement('term');
503
+ $xmlWriter->writeData($entry->name);
504
+ $xmlWriter->endElement();
505
+ }
506
+ }
507
+
508
+ $xmlWriter->endElement();
509
+
510
+ $put_to_csv = false;
511
+ }
512
+ else
513
+ {
514
+ if ( ! in_array($field_options['field_type'], array('radio', 'select'))){
515
+ $v = array();
516
+ foreach ($field_value as $key => $tid) {
517
+ $entry = get_term($tid , $field_options['taxonomy']);
518
+ if ($entry and !is_wp_error($entry))
519
+ {
520
+ $v[] = $entry->name;
521
+ }
522
+ }
523
+ $field_value = implode($implode_delimiter, $v);
524
+ }
525
+ else{
526
+ $entry = get_term($field_value, $field_options['taxonomy']);
527
+ if ($entry)
528
+ {
529
+ $field_value = $entry->name;
530
+ }
531
+ }
532
+ }
533
+
534
+ break;
535
+
536
+ case 'select':
537
+
538
+ if ( ! empty($field_options['multiple']))
539
+ {
540
+ $field_value = implode($implode_delimiter, $field_value);
541
+ }
542
+
543
+ break;
544
+
545
+ case 'checkbox':
546
+
547
+ if ( is_array($field_value) )
548
+ {
549
+ $field_value = implode($implode_delimiter, $field_value);
550
+ }
551
+
552
+ break;
553
+
554
+ case 'repeater':
555
+
556
+ if ($is_xml_export) $xmlWriter->beginElement($element_name_ns, $element_name, null);
557
+
558
+ if( have_rows($field_name, $pid) ):
559
+
560
+ $rowValues = array();
561
+
562
+ $repeater_sub_field_names = array();
563
+
564
+ while( have_rows($field_name, $pid) ):
565
+
566
+ the_row();
567
+
568
+ $row = self::acf_get_row();
569
+
570
+ if ($is_xml_export) $xmlWriter->startElement('row');
571
+
572
+ foreach ($row['field']['sub_fields'] as $sub_field) {
573
+
574
+ if ($acf and version_compare($acf->settings['version'], '5.0.0') >= 0)
575
+ {
576
+ $v = $row['value'][ $row['i'] ][ $sub_field['key'] ];
577
+
578
+ if ($is_xml_export) $v = acf_format_value($v, $row['post_id'], $sub_field);
579
+ }
580
+ else
581
+ {
582
+ $v = get_sub_field($sub_field['name']);
583
+ }
584
+
585
+ $sub_field['delimiter'] = $implode_delimiter;
586
+
587
+ $sub_field_value = self::export_acf_field(
588
+ $v,
589
+ $sub_field,
590
+ false,
591
+ $pid,
592
+ $article,
593
+ $xmlWriter,
594
+ $acfs,
595
+ $is_xml_export ? $sub_field['name'] : $element_name . '_' . $sub_field['name'],
596
+ $element_name_ns,
597
+ $fieldSnipped,
598
+ '',
599
+ $preview,
600
+ $is_xml_export ? false : true
601
+ );
602
+
603
+ if ( ! $is_xml_export )
604
+ {
605
+ switch ($sub_field['type'])
606
+ {
607
+ case 'google_map':
608
+ case 'paypal_item':
609
+ case 'location-field':
610
+ case 'repeater':
611
+
612
+ if ( ! empty($sub_field_value))
613
+ {
614
+ foreach ($sub_field_value as $repeater_key => $repeater_value)
615
+ {
616
+ $rowValues[$sub_field['name']][$repeater_key][] = (is_array($repeater_value)) ? implode($exportOptions['delimiter'], $repeater_value) : $repeater_value;
617
+ }
618
+ }
619
+
620
+ break;
621
+
622
+ default:
623
+
624
+ $rowValues[$sub_field['name']][] = apply_filters('pmxe_acf_field', pmxe_filter( (is_array($sub_field_value)) ? implode($exportOptions['delimiter'], $sub_field_value) : $sub_field_value, $fieldSnipped), $sub_field['name'], $pid);
625
+ break;
626
+ }
627
+ }
628
+ }
629
+
630
+ if ($is_xml_export) $xmlWriter->endElement();
631
+
632
+ endwhile;
633
+
634
+ if ($return_value) return $rowValues;
635
+
636
+ if ( ! $is_xml_export )
637
+ {
638
+ $additional_articles = array();
639
+
640
+ foreach ($rowValues as $key => $values)
641
+ {
642
+ $is_have_subvalues = array_filter(array_keys($values), 'is_numeric');
643
+
644
+ if (empty($is_have_subvalues))
645
+ {
646
+ foreach ($values as $subkey => $subvalue)
647
+ {
648
+ if ( ! in_array($element_name . '_' . $key . '_' . $subkey, $repeater_sub_field_names))
649
+ {
650
+ $repeater_sub_field_names[] = $element_name . '_' . $key . '_' . $subkey;
651
+ }
652
+ // Display each repeater row in its own csv line
653
+ if ( ! empty($field_settings) and $field_settings['repeater_field_item_per_line'] )
654
+ {
655
+ $base_value = array_shift($subvalue);
656
+
657
+ $article[$element_name . '_' . $key . '_' . $subkey] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($base_value))) : $base_value;
658
+
659
+ if ( ! empty($subvalue))
660
+ {
661
+ foreach ($subvalue as $i => $addRowValue)
662
+ {
663
+ $additional_articles[$i]['settings'] = $field_settings;
664
+ $additional_articles[$i]['content'][$element_name . '_' . $key . '_' . $subkey] = $addRowValue;
665
+ }
666
+ }
667
+ }
668
+ else
669
+ {
670
+ $article[$element_name . '_' . $key . '_' . $subkey] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars(implode($implode_delimiter, $subvalue)))) : implode($implode_delimiter, $subvalue);
671
+ }
672
+ }
673
+ }
674
+ else
675
+ {
676
+ if ( ! in_array($element_name . '_' . $key, $repeater_sub_field_names))
677
+ {
678
+ $repeater_sub_field_names[] = $element_name . '_' . $key;
679
+ }
680
+ // Display each repeater row in its own csv line
681
+ if ( ! empty($field_settings) and $field_settings['repeater_field_item_per_line'] )
682
+ {
683
+ $base_value = array_shift($values);
684
+
685
+ $article[$element_name . '_' . $key] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($base_value))) : $base_value;
686
+
687
+ if ( ! empty($values))
688
+ {
689
+ foreach ($values as $i => $addRowValue)
690
+ {
691
+ $additional_articles[$i]['settings'] = $field_settings;
692
+ $additional_articles[$i]['content'][$element_name . '_' . $key] = $addRowValue;
693
+ }
694
+ }
695
+ }
696
+ else
697
+ {
698
+ $article[$element_name . '_' . $key] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars(implode($implode_delimiter, $values)))) : implode($implode_delimiter, $values);
699
+ }
700
+ }
701
+ }
702
+ if ( ! empty($repeater_sub_field_names)) $acfs[$element_name] = $repeater_sub_field_names;
703
+
704
+ if ( ! empty($additional_articles) )
705
+ {
706
+ foreach ($additional_articles as $i => $additional_article) {
707
+ self::$additional_articles[] = $additional_article;
708
+ }
709
+ }
710
+ }
711
+
712
+ endif;
713
+
714
+ if ($is_xml_export) $xmlWriter->endElement();
715
+
716
+ $put_to_csv = false;
717
+
718
+ break;
719
+
720
+ case 'flexible_content':
721
+
722
+ $fc_sub_field_names = array();
723
+
724
+ if ($is_xml_export) $xmlWriter->beginElement($element_name_ns, $element_name, null);
725
+
726
+ // check if the flexible content field has rows of data
727
+ if( have_rows($field_name) ):
728
+
729
+ // loop through the rows of data
730
+ while ( have_rows($field_name) ) : the_row();
731
+
732
+ $row = self::acf_get_row();
733
+
734
+ foreach ($row['field']['layouts'] as $layout) {
735
+
736
+ if ($layout['name'] == $row['value'][ $row['i'] ]['acf_fc_layout']){
737
+
738
+ if ($is_xml_export) $xmlWriter->startElement($row['value'][ $row['i'] ]['acf_fc_layout'] . '_' . $row['i']);
739
+ foreach ($layout['sub_fields'] as $sub_field) {
740
+
741
+ $layout_field_name = $element_name . '_' . $layout['name'] . '_' . $row['i'];
742
+
743
+ $v = '';
744
+
745
+ if (isset($row['value'][ $row['i'] ][ $sub_field['key'] ]))
746
+ {
747
+ $v = $row['value'][ $row['i'] ][ $sub_field['key'] ];
748
+
749
+ if ($is_xml_export)
750
+ {
751
+ $v = acf_format_value($v, $row['post_id'], $sub_field);
752
+ }
753
+ }
754
+
755
+ $sub_field['delimiter'] = $implode_delimiter;
756
+
757
+ $sub_field_values = self::export_acf_field(
758
+ $v,
759
+ $sub_field,
760
+ false,
761
+ $pid,
762
+ $article,
763
+ $xmlWriter,
764
+ $acfs,
765
+ $is_xml_export ? $sub_field['name'] : $layout_field_name . '_' . $sub_field['name'],
766
+ $element_name_ns,
767
+ $fieldSnipped,
768
+ '',
769
+ $preview,
770
+ $is_xml_export ? false : true
771
+ );
772
+
773
+ if ( ! $is_xml_export )
774
+ {
775
+ switch ($sub_field['type'])
776
+ {
777
+ case 'repeater':
778
+
779
+ if ( ! empty($sub_field_values))
780
+ {
781
+ foreach ($sub_field_values as $key => $values) {
782
+ $article[$layout_field_name . '_' . $key] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars(implode($implode_delimiter, $values)))) : implode($implode_delimiter, $values);
783
+ if ( ! in_array($layout_field_name . '_' . $key, $fc_sub_field_names)) $fc_sub_field_names[] = $layout_field_name . '_' . $key;
784
+ }
785
+ }
786
+
787
+ break;
788
+
789
+ default:
790
+
791
+ $article[$layout_field_name . '_' . $sub_field['name']] = $v;
792
+
793
+ if ( ! in_array($layout_field_name . '_' . $sub_field['name'], $fc_sub_field_names))
794
+ $fc_sub_field_names[] = $layout_field_name . '_' . $sub_field['name'];
795
+
796
+ break;
797
+ }
798
+ }
799
+ }
800
+ if ($is_xml_export) $xmlWriter->endElement();
801
+ }
802
+ }
803
+
804
+ endwhile;
805
+
806
+ else :
807
+
808
+ // no layouts found
809
+
810
+ endif;
811
+
812
+ if ($is_xml_export) $xmlWriter->endElement();
813
+
814
+ if ( ! empty($fc_sub_field_names)) $acfs[$element_name] = $fc_sub_field_names;
815
+
816
+ $put_to_csv = false;
817
+
818
+ break;
819
+
820
+ default:
821
+
822
+ break;
823
+ }
824
+ }
825
+
826
+ if ($return_value) return $field_value;
827
+
828
+ if ($put_to_csv)
829
+ {
830
+ $val = apply_filters('pmxe_acf_field', pmxe_filter( ( ! empty($field_value) ) ? maybe_serialize($field_value) : '', $fieldSnipped), $field_name, $pid);
831
+
832
+ if ($is_xml_export)
833
+ {
834
+ $xmlWriter->beginElement($element_name_ns, $element_name, null);
835
+ $xmlWriter->writeData($val);
836
+ $xmlWriter->endElement();
837
+ }
838
+ else
839
+ {
840
+ // $article[$element_name] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($val))) : $val;
841
+ wp_all_export_write_article( $article, $element_name, ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($val))) : $val);
842
+ if ( ! isset($acfs[$element_name])) $acfs[$element_name] = $element_name;
843
+ }
844
+ }
845
+ }
846
+
847
+ public function filter_csv_rows($articles, $options, $export_id)
848
+ {
849
+ if ( ! empty(self::$additional_articles) and $options['export_to'] == 'csv')
850
+ {
851
+ $base_article = $articles[count($articles) - 1];
852
+
853
+ if ( ! empty(self::$additional_articles ) )
854
+ {
855
+ foreach (self::$additional_articles as $article)
856
+ {
857
+ if ($article['settings']['repeater_field_fill_empty_columns'])
858
+ {
859
+ foreach ($article['content'] as $key => $value) {
860
+ unset($base_article[$key]);
861
+ }
862
+ $articles[] = @array_merge($base_article, $article['content']);
863
+ }
864
+ else
865
+ {
866
+ $articles[] = $article['content'];
867
+ }
868
+ }
869
+ self::$additional_articles = array();
870
+ }
871
+ }
872
+
873
+ return $articles;
874
  }
875
 
876
  public function render( & $i ){
877
 
878
+ if ( ! empty($this->_acf_groups) )
879
+ {
880
  ?>
881
  <p class="wpae-available-fields-group"><?php _e("ACF", "wp_all_export_plugin"); ?><span class="wpae-expander">+</span></p>
882
  <div class="wp-all-export-acf-wrapper wpae-custom-field">
883
  <?php
884
+ foreach ($this->_acf_groups as $key => $group)
885
+ {
886
  ?>
887
  <div class="wpae-acf-field">
888
  <ul>
893
  </div>
894
  </li>
895
  <?php
896
+ if ( ! empty($group['fields']))
897
+ {
898
+ foreach ($group['fields'] as $field)
899
+ {
900
  ?>
901
  <li class="pmxe_acf_<?php echo (!empty($group['ID'])) ? $group['ID'] : $group['id'];?>">
902
  <div class="custom_column" rel="<?php echo ($i + 1);?>">
903
+ <label class="wpallexport-xml-element"><?php echo $field['label']; ?></label>
904
  <input type="hidden" name="ids[]" value="1"/>
905
  <input type="hidden" name="cc_label[]" value="<?php echo $field['name']; ?>"/>
906
  <input type="hidden" name="cc_php[]" value=""/>
910
  <input type="hidden" name="cc_type[]" value="acf"/>
911
  <input type="hidden" name="cc_value[]" value="<?php echo $field['name']; ?>"/>
912
  <input type="hidden" name="cc_name[]" value="<?php echo str_replace(" ", "_", $field['label']);?>"/>
913
+ <input type="hidden" name="cc_settings[]" value=""/>
914
  </div>
915
  </li>
916
  <?php
928
  }
929
  }
930
 
931
+ public function render_new_field(){
932
+
933
+ if ( ! empty($this->_acf_groups) )
934
+ {
935
+ foreach ($this->_acf_groups as $key => $group)
936
+ {
937
+ ?>
938
+ <optgroup label="<?php _e("ACF", "wp_all_export_plugin"); ?> - <?php echo $group['title']; ?>">
939
+ <?php
940
+ if ( ! empty($group['fields']))
941
+ {
942
+ foreach ($group['fields'] as $field)
943
+ {
944
+ $field_options = esc_html(serialize(array_merge($field, array('group_id' => ((!empty($group['ID'])) ? $group['ID'] : $group['id']) ))));
945
+ ?>
946
+ <option
947
+ value="acf"
948
+ label="<?php echo $field['label'];?>"
949
+ options="<?php echo $field_options; ?>"><?php echo $field['name'];?></option>
950
+ <?php
951
+ }
952
+ }
953
+ ?>
954
+ </optgroup>
955
+ <?php
956
+ }
957
+ ?>
958
+ </div>
959
+ <?php
960
+ }
961
+ }
962
+
963
  public function render_filters(){
964
 
965
  if ( ! empty($this->_acf_groups) ){
982
 
983
  }
984
 
985
+ public static function prepare_import_template( $exportOptions, &$templateOptions, &$acf_list, $element_name, $field_options)
986
+ {
987
+ $field_tpl_key = $element_name . '[1]';
988
+
989
+ $acf_list[] = '[' . $field_options['name'] . '] ' . $field_options['label'];
990
+
991
+ $field_template = false;
992
+
993
+ $is_multiple_field_value = false;
994
+
995
+ $is_xml_template = $exportOptions['export_to'] == 'xml';
996
+
997
+ $xpath_separator = $is_xml_template ? '/' : '_';
998
+
999
+ $implode_delimiter = ($exportOptions['delimiter'] == ',') ? '|' : ',';
1000
+
1001
+ switch ($field_options['type'])
1002
+ {
1003
+ case 'text':
1004
+ case 'textarea':
1005
+ case 'number':
1006
+ case 'email':
1007
+ case 'password':
1008
+ case 'url':
1009
+ case 'oembed':
1010
+ case 'wysiwyg':
1011
+ case 'image':
1012
+ case 'file':
1013
+ case 'date_picker':
1014
+ case 'color_picker':
1015
+ case 'acf_cf7':
1016
+ case 'gravity_forms_field':
1017
+ case 'limiter':
1018
+ case 'wp_wysiwyg':
1019
+ case 'date_time_picker':
1020
+ $field_template = '{' . $field_tpl_key . '}';
1021
+ break;
1022
+ case 'gallery':
1023
+ case 'relationship':
1024
+
1025
+ if ($is_xml_template)
1026
+ {
1027
+ $field_template = '{' . $field_tpl_key . '}';
1028
+ }
1029
+ else
1030
+ {
1031
+ $field_tpl_key = str_replace("[1]", "", $field_tpl_key);
1032
+
1033
+ if ($implode_delimiter == "|")
1034
+ $field_template = '[str_replace("|", ",",{' . $field_tpl_key . '[1]})]';
1035
+ else
1036
+ $field_template = '{' . $field_tpl_key . '[1]}';
1037
+ }
1038
+ break;
1039
+ case 'post_object':
1040
+ case 'page_link':
1041
+ case 'user':
1042
+
1043
+ if ($is_xml_template)
1044
+ {
1045
+ $field_template = '{' . $field_tpl_key . '}';
1046
+ }
1047
+ else
1048
+ {
1049
+ $field_tpl_key = str_replace("[1]", "", $field_tpl_key);
1050
+
1051
+ if ($field_options['multiple'])
1052
+ {
1053
+ if ($implode_delimiter == "|")
1054
+ $field_template = '[str_replace("|", ",",{' . $field_tpl_key . '[1]})]';
1055
+ else
1056
+ $field_template = '{' . $field_tpl_key . '[1]}';
1057
+ }
1058
+ else
1059
+ {
1060
+ $field_template = '{' . $field_tpl_key . '[1]}';
1061
+ }
1062
+ }
1063
+
1064
+ break;
1065
+ case 'select':
1066
+ case 'checkbox':
1067
+
1068
+ $templateOptions['is_multiple_field_value'][$field_options['key']] = "no";
1069
+
1070
+ if ($is_xml_template)
1071
+ {
1072
+ $field_template = '{' . $field_tpl_key . '}';
1073
+ }
1074
+ else
1075
+ {
1076
+ $field_tpl_key = str_replace("[1]", "", $field_tpl_key);
1077
+
1078
+ if ($implode_delimiter == "|")
1079
+ $field_template = '[str_replace("|", ",",{' . $field_tpl_key . '[1]})]';
1080
+ else
1081
+ $field_template = '{' . $field_tpl_key . '[1]}';
1082
+ }
1083
+
1084
+ break;
1085
+ case 'radio':
1086
+ case 'true_false':
1087
+
1088
+ $templateOptions['is_multiple_field_value'][$field_options['key']] = "no";
1089
+
1090
+ $field_template = '{' . $field_tpl_key . '}';
1091
+
1092
+ break;
1093
+ case 'location-field':
1094
+ case 'google_map':
1095
+
1096
+ if ( ! $is_xml_template) $field_tpl_key = str_replace("[1]", "", $field_tpl_key);
1097
+
1098
+ $field_template = array(
1099
+ 'address' => '{' . $field_tpl_key . $xpath_separator . 'address[1]}',
1100
+ 'address_geocode' => 'address_no_key',
1101
+ 'address_google_developers_api_key' => '',
1102
+ 'address_google_for_work_client_id' => '',
1103
+ 'address_google_for_work_digital_signature' => '',
1104
+ 'lat' => '{' . $field_tpl_key . $xpath_separator . 'lat[1]}',
1105
+ 'lng' => '{' . $field_tpl_key . $xpath_separator . 'lng[1]}'
1106
+ );
1107
+
1108
+ break;
1109
+ case 'paypal_item':
1110
+
1111
+ if ( ! $is_xml_template) $field_tpl_key = str_replace("[1]", "", $field_tpl_key);
1112
+
1113
+ $field_template = array(
1114
+ 'item_name' => '{' . $field_tpl_key . $xpath_separator . 'item_name[1]}',
1115
+ 'item_description' => '{' . $field_tpl_key . $xpath_separator . 'item_description[1]}',
1116
+ 'price' => '{' . $field_tpl_key . $xpath_separator . 'price[1]}'
1117
+ );
1118
+
1119
+ break;
1120
+ case 'taxonomy':
1121
+
1122
+ $taxonomy_options = array();
1123
+
1124
+ $single_term = new stdClass;
1125
+ $single_term->item_id = 1;
1126
+ $single_term->parent_id = NULL;
1127
+ $single_term->xpath = $is_xml_template ? '{' . $field_tpl_key . '/term[1]}' : '{' . $field_tpl_key . '}';
1128
+ $single_term->assign = false;
1129
+
1130
+ $taxonomy_options[] = $single_term;
1131
+
1132
+ $templateOptions['is_multiple_field_value'][$field_options['key']] = "no";
1133
+
1134
+ $field_template = json_encode($taxonomy_options);
1135
+
1136
+ break;
1137
+
1138
+ case 'repeater':
1139
+
1140
+ if ($is_xml_template)
1141
+ {
1142
+ $field_template = array(
1143
+ 'is_variable' => 'yes',
1144
+ 'foreach' => '{' . $field_tpl_key . '/row}',
1145
+ 'rows' => array()
1146
+ );
1147
+ }
1148
+ else
1149
+ {
1150
+ $field_template = array(
1151
+ 'is_variable' => 'csv',
1152
+ 'separator' => $implode_delimiter,
1153
+ 'rows' => array()
1154
+ );
1155
+ }
1156
+
1157
+ if (class_exists('acf')){
1158
+
1159
+ global $acf;
1160
+
1161
+ if ($acf and version_compare($acf->settings['version'], '5.0.0') >= 0){
1162
+
1163
+ $sub_fields = get_posts(array('posts_per_page' => -1, 'post_type' => 'acf-field', 'post_parent' => (( ! empty($field_options['id'])) ? $field_options['id'] : $field_options['ID']), 'post_status' => 'publish'));
1164
+
1165
+ if ( ! empty($sub_fields) ){
1166
+
1167
+ foreach ($sub_fields as $n => $sub_field){
1168
+
1169
+ $sub_field_options = unserialize($sub_field->post_content);
1170
+ $sub_field_options['label'] = $sub_field->post_title;
1171
+ $sub_field_options['name'] = $sub_field->post_excerpt;
1172
+ $sub_field_options['ID'] = $sub_field->ID;
1173
+ $sub_field_options['key'] = $sub_field->post_name;
1174
+
1175
+ $sub_field_tpl_key = $is_xml_template ? $sub_field->post_excerpt : $element_name . '_' . strtolower($sub_field->post_excerpt);
1176
+ $field_template['rows']['1'][$sub_field->post_name] = self::prepare_import_template( $options, $templateOptions, $acf_list, $sub_field_tpl_key, $sub_field_options );
1177
+
1178
+ $templateOptions['is_multiple_field_value'][$field_options['key']]['rows']['1'][$sub_field->post_name] = "no";
1179
+
1180
+ }
1181
+ }
1182
+
1183
+ }
1184
+ else
1185
+ {
1186
+ if ( ! empty($field['sub_fields']))
1187
+ {
1188
+ foreach ($field['sub_fields'] as $n => $sub_field)
1189
+ {
1190
+ $sub_field_tpl_key = $is_xml_template ? $sub_field['name'] : $element_name . '_' . strtolower($sub_field['name']);
1191
+
1192
+ $field_template['rows']['1'][$sub_field['key']] = self::prepare_import_template( $options, $templateOptions, $acf_list, $sub_field_tpl_key, $sub_field );
1193
+
1194
+ $templateOptions['is_multiple_field_value'][$field_options['key']]['rows']['1'][$sub_field['key']] = "no";
1195
+ }
1196
+ }
1197
+ }
1198
+ }
1199
+
1200
+ break;
1201
+
1202
+ case 'flexible_content':
1203
+
1204
+ $field_template = array(
1205
+ 'layouts' => array()
1206
+ );
1207
+
1208
+ if (class_exists('acf')){
1209
+
1210
+ global $acf;
1211
+
1212
+ if ($acf and version_compare($acf->settings['version'], '5.0.0') >= 0){
1213
+
1214
+ $sub_fields = get_posts(array('posts_per_page' => -1, 'post_type' => 'acf-field', 'post_parent' => (( ! empty($field_options['id'])) ? $field_options['id'] : $field_options['ID']), 'post_status' => 'publish'));
1215
+
1216
+ if ( ! empty($field_options['layouts']))
1217
+ {
1218
+ foreach ($field_options['layouts'] as $key => $layout)
1219
+ {
1220
+ if ( ! empty($sub_fields) )
1221
+ {
1222
+ $field_template['layouts'][(string)($key + 1)]['acf_fc_layout'] = $layout['name'];
1223
+
1224
+ foreach ($sub_fields as $n => $sub_field)
1225
+ {
1226
+ $sub_field_options = unserialize($sub_field->post_content);
1227
+
1228
+ if ($sub_field_options['parent_layout'] == $layout['key'])
1229
+ {
1230
+ $sub_field_options['label'] = $sub_field->post_title;
1231
+ $sub_field_options['name'] = $sub_field->post_excerpt;
1232
+ $sub_field_options['ID'] = $sub_field->ID;
1233
+ $sub_field_options['key'] = $sub_field->post_name;
1234
+
1235
+ if ($is_xml_template)
1236
+ {
1237
+ $sub_field_tpl_key = $field_tpl_key . '/' . $layout['name'] . '_' . $key . '[1]/' . $sub_field->post_excerpt;
1238
+ }
1239
+ else
1240
+ {
1241
+ $sub_field_tpl_key = $element_name . '_' . $layout['name'] . '_' . $key . '_' . strtolower($sub_field->post_excerpt);
1242
+ }
1243
+
1244
+ $field_template['layouts'][(string)($key + 1)][$sub_field->post_name] = self::prepare_import_template( $options, $templateOptions, $acf_list, $sub_field_tpl_key, $sub_field_options );
1245
+
1246
+ $templateOptions['is_multiple_field_value'][$field_options['key']]['layouts'][(string)($key + 1)][$sub_field->post_name] = "no";
1247
+ }
1248
+ }
1249
+ }
1250
+ }
1251
+ }
1252
+ }
1253
+ else
1254
+ {
1255
+ if ( ! empty($field['layouts']))
1256
+ {
1257
+ foreach ($field['layouts'] as $key => $layout)
1258
+ {
1259
+ if ( ! empty($layout['sub_fields']))
1260
+ {
1261
+ $field_template['layouts'][(string)($key + 1)]['acf_fc_layout'] = $layout['key'];
1262
+
1263
+ foreach ($layout['sub_fields'] as $n => $sub_field){
1264
+
1265
+ if ($is_xml_template)
1266
+ {
1267
+ $sub_field_tpl_key = $field_tpl_key . '/' . $layout['name'] . '_' . $key . '[1]/' . $sub_field['name'];
1268
+ }
1269
+ else
1270
+ {
1271
+ $sub_field_tpl_key = $element_name . '_' . $layout['name'] . '_' . $key . '_' . strtolower($sub_field['name']);
1272
+ }
1273
+
1274
+ $field_template['layouts'][(string)($key + 1)][$sub_field['key']] = self::prepare_import_template( $options, $templateOptions, $acf_list, $sub_field_tpl_key, $sub_field );
1275
+
1276
+ $templateOptions['is_multiple_field_value'][$field_options['key']]['layouts'][(string)($key + 1)][$sub_field['key']] = "no";
1277
+ }
1278
+ }
1279
+ }
1280
+ }
1281
+ }
1282
+ }
1283
+
1284
+ break;
1285
+
1286
+ default:
1287
+
1288
+ $field_template = '{' . $field_tpl_key . '}';
1289
+
1290
+ break;
1291
+
1292
+ }
1293
+
1294
+ return $field_template;
1295
+ }
1296
+
1297
  /**
1298
  * __get function.
1299
  *
1317
  }
1318
 
1319
  public static function acf_get_row() {
1320
+
1321
+ global $acf;
1322
+
1323
+ if ($acf and version_compare($acf->settings['version'], '5.3.6.0') >= 0)
1324
+ {
1325
+ return acf_get_loop('active');
1326
+ }
1327
  // check and return row
1328
+ elseif( !empty($GLOBALS['acf_field']) ) {
1329
 
1330
  return end( $GLOBALS['acf_field'] );
1331
 
1332
  }
1333
+
 
1334
  // return
1335
  return false;
1336
 
libraries/XmlExportComment.php ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists('XmlExportComment') )
4
+ {
5
+ final class XmlExportComment
6
+ {
7
+ private $init_fields = array(
8
+ array(
9
+ 'label' => 'comment_ID',
10
+ 'name' => 'ID',
11
+ 'type' => 'comment_ID'
12
+ ),
13
+ array(
14
+ 'label' => 'comment_author_email',
15
+ 'name' => 'Author Email',
16
+ 'type' => 'comment_author_email'
17
+ ),
18
+ array(
19
+ 'label' => 'comment_content',
20
+ 'name' => 'Content',
21
+ 'type' => 'comment_content'
22
+ )
23
+ );
24
+
25
+ private $default_fields = array(
26
+ array(
27
+ 'label' => 'comment_ID',
28
+ 'name' => 'ID',
29
+ 'type' => 'comment_ID'
30
+ ),
31
+ array(
32
+ 'label' => 'comment_post_ID',
33
+ 'name' => 'Post ID',
34
+ 'type' => 'comment_post_ID'
35
+ ),
36
+ array(
37
+ 'label' => 'comment_author',
38
+ 'name' => 'Author',
39
+ 'type' => 'comment_author'
40
+ ),
41
+ array(
42
+ 'label' => 'comment_author_email',
43
+ 'name' => 'Author Email',
44
+ 'type' => 'comment_author_email'
45
+ ),
46
+ array(
47
+ 'label' => 'comment_author_url',
48
+ 'name' => 'Author URL',
49
+ 'type' => 'comment_author_url'
50
+ ),
51
+ array(
52
+ 'label' => 'comment_author_IP',
53
+ 'name' => 'Author IP',
54
+ 'type' => 'comment_author_IP'
55
+ ),
56
+ array(
57
+ 'label' => 'comment_date',
58
+ 'name' => 'Date',
59
+ 'type' => 'comment_date'
60
+ ),
61
+ array(
62
+ 'label' => 'comment_content',
63
+ 'name' => 'Content',
64
+ 'type' => 'comment_content'
65
+ ),
66
+ array(
67
+ 'label' => 'comment_karma',
68
+ 'name' => 'Karma',
69
+ 'type' => 'comment_karma'
70
+ ),
71
+ array(
72
+ 'label' => 'comment_approved',
73
+ 'name' => 'Approved',
74
+ 'type' => 'comment_approved'
75
+ ),
76
+ array(
77
+ 'label' => 'comment_agent',
78
+ 'name' => 'Agent',
79
+ 'type' => 'comment_agent'
80
+ ),
81
+ array(
82
+ 'label' => 'comment_type',
83
+ 'name' => 'Type',
84
+ 'type' => 'comment_type'
85
+ ),
86
+ array(
87
+ 'label' => 'comment_parent',
88
+ 'name' => 'Comment Parent',
89
+ 'type' => 'comment_parent'
90
+ ),
91
+ array(
92
+ 'label' => 'user_id',
93
+ 'name' => 'User ID',
94
+ 'type' => 'user_id'
95
+ )
96
+
97
+ );
98
+
99
+ private $advanced_fields = array(
100
+
101
+ );
102
+
103
+ public static $is_active = true;
104
+
105
+ public function __construct()
106
+ {
107
+
108
+ if ( ( XmlExportEngine::$exportOptions['export_type'] == 'specific' and ! in_array('comments', XmlExportEngine::$post_types) )
109
+ or ( XmlExportEngine::$exportOptions['export_type'] == 'advanced' and XmlExportEngine::$exportOptions['wp_query_selector'] != 'wp_comment_query' ) ){
110
+ self::$is_active = false;
111
+ return;
112
+ }
113
+
114
+ add_filter("wp_all_export_available_sections", array( &$this, "filter_available_sections" ), 10, 1);
115
+ add_filter("wp_all_export_init_fields", array( &$this, "filter_init_fields"), 10, 1);
116
+ add_filter("wp_all_export_default_fields", array( &$this, "filter_default_fields"), 10, 1);
117
+ add_filter("wp_all_export_other_fields", array( &$this, "filter_other_fields"), 10, 1);
118
+ }
119
+
120
+ // [FILTERS]
121
+
122
+ /**
123
+ *
124
+ * Filter Init Fields
125
+ *
126
+ */
127
+ public function filter_init_fields($init_fields){
128
+ return $this->init_fields;
129
+ }
130
+
131
+ /**
132
+ *
133
+ * Filter Default Fields
134
+ *
135
+ */
136
+ public function filter_default_fields($default_fields){
137
+ return $this->default_fields;
138
+ }
139
+
140
+ /**
141
+ *
142
+ * Filter Other Fields
143
+ *
144
+ */
145
+ public function filter_other_fields($other_fields){
146
+ return $this->advanced_fields;
147
+ }
148
+
149
+ /**
150
+ *
151
+ * Filter Sections in Available Data
152
+ *
153
+ */
154
+ public function filter_available_sections($sections){
155
+
156
+ unset($sections['cats']);
157
+ unset($sections['media']);
158
+ unset($sections['other']);
159
+
160
+ $sections['cf']['title'] = __("Comment meta", "wp_all_export_plugin");
161
+
162
+ return $sections;
163
+ }
164
+
165
+ // [\FILTERS]
166
+
167
+ public function init( & $existing_meta_keys = array() )
168
+ {
169
+ if ( ! self::$is_active ) return;
170
+
171
+ global $wp_version;
172
+
173
+ if ( version_compare($wp_version, '4.2.0', '>=') )
174
+ {
175
+ $commentsQuery = new WP_Comment_Query( array( 'orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10, 'count' => true));
176
+ $comments = $commentsQuery->get_comments();
177
+ }
178
+ else
179
+ {
180
+ $comments = get_comments( array( 'orderby' => 'comment_ID', 'order' => 'ASC', 'number' => 10, 'count' => true));
181
+ }
182
+
183
+ if ( ! empty( $comments ) ) {
184
+ foreach ( $comments as $comment ) {
185
+ $comment_meta = get_comment_meta($comment->comment_ID, '');
186
+ if ( ! empty($comment_meta)){
187
+ foreach ($comment_meta as $record_meta_key => $record_meta_value) {
188
+ if ( ! in_array($record_meta_key, $existing_meta_keys) ){
189
+ $to_add = true;
190
+ foreach ($this->default_fields as $default_value) {
191
+ if ( $record_meta_key == $default_value['name'] || $record_meta_key == $default_value['type'] ){
192
+ $to_add = false;
193
+ break;
194
+ }
195
+ }
196
+ if ( $to_add ){
197
+ foreach ($this->advanced_fields as $advanced_value) {
198
+ if ( $record_meta_key == $advanced_value['name'] || $record_meta_key == $advanced_value['type']){
199
+ $to_add = false;
200
+ break;
201
+ }
202
+ }
203
+ }
204
+ if ( $to_add ) $existing_meta_keys[] = $record_meta_key;
205
+ }
206
+ }
207
+ }
208
+ }
209
+ }
210
+ }
211
+
212
+ /**
213
+ * __get function.
214
+ *
215
+ * @access public
216
+ * @param mixed $key
217
+ * @return mixed
218
+ */
219
+ public function __get( $key ) {
220
+ return $this->get( $key );
221
+ }
222
+
223
+ /**
224
+ * Get a session variable
225
+ *
226
+ * @param string $key
227
+ * @param mixed $default used if the session variable isn't set
228
+ * @return mixed value of session variable
229
+ */
230
+ public function get( $key, $default = null ) {
231
+ return isset( $this->{$key} ) ? $this->{$key} : $default;
232
+ }
233
+ }
234
+ }
libraries/XmlExportCpt.php ADDED
@@ -0,0 +1,596 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ final class XmlExportCpt
4
+ {
5
+ /**
6
+ * Singletone instance
7
+ * @var XmlExportCpt
8
+ */
9
+ protected static $instance;
10
+
11
+ /**
12
+ * Return singletone instance
13
+ * @return XmlExportCpt
14
+ */
15
+ static public function getInstance() {
16
+ if (self::$instance == NULL) {
17
+ self::$instance = new self();
18
+ }
19
+ return self::$instance;
20
+ }
21
+
22
+ private function __construct(){}
23
+
24
+ public static function prepare_data( $entry, $xmlWriter = false, &$acfs, &$woo, &$woo_order, $implode_delimiter, $preview, $is_item_data = false, $subID = false )
25
+ {
26
+ $article = array();
27
+
28
+ // associate exported post with import
29
+ if ( ! $is_item_data and wp_all_export_is_compatible() and XmlExportEngine::$exportOptions['is_generate_import'] and XmlExportEngine::$exportOptions['import_id'])
30
+ {
31
+ $postRecord = new PMXI_Post_Record();
32
+ $postRecord->clear();
33
+ $postRecord->getBy(array(
34
+ 'post_id' => $entry->ID,
35
+ 'import_id' => XmlExportEngine::$exportOptions['import_id'],
36
+ ));
37
+
38
+ if ($postRecord->isEmpty()){
39
+ $postRecord->set(array(
40
+ 'post_id' => $entry->ID,
41
+ 'import_id' => XmlExportEngine::$exportOptions['import_id'],
42
+ 'unique_key' => $entry->ID,
43
+ 'product_key' => $entry->ID
44
+ ))->save();
45
+ }
46
+ unset($postRecord);
47
+ }
48
+
49
+ foreach (XmlExportEngine::$exportOptions['ids'] as $ID => $value)
50
+ {
51
+ $pType = $entry->post_type;
52
+
53
+ if ( $is_item_data and $subID != $ID ) continue;
54
+
55
+ // skip shop order items data
56
+ if ( $pType == "shop_order" and strpos(XmlExportEngine::$exportOptions['cc_label'][$ID], "item_data__") !== false and ! $is_item_data ) continue;
57
+
58
+ $fieldName = XmlExportEngine::$exportOptions['cc_name'][$ID];
59
+ $fieldValue = str_replace("item_data__", "", XmlExportEngine::$exportOptions['cc_value'][$ID]);
60
+ $fieldLabel = str_replace("item_data__", "", XmlExportEngine::$exportOptions['cc_label'][$ID]);
61
+ $fieldSql = XmlExportEngine::$exportOptions['cc_sql'][$ID];
62
+ $fieldPhp = XmlExportEngine::$exportOptions['cc_php'][$ID];
63
+ $fieldCode = XmlExportEngine::$exportOptions['cc_code'][$ID];
64
+ $fieldType = XmlExportEngine::$exportOptions['cc_type'][$ID];
65
+ $fieldOptions = XmlExportEngine::$exportOptions['cc_options'][$ID];
66
+ $fieldSettings = empty(XmlExportEngine::$exportOptions['cc_settings'][$ID]) ? $fieldOptions : XmlExportEngine::$exportOptions['cc_settings'][$ID];
67
+
68
+ if ( empty($fieldName) or empty($fieldType) or ! is_numeric($ID) ) continue;
69
+
70
+ $element_name = ( ! empty($fieldName) ) ? $fieldName : 'untitled_' . $ID;
71
+ $element_name_ns = '';
72
+
73
+ if (XmlExportEngine::$exportOptions['export_to'] == 'xml')
74
+ {
75
+ $element_name = ( ! empty($fieldName) ) ? preg_replace('/[^a-z0-9_:-]/i', '', $fieldName) : 'untitled_' . $ID;
76
+
77
+ if (strpos($element_name, ":") !== false)
78
+ {
79
+ $element_name_parts = explode(":", $element_name);
80
+ $element_name_ns = (empty($element_name_parts[0])) ? '' : $element_name_parts[0];
81
+ $element_name = (empty($element_name_parts[1])) ? 'untitled_' . $ID : preg_replace('/[^a-z0-9_-]/i', '', $element_name_parts[1]);
82
+ }
83
+ }
84
+
85
+ $fieldSnipped = ( ! empty($fieldPhp ) and ! empty($fieldCode)) ? $fieldCode : false;
86
+
87
+ switch ($fieldType)
88
+ {
89
+ case 'id':
90
+ if ($element_name == 'ID') $element_name = 'id';
91
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_id', pmxe_filter($entry->ID, $fieldSnipped), $entry->ID) );
92
+ break;
93
+ case 'permalink':
94
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_guid', pmxe_filter(get_permalink(), $fieldSnipped), $entry->ID) );
95
+ break;
96
+ case 'post_type':
97
+ if ($entry->post_type == 'product_variation') $pType = 'product';
98
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_type', pmxe_filter($pType, $fieldSnipped), $entry->ID) );
99
+ break;
100
+ case 'title':
101
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_title', pmxe_filter($entry->post_title, $fieldSnipped), $entry->ID) );
102
+ break;
103
+ case 'content':
104
+ $val = apply_filters('pmxe_post_content', pmxe_filter($entry->post_content, $fieldSnipped), $entry->ID);
105
+ wp_all_export_write_article( $article, $element_name, ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($val))) : $val );
106
+ break;
107
+
108
+ // Media Attachments
109
+ case 'attachments':
110
+ case 'attachment_id':
111
+ case 'attachment_url':
112
+ case 'attachment_filename':
113
+ case 'attachment_path':
114
+ case 'attachment_title':
115
+ case 'attachment_caption':
116
+ case 'attachment_description':
117
+ case 'attachment_alt':
118
+
119
+ XmlExportMediaGallery::getInstance($entry->ID);
120
+
121
+ $attachment_data = XmlExportMediaGallery::get_attachments($fieldType);
122
+
123
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_' . $fieldType, pmxe_filter( implode($implode_delimiter, $attachment_data), $fieldSnipped), $entry->ID) );
124
+
125
+ break;
126
+
127
+ // Media Images
128
+ case 'media':
129
+ case 'image_id':
130
+ case 'image_url':
131
+ case 'image_filename':
132
+ case 'image_path':
133
+ case 'image_title':
134
+ case 'image_caption':
135
+ case 'image_description':
136
+ case 'image_alt':
137
+
138
+ $field_options = json_decode($fieldOptions, true);
139
+
140
+ XmlExportMediaGallery::getInstance($entry->ID);
141
+
142
+ $images_data = XmlExportMediaGallery::get_images($fieldType, $field_options);
143
+
144
+ $images_separator = empty($field_options['image_separator']) ? $implode_delimiter : $field_options['image_separator'];
145
+
146
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_' . $fieldType, pmxe_filter( implode($images_separator, $images_data), $fieldSnipped), $entry->ID) );
147
+
148
+ break;
149
+
150
+ case 'date':
151
+
152
+ if ( ! empty($fieldSettings))
153
+ {
154
+ switch ($fieldSettings)
155
+ {
156
+ case 'unix':
157
+ $post_date = get_post_time('U', true);
158
+ break;
159
+ default:
160
+ $post_date = date($fieldSettings, get_post_time('U', true));
161
+ break;
162
+ }
163
+ }
164
+ else
165
+ {
166
+ $post_date = date("Ymd", get_post_time('U', true));
167
+ }
168
+
169
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_date', pmxe_filter($post_date, $fieldSnipped), $entry->ID) );
170
+ break;
171
+
172
+ case 'parent':
173
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_parent', pmxe_filter($entry->post_parent, $fieldSnipped), $entry->ID) );
174
+ break;
175
+ case 'comment_status':
176
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_comment_status', pmxe_filter($entry->comment_status, $fieldSnipped), $entry->ID) );
177
+ break;
178
+ case 'ping_status':
179
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_ping_status', pmxe_filter($entry->ping_status, $fieldSnipped), $entry->ID) );
180
+ break;
181
+ case 'template':
182
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_template', pmxe_filter(get_post_meta($entry->ID, '_wp_page_template', true), $fieldSnipped), $entry->ID) );
183
+ break;
184
+ case 'order':
185
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_menu_order', pmxe_filter($entry->menu_order, $fieldSnipped), $entry->ID) );
186
+ break;
187
+ case 'status':
188
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_status', pmxe_filter($entry->post_status, $fieldSnipped), $entry->ID) );
189
+ break;
190
+ case 'format':
191
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_format', pmxe_filter(get_post_format($entry->ID), $fieldSnipped), $entry->ID) );
192
+ break;
193
+ case 'author':
194
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_author', pmxe_filter($entry->post_author, $fieldSnipped), $entry->ID) );
195
+ break;
196
+ case 'slug':
197
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_slug', pmxe_filter($entry->post_name, $fieldSnipped), $entry->ID) );
198
+ break;
199
+ case 'excerpt':
200
+ $val = apply_filters('pmxe_post_excerpt', pmxe_filter($entry->post_excerpt, $fieldSnipped), $entry->ID);
201
+ wp_all_export_write_article( $article, $element_name, ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($val))) : $val );
202
+ break;
203
+ case 'cf':
204
+ if ( ! empty($fieldValue) )
205
+ {
206
+ $val = "";
207
+
208
+ $cur_meta_values = get_post_meta($entry->ID, $fieldValue);
209
+
210
+ if ( ! empty($cur_meta_values) and is_array($cur_meta_values))
211
+ {
212
+ foreach ($cur_meta_values as $key => $cur_meta_value)
213
+ {
214
+ if (empty($val))
215
+ {
216
+ $val = apply_filters('pmxe_custom_field', pmxe_filter(maybe_serialize($cur_meta_value), $fieldSnipped), $fieldValue, $entry->ID);
217
+ }
218
+ else
219
+ {
220
+ $val = apply_filters('pmxe_custom_field', pmxe_filter($val . $implode_delimiter . maybe_serialize($cur_meta_value), $fieldSnipped), $fieldValue, $entry->ID);
221
+ }
222
+ }
223
+ wp_all_export_write_article( $article, $element_name, $val );
224
+ }
225
+
226
+ if ( empty($cur_meta_values))
227
+ {
228
+ if ( empty($article[$element_name]))
229
+ {
230
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_custom_field', pmxe_filter('', $fieldSnipped), $fieldValue, $entry->ID) );
231
+ }
232
+ }
233
+ }
234
+ break;
235
+
236
+ case 'acf':
237
+
238
+ if ( ! empty($fieldLabel) and class_exists( 'acf' ) ){
239
+
240
+ global $acf;
241
+
242
+ $field_options = unserialize($fieldOptions);
243
+
244
+ if (XmlExportEngine::$exportOptions['export_to'] == 'csv')
245
+ {
246
+ switch ($field_options['type']) {
247
+ case 'textarea':
248
+ case 'oembed':
249
+ case 'wysiwyg':
250
+ case 'wp_wysiwyg':
251
+ case 'date_time_picker':
252
+ case 'date_picker':
253
+
254
+ $field_value = get_field($fieldLabel, $entry->ID, false);
255
+
256
+ break;
257
+
258
+ default:
259
+
260
+ $field_value = get_field($fieldLabel, $entry->ID);
261
+
262
+ break;
263
+ }
264
+ }
265
+ else
266
+ {
267
+ $field_value = get_field($fieldLabel, $entry->ID);
268
+ }
269
+
270
+ XmlExportACF::export_acf_field(
271
+ $field_value,
272
+ XmlExportEngine::$exportOptions,
273
+ $ID,
274
+ $entry->ID,
275
+ $article,
276
+ $xmlWriter,
277
+ $acfs,
278
+ $element_name,
279
+ $element_name_ns,
280
+ $fieldSnipped,
281
+ $field_options['group_id'],
282
+ $preview
283
+ );
284
+
285
+ }
286
+
287
+ break;
288
+
289
+ case 'woo':
290
+
291
+ if ( $xmlWriter and XmlExportEngine::$exportOptions['export_to'] == 'xml')
292
+ {
293
+ XmlExportEngine::$woo_export->export_xml($xmlWriter, $entry, XmlExportEngine::$exportOptions, $ID);
294
+ }
295
+ else
296
+ {
297
+ XmlExportEngine::$woo_export->export_csv($article, $woo, $entry, XmlExportEngine::$exportOptions, $ID);
298
+ }
299
+
300
+ break;
301
+
302
+ case 'woo_order':
303
+
304
+ if ( $xmlWriter and XmlExportEngine::$exportOptions['export_to'] == 'xml')
305
+ {
306
+ XmlExportEngine::$woo_order_export->export_xml($xmlWriter, $entry, XmlExportEngine::$exportOptions, $ID, $preview);
307
+ }
308
+ else
309
+ {
310
+ XmlExportEngine::$woo_order_export->export_csv($article, $woo_order, $entry, XmlExportEngine::$exportOptions, $ID, $preview);
311
+ }
312
+
313
+ break;
314
+
315
+ case 'attr':
316
+
317
+ if ( ! empty($fieldValue))
318
+ {
319
+ if ( $entry->post_parent == 0 )
320
+ {
321
+ $txes_list = get_the_terms($entry->ID, $fieldValue);
322
+ if ( ! is_wp_error($txes_list) and ! empty($txes_list))
323
+ {
324
+ $attr_new = array();
325
+ foreach ($txes_list as $t)
326
+ {
327
+ $attr_new[] = $t->name;
328
+ }
329
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_woo_attribute', pmxe_filter(implode($implode_delimiter, $attr_new), $fieldSnipped), $entry->ID, $fieldValue) );
330
+ }
331
+ }
332
+ else
333
+ {
334
+ $attribute_pa = apply_filters('pmxe_woo_attribute', get_post_meta($entry->ID, 'attribute_' . $fieldValue, true), $entry->ID, $fieldValue);
335
+
336
+ wp_all_export_write_article( $article, $element_name, $attribute_pa );
337
+
338
+ }
339
+
340
+ // if ( ! in_array($element_name, $attributes)) $attributes[] = $element_name;
341
+ }
342
+ break;
343
+
344
+ case 'cats':
345
+
346
+ if ( ! empty($fieldValue) )
347
+ {
348
+ // $article[$element_name] = null;
349
+ $txes_list = get_the_terms($entry->ID, $fieldValue);
350
+ if ( ! is_wp_error($txes_list) and ! empty($txes_list) )
351
+ {
352
+ $txes_ids = array();
353
+ $hierarchy_groups = array();
354
+
355
+ foreach ($txes_list as $t) {
356
+ $txes_ids[] = $t->term_id;
357
+ }
358
+
359
+ foreach ($txes_list as $t) {
360
+ if ( wp_all_export_check_children_assign($t->term_id, $fieldValue, $txes_ids) ){
361
+ $ancestors = get_ancestors( $t->term_id, $fieldValue );
362
+ if (count($ancestors) > 0){
363
+ $hierarchy_group = array();
364
+ for ( $i = count($ancestors) - 1; $i >= 0; $i-- ) {
365
+ $term = get_term_by('id', $ancestors[$i], $fieldValue);
366
+ if ($term){
367
+ $hierarchy_group[] = $term->name;
368
+ }
369
+ }
370
+ $hierarchy_group[] = $t->name;
371
+ $hierarchy_groups[] = implode('>', $hierarchy_group);
372
+ }
373
+ else{
374
+ $hierarchy_groups[] = $t->name;
375
+ }
376
+ }
377
+ }
378
+
379
+ if ( ! empty($hierarchy_groups) )
380
+ {
381
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_post_taxonomy', pmxe_filter(implode($implode_delimiter, $hierarchy_groups), $fieldSnipped), $entry->ID) );
382
+ }
383
+
384
+ }
385
+
386
+ // if ( ! in_array($element_name, $taxes)) $taxes[] = $element_name;
387
+
388
+ if ($fieldLabel == 'product_type'){
389
+
390
+ if ( $entry->post_type == 'product_variation' ) $article[$element_name] = 'variable';
391
+
392
+ $article['parent_id'] = $entry->post_parent;
393
+
394
+ if ($xmlWriter and XmlExportEngine::$exportOptions['export_to'] == 'xml')
395
+ {
396
+ $xmlWriter->beginElement($element_name_ns, 'parent_id', null);
397
+ $xmlWriter->writeData($article['parent_id']);
398
+ $xmlWriter->endElement();
399
+ }
400
+ }
401
+ }
402
+
403
+ break;
404
+
405
+ case 'sql':
406
+
407
+ if ( ! empty($fieldSql) )
408
+ {
409
+ global $wpdb;
410
+ $val = $wpdb->get_var( $wpdb->prepare( stripcslashes(str_replace("%%ID%%", "%d", $fieldSql)), $entry->ID ));
411
+ if ( ! empty($fieldPhp) and !empty($fieldCode) )
412
+ {
413
+ // if shortcode defined
414
+ if (strpos($fieldCode, '[') === 0)
415
+ {
416
+ $val = do_shortcode(str_replace("%%VALUE%%", $val, $fieldCode));
417
+ }
418
+ else
419
+ {
420
+ $val = eval('return ' . stripcslashes(str_replace("%%VALUE%%", $val, $fieldCode)) . ';');
421
+ }
422
+ }
423
+ wp_all_export_write_article( $article, $element_name, apply_filters('pmxe_sql_field', $val, $element_name, $entry->ID) );
424
+ }
425
+ break;
426
+
427
+ default:
428
+ # code...
429
+ break;
430
+ }
431
+
432
+ if ( $xmlWriter and XmlExportEngine::$exportOptions['export_to'] == 'xml' and isset($article[$element_name]) )
433
+ {
434
+ $element_name_in_file = XmlCsvExport::_get_valid_header_name( $element_name );
435
+
436
+ $xmlWriter->beginElement($element_name_ns, $element_name_in_file, null);
437
+ $xmlWriter->writeData($article[$element_name]);
438
+ $xmlWriter->endElement();
439
+ }
440
+ }
441
+ return $article;
442
+ }
443
+
444
+ public static function prepare_import_template( $exportOptions, &$templateOptions, &$cf_list, &$attr_list, &$taxs_list, $element_name, $ID)
445
+ {
446
+ $options = $exportOptions;
447
+
448
+ $element_type = $options['cc_type'][$ID];
449
+
450
+ $is_xml_template = $options['export_to'] == 'xml';
451
+
452
+ $implode_delimiter = ($options['delimiter'] == ',') ? '|' : ',';
453
+
454
+ switch ($element_type)
455
+ {
456
+ case 'id':
457
+ if ($element_name == 'ID') $element_name = 'id';
458
+ $templateOptions['unique_key'] = '{'. $element_name .'[1]}';
459
+ $templateOptions['tmp_unique_key'] = '{'. $element_name .'[1]}';
460
+ $templateOptions['single_product_id'] = '{'. $element_name .'[1]}';
461
+ break;
462
+ case 'title':
463
+ case 'content':
464
+ case 'author':
465
+ case 'parent':
466
+ case 'slug':
467
+ $templateOptions[$element_type] = '{'. $element_name .'[1]}';
468
+ $templateOptions['is_update_' . $options['cc_type'][$ID]] = 1;
469
+ break;
470
+ case 'excerpt':
471
+ $templateOptions['post_excerpt'] = '{'. $element_name .'[1]}';
472
+ $templateOptions['is_update_' . $options['cc_type'][$ID]] = 1;
473
+ break;
474
+ case 'status':
475
+ $templateOptions['status_xpath'] = '{'. $element_name .'[1]}';
476
+ $templateOptions['is_update_status'] = 1;
477
+ break;
478
+ case 'date':
479
+ $templateOptions[$element_type] = '{'. $element_name .'[1]}';
480
+ $templateOptions['is_update_dates'] = 1;
481
+ break;
482
+ case 'post_type':
483
+
484
+ if ( empty($options['cpt']) )
485
+ {
486
+ $templateOptions['is_override_post_type'] = 1;
487
+ $templateOptions['post_type_xpath'] = '{'. $element_name .'[1]}';
488
+ }
489
+ break;
490
+
491
+ case 'cf':
492
+
493
+ if ( ! empty($options['cc_value'][$ID]) )
494
+ {
495
+ $exclude_cf = array('_thumbnail_id');
496
+
497
+ if (strpos($options['cc_value'][$ID], 'attribute_') === 0 and ! in_array($options['cc_value'][$ID], $attr_list))
498
+ {
499
+ $templateOptions['attribute_name'][] = str_replace('attribute_', '', $options['cc_value'][$ID]);
500
+ $templateOptions['attribute_value'][] = '{'. $element_name .'[1]}';
501
+ $templateOptions['in_variations'][] = "1";
502
+ $templateOptions['is_visible'][] = "1";
503
+ $templateOptions['is_taxonomy'][] = "0";
504
+ $templateOptions['create_taxonomy_in_not_exists'][] = "0";
505
+ $attr_list[] = $options['cc_value'][$ID];
506
+ }
507
+ elseif ( ! in_array($options['cc_value'][$ID], $cf_list) and ! in_array($options['cc_value'][$ID], $exclude_cf) )
508
+ {
509
+ $cf_list[] = $options['cc_value'][$ID];
510
+
511
+ $templateOptions['custom_name'][] = $options['cc_value'][$ID];
512
+ $templateOptions['custom_value'][] = '{'. $element_name .'[1]}';
513
+ $templateOptions['custom_format'][] = 0;
514
+ }
515
+ }
516
+
517
+ break;
518
+
519
+ case 'attr':
520
+
521
+ if ( ! empty($options['cc_value'][$ID]) and ! in_array($options['cc_value'][$ID], $attr_list) )
522
+ {
523
+ $templateOptions['attribute_name'][] = str_replace('pa_', '', $options['cc_value'][$ID]);
524
+ $templateOptions['attribute_value'][] = '{'. $element_name .'[1]}';
525
+ $templateOptions['in_variations'][] = "1";
526
+ $templateOptions['is_visible'][] = "1";
527
+ $templateOptions['is_taxonomy'][] = "1";
528
+ $templateOptions['create_taxonomy_in_not_exists'][] = "1";
529
+ $attr_list[] = $options['cc_value'][$ID];
530
+ }
531
+
532
+ break;
533
+ case 'cats':
534
+ if ( ! empty($options['cc_value'][$ID]) )
535
+ {
536
+ switch ($options['cc_label'][$ID])
537
+ {
538
+ case 'product_type':
539
+ $templateOptions['is_multiple_product_type'] = 'no';
540
+ $templateOptions['single_product_type'] = '{'. $element_name .'[1]}';
541
+ break;
542
+ case 'product_shipping_class':
543
+ $templateOptions['is_multiple_product_shipping_class'] = 'no';
544
+ $templateOptions['single_product_shipping_class'] = '{'. $element_name .'[1]}';
545
+ break;
546
+ default:
547
+ $taxonomy = $options['cc_value'][$ID];
548
+ $templateOptions['tax_assing'][$taxonomy] = 1;
549
+
550
+ if (is_taxonomy_hierarchical($taxonomy))
551
+ {
552
+ $templateOptions['tax_logic'][$taxonomy] = 'hierarchical';
553
+ $templateOptions['tax_hierarchical_logic_entire'][$taxonomy] = 1;
554
+ $templateOptions['multiple_term_assing'][$taxonomy] = 1;
555
+ $templateOptions['tax_hierarchical_delim'][$taxonomy] = '>';
556
+ $templateOptions['is_tax_hierarchical_group_delim'][$taxonomy] = 1;
557
+ $templateOptions['tax_hierarchical_group_delim'][$taxonomy] = $is_xml_template ? '|' : $implode_delimiter;
558
+ $templateOptions['tax_hierarchical_xpath'][$taxonomy] = array('{'. $element_name .'[1]}');
559
+ }
560
+ else{
561
+ $templateOptions['tax_logic'][$taxonomy] = 'multiple';
562
+ $templateOptions['multiple_term_assing'][$taxonomy] = 1;
563
+ $templateOptions['tax_multiple_xpath'][$taxonomy] = '{'. $element_name .'[1]}';
564
+ $templateOptions['tax_multiple_delim'][$taxonomy] = $is_xml_template ? '|' : $implode_delimiter;
565
+ }
566
+ $taxs_list[] = $taxonomy;
567
+ break;
568
+ }
569
+ }
570
+ break;
571
+
572
+ }
573
+ }
574
+
575
+ /**
576
+ * __get function.
577
+ *
578
+ * @access public
579
+ * @param mixed $key
580
+ * @return mixed
581
+ */
582
+ public function __get( $key ) {
583
+ return $this->get( $key );
584
+ }
585
+
586
+ /**
587
+ * Get a session variable
588
+ *
589
+ * @param string $key
590
+ * @param mixed $default used if the session variable isn't set
591
+ * @return mixed value of session variable
592
+ */
593
+ public function get( $key, $default = null ) {
594
+ return isset( $this->{$key} ) ? $this->{$key} : $default;
595
+ }
596
+ }
libraries/XmlExportEngine.php CHANGED
@@ -6,14 +6,19 @@ if ( ! class_exists('XmlExportEngine') ){
6
  require_once dirname(__FILE__) . '/XmlExportWooCommerce.php';
7
  require_once dirname(__FILE__) . '/XmlExportWooCommerceOrder.php';
8
  require_once dirname(__FILE__) . '/XmlExportUser.php';
 
 
9
 
10
  final class XmlExportEngine
11
  {
12
 
13
- private $acf_export;
14
- private $woo_export;
15
- private $woo_order_export;
16
- private $user_export;
 
 
 
17
 
18
  private $post;
19
  private $_existing_meta_keys = array();
@@ -27,17 +32,17 @@ if ( ! class_exists('XmlExportEngine') ){
27
  ),
28
  array(
29
  'label' => 'title',
30
- 'name' => 'title',
31
  'type' => 'title'
32
  ),
33
  array(
34
  'label' => 'content',
35
- 'name' => 'content',
36
  'type' => 'content'
37
  )
38
  );
39
 
40
- private $default_fields = array(
41
  array(
42
  'label' => 'id',
43
  'name' => 'ID',
@@ -45,90 +50,80 @@ if ( ! class_exists('XmlExportEngine') ){
45
  ),
46
  array(
47
  'label' => 'title',
48
- 'name' => 'title',
49
  'type' => 'title'
50
  ),
51
  array(
52
  'label' => 'content',
53
- 'name' => 'content',
54
  'type' => 'content'
55
  ),
56
  array(
57
  'label' => 'excerpt',
58
- 'name' => 'excerpt',
59
  'type' => 'excerpt'
60
  ),
61
  array(
62
  'label' => 'date',
63
- 'name' => 'date',
64
  'type' => 'date'
65
  ),
66
  array(
67
  'label' => 'post_type',
68
- 'name' => 'post_type',
69
  'type' => 'post_type'
70
  ),
71
  array(
72
- 'label' => 'media',
73
- 'name' => 'media',
74
- 'type' => 'media'
75
- ),
76
- array(
77
- 'label' => 'attachments',
78
- 'name' => 'attachments',
79
- 'type' => 'attachments'
80
- )
81
  );
82
 
83
  private $other_fields = array(
84
  array(
85
  'label' => 'status',
86
- 'name' => 'status',
87
  'type' => 'status'
88
  ),
89
  array(
90
  'label' => 'author',
91
- 'name' => 'author',
92
  'type' => 'author'
93
  ),
94
  array(
95
  'label' => 'slug',
96
- 'name' => 'slug',
97
  'type' => 'slug'
98
  ),
99
  array(
100
  'label' => 'format',
101
- 'name' => 'format',
102
  'type' => 'format'
103
  ),
104
  array(
105
  'label' => 'template',
106
- 'name' => 'template',
107
  'type' => 'template'
108
  ),
109
  array(
110
  'label' => 'parent',
111
- 'name' => 'parent',
112
  'type' => 'parent'
113
  ),
114
  array(
115
  'label' => 'order',
116
- 'name' => 'order',
117
  'type' => 'order'
118
- ),
119
- array(
120
- 'label' => 'permalink',
121
- 'name' => 'permalink',
122
- 'type' => 'permalink'
123
- ),
124
  array(
125
  'label' => 'comment_status',
126
- 'name' => 'comment_status',
127
  'type' => 'comment_status'
128
  ),
129
  array(
130
  'label' => 'ping_status',
131
- 'name' => 'ping_status',
132
  'type' => 'ping_status'
133
  )
134
  );
@@ -152,22 +147,122 @@ if ( ! class_exists('XmlExportEngine') ){
152
 
153
  private $filters;
154
 
155
- public static $is_user_export = false;
156
- public static $post_types = array();
 
157
  public static $exportOptions = array();
158
  public static $exportQuery;
159
- public static $exportID = false;
 
 
 
160
 
161
- public function __construct( $post, & $errors ){
162
 
163
  $this->post = $post;
164
- $this->errors = $errors;
165
 
166
  $this->available_sections = array(
167
  'default' => array(
168
  'title' => __("Standard", "wp_all_export_plugin"),
169
- 'content' => 'default_fields'
170
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  'cats' => array(
172
  'title' => __("Taxonomies", "wp_all_export_plugin"),
173
  'content' => 'existing_taxonomies'
@@ -180,114 +275,187 @@ if ( ! class_exists('XmlExportEngine') ){
180
  'title' => __("Other", "wp_all_export_plugin"),
181
  'content' => 'other_fields'
182
  )
183
- );
184
 
185
- $this->filter_sections = array(
186
- 'general' => array(
187
- 'title' => __("General", "wp_all_export_plugin"),
188
  'fields' => array(
189
- 'ID' => 'ID',
190
- 'post_title' => 'Title',
191
- 'post_content' => 'Content',
192
- 'post_parent' => 'Parent ID',
193
- 'post_date' => 'Date (Y-m-d H:i:s)',
194
- 'post_status' => 'Status',
195
- 'post_author' => 'Author ID'
 
 
 
 
196
  )
197
  )
198
  );
199
 
200
- if ( 'specific' == $this->post['export_type']) {
 
201
 
202
  self::$post_types = ( ! is_array($this->post['cpt']) ) ? array($this->post['cpt']) : $this->post['cpt'];
203
 
204
  if ( in_array('product', self::$post_types) and ! in_array('product_variation', self::$post_types)) self::$post_types[] = 'product_variation';
205
 
206
- if ( in_array('users', self::$post_types) ) self::$is_user_export = true;
 
 
 
 
207
 
208
  }
209
  else
 
 
 
 
 
 
210
  {
211
- if ( 'wp_user_query' == $this->post['wp_query_selector'] ){
212
- self::$is_user_export = true;
213
- }
214
- }
215
 
216
  self::$exportOptions = $post;
 
 
 
 
 
 
 
217
 
218
- $this->init();
219
-
220
- $this->acf_export = XmlExportACF::getInstance();
221
- $this->woo_export = XmlExportWooCommerce::getInstance();
222
- $this->user_export = XmlExportUser::getInstance();
223
- $this->woo_order_export = XmlExportWooCommerceOrder::getInstance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
 
225
- }
226
 
227
  protected function init(){
228
 
229
  PMXE_Plugin::$session->set('is_user_export', self::$is_user_export);
 
 
230
 
231
  if ('advanced' == $this->post['export_type']) {
232
 
233
  if( "" == $this->post['wp_query'] ){
234
- $this->errors->add('form-validation', __('WP Query field is required', 'pmxe_plugin'));
235
  }
236
- else {
 
 
 
 
 
 
237
 
238
  if ( self::$is_user_export )
239
- {
240
- $this->errors->add('form-validation', __('Upgrade to the professional edition of WP All Export to export users.', 'pmxe_plugin'));
 
 
 
 
241
  }
242
  else
243
- {
 
 
 
 
 
244
  self::$exportQuery = eval('return new WP_Query(array(' . $this->post['wp_query'] . ', \'offset\' => 0, \'posts_per_page\' => 10));');
245
 
246
  if ( empty(self::$exportQuery) ) {
247
- $this->errors->add('form-validation', __('Invalid query', 'pmxe_plugin'));
248
  }
249
  elseif ( empty(self::$exportQuery->found_posts) ) {
250
- $this->errors->add('count-validation', __('No matching posts found for WP_Query expression specified.', 'pmxe_plugin'));
251
  PMXE_Plugin::$session->set('found_posts', 0);
252
  }
253
  else {
254
  PMXE_Plugin::$session->set('wp_query', $this->post['wp_query']);
255
  PMXE_Plugin::$session->set('found_posts', self::$exportQuery->found_posts);
256
- }
 
 
257
  }
258
 
259
  }
260
  }
261
- else {
 
 
 
 
 
 
 
262
 
263
  if ( self::$is_user_export )
264
- {
265
- $this->errors->add('form-validation', __('Upgrade to the professional edition of WP All Export to export users.', 'pmxe_plugin'));
266
  }
267
- else
268
  {
269
- self::$exportQuery = new WP_Query( array( 'post_type' => self::$post_types, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
 
 
 
 
 
270
 
271
- PMXE_Plugin::$session->set('cpt', self::$post_types);
 
 
272
 
273
  if (empty(self::$exportQuery->found_posts)){
274
- $this->errors->add('count-validation', __('No matching posts found for selected post types.', 'pmxe_plugin'));
275
  PMXE_Plugin::$session->set('found_posts', 0);
276
  }
277
  else{
278
  PMXE_Plugin::$session->set('found_posts', self::$exportQuery->found_posts);
279
- }
 
 
280
  }
281
  }
282
 
283
  PMXE_Plugin::$session->save_data();
284
 
285
- }
286
 
287
  public function init_additional_data(){
288
 
289
- $this->woo_order_export->init_additional_data();
290
- $this->woo_export->init_additional_data();
291
 
292
  }
293
 
@@ -297,30 +465,20 @@ if ( ! class_exists('XmlExportEngine') ){
297
  $table_prefix = $wpdb->prefix;
298
 
299
  // Prepare existing taxonomies
300
- if ( 'specific' == $this->post['export_type'] and ! self::$is_user_export )
301
  {
302
- $post_taxonomies = array_diff_key(get_taxonomies_by_object_type(array(self::$post_types[0]), 'object'), array_flip(array('post_format')));
303
 
304
- if ( ! empty($post_taxonomies)){
305
- foreach ($post_taxonomies as $tx) {
306
- if (strpos($tx->name, "pa_") !== 0)
307
- $this->_existing_taxonomies[] = $tx->name;
308
- }
309
- }
310
- $post_type = self::$post_types[0];
311
- $meta_keys = $wpdb->get_results("SELECT DISTINCT {$table_prefix}postmeta.meta_key FROM {$table_prefix}postmeta, {$table_prefix}posts WHERE {$table_prefix}postmeta.post_id = {$table_prefix}posts.ID AND {$table_prefix}posts.post_type = '{$post_type}' AND {$table_prefix}postmeta.meta_key NOT LIKE '_edit%' LIMIT 500");
312
- if ( ! empty($meta_keys)){
313
- foreach ($meta_keys as $meta_key) {
314
- $this->_existing_meta_keys[] = $meta_key->meta_key;
315
- }
316
- }
317
  }
318
- if ( 'advanced' == $this->post['export_type'] and ! self::$is_user_export)
319
  {
320
  $meta_keys = $wpdb->get_results("SELECT DISTINCT meta_key FROM {$table_prefix}postmeta WHERE {$table_prefix}postmeta.meta_key NOT LIKE '_edit%' LIMIT 500");
321
  if ( ! empty($meta_keys)){
 
322
  foreach ($meta_keys as $meta_key) {
323
- $this->_existing_meta_keys[] = $meta_key->meta_key;
 
324
  }
325
  }
326
 
@@ -329,34 +487,44 @@ if ( ! class_exists('XmlExportEngine') ){
329
  foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
330
 
331
  if (strpos($obj->name, "pa_") !== 0 and strlen($obj->name) > 3)
332
- $this->_existing_taxonomies[] = $obj->name;
 
 
 
 
333
  }
334
  }
335
 
336
  // Prepare existing ACF groups & fields
337
- $this->acf_export->init($this->_existing_meta_keys);
338
 
339
  // Prepare existing WooCommerce data
340
- $this->woo_export->init($this->_existing_meta_keys);
341
 
342
  // Prepare existing WooCommerce Order data
343
- $this->woo_order_export->init($this->_existing_meta_keys);
 
 
 
344
 
345
  // Prepare existing Users data
346
- $this->user_export->init($this->_existing_meta_keys);
 
 
 
347
 
348
  return $this->get_available_data();
349
  }
350
 
351
  public function get_available_data(){
352
 
353
- $this->available_data['acf_groups'] = $this->acf_export->get('_acf_groups');
354
- $this->available_data['existing_acf_meta_keys'] = $this->acf_export->get('_existing_acf_meta_keys');
355
  $this->available_data['existing_meta_keys'] = $this->_existing_meta_keys;
356
  $this->available_data['existing_taxonomies'] = $this->_existing_taxonomies;
357
 
358
  $this->available_data['init_fields'] = apply_filters('wp_all_export_init_fields', $this->init_fields);
359
- $this->available_data['default_fields'] = apply_filters('wp_all_export_default_fields', $this->default_fields);
360
  $this->available_data['other_fields'] = apply_filters('wp_all_export_other_fields', $this->other_fields);
361
 
362
  $this->available_data = apply_filters("wp_all_export_available_data", $this->available_data);;
@@ -374,28 +542,31 @@ if ( ! class_exists('XmlExportEngine') ){
374
  $available_sections = apply_filters("wp_all_export_available_sections", $this->available_sections);
375
 
376
  // Render Available WooCommerce Orders Data
377
- $this->woo_order_export->render($i);
378
-
379
- foreach ($available_sections as $slug => $section) {
380
-
381
- if ( ! empty($this->available_data[$section['content']]) ){
382
- ?>
383
- <p class="wpae-available-fields-group"><?php echo $section['title']; ?><span class="wpae-expander">+</span></p>
384
- <div class="wpae-custom-field">
385
- <ul>
386
- <li>
387
- <div class="default_column" rel="">
388
- <a href="javascript:void(0);" class="pmxe_remove_column">X</a>
389
- <label class="wpallexport-element-label"><?php echo __("All", "wp_all_export_plugin") . ' ' . $section['title']; ?></label>
390
- <input type="hidden" name="rules[]" value="pmxe_<?php echo $slug; ?>"/>
391
- </div>
392
- </li>
393
- <?php
394
- foreach ($this->available_data[$section['content']] as $field) {
 
 
 
395
  ?>
396
- <li class="pmxe_<?php echo $slug; ?> <?php if ( ! empty($field['auto'])) echo 'wp_all_export_auto_generate';?>">
397
  <div class="custom_column" rel="<?php echo ($i + 1);?>">
398
- <label class="wpallexport-xml-element">&lt;<?php echo (is_array($field)) ? $field['name'] : $field; ?>&gt;</label>
399
  <input type="hidden" name="ids[]" value="1"/>
400
  <input type="hidden" name="cc_label[]" value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
401
  <input type="hidden" name="cc_php[]" value=""/>
@@ -404,23 +575,70 @@ if ( ! class_exists('XmlExportEngine') ){
404
  <input type="hidden" name="cc_options[]" value=""/>
405
  <input type="hidden" name="cc_type[]" value="<?php echo (is_array($field)) ? $field['type'] : $slug; ?>"/>
406
  <input type="hidden" name="cc_value[]" value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
407
- <input type="hidden" name="cc_name[]" value="<?php echo (is_array($field)) ? $field['name'] : $field;?>"/>
408
- <!--a href="javascript:void(0);" title="<?php _e('Delete field', 'wp_all_export_plugin'); ?>" class="icon-item remove-field"></a-->
409
  </div>
410
  </li>
411
  <?php
412
  $i++;
413
  }
414
- ?>
415
- </ul>
416
- </div>
417
- <?php
418
- }
419
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  }
421
 
422
- // Render Available ACF
423
- $this->acf_export->render($i);
 
 
 
424
 
425
  return ob_get_clean();
426
 
@@ -428,69 +646,230 @@ if ( ! class_exists('XmlExportEngine') ){
428
 
429
  public function render_filters(){
430
 
431
- $filter_sections = apply_filters('wp_all_export_filters', $this->filter_sections);
432
 
433
- foreach ($filter_sections as $slug => $section) {
 
 
 
 
434
 
435
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
436
 
437
- <optgroup label="<?php echo $section['title']; ?>">
438
 
439
- <?php foreach ($section['fields'] as $key => $title) : ?>
440
-
441
- <option value="<?php echo $key; ?>"><?php echo $title; ?></option>
442
 
443
- <?php endforeach; ?>
444
 
445
- </optgroup>
446
 
447
- <?php
448
 
 
 
 
 
449
  }
450
 
451
- $available_sections = apply_filters("wp_all_export_available_filter_sections", $this->available_sections);
 
 
 
 
452
 
453
- foreach ($available_sections as $slug => $section) {
454
 
455
- if ( ! empty($this->available_data[$section['content']]) ){
456
- ?>
457
- <optgroup label="<?php echo $section['title']; ?>">
458
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
459
 
460
- foreach ($this->available_data[$section['content']] as $field) {
461
- switch ($section['content']) {
462
- case 'existing_meta_keys':
 
 
 
 
 
 
463
  ?>
464
- <option value="<?php echo 'cf_' . (is_array($field) ? $field['label'] : $field); ?>"><?php echo (is_array($field) ? $field['name'] : $field); ?></option>
465
- <?php
466
- break;
467
- case 'existing_taxonomies':
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  ?>
469
- <option value="<?php echo 'tx_' . (is_array($field) ? $field['label'] : $field); ?>"><?php echo (is_array($field) ? $field['name'] : $field); ?></option>
470
- <?php
471
- break;
472
-
473
- default:
474
- # code...
475
- break;
476
- }
477
- }
478
- ?>
479
- </optgroup>
480
- <?php
481
- }
 
 
 
 
 
 
 
 
 
 
482
 
483
- }
 
 
 
 
484
 
485
- if ( ! XmlExportWooCommerceOrder::$is_active )
486
- {
487
- // Render Available ACF
488
- $this->acf_export->render_filters();
489
-
490
- }
 
491
 
492
- }
493
 
 
494
  /**
495
  * __get function.
496
  *
6
  require_once dirname(__FILE__) . '/XmlExportWooCommerce.php';
7
  require_once dirname(__FILE__) . '/XmlExportWooCommerceOrder.php';
8
  require_once dirname(__FILE__) . '/XmlExportUser.php';
9
+ require_once dirname(__FILE__) . '/XmlExportComment.php';
10
+ // require_once dirname(__FILE__) . '/XmlExportFiltering.php';
11
 
12
  final class XmlExportEngine
13
  {
14
 
15
+ public static $acf_export;
16
+ public static $woo_export;
17
+ public static $woo_order_export;
18
+ public static $woo_coupon_export;
19
+ public static $woo_refund_export;
20
+ public static $user_export;
21
+ public static $comment_export;
22
 
23
  private $post;
24
  private $_existing_meta_keys = array();
32
  ),
33
  array(
34
  'label' => 'title',
35
+ 'name' => 'Title',
36
  'type' => 'title'
37
  ),
38
  array(
39
  'label' => 'content',
40
+ 'name' => 'Content',
41
  'type' => 'content'
42
  )
43
  );
44
 
45
+ public static $default_fields = array(
46
  array(
47
  'label' => 'id',
48
  'name' => 'ID',
50
  ),
51
  array(
52
  'label' => 'title',
53
+ 'name' => 'Title',
54
  'type' => 'title'
55
  ),
56
  array(
57
  'label' => 'content',
58
+ 'name' => 'Content',
59
  'type' => 'content'
60
  ),
61
  array(
62
  'label' => 'excerpt',
63
+ 'name' => 'Excerpt',
64
  'type' => 'excerpt'
65
  ),
66
  array(
67
  'label' => 'date',
68
+ 'name' => 'Date',
69
  'type' => 'date'
70
  ),
71
  array(
72
  'label' => 'post_type',
73
+ 'name' => 'Post Type',
74
  'type' => 'post_type'
75
  ),
76
  array(
77
+ 'label' => 'permalink',
78
+ 'name' => 'Permalink',
79
+ 'type' => 'permalink'
80
+ )
 
 
 
 
 
81
  );
82
 
83
  private $other_fields = array(
84
  array(
85
  'label' => 'status',
86
+ 'name' => 'Status',
87
  'type' => 'status'
88
  ),
89
  array(
90
  'label' => 'author',
91
+ 'name' => 'Author',
92
  'type' => 'author'
93
  ),
94
  array(
95
  'label' => 'slug',
96
+ 'name' => 'Slug',
97
  'type' => 'slug'
98
  ),
99
  array(
100
  'label' => 'format',
101
+ 'name' => 'Format',
102
  'type' => 'format'
103
  ),
104
  array(
105
  'label' => 'template',
106
+ 'name' => 'Template',
107
  'type' => 'template'
108
  ),
109
  array(
110
  'label' => 'parent',
111
+ 'name' => 'Parent',
112
  'type' => 'parent'
113
  ),
114
  array(
115
  'label' => 'order',
116
+ 'name' => 'Order',
117
  'type' => 'order'
118
+ ),
 
 
 
 
 
119
  array(
120
  'label' => 'comment_status',
121
+ 'name' => 'Comment Status',
122
  'type' => 'comment_status'
123
  ),
124
  array(
125
  'label' => 'ping_status',
126
+ 'name' => 'Ping Status',
127
  'type' => 'ping_status'
128
  )
129
  );
147
 
148
  private $filters;
149
 
150
+ public static $is_user_export = false;
151
+ public static $is_comment_export = false;
152
+ public static $post_types = array();
153
  public static $exportOptions = array();
154
  public static $exportQuery;
155
+ public static $exportID = false;
156
+ public static $exportRecord = false;
157
+
158
+ public static $is_auto_generate_enabled = false;
159
 
160
+ public function __construct( $post, & $errors = false ){
161
 
162
  $this->post = $post;
163
+ $this->errors = $errors;
164
 
165
  $this->available_sections = array(
166
  'default' => array(
167
  'title' => __("Standard", "wp_all_export_plugin"),
168
+ 'content' => 'default_fields'
169
  ),
170
+ 'media' => array(
171
+ 'title' => __("Media", "wp_all_export_plugin"),
172
+ 'content' => '',
173
+ 'additional' => array(
174
+ 'images' => array(
175
+ 'title' => __("Images", "wp_all_export_plugin"),
176
+ 'meta' => array(
177
+ array(
178
+ 'name' => 'URL',
179
+ 'label' => 'url',
180
+ 'type' => 'image_url'
181
+ ),
182
+ array(
183
+ 'name' => 'Filename',
184
+ 'label' => 'filename',
185
+ 'type' => 'image_filename'
186
+ ),
187
+ array(
188
+ 'name' => 'Path',
189
+ 'label' => 'path',
190
+ 'type' => 'image_path'
191
+ ),
192
+ array(
193
+ 'name' => 'ID',
194
+ 'label' => 'image_id',
195
+ 'type' => 'image_id'
196
+ ),
197
+ array(
198
+ 'name' => 'Title',
199
+ 'label' => 'title',
200
+ 'type' => 'image_title'
201
+ ),
202
+ array(
203
+ 'name' => 'Caption',
204
+ 'label' => 'caption',
205
+ 'type' => 'image_caption'
206
+ ),
207
+ array(
208
+ 'name' => 'Description',
209
+ 'label' => 'description',
210
+ 'type' => 'image_description'
211
+ ),
212
+ array(
213
+ 'name' => 'Alt Text',
214
+ 'label' => 'alt',
215
+ 'type' => 'image_alt'
216
+ ),
217
+ )
218
+ ),
219
+ 'attachments' => array(
220
+ 'title' => __("Attachments", "wp_all_export_plugin"),
221
+ 'meta' => array(
222
+ array(
223
+ 'name' => 'URL',
224
+ 'label' => 'url',
225
+ 'type' => 'attachment_url'
226
+ ),
227
+ array(
228
+ 'name' => 'Filename',
229
+ 'label' => 'filename',
230
+ 'type' => 'attachment_filename'
231
+ ),
232
+ array(
233
+ 'name' => 'Path',
234
+ 'label' => 'path',
235
+ 'type' => 'attachment_path'
236
+ ),
237
+ array(
238
+ 'name' => 'ID',
239
+ 'label' => 'attachment_id',
240
+ 'type' => 'attachment_id'
241
+ ),
242
+ array(
243
+ 'name' => 'Title',
244
+ 'label' => 'title',
245
+ 'type' => 'attachment_title'
246
+ ),
247
+ array(
248
+ 'name' => 'Caption',
249
+ 'label' => 'caption',
250
+ 'type' => 'attachment_caption'
251
+ ),
252
+ array(
253
+ 'name' => 'Description',
254
+ 'label' => 'description',
255
+ 'type' => 'attachment_description'
256
+ ),
257
+ array(
258
+ 'name' => 'Alt Text',
259
+ 'label' => 'alt',
260
+ 'type' => 'attachment_alt'
261
+ ),
262
+ )
263
+ )
264
+ )
265
+ ),
266
  'cats' => array(
267
  'title' => __("Taxonomies", "wp_all_export_plugin"),
268
  'content' => 'existing_taxonomies'
275
  'title' => __("Other", "wp_all_export_plugin"),
276
  'content' => 'other_fields'
277
  )
278
+ );
279
 
280
+ $this->filter_sections = array(
281
+ 'author' => array(
282
+ 'title' => __("Author", "wp_all_export_plugin"),
283
  'fields' => array(
284
+ 'user_ID' => 'User ID',
285
+ 'user_login' => 'User Login',
286
+ 'user_nicename' => 'Nicename',
287
+ 'user_email' => 'Email',
288
+ 'user_registered' => 'Date Registered (Y-m-d H:i:s)',
289
+ 'display_name' => 'Display Name',
290
+ 'cf_first_name' => 'First Name',
291
+ 'cf_last_name' => 'Last Name',
292
+ 'nickname' => 'Nickname',
293
+ 'description' => 'User Description',
294
+ 'wp_capabilities' => 'User Role'
295
  )
296
  )
297
  );
298
 
299
+ if ( 'specific' == $this->post['export_type'])
300
+ {
301
 
302
  self::$post_types = ( ! is_array($this->post['cpt']) ) ? array($this->post['cpt']) : $this->post['cpt'];
303
 
304
  if ( in_array('product', self::$post_types) and ! in_array('product_variation', self::$post_types)) self::$post_types[] = 'product_variation';
305
 
306
+ self::$is_user_export = ( in_array('users', self::$post_types) or in_array('shop_customer', self::$post_types) ) ? true : false;
307
+
308
+ self::$is_comment_export = ( in_array('comments', self::$post_types) ) ? true : false;
309
+
310
+ self::$is_auto_generate_enabled = (class_exists('WooCommerce') and in_array(self::$post_types[0], array('product', 'shop_coupon', 'shop_customer')));
311
 
312
  }
313
  else
314
+ {
315
+ self::$is_user_export = ( 'wp_user_query' == $this->post['wp_query_selector'] );
316
+ self::$is_comment_export = ( 'wp_comment_query' == $this->post['wp_query_selector'] );
317
+ }
318
+
319
+ if ( ! self::$is_user_export && ! self::$is_comment_export)
320
  {
321
+ add_filter("wp_all_export_filters", array( &$this, "filter_export_filters"), 10, 1);
322
+ }
 
 
323
 
324
  self::$exportOptions = $post;
325
+
326
+ if ( ! empty(PMXE_Plugin::$session) and PMXE_Plugin::$session->has_session() )
327
+ {
328
+ $filter_args = array(
329
+ 'filter_rules_hierarhy' => $this->post['filter_rules_hierarhy'],
330
+ 'product_matching_mode' => $this->post['product_matching_mode']
331
+ );
332
 
333
+ $this->filters = new XmlExportFiltering($filter_args);
334
+
335
+ $this->init();
336
+ }
337
+
338
+ self::$acf_export = new XmlExportACF();
339
+ self::$woo_export = new XmlExportWooCommerce();
340
+ self::$user_export = new XmlExportUser();
341
+ self::$comment_export = new XmlExportComment();
342
+ self::$woo_order_export = new XmlExportWooCommerceOrder();
343
+ self::$woo_coupon_export = new XmlExportWooCommerceCoupon();
344
+
345
+ }
346
+
347
+ // [FILTERS]
348
+
349
+ /**
350
+ *
351
+ * Filter data for advanced filtering
352
+ *
353
+ */
354
+ public function filter_export_filters($filters){
355
+ return array_merge($filters, $this->filter_sections);
356
+ }
357
 
358
+ // [\FILTERS]
359
 
360
  protected function init(){
361
 
362
  PMXE_Plugin::$session->set('is_user_export', self::$is_user_export);
363
+ PMXE_Plugin::$session->set('is_comment_export', self::$is_comment_export);
364
+ PMXE_Plugin::$session->save_data();
365
 
366
  if ('advanced' == $this->post['export_type']) {
367
 
368
  if( "" == $this->post['wp_query'] ){
369
+ $this->errors->add('form-validation', __('WP Query field is required', 'wp_all_export_plugin'));
370
  }
371
+ else
372
+ {
373
+ $this->filters->parseQuery();
374
+
375
+ PMXE_Plugin::$session->set('whereclause', $this->filters->get('queryWhere'));
376
+ PMXE_Plugin::$session->set('joinclause', $this->filters->get('queryJoin'));
377
+ PMXE_Plugin::$session->save_data();
378
 
379
  if ( self::$is_user_export )
380
+ {
381
+ $this->errors->add('form-validation', __('Upgrade to the professional edition of WP All Export to export users.', 'wp_all_export_plugin'));
382
+ }
383
+ elseif ( self::$is_comment_export )
384
+ {
385
+ $this->errors->add('form-validation', __('Upgrade to the professional edition of WP All Export to export comments.', 'wp_all_export_plugin'));
386
  }
387
  else
388
+ {
389
+ remove_all_actions('parse_query');
390
+ remove_all_actions('pre_get_posts');
391
+
392
+ add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
393
+ add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
394
  self::$exportQuery = eval('return new WP_Query(array(' . $this->post['wp_query'] . ', \'offset\' => 0, \'posts_per_page\' => 10));');
395
 
396
  if ( empty(self::$exportQuery) ) {
397
+ $this->errors->add('form-validation', __('Invalid query', 'wp_all_export_plugin'));
398
  }
399
  elseif ( empty(self::$exportQuery->found_posts) ) {
400
+ $this->errors->add('count-validation', __('No matching posts found for WP_Query expression specified.', 'wp_all_export_plugin'));
401
  PMXE_Plugin::$session->set('found_posts', 0);
402
  }
403
  else {
404
  PMXE_Plugin::$session->set('wp_query', $this->post['wp_query']);
405
  PMXE_Plugin::$session->set('found_posts', self::$exportQuery->found_posts);
406
+ }
407
+ remove_filter('posts_join', 'wp_all_export_posts_join');
408
+ remove_filter('posts_where', 'wp_all_export_posts_where');
409
  }
410
 
411
  }
412
  }
413
+ else
414
+ {
415
+ $this->filters->parseQuery();
416
+
417
+ PMXE_Plugin::$session->set('cpt', self::$post_types);
418
+ PMXE_Plugin::$session->set('whereclause', $this->filters->get('queryWhere'));
419
+ PMXE_Plugin::$session->set('joinclause', $this->filters->get('queryJoin'));
420
+ PMXE_Plugin::$session->save_data();
421
 
422
  if ( self::$is_user_export )
423
+ {
424
+ $this->errors->add('form-validation', __('Upgrade to the professional edition of WP All Export to export users.', 'pmxe_plugin'));
425
  }
426
+ elseif( self::$is_comment_export )
427
  {
428
+ $this->errors->add('form-validation', __('Upgrade to the professional edition of WP All Export to export comments.', 'pmxe_plugin'));
429
+ }
430
+ else
431
+ {
432
+ remove_all_actions('parse_query');
433
+ remove_all_actions('pre_get_posts');
434
 
435
+ add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
436
+ add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
437
+ self::$exportQuery = new WP_Query( array( 'post_type' => self::$post_types, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
438
 
439
  if (empty(self::$exportQuery->found_posts)){
440
+ $this->errors->add('count-validation', __('No matching posts found for selected post types.', 'wp_all_export_plugin'));
441
  PMXE_Plugin::$session->set('found_posts', 0);
442
  }
443
  else{
444
  PMXE_Plugin::$session->set('found_posts', self::$exportQuery->found_posts);
445
+ }
446
+ remove_filter('posts_join', 'wp_all_export_posts_join');
447
+ remove_filter('posts_where', 'wp_all_export_posts_where');
448
  }
449
  }
450
 
451
  PMXE_Plugin::$session->save_data();
452
 
453
+ }
454
 
455
  public function init_additional_data(){
456
 
457
+ self::$woo_order_export->init_additional_data();
458
+ self::$woo_export->init_additional_data();
459
 
460
  }
461
 
465
  $table_prefix = $wpdb->prefix;
466
 
467
  // Prepare existing taxonomies
468
+ if ( 'specific' == $this->post['export_type'] and ! self::$is_user_export and ! self::$is_comment_export )
469
  {
470
+ $this->_existing_taxonomies = wp_all_export_get_existing_taxonomies_by_cpt( self::$post_types[0] );
471
 
472
+ $this->_existing_meta_keys = wp_all_export_get_existing_meta_by_cpt( self::$post_types[0] );
 
 
 
 
 
 
 
 
 
 
 
 
473
  }
474
+ if ( 'advanced' == $this->post['export_type'] and ! self::$is_user_export and ! self::$is_comment_export )
475
  {
476
  $meta_keys = $wpdb->get_results("SELECT DISTINCT meta_key FROM {$table_prefix}postmeta WHERE {$table_prefix}postmeta.meta_key NOT LIKE '_edit%' LIMIT 500");
477
  if ( ! empty($meta_keys)){
478
+ $exclude_keys = array('_first_variation_attributes', '_is_first_variation_created');
479
  foreach ($meta_keys as $meta_key) {
480
+ if ( strpos($meta_key->meta_key, "_tmp") === false && strpos($meta_key->meta_key, "_v_") === false && ! in_array($meta_key->meta_key, $exclude_keys))
481
+ $this->_existing_meta_keys[] = $meta_key->meta_key;
482
  }
483
  }
484
 
487
  foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
488
 
489
  if (strpos($obj->name, "pa_") !== 0 and strlen($obj->name) > 3)
490
+ $this->_existing_taxonomies[] = array(
491
+ 'name' => $obj->label,
492
+ 'label' => $obj->name,
493
+ 'type' => 'cats'
494
+ );
495
  }
496
  }
497
 
498
  // Prepare existing ACF groups & fields
499
+ self::$acf_export->init($this->_existing_meta_keys);
500
 
501
  // Prepare existing WooCommerce data
502
+ self::$woo_export->init($this->_existing_meta_keys);
503
 
504
  // Prepare existing WooCommerce Order data
505
+ self::$woo_order_export->init($this->_existing_meta_keys);
506
+
507
+ // Prepare existing WooCommerce Coupon data
508
+ self::$woo_coupon_export->init($this->_existing_meta_keys);
509
 
510
  // Prepare existing Users data
511
+ self::$user_export->init($this->_existing_meta_keys);
512
+
513
+ // Prepare existing Comments data
514
+ self::$comment_export->init($this->_existing_meta_keys);
515
 
516
  return $this->get_available_data();
517
  }
518
 
519
  public function get_available_data(){
520
 
521
+ $this->available_data['acf_groups'] = self::$acf_export->get('_acf_groups');
522
+ $this->available_data['existing_acf_meta_keys'] = self::$acf_export->get('_existing_acf_meta_keys');
523
  $this->available_data['existing_meta_keys'] = $this->_existing_meta_keys;
524
  $this->available_data['existing_taxonomies'] = $this->_existing_taxonomies;
525
 
526
  $this->available_data['init_fields'] = apply_filters('wp_all_export_init_fields', $this->init_fields);
527
+ $this->available_data['default_fields'] = apply_filters('wp_all_export_default_fields', self::$default_fields);
528
  $this->available_data['other_fields'] = apply_filters('wp_all_export_other_fields', $this->other_fields);
529
 
530
  $this->available_data = apply_filters("wp_all_export_available_data", $this->available_data);;
542
  $available_sections = apply_filters("wp_all_export_available_sections", $this->available_sections);
543
 
544
  // Render Available WooCommerce Orders Data
545
+ self::$woo_order_export->render($i);
546
+
547
+ foreach ($available_sections as $slug => $section)
548
+ {
549
+ if ( ! empty($this->available_data[$section['content']]) or ! empty($section['additional']) ):
550
+ ?>
551
+ <p class="wpae-available-fields-group"><?php echo $section['title']; ?><span class="wpae-expander">+</span></p>
552
+ <div class="wpae-custom-field">
553
+ <ul>
554
+ <?php if ( ! empty($this->available_data[$section['content']]) ): ?>
555
+ <li>
556
+ <div class="default_column" rel="">
557
+ <a href="javascript:void(0);" class="pmxe_remove_column">X</a>
558
+ <label class="wpallexport-element-label"><?php echo __("All", "wp_all_export_plugin") . ' ' . $section['title']; ?></label>
559
+ <input type="hidden" name="rules[]" value="pmxe_<?php echo $slug; ?>"/>
560
+ </div>
561
+ </li>
562
+ <?php
563
+ foreach ($this->available_data[$section['content']] as $field)
564
+ {
565
+ $is_auto_field = ( ! empty($field['auto']) or self::$is_auto_generate_enabled and 'specific' == $this->post['export_type'] and ! in_array(self::$post_types[0], array('product')));
566
  ?>
567
+ <li class="pmxe_<?php echo $slug; ?> <?php if ( $is_auto_field ) echo 'wp_all_export_auto_generate';?>">
568
  <div class="custom_column" rel="<?php echo ($i + 1);?>">
569
+ <label class="wpallexport-xml-element"><?php echo (is_array($field)) ? $field['name'] : $field; ?></label>
570
  <input type="hidden" name="ids[]" value="1"/>
571
  <input type="hidden" name="cc_label[]" value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
572
  <input type="hidden" name="cc_php[]" value=""/>
575
  <input type="hidden" name="cc_options[]" value=""/>
576
  <input type="hidden" name="cc_type[]" value="<?php echo (is_array($field)) ? $field['type'] : $slug; ?>"/>
577
  <input type="hidden" name="cc_value[]" value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
578
+ <input type="hidden" name="cc_name[]" value="<?php echo (is_array($field)) ? $field['name'] : $field;?>"/>
579
+ <input type="hidden" name="cc_settings[]" value=""/>
580
  </div>
581
  </li>
582
  <?php
583
  $i++;
584
  }
585
+ endif;
586
+
587
+ if ( ! empty($section['additional']) )
588
+ {
589
+ foreach ($section['additional'] as $sub_slug => $sub_section)
590
+ {
591
+ ?>
592
+ <li class="available_sub_section">
593
+ <p class="wpae-available-fields-group"><?php echo $sub_section['title']; ?><span class="wpae-expander">+</span></p>
594
+ <div class="wpae-custom-field">
595
+ <ul>
596
+ <li>
597
+ <div class="default_column" rel="">
598
+ <label class="wpallexport-element-label"><?php echo __("All", "wp_all_export_plugin") . ' ' . $sub_section['title']; ?></label>
599
+ <input type="hidden" name="rules[]" value="pmxe_<?php echo $slug;?>_<?php echo $sub_slug;?>"/>
600
+ </div>
601
+ </li>
602
+ <?php
603
+ foreach ($sub_section['meta'] as $field) {
604
+ $field_options = ( in_array($sub_slug, array('images', 'attachments')) ) ? esc_attr('{"is_export_featured":true,"is_export_attached":true,"image_separator":"|"}') : '';
605
+ ?>
606
+ <li class="pmxe_<?php echo $slug; ?>_<?php echo $sub_slug;?>">
607
+ <div class="custom_column" rel="<?php echo ($i + 1);?>">
608
+ <label class="wpallexport-xml-element"><?php echo (is_array($field)) ? $field['name'] : $field; ?></label>
609
+ <input type="hidden" name="ids[]" value="1"/>
610
+ <input type="hidden" name="cc_label[]" value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
611
+ <input type="hidden" name="cc_php[]" value=""/>
612
+ <input type="hidden" name="cc_code[]" value=""/>
613
+ <input type="hidden" name="cc_sql[]" value=""/>
614
+ <input type="hidden" name="cc_options[]" value="<?php echo $field_options; ?>"/>
615
+ <input type="hidden" name="cc_type[]" value="<?php echo (is_array($field)) ? $field['type'] : $sub_slug; ?>"/>
616
+ <input type="hidden" name="cc_value[]" value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
617
+ <input type="hidden" name="cc_name[]" value="<?php echo (is_array($field)) ? $field['name'] : $field;?>"/>
618
+ <input type="hidden" name="cc_settings[]" value=""/>
619
+ </div>
620
+ </li>
621
+ <?php
622
+ $i++;
623
+ }
624
+ ?>
625
+ </ul>
626
+ </li>
627
+ <?php
628
+ }
629
+ }
630
+ ?>
631
+ </ul>
632
+ </div>
633
+ <?php
634
+ endif;
635
  }
636
 
637
+ if ( ! self::$is_comment_export )
638
+ {
639
+ // Render Available ACF
640
+ self::$acf_export->render($i);
641
+ }
642
 
643
  return ob_get_clean();
644
 
646
 
647
  public function render_filters(){
648
 
649
+ $available_sections = apply_filters("wp_all_export_available_sections", apply_filters('wp_all_export_filters', $this->available_sections) );
650
 
651
+ // Render Filters for WooCommerce Orders
652
+ self::$woo_order_export->render_filters();
653
+
654
+ if ( ! empty($available_sections) )
655
+ {
656
 
657
+ foreach ($available_sections as $slug => $section)
658
+ {
659
+ if ( ! empty($this->available_data[$section['content']]) or ! empty($section['fields'])):
660
+ ?>
661
+
662
+ <optgroup label="<?php echo $section['title']; ?>">
663
+
664
+ <?php if ( ! empty($this->available_data[$section['content']]) ): ?>
665
+
666
+ <?php foreach ($this->available_data[$section['content']] as $field) : ?>
667
+
668
+ <?php
669
+
670
+ $field_label = is_array($field) ? $field['label'] : $field;
671
+ $field_type = is_array($field) ? $field['type'] : $slug;
672
+ $field_name = is_array($field) ? $field['name'] : $field;
673
+
674
+ switch ($field_type)
675
+ {
676
+ case 'woo':
677
+ $exclude_fields = array('attributes');
678
+ if ( ! in_array($field_label, $exclude_fields)):
679
+ ?>
680
+ <option value="<?php echo 'cf_' . $field_label; ?>"><?php echo $field_name; ?></option>
681
+ <?php
682
+ endif;
683
+ break;
684
+ case 'cf':
685
+ ?>
686
+ <option value="<?php echo 'cf_' . $field_label; ?>"><?php echo $field_name; ?></option>
687
+ <?php
688
+ break;
689
+ case 'cats':
690
+ case 'attr':
691
+ ?>
692
+ <option value="<?php echo 'tx_' . $field_label; ?>"><?php echo $field_name; ?></option>
693
+ <?php
694
+ break;
695
+ default:
696
+
697
+ if (self::$is_user_export)
698
+ {
699
+ switch ($field_label)
700
+ {
701
+ case 'id':
702
+ $field_label = strtoupper($field_label);
703
+ break;
704
+ case 'user_nicename':
705
+ ?>
706
+ <option value="user_role"><?php _e('User Role', 'wp_all_export_plugin'); ?></option>
707
+ <?php
708
+ break;
709
+ }
710
+ }
711
+ else
712
+ {
713
+ switch ($field_label)
714
+ {
715
+ case 'id':
716
+ $field_label = strtoupper($field_label);
717
+ break;
718
+ case 'parent':
719
+ case 'author':
720
+ case 'status':
721
+ case 'title':
722
+ case 'content':
723
+ case 'date':
724
+ case 'excerpt':
725
+ $field_label = 'post_' . $field_label;
726
+ break;
727
+ case 'permalink':
728
+ $field_label = 'guid';
729
+ break;
730
+ case 'slug':
731
+ $field_label = 'post_name';
732
+ break;
733
+ case 'order':
734
+ $field_label = 'menu_order';
735
+ break;
736
+ case 'template':
737
+ $field_label = 'cf__wp_page_template';
738
+ break;
739
+ case 'format':
740
+ $field_label = 'tx_post_format';
741
+ break;
742
+ default:
743
+ # code...
744
+ break;
745
+ }
746
+ }
747
+ ?>
748
+ <option value="<?php echo $field_label; ?>"><?php echo $field_name; ?></option>
749
+ <?php
750
+ break;
751
+ }
752
+ ?>
753
+
754
+ <?php endforeach; ?>
755
+
756
+ <?php endif; ?>
757
 
758
+ <?php if ( ! empty($section['fields'])): ?>
759
 
760
+ <?php foreach ($section['fields'] as $key => $title) : ?>
761
+
762
+ <option value="<?php echo $key; ?>"><?php echo $title; ?></option>
763
 
764
+ <?php endforeach; ?>
765
 
766
+ <?php endif; ?>
767
 
768
+ </optgroup>
769
 
770
+ <?php
771
+
772
+ endif;
773
+ }
774
  }
775
 
776
+ if ( ! self::$is_comment_export )
777
+ {
778
+ // Render Available ACF
779
+ self::$acf_export->render_filters();
780
+ }
781
 
782
+ }
783
 
784
+ public function render_new_field(){
785
+
786
+ ob_start();
787
+
788
+ $available_sections = apply_filters("wp_all_export_available_sections", $this->available_sections);
789
+
790
+ // Render Available WooCommerce Orders Data
791
+ self::$woo_order_export->render_new_field();
792
+
793
+ if ( ! empty($available_sections) ):?>
794
+
795
+ <select class="wp-all-export-chosen-select" name="column_value_type" style="width:350px;">
796
+
797
+ <?php
798
+ foreach ($available_sections as $slug => $section)
799
+ {
800
+ if ( ! empty($this->available_data[$section['content']]) or ! empty($section['additional']) ):
801
+ ?>
802
+ <optgroup label="<?php echo $section['title']; ?>">
803
 
804
+ <?php
805
+ if ( ! empty($this->available_data[$section['content']]) )
806
+ {
807
+ foreach ($this->available_data[$section['content']] as $field)
808
+ {
809
+ $field_label = is_array($field) ? $field['label'] : $field;
810
+ $field_type = is_array($field) ? $field['type'] : $slug;
811
+ $field_name = is_array($field) ? $field['name'] : $field;
812
+ $field_options = empty($field['options']) ? '' : $field['options'];
813
  ?>
814
+ <option
815
+ value="<?php echo $field_type;?>"
816
+ label="<?php echo $field_label;?>"
817
+ options="<?php echo $field_options; ?>"><?php echo $field_name;?></option>
818
+ <?php
819
+ }
820
+ }
821
+ ?>
822
+
823
+ </optgroup>
824
+
825
+ <?php
826
+
827
+ if ( ! empty($section['additional']) )
828
+ {
829
+ foreach ($section['additional'] as $sub_slug => $sub_section)
830
+ {
831
  ?>
832
+ <optgroup label="<?php echo $sub_section['title']; ?>">
833
+
834
+ <?php
835
+ foreach ($sub_section['meta'] as $field)
836
+ {
837
+ $field_label = is_array($field) ? $field['label'] : $field;
838
+ $field_type = is_array($field) ? $field['type'] : $slug;
839
+ $field_name = is_array($field) ? $field['name'] : $field;
840
+ $field_options = is_array($field) ? $field['options'] : '{"is_export_featured":true,"is_export_attached":true,"image_separator":"|"}';
841
+ ?>
842
+ <option
843
+ value="<?php echo $field_type;?>"
844
+ label="<?php echo $field_label;?>"
845
+ options="<?php echo $field_options; ?>"><?php echo $field_name;?></option>
846
+ <?php
847
+ }
848
+ ?>
849
+ </optgroup>
850
+ <?php
851
+ }
852
+ }
853
+ endif;
854
+ }
855
 
856
+ if ( ! self::$is_comment_export )
857
+ {
858
+ // Render Available ACF
859
+ self::$acf_export->render_new_field();
860
+ }
861
 
862
+ ?>
863
+ <optgroup label="Advanced">
864
+ <option value="sql" label="sql"><?php _e("SQL Query", "wp_all_export_plugin"); ?></option>
865
+ </optgroup>
866
+ </select>
867
+ <?php
868
+ endif;
869
 
870
+ return ob_get_clean();
871
 
872
+ }
873
  /**
874
  * __get function.
875
  *
libraries/XmlExportFiltering.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists('XmlExportFiltering') )
4
+ {
5
+ class XmlExportFiltering
6
+ {
7
+ private $queryWhere = "";
8
+ private $queryJoin = array();
9
+ private $userWhere = "";
10
+ private $userJoin = array();
11
+ private $options;
12
+ private $tax_query = false;
13
+ private $meta_query = false;
14
+
15
+ public function __construct($args = array())
16
+ {
17
+ $this->options = $args;
18
+
19
+ add_filter('wp_all_export_single_filter_rule', array(&$this, 'parse_rule_value'), 10, 1);
20
+ }
21
+
22
+ public function parseQuery()
23
+ {
24
+ // do not apply filters for child exports
25
+ if ( ! empty(XmlExportEngine::$exportRecord->parent_id) )
26
+ {
27
+ $this->queryWhere = XmlExportEngine::$exportRecord->options['whereclause'];
28
+ $this->queryJoin = XmlExportEngine::$exportRecord->options['joinclause'];
29
+ return;
30
+ }
31
+
32
+ global $wpdb;
33
+
34
+ // disable exports for orphaned variations entirely
35
+ if ( ! XmlExportEngine::$is_comment_export and ! XmlExportEngine::$is_user_export and ! empty(XmlExportEngine::$post_types) and @in_array("product", XmlExportEngine::$post_types) and class_exists('WooCommerce'))
36
+ {
37
+ $tmp_queryWhere = $this->queryWhere;
38
+ $tmp_queryJoin = $this->queryJoin;
39
+
40
+ $this->queryJoin = array();
41
+
42
+ $this->queryWhere = " $wpdb->posts.post_type = 'product' AND (($wpdb->posts.post_status <> 'trash' AND $wpdb->posts.post_status <> 'auto-draft'))";
43
+
44
+ $where = $this->queryWhere;
45
+ $join = implode( ' ', array_unique( $this->queryJoin ) );
46
+
47
+ $this->queryWhere = $tmp_queryWhere;
48
+ $this->queryJoin = $tmp_queryJoin;
49
+
50
+ $this->queryWhere .= " AND $wpdb->posts.post_type = 'product' OR ($wpdb->posts.post_type = 'product_variation' AND $wpdb->posts.post_parent IN (
51
+ SELECT DISTINCT $wpdb->posts.ID
52
+ FROM $wpdb->posts $join
53
+ WHERE $where
54
+ )) GROUP BY $wpdb->posts.ID";
55
+
56
+ }
57
+
58
+ }
59
+
60
+ public static function render_filtering_block( $engine, $isWizard, $post, $is_on_template_screen = false )
61
+ {
62
+ ?>
63
+ <input type="hidden" class="hierarhy-output" name="filter_rules_hierarhy" value="<?php echo esc_html($post['filter_rules_hierarhy']);?>"/>
64
+ <?php
65
+
66
+ if ( $isWizard or $post['export_type'] != 'specific' ) return;
67
+
68
+ ?>
69
+ <div class="wpallexport-collapsed wpallexport-section closed">
70
+ <div class="wpallexport-content-section wpallexport-filtering-section" <?php if ($is_on_template_screen):?>style="margin-bottom: 10px;"<?php endif; ?>>
71
+ <div class="wpallexport-collapsed-header" style="padding-left: 25px;">
72
+ <h3><?php _e('Filtering Options','wp_all_export_plugin');?></h3>
73
+ </div>
74
+ <div class="wpallexport-collapsed-content" style="padding: 0;">
75
+ <div class="wpallexport-collapsed-content-inner">
76
+ <?php include_once PMXE_ROOT_DIR . '/views/admin/export/blocks/filters.php'; ?>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ <?php
82
+ }
83
+
84
+ /**
85
+ * __get function.
86
+ *
87
+ * @access public
88
+ * @param mixed $key
89
+ * @return mixed
90
+ */
91
+ public function __get( $key ) {
92
+ return $this->get( $key );
93
+ }
94
+
95
+ /**
96
+ * Get a session variable
97
+ *
98
+ * @param string $key
99
+ * @param mixed $default used if the session variable isn't set
100
+ * @return mixed value of session variable
101
+ */
102
+ public function get( $key, $default = null ) {
103
+ return isset( $this->{$key} ) ? $this->{$key} : $default;
104
+ }
105
+ }
106
+ }
libraries/XmlExportMediaGallery.php ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ final class XmlExportMediaGallery
4
+ {
5
+ /**
6
+ * Singletone instance
7
+ * @var XmlExportMediaGallery
8
+ */
9
+ protected static $instance;
10
+
11
+ /**
12
+ * Return singletone instance
13
+ * @return XmlExportMediaGallery
14
+ */
15
+ static public function getInstance( $pid ) {
16
+ if ( self::$instance == NULL or self::$pid != $pid ) {
17
+ self::$instance = new self( $pid );
18
+ }
19
+ return self::$instance;
20
+ }
21
+
22
+ public static $pid = false;
23
+
24
+ public static $attachments = array();
25
+ public static $images = array();
26
+ public static $images_ids = array();
27
+
28
+ public static $featured_image = false;
29
+
30
+ private function __construct( $pid )
31
+ {
32
+ self::$pid = $pid;
33
+ }
34
+
35
+ public static function init( $type = 'attachments', $options = false )
36
+ {
37
+ self::$attachments = array();
38
+ self::$images = array();
39
+ self::$images_ids = array();
40
+ self::$featured_image = false;
41
+
42
+ switch ($type)
43
+ {
44
+ case 'attachments':
45
+
46
+ $attachments = get_posts( array(
47
+ 'post_type' => 'attachment',
48
+ 'posts_per_page' => -1,
49
+ 'post_parent' => self::$pid,
50
+ ) );
51
+
52
+ if ( ! empty($attachments)):
53
+
54
+ foreach ($attachments as $attachment)
55
+ {
56
+ if ( ! wp_attachment_is_image( $attachment->ID ) )
57
+ {
58
+ self::$attachments[] = $attachment;
59
+ }
60
+ }
61
+
62
+ endif;
63
+
64
+ break;
65
+
66
+ case 'images':
67
+
68
+ // prepare featured image data
69
+ if ( empty(self::$featured_image) )
70
+ {
71
+ $_featured_image_id = get_post_meta(self::$pid, '_thumbnail_id', true);
72
+
73
+ if ( ! empty($_featured_image_id) )
74
+ {
75
+ $_featured_image = get_post($_featured_image_id);
76
+
77
+ if ($_featured_image)
78
+ {
79
+ self::$featured_image = $_featured_image;
80
+ }
81
+ }
82
+ }
83
+
84
+ if ( ! empty(self::$featured_image) and ( empty($options) or ! empty($options['is_export_featured']) ) and ! in_array(self::$featured_image->ID, self::$images_ids))
85
+ {
86
+ self::$images_ids[] = self::$featured_image->ID;
87
+ self::$images[] = self::$featured_image;
88
+ }
89
+
90
+ // prepare attached images data
91
+ if ( empty($options) or ! empty($options['is_export_attached']) )
92
+ {
93
+ $images = get_posts( array(
94
+ 'post_type' => 'attachment',
95
+ 'posts_per_page' => -1,
96
+ 'post_parent' => self::$pid,
97
+ ) );
98
+
99
+ if ( ! empty($images)):
100
+
101
+ foreach ($images as $image)
102
+ {
103
+ if ( wp_attachment_is_image( $image->ID ) and ( empty(self::$featured_image) or self::$featured_image->ID != $image->ID ) )
104
+ {
105
+ self::$images[] = $image;
106
+ self::$images_ids[] = $image->ID;
107
+ }
108
+ }
109
+
110
+ endif;
111
+
112
+ $_gallery = get_post_meta(self::$pid, '_product_image_gallery', true);
113
+
114
+ if ( ! empty($_gallery))
115
+ {
116
+ $gallery = explode(',', $_gallery);
117
+
118
+ if ( ! empty($gallery) and is_array($gallery))
119
+ {
120
+ foreach ($gallery as $aid)
121
+ {
122
+ if ( ! empty($aid) and ! in_array($aid, self::$images_ids) and ( empty(self::$featured_image) or self::$featured_image->ID != $aid ) )
123
+ {
124
+ $_image = get_post($aid);
125
+ if ($_image)
126
+ {
127
+ self::$images_ids[] = $aid;
128
+ self::$images[] = $_image;
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+
136
+ break;
137
+
138
+ default:
139
+ # code...
140
+ break;
141
+ }
142
+ }
143
+
144
+ public static function get_attachments ( $field = 'attachment_url' )
145
+ {
146
+ self::init('attachments');
147
+
148
+ $data = array();
149
+
150
+ if ( ! empty(self::$attachments) )
151
+ {
152
+ foreach (self::$attachments as $attachment)
153
+ {
154
+ $v = self::get_media( str_replace("attachment_", "", $field), $attachment );
155
+
156
+ if ( $v and ! in_array($v, $data)) $data[] = $v;
157
+ }
158
+ }
159
+
160
+ return array_unique($data);
161
+ }
162
+
163
+ public static function get_images( $field = 'image_url', $options = false )
164
+ {
165
+ self::init('images', $options);
166
+
167
+ $data = array();
168
+
169
+ if ( ! empty(self::$images) )
170
+ {
171
+ foreach (self::$images as $image)
172
+ {
173
+ $v = self::get_media( str_replace("image_", "", $field), $image );
174
+
175
+ if ( $v and ! in_array($v, $data)) $data[] = $v;
176
+ }
177
+ }
178
+
179
+ return array_unique($data);
180
+ }
181
+
182
+ private static function get_media( $field = 'url', $attachment = false )
183
+ {
184
+ if ( empty($attachment)) return false;
185
+
186
+ switch ($field)
187
+ {
188
+ case 'media':
189
+ case 'attachments':
190
+ case 'url':
191
+ return wp_get_attachment_url( $attachment->ID );
192
+ break;
193
+ case 'filename':
194
+ return basename(wp_get_attachment_url( $attachment->ID ));
195
+ break;
196
+ case 'path':
197
+ return get_attached_file( $attachment->ID );
198
+ break;
199
+ case 'id':
200
+ return $attachment->ID;
201
+ break;
202
+ case 'title':
203
+ return $attachment->post_title;
204
+ break;
205
+ case 'caption':
206
+ return $attachment->post_excerpt;
207
+ break;
208
+ case 'description':
209
+ return $attachment->post_content;
210
+ break;
211
+ case 'alt':
212
+ return get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);
213
+ break;
214
+
215
+ default:
216
+ # code...
217
+ break;
218
+ }
219
+
220
+ return false;
221
+ }
222
+
223
+ public static $is_include_feature_meta = null;
224
+ public static $is_include_gallery_meta = null;
225
+
226
+ public static function prepare_import_template( $exportOptions, &$templateOptions, $element_name, $ID)
227
+ {
228
+ $options = $exportOptions;
229
+
230
+ $is_xml_template = $options['export_to'] == 'xml';
231
+
232
+ $implode_delimiter = ($options['delimiter'] == ',') ? '|' : ',';
233
+
234
+ $element_type = $options['cc_type'][$ID];
235
+
236
+ if ( is_null(self::$is_include_feature_meta) || is_null(self::$is_include_gallery_meta)) {
237
+ self::$is_include_feature_meta = false;
238
+ self::$is_include_gallery_meta = false;
239
+
240
+ foreach ($options['ids'] as $elID => $value)
241
+ {
242
+ if ( 'image_url' == $options['cc_type'][$elID] ) {
243
+ $field_options = json_decode($options['cc_options'][$elID], true);
244
+ if ( ! empty($field_options['is_export_featured']) ) self::$is_include_feature_meta = true;
245
+ if ( ! empty($field_options['is_export_attached']) ) self::$is_include_gallery_meta = true;
246
+ }
247
+ }
248
+ }
249
+
250
+ switch ($element_type)
251
+ {
252
+ case 'media':
253
+ case 'image_url':
254
+ $field_options = json_decode($options['cc_options'][$ID], true);
255
+ $templateOptions['is_update_images'] = 1;
256
+ $templateOptions['update_images_logic'] = 'add_new';
257
+ $templateOptions['download_featured_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
258
+ if ( empty($templateOptions['download_featured_image'])) {
259
+ $templateOptions['download_featured_image'] = '{'. $element_name .'[1]}';
260
+ }
261
+ else {
262
+ $templateOptions['download_featured_image'] .= $templateOptions['download_featured_delim'] . '{'. $element_name .'[1]}';
263
+ }
264
+ break;
265
+ case 'image_title':
266
+ $field_options = json_decode($options['cc_options'][$ID], true);
267
+ 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 )
268
+ {
269
+ $templateOptions['set_image_meta_title'] = 1;
270
+ $templateOptions['image_meta_title_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
271
+ if ( empty($templateOptions['image_meta_title'])) {
272
+ $templateOptions['image_meta_title'] = '{'. $element_name .'[1]}';
273
+ }
274
+ else {
275
+ $templateOptions['image_meta_title'] .= $templateOptions['image_meta_title_delim'] . '{'. $element_name .'[1]}';
276
+ }
277
+ }
278
+ break;
279
+ case 'image_caption':
280
+ $field_options = json_decode($options['cc_options'][$ID], true);
281
+ 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 )
282
+ {
283
+ $templateOptions['set_image_meta_caption'] = 1;
284
+ $templateOptions['image_meta_caption_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
285
+ if ( empty($templateOptions['image_meta_caption'])) {
286
+ $templateOptions['image_meta_caption'] = '{'. $element_name .'[1]}';
287
+ }
288
+ else {
289
+ $templateOptions['image_meta_caption'] .= $templateOptions['image_meta_caption_delim'] . '{'. $element_name .'[1]}';
290
+ }
291
+ }
292
+ break;
293
+ case 'image_description':
294
+ $field_options = json_decode($options['cc_options'][$ID], true);
295
+ 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 )
296
+ {
297
+ $templateOptions['set_image_meta_description'] = 1;
298
+ $templateOptions['image_meta_description_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
299
+ if ( empty($templateOptions['image_meta_description'])) {
300
+ $templateOptions['image_meta_description'] = '{'. $element_name .'[1]}';
301
+ }
302
+ else {
303
+ $templateOptions['image_meta_description'] .= $templateOptions['image_meta_description_delim'] . '{'. $element_name .'[1]}';
304
+ }
305
+ }
306
+ break;
307
+ case 'image_alt':
308
+ $field_options = json_decode($options['cc_options'][$ID], true);
309
+ 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 )
310
+ {
311
+ $templateOptions['set_image_meta_alt'] = 1;
312
+ $templateOptions['image_meta_alt_delim'] = (empty($field_options['image_separator'])) ? "|" : $field_options['image_separator'];
313
+ if ( empty($templateOptions['image_meta_alt'])) {
314
+ $templateOptions['image_meta_alt'] = '{'. $element_name .'[1]}';
315
+ }
316
+ else {
317
+ $templateOptions['image_meta_alt'] .= $templateOptions['image_meta_alt_delim'] . '{'. $element_name .'[1]}';
318
+ }
319
+ }
320
+ break;
321
+
322
+ case 'attachments':
323
+ case 'attachment_url':
324
+ $templateOptions['atch_delim'] = '|';
325
+ $templateOptions['is_update_attachments'] = 1;
326
+ if ( empty($templateOptions['attachments'])) {
327
+ $templateOptions['attachments'] = '{'. $element_name .'[1]}';
328
+ }
329
+ else {
330
+ $templateOptions['attachments'] .= $templateOptions['atch_delim'] . '{'. $element_name .'[1]}';
331
+ }
332
+ break;
333
+ }
334
+
335
+ }
336
+ }
libraries/XmlExportUser.php CHANGED
@@ -3,25 +3,7 @@
3
  if ( ! class_exists('XmlExportUser') ){
4
 
5
  final class XmlExportUser
6
- {
7
-
8
- /**
9
- * Singletone instance
10
- * @var XmlExportUser
11
- */
12
- protected static $instance;
13
-
14
- /**
15
- * Return singletone instance
16
- * @return XmlExportUser
17
- */
18
- static public function getInstance() {
19
- if (self::$instance == NULL) {
20
- self::$instance = new self();
21
- }
22
- return self::$instance;
23
- }
24
-
25
  private $init_fields = array(
26
  array(
27
  'label' => 'id',
@@ -181,78 +163,33 @@ if ( ! class_exists('XmlExportUser') ){
181
  )
182
  );
183
 
184
- private $filter_sections = array();
185
-
186
  public static $is_active = true;
187
 
188
- private function __construct()
 
 
189
  {
190
 
191
- if ( ( XmlExportEngine::$exportOptions['export_type'] == 'specific' and ! in_array('users', XmlExportEngine::$post_types) )
192
  or ( XmlExportEngine::$exportOptions['export_type'] == 'advanced' and XmlExportEngine::$exportOptions['wp_query_selector'] != 'wp_user_query' ) ){
193
  self::$is_active = false;
194
  return;
195
  }
196
 
197
- $this->filter_sections = array(
198
- 'general' => array(
199
- 'title' => __("General", "wp_all_export_plugin"),
200
- 'fields' => array(
201
- 'ID' => 'ID',
202
- 'user_login' => 'User Login',
203
- 'user_email' => 'User Email',
204
- 'cf_first_name' => 'First Name',
205
- 'cf_last_name' => 'Last Name',
206
- 'user_role' => 'User Role',
207
- 'user_nicename' => 'User Nicename',
208
- 'user_url' => 'User URL',
209
- 'user_registered' => 'Registered Date (Y-m-d H:i:s)',
210
- 'user_status' => 'User Status',
211
- 'display_name' => 'Display Name',
212
- 'cf_nickname' => 'Nickname',
213
- 'cf_description' => 'Description',
214
- 'user_status' => 'User Status'
215
- )
216
- ),
217
- 'advanced' => array(
218
- 'title' => __("Advanced", "wp_all_export_plugin"),
219
- 'fields' => array()
220
- )
221
- );
222
 
223
- foreach ($this->advanced_fields as $key => $field) {
224
- if ($field['type'] == 'cf'){
225
- $this->filter_sections['advanced']['fields']['cf_' . $field['name']] = $field['name'];
226
- }
227
- }
228
-
229
- if (is_multisite()){
230
- $this->filter_sections['network'] = array(
231
- 'title' => __("Network", "wp_all_export_plugin"),
232
- 'fields' => array(
233
- 'blog_id' => 'Blog ID'
234
- )
235
- );
236
- }
237
 
 
238
  add_filter("wp_all_export_available_sections", array( &$this, "filter_available_sections" ), 10, 1);
239
  add_filter("wp_all_export_init_fields", array( &$this, "filter_init_fields"), 10, 1);
240
  add_filter("wp_all_export_default_fields", array( &$this, "filter_default_fields"), 10, 1);
241
  add_filter("wp_all_export_other_fields", array( &$this, "filter_other_fields"), 10, 1);
242
- add_filter("wp_all_export_filters", array( &$this, "filter_export_filters"), 10, 1);
243
  }
244
 
245
  // [FILTERS]
246
-
247
- /**
248
- *
249
- * Filter data for advanced filtering
250
- *
251
- */
252
- public function filter_export_filters($filters){
253
- return $this->filter_sections;
254
- }
255
-
256
  /**
257
  *
258
  * Filter Init Fields
@@ -280,54 +217,220 @@ if ( ! class_exists('XmlExportUser') ){
280
  return $this->advanced_fields;
281
  }
282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  /**
284
  *
285
  * Filter Sections in Available Data
286
  *
287
  */
288
- public function filter_available_sections($sections){
289
 
290
- unset($sections['cats']);
 
 
 
 
 
 
 
 
 
 
291
 
292
- $sections['other']['title'] = __("Advanced", "wp_all_export_plugin");
 
 
 
 
 
 
 
 
 
 
 
293
 
294
- return $sections;
 
 
295
  }
296
 
297
  // [\FILTERS]
298
-
 
 
299
  public function init( & $existing_meta_keys = array() )
300
  {
301
  if ( ! self::$is_active ) return;
302
 
303
- if ( ! empty( XmlExportEngine::$exportQuery->results ) ) {
304
- foreach ( XmlExportEngine::$exportQuery->results as $user ) {
305
- $record_meta = get_user_meta($user->ID, '');
306
- if ( ! empty($record_meta)){
307
- foreach ($record_meta as $record_meta_key => $record_meta_value) {
308
- if ( ! in_array($record_meta_key, $existing_meta_keys) ){
309
- $to_add = true;
310
- foreach ($this->default_fields as $default_value) {
311
- if ( $record_meta_key == $default_value['name'] || $record_meta_key == $default_value['type'] ){
312
- $to_add = false;
313
- break;
314
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  }
316
- if ( $to_add ){
317
- foreach ($this->advanced_fields as $advanced_value) {
318
- if ( $record_meta_key == $advanced_value['name'] || $record_meta_key == $advanced_value['type']){
319
- $to_add = false;
320
- break;
321
- }
322
- }
 
323
  }
324
- if ( $to_add ) $existing_meta_keys[] = $record_meta_key;
325
  }
326
  }
327
- }
 
 
 
 
328
  }
329
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
330
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
 
332
  /**
333
  * __get function.
3
  if ( ! class_exists('XmlExportUser') ){
4
 
5
  final class XmlExportUser
6
+ {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  private $init_fields = array(
8
  array(
9
  'label' => 'id',
163
  )
164
  );
165
 
 
 
166
  public static $is_active = true;
167
 
168
+ public static $is_export_shop_customer = false;
169
+
170
+ public function __construct()
171
  {
172
 
173
+ if ( ( XmlExportEngine::$exportOptions['export_type'] == 'specific' and ! in_array('users', XmlExportEngine::$post_types) and ! in_array('shop_customer', XmlExportEngine::$post_types) )
174
  or ( XmlExportEngine::$exportOptions['export_type'] == 'advanced' and XmlExportEngine::$exportOptions['wp_query_selector'] != 'wp_user_query' ) ){
175
  self::$is_active = false;
176
  return;
177
  }
178
 
179
+ self::$is_active = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
 
181
+ if (in_array('shop_customer', XmlExportEngine::$post_types)) self::$is_export_shop_customer = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
+ add_filter("wp_all_export_available_data", array( &$this, "filter_available_data"), 10, 1);
184
  add_filter("wp_all_export_available_sections", array( &$this, "filter_available_sections" ), 10, 1);
185
  add_filter("wp_all_export_init_fields", array( &$this, "filter_init_fields"), 10, 1);
186
  add_filter("wp_all_export_default_fields", array( &$this, "filter_default_fields"), 10, 1);
187
  add_filter("wp_all_export_other_fields", array( &$this, "filter_other_fields"), 10, 1);
188
+
189
  }
190
 
191
  // [FILTERS]
192
+
 
 
 
 
 
 
 
 
 
193
  /**
194
  *
195
  * Filter Init Fields
217
  return $this->advanced_fields;
218
  }
219
 
220
+ /**
221
+ *
222
+ * Filter Available Data
223
+ *
224
+ */
225
+ public function filter_available_data($available_data){
226
+
227
+ if (self::$is_export_shop_customer)
228
+ {
229
+ $available_data['address_fields'] = $this->available_customer_data();
230
+ }
231
+ elseif (self::$is_woo_custom_founded)
232
+ {
233
+ $available_data['customer_fields'] = $this->available_customer_data();
234
+ }
235
+
236
+ return $available_data;
237
+ }
238
+
239
  /**
240
  *
241
  * Filter Sections in Available Data
242
  *
243
  */
244
+ public function filter_available_sections($available_sections){
245
 
246
+ unset($available_sections['cats']);
247
+ unset($available_sections['media']);
248
+
249
+ if (self::$is_export_shop_customer)
250
+ {
251
+ $customer_data = array(
252
+ 'address' => array(
253
+ 'title' => __("Address", "wp_all_export_plugin"),
254
+ 'content' => 'address_fields'
255
+ )
256
+ );
257
 
258
+ return array_merge(array_slice($available_sections, 0, 1), $customer_data, array_slice($available_sections, 1));
259
+ }
260
+ elseif (self::$is_woo_custom_founded)
261
+ {
262
+ $customer_data = array(
263
+ 'customer' => array(
264
+ 'title' => __("Customer", "wp_all_export_plugin"),
265
+ 'content' => 'customer_fields'
266
+ )
267
+ );
268
+ $available_sections = array_merge(array_slice($available_sections, 0, 1), $customer_data, array_slice($available_sections, 1));
269
+ }
270
 
271
+ self::$is_export_shop_customer or $available_sections['other']['title'] = __("Advanced", "wp_all_export_plugin");
272
+
273
+ return $available_sections;
274
  }
275
 
276
  // [\FILTERS]
277
+
278
+ public static $meta_keys;
279
+ public static $is_woo_custom_founded = false;
280
  public function init( & $existing_meta_keys = array() )
281
  {
282
  if ( ! self::$is_active ) return;
283
 
284
+ global $wpdb;
285
+ $table_prefix = $wpdb->prefix;
286
+ self::$meta_keys = $wpdb->get_results("SELECT DISTINCT {$table_prefix}usermeta.meta_key FROM {$table_prefix}usermeta, {$table_prefix}users WHERE {$table_prefix}usermeta.user_id = {$table_prefix}users.ID LIMIT 500");
287
+
288
+ if ( ! empty(self::$meta_keys)){
289
+
290
+ $address_fields = $this->available_customer_data();
291
+ // detect if at least one filtered user is a WooCommerce customer
292
+ foreach (self::$meta_keys as $meta_key) {
293
+ if ( $meta_key->meta_key == '_customer_user'){
294
+ self::$is_woo_custom_founded = true;
295
+ break;
296
+ }
297
+ }
298
+
299
+ $exclude_keys = array('_first_variation_attributes', '_is_first_variation_created');
300
+ foreach (self::$meta_keys as $meta_key) {
301
+ if ( ! in_array($meta_key->meta_key, $exclude_keys))
302
+ {
303
+ $to_add = true;
304
+ foreach ($this->default_fields as $default_value) {
305
+ if ( $meta_key->meta_key == $default_value['name'] || $meta_key->meta_key == $default_value['type'] ){
306
+ $to_add = false;
307
+ break;
308
+ }
309
+ }
310
+ if ( $to_add ){
311
+ foreach ($this->advanced_fields as $advanced_value) {
312
+ if ( $meta_key->meta_key == $advanced_value['name'] || $meta_key->meta_key == $advanced_value['type']){
313
+ $to_add = false;
314
+ break;
315
  }
316
+ }
317
+ }
318
+ if ( $to_add && ( self::$is_export_shop_customer || self::$is_woo_custom_founded ) )
319
+ {
320
+ foreach ($address_fields as $address_value) {
321
+ if ( $meta_key->meta_key == $address_value['label']){
322
+ $to_add = false;
323
+ break;
324
  }
 
325
  }
326
  }
327
+ if ( $to_add )
328
+ {
329
+ $existing_meta_keys[] = $meta_key->meta_key;
330
+ }
331
+ }
332
  }
333
+ }
334
+ }
335
+
336
+ public function available_customer_data()
337
+ {
338
+
339
+ $main_fields = array(
340
+ array(
341
+ 'name' => __('Customer User ID', 'wp_all_export_plugin'),
342
+ 'label' => '_customer_user',
343
+ 'type' => 'cf'
344
+ )
345
+ );
346
+
347
+ $data = array_merge($main_fields, $this->available_billing_information_data(), $this->available_shipping_information_data());
348
+
349
+ return apply_filters('wp_all_export_available_user_data_filter', $data);
350
+
351
+ }
352
+
353
+ public function available_billing_information_data()
354
+ {
355
+
356
+ $keys = array(
357
+ 'billing_first_name', 'billing_last_name', 'billing_company',
358
+ 'billing_address_1', 'billing_address_2', 'billing_city',
359
+ 'billing_postcode', 'billing_country', 'billing_state',
360
+ 'billing_email', 'billing_phone'
361
+ );
362
+
363
+ $data = $this->generate_friendly_titles($keys, 'billing');
364
+
365
+ return apply_filters('wp_all_export_available_billing_information_data_filter', $data);
366
+
367
+ }
368
+
369
+ public function available_shipping_information_data()
370
+ {
371
+
372
+ $keys = array(
373
+ 'shipping_first_name', 'shipping_last_name', 'shipping_company',
374
+ 'shipping_address_1', 'shipping_address_2', 'shipping_city',
375
+ 'shipping_postcode', 'shipping_country', 'shipping_state'
376
+ );
377
+
378
+ $data = $this->generate_friendly_titles($keys, 'shipping');
379
+
380
+ return apply_filters('wp_all_export_available_shipping_information_data_filter', $data);
381
+
382
+ }
383
+
384
+ public function generate_friendly_titles($keys, $keyword = ''){
385
+ $data = array();
386
+ foreach ($keys as $key) {
387
+
388
+ $key1 = $this->fix_titles(str_replace('_', ' ', $key));
389
+ $key2 = '';
390
+
391
+ if(strpos($key1, $keyword)!== false)
392
+ {
393
+ $key1 = str_replace($keyword, '', $key1);
394
+ $key2 = ' ('.__($keyword, 'wp_all_export_plugin').')';
395
+ }
396
+
397
+ $data[] = array(
398
+ 'name' => __(trim($key1), 'woocommerce').$key2,
399
+ 'label' => $key,
400
+ 'type' => 'cf'
401
+ );
402
+
403
+ }
404
+ return $data;
405
  }
406
+ /**
407
+ *
408
+ * Helper method to fix fields title
409
+ *
410
+ */
411
+ protected function fix_titles($field)
412
+ {
413
+ if (is_array($field))
414
+ {
415
+ $field['name'] = $this->fix_title($field['name']);
416
+ }
417
+ else
418
+ {
419
+ $field = $this->fix_title($field);
420
+ }
421
+ return $field;
422
+ }
423
+ /**
424
+ *
425
+ * Helper method to fix single title
426
+ *
427
+ */
428
+ protected function fix_title($title)
429
+ {
430
+ $uc_title = ucwords(trim(str_replace("_", " ", $title)));
431
+
432
+ return stripos($uc_title, "width") === false ? str_ireplace(array('id', 'url', 'sku'), array('ID', 'URL', 'SKU'), $uc_title) : $uc_title;
433
+ }
434
 
435
  /**
436
  * __get function.
libraries/XmlExportWooCommerce.php CHANGED
@@ -1,27 +1,9 @@
1
  <?php
2
 
3
- if ( ! class_exists('XmlExportWooCommerce') ){
4
-
5
  final class XmlExportWooCommerce
6
- {
7
-
8
- /**
9
- * Singletone instance
10
- * @var XmlExportWooCommerce
11
- */
12
- protected static $instance;
13
-
14
- /**
15
- * Return singletone instance
16
- * @return XmlExportWooCommerce
17
- */
18
- static public function getInstance() {
19
- if (self::$instance == NULL) {
20
- self::$instance = new self();
21
- }
22
- return self::$instance;
23
- }
24
-
25
  public static $products_data = null;
26
 
27
  private $init_fields = array(
@@ -37,102 +19,62 @@ if ( ! class_exists('XmlExportWooCommerce') ){
37
  )
38
  );
39
 
40
- private $_woo_data = array();
41
  private $_product_data = array();
42
 
43
  private static $_existing_attributes = array();
44
 
45
  public static $is_active = true;
46
 
47
- private function __construct(){
48
-
49
- if ( ! class_exists('WooCommerce')
50
- or ( XmlExportEngine::$exportOptions['export_type'] == 'specific' and ! in_array('product', XmlExportEngine::$post_types) )
51
- or ( XmlExportEngine::$exportOptions['export_type'] == 'advanced' and strpos(XmlExportEngine::$exportOptions['wp_query'], 'product') === false ) ) {
52
- self::$is_active = false;
53
- return;
54
- }
55
-
56
  $this->_woo_data = array(
57
  '_visibility', '_stock_status', '_downloadable', '_virtual', '_regular_price', '_sale_price', '_purchase_note', '_featured', '_weight', '_length',
58
  '_width', '_height', '_sku', '_sale_price_dates_from', '_sale_price_dates_to', '_price', '_sold_individually', '_manage_stock', '_stock', '_upsell_ids', '_crosssell_ids',
59
  '_downloadable_files', '_download_limit', '_download_expiry', '_download_type', '_product_url', '_button_text', '_backorders', '_tax_status', '_tax_class', '_product_image_gallery', '_default_attributes',
60
- 'total_sales', '_product_attributes', '_product_version', '_variation_description'
61
  );
62
 
63
  $this->_product_data = array('_sku', '_price', '_regular_price','_sale_price', '_stock_status', '_stock', '_visibility', '_product_url', 'total_sales', 'attributes');
64
 
 
 
 
 
 
 
 
 
 
65
  if ( empty(PMXE_Plugin::$session) ) // if cron execution
66
  {
67
  $id = $_GET['export_id'];
68
  $export = new PMXE_Export_Record();
69
  $export->getById($id);
70
- if ( ! $export->isEmpty() and $export->options['export_to'] == 'csv'){
71
  $this->init_additional_data();
72
  }
73
  }
74
  else
75
  {
76
- self::$products_data = PMXE_Plugin::$session->get('products_data');
 
 
 
 
 
77
  }
78
 
79
  add_filter("wp_all_export_init_fields", array( &$this, "filter_init_fields"), 10, 1);
80
  add_filter("wp_all_export_default_fields", array( &$this, "filter_default_fields"), 10, 1);
81
  add_filter("wp_all_export_other_fields", array( &$this, "filter_other_fields"), 10, 1);
82
  add_filter("wp_all_export_available_sections", array( &$this, "filter_available_sections"), 10, 1);
83
- add_filter("wp_all_export_available_data", array( &$this, "filter_available_data"), 10, 1);
84
- add_filter("wp_all_export_filters", array( &$this, "filter_export_filters"), 10, 1);
85
 
86
  }
87
 
88
  // [FILTERS]
89
-
90
- /**
91
- *
92
- * Filter data for advanced filtering
93
- *
94
- */
95
- public function filter_export_filters($filters){
96
-
97
- $filters['product_data'] = array(
98
- 'title' => __('Product Data', 'wp_all_export_plugin'),
99
- 'fields' => array()
100
- );
101
-
102
- foreach ($this->_product_data as $woo_key) {
103
-
104
- $filters['product_data']['fields']['cf_' . $woo_key] = ucwords(str_replace("_", " ", trim($woo_key, "_")));
105
-
106
- }
107
-
108
- $filters['product_data']['fields']['tx_product_shipping_class'] = 'Shipping Class';
109
-
110
- $filters['other'] = array(
111
- 'title' => __('Advanced', 'wp_all_export_plugin'),
112
- 'fields' => array()
113
- );
114
-
115
- if ( ! empty($this->_woo_data))
116
- {
117
- foreach ($this->_woo_data as $woo_key) {
118
- if ( ! in_array($woo_key, $this->_product_data))
119
- {
120
- $filters['other']['fields']['cf_' . $woo_key] = ucwords(str_replace("_", " ", trim($woo_key, "_")));
121
- }
122
- }
123
-
124
- if ( ! empty(self::$_existing_attributes) )
125
- {
126
- foreach (self::$_existing_attributes as $key => $tx_name) {
127
- $tx = get_taxonomy($tx_name);
128
- $filters['other']['fields']['tx_' . $tx_name] = $tx->label;
129
- }
130
- }
131
- }
132
-
133
- return $filters;
134
- }
135
-
136
  /**
137
  *
138
  * Filter Init Fields
@@ -164,55 +106,138 @@ if ( ! class_exists('XmlExportWooCommerce') ){
164
  */
165
  public function filter_other_fields($other_fields){
166
 
167
- if ( ! empty($this->_woo_data))
 
 
168
  {
169
- foreach ($this->_woo_data as $woo_key) {
170
-
171
- if ( strpos($woo_key, 'attribute_pa_') === 0 ) continue;
172
 
173
- if ( ! in_array($woo_key, $this->_product_data) )
174
- {
175
- $other_fields[] = array(
176
- 'name' => ucwords(str_replace("_", " ", trim($woo_key, "_"))),
177
- 'label' => $woo_key,
178
- 'type' => 'woo'
179
- );
180
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
- // add needed fields to auto generate list
184
- foreach ($other_fields as $key => $field)
185
  {
186
- if ( strpos($field['label'], '_min_') === 0 || strpos($field['label'], '_max_') === 0 )
187
- continue;
188
-
189
- $other_fields[$key]['auto'] = true;
190
- $other_fields[$key]['name'] = ucwords(str_replace("_", " ", trim($other_fields[$key]['name'])));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  }
192
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  if ( ! empty(self::$_existing_attributes) )
194
  {
195
  foreach (self::$_existing_attributes as $key => $tx_name) {
196
  $tx = get_taxonomy($tx_name);
197
- $other_fields[] = array(
198
  'name' => $tx->label,
199
  'label' => $tx_name,
200
  'type' => 'attr'
201
  );
202
  }
203
  }
204
- }
205
 
206
- return $other_fields;
207
- }
208
- /**
209
- *
210
- * Helper method to fix fields title
211
- *
212
- */
213
- protected function fix_titles($field){
214
- $field['name'] = ucwords(str_replace("_", " ", $field['name']));
215
- return $field;
 
 
216
  }
217
 
218
  /**
@@ -222,34 +247,20 @@ if ( ! class_exists('XmlExportWooCommerce') ){
222
  */
223
  public function filter_available_data($available_data){
224
  $available_data['woo_data'] = $this->_woo_data;
225
- $available_data['existing_attributes'] = self::$_existing_attributes;
226
- $available_data['product_fields'] = array();
227
-
228
- if ( ! empty($this->_product_data) )
229
- {
230
-
231
- foreach ($this->_product_data as $woo_key) {
232
-
233
- $available_data['product_fields'][] = array(
234
- 'name' => ucwords(str_replace("_", " ", trim($woo_key, "_"))),
235
- 'label' => $woo_key,
236
- 'type' => 'woo',
237
- 'auto' => true
238
- );
239
-
240
- }
241
- }
242
 
243
  if ( ! empty($available_data['existing_taxonomies']) ) {
244
  $existing_taxonomies = $available_data['existing_taxonomies'];
245
  $available_data['existing_taxonomies'] = array();
246
- foreach ($existing_taxonomies as $tx_name) {
247
- $tx = get_taxonomy($tx_name);
248
- if ($tx_name == 'product_shipping_class')
249
  {
250
  $available_data['product_fields'][] = array(
251
  'name' => 'Shipping Class',
252
- 'label' => $tx_name,
253
  'type' => 'cats',
254
  'auto' => true
255
  );
@@ -257,8 +268,8 @@ if ( ! class_exists('XmlExportWooCommerce') ){
257
  else
258
  {
259
  $available_data['existing_taxonomies'][] = array(
260
- 'name' => ($tx_name == 'product_type') ? 'Product Type' : $tx->label,
261
- 'label' => $tx_name,
262
  'type' => 'cats',
263
  'auto' => true
264
  );
@@ -267,7 +278,39 @@ if ( ! class_exists('XmlExportWooCommerce') ){
267
  }
268
 
269
  return $available_data;
270
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
 
272
  /**
273
  *
@@ -276,13 +319,23 @@ if ( ! class_exists('XmlExportWooCommerce') ){
276
  */
277
  public function filter_available_sections($available_sections){
278
 
279
- $available_sections['other']['title'] = __("Advanced", "wp_all_export_plugin");
280
 
281
  $product_data = array(
282
  'product_data' => array(
283
  'title' => __("Product Data", "wp_all_export_plugin"),
284
- 'content' => 'product_fields'
285
- )
 
 
 
 
 
 
 
 
 
 
286
  );
287
  return array_merge(array_slice($available_sections, 0, 1), $product_data, array_slice($available_sections, 1));
288
  }
@@ -295,37 +348,47 @@ if ( ! class_exists('XmlExportWooCommerce') ){
295
 
296
  $hide_fields = array('_edit_lock', '_edit_last');
297
 
298
- if ( ! empty($existing_meta_keys) )
299
- {
300
- foreach ($existing_meta_keys as $key => $record_meta_key) {
301
-
302
- if ( in_array($record_meta_key, $this->_woo_data) ) unset($existing_meta_keys[$key]);
303
-
304
- if ( strpos($record_meta_key, 'attribute_pa_') === 0 || strpos($record_meta_key, '_min_') === 0 || strpos($record_meta_key, '_max_') === 0){
305
- if ( ! in_array($record_meta_key, $this->_woo_data)){
306
- $this->_woo_data[] = $record_meta_key;
307
- unset($existing_meta_keys[$key]);
308
- }
309
-
310
- }
311
- }
312
- }
313
 
314
  global $wp_taxonomies;
315
 
316
  foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
317
 
318
- if (strpos($obj->name, "pa_") === 0 and strlen($obj->name) > 3)
319
  self::$_existing_attributes[] = $obj->name;
320
  }
321
 
322
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
 
324
  public function init_additional_data()
325
- {
326
  if ( ! self::$is_active ) return;
327
 
328
- if ( empty(self::$products_data) or 'PMXE_Admin_Manage' == PMXE_Plugin::getInstance()->getAdminCurrentScreen()->base )
 
 
329
  {
330
 
331
  self::$products_data = array();
@@ -345,18 +408,106 @@ if ( ! class_exists('XmlExportWooCommerce') ){
345
  }
346
  }
347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
  protected function prepare_export_data( $record, $options, $elId )
349
  {
350
  $data = array();
351
 
352
- if ( ! empty($options['cc_value'][$elId]) )
 
 
353
  {
354
  $implode_delimiter = ($options['delimiter'] == ',') ? '|' : ',';
355
 
356
  $element_name = ( ! empty($options['cc_name'][$elId]) ) ? $options['cc_name'][$elId] : 'untitled_' . $elId;
357
  $fieldSnipped = ( ! empty($options['cc_php'][$elId]) and ! empty($options['cc_code'][$elId]) ) ? $options['cc_code'][$elId] : false;
358
 
359
- switch ($options['cc_value'][$elId])
360
  {
361
  case 'attributes':
362
 
@@ -401,12 +552,13 @@ if ( ! class_exists('XmlExportWooCommerce') ){
401
  }
402
  else
403
  {
404
- $data[$element_name] = '';
405
  }
406
  }
407
  else
408
- {
409
- $data[$element_name] = apply_filters('pmxe_woo_attribute', get_post_meta($record->ID, 'attribute_' . $taxonomy_slug, true), $record->ID, $taxonomy_slug);
 
410
  }
411
 
412
  }
@@ -433,12 +585,12 @@ if ( ! class_exists('XmlExportWooCommerce') ){
433
 
434
  default:
435
 
436
- $cur_meta_values = get_post_meta($record->ID, $options['cc_value'][$elId]);
437
 
438
  if ( ! empty($cur_meta_values) and is_array($cur_meta_values) )
439
  {
440
  foreach ($cur_meta_values as $key => $cur_meta_value)
441
- {
442
  switch ($options['cc_label'][$elId])
443
  {
444
  case '_downloadable_files':
@@ -452,44 +604,67 @@ if ( ! class_exists('XmlExportWooCommerce') ){
452
  foreach ($files as $key => $file) {
453
  $file_paths[] = $file['file'];
454
  $file_names[] = $file['name'];
455
- }
456
-
457
- $data[$element_name . ' Paths'] = implode($implode_delimiter, $file_paths);
458
-
459
- $data[$element_name . ' Names'] = implode($implode_delimiter, $file_names);
460
 
461
  }
 
 
462
 
463
  break;
464
  case '_crosssell_ids':
465
  case '_upsell_ids':
466
- $_upsell_ids = maybe_unserialize($cur_meta_value);
467
- $_skus = array();
468
- if (!empty($_upsell_ids)){
469
- foreach ($_upsell_ids as $_upsell_id) {
470
- $_skus[] = get_post_meta($_upsell_id, '_sku', true);
471
- }
472
- $data[$element_name] = implode($implode_delimiter, $_skus);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  }
 
474
  break;
475
 
476
  default:
 
477
  if ( empty($data[$element_name]) )
478
  {
479
- $data[$element_name] = apply_filters('pmxe_woo_field', pmxe_filter(maybe_serialize($cur_meta_value), $fieldSnipped), $options['cc_value'][$elId], $record->ID);
480
  }
481
  else
482
  {
483
- $data[$element_name . '_' . $key] = apply_filters('pmxe_woo_field', pmxe_filter(maybe_serialize($cur_meta_value), $fieldSnipped), $options['cc_value'][$elId], $record->ID);
484
  }
 
485
  break;
486
  }
487
  }
488
  }
489
 
490
  if ( empty($cur_meta_values) )
491
- {
492
- $data[$element_name] = apply_filters('pmxe_woo_field', pmxe_filter('', $fieldSnipped), $options['cc_value'][$elId], $record->ID);
493
  }
494
 
495
  break;
@@ -501,21 +676,21 @@ if ( ! class_exists('XmlExportWooCommerce') ){
501
  }
502
 
503
  public function export_csv( & $article, & $titles, $record, $options, $element_key )
504
- {
505
- if ( ! self::$is_active ) return;
506
-
507
  $data_to_export = $this->prepare_export_data( $record, $options, $element_key );
508
 
509
  foreach ($data_to_export as $key => $data)
510
  {
511
- $article[$key] = $data;
 
512
  }
513
-
514
  }
515
 
516
  public function get_element_header( & $headers, $options, $element_key )
517
  {
518
- switch ($options['cc_value'][$element_key])
 
 
519
  {
520
  case 'attributes':
521
 
@@ -560,7 +735,28 @@ if ( ! class_exists('XmlExportWooCommerce') ){
560
 
561
  default:
562
 
563
- if ( ! in_array($options['cc_name'][$element_key], $headers)) $headers[] = $options['cc_name'][$element_key];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
564
 
565
  break;
566
  }
@@ -590,6 +786,223 @@ if ( ! class_exists('XmlExportWooCommerce') ){
590
 
591
  }
592
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
593
  /**
594
  * __get function.
595
  *
1
  <?php
2
 
3
+ if ( ! class_exists('XmlExportWooCommerce') )
4
+ {
5
  final class XmlExportWooCommerce
6
+ {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  public static $products_data = null;
8
 
9
  private $init_fields = array(
19
  )
20
  );
21
 
22
+ private $_woo_data = array();
23
  private $_product_data = array();
24
 
25
  private static $_existing_attributes = array();
26
 
27
  public static $is_active = true;
28
 
29
+ public function __construct()
30
+ {
 
 
 
 
 
 
 
31
  $this->_woo_data = array(
32
  '_visibility', '_stock_status', '_downloadable', '_virtual', '_regular_price', '_sale_price', '_purchase_note', '_featured', '_weight', '_length',
33
  '_width', '_height', '_sku', '_sale_price_dates_from', '_sale_price_dates_to', '_price', '_sold_individually', '_manage_stock', '_stock', '_upsell_ids', '_crosssell_ids',
34
  '_downloadable_files', '_download_limit', '_download_expiry', '_download_type', '_product_url', '_button_text', '_backorders', '_tax_status', '_tax_class', '_product_image_gallery', '_default_attributes',
35
+ 'total_sales', '_product_attributes', '_product_version', '_variation_description', '_wc_rating_count', '_wc_review_count', '_wc_average_rating'
36
  );
37
 
38
  $this->_product_data = array('_sku', '_price', '_regular_price','_sale_price', '_stock_status', '_stock', '_visibility', '_product_url', 'total_sales', 'attributes');
39
 
40
+ if ( ! class_exists('WooCommerce')
41
+ or ( XmlExportEngine::$exportOptions['export_type'] == 'specific' and ! in_array('product', XmlExportEngine::$post_types) )
42
+ or ( XmlExportEngine::$exportOptions['export_type'] == 'advanced' and strpos(XmlExportEngine::$exportOptions['wp_query'], 'product') === false ) ) {
43
+ self::$is_active = false;
44
+ return;
45
+ }
46
+
47
+ self::$is_active = true;
48
+
49
  if ( empty(PMXE_Plugin::$session) ) // if cron execution
50
  {
51
  $id = $_GET['export_id'];
52
  $export = new PMXE_Export_Record();
53
  $export->getById($id);
54
+ if ( $export->options['export_to'] == 'csv'){
55
  $this->init_additional_data();
56
  }
57
  }
58
  else
59
  {
60
+ self::$products_data = PMXE_Plugin::$session->get('products_data');
61
+
62
+ if (empty(self::$products_data))
63
+ {
64
+ $this->init_additional_data();
65
+ }
66
  }
67
 
68
  add_filter("wp_all_export_init_fields", array( &$this, "filter_init_fields"), 10, 1);
69
  add_filter("wp_all_export_default_fields", array( &$this, "filter_default_fields"), 10, 1);
70
  add_filter("wp_all_export_other_fields", array( &$this, "filter_other_fields"), 10, 1);
71
  add_filter("wp_all_export_available_sections", array( &$this, "filter_available_sections"), 10, 1);
72
+ add_filter("wp_all_export_available_data", array( &$this, "filter_available_data"), 10, 1);
 
73
 
74
  }
75
 
76
  // [FILTERS]
77
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  /**
79
  *
80
  * Filter Init Fields
106
  */
107
  public function filter_other_fields($other_fields){
108
 
109
+ $advanced_fields = $this->get_fields_for_product_advanced_section();
110
+
111
+ foreach ($advanced_fields as $advanced_field)
112
  {
113
+ $other_fields[] = $advanced_field;
114
+ }
 
115
 
116
+ // add needed fields to auto generate list
117
+ foreach ($other_fields as $key => $field)
118
+ {
119
+ if ( strpos($field['label'], '_min_') === 0 || strpos($field['label'], '_max_') === 0 )
120
+ continue;
121
+
122
+ if ( $field['type'] != 'attr' ) $other_fields[$key]['auto'] = true;
123
+
124
+ $other_fields[$key] = $this->fix_titles($other_fields[$key]);
125
+ }
126
+
127
+ return $other_fields;
128
+ }
129
+ /**
130
+ *
131
+ * Helper method to fix fields title
132
+ *
133
+ */
134
+ protected function fix_titles($field)
135
+ {
136
+ if (is_array($field))
137
+ {
138
+ $field['name'] = $this->fix_title($field['name']);
139
  }
140
+ else
141
+ {
142
+ $field = $this->fix_title($field);
143
+ }
144
+ return $field;
145
+ }
146
+ /**
147
+ *
148
+ * Helper method to fix single title
149
+ *
150
+ */
151
+ protected function fix_title($title)
152
+ {
153
+ $uc_title = ucwords(trim(str_replace("_", " ", $title)));
154
+
155
+ return stripos($uc_title, "width") === false ? str_ireplace(array('id', 'url', 'sku', 'wc'), array('ID', 'URL', 'SKU', 'WC'), $uc_title) : $uc_title;
156
+ }
157
+
158
+ // helper method
159
+ protected function get_fields_for_product_advanced_section()
160
+ {
161
+ $advanced_fields = array();
162
 
163
+ if ( ! empty($this->_woo_data))
 
164
  {
165
+ foreach ($this->_woo_data as $woo_key)
166
+ {
167
+ if ( strpos($woo_key, 'attribute_pa_') === 0 ) continue;
168
+
169
+ if ( ! in_array($woo_key, $this->_product_data) )
170
+ {
171
+ switch ($woo_key)
172
+ {
173
+ case '_upsell_ids':
174
+ $advanced_fields[] = array(
175
+ 'name' => 'Up-Sells',
176
+ 'label' => $woo_key,
177
+ 'type' => 'woo'
178
+ );
179
+ break;
180
+ case '_crosssell_ids':
181
+ $advanced_fields[] = array(
182
+ 'name' => 'Cross-Sells',
183
+ 'label' => $woo_key,
184
+ 'type' => 'woo'
185
+ );
186
+ break;
187
+
188
+ default:
189
+ $advanced_fields[] = $this->fix_titles(array(
190
+ 'name' => $woo_key,
191
+ 'label' => $woo_key,
192
+ 'type' => 'woo'
193
+ ));
194
+ break;
195
+ }
196
+ }
197
+ }
198
  }
199
+ return $advanced_fields;
200
+ }
201
+
202
+ protected function get_fields_for_product_attributes_section()
203
+ {
204
+ $attributes_fields = array();
205
+
206
+ if ( empty(self::$_existing_attributes) )
207
+ {
208
+ global $wp_taxonomies;
209
+
210
+ foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
211
+
212
+ if (strpos($obj->name, "pa_") === 0 and strlen($obj->name) > 3 and ! in_array($obj->name, self::$_existing_attributes))
213
+ self::$_existing_attributes[] = $obj->name;
214
+ }
215
+ }
216
+
217
  if ( ! empty(self::$_existing_attributes) )
218
  {
219
  foreach (self::$_existing_attributes as $key => $tx_name) {
220
  $tx = get_taxonomy($tx_name);
221
+ $attributes_fields[] = array(
222
  'name' => $tx->label,
223
  'label' => $tx_name,
224
  'type' => 'attr'
225
  );
226
  }
227
  }
 
228
 
229
+ if ( ! empty(self::$products_data['attributes']))
230
+ {
231
+ foreach (self::$products_data['attributes'] as $attribute) {
232
+ $attributes_fields[] = $this->fix_titles(array(
233
+ 'name' => str_replace('attribute_', '', $attribute->meta_key),
234
+ 'label' => $attribute->meta_key,
235
+ 'type' => 'cf'
236
+ ));
237
+ }
238
+ }
239
+
240
+ return $attributes_fields;
241
  }
242
 
243
  /**
247
  */
248
  public function filter_available_data($available_data){
249
  $available_data['woo_data'] = $this->_woo_data;
250
+ $available_data['existing_attributes'] = self::$_existing_attributes;
251
+ $available_data['product_fields'] = $this->get_fields_for_product_data_section();
252
+ // $available_data['product_attributes'] = $this->get_fields_for_product_attributes_section();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
 
254
  if ( ! empty($available_data['existing_taxonomies']) ) {
255
  $existing_taxonomies = $available_data['existing_taxonomies'];
256
  $available_data['existing_taxonomies'] = array();
257
+ foreach ($existing_taxonomies as $taxonomy) {
258
+ $tx = get_taxonomy($taxonomy['label']);
259
+ if ($taxonomy['label'] == 'product_shipping_class')
260
  {
261
  $available_data['product_fields'][] = array(
262
  'name' => 'Shipping Class',
263
+ 'label' => $taxonomy['label'],
264
  'type' => 'cats',
265
  'auto' => true
266
  );
268
  else
269
  {
270
  $available_data['existing_taxonomies'][] = array(
271
+ 'name' => ($taxonomy['label'] == 'product_type') ? 'Product Type' : $tx->label,
272
+ 'label' => $taxonomy['label'],
273
  'type' => 'cats',
274
  'auto' => true
275
  );
278
  }
279
 
280
  return $available_data;
281
+ }
282
+ // helper method
283
+ protected function get_fields_for_product_data_section()
284
+ {
285
+ $product_fields = array();
286
+ if ( ! empty($this->_product_data) )
287
+ {
288
+ foreach ($this->_product_data as $woo_key)
289
+ {
290
+ switch ($woo_key)
291
+ {
292
+ case '_product_url':
293
+ $product_fields[] = array(
294
+ 'name' => 'External Product URL',
295
+ 'label' => $woo_key,
296
+ 'type' => 'woo',
297
+ 'auto' => true
298
+ );
299
+ break;
300
+
301
+ default:
302
+ $product_fields[] = $this->fix_titles(array(
303
+ 'name' => $woo_key,
304
+ 'label' => $woo_key,
305
+ 'type' => 'woo',
306
+ 'auto' => true
307
+ ));
308
+ break;
309
+ }
310
+ }
311
+ }
312
+ return $product_fields;
313
+ }
314
 
315
  /**
316
  *
319
  */
320
  public function filter_available_sections($available_sections){
321
 
322
+ $available_sections['other']['title'] = __("Other", "wp_all_export_plugin");
323
 
324
  $product_data = array(
325
  'product_data' => array(
326
  'title' => __("Product Data", "wp_all_export_plugin"),
327
+ 'content' => 'product_fields',
328
+ 'additional' => array(
329
+ 'attributes' => array(
330
+ 'title' => __("Attributes", "wp_all_export_plugin"),
331
+ 'meta' => $this->get_fields_for_product_attributes_section()
332
+ )
333
+ )
334
+ ),
335
+ // 'product_attributes' => array(
336
+ // 'title' => __("Attributes", "wp_all_export_plugin"),
337
+ // 'content' => 'product_attributes'
338
+ // ),
339
  );
340
  return array_merge(array_slice($available_sections, 0, 1), $product_data, array_slice($available_sections, 1));
341
  }
348
 
349
  $hide_fields = array('_edit_lock', '_edit_last');
350
 
351
+ $this->filter_meta_keys( $existing_meta_keys );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
 
353
  global $wp_taxonomies;
354
 
355
  foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
356
 
357
+ if (strpos($obj->name, "pa_") === 0 and strlen($obj->name) > 3 and ! in_array($obj->name, self::$_existing_attributes))
358
  self::$_existing_attributes[] = $obj->name;
359
  }
360
 
361
  }
362
+ // helper method
363
+ protected function filter_meta_keys( & $meta_keys = array() )
364
+ {
365
+ if ( ! empty($meta_keys) )
366
+ {
367
+ foreach ($meta_keys as $key => $record_meta_key) {
368
+
369
+ if ( in_array($record_meta_key, $this->_woo_data) ) unset($meta_keys[$key]);
370
+
371
+ if ( strpos($record_meta_key, 'attribute_pa_') === 0 || strpos($record_meta_key, '_min_') === 0 || strpos($record_meta_key, '_max_') === 0){
372
+ if ( ! in_array($record_meta_key, $this->_woo_data)){
373
+ $this->_woo_data[] = $record_meta_key;
374
+ unset($meta_keys[$key]);
375
+ }
376
+ }
377
+ if ( strpos($record_meta_key, 'attribute_') === 0 && strpos($record_meta_key, 'attribute_pa_') === false )
378
+ {
379
+ unset($meta_keys[$key]);
380
+ }
381
+ }
382
+ }
383
+ }
384
 
385
  public function init_additional_data()
386
+ {
387
  if ( ! self::$is_active ) return;
388
 
389
+ $cs = PMXE_Plugin::getInstance()->getAdminCurrentScreen();
390
+
391
+ if ( empty(self::$products_data) or ! empty($cs) and 'PMXE_Admin_Manage' == $cs->base )
392
  {
393
 
394
  self::$products_data = array();
408
  }
409
  }
410
 
411
+ // [prepare fields for order items]
412
+ public function get_all_fields_for_order_items()
413
+ {
414
+ $meta_keys = wp_all_export_get_existing_meta_by_cpt('product');
415
+
416
+ $this->filter_meta_keys( $meta_keys );
417
+
418
+ $default_data = $this->get_default_fields_for_order_items();
419
+
420
+ $product_data = $this->get_fields_for_product_data_section();
421
+
422
+ $taxes_data = array();
423
+
424
+ foreach ($product_data as $field)
425
+ {
426
+ if ( ! in_array($field['label'], array('_sku', 'attributes'))) $default_data[] = $field;
427
+ }
428
+
429
+ $existing_taxonomies = wp_all_export_get_existing_taxonomies_by_cpt('product');
430
+
431
+ foreach ($existing_taxonomies as $taxonomy)
432
+ {
433
+ $tx = get_taxonomy($taxonomy['label']);
434
+ if ($taxonomy['label'] == 'product_shipping_class')
435
+ {
436
+ $product_data[] = array(
437
+ 'name' => 'Shipping Class',
438
+ 'label' => $taxonomy['name'],
439
+ 'type' => 'cats',
440
+ 'auto' => true
441
+ );
442
+ }
443
+ else
444
+ {
445
+ $taxes_data[] = array(
446
+ 'name' => ($taxonomy['label'] == 'product_type') ? 'Product Type' : $tx->label,
447
+ 'label' => $taxonomy['label'],
448
+ 'type' => 'cats',
449
+ 'auto' => true
450
+ );
451
+ }
452
+ }
453
+
454
+ return array(
455
+ 'product_data' => array(
456
+ 'title' => __('Product Data', 'wp_all_export_plugin'),
457
+ 'meta' => $default_data,
458
+ // 'additional' => array(
459
+ // 'attributes' => array(
460
+ // 'title' => __("Attributes", "wp_all_export_plugin"),
461
+ // 'meta' => $this->get_fields_for_product_attributes_section()
462
+ // )
463
+ // )
464
+ ),
465
+ 'taxonomies' => array(
466
+ 'title' => __('Taxonomies', 'wp_all_export_plugin'),
467
+ 'meta' => $taxes_data
468
+ ),
469
+ 'cf' => array(
470
+ 'title' => __('Custom Fields', 'wp_all_export_plugin'),
471
+ 'meta' => $meta_keys
472
+ ),
473
+ 'attributes' => array(
474
+ 'title' => __('Attributes', 'wp_all_export_plugin'),
475
+ 'meta' => $this->get_fields_for_product_attributes_section()
476
+ ),
477
+ 'advanced' => array(
478
+ 'title' => __('Advanced', 'wp_all_export_plugin'),
479
+ 'meta' => $this->get_fields_for_product_advanced_section()
480
+ )
481
+ );
482
+ }
483
+ // helper method
484
+ protected function get_default_fields_for_order_items()
485
+ {
486
+ $exclude_default_fields = array('id', 'title', 'permalink');
487
+
488
+ $default_fields = array();
489
+ foreach (XmlExportEngine::$default_fields as $field)
490
+ {
491
+ if ( ! in_array($field['type'], $exclude_default_fields) ) $default_fields[] = $field;
492
+ }
493
+ return $default_fields;
494
+ }
495
+ // [\prepare fields for order items]
496
+
497
  protected function prepare_export_data( $record, $options, $elId )
498
  {
499
  $data = array();
500
 
501
+ $element_value = str_replace("item_data__", "", $options['cc_value'][$elId]);
502
+
503
+ if ( ! empty($element_value) )
504
  {
505
  $implode_delimiter = ($options['delimiter'] == ',') ? '|' : ',';
506
 
507
  $element_name = ( ! empty($options['cc_name'][$elId]) ) ? $options['cc_name'][$elId] : 'untitled_' . $elId;
508
  $fieldSnipped = ( ! empty($options['cc_php'][$elId]) and ! empty($options['cc_code'][$elId]) ) ? $options['cc_code'][$elId] : false;
509
 
510
+ switch ($element_value)
511
  {
512
  case 'attributes':
513
 
552
  }
553
  else
554
  {
555
+ $data[$element_name] = pmxe_filter('', $fieldSnipped);
556
  }
557
  }
558
  else
559
+ {
560
+ $variation_attribute = get_post_meta($record->ID, 'attribute_' . $taxonomy_slug, true);
561
+ $data[$element_name] = apply_filters('pmxe_woo_attribute', pmxe_filter($variation_attribute, $fieldSnipped), $record->ID, $taxonomy_slug);
562
  }
563
 
564
  }
585
 
586
  default:
587
 
588
+ $cur_meta_values = get_post_meta($record->ID, $element_value);
589
 
590
  if ( ! empty($cur_meta_values) and is_array($cur_meta_values) )
591
  {
592
  foreach ($cur_meta_values as $key => $cur_meta_value)
593
+ {
594
  switch ($options['cc_label'][$elId])
595
  {
596
  case '_downloadable_files':
604
  foreach ($files as $key => $file) {
605
  $file_paths[] = $file['file'];
606
  $file_names[] = $file['name'];
607
+ }
 
 
 
 
608
 
609
  }
610
+ $data[$element_name . ' Paths'] = pmxe_filter(implode($implode_delimiter, $file_paths), $fieldSnipped);
611
+ $data[$element_name . ' Names'] = pmxe_filter(implode($implode_delimiter, $file_names), $fieldSnipped);
612
 
613
  break;
614
  case '_crosssell_ids':
615
  case '_upsell_ids':
616
+
617
+ $sell_export_type = empty($options['cc_settings'][$elId]) ? 'sku' : $options['cc_settings'][$elId];
618
+
619
+ $_ids = maybe_unserialize($cur_meta_value);
620
+ $_values = array();
621
+ if (!empty($_ids)){
622
+
623
+ switch ($sell_export_type) {
624
+ case 'sku':
625
+ foreach ($_ids as $_id) {
626
+ $_values[] = get_post_meta($_id, '_sku', true);
627
+ }
628
+ break;
629
+ case 'id':
630
+ $_values = $_ids;
631
+ break;
632
+ case 'name':
633
+ foreach ($_ids as $_id) {
634
+ $p = get_post($_id);
635
+ if ($p)
636
+ {
637
+ $_values[] = $p->post_name;
638
+ }
639
+ }
640
+ break;
641
+ default:
642
+ # code...
643
+ break;
644
+ }
645
  }
646
+ $data[$element_name] = apply_filters('pmxe_woo_field', pmxe_filter(implode($implode_delimiter, $_values), $fieldSnipped), $element_value, $record->ID);
647
  break;
648
 
649
  default:
650
+
651
  if ( empty($data[$element_name]) )
652
  {
653
+ $data[$element_name] = apply_filters('pmxe_woo_field', pmxe_filter(maybe_serialize($cur_meta_value), $fieldSnipped), $element_value, $record->ID);
654
  }
655
  else
656
  {
657
+ $data[$element_name . '_' . $key] = apply_filters('pmxe_woo_field', pmxe_filter(maybe_serialize($cur_meta_value), $fieldSnipped), $element_value, $record->ID);
658
  }
659
+
660
  break;
661
  }
662
  }
663
  }
664
 
665
  if ( empty($cur_meta_values) )
666
+ {
667
+ $data[$element_name] = apply_filters('pmxe_woo_field', pmxe_filter('', $fieldSnipped), $element_value, $record->ID);
668
  }
669
 
670
  break;
676
  }
677
 
678
  public function export_csv( & $article, & $titles, $record, $options, $element_key )
679
+ {
 
 
680
  $data_to_export = $this->prepare_export_data( $record, $options, $element_key );
681
 
682
  foreach ($data_to_export as $key => $data)
683
  {
684
+ // $article[$key] = $data;
685
+ wp_all_export_write_article( $article, $key, $data );
686
  }
 
687
  }
688
 
689
  public function get_element_header( & $headers, $options, $element_key )
690
  {
691
+ $element_value = str_replace("item_data__", "", $options['cc_value'][$element_key]);
692
+
693
+ switch ($element_value)
694
  {
695
  case 'attributes':
696
 
735
 
736
  default:
737
 
738
+ if ( ! in_array($options['cc_name'][$element_key], $headers))
739
+ {
740
+ $headers[] = $options['cc_name'][$element_key];
741
+ }
742
+ else
743
+ {
744
+ $is_added = false;
745
+ $i = 0;
746
+ do
747
+ {
748
+ $new_element_name = $options['cc_name'][$element_key] . '_' . md5($i);
749
+
750
+ if ( ! in_array($new_element_name, $headers) )
751
+ {
752
+ $headers[] = $new_element_name;
753
+ $is_added = true;
754
+ }
755
+
756
+ $i++;
757
+ }
758
+ while ( ! $is_added );
759
+ }
760
 
761
  break;
762
  }
786
 
787
  }
788
 
789
+ public static function prepare_import_template( $exportOptions, &$templateOptions, &$cf_list, &$attr_list, $element_name, $element_key )
790
+ {
791
+ if ( ! in_array($element_key, $cf_list)) $cf_list[] = $element_key;
792
+
793
+ $is_xml_template = $exportOptions['export_to'] == 'xml';
794
+
795
+ $implode_delimiter = ($exportOptions['delimiter'] == ',') ? '|' : ',';
796
+
797
+ switch ($element_key)
798
+ {
799
+ case '_visibility':
800
+ $templateOptions['is_product_visibility'] = 'xpath';
801
+ $templateOptions['single_product_visibility'] = '{'. $element_name .'[1]}';
802
+ break;
803
+ case '_stock_status':
804
+ $templateOptions['product_stock_status'] = 'xpath';
805
+ $templateOptions['single_product_stock_status'] = '{'. $element_name .'[1]}';
806
+ break;
807
+ case '_downloadable':
808
+ $templateOptions['is_product_downloadable'] = 'xpath';
809
+ $templateOptions['single_product_downloadable'] = '{'. $element_name .'[1]}';
810
+ break;
811
+ case '_virtual':
812
+ $templateOptions['is_product_virtual'] = 'xpath';
813
+ $templateOptions['single_product_virtual'] = '{'. $element_name .'[1]}';
814
+ break;
815
+ case '_price':
816
+ $templateOptions['single_product_regular_price'] = '{'. $element_name .'[1]}';
817
+ break;
818
+ case '_regular_price':
819
+ $templateOptions['single_product_regular_price'] = '{'. $element_name .'[1]}';
820
+ if ( ! in_array('_price', $cf_list)) $cf_list[] = '_price';
821
+ break;
822
+ case '_sale_price':
823
+ $templateOptions['single_product_sale_price'] = '{'. $element_name .'[1]}';
824
+ if ( ! in_array('_price', $cf_list)) $cf_list[] = '_price';
825
+ break;
826
+ case '_purchase_note':
827
+ $templateOptions['single_product_purchase_note'] = '{'. $element_name .'[1]}';
828
+ break;
829
+ case '_featured':
830
+ $templateOptions['is_product_featured'] = 'xpath';
831
+ $templateOptions['single_product_featured'] = '{'. $element_name .'[1]}';
832
+ break;
833
+ case '_weight':
834
+ $templateOptions['single_product_weight'] = '{'. $element_name .'[1]}';
835
+ break;
836
+ case '_length':
837
+ $templateOptions['single_product_length'] = '{'. $element_name .'[1]}';
838
+ break;
839
+ case '_width':
840
+ $templateOptions['single_product_width'] = '{'. $element_name .'[1]}';
841
+ break;
842
+ case '_height':
843
+ $templateOptions['single_product_height'] = '{'. $element_name .'[1]}';
844
+ break;
845
+ case '_sku':
846
+ $templateOptions['single_product_sku'] = '{'. $element_name .'[1]}';
847
+ $templateOptions['single_product_parent_id'] = '{parent_id[1]}';
848
+ break;
849
+ case '_sale_price_dates_from':
850
+ $templateOptions['single_sale_price_dates_from'] = '{'. $element_name .'[1]}';
851
+ break;
852
+ case '_sale_price_dates_to':
853
+ $templateOptions['single_sale_price_dates_to'] = '{'. $element_name .'[1]}';
854
+ break;
855
+ case '_sold_individually':
856
+ $templateOptions['product_sold_individually'] = 'xpath';
857
+ $templateOptions['single_product_sold_individually'] = '{'. $element_name .'[1]}';
858
+ break;
859
+ case '_manage_stock':
860
+ $templateOptions['is_product_manage_stock'] = 'xpath';
861
+ $templateOptions['single_product_manage_stock'] = '{'. $element_name .'[1]}';
862
+ break;
863
+ case '_stock':
864
+ $templateOptions['single_product_stock_qty'] = '{'. $element_name .'[1]}';
865
+ break;
866
+ case '_upsell_ids':
867
+
868
+ if ($implode_delimiter == "|")
869
+ $templateOptions['single_product_up_sells'] = '[str_replace("|", ",",{' . $element_name . '[1]})]';
870
+ else
871
+ $templateOptions['single_product_up_sells'] = '{' . $element_name . '[1]}';
872
+
873
+ break;
874
+ case '_crosssell_ids':
875
+
876
+ if ($implode_delimiter == "|")
877
+ $templateOptions['single_product_cross_sells'] = '[str_replace("|", ",",{' . $element_name . '[1]})]';
878
+ else
879
+ $templateOptions['single_product_cross_sells'] = '{' . $element_name . '[1]}';
880
+
881
+ break;
882
+ case '_downloadable_files':
883
+ $templateOptions['single_product_files'] = '{'. $element_name .'_paths[1]}';
884
+ $templateOptions['single_product_files_names'] = '{'. $element_name .'_names[1]}';
885
+ break;
886
+ case '_download_limit':
887
+ $templateOptions['single_product_download_limit'] = '{'. $element_name .'[1]}';
888
+ break;
889
+ case '_download_expiry':
890
+ $templateOptions['single_product_download_expiry'] = '{'. $element_name .'[1]}';
891
+ break;
892
+ case '_download_type':
893
+ $templateOptions['single_product_download_type'] = '{'. $element_name .'[1]}';
894
+ break;
895
+ case '_product_url':
896
+ $templateOptions['single_product_url'] = '{'. $element_name .'[1]}';
897
+ break;
898
+ case '_button_text':
899
+ $templateOptions['single_product_button_text'] = '{'. $element_name .'[1]}';
900
+ break;
901
+ case '_tax_status':
902
+ $templateOptions['is_multiple_product_tax_status'] = 'no';
903
+ $templateOptions['single_product_tax_status'] = '{'. $element_name .'[1]}';
904
+ break;
905
+ case '_tax_class':
906
+ $templateOptions['is_multiple_product_tax_class'] = 'no';
907
+ $templateOptions['single_product_tax_class'] = '{'. $element_name .'[1]}';
908
+ break;
909
+ case '_backorders':
910
+ $templateOptions['product_allow_backorders'] = 'xpath';
911
+ $templateOptions['single_product_allow_backorders'] = '{'. $element_name .'[1]}';
912
+ break;
913
+ case 'attributes':
914
+
915
+ global $wp_taxonomies;
916
+
917
+ foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
918
+
919
+ if (strpos($obj->name, "pa_") === 0 and strlen($obj->name) > 3)
920
+ {
921
+ if ($is_xml_template)
922
+ {
923
+ $templateOptions['attribute_name'][] = '{AttributeName' . $obj->name .'[1]}';
924
+ $templateOptions['attribute_value'][] = '{AttributeValue' . $obj->name .'[1]}';
925
+ $templateOptions['advanced_in_variations_xpath'][] = '{AttributeInVariations' . $obj->name .'[1]}';
926
+ $templateOptions['advanced_is_visible_xpath'][] = '{AttributeIsVisible' . $obj->name .'[1]}';
927
+ $templateOptions['advanced_is_taxonomy_xpath'][] = '{AttributeIsTaxonomy' . $obj->name .'[1]}';
928
+ }
929
+ else
930
+ {
931
+ $attribute_name = preg_replace('/[^a-z0-9_]/i', '', $obj->name);
932
+ $templateOptions['attribute_name'][] = '{attributename' . $attribute_name .'[1]}';
933
+ $templateOptions['attribute_value'][] = '{attributevalue' . $attribute_name .'[1]}';
934
+ $templateOptions['advanced_in_variations_xpath'][] = '{attributeinvariations' . $attribute_name .'[1]}';
935
+ $templateOptions['advanced_is_visible_xpath'][] = '{attributeisvisible' . $attribute_name .'[1]}';
936
+ $templateOptions['advanced_is_taxonomy_xpath'][] = '{attributeistaxonomy' . $attribute_name .'[1]}';
937
+ }
938
+
939
+ $templateOptions['in_variations'][] = "1";
940
+ $templateOptions['is_visible'][] = "1";
941
+ $templateOptions['is_taxonomy'][] = "1";
942
+ $templateOptions['create_taxonomy_in_not_exists'][] = "1";
943
+
944
+ $templateOptions['is_advanced'][] = "1";
945
+ $templateOptions['advanced_is_create_terms'][] = "yes";
946
+ $templateOptions['advanced_in_variations'][] = "xpath";
947
+ $templateOptions['advanced_is_visible'][] = "xpath";
948
+ $templateOptions['advanced_is_taxonomy'][] = "xpath";
949
+
950
+ $attr_list[] = $obj->name;
951
+ }
952
+ }
953
+
954
+ global $wpdb;
955
+
956
+ $table_prefix = $wpdb->prefix;
957
+
958
+ $attributes = $wpdb->get_results($wpdb->prepare("SELECT DISTINCT meta_key FROM {$table_prefix}postmeta
959
+ WHERE {$table_prefix}postmeta.meta_key LIKE %s AND {$table_prefix}postmeta.meta_key NOT LIKE %s", 'attribute_%', 'attribute_pa_%'));
960
+
961
+ if ( ! empty($attributes))
962
+ {
963
+ foreach ($attributes as $attribute)
964
+ {
965
+ if ($is_xml_template)
966
+ {
967
+ $attribute_name = ucfirst(str_replace('attribute_', '', $attribute->meta_key));
968
+ $templateOptions['attribute_name'][] = '{AttributeName' . $attribute_name .'[1]}';
969
+ $templateOptions['attribute_value'][] = '{AttributeValue' . $attribute_name .'[1]}';
970
+ $templateOptions['advanced_in_variations_xpath'][] = '{AttributeInVariations' . $attribute_name .'[1]}';
971
+ $templateOptions['advanced_is_visible_xpath'][] = '{AttributeIsVisible' . $attribute_name .'[1]}';
972
+ $templateOptions['advanced_is_taxonomy_xpath'][] = '{AttributeIsTaxonomy' . $attribute_name .'[1]}';
973
+ }
974
+ else
975
+ {
976
+ $attribute_name = preg_replace('/[^a-z0-9_]/i', '', str_replace('attribute_', '', $attribute->meta_key));
977
+ $templateOptions['attribute_name'][] = '{attributename' . $attribute_name .'[1]}';
978
+ $templateOptions['attribute_value'][] = '{attributevalue' . $attribute_name .'[1]}';
979
+ $templateOptions['advanced_in_variations_xpath'][] = '{attributeinvariations' . $attribute_name .'[1]}';
980
+ $templateOptions['advanced_is_visible_xpath'][] = '{attributeisvisible' . $attribute_name .'[1]}';
981
+ $templateOptions['advanced_is_taxonomy_xpath'][] = '{attributeistaxonomy' . $attribute_name .'[1]}';
982
+ }
983
+
984
+ $templateOptions['in_variations'][] = "1";
985
+ $templateOptions['is_visible'][] = "1";
986
+ $templateOptions['is_taxonomy'][] = "1";
987
+ $templateOptions['create_taxonomy_in_not_exists'][] = "1";
988
+
989
+ $templateOptions['is_advanced'][] = "1";
990
+ $templateOptions['advanced_is_create_terms'][] = "yes";
991
+ $templateOptions['advanced_in_variations'][] = "xpath";
992
+ $templateOptions['advanced_is_visible'][] = "xpath";
993
+ $templateOptions['advanced_is_taxonomy'][] = "xpath";
994
+
995
+ $attr_list[] = str_replace('attribute_', '', $attribute->meta_key);
996
+ }
997
+ }
998
+
999
+ break;
1000
+ default:
1001
+ # code...
1002
+ break;
1003
+ }
1004
+ }
1005
+
1006
  /**
1007
  * __get function.
1008
  *
libraries/XmlExportWooCommerceCoupon.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists('XmlExportWooCommerceCoupon') )
4
+ {
5
+ final class XmlExportWooCommerceCoupon
6
+ {
7
+ public static $is_active = true;
8
+
9
+ public $init_fields = array(
10
+ array(
11
+ 'name' => 'Coupon ID',
12
+ 'type' => 'id',
13
+ 'options' => '',
14
+ 'label' => 'id'
15
+ ),
16
+ array(
17
+ 'name' => 'Coupon Code',
18
+ 'type' => 'title',
19
+ 'options' => '',
20
+ 'label' => 'title'
21
+ ),
22
+ array(
23
+ 'name' => 'Expiry Date',
24
+ 'type' => 'cf',
25
+ 'options' => '',
26
+ 'label' => 'expiry_date'
27
+ )
28
+ );
29
+
30
+ public $default_fields = array(
31
+ array(
32
+ 'name' => 'Coupon ID',
33
+ 'type' => 'id',
34
+ 'label' => 'id'
35
+ ),
36
+ array(
37
+ 'name' => 'Coupon Code',
38
+ 'type' => 'title',
39
+ 'label' => 'title'
40
+ ),
41
+ array(
42
+ 'name' => 'Coupon Description',
43
+ 'type' => 'excerpt',
44
+ 'label' => 'excerpt'
45
+ ),
46
+ array(
47
+ 'name' => 'Discount Type',
48
+ 'type' => 'cf',
49
+ 'label' => 'discount_type'
50
+ ),
51
+ array(
52
+ 'name' => 'Coupon Amount',
53
+ 'type' => 'cf',
54
+ 'label' => 'coupon_amount'
55
+ ),
56
+ array(
57
+ 'name' => 'Expiry Date',
58
+ 'type' => 'cf',
59
+ 'label' => 'expiry_date'
60
+ ),
61
+ array(
62
+ 'name' => 'Free Shipping',
63
+ 'type' => 'cf',
64
+ 'label' => 'free_shipping'
65
+ ),
66
+ array(
67
+ 'name' => 'Exclude Sale Items',
68
+ 'type' => 'cf',
69
+ 'label' => 'exclude_sale_items'
70
+ )
71
+ );
72
+
73
+ public $other_fields = array(
74
+ array(
75
+ 'label' => 'status',
76
+ 'name' => 'Status',
77
+ 'type' => 'status'
78
+ ),
79
+ array(
80
+ 'label' => 'author',
81
+ 'name' => 'Author',
82
+ 'type' => 'author'
83
+ ),
84
+ array(
85
+ 'label' => 'slug',
86
+ 'name' => 'Slug',
87
+ 'type' => 'slug'
88
+ ),
89
+ array(
90
+ 'label' => 'date',
91
+ 'name' => 'Date',
92
+ 'type' => 'date'
93
+ ),
94
+ array(
95
+ 'label' => 'post_type',
96
+ 'name' => 'Post Type',
97
+ 'type' => 'post_type'
98
+ )
99
+ );
100
+
101
+
102
+ private $_coupon_data = array();
103
+
104
+ public function __construct()
105
+ {
106
+ if ( ! class_exists('WooCommerce')
107
+ or ( XmlExportEngine::$exportOptions['export_type'] == 'specific' and ! in_array('shop_coupon', XmlExportEngine::$post_types) )
108
+ or ( XmlExportEngine::$exportOptions['export_type'] == 'advanced' and strpos(XmlExportEngine::$exportOptions['wp_query'], 'shop_coupon') === false ) ) {
109
+ self::$is_active = false;
110
+ return;
111
+ }
112
+
113
+ self::$is_active = true;
114
+
115
+ $this->_coupon_data = array(
116
+ 'discount_type', 'coupon_amount', 'expiry_date', 'free_shipping', 'exclude_sale_items'
117
+ );
118
+
119
+ add_filter("wp_all_export_default_fields", array( &$this, "filter_default_fields"), 10, 1);
120
+ add_filter("wp_all_export_other_fields", array( &$this, "filter_other_fields"), 10, 1);
121
+ add_filter("wp_all_export_available_data", array( &$this, "filter_available_data"), 10, 1);
122
+ add_filter("wp_all_export_available_sections", array( &$this, "filter_available_sections" ), 10, 1);
123
+ add_filter("wp_all_export_init_fields", array( &$this, "filter_init_fields"), 10, 1);
124
+
125
+ }
126
+
127
+ // [FILTERS]
128
+
129
+ /**
130
+ *
131
+ * Filter Init Fields
132
+ *
133
+ */
134
+ public function filter_init_fields($init_fields){
135
+ return $this->init_fields;
136
+ }
137
+
138
+ /**
139
+ *
140
+ * Filter Default Fields
141
+ *
142
+ */
143
+ public function filter_default_fields($default_fields){
144
+ return $this->default_fields;
145
+ }
146
+
147
+ /**
148
+ *
149
+ * Filter Other Fields
150
+ *
151
+ */
152
+ public function filter_other_fields($other_fields){
153
+ return $this->other_fields;
154
+ }
155
+
156
+ /**
157
+ *
158
+ * Filter Available Data
159
+ *
160
+ */
161
+ public function filter_available_data($available_data){
162
+
163
+ $available_data['existing_meta_keys'] = array_merge($available_data['other_fields'], $available_data['existing_meta_keys']);
164
+
165
+ return $available_data;
166
+ }
167
+
168
+ /**
169
+ *
170
+ * Filter Sections in Available Data
171
+ *
172
+ */
173
+ public function filter_available_sections($sections){
174
+ unset($sections['media']);
175
+ unset($sections['other']);
176
+ $sections['cf']['title'] = __("Other", "wp_all_export_plugin");
177
+ return $sections;
178
+ }
179
+
180
+ // [\FILTERS]
181
+
182
+ public function init( & $existing_meta_keys = array() ){
183
+
184
+ if ( ! self::$is_active ) return;
185
+
186
+ if ( ! empty($existing_meta_keys) )
187
+ {
188
+ foreach ($existing_meta_keys as $key => $record_meta_key)
189
+ {
190
+ if ( in_array($record_meta_key, $this->_coupon_data) )
191
+ {
192
+ unset($existing_meta_keys[$key]);
193
+ }
194
+ }
195
+ }
196
+ }
197
+ }
198
+ }
libraries/XmlExportWooCommerceOrder.php CHANGED
@@ -1,26 +1,9 @@
1
  <?php
2
 
3
- if ( ! class_exists('XmlExportWooCommerceOrder') ){
4
-
5
  final class XmlExportWooCommerceOrder
6
- {
7
- /**
8
- * Singletone instance
9
- * @var XmlExportWooCommerceOrder
10
- */
11
- protected static $instance;
12
-
13
- /**
14
- * Return singletone instance
15
- * @return XmlExportWooCommerceOrder
16
- */
17
- static public function getInstance() {
18
- if (self::$instance == NULL) {
19
- self::$instance = new self();
20
- }
21
- return self::$instance;
22
- }
23
-
24
  public static $is_active = true;
25
 
26
  public static $order_sections = array();
@@ -47,43 +30,22 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
47
  'options' => 'order',
48
  'label' => 'post_title'
49
  )
50
- );
51
 
52
- private $filter_sections = array();
53
 
54
- private function __construct()
55
  {
 
56
 
57
  if ( ! class_exists('WooCommerce')
58
  or ( XmlExportEngine::$exportOptions['export_type'] == 'specific' and ! in_array('shop_order', XmlExportEngine::$post_types) )
59
  or ( XmlExportEngine::$exportOptions['export_type'] == 'advanced' and strpos(XmlExportEngine::$exportOptions['wp_query'], 'shop_order') === false ) ) {
60
  self::$is_active = false;
61
  return;
62
- }
63
- $this->filter_sections = array(
64
- 'general' => array(
65
- 'title' => __("Order", "wp_all_export_plugin"),
66
- 'fields' => array(
67
- 'ID' => __('Order ID', 'wp_all_export_plugin'),
68
- 'cf__order_key' => __('Order Key', 'wp_all_export_plugin'),
69
- 'post_date' => __('Order Date', 'wp_all_export_plugin'),
70
- 'cf__completed_date' => __('Completed Date', 'wp_all_export_plugin'),
71
- 'post_title' => __('Title', 'wp_all_export_plugin'),
72
- 'post_status' => __('Order Status', 'wp_all_export_plugin'),
73
- 'cf__order_currency' => __('Order Currency', 'wp_all_export_plugin'),
74
- 'cf__payment_method_title' => __('Payment Method', 'wp_all_export_plugin'),
75
- 'cf__order_total' => __('Order Total', 'wp_all_export_plugin')
76
- )
77
- ),
78
- 'customer' => array(
79
- 'title' => __("Customer", "wp_all_export_plugin"),
80
- 'fields' => array()
81
- )
82
- );
83
 
84
- foreach ($this->available_customer_data() as $key => $value) {
85
- $this->filter_sections['customer']['fields'][($key == 'post_excerpt') ? $key : 'cf_' . $key] = $value;
86
- }
87
 
88
  if ( empty(PMXE_Plugin::$session) ) // if cron execution
89
  {
@@ -96,39 +58,18 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
96
  }
97
  else
98
  {
99
- self::$orders_data = PMXE_Plugin::$session->get('orders_data');
100
  }
101
 
102
- add_filter("wp_all_export_available_sections", array( &$this, "filter_available_sections" ), 10, 1);
103
- add_filter("wp_all_export_available_filter_sections", array( &$this, "filter_available_filter_sections" ), 10, 1);
104
- add_filter("wp_all_export_init_fields", array( &$this, "filter_init_fields"), 10, 1);
105
- add_filter("wp_all_export_filters", array( &$this, "filter_export_filters"), 10, 1);
106
 
107
  self::$order_sections = $this->available_sections();
108
 
109
  }
110
 
111
- // [FILTERS]
112
-
113
- /**
114
- *
115
- * Filter data for advanced filtering
116
- *
117
- */
118
- public function filter_export_filters($filters){
119
- return $this->filter_sections;
120
- }
121
-
122
- /**
123
- *
124
- * Filter sections for advanced filtering
125
- *
126
- */
127
- public function filter_available_filter_sections($sections){
128
- unset($sections['cats']);
129
- $sections['cf']['title'] = __('Advanced', 'wp_all_export_plugin');
130
- return $sections;
131
- }
132
 
133
  /**
134
  *
@@ -172,6 +113,19 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
172
 
173
  endforeach;
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  foreach ($existing_meta_keys as $key => $record_meta_key)
176
  {
177
  self::$order_sections['cf']['meta'][$record_meta_key] = array(
@@ -192,16 +146,55 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
192
  if ( ! empty($meta_keys)){
193
  foreach ($meta_keys as $meta_key) {
194
  if (strpos($meta_key->meta_key, "pa_") !== 0 and empty(self::$order_sections['cf']['meta'][$meta_key->meta_key]) and empty($product_data[$meta_key->meta_key]))
195
- self::$order_sections['cf']['meta'][$meta_key->meta_key] = array(
196
- 'name' => $meta_key->meta_key,
197
- 'label' => $meta_key->meta_key,
198
  'options' => 'items',
199
- 'type' => 'woo_order'
200
- );
201
  }
202
  }
203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  }
 
 
 
 
 
 
 
 
 
 
 
205
 
206
  public function init_additional_data(){
207
 
@@ -218,24 +211,36 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
218
  private $__coupons_used = null;
219
  private $order_id = null;
220
 
221
- protected function prepare_export_data( $record, $options, $elId ){
 
 
 
 
 
 
 
 
222
 
223
  // an array with data to export
224
- $data = array();
 
 
 
 
 
 
225
 
226
  global $wpdb;
227
- $table_prefix = $wpdb->prefix;
228
 
229
- if ( ! empty($options['cc_value'][$elId]) ){
230
-
231
- $fieldSnipped = ( ! empty($options['cc_php'][$elId]) and ! empty($options['cc_code'][$elId]) ) ? $options['cc_code'][$elId] : false;
232
 
233
  switch ($options['cc_options'][$elId]) {
234
 
235
  case 'order':
236
  case 'customer':
237
 
238
- $data[$options['cc_name'][$elId]] = ( strpos($options['cc_value'][$elId], "_") === 0 ) ? get_post_meta($record->ID, $options['cc_value'][$elId], true) : $record->$options['cc_value'][$elId];
239
 
240
  if ($options['cc_value'][$elId] == "post_title")
241
  {
@@ -244,7 +249,7 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
244
 
245
  $data[$options['cc_name'][$elId]] = pmxe_filter( $data[$options['cc_name'][$elId]], $fieldSnipped);
246
 
247
- break;
248
  }
249
 
250
  }
@@ -252,27 +257,263 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
252
  return $data;
253
  }
254
 
255
- private $additional_articles = array();
256
 
257
- public function export_csv( & $article, & $titles, $record, $options, $elId ){
258
 
259
  if ( ! self::$is_active ) return;
260
 
261
- $data_to_export = $this->prepare_export_data( $record, $options, $elId );
262
 
263
  foreach ($data_to_export as $key => $data) {
264
 
265
  if ( ! in_array($key, array('items', 'taxes', 'shipping', 'coupons', 'surcharge')) )
266
- {
267
- $article[$key] = $data;
268
- if ( ! in_array($key, $titles) ) $titles[] = $key;
 
269
  }
270
- }
271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
 
273
  public function get_element_header( & $headers, $options, $element_key ){
274
 
275
- if ( ! in_array($options['cc_name'][$element_key], $headers)) $headers[] = $options['cc_name'][$element_key];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
 
277
  }
278
 
@@ -295,36 +536,50 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
295
 
296
  }
297
 
298
- public function export_xml( & $xmlWriter, $record, $options, $elId ){
299
 
300
  if ( ! self::$is_active ) return;
301
 
302
- $data_to_export = $this->prepare_export_data( $record, $options, $elId );
303
 
304
  foreach ($data_to_export as $key => $data) {
305
 
306
- if ( ! in_array($key, array('items', 'taxes', 'shipping', 'coupons', 'surcharge')) )
307
- {
308
- $xmlWriter->writeElement(str_replace("-", "_", sanitize_title($key)), $data);
309
- }
 
 
 
 
 
 
 
310
  }
311
  }
312
 
 
 
 
 
 
313
  public function render( & $i ){
314
 
315
  if ( ! self::$is_active ) return;
316
 
317
  foreach (self::$order_sections as $slug => $section) :
 
318
  ?>
319
  <p class="wpae-available-fields-group"><?php echo $section['title']; ?><span class="wpae-expander">+</span></p>
320
  <div class="wpae-custom-field">
321
- <?php if ( ! in_array($slug, array('order', 'customer', 'cf'))) : ?>
322
  <div class="wpallexport-free-edition-notice">
323
  <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=wooco+orders&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to export custom order data.','wp_all_export_plugin');?></a>
324
  </div>
325
  <?php endif; ?>
326
  <ul>
327
- <li <?php if ( ! in_array($slug, array('order', 'customer', 'cf'))) : ?>class="wpallexport_disabled"<?php endif; ?>>
 
328
  <div class="default_column" rel="">
329
  <label class="wpallexport-element-label"><?php echo __("All", "wp_all_export_plugin") . ' ' . $section['title'] . ' ' . __("Data", "wp_all_export_plugin"); ?></label>
330
  <input type="hidden" name="rules[]" value="pmxe_<?php echo $slug;?>"/>
@@ -333,9 +588,9 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
333
  <?php
334
  foreach ($section['meta'] as $cur_meta_key => $field) {
335
  ?>
336
- <li class="pmxe_<?php echo $slug; ?> <?php if ( ! in_array($slug, array('order', 'customer', 'cf'))) : ?>wpallexport_disabled<?php endif;?>">
337
  <div class="custom_column" rel="<?php echo ($i + 1);?>">
338
- <label class="wpallexport-xml-element">&lt;<?php echo (is_array($field)) ? $field['name'] : $field; ?>&gt;</label>
339
  <input type="hidden" name="ids[]" value="1"/>
340
  <input type="hidden" name="cc_label[]" value="<?php echo (is_array($field)) ? $field['label'] : $cur_meta_key; ?>"/>
341
  <input type="hidden" name="cc_php[]" value=""/>
@@ -345,20 +600,197 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
345
  <input type="hidden" name="cc_type[]" value="<?php echo (is_array($field)) ? $field['type'] : 'woo_order'; ?>"/>
346
  <input type="hidden" name="cc_value[]" value="<?php echo (is_array($field)) ? $field['label'] : $cur_meta_key; ?>"/>
347
  <input type="hidden" name="cc_name[]" value="<?php echo (is_array($field)) ? $field['name'] : $field;?>"/>
 
348
  </div>
349
  </li>
350
  <?php
351
  $i++;
352
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  ?>
354
  </ul>
355
  </div>
356
  <?php
 
357
  endforeach;
358
  }
359
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  public function render_filters(){
361
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  }
363
 
364
  public function available_sections(){
@@ -374,7 +806,8 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
374
  ),
375
  'items' => array(
376
  'title' => __('Items', 'wp_all_export_plugin'),
377
- 'meta' => $this->available_order_default_product_data()
 
378
  ),
379
  'taxes' => array(
380
  'title' => __('Taxes & Shipping', 'wp_all_export_plugin'),
@@ -384,10 +817,24 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
384
  'title' => __('Fees & Discounts', 'wp_all_export_plugin'),
385
  'meta' => $this->available_order_fees_data()
386
  ),
 
 
 
 
 
 
 
 
 
 
387
  'cf' => array(
388
- 'title' => __('Advanced', 'wp_all_export_plugin'),
389
  'meta' => array()
390
  ),
 
 
 
 
391
  );
392
 
393
  return apply_filters('wp_all_export_available_order_sections_filter', $sections);
@@ -433,6 +880,14 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
433
  return apply_filters('wp_all_export_available_order_default_product_data_filter', $data);
434
  }
435
 
 
 
 
 
 
 
 
 
436
  public function available_order_taxes_data(){
437
 
438
  $data = array(
@@ -509,7 +964,7 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
509
  $data = array();
510
  foreach ($keys as $key) {
511
 
512
- $key1 = ucwords(str_replace('_', ' ', $key));
513
  $key2 = '';
514
 
515
  if(strpos($key1, $keyword)!== false)
@@ -524,6 +979,167 @@ if ( ! class_exists('XmlExportWooCommerceOrder') ){
524
  return $data;
525
  }
526
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
  /**
528
  * __get function.
529
  *
1
  <?php
2
 
3
+ if ( ! class_exists('XmlExportWooCommerceOrder') )
4
+ {
5
  final class XmlExportWooCommerceOrder
6
+ {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  public static $is_active = true;
8
 
9
  public static $order_sections = array();
30
  'options' => 'order',
31
  'label' => 'post_title'
32
  )
33
+ );
34
 
35
+ private $order_core_fields = array();
36
 
37
+ public function __construct()
38
  {
39
+ $this->order_core_fields = array('_prices_include_tax', '_customer_ip_address', '_customer_user_agent', '_created_via', '_order_version', '_payment_method', '_cart_discount_tax', '_order_shipping_tax', '_recorded_sales', '_order_stock_reduced', '_recorded_coupon_usage_counts', '_transaction_id');
40
 
41
  if ( ! class_exists('WooCommerce')
42
  or ( XmlExportEngine::$exportOptions['export_type'] == 'specific' and ! in_array('shop_order', XmlExportEngine::$post_types) )
43
  or ( XmlExportEngine::$exportOptions['export_type'] == 'advanced' and strpos(XmlExportEngine::$exportOptions['wp_query'], 'shop_order') === false ) ) {
44
  self::$is_active = false;
45
  return;
46
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
+ self::$is_active = true;
 
 
49
 
50
  if ( empty(PMXE_Plugin::$session) ) // if cron execution
51
  {
58
  }
59
  else
60
  {
61
+ $this->init_additional_data();
62
  }
63
 
64
+ add_filter("wp_all_export_available_sections", array( &$this, "filter_available_sections" ), 10, 1);
65
+ add_filter("wp_all_export_csv_rows", array( &$this, "filter_csv_rows"), 10, 2);
66
+ add_filter("wp_all_export_init_fields", array( &$this, "filter_init_fields"), 10, 1);
 
67
 
68
  self::$order_sections = $this->available_sections();
69
 
70
  }
71
 
72
+ // [FILTERS]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  /**
75
  *
113
 
114
  endforeach;
115
 
116
+ foreach ( $this->order_core_fields as $core_field ):
117
+
118
+ foreach ($existing_meta_keys as $key => $record_meta_key)
119
+ {
120
+ if ( $record_meta_key == $core_field )
121
+ {
122
+ unset($existing_meta_keys[$key]);
123
+ break;
124
+ }
125
+ }
126
+
127
+ endforeach;
128
+
129
  foreach ($existing_meta_keys as $key => $record_meta_key)
130
  {
131
  self::$order_sections['cf']['meta'][$record_meta_key] = array(
146
  if ( ! empty($meta_keys)){
147
  foreach ($meta_keys as $meta_key) {
148
  if (strpos($meta_key->meta_key, "pa_") !== 0 and empty(self::$order_sections['cf']['meta'][$meta_key->meta_key]) and empty($product_data[$meta_key->meta_key]))
149
+ self::$order_sections['other']['meta'][$meta_key->meta_key] = $this->fix_titles(array(
150
+ 'name' => $meta_key->meta_key,
151
+ 'label' => $meta_key->meta_key,
152
  'options' => 'items',
153
+ 'type' => 'woo_order'
154
+ ));
155
  }
156
  }
157
 
158
+ foreach ( $this->order_core_fields as $core_field ):
159
+
160
+ self::$order_sections['other']['meta'][$core_field] = $this->fix_titles(array(
161
+ 'name' => $core_field,
162
+ 'label' => $core_field,
163
+ 'options' => '',
164
+ 'type' => 'cf'
165
+ ));
166
+
167
+ endforeach;
168
+ }
169
+
170
+ /**
171
+ *
172
+ * Helper method to fix fields title
173
+ *
174
+ */
175
+ protected function fix_titles($field)
176
+ {
177
+ if (is_array($field))
178
+ {
179
+ $field['name'] = $this->fix_title($field['name']);
180
+ }
181
+ else
182
+ {
183
+ $field = $this->fix_title($field);
184
+ }
185
+ return $field;
186
  }
187
+ /**
188
+ *
189
+ * Helper method to fix single title
190
+ *
191
+ */
192
+ protected function fix_title($title)
193
+ {
194
+ $uc_title = ucwords(trim(str_replace("_", " ", $title)));
195
+
196
+ return stripos($uc_title, "width") === false ? str_ireplace(array('id', 'url', 'sku'), array('ID', 'URL', 'SKU'), $uc_title) : $uc_title;
197
+ }
198
 
199
  public function init_additional_data(){
200
 
211
  private $__coupons_used = null;
212
  private $order_id = null;
213
 
214
+ // csv headers
215
+ private $woo = array();
216
+ private $woo_order = array();
217
+ private $acfs = array();
218
+ private $taxes = array();
219
+ private $attributes = array();
220
+ private $articles = array();
221
+
222
+ protected function prepare_export_data( $record, $options, $elId, $preview ){
223
 
224
  // an array with data to export
225
+ $data = array(
226
+ 'items' => array(),
227
+ 'taxes' => array(),
228
+ 'shipping' => array(),
229
+ 'coupons' => array(),
230
+ 'surcharge' => array()
231
+ );
232
 
233
  global $wpdb;
234
+ $table_prefix = $wpdb->prefix;
235
 
236
+ if ( ! empty($options['cc_value'][$elId]) ){
 
 
237
 
238
  switch ($options['cc_options'][$elId]) {
239
 
240
  case 'order':
241
  case 'customer':
242
 
243
+ $data[$options['cc_name'][$elId]] = ( strpos($options['cc_value'][$elId], "_") === 0 ) ? get_post_meta($record->ID, $options['cc_value'][$elId], true) : $record->{$options['cc_value'][$elId]};
244
 
245
  if ($options['cc_value'][$elId] == "post_title")
246
  {
249
 
250
  $data[$options['cc_name'][$elId]] = pmxe_filter( $data[$options['cc_name'][$elId]], $fieldSnipped);
251
 
252
+ break;
253
  }
254
 
255
  }
257
  return $data;
258
  }
259
 
260
+ private $additional_articles = array();
261
 
262
+ public function export_csv( & $article, & $titles, $record, $options, $elId, $preview ){
263
 
264
  if ( ! self::$is_active ) return;
265
 
266
+ $data_to_export = $this->prepare_export_data( $record, $options, $elId, $preview );
267
 
268
  foreach ($data_to_export as $key => $data) {
269
 
270
  if ( ! in_array($key, array('items', 'taxes', 'shipping', 'coupons', 'surcharge')) )
271
+ {
272
+ // $article[$key] = $data;
273
+ wp_all_export_write_article( $article, $key, $data );
274
+ // if ( ! in_array($key, $titles) ) $titles[] = $key;
275
  }
276
+ }
277
+ }
278
+
279
+ public function filter_csv_rows($articles, $options){
280
+
281
+ if ( ! empty($this->additional_articles) and $options['order_item_per_row'] and $options['export_to'] == 'csv')
282
+ {
283
+ $base_article = $articles[count($articles) - 1];
284
+ array_shift($this->additional_articles);
285
+ if ( ! empty($this->additional_articles ) ){
286
+ foreach ($this->additional_articles as $article) {
287
+ if ($options['order_item_fill_empty_columns'])
288
+ {
289
+ foreach ($article as $key => $value) {
290
+ unset($base_article[$key]);
291
+ }
292
+ $articles[] = @array_merge($base_article, $article);
293
+ }
294
+ else
295
+ {
296
+ $articles[] = $article;
297
+ }
298
+ }
299
+ $this->additional_articles = array();
300
+ }
301
+ }
302
+
303
+ return $articles;
304
+ }
305
 
306
  public function get_element_header( & $headers, $options, $element_key ){
307
 
308
+ switch ($options['cc_value'][$element_key])
309
+ {
310
+ // Rate Code (per tax)
311
+ case 'tax_order_item_name':
312
+ // Rate Percentage (per tax)
313
+ case 'tax_rate':
314
+ // Amount (per tax)
315
+ case 'tax_amount':
316
+
317
+ if ( ! empty(self::$orders_data['taxes']))
318
+ {
319
+ foreach ( self::$orders_data['taxes'] as $tax) {
320
+ $friendly_name = str_replace("per tax", $this->get_rate_friendly_name($tax->order_item_id), $options['cc_name'][$element_key]);
321
+ if ( ! in_array($friendly_name, $headers)) $headers[] = $friendly_name;
322
+ }
323
+ }
324
+
325
+ break;
326
+ // Discount Amount (per coupon)
327
+ case 'discount_amount':
328
+
329
+ if ( ! empty(self::$orders_data['coupons']))
330
+ {
331
+ foreach ( self::$orders_data['coupons'] as $coupon) {
332
+ $friendly_name = str_replace("per coupon", $coupon->order_item_name, $options['cc_name'][$element_key]);
333
+ if ( ! in_array($friendly_name, $headers)) $headers[] = $friendly_name;
334
+ }
335
+ }
336
+
337
+ break;
338
+ // Fee Amount (per surcharge)
339
+ case 'fee_line_total':
340
+
341
+ if ( ! empty(self::$orders_data['fees']))
342
+ {
343
+ foreach ( self::$orders_data['fees'] as $fee) {
344
+ $friendly_name = str_replace("Amount (per surcharge)", "(" . $fee->order_item_name . ")", $options['cc_name'][$element_key]);
345
+ if ( ! in_array($friendly_name, $headers)) $headers[] = $friendly_name;
346
+ }
347
+ }
348
+
349
+ break;
350
+
351
+ // Product Variation Details
352
+ case '__product_variation':
353
+
354
+ if ( ! empty(self::$orders_data['line_items_max_count']) and ! empty(self::$orders_data['variations']))
355
+ {
356
+ if ($options['order_item_per_row']){
357
+ foreach ( self::$orders_data['variations'] as $variation) {
358
+ $friendly_name = $options['cc_name'][$element_key] . " (" . sanitize_title(str_replace("pa_", "", $variation->meta_key)) . ")";
359
+ if ( ! in_array($friendly_name, $headers)) $headers[] = $friendly_name;
360
+ }
361
+ }
362
+ else{
363
+ for ($i = 1; $i <= self::$orders_data['line_items_max_count']; $i++){
364
+ foreach ( self::$orders_data['variations'] as $variation) {
365
+ $friendly_name = $options['cc_name'][$element_key] . " #" . $i . " (" . sanitize_title(str_replace("pa_", "", $variation->meta_key)) . ")";
366
+ if ( ! in_array($friendly_name, $headers)) $headers[] = $friendly_name;
367
+ }
368
+ }
369
+ }
370
+ }
371
+
372
+ break;
373
+
374
+ default:
375
+
376
+ switch ($options['cc_options'][$element_key])
377
+ {
378
+ // Order's product basic data headers
379
+ case 'items':
380
+
381
+ if ($options['order_item_per_row'])
382
+ {
383
+ if ( ! in_array($options['cc_name'][$element_key], $headers)) $headers[] = $options['cc_name'][$element_key];
384
+ }
385
+ else
386
+ {
387
+ if ( ! empty(self::$orders_data['line_items_max_count'])){
388
+ for ($i = 1; $i <= self::$orders_data['line_items_max_count']; $i++){
389
+ $friendly_name = $options['cc_name'][$element_key] . " #" . $i;
390
+ if ( ! in_array($friendly_name, $headers)) $headers[] = $friendly_name;
391
+ }
392
+ }
393
+ }
394
+
395
+ break;
396
+
397
+ default:
398
+
399
+ // Order's product advanced data headers
400
+ if ( strpos($options['cc_label'][$element_key], 'item_data__') !== false)
401
+ {
402
+ $element_label = str_replace("item_data__", "", $options['cc_label'][$element_key]);
403
+
404
+ $element_headers = array();
405
+
406
+ $element_name = ( ! empty($options['cc_name'][$element_key]) ) ? $options['cc_name'][$element_key] : 'untitled_' . $element_key;
407
+
408
+ switch ($options['cc_type'][$element_key])
409
+ {
410
+
411
+ case 'woo':
412
+
413
+ XmlExportEngine::$woo_export->get_element_header( $element_headers, $options, $element_key );
414
+
415
+ break;
416
+
417
+ case 'acf':
418
+
419
+ if ( ! empty($this->acfs) ){
420
+ $single_acf_field = array_shift($this->acfs);
421
+ if ( is_array($single_acf_field))
422
+ {
423
+ foreach ($single_acf_field as $acf_header) {
424
+ if ( ! in_array($acf_header, $element_headers)) $element_headers[] = $acf_header;
425
+ }
426
+ }
427
+ else
428
+ {
429
+ if ( ! in_array($single_acf_field, $element_headers)) $element_headers[] = $single_acf_field;
430
+ }
431
+ }
432
+
433
+ break;
434
+
435
+ default:
436
+
437
+ if ( ! in_array($element_name, $element_headers))
438
+ {
439
+ $element_headers[] = $element_name;
440
+ }
441
+ else
442
+ {
443
+ $is_added = false;
444
+ $i = 0;
445
+ do
446
+ {
447
+ $new_element_name = $element_name . '_' . md5($i);
448
+
449
+ if ( ! in_array($new_element_name, $element_headers) )
450
+ {
451
+ $element_headers[] = $new_element_name;
452
+ $is_added = true;
453
+ }
454
+
455
+ $i++;
456
+ }
457
+ while ( ! $is_added );
458
+ }
459
+
460
+ // $element_headers[] = $element_name;
461
+
462
+ break;
463
+ }
464
+
465
+ if ( ! empty($element_headers) )
466
+ {
467
+ foreach ($element_headers as $header)
468
+ {
469
+ if ($options['order_item_per_row'])
470
+ {
471
+ if ( ! in_array($header, $headers)) $headers[] = $header;
472
+ }
473
+ else
474
+ {
475
+ if ( ! empty(self::$orders_data['line_items_max_count'])){
476
+ for ($i = 1; $i <= self::$orders_data['line_items_max_count']; $i++){
477
+ $friendly_name = $header . " #" . $i;
478
+ if ( ! in_array($friendly_name, $headers)) $headers[] = $friendly_name;
479
+ }
480
+ }
481
+ }
482
+ }
483
+ }
484
+ }
485
+ else
486
+ {
487
+ if ( ! in_array($options['cc_name'][$element_key], $headers))
488
+ {
489
+ $headers[] = $options['cc_name'][$element_key];
490
+ }
491
+ else
492
+ {
493
+ $is_added = false;
494
+ $i = 0;
495
+ do
496
+ {
497
+ $new_element_name = $options['cc_name'][$element_key] . '_' . md5($i);
498
+
499
+ if ( ! in_array($new_element_name, $headers) )
500
+ {
501
+ $headers[] = $new_element_name;
502
+ $is_added = true;
503
+ }
504
+
505
+ $i++;
506
+ }
507
+ while ( ! $is_added );
508
+ }
509
+ }
510
+
511
+ break;
512
+ }
513
+
514
+ break;
515
+
516
+ }
517
 
518
  }
519
 
536
 
537
  }
538
 
539
+ public function export_xml( & $xmlWriter, $record, $options, $elId, $preview ){
540
 
541
  if ( ! self::$is_active ) return;
542
 
543
+ $data_to_export = $this->prepare_export_data( $record, $options, $elId, $preview );
544
 
545
  foreach ($data_to_export as $key => $data) {
546
 
547
+ $element_name_ns = '';
548
+ $element_name = str_replace("-", "_", preg_replace('/[^a-z0-9:_]/i', '', $key));
549
+ if (strpos($element_name, ":") !== false)
550
+ {
551
+ $element_name_parts = explode(":", $element_name);
552
+ $element_name_ns = (empty($element_name_parts[0])) ? '' : $element_name_parts[0];
553
+ $element_name = (empty($element_name_parts[1])) ? 'untitled_' . $ID : $element_name_parts[1];
554
+ }
555
+ $xmlWriter->beginElement($element_name_ns, $element_name, null);
556
+ $xmlWriter->writeData($data);
557
+ $xmlWriter->endElement();
558
  }
559
  }
560
 
561
+ public static function prepare_child_exports( $export, $is_cron = false )
562
+ {
563
+ return array();
564
+ }
565
+
566
  public function render( & $i ){
567
 
568
  if ( ! self::$is_active ) return;
569
 
570
  foreach (self::$order_sections as $slug => $section) :
571
+ if ( ! empty($section['meta']) or ! empty($section['additional']) ):
572
  ?>
573
  <p class="wpae-available-fields-group"><?php echo $section['title']; ?><span class="wpae-expander">+</span></p>
574
  <div class="wpae-custom-field">
575
+ <?php if ( ! in_array($slug, array('order', 'customer', 'cf', 'other'))) : ?>
576
  <div class="wpallexport-free-edition-notice">
577
  <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=wooco+orders&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to export custom order data.','wp_all_export_plugin');?></a>
578
  </div>
579
  <?php endif; ?>
580
  <ul>
581
+ <?php if ( ! empty($section['meta']) ): ?>
582
+ <li <?php if ( ! in_array($slug, array('order', 'customer', 'cf', 'other'))) : ?>class="wpallexport_disabled"<?php endif; ?>>
583
  <div class="default_column" rel="">
584
  <label class="wpallexport-element-label"><?php echo __("All", "wp_all_export_plugin") . ' ' . $section['title'] . ' ' . __("Data", "wp_all_export_plugin"); ?></label>
585
  <input type="hidden" name="rules[]" value="pmxe_<?php echo $slug;?>"/>
588
  <?php
589
  foreach ($section['meta'] as $cur_meta_key => $field) {
590
  ?>
591
+ <li class="pmxe_<?php echo $slug; ?> <?php if ( ! in_array($slug, array('order', 'customer', 'cf', 'other'))) : ?>wpallexport_disabled<?php endif;?>">
592
  <div class="custom_column" rel="<?php echo ($i + 1);?>">
593
+ <label class="wpallexport-xml-element"><?php echo (is_array($field)) ? $field['name'] : $field; ?></label>
594
  <input type="hidden" name="ids[]" value="1"/>
595
  <input type="hidden" name="cc_label[]" value="<?php echo (is_array($field)) ? $field['label'] : $cur_meta_key; ?>"/>
596
  <input type="hidden" name="cc_php[]" value=""/>
600
  <input type="hidden" name="cc_type[]" value="<?php echo (is_array($field)) ? $field['type'] : 'woo_order'; ?>"/>
601
  <input type="hidden" name="cc_value[]" value="<?php echo (is_array($field)) ? $field['label'] : $cur_meta_key; ?>"/>
602
  <input type="hidden" name="cc_name[]" value="<?php echo (is_array($field)) ? $field['name'] : $field;?>"/>
603
+ <input type="hidden" name="cc_settings[]" value=""/>
604
  </div>
605
  </li>
606
  <?php
607
  $i++;
608
+ }
609
+ endif;
610
+
611
+ if ( ! empty($section['additional']) )
612
+ {
613
+ foreach ($section['additional'] as $sub_slug => $sub_section)
614
+ {
615
+ ?>
616
+ <li class="available_sub_section">
617
+ <p class="wpae-available-fields-group"><?php echo $sub_section['title']; ?><span class="wpae-expander">+</span></p>
618
+ <div class="wpae-custom-field">
619
+ <ul>
620
+ <li class="wpallexport_disabled">
621
+ <div class="default_column" rel="">
622
+ <label class="wpallexport-element-label"><?php echo __("All", "wp_all_export_plugin") . ' ' . $sub_section['title']; ?></label>
623
+ <input type="hidden" name="rules[]" value="pmxe_<?php echo $slug;?>_<?php echo $sub_slug;?>"/>
624
+ </div>
625
+ </li>
626
+ <?php
627
+ foreach ($sub_section['meta'] as $field) {
628
+ ?>
629
+ <li class="pmxe_<?php echo $slug; ?>_<?php echo $sub_slug;?> wpallexport_disabled">
630
+ <div class="custom_column" rel="<?php echo ($i + 1);?>">
631
+ <label class="wpallexport-xml-element"><?php echo (is_array($field)) ? $field['name'] : $field; ?></label>
632
+ <input type="hidden" name="ids[]" value="1"/>
633
+ <input type="hidden" name="cc_label[]" value="item_data__<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
634
+ <input type="hidden" name="cc_php[]" value=""/>
635
+ <input type="hidden" name="cc_code[]" value=""/>
636
+ <input type="hidden" name="cc_sql[]" value=""/>
637
+ <input type="hidden" name="cc_options[]" value="item_data"/>
638
+ <input type="hidden" name="cc_type[]" value="<?php echo (is_array($field)) ? $field['type'] : $sub_slug; ?>"/>
639
+ <input type="hidden" name="cc_value[]" value="item_data__<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
640
+ <input type="hidden" name="cc_name[]" value="<?php echo (is_array($field)) ? $field['name'] : $field;?>"/>
641
+ <input type="hidden" name="cc_settings[]" value=""/>
642
+ </div>
643
+ </li>
644
+ <?php
645
+ $i++;
646
+ }
647
+ ?>
648
+ </ul>
649
+ </li>
650
+ <?php
651
+ }
652
+ }
653
+
654
  ?>
655
  </ul>
656
  </div>
657
  <?php
658
+ endif;
659
  endforeach;
660
  }
661
 
662
+ public function render_new_field(){
663
+
664
+ if ( ! self::$is_active ) return;
665
+
666
+ ?>
667
+ <select class="wp-all-export-chosen-select" name="column_value_type" style="width:350px;">
668
+ <?php
669
+ foreach (self::$order_sections as $slug => $section) :
670
+ ?>
671
+ <optgroup label="<?php echo $section['title']; ?>">
672
+ <?php
673
+ foreach ($section['meta'] as $cur_meta_key => $field)
674
+ {
675
+ $field_label = is_array($field) ? $field['label'] : $cur_meta_key;
676
+ $field_type = is_array($field) ? $field['type'] : 'woo_order';
677
+ $field_name = is_array($field) ? $field['name'] : $field;
678
+ $field_options = is_array($field) ? $field['options'] : $slug;
679
+ ?>
680
+ <option
681
+ value="<?php echo $field_type;?>"
682
+ label="<?php echo $field_label;?>"
683
+ options="<?php echo $field_options; ?>"><?php echo $field_name;?></option>
684
+ <?php
685
+ }
686
+ ?>
687
+ </optgroup>
688
+ <?php
689
+ if ( ! empty($section['additional']) )
690
+ {
691
+ foreach ($section['additional'] as $sub_slug => $sub_section)
692
+ {
693
+ ?>
694
+ <optgroup label="<?php echo $sub_section['title']; ?>">
695
+
696
+ <?php foreach ($sub_section['meta'] as $field): ?>
697
+
698
+ <?php
699
+ $field_label = 'item_data__' . ( is_array($field) ? $field['label'] : $field );
700
+ $field_type = is_array($field) ? $field['type'] : $sub_slug;
701
+ $field_name = is_array($field) ? $field['name'] : $field;
702
+ $field_options = 'item_data';
703
+ ?>
704
+ <option
705
+ value="<?php echo $field_type;?>"
706
+ label="<?php echo $field_label;?>"
707
+ options="<?php echo $field_options; ?>"><?php echo $field_name;?></option>
708
+
709
+ <?php endforeach; ?>
710
+
711
+ </optgroup>
712
+ <?php
713
+ }
714
+ }
715
+
716
+ endforeach;
717
+
718
+ // Render Available ACF
719
+ XmlExportEngine::$acf_export->render_new_field();
720
+
721
+ ?>
722
+
723
+ <optgroup label="Advanced">
724
+ <option value="sql" label="sql"><?php _e("SQL Query", "wp_all_export_plugin"); ?></option>
725
+ </optgroup>
726
+
727
+ </select>
728
+ <?php
729
+ }
730
+
731
  public function render_filters(){
732
 
733
+ if ( ! self::$is_active ) return;
734
+
735
+ foreach (self::$order_sections as $slug => $section) :
736
+ ?>
737
+ <optgroup label="<?php echo $section['title']; ?>">
738
+ <?php
739
+ foreach ($section['meta'] as $cur_meta_key => $field)
740
+ {
741
+ $field_label = is_array($field) ? $field['label'] : $cur_meta_key;
742
+ $field_type = is_array($field) ? $field['type'] : 'woo_order';
743
+ $field_name = is_array($field) ? $field['name'] : $field;
744
+ $field_options = is_array($field) ? $field['options'] : $slug;
745
+
746
+ switch ($field_options)
747
+ {
748
+ case 'order':
749
+ case 'customer':
750
+ if ( strpos($field_label, '_') === 0):
751
+ ?>
752
+ <option value="<?php echo 'cf_' . $field_label; ?>"><?php echo $field_name; ?></option>
753
+ <?php
754
+ else:
755
+ ?>
756
+ <option value="<?php echo $field_label; ?>"><?php echo $field_name; ?></option>
757
+ <?php
758
+ endif;
759
+ break;
760
+ case 'notes':
761
+ case 'items':
762
+ case 'taxes':
763
+ case 'fees':
764
+ break;
765
+ default:
766
+ switch ($field_type)
767
+ {
768
+ case 'cf':
769
+ ?>
770
+ <option value="<?php echo 'cf_' . $field_label; ?>"><?php echo $field_name; ?></option>
771
+ <?php
772
+ break;
773
+ case 'cats':
774
+ case 'attr':
775
+ ?>
776
+ <option value="<?php echo 'tx_' . $field_label; ?>"><?php echo $field_name; ?></option>
777
+ <?php
778
+ break;
779
+ default:
780
+ ?>
781
+ <option value="<?php echo $field_label; ?>"><?php echo $field_name; ?></option>
782
+ <?php
783
+ break;
784
+ }
785
+ break;
786
+ }
787
+ }
788
+ ?>
789
+ </optgroup>
790
+ <?php
791
+
792
+ endforeach;
793
+
794
  }
795
 
796
  public function available_sections(){
806
  ),
807
  'items' => array(
808
  'title' => __('Items', 'wp_all_export_plugin'),
809
+ 'meta' => $this->available_order_default_product_data(),
810
+ 'additional' => $this->available_order_items_data()
811
  ),
812
  'taxes' => array(
813
  'title' => __('Taxes & Shipping', 'wp_all_export_plugin'),
817
  'title' => __('Fees & Discounts', 'wp_all_export_plugin'),
818
  'meta' => $this->available_order_fees_data()
819
  ),
820
+ 'notes' => array(
821
+ 'title' => __('Notes', 'wp_all_export_plugin'),
822
+ 'meta' => array(
823
+ 'comment_content' => __('Note Content', 'wp_all_export_plugin'),
824
+ 'comment_date' => __('Note Date', 'wp_all_export_plugin'),
825
+ 'visibility' => __('Note Visibility', 'wp_all_export_plugin'),
826
+ 'comment_author' => __('Note User Name', 'wp_all_export_plugin'),
827
+ 'comment_author_email' => __('Note User Email', 'wp_all_export_plugin')
828
+ )
829
+ ),
830
  'cf' => array(
831
+ 'title' => __('Custom Fields', 'wp_all_export_plugin'),
832
  'meta' => array()
833
  ),
834
+ 'other' => array(
835
+ 'title' => __('Other', 'wp_all_export_plugin'),
836
+ 'meta' => array()
837
+ )
838
  );
839
 
840
  return apply_filters('wp_all_export_available_order_sections_filter', $sections);
880
  return apply_filters('wp_all_export_available_order_default_product_data_filter', $data);
881
  }
882
 
883
+ public function available_order_items_data()
884
+ {
885
+
886
+ $data = XmlExportEngine::$woo_export->get_all_fields_for_order_items();
887
+
888
+ return apply_filters('wp_all_export_available_order_additional_product_data_filter', $data);
889
+ }
890
+
891
  public function available_order_taxes_data(){
892
 
893
  $data = array(
964
  $data = array();
965
  foreach ($keys as $key) {
966
 
967
+ $key1 = $this->fix_titles(str_replace('_', ' ', $key));
968
  $key2 = '';
969
 
970
  if(strpos($key1, $keyword)!== false)
979
  return $data;
980
  }
981
 
982
+ public static function prepare_import_template( $exportOptions, &$templateOptions, $element_name, $ID )
983
+ {
984
+
985
+ if ( ! self::$is_active ) return;
986
+
987
+ $options = $exportOptions;
988
+
989
+ $element_type = $options['cc_value'][$ID];
990
+
991
+ $is_xml_template = $options['export_to'] == 'xml';
992
+
993
+ $implode_delimiter = ($options['delimiter'] == ',') ? '|' : ',';
994
+
995
+ switch ($element_type)
996
+ {
997
+ case 'ID':
998
+ $templateOptions['unique_key'] = '{'. $element_name .'[1]}';
999
+ $templateOptions['tmp_unique_key'] = '{'. $element_name .'[1]}';
1000
+ break;
1001
+
1002
+ case 'post_status':
1003
+ $templateOptions['is_update_status'] = 1;
1004
+ $templateOptions['pmwi_order']['status'] = 'xpath';
1005
+ $templateOptions['pmwi_order']['status_xpath'] = '{'. $element_name .'[1]}';
1006
+ break;
1007
+
1008
+ case 'post_date':
1009
+ $templateOptions['is_update_dates'] = 1;
1010
+ $templateOptions['pmwi_order']['date'] = '{'. $element_name .'[1]}';
1011
+ break;
1012
+
1013
+ case '_billing_email':
1014
+ $templateOptions['pmwi_order']['billing_source_match_by'] = 'email';
1015
+ $templateOptions['pmwi_order']['billing_source_email'] = '{'. $element_name .'[1]}';
1016
+ $templateOptions['pmwi_order']['is_update_billing_details'] = 1;
1017
+ $templateOptions['pmwi_order']['is_update_shipping_details'] = 1;
1018
+ break;
1019
+
1020
+ case 'post_excerpt':
1021
+ $templateOptions['is_update_excerpt'] = 1;
1022
+ $templateOptions['pmwi_order']['customer_provided_note'] = '{'. $element_name .'[1]}';
1023
+ break;
1024
+
1025
+ case '_transaction_id':
1026
+ $templateOptions['pmwi_order']['transaction_id'] = '{'. $element_name .'[1]}';
1027
+ break;
1028
+
1029
+ case '_payment_method':
1030
+ $templateOptions['pmwi_order']['payment_method'] = 'xpath';
1031
+ $templateOptions['pmwi_order']['payment_method_xpath'] = '{'. $element_name .'[1]}';
1032
+ $templateOptions['pmwi_order']['is_update_payment'] = 1;
1033
+ break;
1034
+
1035
+ case '__product_sku':
1036
+ $templateOptions['pmwi_order']['is_update_products'] = 1;
1037
+ $templateOptions['pmwi_order']['products_repeater_mode'] = $options['export_to'];
1038
+ if ($is_xml_template)
1039
+ {
1040
+ $templateOptions['pmwi_order']['products_repeater_mode_foreach'] = '{OrderItems[1]/Item}';
1041
+ $templateOptions['pmwi_order']['products'][0]['sku'] = '{'. $element_name .'[1]}';
1042
+ }
1043
+ break;
1044
+
1045
+ case '_qty':
1046
+ if ($is_xml_template)
1047
+ {
1048
+ $templateOptions['pmwi_order']['products'][0]['qty'] = '{'. $element_name .'[1]}';
1049
+ }
1050
+ break;
1051
+
1052
+ // prepare template for fee line items
1053
+ case 'fee_line_total':
1054
+ $templateOptions['pmwi_order']['is_update_fees'] = 1;
1055
+ $templateOptions['pmwi_order']['fees_repeater_mode'] = $options['export_to'];
1056
+ if ($is_xml_template)
1057
+ {
1058
+ $templateOptions['pmwi_order']['fees_repeater_mode_foreach'] = '{OrderSurcharge[1]/Surcharge}';
1059
+ $templateOptions['pmwi_order']['fees'][0]['name'] = '{fee_name[1]}';
1060
+ $templateOptions['pmwi_order']['fees'][0]['amount'] = '{fee_amount[1]}';
1061
+ }
1062
+ break;
1063
+
1064
+ // prepare template for coupon line items
1065
+ case 'discount_amount':
1066
+ $templateOptions['pmwi_order']['is_update_coupons'] = 1;
1067
+ $templateOptions['pmwi_order']['coupons_repeater_mode'] = $options['export_to'];
1068
+ if ($is_xml_template)
1069
+ {
1070
+ $templateOptions['pmwi_order']['coupons_repeater_mode_foreach'] = '{OrderCoupons[1]/Coupon}';
1071
+ $templateOptions['pmwi_order']['coupons'][0]['code'] = '{coupon_code[1]}';
1072
+ $templateOptions['pmwi_order']['coupons'][0]['amount'] = '{discount_amount[1]}';
1073
+ $templateOptions['pmwi_order']['coupons'][0]['amount_tax'] = '';
1074
+ }
1075
+ break;
1076
+
1077
+ // prepare template for shipping line items
1078
+ case 'shipping_order_item_name':
1079
+ $templateOptions['pmwi_order']['is_update_shipping'] = 1;
1080
+ $templateOptions['pmwi_order']['shipping_repeater_mode'] = $options['export_to'];
1081
+ if ($is_xml_template)
1082
+ {
1083
+ $templateOptions['pmwi_order']['shipping_repeater_mode_foreach'] = '{OrderShipping[1]/Shipping}';
1084
+ $templateOptions['pmwi_order']['shipping'][0]['name'] = '{'. $element_name.'[1]}';
1085
+ $templateOptions['pmwi_order']['shipping'][0]['class'] = 'xpath';
1086
+ $templateOptions['pmwi_order']['shipping'][0]['class_xpath'] = '{'. $element_name .'}';
1087
+ }
1088
+ break;
1089
+
1090
+ case '_order_shipping':
1091
+ $templateOptions['pmwi_order']['shipping'][0]['amount'] = '{'. $element_name .'[1]}';
1092
+ break;
1093
+
1094
+ // prepare template for tax line items
1095
+ case 'tax_order_item_name':
1096
+ $templateOptions['pmwi_order']['is_update_taxes'] = 1;
1097
+ $templateOptions['pmwi_order']['taxes_repeater_mode'] = $options['export_to'];
1098
+ if ($is_xml_template)
1099
+ {
1100
+ $templateOptions['pmwi_order']['taxes_repeater_mode_foreach'] = '{OrderTaxes[1]/Tax}';
1101
+ $templateOptions['pmwi_order']['taxes'][0]['shipping_tax_amount'] = '';
1102
+ $templateOptions['pmwi_order']['taxes'][0]['code'] = 'xpath';
1103
+ $templateOptions['pmwi_order']['taxes'][0]['code_xpath'] = '{'. $element_name .'[1]}';
1104
+ }
1105
+
1106
+ // $tax_data[$element_name] = pmxe_filter( $order_tax->order_item_name, $TaxesfieldSnipped);
1107
+ break;
1108
+
1109
+ case 'tax_rate':
1110
+ // $tax_data[$element_name] = pmxe_filter(( ! empty($rate_details)) ? $rate_details->tax_rate : '', $TaxesfieldSnipped);
1111
+ break;
1112
+
1113
+ case 'tax_amount':
1114
+ $templateOptions['pmwi_order']['taxes'][0]['tax_amount'] = '{'. $element_name.'[1]}';
1115
+ break;
1116
+
1117
+ // order notes
1118
+ case 'comment_content':
1119
+ $templateOptions['pmwi_order']['is_update_notes'] = 1;
1120
+ $templateOptions['pmwi_order']['order_note_content'] = '{'. $element_name .'[1]}';
1121
+ break;
1122
+
1123
+ case 'comment_date':
1124
+ $templateOptions['pmwi_order']['order_note_date'] = '{'. $element_name .'[1]}';
1125
+ break;
1126
+
1127
+ case 'visibility':
1128
+ $templateOptions['pmwi_order']['order_note_visibility'] = '{xpath[1]}';
1129
+ $templateOptions['pmwi_order']['order_note_visibility_xpath'] = '{'. $element_name .'[1]}';
1130
+ break;
1131
+
1132
+ case 'comment_author':
1133
+ $templateOptions['pmwi_order']['order_note_author'][0]['username'] = '{'. $element_name .'[1]}';
1134
+ break;
1135
+
1136
+ case 'comment_author_email':
1137
+ $templateOptions['pmwi_order']['order_note_author'][0]['email'] = '{'. $element_name .'[1]}';
1138
+ break;
1139
+ }
1140
+
1141
+ }
1142
+
1143
  /**
1144
  * __get function.
1145
  *
libraries/XmlGoogleMerchants.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ final class XmlGoogleMerchants
4
+ {
5
+ private $export_id = false;
6
+ private $add_data = array();
7
+
8
+ public function __construct( $id, $additional_data )
9
+ {
10
+ $this->export_id = $id;
11
+ $this->add_data = $additional_data;
12
+
13
+ if ( ! empty($this->export_id))
14
+ {
15
+ add_filter('wp_all_export_xml_header', array( &$this, 'wpae_xml_header'), 10, 2);
16
+ add_filter('wp_all_export_additional_data', array( &$this, 'wpae_additional_data'), 10, 3);
17
+ add_filter('wp_all_export_xml_footer', array( &$this, 'wpae_xml_footer'), 10, 2);
18
+ add_filter('wp_all_export_main_xml_tag', array( &$this, 'wpae_main_xml_tag'), 10, 2);
19
+ add_filter('wp_all_export_record_xml_tag', array( &$this, 'wpae_record_xml_tag'), 10, 2);
20
+ }
21
+ }
22
+
23
+ public function wpae_xml_header($header, $export_id)
24
+ {
25
+ if ( $export_id == $this->export_id )
26
+ {
27
+ $header .= "\n<rss version=\"2.0\" xmlns:g=\"http://base.google.com/ns/1.0\">";
28
+ }
29
+ return $header;
30
+ }
31
+
32
+ public function wpae_additional_data($add_data, $options, $export_id)
33
+ {
34
+ if ( $export_id == $this->export_id && ! empty($this->add_data))
35
+ {
36
+ $add_data = array_merge($add_data, $this->add_data);
37
+ }
38
+ return $add_data;
39
+ }
40
+
41
+ public function wpae_xml_footer($footer, $export_id)
42
+ {
43
+ if ( $export_id == $this->export_id )
44
+ {
45
+ $footer = "</rss>";
46
+ }
47
+ return $footer;
48
+ }
49
+
50
+ public function wpae_main_xml_tag( $tag, $export_id )
51
+ {
52
+ return ( $export_id == $this->export_id ) ? 'channel' : $tag;
53
+ }
54
+
55
+ public function wpae_record_xml_tag( $tag, $export_id )
56
+ {
57
+ return ( $export_id == $this->export_id ) ? 'item' : $tag;
58
+ }
59
+ }
models/export/record.php CHANGED
@@ -15,7 +15,235 @@ class PMXE_Export_Record extends PMXE_Model_Record {
15
  return 'text/html';
16
  }
17
 
18
- /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  * Clear associations with posts
20
  * @return PMXE_Import_Record
21
  * @chainable
@@ -26,11 +254,24 @@ class PMXE_Export_Record extends PMXE_Model_Record {
26
  return $this;
27
  }
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  /**
30
  * @see parent::delete()
31
  */
32
  public function delete() {
33
- $this->deletePosts();
34
  if ( ! empty($this->options['import_id']) and wp_all_export_is_compatible()){
35
  $import = new PMXI_Import_Record();
36
  $import->getById($this->options['import_id']);
15
  return 'text/html';
16
  }
17
 
18
+ public function generate_bundle( $debug = false)
19
+ {
20
+ // do not generate export bundle if not supported
21
+ if ( ! self::is_bundle_supported($this->options) ) return;
22
+
23
+ $uploads = wp_upload_dir();
24
+
25
+ //generate temporary folder
26
+ $export_dir = wp_all_export_secure_file($uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::UPLOADS_DIRECTORY, $this->id ) . DIRECTORY_SEPARATOR;
27
+ $bundle_dir = $export_dir . 'bundle' . DIRECTORY_SEPARATOR;
28
+
29
+ // clear tmp dir
30
+ wp_all_export_rrmdir($bundle_dir);
31
+
32
+ @mkdir($bundle_dir);
33
+
34
+ $friendly_name = sanitize_file_name($this->friendly_name);
35
+
36
+ $template = "WP All Import Template - " . $friendly_name . ".txt";
37
+
38
+ $templates = array();
39
+
40
+ $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
41
+
42
+ if ( ! $is_secure_import)
43
+ {
44
+ $filepath = get_attached_file($this->attch_id);
45
+ }
46
+ else
47
+ {
48
+ $filepath = wp_all_export_get_absolute_path($this->options['filepath']);
49
+ }
50
+
51
+ @copy( $filepath, $bundle_dir . basename($filepath) );
52
+
53
+ if ( ! empty($this->options['tpl_data']))
54
+ {
55
+ $template_data = array($this->options['tpl_data']);
56
+
57
+ $template_data[0]['source_file_name'] = basename($filepath);
58
+
59
+ $template_options = maybe_unserialize($template_data[0]['options']);
60
+
61
+ $templates[$template_options['custom_type']] = $template_data;
62
+
63
+ $readme = __("The other two files in this zip are the export file containing all of your data and the import template for WP All Import. \n\nTo import this data, create a new import with WP All Import and upload this zip file.", "wp_all_export_plugin");
64
+
65
+ file_put_contents($bundle_dir . 'readme.txt', $readme);
66
+ }
67
+
68
+ file_put_contents($bundle_dir . $template, json_encode($templates));
69
+
70
+ if ($this->options['creata_a_new_export_file'] && ! empty($this->options['cpt']) and class_exists('WooCommerce') and in_array('shop_order', $this->options['cpt']) and empty($this->parent_id) )
71
+ {
72
+ $bundle_path = $export_dir . $friendly_name . '-' . ($this->iteration + 1) . '.zip';
73
+ }
74
+ else
75
+ {
76
+ $bundle_path = $export_dir . $friendly_name . '.zip';
77
+ }
78
+
79
+ if ( @file_exists($bundle_path))
80
+ {
81
+ @unlink($bundle_path);
82
+ }
83
+
84
+ PMXE_Zip::zipDir($bundle_dir, $bundle_path);
85
+
86
+ // clear tmp dir
87
+ wp_all_export_rrmdir($bundle_dir);
88
+
89
+ $exportOptions = $this->options;
90
+ $exportOptions['bundlepath'] = wp_all_export_get_relative_path($bundle_path);
91
+ $this->set(array(
92
+ 'options' => $exportOptions
93
+ ))->save();
94
+
95
+ return $bundle_path;
96
+ }
97
+
98
+ public function fix_template_options()
99
+ {
100
+ // migrate media options since @version 1.0.5
101
+ if ( empty($this->options['migration']) )
102
+ {
103
+ $options = $this->options;
104
+
105
+ $options['migration'] = PMXE_VERSION;
106
+
107
+ $is_migrate_media = false;
108
+
109
+ foreach ($options['ids'] as $ID => $value)
110
+ {
111
+ if ( in_array($options['cc_type'][$ID], array('media', 'attachments')))
112
+ {
113
+ $is_migrate_media = true;
114
+ break;
115
+ }
116
+ }
117
+
118
+ if ( ! $is_migrate_media )
119
+ {
120
+ $this->set(array('options' => $options))->save();
121
+
122
+ return $this;
123
+ }
124
+
125
+ $fields = array();
126
+
127
+ foreach ($options['ids'] as $ID => $value)
128
+ {
129
+ $field = array(
130
+ 'cc_label' => empty($options['cc_label'][$ID]) ? '' : $options['cc_label'][$ID],
131
+ 'cc_php' => empty($options['cc_php'][$ID]) ? '' : $options['cc_php'][$ID],
132
+ 'cc_code' => empty($options['cc_code'][$ID]) ? '' : $options['cc_code'][$ID],
133
+ 'cc_sql' => empty($options['cc_sql'][$ID]) ? '' : $options['cc_sql'][$ID],
134
+ 'cc_type' => empty($options['cc_type'][$ID]) ? '' : $options['cc_type'][$ID],
135
+ 'cc_options' => empty($options['cc_options'][$ID]) ? '' : $options['cc_options'][$ID],
136
+ 'cc_value' => empty($options['cc_value'][$ID]) ? '' : $options['cc_value'][$ID],
137
+ 'cc_name' => empty($options['cc_name'][$ID]) ? '' : $options['cc_name'][$ID],
138
+ 'cc_settings' => empty($options['cc_settings'][$ID]) ? '' : $options['cc_settings'][$ID]
139
+ );
140
+
141
+ switch ($field['cc_type'])
142
+ {
143
+ case 'media':
144
+
145
+ switch ($field['cc_options'])
146
+ {
147
+ case 'urls':
148
+ $field['cc_label'] = 'url';
149
+ $field['cc_value'] = 'url';
150
+ $field['cc_type'] = 'image_url';
151
+ break;
152
+ case 'filenames':
153
+ $field['cc_label'] = 'filename';
154
+ $field['cc_value'] = 'filename';
155
+ $field['cc_type'] = 'image_filename';
156
+ break;
157
+ case 'filepaths':
158
+ $field['cc_label'] = 'path';
159
+ $field['cc_value'] = 'path';
160
+ $field['cc_type'] = 'image_path';
161
+ break;
162
+ default:
163
+ $field['cc_label'] = 'url';
164
+ $field['cc_value'] = 'url';
165
+ $field['cc_type'] = 'image_url';
166
+ break;
167
+ }
168
+
169
+ $field_name = $field['cc_name'];
170
+ $field['cc_name'] .= '_images';
171
+ $field['cc_options'] = '{"is_export_featured":true,"is_export_attached":true,"image_separator":"|"}';
172
+
173
+ $fields[] = $field;
174
+
175
+ $new_fields = array('title', 'caption', 'description', 'alt');
176
+
177
+ foreach ($new_fields as $value)
178
+ {
179
+ $new_field = array(
180
+ 'cc_label' => $value,
181
+ 'cc_php' => empty($options['cc_php'][$ID]) ? '' : $options['cc_php'][$ID],
182
+ 'cc_code' => empty($options['cc_code'][$ID]) ? '' : $options['cc_code'][$ID],
183
+ 'cc_sql' => empty($options['cc_sql'][$ID]) ? '' : $options['cc_sql'][$ID],
184
+ 'cc_type' => 'image_' . $value,
185
+ 'cc_options' => '{"is_export_featured":true,"is_export_attached":true,"image_separator":"|"}',
186
+ 'cc_value' => $value,
187
+ 'cc_name' => $field_name . '_' . $value,
188
+ 'cc_settings' => ''
189
+ );
190
+
191
+ $fields[] = $new_field;
192
+ }
193
+
194
+ break;
195
+
196
+ case 'attachments':
197
+ $field['cc_type'] = 'attachment_url';
198
+ $field['cc_options'] = '';
199
+ $fields[] = $field;
200
+ break;
201
+
202
+ default:
203
+ $fields[] = $field;
204
+ break;
205
+ }
206
+ }
207
+
208
+ // reset fields settings
209
+ $options['ids'] = array();
210
+ $options['cc_label'] = array();
211
+ $options['cc_php'] = array();
212
+ $options['cc_code'] = array();
213
+ $options['cc_sql'] = array();
214
+ $options['cc_type'] = array();
215
+ $options['cc_options'] = array();
216
+ $options['cc_value'] = array();
217
+ $options['cc_name'] = array();
218
+ $options['cc_settings'] = array();
219
+
220
+ // apply new field settings
221
+ foreach ($fields as $ID => $field) {
222
+ $options['ids'][] = 1;
223
+ $options['cc_label'][] = $field['cc_label'];
224
+ $options['cc_php'][] = $field['cc_php'];
225
+ $options['cc_code'][] = $field['cc_code'];
226
+ $options['cc_sql'][] = $field['cc_sql'];
227
+ $options['cc_type'][] = $field['cc_type'];
228
+ $options['cc_options'][] = $field['cc_options'];
229
+ $options['cc_value'][] = $field['cc_value'];
230
+ $options['cc_name'][] = $field['cc_name'];
231
+ $options['cc_settings'][] = $field['cc_settings'];
232
+ }
233
+
234
+ $this->set(array('options' => $options))->save();
235
+ }
236
+
237
+ return $this;
238
+ }
239
+
240
+ public static function is_bundle_supported( $options )
241
+ {
242
+ $unsupported_post_types = array('comments', 'shop_order');
243
+ return ( empty($options['cpt']) and ! in_array($options['wp_query_selector'], array('wp_comment_query')) or ! empty($options['cpt']) and ! in_array($options['cpt'][0], $unsupported_post_types) ) ? true : false;
244
+ }
245
+
246
+ /**
247
  * Clear associations with posts
248
  * @return PMXE_Import_Record
249
  * @chainable
254
  return $this;
255
  }
256
 
257
+ /**
258
+ * Delete associated sub exports
259
+ * @return PMXE_Export_Record
260
+ * @chainable
261
+ */
262
+ public function deleteChildren(){
263
+ $exportList = new PMXE_Export_List();
264
+ foreach ($exportList->getBy('parent_id', $this->id)->convertRecords() as $i) {
265
+ $i->delete();
266
+ }
267
+ return $this;
268
+ }
269
+
270
  /**
271
  * @see parent::delete()
272
  */
273
  public function delete() {
274
+ $this->deletePosts()->deleteChildren();
275
  if ( ! empty($this->options['import_id']) and wp_all_export_is_compatible()){
276
  $import = new PMXI_Import_Record();
277
  $import->getById($this->options['import_id']);
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Export WordPress data to XML/CSV ===
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
- Tested up to: 4.4.1
5
- Stable tag: 1.0.4
6
  Tags: wordpress csv export, wordpress xml export, xml, csv, datafeed, export, migrate, export csv from wordpress, export xml from wordpress, advanced xml export, advanced csv export, export data, bulk csv export, export custom post type, export woocommerce products, export woocommerce orders, migrate woocommerce, csv export, export csv, xml export, export xml, csv exporter, datafeed
7
 
8
  WP All Export is an extremely powerful exporter that makes it easy to export any XML or CSV file from WordPress.
@@ -78,6 +78,16 @@ Either: -
78
 
79
  == Changelog ==
80
 
 
 
 
 
 
 
 
 
 
 
81
  = 1.0.4 =
82
  * fixed export attachment meta alt
83
  * fixed export manually stored ACF
1
  === Export WordPress data to XML/CSV ===
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
+ Tested up to: 4.5.1
5
+ Stable tag: 1.0.5
6
  Tags: wordpress csv export, wordpress xml export, xml, csv, datafeed, export, migrate, export csv from wordpress, export xml from wordpress, advanced xml export, advanced csv export, export data, bulk csv export, export custom post type, export woocommerce products, export woocommerce orders, migrate woocommerce, csv export, export csv, xml export, export xml, csv exporter, datafeed
7
 
8
  WP All Export is an extremely powerful exporter that makes it easy to export any XML or CSV file from WordPress.
78
 
79
  == Changelog ==
80
 
81
+ = 1.0.5 =
82
+ * fixed misaligned columns on exporting product attributes
83
+ * fixed export nested repeaters field in CSV format
84
+ * fixed live records counting for advanced export mode
85
+ * fixed Events Calendar conflict
86
+ * added new filters 'wp_all_export_add_before_node', 'wp_all_export_add_after_node'
87
+ * added possibility export repeater rows one per line
88
+ * exclude orphaned variations from exprt file
89
+ * changed UI for export media data ( images & attachments )
90
+
91
  = 1.0.4 =
92
  * fixed export attachment meta alt
93
  * fixed export manually stored ACF
schema.php CHANGED
@@ -40,6 +40,7 @@ CREATE TABLE {$table_prefix}templates (
40
  ) $charset_collate;
41
  CREATE TABLE {$table_prefix}exports (
42
  id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 
43
  attch_id BIGINT(20) UNSIGNED NOT NULL,
44
  options LONGTEXT,
45
  scheduled VARCHAR(64) NOT NULL DEFAULT '',
@@ -54,6 +55,7 @@ CREATE TABLE {$table_prefix}exports (
54
  executing BOOL NOT NULL DEFAULT 0,
55
  triggered BOOL NOT NULL DEFAULT 0,
56
  iteration BIGINT(20) NOT NULL DEFAULT 0,
 
57
  PRIMARY KEY (id)
58
  ) $charset_collate;
59
  SCHEMA;
40
  ) $charset_collate;
41
  CREATE TABLE {$table_prefix}exports (
42
  id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
43
+ parent_id BIGINT(20) NOT NULL DEFAULT 0,
44
  attch_id BIGINT(20) UNSIGNED NOT NULL,
45
  options LONGTEXT,
46
  scheduled VARCHAR(64) NOT NULL DEFAULT '',
55
  executing BOOL NOT NULL DEFAULT 0,
56
  triggered BOOL NOT NULL DEFAULT 0,
57
  iteration BIGINT(20) NOT NULL DEFAULT 0,
58
+ export_post_type VARCHAR(64) NOT NULL DEFAULT '',
59
  PRIMARY KEY (id)
60
  ) $charset_collate;
61
  SCHEMA;
static/css/admin.css CHANGED
@@ -1,5 +1,24 @@
1
- .wpallexport-plugin .preview_a_row, .wpallexport-plugin .add_column{
2
- margin-top: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  }
4
  .wpallexport-plugin fieldset.column{
5
  display: none;
@@ -17,7 +36,7 @@
17
  position: relative;
18
  }
19
  .wpallexport-plugin #wp_all_export_auto_generate_data{
20
- background: #33aa28 none repeat scroll 0 0;
21
  color: #fff;
22
  display: block;
23
  margin: 10px 5px;
@@ -45,6 +64,7 @@
45
  text-decoration: underline !important;
46
  }
47
  .wpallexport-plugin .wpallexport-user-export-notice,
 
48
  .wpallexport-plugin .wpallexport-comments-export-notice{
49
  padding: 20px;
50
  display: none;
@@ -112,7 +132,8 @@
112
  .wpallexport-plugin #available_data{
113
  padding: 0;
114
  background: #fafafa;
115
- border: 1px solid #ddd;
 
116
  }
117
  .wpallexport-plugin #available_data .title,
118
  .wpallexport-plugin .wp-all-export-edit-column .title {
@@ -226,10 +247,106 @@
226
  color: #888;
227
  display: block;
228
  font-size: 12px;
229
- margin-right: 190px;
230
  opacity: 0.7;
231
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
 
 
 
 
 
 
233
  /*--------------------------------------------------------------------------
234
  *
235
  * Basic rules
@@ -306,7 +423,7 @@
306
  text-decoration: none;
307
  }
308
  .wpallexport-plugin .wpallexport-large-button{
309
- box-shadow: none;
310
  vertical-align:bottom !important;
311
  height: 40px;
312
  line-height: 39px;
@@ -324,7 +441,7 @@
324
  .wpallexport-plugin .wpallexport-logo{
325
  background: url('../img/logo.png');
326
  width: 60px;
327
- height: 51px;
328
  float: left;
329
  margin-right: 10px;
330
  }
@@ -1174,7 +1291,8 @@
1174
  text-align: center;
1175
  }
1176
  .wpallexport-plugin .wpallexport-import-types h2,
1177
- .wpallexport-plugin .wpallexport-import-types h3{
 
1178
  color:#40ad6e;
1179
  font-size: 24px;
1180
  margin-bottom: 25px;
@@ -1275,6 +1393,10 @@
1275
  top:10px;
1276
  left: -10px;
1277
  }
 
 
 
 
1278
 
1279
  .wpallexport-plugin .wpallexport-upload-resource-step-one,
1280
  .wpallexport-plugin .wpallexport-file-upload-result{
@@ -1413,62 +1535,6 @@
1413
  position: relative;
1414
  top: -2px;
1415
  }
1416
- .wpallexport-plugin .wpallexport-import-to{
1417
- background: none repeat scroll 0 0 #f6f5f1;
1418
- border: 1px solid #ddd;
1419
- color: #888;
1420
- display: inline-block;
1421
- font-size: 18px;
1422
- height: 50px;
1423
- line-height: 24px;
1424
- padding-top: 25px;
1425
- text-align: center;
1426
- text-decoration: none;
1427
- width: 360px;
1428
- margin-right: 10px;
1429
- position: relative;
1430
- }
1431
- .wpallexport-plugin .wpallexport-import-to span.wpallexport-import-to-arrow{
1432
- display: none;
1433
- }
1434
- .wpallexport-plugin .wpallexport-import-to.wpallexport-import-to-checked span.wpallexport-import-to-arrow{
1435
- background: url('../img/ui_4.0/bottom_arrow.png') no-repeat;
1436
- position: absolute;
1437
- bottom: -12px;
1438
- left: 48%;
1439
- display: block;
1440
- height: 14px;
1441
- width: 24px;
1442
- }
1443
- .wpallexport-plugin .wpallexport-import-to.wpallexport-import-to-checked{
1444
- background: #38A659;
1445
- border: 1px solid #3da55c;
1446
- color: #fff;
1447
- }
1448
- .wpallexport-plugin .wpallexport-import-to.wpallexport-to-new-items span.wpallexport-import-to-title:before{
1449
- content: "\f464";
1450
- /*display: inline-block;*/
1451
- font-family: "dashicons";
1452
- font-size: 33px;
1453
- left: 27%;
1454
- line-height: 10px;
1455
- position: absolute;
1456
- top: 33px;
1457
- }
1458
- .wpallexport-plugin .wpallexport-import-to.wpallexport-to-new-items.wpallexport-import-to-checked span.wpallexport-import-to-title:before,
1459
- .wpallexport-plugin .wpallexport-import-to.wpallexport-to-existing-items.wpallexport-import-to-checked span.wpallexport-import-to-title:before{
1460
- color: #a3ddb4;
1461
- }
1462
- .wpallexport-plugin .wpallexport-import-to.wpallexport-to-existing-items span.wpallexport-import-to-title:before{
1463
- content: "\f321";
1464
- /*display: inline-block;*/
1465
- font-family: "dashicons";
1466
- font-size: 33px;
1467
- left: 23%;
1468
- line-height: 10px;
1469
- position: absolute;
1470
- top: 33px;
1471
- }
1472
  .wpallexport-plugin #file_selector .dd-option .dashicon:before,
1473
  .wpallexport-plugin #file_selector .dd-selected .dashicon:before {
1474
  font-size: 24px;
@@ -1494,6 +1560,19 @@
1494
  color: #555;
1495
  margin-top: 0;
1496
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1497
  .wpallexport-plugin #file_selector .dd-option .dashicon-cpt:before,
1498
  .wpallexport-plugin #file_selector .dd-selected .dashicon-cpt:before{
1499
  font-family: "dashicons";
@@ -1616,6 +1695,7 @@
1616
  background: none;
1617
  }
1618
  .wpallexport-plugin .wp_all_export_product_matching_mode{
 
1619
  margin-left: 10px;
1620
  }
1621
  /*--------------------------------------------------------------------------
@@ -1624,10 +1704,17 @@
1624
  *
1625
  *-------------------------------------------------------------------------*/
1626
 
 
 
 
 
 
 
1627
  .wpallexport-plugin .wpallexport-console{
1628
  position:relative;
1629
  padding:0;
1630
  display:none;
 
1631
  }
1632
  .wpallexport-plugin .action_buttons{
1633
  overflow: hidden;
@@ -1667,8 +1754,8 @@
1667
  width: 50px;
1668
  }
1669
  .wpallexport-plugin #wp_all_export_add_rule{
1670
- background: url("../img/rule.png") no-repeat scroll 10px 10px #dcdcdc;
1671
- border: 1px solid #dcdcdc;
1672
  border-radius: 5px;
1673
  -moz-border-radius: 5px;
1674
  -khtml-border-radius: 5px;
@@ -1743,6 +1830,7 @@
1743
  background: url('../img/list.png') no-repeat 0 3px;
1744
  padding-left: 30px;
1745
  height: 25px;
 
1746
  }
1747
  .wpallexport-plugin .wp_all_export_filtering_rules .drag-element .rule_element{
1748
  display: inline-block;
@@ -1833,6 +1921,16 @@
1833
  margin-top: 5px;
1834
  font-size:20px;
1835
  }
 
 
 
 
 
 
 
 
 
 
1836
  .wpallexport-plugin .wpallexport-change-root-element{
1837
  display: block;
1838
  background: #f6f5f1;
@@ -1929,10 +2027,13 @@
1929
  *-------------------------------------------------------------------------*/
1930
 
1931
  /*@+ Template form */
 
 
 
1932
  .wpallexport-plugin form.wpallexport-step-3 {
1933
  /*width: 700px;*/
1934
- position: fixed;
1935
- width: 66.6%;
1936
  margin-top: 0 !important;
1937
  }
1938
  .wpallexport-plugin form.wpallexport-template .load-template {
@@ -1941,7 +2042,7 @@
1941
  }
1942
 
1943
  .wpallexport-plugin form.wpallexport-step-3 .wpallexport-section .wpallexport-content-section{
1944
- overflow: hidden;
1945
  padding-bottom: 0;
1946
  margin-top: 0;
1947
  }
@@ -2054,6 +2155,17 @@
2054
  position: relative;
2055
  float: right;
2056
  }
 
 
 
 
 
 
 
 
 
 
 
2057
  .wpallexport-plugin .sub_input{
2058
  padding-left:17px;
2059
  margin: 5px;
@@ -2411,11 +2523,8 @@
2411
  /*display: block;
2412
  padding: 5px;*/
2413
  }
2414
- .wpallexport-plugin .wp-all-export-format{
2415
- float: right;
2416
- height: 90px;
2417
- margin-top: 15px;
2418
- width: 200px;
2419
  }
2420
 
2421
  /*--------------------------------------------------------------------------
@@ -2496,7 +2605,7 @@
2496
  overflow: hidden;
2497
  }
2498
  .wpallexport-plugin form.edit{
2499
- overflow: hidden;
2500
  }
2501
  .wpallexport-plugin .switcher-target-is_keep_former_posts{
2502
  padding-left: 25px;
@@ -2610,7 +2719,11 @@
2610
  border: none;
2611
  padding: 1px;
2612
  }
2613
- .wpallexport-plugin #processbar{
 
 
 
 
2614
  text-align: center;
2615
  visibility: hidden;
2616
  height: 30px;
@@ -2620,14 +2733,30 @@
2620
  color: #222222;
2621
  position: relative;
2622
  }
2623
- .wpallexport-plugin #processbar div{
 
2624
  background: #76d771;
2625
  height: 30px;
2626
  width: 0%;
2627
  position: absolute;
2628
  top:0;
2629
  }
2630
- .wpallexport-plugin #export_progress{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2631
  color: #000000;
2632
  font-size: 21px;
2633
  /*font-weight: bold;*/
@@ -2638,26 +2767,35 @@
2638
  position: relative;
2639
  padding-top: 10px;
2640
  }
2641
- .wpallexport-plugin #export_progress #center_progress{
2642
  color:#46ba69;
2643
  font-size: 60px;
2644
  }
2645
- .wpallexport-plugin #right_progress{
2646
  position: absolute;
2647
  right: 0;
2648
  color:#777;
2649
  }
2650
- .wpallexport-plugin #right_progress span{
2651
  color:#000;
2652
  }
2653
- .wpallexport-plugin #left_progress{
2654
  position: absolute;
2655
  left: 0;
2656
  color: #777;
2657
  }
2658
- .wpallexport-plugin #left_progress #then{
2659
  color:#000;
2660
  }
 
 
 
 
 
 
 
 
 
2661
  .wpallexport-plugin #existing_meta_keys{
2662
  margin-bottom: 10px;
2663
  padding: 2px;
@@ -2875,6 +3013,8 @@
2875
 
2876
  .wpallexport-plugin .wpallexport-xml {
2877
  /*padding-left: 15px;*/
 
 
2878
  }
2879
  .wpallexport-plugin .wpallexport-xml .wpallexport-hasmenu{
2880
  -webkit-user-select: none;
@@ -3089,7 +3229,7 @@
3089
  }
3090
  /*@*/
3091
  .wpallexport-plugin form.settings p{
3092
- font-size: 14px;
3093
  }
3094
  .wpallexport-plugin form.settings .wpallexport-header{
3095
  overflow: hidden;
@@ -3151,7 +3291,9 @@
3151
  color: #777 !important;
3152
  padding: 9px 15px 9px 30px;
3153
  }
3154
-
 
 
3155
  /*--------------------------------------------------------------------------
3156
  *
3157
  * Media Queries
@@ -3163,6 +3305,9 @@
3163
  .wpallexport-plugin .change_file a.wpallexport-import-from{
3164
  width: 320px;
3165
  }
 
 
 
3166
  }
3167
 
3168
  @media screen and (min-width: 1530px) and (max-width: 1629px) {
@@ -3170,6 +3315,10 @@
3170
  .wpallexport-plugin .change_file a.wpallexport-import-from{
3171
  width: 295px;
3172
  }
 
 
 
 
3173
  }
3174
 
3175
  @media screen and (min-width: 1416px) and (max-width: 1529px) {
@@ -3182,6 +3331,10 @@
3182
  display: block;
3183
  max-width: 585px;
3184
  }
 
 
 
 
3185
  }
3186
 
3187
  @media screen and (min-width: 1350px) and (max-width: 1415px) {
@@ -3189,7 +3342,7 @@
3189
  width: 1120px;
3190
  }
3191
  /*.wpallexport-plugin a.wpallexport-import-from{
3192
- width: 292px;
3193
  }*/
3194
  .wpallexport-plugin .change_file a.wpallexport-import-from{
3195
  width: 220px;
@@ -3217,6 +3370,9 @@
3217
  .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3218
  margin-left: -13%;
3219
  }
 
 
 
3220
  }
3221
 
3222
  @media screen and (min-width: 1250px) and (max-width: 1349px) {
@@ -3224,7 +3380,7 @@
3224
  width: 1020px;
3225
  }
3226
  /*.wpallexport-plugin a.wpallexport-import-from{
3227
- width: 292px;
3228
  }*/
3229
  .wpallexport-plugin .wpallexport-ready-to-go h4{
3230
  font-size: 18px;
@@ -3261,8 +3417,11 @@
3261
  .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3262
  margin-left: -16%;
3263
  }
3264
- .wpallexport-plugin form.wpallexport-step-3{
3265
  width: 60%;
 
 
 
3266
  }
3267
  }
3268
 
@@ -3271,7 +3430,7 @@
3271
  width: 920px;
3272
  }
3273
  /*.wpallexport-plugin a.wpallexport-import-from{
3274
- width: 292px;
3275
  }*/
3276
  .wpallexport-plugin .wpallexport-upload-type-container{
3277
  padding: 0 40px;
@@ -3331,19 +3490,22 @@
3331
  .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3332
  margin-left: -16%;
3333
  }
3334
- .wpallexport-plugin form.wpallexport-step-3{
3335
  width: 55%;
 
 
 
3336
  }
3337
  }
3338
  @media screen and (min-width: 1050px) and (max-width: 1149px) {
3339
- .wpallexport-plugin form.wpallexport-step-3{
3340
  width: 55%;
3341
- }
3342
  .wpallexport-plugin .wpallexport-wrapper{
3343
  width: 800px;
3344
  }
3345
  /*.wpallexport-plugin a.wpallexport-import-from{
3346
- width: 292px;
3347
  font-size: 15px;
3348
  }*/
3349
  .wpallexport-plugin .wpallexport-upload-type-container{
@@ -3362,7 +3524,7 @@
3362
  .wpallexport-plugin #export_finished h3{
3363
  font-size: 14px;
3364
  }
3365
- .wpallexport-plugin #export_progress{
3366
  font-size: 16px;
3367
  }
3368
  .wpallexport-plugin .change_file .wpallexport-import-types{
@@ -3412,13 +3574,16 @@
3412
  .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3413
  margin-left: -16%;
3414
  }
 
 
 
3415
  }
3416
  @media screen and (max-width: 1049px) {
3417
  .wpallexport-plugin .wpallexport-wrapper{
3418
  width: 760px;
3419
  }
3420
  /*.wpallexport-plugin a.wpallexport-import-from{
3421
- width: 300px;
3422
  font-size: 15px;
3423
  }*/
3424
  .wpallexport-plugin .wpallexport-upload-type-container{
@@ -3440,7 +3605,7 @@
3440
  .wpallexport-plugin #export_finished h3{
3441
  font-size: 13px;
3442
  }
3443
- .wpallexport-plugin #export_progress{
3444
  font-size: 16px;
3445
  }
3446
 
@@ -3503,7 +3668,10 @@
3503
  .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3504
  margin-left: -16%;
3505
  }
3506
- .wpallexport-plugin form.wpallexport-step-3{
3507
  width: 55%;
 
 
 
3508
  }
3509
- }
1
+ .wpallexport-plugin .preview_a_row,
2
+ .wpallexport-plugin .add_column,
3
+ .wpallexport-plugin .wp_all_export_auto_generate_data{
4
+ background: #40acad;
5
+ -moz-border-radius: 4px;
6
+ -khtml-border-radius: 4px;
7
+ -webkit-border-radius: 4px;
8
+ border-radius: 4px;
9
+ clear: both;
10
+ color: #fff !important;
11
+ float: right;
12
+ font-size: 14px;
13
+ /*margin: 10px 0;*/
14
+ padding: 10px 20px 10px 20px;
15
+ border: none;
16
+ cursor: pointer;
17
+ }
18
+ .wpallexport-plugin .wp_all_export_auto_generate_data{
19
+ clear: none;
20
+ margin-left: 20px;
21
+ float: left;
22
  }
23
  .wpallexport-plugin fieldset.column{
24
  display: none;
36
  position: relative;
37
  }
38
  .wpallexport-plugin #wp_all_export_auto_generate_data{
39
+ background: #38a659 none repeat scroll 0 0;
40
  color: #fff;
41
  display: block;
42
  margin: 10px 5px;
64
  text-decoration: underline !important;
65
  }
66
  .wpallexport-plugin .wpallexport-user-export-notice,
67
+ .wpallexport-plugin .wpallexport-shop_customer-export-notice,
68
  .wpallexport-plugin .wpallexport-comments-export-notice{
69
  padding: 20px;
70
  display: none;
132
  .wpallexport-plugin #available_data{
133
  padding: 0;
134
  background: #fafafa;
135
+ border: 1px solid #ddd;
136
+ overflow: hidden;
137
  }
138
  .wpallexport-plugin #available_data .title,
139
  .wpallexport-plugin .wp-all-export-edit-column .title {
247
  color: #888;
248
  display: block;
249
  font-size: 12px;
250
+ /*margin-right: 190px;*/
251
  opacity: 0.7;
252
  }
253
+ .wpallexport-plugin .wpallexport-filtering-wrapper{
254
+ overflow: hidden;
255
+ background: #fff none repeat scroll 0 0;
256
+ border-color: #ddd;
257
+ border-style: solid;
258
+ border-width: 1px;
259
+ padding: 0 20px 0;
260
+ margin-top: 20px;
261
+ display: none;
262
+ }
263
+ .wpallexport-plugin .last_condition{
264
+ display: none !important;
265
+ }
266
+
267
+ .wpallexport-plugin #date_field_notice{
268
+ display: none;
269
+ }
270
+ .wpallexport-plugin .wp_all_export_btn_with_note{
271
+ display: inline-block;
272
+ }
273
+
274
+ .wpallexport-plugin .wpallexport-import-to-format{
275
+ background: #f6f5f1 none repeat scroll 0 0;
276
+ border: 1px solid #cfceca;
277
+ color: #888 !important;
278
+ display: inline-block;
279
+ font-size: 18px;
280
+ height: 50px;
281
+ line-height: 10px;
282
+ padding-top: 25px;
283
+ text-align: center;
284
+ text-decoration: none;
285
+ max-width: 360px;
286
+ width:40%;
287
+ margin-right: 10px;
288
+ position: relative;
289
+
290
+ }
291
+ .wpallexport-plugin .wpallexport-import-to-format.selected{
292
+ background: #38a659 none repeat scroll 0 0;
293
+ border: 1px solid #3da55c;
294
+ color: #fff !important;
295
+ }
296
+
297
+ .wpallexport-plugin .wpallexport-import-to-format span.wpallexport-import-to-arrow{
298
+ display: none;
299
+ }
300
+ .wpallexport-plugin .wpallexport-import-to-format.selected span.wpallexport-import-to-arrow{
301
+ background: url('../img/bottom_arrow.png') no-repeat;
302
+ position: absolute;
303
+ bottom: -12px;
304
+ left: 48%;
305
+ display: block;
306
+ height: 14px;
307
+ width: 24px;
308
+ }
309
+
310
+
311
+ .wpallexport-plugin .wpallexport-import-to-format.wpallexport-csv-type span.wpallexport-import-to-title:before{
312
+ color: #888;
313
+ content: "\f495";
314
+ font-family: "dashicons";
315
+ font-size: 30px;
316
+ padding-right: 5px;
317
+ position: relative;
318
+ top: 7px;
319
+ }
320
+ .wpallexport-plugin .wpallexport-import-to-format.wpallexport-xml-type span.wpallexport-import-to-title:before{
321
+ color: #888;
322
+ content: "\f499";
323
+ font-family: "dashicons";
324
+ font-size: 30px;
325
+ padding-right: 5px;
326
+ position: relative;
327
+ top: 7px;
328
+ }
329
+ .wpallexport-plugin .wpallexport-import-to-format.wpallexport-csv-type.selected span.wpallexport-import-to-title:before,
330
+ .wpallexport-plugin .wpallexport-import-to-format.wpallexport-xml-type.selected span.wpallexport-import-to-title:before{
331
+ color: #a3ddb4;
332
+ }
333
+
334
+ .wpallexport-plugin .wpallexport-all-options .wpallexport-file-format-options{
335
+ margin: 10px auto;
336
+ text-align: center;
337
+ }
338
+ .wpallexport-plugin .wpallexport-all-options .wpallexport-file-format-options .wpallexport-csv-options{
339
+ margin: 0 auto;
340
+ min-height: 30px;
341
+ width: 82%;
342
+ max-width: 735px;
343
+ }
344
 
345
+ .wpallexport-plugin #available_data div.wpae-custom-field{
346
+ overflow: auto;
347
+ height: auto;
348
+ /*max-height: 500px; */
349
+ }
350
  /*--------------------------------------------------------------------------
351
  *
352
  * Basic rules
423
  text-decoration: none;
424
  }
425
  .wpallexport-plugin .wpallexport-large-button{
426
+ box-shadow: none !important;
427
  vertical-align:bottom !important;
428
  height: 40px;
429
  line-height: 39px;
441
  .wpallexport-plugin .wpallexport-logo{
442
  background: url('../img/logo.png');
443
  width: 60px;
444
+ height: 53px;
445
  float: left;
446
  margin-right: 10px;
447
  }
1291
  text-align: center;
1292
  }
1293
  .wpallexport-plugin .wpallexport-import-types h2,
1294
+ .wpallexport-plugin .wpallexport-import-types h3,
1295
+ .wpallexport-plugin .wpallexport-choose-data-type h3{
1296
  color:#40ad6e;
1297
  font-size: 24px;
1298
  margin-bottom: 25px;
1393
  top:10px;
1394
  left: -10px;
1395
  }
1396
+ .wpallexport-plugin a.wpallexport-import-from.wpallexport-url-type.selected span.wpallexport-icon:before,
1397
+ .wpallexport-plugin a.wpallexport-import-from.wpallexport-file-type.selected span.wpallexport-icon:before{
1398
+ color: #a3ddb4;
1399
+ }
1400
 
1401
  .wpallexport-plugin .wpallexport-upload-resource-step-one,
1402
  .wpallexport-plugin .wpallexport-file-upload-result{
1535
  position: relative;
1536
  top: -2px;
1537
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1538
  .wpallexport-plugin #file_selector .dd-option .dashicon:before,
1539
  .wpallexport-plugin #file_selector .dd-selected .dashicon:before {
1540
  font-size: 24px;
1560
  color: #555;
1561
  margin-top: 0;
1562
  }
1563
+ .wpallexport-plugin #file_selector .dd-option .dashicon-shop_order:before,
1564
+ .wpallexport-plugin #file_selector .dd-selected .dashicon-shop_order:before,
1565
+ .wpallexport-plugin #file_selector .dd-option .dashicon-shop_order_refund:before,
1566
+ .wpallexport-plugin #file_selector .dd-selected .dashicon-shop_order_refund:before,
1567
+ .wpallexport-plugin #file_selector .dd-option .dashicon-shop_coupon:before,
1568
+ .wpallexport-plugin #file_selector .dd-selected .dashicon-shop_coupon:before,
1569
+ .wpallexport-plugin #file_selector .dd-option .dashicon-shop_customer:before,
1570
+ .wpallexport-plugin #file_selector .dd-selected .dashicon-shop_customer:before{
1571
+ font-family: "WooCommerce";
1572
+ content: "\e03d";
1573
+ color: #555;
1574
+ margin-top: 2px;
1575
+ }
1576
  .wpallexport-plugin #file_selector .dd-option .dashicon-cpt:before,
1577
  .wpallexport-plugin #file_selector .dd-selected .dashicon-cpt:before{
1578
  font-family: "dashicons";
1695
  background: none;
1696
  }
1697
  .wpallexport-plugin .wp_all_export_product_matching_mode{
1698
+ margin-top: 25px;
1699
  margin-left: 10px;
1700
  }
1701
  /*--------------------------------------------------------------------------
1704
  *
1705
  *-------------------------------------------------------------------------*/
1706
 
1707
+ .wpallexport-plugin .wpallexport-filtering-section{
1708
+ padding-bottom: 15px !important;
1709
+ margin-bottom: 0px;
1710
+ margin-top: 10px;
1711
+ overflow: visible;
1712
+ }
1713
  .wpallexport-plugin .wpallexport-console{
1714
  position:relative;
1715
  padding:0;
1716
  display:none;
1717
+ height: 110px;
1718
  }
1719
  .wpallexport-plugin .action_buttons{
1720
  overflow: hidden;
1754
  width: 50px;
1755
  }
1756
  .wpallexport-plugin #wp_all_export_add_rule{
1757
+ background: url("../img/rule.png") no-repeat scroll 10px 10px #ccc;
1758
+ border: 1px solid #ddd;
1759
  border-radius: 5px;
1760
  -moz-border-radius: 5px;
1761
  -khtml-border-radius: 5px;
1830
  background: url('../img/list.png') no-repeat 0 3px;
1831
  padding-left: 30px;
1832
  height: 25px;
1833
+ line-height: 21px;
1834
  }
1835
  .wpallexport-plugin .wp_all_export_filtering_rules .drag-element .rule_element{
1836
  display: inline-block;
1921
  margin-top: 5px;
1922
  font-size:20px;
1923
  }
1924
+ .wpallexport-plugin .ajax-console .founded_records .wp_all_export_preloader{
1925
+ margin: 20px 0;
1926
+ position: relative;
1927
+ top:10px;
1928
+ }
1929
+ .wpallexport-plugin #filtering_result .wp_all_export_preloader{
1930
+ margin: 20px 0;
1931
+ position: relative;
1932
+ top:-10px;
1933
+ }
1934
  .wpallexport-plugin .wpallexport-change-root-element{
1935
  display: block;
1936
  background: #f6f5f1;
2027
  *-------------------------------------------------------------------------*/
2028
 
2029
  /*@+ Template form */
2030
+ .wpallexport-plugin .wpallexport-export-template tbody tr td.left{
2031
+ width: 81%;
2032
+ }
2033
  .wpallexport-plugin form.wpallexport-step-3 {
2034
  /*width: 700px;*/
2035
+ position: relative;
2036
+ width: 100%;
2037
  margin-top: 0 !important;
2038
  }
2039
  .wpallexport-plugin form.wpallexport-template .load-template {
2042
  }
2043
 
2044
  .wpallexport-plugin form.wpallexport-step-3 .wpallexport-section .wpallexport-content-section{
2045
+ /*overflow: hidden; */
2046
  padding-bottom: 0;
2047
  margin-top: 0;
2048
  }
2155
  position: relative;
2156
  float: right;
2157
  }
2158
+ .wpallexport-plugin .wp_all_export_functions_preloader{
2159
+ background: url("../img/preloader.gif") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
2160
+ margin-top: 6px;
2161
+ margin-left: 6px;
2162
+ height: 16px;
2163
+ line-height: 16px;
2164
+ padding-left: 20px;
2165
+ display: none;
2166
+ position: relative;
2167
+ float: right;
2168
+ }
2169
  .wpallexport-plugin .sub_input{
2170
  padding-left:17px;
2171
  margin: 5px;
2523
  /*display: block;
2524
  padding: 5px;*/
2525
  }
2526
+ .wpallexport-plugin .wp-all-export-format{
2527
+ /*margin-top: 15px; */
 
 
 
2528
  }
2529
 
2530
  /*--------------------------------------------------------------------------
2605
  overflow: hidden;
2606
  }
2607
  .wpallexport-plugin form.edit{
2608
+ /*overflow: hidden;*/
2609
  }
2610
  .wpallexport-plugin .switcher-target-is_keep_former_posts{
2611
  padding-left: 25px;
2719
  border: none;
2720
  padding: 1px;
2721
  }
2722
+ .wpallexport-plugin .wpallexport_process_parent_wrapper
2723
+ {
2724
+ margin-bottom: 20px;
2725
+ }
2726
+ .wpallexport-plugin .wpallexport_processbar{
2727
  text-align: center;
2728
  visibility: hidden;
2729
  height: 30px;
2733
  color: #222222;
2734
  position: relative;
2735
  }
2736
+ .wpallexport-plugin .wpallexport_processbar div
2737
+ {
2738
  background: #76d771;
2739
  height: 30px;
2740
  width: 0%;
2741
  position: absolute;
2742
  top:0;
2743
  }
2744
+ .wpallexport-plugin .wpallexport_process_child_wrapper
2745
+ {
2746
+ height: 55px;
2747
+ overflow: hidden;
2748
+ }
2749
+ .wpallexport-plugin .wpallexport_process_child_wrapper .wpallexport_processbar
2750
+ {
2751
+ height: 10px;
2752
+ margin: 10px 0px 10px;
2753
+ }
2754
+ .wpallexport-plugin .wpallexport_process_child_wrapper .wpallexport_processbar div
2755
+ {
2756
+ width: 0%;
2757
+ height: 10px;
2758
+ }
2759
+ .wpallexport-plugin .export_progress{
2760
  color: #000000;
2761
  font-size: 21px;
2762
  /*font-weight: bold;*/
2767
  position: relative;
2768
  padding-top: 10px;
2769
  }
2770
+ .wpallexport-plugin .export_progress .center_progress{
2771
  color:#46ba69;
2772
  font-size: 60px;
2773
  }
2774
+ .wpallexport-plugin .right_progress{
2775
  position: absolute;
2776
  right: 0;
2777
  color:#777;
2778
  }
2779
+ .wpallexport-plugin .right_progress span{
2780
  color:#000;
2781
  }
2782
+ .wpallexport-plugin .left_progress{
2783
  position: absolute;
2784
  left: 0;
2785
  color: #777;
2786
  }
2787
+ .wpallexport-plugin .left_progress #then{
2788
  color:#000;
2789
  }
2790
+ .wpallexport-plugin .wpallexport_process_child_wrapper .export_progress
2791
+ {
2792
+ font-size: 16px;
2793
+ padding: 0px;
2794
+ }
2795
+ .wpallexport-plugin .wpallexport_process_child_wrapper .center_progress
2796
+ {
2797
+ font-size: 20px;
2798
+ }
2799
  .wpallexport-plugin #existing_meta_keys{
2800
  margin-bottom: 10px;
2801
  padding: 2px;
3013
 
3014
  .wpallexport-plugin .wpallexport-xml {
3015
  /*padding-left: 15px;*/
3016
+ overflow: auto;
3017
+ /*height: 92%;*/
3018
  }
3019
  .wpallexport-plugin .wpallexport-xml .wpallexport-hasmenu{
3020
  -webkit-user-select: none;
3229
  }
3230
  /*@*/
3231
  .wpallexport-plugin form.settings p{
3232
+ /*font-size: 14px !important;*/
3233
  }
3234
  .wpallexport-plugin form.settings .wpallexport-header{
3235
  overflow: hidden;
3291
  color: #777 !important;
3292
  padding: 9px 15px 9px 30px;
3293
  }
3294
+ .wpallexport-plugin .wpae-custom-field ul li{
3295
+ margin-left: 15px;
3296
+ }
3297
  /*--------------------------------------------------------------------------
3298
  *
3299
  * Media Queries
3305
  .wpallexport-plugin .change_file a.wpallexport-import-from{
3306
  width: 320px;
3307
  }
3308
+ .wpallexport-plugin .wpallexport-export-template tbody tr td.left{
3309
+ width: 78%;
3310
+ }
3311
  }
3312
 
3313
  @media screen and (min-width: 1530px) and (max-width: 1629px) {
3315
  .wpallexport-plugin .change_file a.wpallexport-import-from{
3316
  width: 295px;
3317
  }
3318
+
3319
+ .wpallexport-plugin .wpallexport-export-template tbody tr td.left{
3320
+ width: 78%;
3321
+ }
3322
  }
3323
 
3324
  @media screen and (min-width: 1416px) and (max-width: 1529px) {
3331
  display: block;
3332
  max-width: 585px;
3333
  }
3334
+
3335
+ .wpallexport-plugin .wpallexport-export-template tbody tr td.left{
3336
+ width: 78%;
3337
+ }
3338
  }
3339
 
3340
  @media screen and (min-width: 1350px) and (max-width: 1415px) {
3342
  width: 1120px;
3343
  }
3344
  /*.wpallexport-plugin a.wpallexport-import-from{
3345
+ width: 340px;
3346
  }*/
3347
  .wpallexport-plugin .change_file a.wpallexport-import-from{
3348
  width: 220px;
3370
  .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3371
  margin-left: -13%;
3372
  }
3373
+ .wpallexport-plugin .wpallexport-export-template tbody tr td.left{
3374
+ width: 76%;
3375
+ }
3376
  }
3377
 
3378
  @media screen and (min-width: 1250px) and (max-width: 1349px) {
3380
  width: 1020px;
3381
  }
3382
  /*.wpallexport-plugin a.wpallexport-import-from{
3383
+ width: 300px;
3384
  }*/
3385
  .wpallexport-plugin .wpallexport-ready-to-go h4{
3386
  font-size: 18px;
3417
  .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3418
  margin-left: -16%;
3419
  }
3420
+ /*.wpallexport-plugin form.wpallexport-step-3{
3421
  width: 60%;
3422
+ }*/
3423
+ .wpallexport-plugin .wpallexport-export-template tbody tr td.left{
3424
+ width: 74%;
3425
  }
3426
  }
3427
 
3430
  width: 920px;
3431
  }
3432
  /*.wpallexport-plugin a.wpallexport-import-from{
3433
+ width: 260px;
3434
  }*/
3435
  .wpallexport-plugin .wpallexport-upload-type-container{
3436
  padding: 0 40px;
3490
  .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3491
  margin-left: -16%;
3492
  }
3493
+ /*.wpallexport-plugin form.wpallexport-step-3{
3494
  width: 55%;
3495
+ }*/
3496
+ .wpallexport-plugin .wpallexport-export-template tbody tr td.left{
3497
+ width: 71%;
3498
  }
3499
  }
3500
  @media screen and (min-width: 1050px) and (max-width: 1149px) {
3501
+ /*.wpallexport-plugin form.wpallexport-step-3{
3502
  width: 55%;
3503
+ }*/
3504
  .wpallexport-plugin .wpallexport-wrapper{
3505
  width: 800px;
3506
  }
3507
  /*.wpallexport-plugin a.wpallexport-import-from{
3508
+ width: 230px;
3509
  font-size: 15px;
3510
  }*/
3511
  .wpallexport-plugin .wpallexport-upload-type-container{
3524
  .wpallexport-plugin #export_finished h3{
3525
  font-size: 14px;
3526
  }
3527
+ .wpallexport-plugin .export_progress{
3528
  font-size: 16px;
3529
  }
3530
  .wpallexport-plugin .change_file .wpallexport-import-types{
3574
  .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3575
  margin-left: -16%;
3576
  }
3577
+ .wpallexport-plugin .wpallexport-export-template tbody tr td.left{
3578
+ width: 67%;
3579
+ }
3580
  }
3581
  @media screen and (max-width: 1049px) {
3582
  .wpallexport-plugin .wpallexport-wrapper{
3583
  width: 760px;
3584
  }
3585
  /*.wpallexport-plugin a.wpallexport-import-from{
3586
+ width: 220px;
3587
  font-size: 15px;
3588
  }*/
3589
  .wpallexport-plugin .wpallexport-upload-type-container{
3605
  .wpallexport-plugin #export_finished h3{
3606
  font-size: 13px;
3607
  }
3608
+ .wpallexport-plugin .export_progress{
3609
  font-size: 16px;
3610
  }
3611
 
3668
  .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3669
  margin-left: -16%;
3670
  }
3671
+ /*.wpallexport-plugin form.wpallexport-step-3{
3672
  width: 55%;
3673
+ }*/
3674
+ .wpallexport-plugin .wpallexport-export-template tbody tr td.left{
3675
+ width: 65%;
3676
  }
3677
+ }
static/js/admin.js CHANGED
@@ -41,8 +41,15 @@
41
  matchBrackets: true,
42
  mode: "application/x-httpd-php",
43
  indentUnit: 4,
44
- indentWithTabs: true
 
45
  });
 
 
 
 
 
 
46
  }
47
 
48
  // swither show/hide logic
@@ -114,11 +121,14 @@
114
  }
115
  else{
116
  $parent.addClass('closed');
117
- $parent.find('.wpallexport-collapsed-content:first').slideUp();
118
  }
119
  });
120
 
121
- var get_valid_ajaxurl = function(){
 
 
 
122
  var $URL = ajaxurl;
123
  if (typeof export_id != "undefined")
124
  {
@@ -134,8 +144,74 @@
134
  return $URL;
135
  }
136
 
137
- // Export filtering
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
 
 
139
  var init_filtering_fields = function(){
140
 
141
  var wp_all_export_rules_config = {
@@ -153,6 +229,17 @@
153
 
154
  $('#wp_all_export_available_rules').html('<div class="wp_all_export_preloader" style="display:block;"></div>');
155
 
 
 
 
 
 
 
 
 
 
 
 
156
  var request = {
157
  action: 'export_available_rules',
158
  data: {'selected' : params.selected},
@@ -170,13 +257,24 @@
170
  $('#wp_all_export_value').hide();
171
  else
172
  $('#wp_all_export_value').show();
173
- });
174
  },
175
  dataType: "json"
176
  });
177
  });
178
  }
179
- }
 
 
 
 
 
 
 
 
 
 
 
180
 
181
  }
182
 
@@ -184,13 +282,18 @@
184
 
185
  var filtering = function(postType){
186
 
 
 
 
 
 
187
  var request = {
188
  action: 'export_filtering',
189
- data: {'cpt' : postType, 'export_type' : 'specific', 'filter_rules_hierarhy' : '', 'product_matching_mode' : 'strict'},
190
  security: wp_all_export_security
191
  };
192
 
193
- if (is_first_load == false || postType != '') $('.wp_all_export_preloader').show();
194
 
195
  $.ajax({
196
  type: 'POST',
@@ -200,22 +303,33 @@
200
 
201
  $('.wp_all_export_preloader').hide();
202
 
203
- if (postType != '')
204
- {
205
-
206
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').html(response.html);
207
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
208
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').addClass('closed');
209
- //$('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
210
-
211
- init_filtering_fields();
212
 
213
- }
214
- else
215
  {
216
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
217
- //$('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
 
218
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
 
220
  },
221
  error: function( jqXHR, textStatus ) {
@@ -226,16 +340,123 @@
226
  dataType: "json"
227
  });
228
 
229
- }
230
 
231
- $('#wp_all_export_rule').change(function(){
232
- if ($(this).val() == 'is_empty' || $(this).val() == 'is_not_empty')
233
- $('#wp_all_export_value').hide();
234
- else
235
- $('#wp_all_export_value').show();
236
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
 
238
- // step 1 ( chose & filter export data )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  $('.wpallexport-step-1').each(function(){
240
 
241
  var $wrap = $('.wrap');
@@ -244,82 +465,70 @@
244
 
245
  $('.wpallexport-import-from').click(function(){
246
 
247
- var showImportType = false;
248
-
249
- var postType = $('input[name=cpt]').val();
250
 
 
 
251
  switch ($(this).attr('rel')){
252
  case 'specific_type':
253
- if (postType != ''){
254
-
 
 
 
 
 
255
  if (postType == 'users'){
256
  $('.wpallexport-user-export-notice').show();
257
  showImportType = false;
258
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
259
  }
260
- else
261
  {
262
- $('.wpallexport-user-export-notice').hide();
263
- showImportType = true;
264
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
265
- }
266
-
267
- if (postType == 'comments'){
268
  $('.wpallexport-comments-export-notice').show();
269
  showImportType = false;
270
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
271
  }
272
- else
273
  {
274
- $('.wpallexport-comments-export-notice').hide();
275
- showImportType = true;
276
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
277
  }
278
-
279
- if (postType == 'product')
280
- {
281
- $('.auto-generate-template').show();
282
- }
283
  else
284
- {
285
- $('.auto-generate-template').hide();
286
- }
287
- }
288
- else
289
- {
290
- $('.auto-generate-template').hide();
291
- $('.wpallexport-user-export-notice').hide();
292
- $('.wpallexport-comments-export-notice').hide();
293
- showImportType = false;
294
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
295
- }
296
  break;
297
- case 'advanced_type':
298
- $('.auto-generate-template').hide();
 
 
 
 
299
  if ($('input[name=wp_query_selector]').val() == 'wp_user_query')
300
  {
301
  $('.wpallexport-user-export-notice').show();
302
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
303
  showImportType = false;
304
  }
305
- else
306
- {
307
- $('.wpallexport-user-export-notice').hide();
308
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
309
- showImportType = true;
310
- }
311
- if ($('input[name=wp_query_selector]').val() == 'wp_comment_query')
312
  {
313
  $('.wpallexport-comments-export-notice').show();
314
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
315
  showImportType = false;
316
  }
317
  else
318
- {
319
- $('.wpallexport-comments-export-notice').hide();
320
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
321
  showImportType = true;
322
- }
 
 
323
  break;
324
  }
325
 
@@ -333,8 +542,7 @@
333
  {
334
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
335
  }
336
- else
337
- {
338
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
339
  }
340
 
@@ -346,6 +554,10 @@
346
  width: 600,
347
  onSelected: function(selectedData){
348
 
 
 
 
 
349
  if (selectedData.selectedData.value != ""){
350
 
351
  $('#file_selector').find('.dd-selected').css({'color':'#555'});
@@ -357,69 +569,51 @@
357
  i++;
358
  });
359
 
360
- $('.wpallexport-choose-file').find('input[name=cpt]').val(postType);
361
-
362
  if (postType == 'users')
363
  {
364
  $('.wpallexport-user-export-notice').show();
365
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
366
  }
367
- else
368
- {
369
- $('.wpallexport-user-export-notice').hide();
370
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
371
- }
372
-
373
- if (postType == 'comments')
374
  {
375
  $('.wpallexport-comments-export-notice').show();
376
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
377
  }
378
- else
379
- {
380
- $('.wpallexport-comments-export-notice').hide();
381
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
382
- }
383
-
384
- if (postType == 'product')
385
  {
386
- $('.auto-generate-template').show();
 
387
  }
388
  else
389
- {
390
- $('.auto-generate-template').hide();
391
- }
392
 
393
  filtering(postType);
394
 
395
  }
396
  else
397
- {
398
- $('.auto-generate-template').hide();
399
- $('.wpallexport-user-export-notice').hide();
400
- $('.wpallexport-comments-export-notice').hide();
401
  $('.wpallexport-choose-file').find('input[name=cpt]').val('');
402
  $('#file_selector').find('.dd-selected').css({'color':'#cfceca'});
403
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
 
404
 
405
  switch ($('.wpallexport-import-from.selected').attr('rel')){
406
  case 'specific_type':
407
  filtering($('input[name=cpt]').val());
408
  break;
409
  case 'advanced_type':
410
- //if ($('input[name=wp_query]').val() != ''){
411
- // $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
412
- // }
413
- // else{
414
- // $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
415
- // }
416
  break;
417
  }
418
  }
419
  }
420
  });
421
-
422
- $('a.auto-generate-template').click(function(){
423
  $('input[name^=auto_generate]').val('1');
424
 
425
  $('.hierarhy-output').each(function(){
@@ -431,7 +625,7 @@
431
 
432
  $(this).parents('form:first').submit();
433
  });
434
-
435
  $('form.wpallexport-choose-file').find('input[type=submit]').click(function(e){
436
  e.preventDefault();
437
 
@@ -448,83 +642,56 @@
448
  $('#wp_query_selector').ddslick({
449
  width: 600,
450
  onSelected: function(selectedData){
451
-
452
- if ( ! $('.wp_query:visible').length ) return;
 
 
 
 
453
 
454
  if (selectedData.selectedData.value != ""){
455
 
456
  $('#wp_query_selector').find('.dd-selected').css({'color':'#555'});
457
  var queryType = selectedData.selectedData.value;
458
- if (queryType == 'wp_query')
459
- {
460
- $('.wpallexport-user-export-notice').hide();
461
- $('.wpallexport-comments-export-notice').hide();
462
- $('textarea[name=wp_query]').attr("placeholder", "'post_type' => 'post', 'post_status' => array( 'pending', 'draft', 'future' )");
463
- $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
464
  }
465
  if(queryType == 'wp_user_query')
466
  {
467
- $('.wpallexport-user-export-notice').show();
468
- $('.wpallexport-comments-export-notice').hide();
469
  $('textarea[name=wp_query]').attr("placeholder", "'role' => 'Administrator'");
470
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
471
  }
472
- if(queryType == 'wp_comment_query')
473
  {
474
  $('.wpallexport-comments-export-notice').show();
475
- $('textarea[name=wp_query]').attr("placeholder", "'meta_key' => 'featured', 'meta_value' => '1'");
476
- $('.wpallexport-user-export-notice').hide();
477
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
478
  }
479
  $('input[name=wp_query_selector]').val(queryType);
480
  }
481
- else
482
- {
483
- $('.wpallexport-user-export-notice').hide();
484
- $('.wpallexport-comments-export-notice').hide();
485
  $('#wp_query_selector').find('.dd-selected').css({'color':'#cfceca'});
486
- $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
 
487
  }
488
  }
489
  });
490
 
491
  });
492
- //[/End Step 1]
493
 
494
- // step 2 ( export template )
495
- $('.wpallexport-export-template').each(function(){
496
-
497
- var offset = $('#available_data').offset();
498
-
499
- var offsetTop = $('.error:visible').length ? offset.top + 45 : offset.top;
500
-
501
- $('.wpallexport-step-3').css({'top': (offsetTop) + 'px'});
502
 
503
- $is_show_warning = true;
504
- $is_show_sku_warning = 2;
505
- $is_show_advanced_query_warning = $('.wp-all-export-advanced-query-warning').length;
506
- $('#columns').find('li').each(function(){
507
- if ($(this).find('input[name^=cc_type]').val() == 'id'){
508
- $is_show_warning = false;
509
- }
510
- if ($(this).find('input[name^=cc_label]').val() == '_sku'){
511
- $is_show_sku_warning--;
512
- }
513
- if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
514
- $is_show_sku_warning--;
515
- }
516
- if ($(this).find('input[name^=cc_label]').val() == 'post_type'){
517
- $is_show_advanced_query_warning = 0;
518
- }
519
- });
520
 
521
- if ($is_show_warning) $('.wp-all-export-warning').show(); else $('.wp-all-export-warning').hide();
522
- if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
523
- if ($is_show_advanced_query_warning > 0) $('.wp-all-export-advanced-query-warning').show(); else $('.wp-all-export-advanced-query-warning').hide();
524
 
525
  var $sortable = $( "#columns" );
526
 
527
- $( "#available_data li:not(.wpallexport_disabled)" ).draggable({
528
  appendTo: "body",
529
  helper: "clone"
530
  });
@@ -538,12 +705,12 @@
538
 
539
  $( "#columns_to_export" ).on( "dropout", function( event, ui ) {
540
  outsideContainer = 1;
541
- ui.draggable.find('.custom_column').css('background', 'pink');
542
  } );
543
 
544
  $( "#columns_to_export" ).on( "dropover", function( event, ui ) {
545
  outsideContainer = 0;
546
- ui.draggable.find('.custom_column').css('background', 'none');
547
  } );
548
 
549
  // this one control if the draggable is dropped
@@ -552,6 +719,12 @@
552
  drop : function(event, ui){
553
  if(outsideContainer == 1){
554
  ui.draggable.remove();
 
 
 
 
 
 
555
  }else{
556
  ui.draggable.find('.custom_column').css('background', 'none');
557
  }
@@ -568,45 +741,62 @@
568
  if (ui.draggable.find('input[name^=rules]').length){
569
  $('li.' + ui.draggable.find('input[name^=rules]').val()).each(function(){
570
  var $value = $(this).find('input[name^=cc_value]').val();
 
 
 
 
 
 
571
  var $add_field = true;
572
  $('#columns').find('li').each(function(){
573
- if ($(this).find('input[name^=cc_value]').val() == $value){
574
- $add_field = false;
 
 
 
 
 
 
 
 
 
575
  }
576
  });
577
  if ($add_field)
578
  {
579
  $( "<li></li>" ).html( $(this).html() ).appendTo( $( "#columns_to_export ol" ) );
580
- $('#columns').find('li:last').find('div:first').attr('rel', $('#columns').find('li:not(.placeholder)').length);
 
 
 
 
 
 
 
 
 
 
 
581
  }
582
  });
583
  }
584
  else{
585
  $( "<li></li>" ).html( ui.draggable.html() ).appendTo( this );
586
- $('#columns').find('li:last').find('div:first').attr('rel', $('#columns').find('li:not(.placeholder)').length);
587
- }
588
-
589
- $is_show_warning = true;
590
- $is_show_sku_warning = 2;
591
- $is_show_advanced_query_warning = $('.wp-all-export-advanced-query-warning').length;
592
- $('#columns').find('li').each(function(){
593
- if ($(this).find('input[name^=cc_type]').val() == 'id'){
594
- $is_show_warning = false;
595
- }
596
- if ($(this).find('input[name^=cc_label]').val() == '_sku'){
597
- $is_show_sku_warning--;
598
- }
599
- if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
600
- $is_show_sku_warning--;
601
  }
602
- if ($(this).find('input[name^=cc_label]').val() == 'post_type'){
603
- $is_show_advanced_query_warning = 0;
 
 
604
  }
605
- });
606
 
607
- if ($is_show_warning) $('.wp-all-export-warning').show(); else $('.wp-all-export-warning').hide();
608
- if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
609
- if ($is_show_advanced_query_warning > 0) $('.wp-all-export-advanced-query-warning').show(); else $('.wp-all-export-advanced-query-warning').hide();
610
 
611
  }
612
  }).sortable({
@@ -625,11 +815,12 @@
625
 
626
  if (typeof wpPointerL10n != "undefined") wpPointerL10n.dismiss = 'Close';
627
 
628
- /**
629
- * Add Another btn click
630
- */
631
  $addAnother.click(function(){
 
632
  $addAnotherForm.find('form')[0].reset();
 
 
633
  $addAnotherForm.removeAttr('rel');
634
  $addAnotherForm.removeClass('dc').addClass('cc');
635
  $addAnotherForm.find('.cc_field').hide();
@@ -649,15 +840,16 @@
649
  $(this).removeAttr('selected');
650
  });
651
 
652
- $('.wp-all-export-chosen-select').trigger('chosen:updated');
653
-
 
654
  $('.wpallexport-overlay').show();
655
- $addAnotherForm.show();
 
656
 
657
  });
658
- /**
659
- * Delete custom column action
660
- */
661
  $addAnotherForm.find('.delete_action').click(function(){
662
 
663
  $('.custom_column').removeClass('active');
@@ -668,210 +860,137 @@
668
  $('#columns').find( ".placeholder" ).show();
669
  }
670
 
671
- $is_show_warning = true;
672
- $is_show_sku_warning = 2;
673
- $is_show_advanced_query_warning = $('.wp-all-export-advanced-query-warning').length;
674
- $('#columns').find('li:not(.placeholder)').each(function(i, e){
675
- $(this).find('div.custom_column:first').attr('rel', i + 1);
676
- if ($(this).find('input[name^=cc_type]').val() == 'id'){
677
- $is_show_warning = false;
678
- }
679
- if ($(this).find('input[name^=cc_label]').val() == '_sku'){
680
- $is_show_sku_warning--;
681
- }
682
- if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
683
- $is_show_sku_warning--;
684
- }
685
- if ($(this).find('input[name^=cc_label]').val() == 'post_type'){
686
- $is_show_advanced_query_warning = 0;
687
- }
688
- });
689
-
690
- if ($is_show_warning) $('.wp-all-export-warning').show(); else $('.wp-all-export-warning').hide();
691
- if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
692
- if ($is_show_advanced_query_warning > 0) $('.wp-all-export-advanced-query-warning').show(); else $('.wp-all-export-advanced-query-warning').hide();
693
 
694
  $addAnotherForm.fadeOut();
695
  $('.wpallexport-overlay').hide();
696
- });
697
-
698
- $('.remove-field').live('click', function(e){
699
- e.stopPropagation();
700
- $(this).parents('li:first').fadeOut().remove();
701
- if ( ! $('#columns').find('li:visible').length ){
702
- $('#columns').find( ".placeholder" ).show();
703
- }
704
-
705
- $is_show_warning = true;
706
- $is_show_sku_warning = 2;
707
- $is_show_advanced_query_warning = $('.wp-all-export-advanced-query-warning').length;
708
- $('#columns').find('li:not(.placeholder)').each(function(i, e){
709
- $(this).find('div.custom_column:first').attr('rel', i + 1);
710
- if ($(this).find('input[name^=cc_type]').val() == 'id'){
711
- $is_show_warning = false;
712
- }
713
- if ($(this).find('input[name^=cc_label]').val() == '_sku'){
714
- $is_show_sku_warning--;
715
- }
716
- if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
717
- $is_show_sku_warning--;
718
- }
719
- if ($(this).find('input[name^=cc_label]').val() == 'post_type'){
720
- $is_show_advanced_query_warning = 0;
721
- }
722
- });
723
-
724
- if ($is_show_warning) $('.wp-all-export-warning').show(); else $('.wp-all-export-warning').hide();
725
- if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
726
- if ($is_show_advanced_query_warning > 0) $('.wp-all-export-advanced-query-warning').show(); else $('.wp-all-export-advanced-query-warning').hide();
727
- });
728
 
729
- /**
730
- * Add/Edit custom column action
731
- */
732
  $addAnotherForm.find('.save_action').click(function(){
733
 
734
- var $value_type = $addAnotherForm.find('select[name=column_value_type]');
735
- var $php_code = $addAnotherForm.find('.php_code:visible');
736
- var $name = $addAnotherForm.find('input.column_name');
737
- var $export_data_type = $addAnotherForm.find('input[name=export_data_type]');
738
 
739
- var $save = true;
 
740
 
741
- // if ($export_data_type.val() == 'shop_order'){
742
- // $name.val($value_type.find('option:selected').html());
743
- // }
744
-
745
- if ($name.val() == '')
746
  {
747
  $save = false;
748
- $name.addClass('error');
 
749
  }
750
 
751
- if ($save)
752
- {
753
- var $clone = ($addAnotherForm.attr('rel')) ? $('#columns').find('.custom_column[rel='+ $addAnotherForm.attr('rel') +']') : $template.clone(true);
754
- if (!parseInt($addAnotherForm.attr('rel'))) $clone.attr('rel', $('#columns').find('.custom_column').length + 1);
755
-
756
- $clone.find('input[name^=cc_php]').val($addAnotherForm.find('#coperate_php').is(':checked') ? '1' : '0');
757
- $clone.find('input[name^=cc_code]').val($php_code.val());
758
- $clone.find('input[name^=cc_sql]').val($addAnotherForm.find('textarea.column_value').val());
759
- $clone.find('input[name^=cc_name]').val($name.val());
760
 
761
- if ($export_data_type.val() == 'shop_order' && $value_type.find('option:selected').val() != 'sql'){
762
- $clone.find('input[name^=cc_type]').val('woo_order');
763
- }
764
- else{
765
- $clone.find('input[name^=cc_type]').val($value_type.val());
766
- }
767
-
768
- $clone.find('label.wpallexport-xml-element').html("&lt;" + $name.val() + "&gt;");
769
 
770
- if (!parseInt($addAnotherForm.attr('rel'))){
771
- $( "#columns" ).find( ".placeholder" ).hide();
772
- $sortable.append('<li></li>');
773
- $sortable.find('li:last').append($clone.removeClass('template').fadeIn());
774
- }
775
 
776
- var availableData = $('#available_data');
 
 
 
 
 
777
 
778
- switch ( $clone.find('input[name^=cc_type]').val() ){
779
- case 'media':
780
- $clone.find('input[name^=cc_options]').val($addAnotherForm.find('select.media_field_export_data').val());
781
- break;
782
- case 'date':
783
- var $dateType = $addAnotherForm.find('select.date_field_export_data').val();
784
- if ($dateType == 'unix')
785
- $clone.find('input[name^=cc_options]').val('unix');
786
- else
787
- $clone.find('input[name^=cc_options]').val($('.pmxe_date_format').val());
788
- break;
789
- case 'cf':
790
- var $value = $addAnotherForm.find('.cf_direct_value');
791
- $clone.find('input[name^=cc_value]').val($value.val());
792
- $clone.find('input[name^=cc_label]').val($value.val());
793
- break;
794
- case 'acf':
795
- var $value = $addAnotherForm.find('.acf_direct_value');
796
- $clone.find('input[name^=cc_value]').val($value.val());
797
- $clone.find('input[name^=cc_label]').val($value.val());
798
- availableData.find('.custom_column').each(function(){
799
- if ($(this).find('input[name^=cc_value]').val() == $value.val()){
800
- $clone.find('input[name^=cc_options]').val($(this).find('input[name^=cc_options]').val());
801
- }
802
- });
803
- break;
804
- case 'woo':
805
- var $value = $addAnotherForm.find('.woo_direct_value');
806
- $clone.find('input[name^=cc_value]').val($value.val());
807
- $clone.find('input[name^=cc_label]').val($value.val());
808
- break;
809
- case 'attr':
810
- var $value = $addAnotherForm.find('.attr_direct_value');
811
- $clone.find('input[name^=cc_value]').val($value.val());
812
- $clone.find('input[name^=cc_label]').val($value.val());
813
- break;
814
- case 'cats':
815
- var $value = $addAnotherForm.find('.cats_direct_value');
816
- $clone.find('input[name^=cc_value]').val($value.val());
817
- $clone.find('input[name^=cc_label]').val($value.val());
818
- break;
819
- case 'woo_order':
820
- $clone.find('input[name^=cc_value]').val($value_type.val());
821
- $clone.find('input[name^=cc_label]').val($value_type.val());
822
- if ($value_type.find('option:selected').attr('rel') == 'cf')
823
- {
824
- $clone.find('input[name^=cc_type]').val('cf');
825
- }
826
- else
827
- {
828
- $clone.find('input[name^=cc_options]').val($value_type.find('option:selected').attr('rel'));
829
- }
830
- break;
831
- default:
832
- $clone.find('input[name^=cc_value]').val($value_type.val());
833
- $clone.find('input[name^=cc_label]').val($value_type.val());
834
- break;
835
- }
836
-
837
- $is_show_warning = true;
838
- $is_show_sku_warning = 2;
839
- $is_show_advanced_query_warning = $('.wp-all-export-advanced-query-warning').length;
840
- $('#columns').find('li').each(function(){
841
- if ($(this).find('input[name^=cc_type]').val() == 'id'){
842
- $is_show_warning = false;
843
- }
844
- if ($(this).find('input[name^=cc_label]').val() == '_sku'){
845
- $is_show_sku_warning--;
846
- }
847
- if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
848
- $is_show_sku_warning--;
849
  }
850
- if ($(this).find('input[name^=cc_label]').val() == 'post_type'){
851
- $is_show_advanced_query_warning = 0;
 
 
 
 
 
 
 
 
852
  }
853
- });
854
-
855
- if ($is_show_warning) $('.wp-all-export-warning').show(); else $('.wp-all-export-warning').hide();
856
- if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
857
- if ($is_show_advanced_query_warning > 0) $('.wp-all-export-advanced-query-warning').show(); else $('.wp-all-export-advanced-query-warning').hide();
 
 
 
 
 
 
 
 
 
858
 
859
- $addAnotherForm.hide();
860
 
861
- $('.wpallexport-overlay').hide();
862
 
863
- $('.custom_column').removeClass('active');
864
-
865
- }
866
- });
867
 
868
- $addAnotherForm.find('input[type=text], textarea').focus(function(){$(this).removeClass('error');});
 
 
869
 
870
- /**
871
- * Click on column for edit
872
- */
873
  $('#columns').find('.custom_column').live('click', function(){
874
- $addAnotherForm.find('form')[0].reset();
 
 
 
875
  $addAnotherForm.removeClass('dc').addClass('cc');
876
  $addAnotherForm.attr('rel', $(this).attr('rel'));
877
 
@@ -883,26 +1002,19 @@
883
  $addAnotherForm.find('.cc_field').hide();
884
  $('.custom_column').removeClass('active');
885
  $(this).addClass('active');
 
 
 
886
 
887
- var $export_data_type = $addAnotherForm.find('input[name=export_data_type]');
888
- var $type = '';
889
 
890
- // set field type
891
- if ($export_data_type.val() == 'shop_order')
892
- {
893
- $type = $(this).find('input[name^=cc_value]');
894
- }
895
- else
896
- {
897
- $type = $(this).find('input[name^=cc_type]');
898
- }
899
 
900
  $addAnotherForm.find('select[name=column_value_type]').find('option').each(function(){
901
- if ($(this).val() == $type.val())
902
  $(this).attr({'selected':'selected'}).click();
903
  else
904
  $(this).removeAttr('selected');
905
- });
906
 
907
  $('.wp-all-export-chosen-select').trigger('chosen:updated');
908
 
@@ -922,81 +1034,92 @@
922
  $addAnotherForm.find('#coperate_php').parents('div.input:first').find('.php_code').val($php_code.val());
923
 
924
  var $options = $(this).find('input[name^=cc_options]').val();
 
925
 
926
- switch ( $type.val() ){
927
  case 'sql':
928
  $addAnotherForm.find('textarea.column_value').val($(this).find('input[name^=cc_sql]').val());
929
  $addAnotherForm.find('.sql_field_type').show();
 
 
 
 
 
 
 
 
 
 
 
 
930
  break;
931
- case 'cf':
932
- $addAnotherForm.find('.cf_direct_value').val($(this).find('input[name^=cc_value]').val());
933
- $addAnotherForm.find('.cf_field_type').show();
934
- break;
935
- case 'acf':
936
- $addAnotherForm.find('.acf_direct_value').val($(this).find('input[name^=cc_value]').val());
937
- $addAnotherForm.find('.acf_field_type').show();
938
- break;
939
- case 'woo':
940
- $addAnotherForm.find('.woo_direct_value').val($(this).find('input[name^=cc_value]').val());
941
- $addAnotherForm.find('.woo_field_type').show();
942
- break;
943
- case 'attr':
944
- $addAnotherForm.find('.attr_direct_value').val($(this).find('input[name^=cc_value]').val());
945
- $addAnotherForm.find('.attr_field_type').show();
946
- break;
947
- case 'cats':
948
- $addAnotherForm.find('.cats_direct_value').val($(this).find('input[name^=cc_value]').val());
949
- $addAnotherForm.find('.cats_field_type').show();
950
- break;
951
  case 'date':
952
  $addAnotherForm.find('select.date_field_export_data').find('option').each(function(){
953
- if ($(this).val() == $options || $options != 'unix' && $(this).val() == 'php')
954
  $(this).attr({'selected':'selected'}).click();
955
  else
956
  $(this).removeAttr('selected');
957
  });
958
 
959
- if ($options != 'php' && $options != 'unix'){
960
- $('.pmxe_date_format').val($options);
961
  $('.pmxe_date_format_wrapper').show();
962
  }
963
  else
964
  $('.pmxe_date_format').val('');
965
  $addAnotherForm.find('.date_field_type').show();
966
- break;
967
- case 'media':
968
- $addAnotherForm.find('select.media_field_export_data').find('option').each(function(){
969
- if ($(this).val() == $options)
970
- $(this).attr({'selected':'selected'}).click();
971
- else
972
- $(this).removeAttr('selected');
973
- });
974
- $addAnotherForm.find('.media_field_type').show();
 
 
 
 
 
 
 
 
 
975
  break;
976
  }
977
 
978
- $addAnotherForm.find('input.column_name').val($(this).find('input[name^=cc_name]').val());
 
 
 
 
 
979
  $addAnotherForm.show();
980
  $('.wpallexport-overlay').show();
981
 
982
- });
983
-
984
- $is_show_sku_warning = 2;
985
- $('#columns').find('li').each(function(){
986
- if ($(this).find('input[name^=cc_label]').val() == '_sku'){
987
- $is_show_sku_warning--;
988
- }
989
- if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
990
- $is_show_sku_warning--;
991
- }
992
- });
993
 
994
- if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
995
-
996
- /**
997
- * Preview export file
998
- */
999
-
1000
  var doPreview = function( ths, tagno ){
1001
 
1002
  $('.wpallexport-overlay').show();
@@ -1028,7 +1151,7 @@
1028
  data: $('form.wpallexport-step-3').serialize(),
1029
  tagno: tagno,
1030
  security: wp_all_export_security
1031
- };
1032
 
1033
  $.ajax({
1034
  type: 'POST',
@@ -1065,7 +1188,7 @@
1065
 
1066
  $(this).find('.preview_a_row').click( function(){
1067
  doPreview($(this), 1);
1068
- });
1069
 
1070
  $('.wpae-available-fields-group').click(function(){
1071
  var $mode = $(this).find('.wpae-expander').text();
@@ -1081,57 +1204,7 @@
1081
  $(this).parents('fieldset:first').hide();
1082
  $('.wpallexport-overlay').hide();
1083
  $('#columns').find('div.active').removeClass('active');
1084
- });
1085
-
1086
- $('.cf_direct_value').each(function(){
1087
- $(this).autocomplete({
1088
- source: eval('__META_KEYS'),
1089
- minLength: 0
1090
- }).click(function () {
1091
- $(this).autocomplete('search', '');
1092
- $(this).attr('rel', '');
1093
- });
1094
- });
1095
-
1096
- $('.woo_direct_value').each(function(){
1097
- $(this).autocomplete({
1098
- source: eval('__WOO_KEYS'),
1099
- minLength: 0
1100
- }).click(function () {
1101
- $(this).autocomplete('search', '');
1102
- $(this).attr('rel', '');
1103
- });
1104
- });
1105
-
1106
- $('.attr_direct_value').each(function(){
1107
- $(this).autocomplete({
1108
- source: eval('__ATTR_KEYS'),
1109
- minLength: 0
1110
- }).click(function () {
1111
- $(this).autocomplete('search', '');
1112
- $(this).attr('rel', '');
1113
- });
1114
- });
1115
-
1116
- $('.acf_direct_value').each(function(){
1117
- $(this).autocomplete({
1118
- source: eval('__ACF_KEYS'),
1119
- minLength: 0
1120
- }).click(function () {
1121
- $(this).autocomplete('search', '');
1122
- $(this).attr('rel', '');
1123
- });
1124
- });
1125
-
1126
- $('.cats_direct_value').each(function(){
1127
- $(this).autocomplete({
1128
- source: eval('__TAXES_KEYS'),
1129
- minLength: 0
1130
- }).click(function () {
1131
- $(this).autocomplete('search', '');
1132
- $(this).attr('rel', '');
1133
- });
1134
- });
1135
 
1136
  $('.date_field_export_data').change(function(){
1137
  if ($(this).val() == "unix")
@@ -1165,34 +1238,35 @@
1165
  $(selector).chosen(wp_all_export_config[selector]);
1166
  $(selector).on('change', function(evt, params) {
1167
  $('.cc_field').hide();
1168
- switch ($(selector).val()){
1169
- case 'media':
1170
- $('.media_field_type').show();
1171
- break;
1172
  case 'date':
1173
  $('.date_field_type').show();
1174
  break;
1175
  case 'sql':
1176
  $('.sql_field_type').show();
1177
- break;
1178
- case 'cf':
1179
- $('.cf_field_type').show();
1180
- break;
1181
- case 'acf':
1182
- $('.acf_field_type').show();
1183
- break;
1184
  case 'woo':
1185
- $('.woo_field_type').show();
1186
- break;
1187
- case 'attr':
1188
- $('.attr_field_type').show();
 
 
 
 
1189
  break;
1190
- case 'cats':
1191
- $('.cats_field_type').show();
 
 
 
1192
  break;
1193
  }
1194
  });
1195
- }
1196
 
1197
  $('.wp-all-export-advanced-field-options').click(function(){
1198
  if ($(this).find('span').html() == '+'){
@@ -1208,28 +1282,105 @@
1208
  });
1209
 
1210
  // Auto generate available data
1211
- $('#wp_all_export_auto_generate_data').click(function(){
1212
 
1213
  $('ol#columns').find('li:not(.placeholder)').fadeOut().remove();
 
1214
 
1215
- $('#available_data').find('li.wp_all_export_auto_generate, li.pmxe_cats').each(function(i, e){
1216
- var clone = $(this).clone();
1217
- clone.attr('rel', i);
1218
- $( "<li></li>" ).html( clone.html() ).appendTo( $( "#columns_to_export ol" ) );
1219
- });
 
 
 
 
 
 
 
 
 
1220
 
1221
- });
 
 
 
 
1222
 
1223
- });
1224
- //[/End Step 2]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1225
 
1226
- // template form: auto submit when `load template` list value is picked
1227
- $('form.wpallexport-template').find('select[name="load_template"]').live('change', function () {
1228
- $(this).parents('form').submit();
1229
  });
 
1230
 
1231
- // step 3 ( export options )
1232
- if ( $('.wpallexport-step-4').length ){
 
1233
 
1234
  if ($('input[name^=selected_post_type]').length){
1235
 
@@ -1237,6 +1388,12 @@
1237
 
1238
  init_filtering_fields();
1239
 
 
 
 
 
 
 
1240
  $('form.choose-export-options').find('input[type=submit]').click(function(e){
1241
  e.preventDefault();
1242
 
@@ -1248,25 +1405,155 @@
1248
  });
1249
 
1250
  $(this).parents('form:first').submit();
1251
- });
1252
-
1253
  }
1254
 
1255
  $('.wp_all_export_confirm_and_run').click(function(e){
1256
  e.preventDefault();
1257
  $('form.choose-export-options').submit();
1258
  });
 
1259
  }
1260
- //[/End Step 3]
 
 
 
 
 
 
 
 
 
 
 
 
 
1261
 
1262
- //[Step 4]
1263
  $('.download_data').click(function(){
1264
  window.location.href = $(this).attr('rel');
1265
  });
1266
- //[/End Step 4]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1267
 
1268
- // additional functionality
1269
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1270
  $('input[name=pmxe_generate_zapier_api_key]').click(function(e){
1271
 
1272
  e.preventDefault();
@@ -1295,23 +1582,14 @@
1295
  $('#columns').find('div.active').removeClass('active');
1296
  $('fieldset.wp-all-export-edit-column').hide();
1297
  $(this).hide();
1298
- });
1299
-
1300
- var fix_tag_position = function(){
1301
- if ( $('.wpallexport-step-3').length ){
1302
- var offset = $('#available_data').offset();
1303
-
1304
- if ($(document).scrollTop() > offset.top){
1305
- $('.wpallexport-step-3').css({'top':'10px'});
1306
- }
1307
- else{
1308
- $('.wpallexport-step-3').css({'top': (offset.top - $(document).scrollTop()) + 'px'});
1309
- }
1310
- }
1311
- }
1312
-
1313
- $(document).scroll(function() {
1314
- fix_tag_position();
1315
- });
1316
 
1317
  });})(jQuery);
41
  matchBrackets: true,
42
  mode: "application/x-httpd-php",
43
  indentUnit: 4,
44
+ indentWithTabs: true,
45
+ lineWrapping: true
46
  });
47
+ editor.setCursor(1);
48
+ $('.CodeMirror').resizable({
49
+ resize: function() {
50
+ editor.setSize("100%", $(this).height());
51
+ }
52
+ });
53
  }
54
 
55
  // swither show/hide logic
121
  }
122
  else{
123
  $parent.addClass('closed');
124
+ $parent.find('.wpallexport-collapsed-content:first').slideUp();
125
  }
126
  });
127
 
128
+ // [ Helper functions ]
129
+
130
+ var get_valid_ajaxurl = function()
131
+ {
132
  var $URL = ajaxurl;
133
  if (typeof export_id != "undefined")
134
  {
144
  return $URL;
145
  }
146
 
147
+ // generate warning on a fly when required fields deleting from the export template
148
+ var trigger_warnings = function()
149
+ {
150
+
151
+ var missing_fields = ['id'];
152
+
153
+ if ( $('#is_product_export').length ) missing_fields = missing_fields.concat(['_sku', 'product_type']);
154
+ if ( $('#is_wp_query').length ) missing_fields.push('post_type');
155
+
156
+ $('#columns').find('li:not(.placeholder)').each(function(i, e){
157
+ $(this).find('div.custom_column:first').attr('rel', i + 1);
158
+ if ($(this).find('input[name^=cc_type]').val() == 'id'){
159
+ var index = missing_fields.indexOf('id');
160
+ if (index > -1) {
161
+ missing_fields.splice(index, 1);
162
+ }
163
+ }
164
+ if ($(this).find('input[name^=cc_label]').val() == '_sku'){
165
+ var index = missing_fields.indexOf('_sku');
166
+ if (index > -1) {
167
+ missing_fields.splice(index, 1);
168
+ }
169
+
170
+ }
171
+ if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
172
+ var index = missing_fields.indexOf('product_type');
173
+ if (index > -1) {
174
+ missing_fields.splice(index, 1);
175
+ }
176
+ }
177
+ if ($(this).find('input[name^=cc_label]').val() == 'post_type'){
178
+ var index = missing_fields.indexOf('post_type');
179
+ if (index > -1) {
180
+ missing_fields.splice(index, 1);
181
+ }
182
+ }
183
+ });
184
+
185
+ if ( missing_fields.length )
186
+ {
187
+ var fields = '';
188
+ switch (missing_fields.length)
189
+ {
190
+ case 1:
191
+ fields = missing_fields.shift();
192
+ break;
193
+ case 2:
194
+ fields = missing_fields.join(" and ");
195
+ break;
196
+ default:
197
+ var latest_field = missing_fields.pop();
198
+ fields = missing_fields.join(", ") + ", and " + latest_field;
199
+ break;
200
+ }
201
+
202
+ var warning_template = $('#warning_template').length ? $('#warning_template').val().replace("%s", fields) : '';
203
+
204
+ $('.wp-all-export-warning').find('p').html(warning_template);
205
+ $('.wp-all-export-warning').show();
206
+ }
207
+ else
208
+ {
209
+ $('.wp-all-export-warning').hide();
210
+ }
211
+
212
+ }
213
 
214
+ // Get a valid filtering rules for selected field type
215
  var init_filtering_fields = function(){
216
 
217
  var wp_all_export_rules_config = {
229
 
230
  $('#wp_all_export_available_rules').html('<div class="wp_all_export_preloader" style="display:block;"></div>');
231
 
232
+ var date_fields = ['post_date', 'comment_date', 'user_registered'];
233
+
234
+ if ( date_fields.indexOf(params.selected) > -1 )
235
+ {
236
+ $('#date_field_notice').show();
237
+ }
238
+ else
239
+ {
240
+ $('#date_field_notice').hide();
241
+ }
242
+
243
  var request = {
244
  action: 'export_available_rules',
245
  data: {'selected' : params.selected},
257
  $('#wp_all_export_value').hide();
258
  else
259
  $('#wp_all_export_value').show();
260
+ });
261
  },
262
  dataType: "json"
263
  });
264
  });
265
  }
266
+ }
267
+
268
+ $('.wp_all_export_filtering_rules').pmxe_nestedSortable({
269
+ handle: 'div',
270
+ items: 'li.dragging',
271
+ toleranceElement: '> div',
272
+ update: function () {
273
+ $('.wp_all_export_filtering_rules').find('.condition').removeClass('last_condition').show();
274
+ $('.wp_all_export_filtering_rules').find('.condition:last').addClass('last_condition');
275
+ liveFiltering();
276
+ }
277
+ });
278
 
279
  }
280
 
282
 
283
  var filtering = function(postType){
284
 
285
+ var is_preload = $('.wpallexport-preload-post-data').val();
286
+ var filter_rules_hierarhy = parseInt(is_preload) ? $('input[name=filter_rules_hierarhy]').val() : '';
287
+
288
+ $('.wpallexport-preload-post-data').val(0);
289
+
290
  var request = {
291
  action: 'export_filtering',
292
+ data: {'cpt' : postType, 'export_type' : 'specific', 'filter_rules_hierarhy' : filter_rules_hierarhy, 'product_matching_mode' : 'strict'},
293
  security: wp_all_export_security
294
  };
295
 
296
+ if (is_first_load == false || postType != '') $('.wp_all_export_preloader').show();
297
 
298
  $.ajax({
299
  type: 'POST',
303
 
304
  $('.wp_all_export_preloader').hide();
305
 
306
+ var export_type = $('input[name=export_type]').val();
 
 
 
 
 
 
 
 
307
 
308
+ if (export_type == 'advanced')
 
309
  {
310
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
311
+ $('.wpallexport-choose-file').find('.wp_all_export_continue_step_two').html(response.btns);
312
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
313
  }
314
+ else
315
+ {
316
+ if (postType != '')
317
+ {
318
+
319
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').html(response.html);
320
+ $('.wpallexport-choose-file').find('.wp_all_export_continue_step_two').html(response.btns);
321
+
322
+ init_filtering_fields();
323
+ liveFiltering(is_first_load);
324
+ }
325
+ else
326
+ {
327
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
328
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
329
+ }
330
+ }
331
+
332
+ is_first_load = false;
333
 
334
  },
335
  error: function( jqXHR, textStatus ) {
340
  dataType: "json"
341
  });
342
 
343
+ }
344
 
345
+ var liveFiltering = function(first_load, after_filtering){
346
+
347
+ // serialize filters
348
+ $('.hierarhy-output').each(function(){
349
+ var sortable = $('.wp_all_export_filtering_rules.ui-sortable');
350
+ if (sortable.length){
351
+ $(this).val(window.JSON.stringify(sortable.pmxe_nestedSortable('toArray', {startDepthCount: 0})));
352
+ }
353
+ });
354
+
355
+ var postType = $('input[name=cpt]').length ? $('input[name=cpt]').val() : $('input[name=selected_post_type]').val();
356
+
357
+ // prepare data for ajax request to get post count after filtering
358
+ var request = {
359
+ action: 'export_filtering_count',
360
+ data: {
361
+ 'cpt' : postType,
362
+ 'filter_rules_hierarhy' : $('input[name=filter_rules_hierarhy]').val(),
363
+ 'product_matching_mode' : $('select[name=product_matching_mode]').length ? $('select[name=product_matching_mode]').val() : '',
364
+ 'is_confirm_screen' : $('.wpallexport-step-4').length,
365
+ 'is_template_screen' : $('.wpallexport-step-3').length,
366
+ 'export_only_new_stuff' : $('#export_only_new_stuff').is(':checked') ? 1 : 0,
367
+ 'export_type' : $('input[name=export_type]').val()
368
+ },
369
+ security: wp_all_export_security
370
+ };
371
+
372
+ $('.wp_all_export_preloader').show();
373
+ $('.wp_all_export_filter_preloader').show();
374
+
375
+ $.ajax({
376
+ type: 'POST',
377
+ url: get_valid_ajaxurl(),
378
+ data: request,
379
+ success: function(response) {
380
+
381
+ $('.wp_all_export_filter_preloader').hide();
382
+
383
+ $('#filtering_result').html(response.html);
384
+
385
+ $('.wpallexport-choose-file').find('.wpallexport-filtering-wrapper').slideDown(400, function(){
386
+ if (typeof first_load != 'undefined')
387
+ {
388
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
389
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').addClass('closed');
390
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
391
+ }
392
+ });
393
+
394
+ $('.wp_all_export_preloader').hide();
395
+
396
+ if (typeof after_filtering != 'undefined')
397
+ {
398
+ after_filtering(response);
399
+ }
400
+
401
+ if ( $('.wpallexport-step-4').length && typeof wp_all_export_L10n != 'undefined'){
402
+
403
+ if (response.found_records)
404
+ {
405
+ $('.wp_all_export_confirm_and_run').show();
406
+ $('.confirm_and_run_bottom').val(wp_all_export_L10n.confirm_and_run);
407
+ $('#filtering_result').removeClass('nothing_to_export');
408
+ }
409
+ else
410
+ {
411
+ $('.wp_all_export_confirm_and_run').hide();
412
+ $('.confirm_and_run_bottom').val(wp_all_export_L10n.save_configuration);
413
+ $('#filtering_result').addClass('nothing_to_export');
414
+ }
415
+ }
416
+
417
+ if ( $('.wpallexport-step-3').length ){
418
+
419
+ $('.founded_records').html(response.html);
420
+
421
+ if (response.found_records)
422
+ {
423
+ $('.founded_records').removeClass('nothing_to_export');
424
+ }
425
+ else
426
+ {
427
+ $('.founded_records').addClass('nothing_to_export');
428
+ }
429
+ }
430
+
431
+ if ( $('.wpallexport-step-1').length)
432
+ {
433
+ if (response.found_records)
434
+ {
435
+ $('.founded_records').removeClass('nothing_to_export');
436
+ }
437
+ else
438
+ {
439
+ $('.founded_records').addClass('nothing_to_export');
440
+ }
441
+ }
442
 
443
+ },
444
+ error: function( jqXHR, textStatus ) {
445
+
446
+ $('.wp_all_export_filter_preloader').hide();
447
+ $('.wp_all_export_preloader').hide();
448
+
449
+ },
450
+ dataType: "json"
451
+ }).fail(function(xhr, textStatus, error) {
452
+ $('.wpallexport-header').next('.clear').after("<div class='error inline'><p>" + textStatus + " " + error + "</p></div>");
453
+ });
454
+
455
+ }
456
+ // [ \Helper functions ]
457
+
458
+
459
+ // [ Step 1 ( chose & filter export data ) ]
460
  $('.wpallexport-step-1').each(function(){
461
 
462
  var $wrap = $('.wrap');
465
 
466
  $('.wpallexport-import-from').click(function(){
467
 
468
+ var showImportType = false;
 
 
469
 
470
+ var postType = $('input[name=cpt]').val();
471
+
472
  switch ($(this).attr('rel')){
473
  case 'specific_type':
474
+
475
+ $('.wpallexport-user-export-notice').hide();
476
+ $('.wpallexport-shop_customer-export-notice').hide();
477
+ $('.wpallexport-comments-export-notice').hide();
478
+
479
+ if (postType != '')
480
+ {
481
  if (postType == 'users'){
482
  $('.wpallexport-user-export-notice').show();
483
  showImportType = false;
484
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
485
  }
486
+ else if (postType == 'comments')
487
  {
 
 
 
 
 
 
488
  $('.wpallexport-comments-export-notice').show();
489
  showImportType = false;
490
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
491
  }
492
+ else if (postType == 'shop_customer')
493
  {
494
+ $('.wpallexport-customer-export-notice').show();
495
+ showImportType = false;
496
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
497
  }
 
 
 
 
 
498
  else
499
+ {
500
+ showImportType = true;
501
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
502
+ }
503
+
504
+ $('.wpallexport-filtering-wrapper').show();
505
+ }
 
 
 
 
 
506
  break;
507
+ case 'advanced_type':
508
+
509
+ $('.wpallexport-user-export-notice').hide();
510
+ $('.wpallexport-comments-export-notice').hide();
511
+ $('.wpallexport-shop_customer-export-notice').hide();
512
+
513
  if ($('input[name=wp_query_selector]').val() == 'wp_user_query')
514
  {
515
  $('.wpallexport-user-export-notice').show();
516
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
517
  showImportType = false;
518
  }
519
+ else if ($('input[name=wp_query_selector]').val() == 'wp_comment_query')
 
 
 
 
 
 
520
  {
521
  $('.wpallexport-comments-export-notice').show();
522
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
523
  showImportType = false;
524
  }
525
  else
526
+ {
 
527
  $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
528
  showImportType = true;
529
+ }
530
+ $('.wpallexport-filtering-wrapper').hide();
531
+ filtering();
532
  break;
533
  }
534
 
542
  {
543
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
544
  }
545
+ else{
 
546
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
547
  }
548
 
554
  width: 600,
555
  onSelected: function(selectedData){
556
 
557
+ $('.wpallexport-user-export-notice').hide();
558
+ $('.wpallexport-comments-export-notice').hide();
559
+ $('.wpallexport-shop_customer-export-notice').hide();
560
+
561
  if (selectedData.selectedData.value != ""){
562
 
563
  $('#file_selector').find('.dd-selected').css({'color':'#555'});
569
  i++;
570
  });
571
 
572
+ $('.wpallexport-choose-file').find('input[name=cpt]').val(postType);
573
+
574
  if (postType == 'users')
575
  {
576
  $('.wpallexport-user-export-notice').show();
577
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
578
  }
579
+ else if (postType == 'comments')
 
 
 
 
 
 
580
  {
581
  $('.wpallexport-comments-export-notice').show();
582
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
583
  }
584
+ else if (postType == 'shop_customer')
 
 
 
 
 
 
585
  {
586
+ $('.wpallexport-shop_customer-export-notice').show();
587
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
588
  }
589
  else
590
+ {
591
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
592
+ }
593
 
594
  filtering(postType);
595
 
596
  }
597
  else
598
+ {
 
 
 
599
  $('.wpallexport-choose-file').find('input[name=cpt]').val('');
600
  $('#file_selector').find('.dd-selected').css({'color':'#cfceca'});
601
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
602
+ $('.wpallexport-choose-file').find('.wpallexport-filtering-wrapper').slideUp();
603
 
604
  switch ($('.wpallexport-import-from.selected').attr('rel')){
605
  case 'specific_type':
606
  filtering($('input[name=cpt]').val());
607
  break;
608
  case 'advanced_type':
609
+
 
 
 
 
 
610
  break;
611
  }
612
  }
613
  }
614
  });
615
+
616
+ $('a.auto-generate-template').live('click', function(){
617
  $('input[name^=auto_generate]').val('1');
618
 
619
  $('.hierarhy-output').each(function(){
625
 
626
  $(this).parents('form:first').submit();
627
  });
628
+
629
  $('form.wpallexport-choose-file').find('input[type=submit]').click(function(e){
630
  e.preventDefault();
631
 
642
  $('#wp_query_selector').ddslick({
643
  width: 600,
644
  onSelected: function(selectedData){
645
+
646
+ $('.wpallexport-user-export-notice').hide();
647
+ $('.wpallexport-comments-export-notice').hide();
648
+ $('.wpallexport-shop_customer-export-notice').hide();
649
+
650
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
651
 
652
  if (selectedData.selectedData.value != ""){
653
 
654
  $('#wp_query_selector').find('.dd-selected').css({'color':'#555'});
655
  var queryType = selectedData.selectedData.value;
656
+ if (queryType == 'wp_query'){
657
+ $('textarea[name=wp_query]').attr("placeholder", "'post_type' => 'post', 'post_status' => array( 'pending', 'draft', 'future' )");
658
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
 
 
 
659
  }
660
  if(queryType == 'wp_user_query')
661
  {
662
+ $('.wpallexport-user-export-notice').show();
 
663
  $('textarea[name=wp_query]').attr("placeholder", "'role' => 'Administrator'");
664
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
665
  }
666
+ else if(queryType == 'wp_comment_query')
667
  {
668
  $('.wpallexport-comments-export-notice').show();
669
+ $('textarea[name=wp_query]').attr("placeholder", "'meta_key' => 'featured', 'meta_value' => '1'");
 
670
  $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
671
  }
672
  $('input[name=wp_query_selector]').val(queryType);
673
  }
674
+ else{
675
+
 
 
676
  $('#wp_query_selector').find('.dd-selected').css({'color':'#cfceca'});
677
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
678
+
679
  }
680
  }
681
  });
682
 
683
  });
684
+ // [ \Step 1 ( chose & filter export data ) ]
685
 
 
 
 
 
 
 
 
 
686
 
687
+ // [ Step 2 ( export template ) ]
688
+ $('.wpallexport-export-template').each(function(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
689
 
690
+ trigger_warnings();
 
 
691
 
692
  var $sortable = $( "#columns" );
693
 
694
+ $( "#available_data li:not(.available_sub_section, .wpallexport_disabled)" ).draggable({
695
  appendTo: "body",
696
  helper: "clone"
697
  });
705
 
706
  $( "#columns_to_export" ).on( "dropout", function( event, ui ) {
707
  outsideContainer = 1;
708
+ ui.draggable.find('.custom_column').css('background', 'white');
709
  } );
710
 
711
  $( "#columns_to_export" ).on( "dropover", function( event, ui ) {
712
  outsideContainer = 0;
713
+ ui.draggable.find('.custom_column').css('background', 'white');
714
  } );
715
 
716
  // this one control if the draggable is dropped
719
  drop : function(event, ui){
720
  if(outsideContainer == 1){
721
  ui.draggable.remove();
722
+ trigger_warnings();
723
+
724
+ if ( $('#columns').find('li:not(.placeholder)').length === 1)
725
+ {
726
+ $('#columns').find( ".placeholder" ).show();
727
+ }
728
  }else{
729
  ui.draggable.find('.custom_column').css('background', 'none');
730
  }
741
  if (ui.draggable.find('input[name^=rules]').length){
742
  $('li.' + ui.draggable.find('input[name^=rules]').val()).each(function(){
743
  var $value = $(this).find('input[name^=cc_value]').val();
744
+ var $is_media_field = false;
745
+ if ( $(this).find('input[name^=cc_type]').val().indexOf('image_') !== -1 || $(this).find('input[name^=cc_type]').val().indexOf('attachment_') !== -1 )
746
+ {
747
+ $value = $(this).find('input[name^=cc_type]').val();
748
+ $is_media_field = true;
749
+ }
750
  var $add_field = true;
751
  $('#columns').find('li').each(function(){
752
+ if ( $is_media_field )
753
+ {
754
+ if ($(this).find('input[name^=cc_type]').val() == $value){
755
+ $add_field = false;
756
+ }
757
+ }
758
+ else
759
+ {
760
+ if ($(this).find('input[name^=cc_value]').val() == $value){
761
+ $add_field = false;
762
+ }
763
  }
764
  });
765
  if ($add_field)
766
  {
767
  $( "<li></li>" ).html( $(this).html() ).appendTo( $( "#columns_to_export ol" ) );
768
+ var $just_added = $('#columns').find('li:last').find('div:first');
769
+ $just_added.attr('rel', $('#columns').find('li:not(.placeholder)').length);
770
+ if ( $just_added.find('input[name^=cc_type]').val().indexOf('image_') !== -1 )
771
+ {
772
+ $just_added.find('.wpallexport-xml-element').html('Image ' + $just_added.find('input[name^=cc_name]').val());
773
+ $just_added.find('input[name^=cc_name]').val('Image ' + $just_added.find('input[name^=cc_name]').val());
774
+ }
775
+ if ( $just_added.find('input[name^=cc_type]').val().indexOf('attachment_') !== -1 )
776
+ {
777
+ $just_added.find('.wpallexport-xml-element').html('Attachment ' + $just_added.find('input[name^=cc_name]').val());
778
+ $just_added.find('input[name^=cc_name]').val('Attachment ' + $just_added.find('input[name^=cc_name]').val());
779
+ }
780
  }
781
  });
782
  }
783
  else{
784
  $( "<li></li>" ).html( ui.draggable.html() ).appendTo( this );
785
+ var $just_added = $('#columns').find('li:last').find('div:first');
786
+ $just_added.attr('rel', $('#columns').find('li:not(.placeholder)').length);
787
+ if ( $just_added.find('input[name^=cc_type]').val().indexOf('image_') !== -1 )
788
+ {
789
+ $just_added.find('.wpallexport-xml-element').html('Image ' + $just_added.find('input[name^=cc_name]').val());
790
+ $just_added.find('input[name^=cc_name]').val('Image ' + $just_added.find('input[name^=cc_name]').val());
 
 
 
 
 
 
 
 
 
791
  }
792
+ if ( $just_added.find('input[name^=cc_type]').val().indexOf('attachment_') !== -1 )
793
+ {
794
+ $just_added.find('.wpallexport-xml-element').html('Attachment ' + $just_added.find('input[name^=cc_name]').val());
795
+ $just_added.find('input[name^=cc_name]').val('Attachment ' + $just_added.find('input[name^=cc_name]').val());
796
  }
797
+ }
798
 
799
+ trigger_warnings();
 
 
800
 
801
  }
802
  }).sortable({
815
 
816
  if (typeof wpPointerL10n != "undefined") wpPointerL10n.dismiss = 'Close';
817
 
818
+ // Add Another btn click
 
 
819
  $addAnother.click(function(){
820
+
821
  $addAnotherForm.find('form')[0].reset();
822
+ $addAnotherForm.find('input[type=checkbox]').removeAttr('checked');
823
+
824
  $addAnotherForm.removeAttr('rel');
825
  $addAnotherForm.removeClass('dc').addClass('cc');
826
  $addAnotherForm.find('.cc_field').hide();
840
  $(this).removeAttr('selected');
841
  });
842
 
843
+ $('.wp-all-export-chosen-select').trigger('chosen:updated');
844
+ $('.wp_all_export_saving_status').html('');
845
+
846
  $('.wpallexport-overlay').show();
847
+ $addAnotherForm.find('input.switcher').change();
848
+ $addAnotherForm.show();
849
 
850
  });
851
+
852
+ // Delete custom column action
 
853
  $addAnotherForm.find('.delete_action').click(function(){
854
 
855
  $('.custom_column').removeClass('active');
860
  $('#columns').find( ".placeholder" ).show();
861
  }
862
 
863
+ trigger_warnings();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
864
 
865
  $addAnotherForm.fadeOut();
866
  $('.wpallexport-overlay').hide();
867
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
868
 
869
+ // Add/Edit custom column action
 
 
870
  $addAnotherForm.find('.save_action').click(function(){
871
 
872
+ var $save = true;
 
 
 
873
 
874
+ // element name in exported file
875
+ var $elementName = $addAnotherForm.find('input.column_name');
876
 
877
+ // element name validation
878
+ if ($elementName.val() == '')
 
 
 
879
  {
880
  $save = false;
881
+ $elementName.addClass('error');
882
+ return false;
883
  }
884
 
885
+ // get PHP function name
886
+ var $phpFunction = $addAnotherForm.find('.php_code:visible');
 
 
 
 
 
 
 
887
 
888
+ // validation passed, prepare field data
889
+ var $elementIndex = $addAnotherForm.attr('rel');
890
+ // element type
891
+ var $elementType = $addAnotherForm.find('select[name=column_value_type]');
892
+ // element label, options and other stuff
893
+ var $elementDetails = $elementType.find('option:selected');
 
 
894
 
895
+ var $clone = ( $elementIndex ) ? $('#columns').find('.custom_column[rel='+ $elementIndex +']') : $template.clone(true);
 
 
 
 
896
 
897
+ // if new field adding
898
+ if ( ! parseInt( $elementIndex ) )
899
+ {
900
+ // new column added, increase element Index
901
+ $clone.attr('rel', $('#columns').find('.custom_column').length + 1);
902
+ }
903
 
904
+ // add element label
905
+ $clone.find('label.wpallexport-xml-element').html( $elementName.val() );
906
+ // wrap field value into PHP function
907
+ $clone.find('input[name^=cc_php]').val( $addAnotherForm.find('#coperate_php').is(':checked') ? '1' : '0' );
908
+ // save PHP function name
909
+ $clone.find('input[name^=cc_code]').val( $phpFunction.val() );
910
+ // save SQL code
911
+ $clone.find('input[name^=cc_sql]').val( $addAnotherForm.find('textarea.column_value').val() );
912
+ // save element name
913
+ $clone.find('input[name^=cc_name]').val( $elementName.val() == "ID" ? "id" : $elementName.val() );
914
+ // save element type
915
+ $clone.find('input[name^=cc_type]').val( $elementType.val() );
916
+ // save element value
917
+ $clone.find('input[name^=cc_value]').val( $elementDetails.attr('label') );
918
+ // save element label
919
+ $clone.find('input[name^=cc_label]').val( $elementDetails.attr('label') );
920
+ // save element options
921
+ $clone.find('input[name^=cc_options]').val( $elementDetails.attr('options') );
922
+
923
+ // if new field adding append element to the export template
924
+ if ( ! parseInt( $elementIndex ) )
925
+ {
926
+ $( "#columns" ).find( ".placeholder" ).hide();
927
+ $sortable.append('<li></li>');
928
+ $sortable.find('li:last').append($clone.removeClass('template').fadeIn());
929
+ }
930
+
931
+ // set up additional element settings by element type
932
+ switch ( $elementType.val() )
933
+ {
934
+ // save post date field format
935
+ case 'date':
936
+ var $dateType = $addAnotherForm.find('select.date_field_export_data').val();
937
+ if ($dateType == 'unix')
938
+ $clone.find('input[name^=cc_settings]').val('unix');
939
+ else
940
+ $clone.find('input[name^=cc_settings]').val($('.pmxe_date_format').val());
941
+ break;
942
+ // set up additional settings for repeater field
943
+ case 'acf':
944
+ // determine is repeater field selected in dropdown
945
+ if ( $clone.find('input[name^=cc_options]').val().indexOf('s:4:"type";s:8:"repeater"') !== -1 )
946
+ {
947
+ var obj = {};
948
+ obj['repeater_field_item_per_line'] = $addAnotherForm.find('#repeater_field_item_per_line').is(':checked');
949
+ obj['repeater_field_fill_empty_columns'] = $addAnotherForm.find('#repeater_field_fill_empty_columns').is(':checked');
950
+ $clone.find('input[name^=cc_settings]').val(window.JSON.stringify(obj));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
951
  }
952
+ break;
953
+ case 'woo':
954
+ switch ( $clone.find('input[name^=cc_value]').val() )
955
+ {
956
+ case '_upsell_ids':
957
+ case '_crosssell_ids':
958
+ case 'item_data___upsell_ids':
959
+ case 'item_data___crosssell_ids':
960
+ $clone.find('input[name^=cc_settings]').val($addAnotherForm.find('select.linked_field_export_data').val());
961
+ break;
962
  }
963
+ break;
964
+ default:
965
+ // save option for media images field types
966
+ if ( $clone.find('input[name^=cc_type]').val().indexOf('image_') !== -1 )
967
+ {
968
+ var obj = {};
969
+ obj['is_export_featured'] = $addAnotherForm.find('#is_image_export_featured').is(':checked');
970
+ obj['is_export_attached'] = $addAnotherForm.find('#is_image_export_attached_images').is(':checked');
971
+ obj['image_separator'] = $addAnotherForm.find('input[name=image_field_separator]').val();
972
+ $clone.find('input[name^=cc_options]').val(window.JSON.stringify(obj));
973
+ }
974
+
975
+ break;
976
+ }
977
 
978
+ trigger_warnings();
979
 
980
+ $addAnotherForm.hide();
981
 
982
+ $('.wpallexport-overlay').hide();
 
 
 
983
 
984
+ $('.custom_column').removeClass('active');
985
+
986
+ });
987
 
988
+ // Clicking on column for edit
 
 
989
  $('#columns').find('.custom_column').live('click', function(){
990
+
991
+ $addAnotherForm.find('form')[0].reset();
992
+ $addAnotherForm.find('input[type=checkbox]').removeAttr('checked');
993
+
994
  $addAnotherForm.removeClass('dc').addClass('cc');
995
  $addAnotherForm.attr('rel', $(this).attr('rel'));
996
 
1002
  $addAnotherForm.find('.cc_field').hide();
1003
  $('.custom_column').removeClass('active');
1004
  $(this).addClass('active');
1005
+
1006
+ var $elementType = $(this).find('input[name^=cc_type]');
1007
+ var $elementLabel = $(this).find('input[name^=cc_label]');
1008
 
 
 
1009
 
1010
+ $('.wp_all_export_saving_status').html('');
 
 
 
 
 
 
 
 
1011
 
1012
  $addAnotherForm.find('select[name=column_value_type]').find('option').each(function(){
1013
+ if ($(this).attr('label') == $elementLabel.val() && $(this).val() == $elementType.val())
1014
  $(this).attr({'selected':'selected'}).click();
1015
  else
1016
  $(this).removeAttr('selected');
1017
+ });
1018
 
1019
  $('.wp-all-export-chosen-select').trigger('chosen:updated');
1020
 
1034
  $addAnotherForm.find('#coperate_php').parents('div.input:first').find('.php_code').val($php_code.val());
1035
 
1036
  var $options = $(this).find('input[name^=cc_options]').val();
1037
+ var $settings = $(this).find('input[name^=cc_settings]').val();
1038
 
1039
+ switch ( $elementType.val() ){
1040
  case 'sql':
1041
  $addAnotherForm.find('textarea.column_value').val($(this).find('input[name^=cc_sql]').val());
1042
  $addAnotherForm.find('.sql_field_type').show();
1043
+ break;
1044
+ case 'acf':
1045
+ if ($options.indexOf('s:4:"type";s:8:"repeater"') !== -1)
1046
+ {
1047
+ $addAnotherForm.find('.repeater_field_type').show();
1048
+ if ($settings != "")
1049
+ {
1050
+ var $field_options = window.JSON.parse($settings);
1051
+ if ($field_options.repeater_field_item_per_line) $addAnotherForm.find('#repeater_field_item_per_line').attr('checked','checked');
1052
+ if ($field_options.repeater_field_fill_empty_columns) $addAnotherForm.find('#repeater_field_fill_empty_columns').attr('checked','checked');
1053
+ }
1054
+ }
1055
  break;
1056
+ case 'woo':
1057
+ $woo_type = $(this).find('input[name^=cc_value]');
1058
+ switch ($woo_type.val())
1059
+ {
1060
+ case '_upsell_ids':
1061
+ case '_crosssell_ids':
1062
+ case 'item_data___upsell_ids':
1063
+ case 'item_data___crosssell_ids':
1064
+
1065
+ $addAnotherForm.find('select.linked_field_export_data').find('option').each(function(){
1066
+ if ($(this).val() == $settings)
1067
+ $(this).attr({'selected':'selected'}).click();
1068
+ else
1069
+ $(this).removeAttr('selected');
1070
+ });
1071
+ $addAnotherForm.find('.linked_field_type').show();
1072
+ break;
1073
+ }
1074
+ break;
 
1075
  case 'date':
1076
  $addAnotherForm.find('select.date_field_export_data').find('option').each(function(){
1077
+ if ($(this).val() == $settings || $settings != 'unix' && $(this).val() == 'php')
1078
  $(this).attr({'selected':'selected'}).click();
1079
  else
1080
  $(this).removeAttr('selected');
1081
  });
1082
 
1083
+ if ($settings != 'php' && $settings != 'unix'){
1084
+ $('.pmxe_date_format').val($settings);
1085
  $('.pmxe_date_format_wrapper').show();
1086
  }
1087
  else
1088
  $('.pmxe_date_format').val('');
1089
  $addAnotherForm.find('.date_field_type').show();
1090
+ break;
1091
+ default:
1092
+
1093
+ if ( $elementType.val().indexOf('image_') !== -1 )
1094
+ {
1095
+ $addAnotherForm.find('.image_field_type').show();
1096
+
1097
+ if ($options != "")
1098
+ {
1099
+ var $field_options = window.JSON.parse($options);
1100
+
1101
+ if ($field_options.is_export_featured) $addAnotherForm.find('#is_image_export_featured').attr('checked','checked');
1102
+ if ($field_options.is_export_attached) $addAnotherForm.find('#is_image_export_attached_images').attr('checked','checked');
1103
+
1104
+ $addAnotherForm.find('input[name=image_field_separator]').val($field_options.image_separator);
1105
+ }
1106
+ }
1107
+
1108
  break;
1109
  }
1110
 
1111
+ $addAnotherForm.find('input.switcher').change();
1112
+
1113
+ var $column_name = $(this).find('input[name^=cc_name]').val();
1114
+ if ($column_name == "ID") $column_name = "id";
1115
+
1116
+ $addAnotherForm.find('input.column_name').val($column_name);
1117
  $addAnotherForm.show();
1118
  $('.wpallexport-overlay').show();
1119
 
1120
+ });
 
 
 
 
 
 
 
 
 
 
1121
 
1122
+ // Preview export file
 
 
 
 
 
1123
  var doPreview = function( ths, tagno ){
1124
 
1125
  $('.wpallexport-overlay').show();
1151
  data: $('form.wpallexport-step-3').serialize(),
1152
  tagno: tagno,
1153
  security: wp_all_export_security
1154
+ };
1155
 
1156
  $.ajax({
1157
  type: 'POST',
1188
 
1189
  $(this).find('.preview_a_row').click( function(){
1190
  doPreview($(this), 1);
1191
+ });
1192
 
1193
  $('.wpae-available-fields-group').click(function(){
1194
  var $mode = $(this).find('.wpae-expander').text();
1204
  $(this).parents('fieldset:first').hide();
1205
  $('.wpallexport-overlay').hide();
1206
  $('#columns').find('div.active').removeClass('active');
1207
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1208
 
1209
  $('.date_field_export_data').change(function(){
1210
  if ($(this).val() == "unix")
1238
  $(selector).chosen(wp_all_export_config[selector]);
1239
  $(selector).on('change', function(evt, params) {
1240
  $('.cc_field').hide();
1241
+ var selected_value = $(selector).find('option:selected').attr('label');
1242
+ var ftype = $(selector).val();
1243
+
1244
+ switch (ftype){
1245
  case 'date':
1246
  $('.date_field_type').show();
1247
  break;
1248
  case 'sql':
1249
  $('.sql_field_type').show();
1250
+ break;
 
 
 
 
 
 
1251
  case 'woo':
1252
+ switch (selected_value){
1253
+ case 'item_data___upsell_ids':
1254
+ case 'item_data___crosssell_ids':
1255
+ case '_upsell_ids':
1256
+ case '_crosssell_ids':
1257
+ $addAnotherForm.find('.linked_field_type').show();
1258
+ break;
1259
+ }
1260
  break;
1261
+ default:
1262
+ if ( $(selector).val().indexOf('image_') !== -1)
1263
+ {
1264
+ $('.image_field_type').show();
1265
+ }
1266
  break;
1267
  }
1268
  });
1269
+ }
1270
 
1271
  $('.wp-all-export-advanced-field-options').click(function(){
1272
  if ($(this).find('span').html() == '+'){
1282
  });
1283
 
1284
  // Auto generate available data
1285
+ $('.wp_all_export_auto_generate_data').click(function(){
1286
 
1287
  $('ol#columns').find('li:not(.placeholder)').fadeOut().remove();
1288
+ $('ol#columns').find('li.placeholder').fadeOut();
1289
 
1290
+ if ($('#available_data').find('li.wp_all_export_auto_generate').length)
1291
+ {
1292
+ $('#available_data').find('li.wp_all_export_auto_generate, li.pmxe_cats').each(function(i, e){
1293
+ var $clone = $(this).clone();
1294
+ $clone.attr('rel', i);
1295
+ $( "<li></li>" ).html( $clone.html() ).appendTo( $( "#columns_to_export ol" ) );
1296
+ });
1297
+ }
1298
+ else
1299
+ {
1300
+ $('#available_data').find('div.custom_column').each(function(i, e){
1301
+ var $parent = $(this).parent('li');
1302
+ var $clone = $parent.clone();
1303
+ $clone.attr('rel', i);
1304
 
1305
+ if ( $clone.find('input[name^=cc_type]').val().indexOf('image_') !== -1 )
1306
+ {
1307
+ $clone.find('.wpallexport-xml-element').html('Image ' + $clone.find('input[name^=cc_name]').val());
1308
+ $clone.find('input[name^=cc_name]').val('Image ' + $clone.find('input[name^=cc_name]').val());
1309
+ }
1310
 
1311
+ if ( $clone.find('input[name^=cc_type]').val().indexOf('attachment_') !== -1 )
1312
+ {
1313
+ $clone.find('.wpallexport-xml-element').html('Attachment ' + $clone.find('input[name^=cc_name]').val());
1314
+ $clone.find('input[name^=cc_name]').val('Attachment ' + $clone.find('input[name^=cc_name]').val());
1315
+ }
1316
+
1317
+ $( "<li></li>" ).html( $clone.html() ).appendTo( $( "#columns_to_export ol" ) );
1318
+ });
1319
+ }
1320
+
1321
+ trigger_warnings();
1322
+
1323
+ });
1324
+
1325
+ if ($('input[name^=selected_post_type]').length){
1326
+
1327
+ var postType = $('input[name^=selected_post_type]').val();
1328
+
1329
+ init_filtering_fields();
1330
+
1331
+ // if ($('form.edit').length){
1332
+
1333
+ liveFiltering();
1334
+
1335
+ // }
1336
+
1337
+ $('form.wpallexport-template').find('input[type=submit]').click(function(e){
1338
+ e.preventDefault();
1339
+
1340
+ $('.hierarhy-output').each(function(){
1341
+ var sortable = $('.wp_all_export_filtering_rules.ui-sortable');
1342
+ if (sortable.length){
1343
+ $(this).val(window.JSON.stringify(sortable.pmxe_nestedSortable('toArray', {startDepthCount: 0})));
1344
+ }
1345
+ });
1346
+
1347
+ $(this).parents('form:first').submit();
1348
+ });
1349
+ }
1350
+
1351
+ $('.wpallexport-import-to-format').click(function(){
1352
+
1353
+ $('.wpallexport-import-to-format').removeClass('selected');
1354
+ $(this).addClass('selected');
1355
+
1356
+ if ($(this).hasClass('wpallexport-csv-type'))
1357
+ {
1358
+ $('.wpallexport-csv-options').show();
1359
+ $('.wpallexport-xml-options').hide();
1360
+ $('input[name=export_to]').val('csv');
1361
+ }
1362
+ else
1363
+ {
1364
+ $('.wpallexport-csv-options').hide();
1365
+ $('.wpallexport-xml-options').show();
1366
+ $('input[name=export_to]').val('xml');
1367
+ }
1368
+ });
1369
+
1370
+ // template form: auto submit when `load template` list value is picked
1371
+ $(this).find('select[name="load_template"]').live('change', function () {
1372
+ $(this).parents('form').submit();
1373
+ });
1374
+
1375
+ var height = $(window).height();
1376
+ $('#available_data').find('.wpallexport-xml').css({'max-height': height - 125});
1377
 
 
 
 
1378
  });
1379
+ // [ \Step 2 ( export template ) ]
1380
 
1381
+
1382
+ // [ Step 3 ( export options ) ]
1383
+ if ( $('.wpallexport-export-options').length ){
1384
 
1385
  if ($('input[name^=selected_post_type]').length){
1386
 
1388
 
1389
  init_filtering_fields();
1390
 
1391
+ // if ($('form.edit').length){
1392
+
1393
+ liveFiltering();
1394
+
1395
+ // }
1396
+
1397
  $('form.choose-export-options').find('input[type=submit]').click(function(e){
1398
  e.preventDefault();
1399
 
1405
  });
1406
 
1407
  $(this).parents('form:first').submit();
1408
+ });
 
1409
  }
1410
 
1411
  $('.wp_all_export_confirm_and_run').click(function(e){
1412
  e.preventDefault();
1413
  $('form.choose-export-options').submit();
1414
  });
1415
+
1416
  }
1417
+ // if we are on re-run export screen
1418
+ if ($('.wpallexport-re-run-export').length)
1419
+ {
1420
+ $('#export_only_new_stuff').click(function(){
1421
+ $(this).attr('disabled','disabled');
1422
+ $('label[for=export_only_new_stuff]').addClass('loading');
1423
+ liveFiltering(null, function(){
1424
+ $('label[for=export_only_new_stuff]').removeClass('loading');
1425
+ $('#export_only_new_stuff').removeAttr('disabled');
1426
+ });
1427
+ });
1428
+ }
1429
+ // [ \Step 3 ( export options ) ]
1430
+
1431
 
1432
+ // [ Step 4 ( export completed ) ]
1433
  $('.download_data').click(function(){
1434
  window.location.href = $(this).attr('rel');
1435
  });
1436
+ // [ \Step 4 ( export completed ) ]
1437
+
1438
+
1439
+ // [ Additional functionality ]
1440
+
1441
+ // Add new filtering rule
1442
+ $('#wp_all_export_add_rule').live('click', function(){
1443
+
1444
+ var $el = $('#wp_all_export_xml_element');
1445
+ var $rule = $('#wp_all_export_rule');
1446
+ var $val = $('#wp_all_export_value');
1447
+
1448
+ if ($el.val() == "" || $rule.val() == "") return;
1449
+
1450
+ var relunumber = $('.wp_all_export_filtering_rules').find('li').length + 1;
1451
+
1452
+ var html = '<li id="item_'+ relunumber +'" class="dragging"><div class="drag-element">';
1453
+ html += '<input type="hidden" value="'+ $el.val() +'" class="wp_all_export_xml_element" name="wp_all_export_xml_element['+relunumber+']"/>';
1454
+ html += '<input type="hidden" value="'+ $el.find('option:selected').html() +'" class="wp_all_export_xml_element_title" name="wp_all_export_xml_element_title['+relunumber+']"/>';
1455
+ html += '<input type="hidden" value="'+ $rule.val() +'" class="wp_all_export_rule" name="wp_all_export_rule['+relunumber+']"/>';
1456
+ html += '<input type="hidden" value="'+ $val.val() +'" class="wp_all_export_value" name="wp_all_export_value['+relunumber+']"/>';
1457
+ html += '<span class="rule_element">' + $el.find('option:selected').html() + '</span> <span class="rule_as_is">' + $rule.find('option:selected').html() + '</span> <span class="rule_condition_value">"' + $val.val() +'"</span>';
1458
+ html += '<span class="condition"> <label for="rule_and_'+relunumber+'">AND</label><input id="rule_and_'+relunumber+'" type="radio" value="and" name="rule['+relunumber+']" checked="checked" class="rule_condition"/><label for="rule_or_'+relunumber+'">OR</label><input id="rule_or_'+relunumber+'" type="radio" value="or" name="rule['+relunumber+']" class="rule_condition"/> </span>';
1459
+ html += '</div><a href="javascript:void(0);" class="icon-item remove-ico"></a></li>';
1460
+
1461
+ $('#wpallexport-filters, #wp_all_export_apply_filters').show();
1462
+ $('#no_options_notice').hide();
1463
+
1464
+ $('.wp_all_export_filtering_rules').append(html);
1465
+
1466
+ $('.wp_all_export_filtering_rules').find('.condition:hidden').each(function(){
1467
+ $(this).show();
1468
+ $(this).find('.rule_condition:first').attr('checked', 'checked');
1469
+ });
1470
+ $('.wp_all_export_filtering_rules').find('.condition').removeClass('last_condition');
1471
+ $('.wp_all_export_filtering_rules').find('.condition:last').addClass('last_condition');
1472
+
1473
+ $('.wp_all_export_product_matching_mode').show();
1474
+
1475
+ $el.prop('selectedIndex',0).trigger('chosen:updated');;
1476
+ $rule.prop('selectedIndex',0).trigger('chosen:updated');;
1477
+
1478
+ $val.val('');
1479
+ $('#wp_all_export_value').show();
1480
+
1481
+ $('#date_field_notice').hide();
1482
+
1483
+ liveFiltering();
1484
+
1485
+ });
1486
+
1487
+ // Re-count posts when clicking "OR" | "AND" clauses
1488
+ $('input[name^=rule]').live('click', function(){
1489
+ liveFiltering();
1490
+ });
1491
+ // Re-count posts when changing product matching mode in filtering section
1492
+ $('select[name^=product_matching_mode]').live('change', function(){
1493
+ liveFiltering();
1494
+ });
1495
+ // Re-count posts when deleting a filtering rule
1496
+ $('.wp_all_export_filtering_rules').find('.remove-ico').live('click', function(){
1497
+ $(this).parents('li:first').remove();
1498
+ if ( ! $('.wp_all_export_filtering_rules').find('li').length)
1499
+ {
1500
+ $('#wp_all_export_apply_filters').hide();
1501
+ $('#no_options_notice').show();
1502
+ $('.wp_all_export_product_matching_mode').hide();
1503
+ }
1504
+ else
1505
+ {
1506
+ $('.wp_all_export_filtering_rules').find('li:last').find('.condition').addClass('last_condition');
1507
+ }
1508
+
1509
+ liveFiltering();
1510
+ });
1511
+ // hide "value" input when "Is Empty" or "Is Not Empty" rule is selected
1512
+ $('#wp_all_export_rule').change(function(){
1513
+ if ($(this).val() == 'is_empty' || $(this).val() == 'is_not_empty')
1514
+ $('#wp_all_export_value').hide();
1515
+ else
1516
+ $('#wp_all_export_value').show();
1517
+ });
1518
+ // saving & validating function editor
1519
+ $('.wp_all_export_save_functions').click(function(){
1520
+ var request = {
1521
+ action: 'save_functions',
1522
+ data: editor.getValue(),
1523
+ security: wp_all_export_security
1524
+ };
1525
+ $('.wp_all_export_functions_preloader').show();
1526
+ $('.wp_all_export_saving_status').html('');
1527
 
1528
+ $.ajax({
1529
+ type: 'POST',
1530
+ url: get_valid_ajaxurl(),
1531
+ data: request,
1532
+ success: function(response) {
1533
+ $('.wp_all_export_functions_preloader').hide();
1534
+
1535
+ if (response.result)
1536
+ {
1537
+ $('.wp_all_export_saving_status').css({'color':'green'});
1538
+ setTimeout(function() {
1539
+ $('.wp_all_export_saving_status').html('').fadeOut();
1540
+ }, 3000);
1541
+ }
1542
+ else
1543
+ {
1544
+ $('.wp_all_export_saving_status').css({'color':'red'});
1545
+ }
1546
+
1547
+ $('.wp_all_export_saving_status').html(response.msg).show();
1548
+
1549
+ },
1550
+ error: function( jqXHR, textStatus ) {
1551
+ $('.wp_all_export_functions_preloader').hide();
1552
+ },
1553
+ dataType: "json"
1554
+ });
1555
+ });
1556
+ // auot-generate zapier API key
1557
  $('input[name=pmxe_generate_zapier_api_key]').click(function(e){
1558
 
1559
  e.preventDefault();
1582
  $('#columns').find('div.active').removeClass('active');
1583
  $('fieldset.wp-all-export-edit-column').hide();
1584
  $(this).hide();
1585
+ });
1586
+
1587
+ if ( $('.wpallexport-template').length )
1588
+ {
1589
+ setTimeout(function(){
1590
+ $('.wpallexport-template').slideDown();
1591
+ }, 1000);
1592
+ }
1593
+ // [ \Additional functionality ]
 
 
 
 
 
 
 
 
 
1594
 
1595
  });})(jQuery);
views/admin/export/blocks/filters.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wpallexport-free-edition-notice" style="padding: 20px; margin-bottom: 10px;">
2
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&amp;utm_medium=in-plugin&amp;utm_campaign=download-from-url"><?php _e('Upgrade to the professional edition of WP All Export to add filtering rules.','wp_all_export_plugin');?></a>
3
+ </div>
4
+ <div class="wp_all_export_rule_inputs">
5
+ <table>
6
+ <tr>
7
+ <th><?php _e('Element', 'wp_all_export_plugin'); ?></th>
8
+ <th><?php _e('Rule', 'wp_all_export_plugin'); ?></th>
9
+ <th><?php _e('Value', 'wp_all_export_plugin'); ?></th>
10
+ <th>&nbsp;</th>
11
+ </tr>
12
+ <tr>
13
+ <td style="width: 25%;">
14
+ <select id="wp_all_export_xml_element">
15
+ <option value=""><?php _e('Select Element', 'wp_all_export_plugin'); ?></option>
16
+ <?php echo $engine->render_filters(); ?>
17
+ </select>
18
+ </td>
19
+ <td style="width: 25%;" id="wp_all_export_available_rules">
20
+ <select id="wp_all_export_rule">
21
+ <option value=""><?php _e('Select Rule', 'wp_all_export_plugin'); ?></option>
22
+ </select>
23
+ </td>
24
+ <td style="width: 25%;">
25
+ <input id="wp_all_export_value" type="text" placeholder="value" value="" disabled="disabled"/>
26
+ </td>
27
+ <td style="width: 15%;">
28
+ <a id="wp_all_export_add_rule" href="javascript:void(0);"><?php _e('Add Rule', 'wp_all_export_plugin');?></a>
29
+ </td>
30
+ </tr>
31
+ </table>
32
+ </div>
33
+ <div id="wpallexport-filters" style="padding:0;">
34
+ <div class="wpallexport-content-section" style="padding:0; border: none;">
35
+ <fieldset id="wp_all_export_filtering_rules">
36
+ <?php
37
+ $filter_rules = $post['filter_rules_hierarhy'];
38
+ $filter_rules_hierarhy = json_decode($filter_rules);
39
+ ?>
40
+ <p id="date_field_notice" style="margin: 5px 0px 20px; text-align: center;"><?php _e('Date filters use natural language.<br>For example, to return records created in the last week: <i>date ▸ newer than ▸ last week</i>.<br>For all records created in 2016: <i>date ▸ older than ▸ 1/1/2017</i> AND <i>date ▸ newer than ▸ 12/31/2015</i>', 'wp_all_export_plugin');?>.</p>
41
+ <p id="no_options_notice" style="margin:20px 0 5px; text-align:center; <?php if ( ! empty($filter_rules_hierarhy) and is_array($filter_rules_hierarhy) ) echo 'display:none;';?>"><?php _e('No filtering options. Add filtering options to only export records matching some specified criteria.', 'wp_all_export_plugin');?></p>
42
+ <ol class="wp_all_export_filtering_rules">
43
+ <?php
44
+
45
+ $condition_labels = array(
46
+ 'default' => array(
47
+ 'equals' => __('equals', 'wp_all_export_plugin'),
48
+ 'not_equals' => __("doesn't equal", 'wp_all_export_plugin'),
49
+ 'greater' => __('greater than', 'wp_all_export_plugin'),
50
+ 'equals_or_greater' => __('equal to or greater than', 'wp_all_export_plugin'),
51
+ 'less' => __('less than', 'wp_all_export_plugin'),
52
+ 'equals_or_less' => __('equal to or less than', 'wp_all_export_plugin'),
53
+ 'contains' => __('contains', 'wp_all_export_plugin'),
54
+ 'not_contains' => __("doesn't contain", 'wp_all_export_plugin'),
55
+ 'is_empty' => __('is empty', 'wp_all_export_plugin'),
56
+ 'is_not_empty' => __('is not empty', 'wp_all_export_plugin'),
57
+ 'in' => __('In', 'wp_all_export_plugin'),
58
+ 'not_in' => __('Not In', 'wp_all_export_plugin')
59
+ ),
60
+ 'date' => array(
61
+ 'equals' => __('equals', 'wp_all_export_plugin'),
62
+ 'not_equals' => __("doesn't equal", 'wp_all_export_plugin'),
63
+ 'greater' => __('newer than', 'wp_all_export_plugin'),
64
+ 'equals_or_greater' => __('equal to or newer than', 'wp_all_export_plugin'),
65
+ 'less' => __('older than', 'wp_all_export_plugin'),
66
+ 'equals_or_less' => __('equal to or older than', 'wp_all_export_plugin'),
67
+ 'contains' => __('contains', 'wp_all_export_plugin'),
68
+ 'not_contains' => __("doesn't contain", 'wp_all_export_plugin'),
69
+ 'is_empty' => __('is empty', 'wp_all_export_plugin'),
70
+ 'is_not_empty' => __('is not empty', 'wp_all_export_plugin'),
71
+ 'in' => __('In', 'wp_all_export_plugin'),
72
+ 'not_in' => __('Not In', 'wp_all_export_plugin')
73
+ )
74
+ );
75
+
76
+ if ( ! empty($filter_rules_hierarhy) and is_array($filter_rules_hierarhy) ):
77
+
78
+ $rulenumber = 0;
79
+
80
+ foreach ($filter_rules_hierarhy as $rule)
81
+ {
82
+ if ( is_null($rule->parent_id) )
83
+ {
84
+ $condition_label = in_array($rule->element, array('post_date', 'user_registered', 'comment_date')) ? $condition_labels['date'][$rule->condition] : $condition_labels['default'][$rule->condition];
85
+
86
+ $rulenumber++;
87
+ ?>
88
+ <li id="item_<?php echo $rulenumber;?>" class="dragging">
89
+ <div class="drag-element">
90
+ <input type="hidden" value="<?php echo $rule->element; ?>" class="wp_all_export_xml_element" name="wp_all_export_xml_element[<?php echo $rulenumber; ?>]"/>
91
+ <input type="hidden" value="<?php echo $rule->title; ?>" class="wp_all_export_xml_element_title" name="wp_all_export_xml_element_title[<?php echo $rulenumber; ?>]"/>
92
+ <input type="hidden" value="<?php echo $rule->condition; ?>" class="wp_all_export_rule" name="wp_all_export_rule[<?php echo $rulenumber; ?>]"/>
93
+ <input type="hidden" value="<?php echo $rule->value; ?>" class="wp_all_export_value" name="wp_all_export_value[<?php echo $rulenumber; ?>]"/>
94
+ <span class="rule_element"><?php echo $rule->title; ?></span>
95
+ <span class="rule_as_is"><?php echo $condition_label; ?></span>
96
+ <span class="rule_condition_value"><?php echo $rule->value; ?></span>
97
+ <span class="condition <?php if ($rulenumber == count($filter_rules_hierarhy)):?>last_condition<?php endif; ?>">
98
+ <label for="rule_and_<?php echo $rulenumber; ?>">AND</label>
99
+ <input id="rule_and_<?php echo $rulenumber; ?>" type="radio" value="and" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'AND'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
100
+ <label for="rule_or_<?php echo $rulenumber; ?>">OR</label>
101
+ <input id="rule_or_<?php echo $rulenumber; ?>" type="radio" value="or" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'OR'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
102
+ </span>
103
+ </div>
104
+ <a href="javascript:void(0);" class="icon-item remove-ico"></a>
105
+ <?php echo wp_all_export_reverse_rules_html($filter_rules_hierarhy, $rule, $rulenumber, $condition_labels); ?>
106
+ </li>
107
+ <?php
108
+ }
109
+ }
110
+ endif;
111
+ ?>
112
+ </ol>
113
+ <div class="clear"></div>
114
+
115
+ </fieldset>
116
+
117
+ <?php if ( @in_array("product", $post["cpt"]) and class_exists('WooCommerce')) : ?>
118
+
119
+ <div class="input wp_all_export_product_matching_mode">
120
+ <?php $product_matching_mode = $post['product_matching_mode']; ?>
121
+ <label><?php _e("Variable product matching rules: ", "wp_all_export_plugin"); ?></label>
122
+ <select name="product_matching_mode" style="width: 100px; border-radius:0; height: auto;">
123
+ <option value="strict" <?php echo ( $product_matching_mode == 'strict' ) ? 'selected="selected"' : ''; ?>><?php _e("Strict", "wp_all_export_plugin"); ?></option>
124
+ <option value="permissive" <?php echo ( $product_matching_mode == 'permissive' ) ? 'selected="selected"' : ''; ?>><?php _e("Permissive", "wp_all_export_plugin"); ?></option>
125
+ </select>
126
+ <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('Strict matching requires all variations to pass in order for the product to be exported. Permissive matching allows the product to be exported if any of the variations pass.', 'wp_all_export_plugin'); ?>">?</a>
127
+ </div>
128
+
129
+ <?php endif; ?>
130
+
131
+ </div>
132
+ </div>
views/admin/export/index.php CHANGED
@@ -47,7 +47,7 @@
47
  <?php
48
  $custom_types = get_post_types(array('_builtin' => true), 'objects') + get_post_types(array('_builtin' => false, 'show_ui' => true), 'objects') + get_post_types(array('_builtin' => false, 'show_ui' => false), 'objects');
49
  foreach ($custom_types as $key => $ct) {
50
- if (in_array($key, array('attachment', 'revision', 'nav_menu_item', 'import_users'))) unset($custom_types[$key]);
51
  }
52
  $custom_types = apply_filters( 'wpallexport_custom_types', $custom_types );
53
  ?>
@@ -57,18 +57,20 @@
57
  <?php if (count($custom_types)): ?>
58
  <?php foreach ($custom_types as $key => $ct):?>
59
  <?php
60
- $image_src = 'dashicon-cpt';
61
- if ( in_array($key, array('post', 'page', 'product', 'import_users') ) )
62
- $image_src = 'dashicon-' . $key;
 
 
 
63
  ?>
64
- <option value="<?php echo $key;?>" data-imagesrc="dashicon <?php echo $image_src; ?>" <?php if ($key == $post['cpt']) echo 'selected="selected"'; ?>><?php echo $ct->labels->name; ?></option>
65
  <?php endforeach ?>
66
  <?php endif ?>
67
  <option value="users" data-imagesrc="dashicon dashicon-import_users" <?php if ('users' == $post['cpt']) echo 'selected="selected"'; ?>><?php _e("Users", "wp_all_export_plugin"); ?></option>
68
  <option value="comments" data-imagesrc="dashicon dashicon-comments" <?php if ('comments' == $post['cpt']) echo 'selected="selected"'; ?>><?php _e("Comments", "wp_all_export_plugin"); ?></option>
69
- </select>
70
-
71
- <input type="hidden" name="cpt" value="<?php echo $post['cpt']; ?>"/>
72
 
73
  </div>
74
 
@@ -76,6 +78,10 @@
76
  <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=export-users&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to export users.','wp_all_export_plugin');?></a>
77
  <p><?php _e('If you already own it, remove the free edition and install the professional edition.', 'wp_all_export_plugin'); ?></p>
78
  </div>
 
 
 
 
79
  <div class="wpallexport-free-edition-notice wpallexport-comments-export-notice">
80
  <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=export-users&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to export comments.','wp_all_export_plugin');?></a>
81
  <p><?php _e('If you already own it, remove the free edition and install the professional edition.', 'wp_all_export_plugin'); ?></p>
@@ -111,26 +117,28 @@
111
  <div class="wp_all_export_preloader"></div>
112
 
113
  <input type="hidden" class="hierarhy-output" name="filter_rules_hierarhy" value="<?php echo esc_html($post['filter_rules_hierarhy']);?>"/>
 
 
114
 
 
 
 
 
115
  </div>
116
 
117
  <div class="wpallexport-upload-resource-step-two rad4 wpallexport-collapsed closed">
118
-
119
  </div>
120
 
121
  <p class="wpallexport-submit-buttons" <?php if ('advanced' == $post['export_type']) echo 'style="display:block;"';?>>
122
- <input type="hidden" name="custom_type" value="">
123
  <input type="hidden" name="is_submitted" value="1" />
124
  <input type="hidden" name="auto_generate" value="0" />
125
-
126
- <?php wp_nonce_field('choose-cpt', '_wpnonce_choose-cpt'); ?>
127
-
128
- <a href="javascript:void(0);" class="back rad3 auto-generate-template" style="float:none; background: #e4e6e6; padding: 0 50px;"><?php _e('Skip to Step 3', 'wp_all_export_plugin'); ?></a>
129
 
130
- <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Continue to Step 2', 'wp_all_export_plugin') ?>" id="advanced_upload"/>
 
 
131
 
132
- <span class="auto-generate-template"><?php _e('Auto Generate Export Template', 'wp_all_export_plugin'); ?></span>
133
-
134
  </p>
135
 
136
  <table><tr><td class="wpallexport-note"></td></tr></table>
47
  <?php
48
  $custom_types = get_post_types(array('_builtin' => true), 'objects') + get_post_types(array('_builtin' => false, 'show_ui' => true), 'objects') + get_post_types(array('_builtin' => false, 'show_ui' => false), 'objects');
49
  foreach ($custom_types as $key => $ct) {
50
+ if (in_array($key, array('attachment', 'revision', 'nav_menu_item', 'import_users', 'shop_webhook', 'acf-field', 'acf-field-group'))) unset($custom_types[$key]);
51
  }
52
  $custom_types = apply_filters( 'wpallexport_custom_types', $custom_types );
53
  ?>
57
  <?php if (count($custom_types)): ?>
58
  <?php foreach ($custom_types as $key => $ct):?>
59
  <?php
60
+ $image_src = 'dashicon-cpt';
61
+ $cpt_label = $ct->labels->name;
62
+
63
+ if ( in_array($key, array('post', 'page', 'product', 'import_users', 'shop_order', 'shop_coupon', 'shop_customer') ) )
64
+ $image_src = 'dashicon-' . $key;
65
+
66
  ?>
67
+ <option value="<?php echo $key;?>" data-imagesrc="dashicon <?php echo $image_src; ?>" <?php if ($key == $post['cpt']) echo 'selected="selected"'; ?>><?php echo $cpt_label; ?></option>
68
  <?php endforeach ?>
69
  <?php endif ?>
70
  <option value="users" data-imagesrc="dashicon dashicon-import_users" <?php if ('users' == $post['cpt']) echo 'selected="selected"'; ?>><?php _e("Users", "wp_all_export_plugin"); ?></option>
71
  <option value="comments" data-imagesrc="dashicon dashicon-comments" <?php if ('comments' == $post['cpt']) echo 'selected="selected"'; ?>><?php _e("Comments", "wp_all_export_plugin"); ?></option>
72
+ </select>
73
+ <input type="hidden" name="cpt" value="<?php echo $post['cpt']; ?>"/>
 
74
 
75
  </div>
76
 
78
  <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=export-users&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to export users.','wp_all_export_plugin');?></a>
79
  <p><?php _e('If you already own it, remove the free edition and install the professional edition.', 'wp_all_export_plugin'); ?></p>
80
  </div>
81
+ <div class="wpallexport-free-edition-notice wpallexport-shop_customer-export-notice">
82
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=export-users&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to export customers.','wp_all_export_plugin');?></a>
83
+ <p><?php _e('If you already own it, remove the free edition and install the professional edition.', 'wp_all_export_plugin'); ?></p>
84
+ </div>
85
  <div class="wpallexport-free-edition-notice wpallexport-comments-export-notice">
86
  <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=export-users&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to export comments.','wp_all_export_plugin');?></a>
87
  <p><?php _e('If you already own it, remove the free edition and install the professional edition.', 'wp_all_export_plugin'); ?></p>
117
  <div class="wp_all_export_preloader"></div>
118
 
119
  <input type="hidden" class="hierarhy-output" name="filter_rules_hierarhy" value="<?php echo esc_html($post['filter_rules_hierarhy']);?>"/>
120
+ <input type="hidden" class="wpallexport-preload-post-data" value="<?php echo $preload;?>">
121
+ </div>
122
 
123
+ <div class="wpallexport-filtering-wrapper rad4">
124
+ <div class="ajax-console" id="filtering_result">
125
+
126
+ </div>
127
  </div>
128
 
129
  <div class="wpallexport-upload-resource-step-two rad4 wpallexport-collapsed closed">
130
+
131
  </div>
132
 
133
  <p class="wpallexport-submit-buttons" <?php if ('advanced' == $post['export_type']) echo 'style="display:block;"';?>>
134
+ <input type="hidden" name="custom_type" value="" />
135
  <input type="hidden" name="is_submitted" value="1" />
136
  <input type="hidden" name="auto_generate" value="0" />
 
 
 
 
137
 
138
+ <?php wp_nonce_field('choose-cpt', '_wpnonce_choose-cpt'); ?>
139
+
140
+ <span class="wp_all_export_continue_step_two"></span>
141
 
 
 
142
  </p>
143
 
144
  <table><tr><td class="wpallexport-note"></td></tr></table>
views/admin/export/options.php CHANGED
@@ -1,9 +1,14 @@
1
- <?php
2
- $isWizard = $this->isWizard;
3
- $baseUrl = $this->baseUrl;
 
 
4
  ?>
 
 
 
5
 
6
- <div class="wpallexport-step-4">
7
 
8
  <h2 class="wpallexport-wp-notices"></h2>
9
 
@@ -26,177 +31,73 @@
26
  <tr>
27
  <td class="left" style="width: 100%;">
28
 
29
- <?php do_action('pmxe_options_header', $isWizard, $post); ?>
30
 
31
  <div class="ajax-console">
32
  <?php if ($this->errors->get_error_codes()): ?>
33
  <?php $this->error() ?>
34
  <?php endif ?>
35
  </div>
36
-
37
- <?php if ($isWizard): ?>
38
-
39
- <div class="wpallexport-content-section" style="padding: 0 30px 0 0; overflow: hidden; margin-bottom: 0;">
40
-
41
- <div class="wpallexport-ready-to-go">
42
 
43
- <h3><?php _e('Your export is ready to run.', 'wp_all_export_plugin'); ?></h3>
44
-
45
- <h4><?php printf(__('WP All Export will export %d %s.'), PMXE_Plugin::$session->found_posts, wp_all_export_get_cpt_name($post['cpt'])); ?></h4>
46
-
47
- </div>
48
-
49
- <form class="confirm <?php echo ! $isWizard ? 'edit' : '' ?>" method="post" style="float:right;">
 
 
 
 
 
50
 
51
- <?php wp_nonce_field('options', '_wpnonce_options') ?>
52
- <input type="hidden" name="is_submitted" value="1" />
53
 
54
- <input type="submit" class="rad10 wp_all_export_confirm_and_run" value="<?php _e('Confirm & Run Export', 'wp_all_export_plugin') ?>" />
55
- </form>
 
 
56
 
57
- </div>
58
 
59
- <?php endif; ?>
60
 
61
- <div class="clear"></div>
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
- <form class="<?php echo ! $isWizard ? 'edit' : 'options' ?> choose-export-options" method="post" enctype="multipart/form-data" autocomplete="off" <?php echo ! $isWizard ? 'style="overflow:visible;"' : '' ?>>
64
-
65
- <?php if ( ! $isWizard and $post['export_type'] == 'specific'): ?>
66
-
67
- <div class="wpallexport-collapsed wpallexport-section closed">
68
- <div class="wpallexport-content-section">
69
- <div class="wpallexport-collapsed-header" style="padding-left: 25px;">
70
- <h3><?php _e('Filters','wp_all_export_plugin');?></h3>
71
- </div>
72
- <div class="wpallexport-collapsed-content" style="padding: 0;">
73
- <div class="wpallexport-collapsed-content-inner">
74
- <div class="wpallexport-free-edition-notice" style="padding: 20px; margin-bottom: 10px;">
75
- <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&amp;utm_medium=in-plugin&amp;utm_campaign=download-from-url"><?php _e('Upgrade to the professional edition of WP All Export to add filtering rules.','wp_all_export_plugin');?></a>
76
- <p><?php _e('If you already own it, remove the free edition and install the professional edition.', 'wp_all_export_plugin'); ?></p>
77
- </div>
78
- <input type="hidden" name="selected_post_type" value="<?php echo $post['cpt'][0]; ?>"/>
79
- <div class="wp_all_export_rule_inputs">
80
- <table>
81
- <tr>
82
- <th><?php _e('Element', 'wp_all_export_plugin'); ?></th>
83
- <th><?php _e('Rule', 'wp_all_export_plugin'); ?></th>
84
- <th><?php _e('Value', 'wp_all_export_plugin'); ?></th>
85
- <th>&nbsp;</th>
86
- </tr>
87
- <tr>
88
- <td style="width: 25%;">
89
- <select id="wp_all_export_xml_element">
90
- <option value=""><?php _e('Select Element', 'wp_all_export_plugin'); ?></option>
91
- <?php echo $engine->render_filters(); ?>
92
- </select>
93
- </td>
94
- <td style="width: 25%;" id="wp_all_export_available_rules">
95
- <select id="wp_all_export_rule">
96
- <option value=""><?php _e('Select Rule', 'wp_all_export_plugin'); ?></option>
97
- </select>
98
- </td>
99
- <td style="width: 25%;">
100
- <input id="wp_all_export_value" type="text" placeholder="value" value="" disabled="disabled"/>
101
- </td>
102
- <td style="width: 15%;">
103
- <a id="wp_all_export_add_rule" href="javascript:void(0);"><?php _e('Add Rule', 'wp_all_export_plugin');?></a>
104
- </td>
105
- </tr>
106
- </table>
107
- </div>
108
- <div id="wpallexport-filters" style="padding:0;">
109
- <div class="wpallexport-content-section" style="padding:0; border: none;">
110
- <fieldset id="wp_all_export_filtering_rules">
111
- <?php
112
- $filter_rules = $post['filter_rules_hierarhy'];
113
- $filter_rules_hierarhy = json_decode($filter_rules);
114
- if ( empty($filter_rules_hierarhy) or ! is_array($filter_rules_hierarhy) ):
115
- ?>
116
- <p style="margin:20px 0 5px; text-align:center;"><?php _e('No filtering options. Add filtering options to only export records matching some specified criteria.', 'wp_all_export_plugin');?></p>
117
- <?php
118
- endif;
119
- ?>
120
- <ol class="wp_all_export_filtering_rules">
121
- <?php
122
- if ( ! empty($filter_rules_hierarhy) and is_array($filter_rules_hierarhy) ):
123
- $rulenumber = 0;
124
- foreach ($filter_rules_hierarhy as $rule) {
125
-
126
- if ( is_null($rule->parent_id) )
127
- {
128
- $rulenumber++;
129
- ?>
130
- <li id="item_<?php echo $rulenumber;?>" class="dragging">
131
- <div class="drag-element">
132
- <input type="hidden" value="<?php echo $rule->element; ?>" class="wp_all_export_xml_element" name="wp_all_export_xml_element[<?php echo $rulenumber; ?>]"/>
133
- <input type="hidden" value="<?php echo $rule->title; ?>" class="wp_all_export_xml_element_title" name="wp_all_export_xml_element_title[<?php echo $rulenumber; ?>]"/>
134
- <input type="hidden" value="<?php echo $rule->condition; ?>" class="wp_all_export_rule" name="wp_all_export_rule[<?php echo $rulenumber; ?>]"/>
135
- <input type="hidden" value="<?php echo $rule->value; ?>" class="wp_all_export_value" name="wp_all_export_value[<?php echo $rulenumber; ?>]"/>
136
- <span class="rule_element"><?php echo $rule->title; ?></span>
137
- <span class="rule_as_is"><?php echo $rule->condition; ?></span>
138
- <span class="rule_condition_value"><?php echo $rule->value; ?></span>
139
- <span class="condition" <?php if ($rulenumber == count($filter_rules_hierarhy)):?>style="display:none;"<?php endif; ?>>
140
- <label for="rule_and_<?php echo $rulenumber; ?>">AND</label>
141
- <input id="rule_and_<?php echo $rulenumber; ?>" type="radio" value="and" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'AND'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
142
- <label for="rule_or_<?php echo $rulenumber; ?>">OR</label>
143
- <input id="rule_or_<?php echo $rulenumber; ?>" type="radio" value="or" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'OR'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
144
- </span>
145
- </div>
146
- <a href="javascript:void(0);" class="icon-item remove-ico"></a>
147
- <?php echo wp_all_export_reverse_rules_html($filter_rules_hierarhy, $rule, $rulenumber); ?>
148
- </li>
149
- <?php
150
- }
151
- }
152
- endif;
153
- ?>
154
- </ol>
155
- <div class="clear"></div>
156
-
157
- </fieldset>
158
-
159
- <?php if ( @in_array("product", $post["cpt"]) and class_exists('WooCommerce')) : ?>
160
-
161
- <div class="input wp_all_export_product_matching_mode" <?php if (empty($filter_rules_hierarhy)): ?>style="display:none;"<?php endif; ?>>
162
- <?php $product_matching_mode = $post['product_matching_mode']; ?>
163
- <label><?php _e("Variable product matching rules: ", "wp_all_export_plugin"); ?></label>
164
- <select name="product_matching_mode">
165
- <option value="strict" <?php echo ( $product_matching_mode == 'strict' ) ? 'selected="selected"' : ''; ?>><?php _e("Strict", "wp_all_export_plugin"); ?></option>
166
- <option value="permissive" <?php echo ( $product_matching_mode == 'permissive' ) ? 'selected="selected"' : ''; ?>><?php _e("Permissive", "wp_all_export_plugin"); ?></option>
167
- </select>
168
- <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('Strict matching requires all variations to pass in order for the product to be exported. Permissive matching allows the product to be exported if any of the variations pass.', 'wp_all_export_plugin'); ?>">?</a>
169
- </div>
170
-
171
- <?php endif; ?>
172
-
173
- </div>
174
- </div>
175
- </div>
176
-
177
- <input type="hidden" class="hierarhy-output" name="filter_rules_hierarhy" value="<?php echo esc_html($post['filter_rules_hierarhy']);?>"/>
178
-
179
- </div>
180
- </div>
181
- </div>
182
 
183
- <?php endif; ?>
184
 
185
- <?php include_once 'options/settings.php'; ?>
186
 
187
  <p class="wpallexport-submit-buttons" style="text-align: center;">
188
  <?php wp_nonce_field('options', '_wpnonce_options') ?>
189
  <input type="hidden" name="is_submitted" value="1" />
190
 
191
- <?php if ($isWizard): ?>
192
 
193
- <a href="<?php echo apply_filters('pmxi_options_back_link', add_query_arg('action', 'template', $this->baseUrl), $isWizard); ?>" class="back rad3"><?php _e('Back to Step 2', 'wp_all_export_plugin') ?></a>
194
 
195
- <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Confirm & Run Export', 'wp_all_export_plugin') ?>" />
196
 
197
  <?php else: ?>
198
- <a href="<?php echo apply_filters('pmxi_options_back_link', remove_query_arg('id', remove_query_arg('action', $this->baseUrl)), $isWizard); ?>" class="back rad3"><?php _e('Back to Manage Exports', 'wp_all_export_plugin') ?></a>
199
- <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Save Export Configuration', 'wp_all_export_plugin') ?>" />
200
  <?php endif ?>
201
  </p>
202
 
1
+ <?php
2
+ $l10n = array(
3
+ 'confirm_and_run' => __('Confirm & Run Export', 'wp_all_export_plugin'),
4
+ 'save_configuration' => __('Save Export Configuration', 'wp_all_export_plugin')
5
+ );
6
  ?>
7
+ <script type="text/javascript">
8
+ var wp_all_export_L10n = <?php echo json_encode($l10n); ?>;
9
+ </script>
10
 
11
+ <div class="wpallexport-step-4 wpallexport-export-options">
12
 
13
  <h2 class="wpallexport-wp-notices"></h2>
14
 
31
  <tr>
32
  <td class="left" style="width: 100%;">
33
 
34
+ <?php do_action('pmxe_options_header', $this->isWizard, $post); ?>
35
 
36
  <div class="ajax-console">
37
  <?php if ($this->errors->get_error_codes()): ?>
38
  <?php $this->error() ?>
39
  <?php endif ?>
40
  </div>
 
 
 
 
 
 
41
 
42
+ <div class="wpallexport-content-section" style="padding: 0 30px 0 0; overflow: hidden; margin-bottom: 0;">
43
+
44
+ <div id="filtering_result" class="wpallexport-ready-to-go <?php if (empty(PMXE_Plugin::$session->found_posts)):?>nothing_to_export<?php endif;?>">
45
+ <?php if (empty(PMXE_Plugin::$session->found_posts)):?>
46
+ <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
47
+ <?php else: ?>
48
+ <h3><?php _e('Your export is ready to run.', 'wp_all_export_plugin'); ?></h3>
49
+ <?php endif; ?>
50
+ <div class="wp_all_export_preloader"></div>
51
+ </div>
52
+ <?php if ($this->isWizard): ?>
53
+ <form class="confirm <?php echo ! $this->isWizard ? 'edit' : '' ?>" method="post" style="float:right;">
54
 
55
+ <?php wp_nonce_field('options', '_wpnonce_options') ?>
56
+ <input type="hidden" name="is_submitted" value="1" />
57
 
58
+ <input type="submit" class="rad10 wp_all_export_confirm_and_run" value="<?php _e('Confirm & Run Export', 'wp_all_export_plugin') ?>" />
59
+ </form>
60
+ <?php endif; ?>
61
+ </div>
62
 
63
+ <div class="clear"></div>
64
 
65
+ <form class="<?php echo ! $this->isWizard ? 'edit' : 'options' ?> choose-export-options" method="post" enctype="multipart/form-data" autocomplete="off" <?php echo ! $this->isWizard ? 'style="overflow:visible;"' : '' ?>>
66
 
67
+ <?php
68
+ $selected_post_type = '';
69
+ if (XmlExportUser::$is_active):
70
+ $selected_post_type = empty($post['cpt'][0]) ? 'users' : $post['cpt'][0];
71
+ endif;
72
+ if (XmlExportComment::$is_active):
73
+ $selected_post_type = 'comments';
74
+ endif;
75
+ if (empty($selected_post_type) and ! empty($post['cpt'][0]))
76
+ {
77
+ $selected_post_type = $post['cpt'][0];
78
+ }
79
+ ?>
80
 
81
+ <input type="hidden" name="selected_post_type" value="<?php echo $selected_post_type; ?>"/>
82
+ <input type="hidden" name="export_type" value="<?php echo $post['export_type']; ?>"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
+ <?php XmlExportFiltering::render_filtering_block( $engine, $this->isWizard, $post ); ?>
85
 
86
+ <?php include_once 'options/settings.php'; ?>
87
 
88
  <p class="wpallexport-submit-buttons" style="text-align: center;">
89
  <?php wp_nonce_field('options', '_wpnonce_options') ?>
90
  <input type="hidden" name="is_submitted" value="1" />
91
 
92
+ <?php if ($this->isWizard): ?>
93
 
94
+ <a href="<?php echo apply_filters('pmxi_options_back_link', add_query_arg('action', 'template', $this->baseUrl), $this->isWizard); ?>" class="back rad3"><?php _e('Back', 'wp_all_export_plugin') ?></a>
95
 
96
+ <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Confirm & Run Export', 'wp_all_export_plugin'); ?>" />
97
 
98
  <?php else: ?>
99
+ <a href="<?php echo apply_filters('pmxi_options_back_link', remove_query_arg('id', remove_query_arg('action', $this->baseUrl)), $this->isWizard); ?>" class="back rad3"><?php _e('Back to Manage Exports', 'wp_all_export_plugin') ?></a>
100
+ <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Save Export Configuration', 'wp_all_export_plugin'); ?>" />
101
  <?php endif ?>
102
  </p>
103
 
views/admin/export/options/settings.php CHANGED
@@ -1,59 +1,112 @@
1
- <div class="wpallexport-template">
2
- <div class="wpallexport-collapsed wpallexport-section">
3
- <div class="wpallexport-content-section">
4
- <div class="wpallexport-collapsed-header" style="padding-left: 25px;">
5
- <h3><?php _e('Configure Advanced Settings','wp_all_export_plugin');?></h3>
6
- </div>
7
- <div class="wpallexport-collapsed-content" style="padding: 0;">
8
- <div class="wpallexport-collapsed-content-inner">
9
- <table class="form-table" style="max-width:none;">
10
- <tr>
11
- <td colspan="3">
12
- <div class="input" style="margin:5px 0px;">
13
- <label for="records_per_request"><?php _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 _e('records', 'wp_all_export_plugin'); ?></label>
14
- <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _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>
15
- </div>
16
- <div class="input" style="margin:5px 0px;">
17
- <input type="hidden" name="export_only_new_stuff" value="0" />
18
- <input type="checkbox" id="export_only_new_stuff" name="export_only_new_stuff" value="1" <?php echo $post['export_only_new_stuff'] ? 'checked="checked"': '' ?> />
19
- <label for="export_only_new_stuff"><?php printf(__('Only export %s once', 'wp_all_export_plugin'), empty($post['cpt']) ? __('records', 'wp_all_export_plugin') : wp_all_export_get_cpt_name($post['cpt'])); ?></label>
20
- <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('If re-run, this export will only include records that have not been previously exported.', 'wp_all_export_plugin'); ?>">?</a>
21
- </div>
22
- <div class="input" style="margin:5px 0px;">
23
- <input type="hidden" name="include_bom" value="0" />
24
- <input type="checkbox" id="include_bom" name="include_bom" value="1" <?php echo $post['include_bom'] ? 'checked="checked"': '' ?> />
25
- <label for="include_bom"><?php _e('Include BOM in export file', 'wp_all_export_plugin') ?></label>
26
- <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('The BOM will help some programs like Microsoft Excel read your export file if it includes non-English characters.', 'wp_all_export_plugin'); ?>">?</a>
27
- </div>
28
- <div class="input" style="margin:5px 0px;">
29
- <input type="hidden" name="creata_a_new_export_file" value="0" />
30
- <input type="checkbox" id="creata_a_new_export_file" name="creata_a_new_export_file" value="1" <?php echo $post['creata_a_new_export_file'] ? 'checked="checked"': '' ?> />
31
- <label for="creata_a_new_export_file"><?php _e('Create a new file each time export is run', 'wp_all_export_plugin') ?></label>
32
- <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('If disabled, the export file will be overwritten every time this export run.', 'wp_all_export_plugin'); ?>">?</a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  </div>
34
- <div class="input" style="margin:5px 0px;">
35
- <input type="hidden" name="split_large_exports" value="0" />
36
- <input type="checkbox" id="split_large_exports" name="split_large_exports" class="switcher" value="1" <?php echo $post['split_large_exports'] ? 'checked="checked"': '' ?> />
37
- <label for="split_large_exports"><?php _e('Split large exports into multiple files', 'wp_all_export_plugin') ?></label>
38
- <span class="switcher-target-split_large_exports pl17" style="display:block; clear: both; width: 100%;">
39
- <div class="input pl17" style="margin:5px 0px;">
40
- <label for="records_per_request"><?php _e('Limit export to', 'wp_all_export_plugin');?></label> <input type="text" name="split_large_exports_count" class="wp_all_export_sub_input" style="width: 50px;" value="<?php echo esc_attr($post['split_large_exports_count']) ?>" /> <?php _e('records per file', 'wp_all_export_plugin'); ?>
41
- </div>
42
- </span>
43
- </div>
44
- <br>
45
- <hr>
46
- <p style="text-align:right;">
47
- <div class="input">
48
- <label for="save_import_as" style="width: 103px;"><?php _e('Friendly Name:','wp_all_export_plugin');?></label>
49
- <input type="text" name="friendly_name" title="<?php _e('Save friendly name...', 'pmxi_plugin') ?>" style="vertical-align:middle; background:#fff !important;" value="<?php echo esc_attr($post['friendly_name']) ?>" />
50
- </div>
51
- </p>
52
- </td>
53
- </tr>
54
- </table>
55
- </div>
56
  </div>
57
  </div>
58
- </div>
59
  </div>
1
+ <div class="wpallexport-collapsed wpallexport-section">
2
+ <div class="wpallexport-content-section" style="margin-top:10px;">
3
+ <div class="wpallexport-collapsed-header" style="padding-left: 25px;">
4
+ <h3><?php _e('Configure Advanced Settings','wp_all_export_plugin');?></h3>
5
+ </div>
6
+ <div class="wpallexport-collapsed-content" style="padding: 0;">
7
+ <div class="wpallexport-collapsed-content-inner">
8
+ <table class="form-table" style="max-width:none;">
9
+ <tr>
10
+ <td colspan="3">
11
+ <div class="input" style="margin:5px 0px;">
12
+ <label for="records_per_request"><?php _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 _e('records', 'wp_all_export_plugin'); ?></label>
13
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _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>
14
+ </div>
15
+ <div class="input" style="margin:5px 0px;">
16
+ <input type="hidden" name="export_only_new_stuff" value="0" />
17
+ <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"/>
18
+ <label for="export_only_new_stuff" disabled="disabled"><?php printf(__('Only export %s once', 'wp_all_export_plugin'), empty($post['cpt']) ? __('records', 'wp_all_export_plugin') : wp_all_export_get_cpt_name($post['cpt'])); ?></label>
19
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('If re-run, this export will only include records that have not been previously exported.<br><br><strong>Upgrade to the professional edition of WP All Export to use this option.</strong>', 'wp_all_export_plugin'); ?>">?</a>
20
+ </div>
21
+ <div class="input" style="margin:5px 0px;">
22
+ <input type="hidden" name="include_bom" value="0" />
23
+ <input type="checkbox" id="include_bom" name="include_bom" value="1" <?php echo $post['include_bom'] ? 'checked="checked"': '' ?> />
24
+ <label for="include_bom"><?php _e('Include BOM in export file', 'wp_all_export_plugin') ?></label>
25
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('The BOM will help some programs like Microsoft Excel read your export file if it includes non-English characters.', 'wp_all_export_plugin'); ?>">?</a>
26
+ </div>
27
+ <div class="input" style="margin:5px 0px;">
28
+ <input type="hidden" name="creata_a_new_export_file" value="0" />
29
+ <input type="checkbox" id="creata_a_new_export_file" name="creata_a_new_export_file" value="1" <?php echo $post['creata_a_new_export_file'] ? 'checked="checked"': '' ?> />
30
+ <?php if ( ! XmlExportEngine::$is_auto_generate_enabled || ! XmlExportWooCommerceOrder::$is_active || $post['export_type'] != 'specific'): ?>
31
+ <label for="creata_a_new_export_file"><?php _e('Create a new file each time export is run', 'wp_all_export_plugin') ?></label>
32
+ <?php else: ?>
33
+ <label for="creata_a_new_export_file"><?php _e('Create a new import bundle each time export is run', 'wp_all_export_plugin') ?></label>
34
+ <?php endif; ?>
35
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('If disabled, the export file will be overwritten every time this export run.', 'wp_all_export_plugin'); ?>">?</a>
36
+ </div>
37
+
38
+ <?php if ( ! XmlExportEngine::$is_auto_generate_enabled || ! XmlExportWooCommerceOrder::$is_active || $post['export_type'] != 'specific'): ?>
39
+ <div class="input" style="margin:5px 0px;">
40
+ <input type="hidden" name="split_large_exports" value="0" />
41
+ <input type="checkbox" id="split_large_exports" name="split_large_exports" class="switcher" value="1" <?php echo $post['split_large_exports'] ? 'checked="checked"': '' ?> />
42
+ <label for="split_large_exports"><?php _e('Split large exports into multiple files', 'wp_all_export_plugin') ?></label>
43
+ <span class="switcher-target-split_large_exports pl17" style="display:block; clear: both; width: 100%;">
44
+ <div class="input pl17" style="margin:5px 0px;">
45
+ <label for="records_per_request"><?php _e('Limit export to', 'wp_all_export_plugin');?></label> <input type="text" name="split_large_exports_count" class="wp_all_export_sub_input" style="width: 50px;" value="<?php echo esc_attr($post['split_large_exports_count']) ?>" /> <?php _e('records per file', 'wp_all_export_plugin'); ?>
46
+ </div>
47
+ </span>
48
+ </div>
49
+ <?php endif; ?>
50
+
51
+ <?php if ( XmlExportEngine::$is_auto_generate_enabled && XmlExportWooCommerceOrder::$is_active && $post['export_type'] == 'specific'): ?>
52
+ <!-- Include products -->
53
+ <div class="input" style="margin:5px 0px;">
54
+ <input type="hidden" name="order_include_poducts" value="0" />
55
+ <input type="checkbox" id="order_include_poducts" name="order_include_poducts" class="switcher" value="1" <?php echo $post['order_include_poducts'] ? 'checked="checked"': '' ?> />
56
+ <label for="order_include_poducts"><?php _e('Include products', 'wp_all_export_plugin') ?></label>
57
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('Products purchased in these orders will also be exported.', 'wp_all_export_plugin'); ?>">?</a>
58
+ <span class="switcher-target-order_include_poducts pl17" style="display:block; clear: both; width: 100%;">
59
+ <div class="input" style="margin-left: 5px;">
60
+ <input type="hidden" name="order_include_all_poducts" value="0" />
61
+ <input type="checkbox" id="order_include_all_poducts" name="order_include_all_poducts" class="switcher" value="1" <?php echo $post['order_include_all_poducts'] ? 'checked="checked"': '' ?> />
62
+ <label for="order_include_all_poducts"><?php _e('Export all products', 'wp_all_export_plugin') ?></label>
63
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('All products will be exported, not only those that were purchased in these orders.', 'wp_all_export_plugin'); ?>">?</a>
64
+ </div>
65
+ </span>
66
+ </div>
67
+ <!-- Include Coupons -->
68
+ <div class="input" style="margin:5px 0px;">
69
+ <input type="hidden" name="order_include_coupons" value="0" />
70
+ <input type="checkbox" id="order_include_coupons" name="order_include_coupons" class="switcher" value="1" <?php echo $post['order_include_coupons'] ? 'checked="checked"': '' ?> />
71
+ <label for="order_include_coupons"><?php _e('Include coupons', 'wp_all_export_plugin') ?></label>
72
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('Coupons used in these orders will also be exported.', 'wp_all_export_plugin'); ?>">?</a>
73
+ <span class="switcher-target-order_include_coupons pl17" style="display:block; clear: both; width: 100%;">
74
+ <div class="input" style="margin-left: 5px;">
75
+ <input type="hidden" name="order_include_all_coupons" value="0" />
76
+ <input type="checkbox" id="order_include_all_coupons" name="order_include_all_coupons" class="switcher" value="1" <?php echo $post['order_include_all_coupons'] ? 'checked="checked"': '' ?> />
77
+ <label for="order_include_all_coupons"><?php _e('Export all coupons', 'wp_all_export_plugin') ?></label>
78
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('All coupons will be exported, not only those that were used in these orders.', 'wp_all_export_plugin'); ?>">?</a>
79
+ </div>
80
+ </span>
81
+ </div>
82
+ <!-- Include Customers -->
83
+ <div class="input" style="margin:5px 0px;">
84
+ <input type="hidden" name="order_include_customers" value="0" />
85
+ <input type="checkbox" id="order_include_customers" name="order_include_customers" class="switcher" value="1" <?php echo $post['order_include_customers'] ? 'checked="checked"': '' ?> />
86
+ <label for="order_include_customers"><?php _e('Include customers', 'wp_all_export_plugin') ?></label>
87
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('Customers who purchased created orders will also be exported.', 'wp_all_export_plugin'); ?>">?</a>
88
+ <span class="switcher-target-order_include_customers pl17" style="display:block; clear: both; width: 100%;">
89
+ <div class="input" style="margin-left: 5px;">
90
+ <input type="hidden" name="order_include_all_customers" value="0" />
91
+ <input type="checkbox" id="order_include_all_customers" name="order_include_all_customers" class="switcher" value="1" <?php echo $post['order_include_all_customers'] ? 'checked="checked"': '' ?> />
92
+ <label for="order_include_all_customers"><?php _e('Export all customers', 'wp_all_export_plugin') ?></label>
93
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('All customers will be exported, not only those that created these orders.', 'wp_all_export_plugin'); ?>">?</a>
94
+ </div>
95
+ </span>
96
+ </div>
97
+ <?php endif; ?>
98
+ <br>
99
+ <hr>
100
+ <p style="text-align:right;">
101
+ <div class="input">
102
+ <label for="save_import_as" style="width: 103px;"><?php _e('Friendly Name:','wp_all_export_plugin');?></label>
103
+ <input type="text" name="friendly_name" title="<?php _e('Save friendly name...', 'pmxi_plugin') ?>" style="vertical-align:middle; background:#fff !important;" value="<?php echo esc_attr($post['friendly_name']) ?>" />
104
  </div>
105
+ </p>
106
+ </td>
107
+ </tr>
108
+ </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  </div>
110
  </div>
111
+ </div>
112
  </div>
views/admin/export/process.php CHANGED
@@ -22,31 +22,71 @@
22
  <h2><?php _e('Export <span id="status">in Progress...</span>', 'wp_all_export_plugin') ?></h2>
23
  <h3 id="process_notice"><?php _e('Exporting may take some time. Please do not close your browser or refresh the page until the process is complete.', 'wp_all_export_plugin'); ?></h3>
24
  </div>
25
- <div id="processbar" class="rad14">
26
- <div class="rad14"></div>
27
- </div>
28
- <div id="export_progress">
29
- <span id="left_progress"><?php _e('Time Elapsed', 'wp_all_export_plugin');?> <span id="then">00:00:00</span></span>
30
- <span id="center_progress"><span id="percents_count">0</span>%</span>
31
- <span id="right_progress"><?php _e('Exported','wp_all_export_plugin');?> <span id="created_count"><?php echo $update_previous->exported; ?></span></span>
32
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  </div>
34
 
35
- <div id="export_finished">
36
- <!--h1><?php _e('Export Complete!', 'wp_all_export_plugin'); ?></h1-->
37
  <h3><?php _e('WP All Export successfully exported your data!','wp_all_export_plugin'); ?></h3>
38
  <p><?php _e('Download Data', 'wp_all_export_plugin'); ?></p>
39
  <div class="input wp_all_export_download">
40
  <div class="input">
41
- <button class="button button-primary button-hero wpallexport-large-button download_data" rel="<?php echo add_query_arg(array('action' => 'download', 'id' => $update_previous->id, '_wpnonce' => wp_create_nonce( '_wpnonce-download_feed' )), $this->baseUrl); ?>"><?php echo strtoupper($update_previous->options['export_to']); ?></button>
42
  </div>
43
  <?php if ( ! empty($update_previous->options['split_large_exports']) ): ?>
44
  <div class="input" style="margin-left: 10px;">
45
- <button class="button button-primary button-hero wpallexport-large-button download_data" rel="<?php echo add_query_arg(array('page' => 'pmxe-admin-manage', 'id' => $update_previous->id, 'action' => 'split_bundle', '_wpnonce' => wp_create_nonce( '_wpnonce-download_split_bundle' )), $this->baseUrl); ?>"><?php printf(__('Split %ss', 'wp_all_export_plugin'), strtoupper($update_previous->options['export_to'])); ?></button>
46
- <!--span><?php _e('Settings & Data for WP All Import', 'wp_all_export_plugin'); ?></span-->
47
  </div>
48
  <?php endif; ?>
49
- <?php if ( empty($update_previous->options['cpt']) or ! in_array('shop_order', $update_previous->options['cpt'])): ?>
50
  <div class="input" style="margin-left: 10px;">
51
  <button class="button button-primary button-hero wpallexport-large-button download_data" rel="<?php echo add_query_arg(array('page' => 'pmxe-admin-manage', 'id' => $update_previous->id, 'action' => 'bundle', '_wpnonce' => wp_create_nonce( '_wpnonce-download_bundle' )), $this->baseUrl); ?>"><?php _e('Bundle', 'wp_all_export_plugin'); ?></button>
52
  <span><?php _e('Settings & Data for WP All Import', 'wp_all_export_plugin'); ?></span>
@@ -95,16 +135,17 @@
95
  setInterval(update, 1000);
96
 
97
  var $this = $(this);
98
-
99
  interval = setInterval(function () {
100
 
101
- var percents = $('#percents_count').html();
102
- $('#processbar div').css({'width': ((parseInt(percents) > 100 || percents == undefined) ? 100 : percents) + '%'});
103
-
 
104
 
105
  }, 1000);
106
 
107
- $('#processbar').css({'visibility':'visible'});
108
 
109
  });
110
 
@@ -113,47 +154,70 @@
113
  security: wp_all_export_security
114
  };
115
 
116
- function wp_all_export_process(){
117
 
118
  var $URL = ajaxurl;
119
- if (typeof export_id != "undefined")
120
- {
121
- if ($URL.indexOf("?") == -1)
122
- {
123
- $URL += '?id=' + export_id;
124
- }
125
- else
126
- {
127
- $URL += '&id=' + export_id;
128
- }
129
- }
130
-
 
 
 
 
 
 
 
 
131
  $.ajax({
132
  type: 'POST',
133
  url: $URL,
134
  data: request,
135
  success: function(response) {
136
 
137
- $('#created_count').html(response.exported);
138
- $('#percents_count').html(response.percentage);
139
- $('#processbar div').css({'width': response.percentage + '%'});
140
-
141
- if (response.done)
142
  {
143
- $('#status').html('Complete');
144
  window.onbeforeunload = false;
 
 
 
145
 
146
- setTimeout(function() {
147
-
148
- $('#export_finished').fadeIn();
149
-
150
- }, 1000);
151
 
152
- //window.location.href = "<?php echo add_query_arg('action', 'download', $this->baseUrl); ?>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  }
154
  else
155
  {
156
- wp_all_export_process();
157
  }
158
  },
159
  error:function(request, status, error){
@@ -165,7 +229,7 @@
165
  });
166
  };
167
 
168
- wp_all_export_process();
169
 
170
  window.onbeforeunload = function () {
171
  return 'WARNING:\nExport process in under way, leaving the page will interrupt\nthe operation and most likely to cause leftovers in posts.';
22
  <h2><?php _e('Export <span id="status">in Progress...</span>', 'wp_all_export_plugin') ?></h2>
23
  <h3 id="process_notice"><?php _e('Exporting may take some time. Please do not close your browser or refresh the page until the process is complete.', 'wp_all_export_plugin'); ?></h3>
24
  </div>
25
+ <div class="wpallexport_process_wrapper_<?php echo $update_previous->id; ?> wpallexport_process_parent_wrapper">
26
+ <div class="wpallexport_processbar rad14">
27
+ <div class="rad14"></div>
28
+ </div>
29
+ <div class="export_progress">
30
+ <span class="left_progress"><?php _e('Time Elapsed', 'wp_all_export_plugin');?> <span id="then">00:00:00</span></span>
31
+ <span class="center_progress"><span class="percents_count">0</span>%</span>
32
+ <span class="right_progress"><?php _e('Exported','wp_all_export_plugin');?> <span class="created_count"><?php echo $update_previous->exported; ?></span></span>
33
+ </div>
34
+ </div>
35
+ <?php
36
+ if ( XmlExportWooCommerceOrder::$is_active && $update_previous->options['export_type'] == 'specific' ):
37
+
38
+ $exportList = new PMXE_Export_List();
39
+ foreach ($exportList->getBy('parent_id', $update_previous->id)->convertRecords() as $child_export)
40
+ {
41
+ $is_render_child_progress = true;
42
+ switch ($child_export->export_post_type)
43
+ {
44
+ case 'product':
45
+ if ( ! $update_previous->options['order_include_poducts'] ) $is_render_child_progress = false;
46
+ break;
47
+ case 'shop_coupon':
48
+ if ( ! $update_previous->options['order_include_coupons'] ) $is_render_child_progress = false;
49
+ break;
50
+ case 'shop_customer':
51
+ if ( ! $update_previous->options['order_include_customers'] ) $is_render_child_progress = false;
52
+ break;
53
+ }
54
+
55
+ if ( ! $is_render_child_progress) continue;
56
+
57
+ ?>
58
+ <div class="clear"></div>
59
+ <div class="wpallexport_process_wrapper_<?php echo $child_export->id; ?> wpallexport_process_child_wrapper">
60
+ <div class="wpallexport_processbar rad14">
61
+ <div class="rad14"></div>
62
+ </div>
63
+ <div class="export_progress">
64
+ <span class="left_progress">
65
+ <span class="center_progress">
66
+ <span class="percents_count">0</span>%</span> <?php printf(__("Export %ss", "wp_all_export_plugin"), ucwords(str_replace("_", " ", str_replace("shop", "", $child_export->export_post_type))));?></span>
67
+ <span class="right_progress"><?php _e('Exported','wp_all_export_plugin');?> <span class="created_count">0</span></span>
68
+ </div>
69
+ </div>
70
+ <?php
71
+ }
72
+
73
+ endif;
74
+ ?>
75
  </div>
76
 
77
+ <div id="export_finished">
 
78
  <h3><?php _e('WP All Export successfully exported your data!','wp_all_export_plugin'); ?></h3>
79
  <p><?php _e('Download Data', 'wp_all_export_plugin'); ?></p>
80
  <div class="input wp_all_export_download">
81
  <div class="input">
82
+ <button class="button button-primary button-hero wpallexport-large-button download_data" rel="<?php echo add_query_arg(array('action' => 'download', 'id' => $update_previous->id, '_wpnonce' => wp_create_nonce( '_wpnonce-download_feed' )), $this->baseUrl); ?>"><?php echo strtoupper(wp_all_export_get_export_format($update_previous->options)); ?></button>
83
  </div>
84
  <?php if ( ! empty($update_previous->options['split_large_exports']) ): ?>
85
  <div class="input" style="margin-left: 10px;">
86
+ <button class="button button-primary button-hero wpallexport-large-button download_data" rel="<?php echo add_query_arg(array('page' => 'pmxe-admin-manage', 'id' => $update_previous->id, 'action' => 'split_bundle', '_wpnonce' => wp_create_nonce( '_wpnonce-download_split_bundle' )), $this->baseUrl); ?>"><?php printf(__('Split %ss', 'wp_all_export_plugin'), strtoupper(wp_all_export_get_export_format($update_previous->options))); ?></button>
 
87
  </div>
88
  <?php endif; ?>
89
+ <?php if ( PMXE_Export_Record::is_bundle_supported($update_previous->options) ): ?>
90
  <div class="input" style="margin-left: 10px;">
91
  <button class="button button-primary button-hero wpallexport-large-button download_data" rel="<?php echo add_query_arg(array('page' => 'pmxe-admin-manage', 'id' => $update_previous->id, 'action' => 'bundle', '_wpnonce' => wp_create_nonce( '_wpnonce-download_bundle' )), $this->baseUrl); ?>"><?php _e('Bundle', 'wp_all_export_plugin'); ?></button>
92
  <span><?php _e('Settings & Data for WP All Import', 'wp_all_export_plugin'); ?></span>
135
  setInterval(update, 1000);
136
 
137
  var $this = $(this);
138
+
139
  interval = setInterval(function () {
140
 
141
+ $('div[class^=wpallexport_process_wrapper]').each(function(){
142
+ var percents = $(this).find('.percents_count').html();
143
+ $(this).find('.wpallexport_processbar div').css({'width': ((parseInt(percents) > 100 || percents == undefined) ? 100 : percents) + '%'});
144
+ });
145
 
146
  }, 1000);
147
 
148
+ $('.wpallexport_processbar').css({'visibility':'visible'});
149
 
150
  });
151
 
154
  security: wp_all_export_security
155
  };
156
 
157
+ function wp_all_export_process( queue_export ){
158
 
159
  var $URL = ajaxurl;
160
+
161
+ if (queue_export !== false)
162
+ {
163
+ $URL += '?id=' + queue_export;
164
+ }
165
+ else
166
+ {
167
+ if (typeof export_id != "undefined")
168
+ {
169
+ if ($URL.indexOf("?") == -1)
170
+ {
171
+ $URL += '?id=' + export_id;
172
+ }
173
+ else
174
+ {
175
+ $URL += '&id=' + export_id;
176
+ }
177
+ }
178
+ }
179
+
180
  $.ajax({
181
  type: 'POST',
182
  url: $URL,
183
  data: request,
184
  success: function(response) {
185
 
186
+ if (response === null)
 
 
 
 
187
  {
188
+ $('#status').html('Error');
189
  window.onbeforeunload = false;
190
+ $('#process_notice').after(request.responseText);
191
+ return;
192
+ }
193
 
194
+ var $process_wrapper = $('.wpallexport_process_wrapper_' + response.export_id);
 
 
 
 
195
 
196
+ $process_wrapper.find('.created_count').html(response.exported);
197
+ $process_wrapper.find('.percents_count').html(response.percentage);
198
+ $process_wrapper.find('.wpallexport_processbar div').css({'width': response.percentage + '%'});
199
+
200
+ if (response.done)
201
+ {
202
+ if (response.queue_export)
203
+ {
204
+ wp_all_export_process( response.queue_export );
205
+ }
206
+ else
207
+ {
208
+ $('#status').html('Complete');
209
+ window.onbeforeunload = false;
210
+
211
+ setTimeout(function() {
212
+
213
+ $('#export_finished').fadeIn();
214
+
215
+ }, 1000);
216
+ }
217
  }
218
  else
219
  {
220
+ wp_all_export_process(response.export_id);
221
  }
222
  },
223
  error:function(request, status, error){
229
  });
230
  };
231
 
232
+ wp_all_export_process(<?php echo $update_previous->id; ?>);
233
 
234
  window.onbeforeunload = function () {
235
  return 'WARNING:\nExport process in under way, leaving the page will interrupt\nthe operation and most likely to cause leftovers in posts.';
views/admin/export/template.php CHANGED
@@ -16,26 +16,20 @@
16
 
17
  <div class="clear"></div>
18
 
19
- <div class="wpallexport-content-section wpallexport-console" style="display: block; margin-bottom: 0;">
20
  <div class="ajax-console">
21
- <div class="founded_records">
22
- <h3><span class="matches_count"><?php echo PMXE_Plugin::$session->found_posts; ?></span> <strong><?php echo wp_all_export_get_cpt_name($post['cpt']); ?></strong> will be exported</h3>
23
  <h4><?php _e("Choose data to include in the export file."); ?></h4>
24
- </div>
25
- </div>
26
  </div>
27
 
 
 
28
  <table class="wpallexport-layout wpallexport-export-template">
29
- <tr style="height: 500px;">
30
- <td class="left">
31
-
32
- <script type="text/javascript">
33
- __META_KEYS = <?php echo json_encode(array_values($existing_meta_keys)); ?>;
34
- __ACF_KEYS = <?php echo json_encode($existing_acf_meta_keys); ?>;
35
- __TAXES_KEYS = <?php echo json_encode($existing_taxonomies); ?>;
36
- __ATTR_KEYS = <?php echo json_encode($existing_attributes); ?>;
37
- __WOO_KEYS = <?php echo json_encode($woo_data); ?>;
38
- </script>
39
 
40
  <?php do_action('pmxe_template_header', $this->isWizard, $post); ?>
41
 
@@ -43,34 +37,60 @@
43
  <?php $this->error(); ?>
44
  <?php endif ?>
45
 
46
- <form class="wpallexport-template <?php echo ! $this->isWizard ? 'edit' : '' ?> wpallexport-step-3" method="post">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  <div class="wpallexport-collapsed wpallexport-section">
48
  <div class="wpallexport-content-section">
49
- <div class="wpallexport-collapsed-content">
50
- <fieldset class="optionsset" style="padding: 20px;">
51
  <div id="columns_to_export">
52
  <div class="columns-to-export-content" style="padding-right: 8px;">
53
  <ol id="columns" class="rad4">
54
  <?php
55
  $i = 0;
56
  $new_export = false;
57
- if ( ! empty($post['ids']) ){
58
- foreach ($post['ids'] as $ID => $value) {
 
 
59
  if (is_numeric($ID)){ if (empty($post['cc_name'][$ID])) continue;
60
  ?>
61
  <li>
62
- <div class="custom_column" rel="<?php echo ($i + 1);?>">
63
- <label class="wpallexport-xml-element">&lt;<?php echo (!empty($post['cc_name'][$ID])) ? $post['cc_name'][$ID] : $post['cc_label'][$ID]; ?>&gt;</label>
 
 
 
 
 
 
64
  <input type="hidden" name="ids[]" value="1"/>
65
  <input type="hidden" name="cc_label[]" value="<?php echo (!empty($post['cc_label'][$ID])) ? $post['cc_label'][$ID] : ''; ?>"/>
66
  <input type="hidden" name="cc_php[]" value="<?php echo (!empty($post['cc_php'][$ID])) ? $post['cc_php'][$ID] : 0; ?>"/>
67
  <input type="hidden" name="cc_code[]" value="<?php echo (!empty($post['cc_code'][$ID])) ? $post['cc_code'][$ID] : ''; ?>"/>
68
  <input type="hidden" name="cc_sql[]" value="<?php echo (!empty($post['cc_sql'][$ID])) ? $post['cc_sql'][$ID] : ''; ?>"/>
69
- <input type="hidden" name="cc_type[]" value="<?php echo $post['cc_type'][$ID]; ?>"/>
70
- <input type="hidden" name="cc_options[]" value="<?php echo esc_html($post['cc_options'][$ID]); ?>"/>
71
  <input type="hidden" name="cc_value[]" value="<?php echo esc_attr($post['cc_value'][$ID]); ?>"/>
72
- <input type="hidden" name="cc_name[]" value="<?php echo (!empty($post['cc_name'][$ID])) ? $post['cc_name'][$ID] : str_replace(" ", "_", $post['cc_label'][$ID]); ?>"/>
73
- <!--a href="javascript:void(0);" title="<?php _e('Delete field', 'wp_all_export_plugin'); ?>" class="icon-item remove-field"></a-->
74
  </div>
75
  </li>
76
  <?php
@@ -81,7 +101,7 @@
81
  elseif ($this->isWizard)
82
  {
83
  $new_export = true;
84
- if ( empty($post['cpt']) and ! XmlExportWooCommerceOrder::$is_active and ! XmlExportUser::$is_active ){
85
  $init_fields[] =
86
  array(
87
  'label' => 'post_type',
@@ -93,7 +113,7 @@
93
  ?>
94
  <li>
95
  <div class="custom_column" rel="<?php echo ($i + 1);?>">
96
- <label class="wpallexport-xml-element">&lt;<?php echo $field['name']; ?>&gt;</label>
97
  <input type="hidden" name="ids[]" value="1"/>
98
  <input type="hidden" name="cc_label[]" value="<?php echo $field['label']; ?>"/>
99
  <input type="hidden" name="cc_php[]" value=""/>
@@ -102,14 +122,13 @@
102
  <input type="hidden" name="cc_options[]" value="<?php echo (empty($field['options'])) ? '' : $field['options']; ?>"/>
103
  <input type="hidden" name="cc_type[]" value="<?php echo $field['type']; ?>"/>
104
  <input type="hidden" name="cc_value[]" value="<?php echo $field['label']; ?>"/>
105
- <input type="hidden" name="cc_name[]" value="<?php echo $field['name'];?>"/>
106
- <!--a href="javascript:void(0);" title="<?php _e('Delete field', 'wp_all_export_plugin'); ?>" class="icon-item remove-field"></a-->
107
  </div>
108
  </li>
109
  <?php
110
  $i++;
111
- }
112
-
113
  }
114
  ?>
115
  <li class="placeholder" <?php if ( ! empty($post['ids']) and count($post['ids']) > 1 or $new_export) echo 'style="display:none;"'; ?>><?php _e("Drag & drop data from \"Available Data\" on the right to include it in the export or click \"Add Field To Export\" below.", "wp_all_export_plugin"); ?></li>
@@ -130,79 +149,136 @@
130
  <input type="hidden" name="cc_options[]" value=""/>
131
  <input type="hidden" name="cc_value[]" value=""/>
132
  <input type="hidden" name="cc_name[]" value=""/>
133
- <!--a href="javascript:void(0);" title="<?php _e('Delete field', 'wp_all_export_plugin'); ?>" class="icon-item remove-field"></a-->
134
  </div>
135
 
136
  <!-- Warning Messages -->
137
- <?php if ( ! XmlExportWooCommerceOrder::$is_active ) : ?>
138
  <div class="wp-all-export-warning" <?php if ( empty($post['ids']) or count($post['ids']) > 1 ) echo 'style="display:none;"'; ?>>
139
- <p><?php _e("Warning: without an ID column, you won't be able to re-import this data using WP All Import.", "wp_all_export_plugin"); ?></p>
 
140
  </div>
141
  <?php endif; ?>
142
 
143
  <?php if ( XmlExportWooCommerce::$is_active ) : ?>
144
- <div class="wp-all-export-sku-warning" <?php echo 'style="display:none;"'; ?>>
145
- <p><?php _e("Warning: without _sku and product_type columns, you won't be able to re-import this data using WP All Import.", "wp_all_export_plugin"); ?></p>
146
- </div>
147
  <?php endif; ?>
148
 
149
- <?php if ( empty($post['cpt']) and ! XmlExportWooCommerceOrder::$is_active and ! XmlExportUser::$is_active ) : ?>
150
- <div class="wp-all-export-advanced-query-warning" <?php echo 'style="display:none;"'; ?>>
151
- <p><?php _e("Warning: without post_type column, you won't be able to re-import this data using WP All Import.", "wp_all_export_plugin"); ?></p>
152
- </div>
153
  <?php endif; ?>
154
-
155
- <!-- Add New Field Button -->
156
- <div class="input" style="float: left;">
157
- <input type="button" value="<?php _e('Add Field To Export', 'wp_all_export_plugin');?>" class="button-primary add_column">
158
- <?php if ( XmlExportWooCommerceOrder::$is_active ): ?>
159
- <div class="input switcher-target-export_to_csv" style="margin-top: 10px;">
160
- <input type="hidden" name="order_item_per_row" value="0"/>
161
- <input type="checkbox" id="order_item_per_row" name="order_item_per_row" value="1" <?php if ($post['order_item_per_row']):?>checked="checked"<?php endif; ?>/>
162
- <label for="order_item_per_row"><?php _e("Display each product in its own row", "wp_all_export_plugin"); ?></label>
163
- <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('If an order contains multiple products, each product will have its own row. If disabled, each product will have its own column.', 'wp_all_export_plugin'); ?>">?</a>
164
- <div class="input switcher-target-order_item_per_row" style="margin-top: 10px; padding-left: 15px;">
165
- <input type="hidden" name="order_item_fill_empty_columns" value="0"/>
166
- <input type="checkbox" id="order_item_fill_empty_columns" name="order_item_fill_empty_columns" value="1" <?php if ($post['order_item_fill_empty_columns']):?>checked="checked"<?php endif; ?>/>
167
- <label for="order_item_fill_empty_columns"><?php _e("Fill in empty columns", "wp_all_export_plugin"); ?></label>
168
- <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('If enabled, each order item will appear as its own row with all order info filled in for every column. If disabled, order info will only display on one row with only the order item info displaying in additional rows.', 'wp_all_export_plugin'); ?>">?</a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  </div>
170
- </div>
171
- <?php endif; ?>
172
- </div>
173
-
174
- <!-- Preview a Row Button -->
175
- <div class="input" style="float: right;">
176
- <input type="button" value="<?php _e('Preview A Row', 'wp_all_export_plugin');?>" class="button-primary preview_a_row">
177
- </div>
178
-
179
- <!-- Export File Format -->
180
- <div class="input wp-all-export-format">
181
- <div class="input" style="float: left; padding-bottom: 5px;">
182
- <label><?php _e("Export File Format:", "wp_all_export_plugin"); ?></label>
183
- </div>
184
- <div class="clear"></div>
185
- <div class="input">
186
- <input type="radio" id="export_to_xml" class="switcher" name="export_to" value="xml" <?php echo 'csv' != $post['export_to'] ? 'checked="checked"': '' ?>/>
187
- <label for="export_to_xml"><?php _e('XML', 'wp_all_export_plugin' )?></label><br>
188
- </div>
189
- <div class="input">
190
- <input type="radio" id="export_to_csv" class="switcher" name="export_to" value="csv" <?php echo 'csv' == $post['export_to'] ? 'checked="checked"': '' ?>/>
191
- <label for="export_to_csv"><?php _e('CSV', 'wp_all_export_plugin' )?></label>
192
- <div class="switcher-target-export_to_csv wpallexport-csv-delimiter">
193
- <div class="input" style="padding: 5px;">
194
- <label style="width: 80px;"><?php _e('Delimiter:','wp_all_export_plugin');?></label> <input type="text" name="delimiter" value="<?php echo esc_attr($post['delimiter']) ?>" />
195
  </div>
196
  </div>
197
- </div>
198
- </div>
199
- </fieldset>
200
  </div>
201
  </div>
202
  </div>
203
-
204
- <hr>
205
 
 
 
206
  <div class="input wpallexport-section" style="padding-bottom: 8px; padding-left: 8px;">
207
 
208
  <p style="margin: 11px; float: left;">
@@ -218,9 +294,9 @@
218
  <select name="load_template" id="load_template" style="padding:2px; width: auto; height: 40px;">
219
  <option value=""><?php _e('Load Template...', 'wp_all_export_plugin') ?></option>
220
  <?php foreach ($templates->getBy()->convertRecords() as $t): ?>
221
- <?php
222
  // When creating a new export you should be able to select existing saved export templates that were created for the same post type.
223
- if ( $this->isWizard and $t->options['cpt'] != $post['cpt'] ) continue;
224
  ?>
225
  <option value="<?php echo $t->id ?>"><?php echo $t->name ?></option>
226
  <?php endforeach ?>
@@ -228,7 +304,7 @@
228
  </div>
229
 
230
  </div>
231
-
232
  <hr>
233
 
234
  <div class="wpallexport-submit-buttons">
@@ -239,8 +315,10 @@
239
 
240
  <?php if ( ! $this->isWizard ): ?>
241
  <a href="<?php echo remove_query_arg('id', remove_query_arg('action', $this->baseUrl)); ?>" class="back rad3" style="float:none;"><?php _e('Back to Manage Exports', 'wp_all_export_plugin') ?></a>
 
 
242
  <?php endif; ?>
243
- <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e( ($this->isWizard) ? 'Continue to Step 3' : 'Update Template', 'wp_all_export_plugin') ?>" />
244
  </div>
245
 
246
  </div>
@@ -251,19 +329,13 @@
251
 
252
  </td>
253
 
254
- <td class="right template-sidebar">
255
 
256
  <fieldset id="available_data" class="optionsset rad4">
257
 
258
  <div class="title"><?php _e('Available Data', 'wp_all_export_plugin'); ?></div>
259
 
260
- <div class="wpallexport-xml resetable">
261
-
262
- <?php if ( XmlExportWooCommerce::$is_active ) : ?>
263
-
264
- <a href="javascript:void(0);" id="wp_all_export_auto_generate_data" class="rad4"><?php _e('Auto Generate', 'wp_all_export_plugin'); ?></a>
265
-
266
- <?php endif; ?>
267
 
268
  <ul>
269
 
@@ -276,32 +348,15 @@
276
  </fieldset>
277
  </td>
278
  </tr>
 
279
  </table>
280
 
281
  <fieldset class="optionsset column rad4 wp-all-export-edit-column">
282
 
283
  <div class="title"><span class="wpallexport-add-row-title"><?php _e('Add Field To Export','wp_all_export_plugin');?></span><span class="wpallexport-edit-row-title"><?php _e('Edit Export Field','wp_all_export_plugin');?></span></div>
284
 
285
- <?php
286
-
287
- if ( XmlExportEngine::$is_user_export )
288
- {
289
- include_once 'template/new_field_user.php';
290
- }
291
- else
292
- {
293
- if ( in_array('shop_order', XmlExportEngine::$post_types))
294
- {
295
- include_once 'template/new_field_shop_order.php';
296
- }
297
- else
298
- {
299
- include_once 'template/new_field_cpt.php';
300
- }
301
- }
302
-
303
- ?>
304
-
305
  </fieldset>
306
 
307
  <div class="wpallexport-overlay"></div>
16
 
17
  <div class="clear"></div>
18
 
19
+ <div class="wpallexport-content-section wpallexport-console" style="display: block; margin-bottom: 10px;">
20
  <div class="ajax-console">
21
+ <div class="founded_records">
22
+ <div class="wp_all_export_preloader"></div>
23
  <h4><?php _e("Choose data to include in the export file."); ?></h4>
24
+ </div>
25
+ </div>
26
  </div>
27
 
28
+ <?php XmlExportFiltering::render_filtering_block( $engine, $this->isWizard, $post, true ); ?>
29
+
30
  <table class="wpallexport-layout wpallexport-export-template">
31
+ <tr>
32
+ <td class="left">
 
 
 
 
 
 
 
 
33
 
34
  <?php do_action('pmxe_template_header', $this->isWizard, $post); ?>
35
 
37
  <?php $this->error(); ?>
38
  <?php endif ?>
39
 
40
+ <form class="wpallexport-template <?php echo ! $this->isWizard ? 'edit' : '' ?> wpallexport-step-3" method="post" style="display:none;">
41
+
42
+ <?php
43
+ $selected_post_type = '';
44
+ if (XmlExportUser::$is_active):
45
+ $selected_post_type = empty($post['cpt'][0]) ? 'users' : $post['cpt'][0];
46
+ endif;
47
+ if (XmlExportComment::$is_active):
48
+ $selected_post_type = 'comments';
49
+ endif;
50
+ if (empty($selected_post_type) and ! empty($post['cpt'][0]))
51
+ {
52
+ $selected_post_type = $post['cpt'][0];
53
+ }
54
+ ?>
55
+
56
+ <input type="hidden" name="selected_post_type" value="<?php echo $selected_post_type; ?>"/>
57
+ <input type="hidden" name="export_type" value="<?php echo $post['export_type']; ?>"/>
58
+
59
  <div class="wpallexport-collapsed wpallexport-section">
60
  <div class="wpallexport-content-section">
61
+ <div class="wpallexport-collapsed-content" style="padding-bottom: 60px;">
62
+ <fieldset class="optionsset" style="padding: 10px 20px;">
63
  <div id="columns_to_export">
64
  <div class="columns-to-export-content" style="padding-right: 8px;">
65
  <ol id="columns" class="rad4">
66
  <?php
67
  $i = 0;
68
  $new_export = false;
69
+ if ( ! empty($post['ids']) )
70
+ {
71
+ foreach ($post['ids'] as $ID => $value)
72
+ {
73
  if (is_numeric($ID)){ if (empty($post['cc_name'][$ID])) continue;
74
  ?>
75
  <li>
76
+ <div class="custom_column" rel="<?php echo ($i + 1);?>">
77
+ <?php
78
+ $field_label = (!empty($post['cc_name'][$ID])) ? $post['cc_name'][$ID] : $post['cc_label'][$ID];
79
+ $field_name = (!empty($post['cc_name'][$ID])) ? $post['cc_name'][$ID] : trim(str_replace(" ", "_", $post['cc_label'][$ID]));
80
+ $field_type = $post['cc_type'][$ID];
81
+ $field_options = esc_html($post['cc_options'][$ID]);
82
+ ?>
83
+ <label class="wpallexport-xml-element"><?php echo (strtolower($field_label) == "id") ? "ID" : $field_label; ?></label>
84
  <input type="hidden" name="ids[]" value="1"/>
85
  <input type="hidden" name="cc_label[]" value="<?php echo (!empty($post['cc_label'][$ID])) ? $post['cc_label'][$ID] : ''; ?>"/>
86
  <input type="hidden" name="cc_php[]" value="<?php echo (!empty($post['cc_php'][$ID])) ? $post['cc_php'][$ID] : 0; ?>"/>
87
  <input type="hidden" name="cc_code[]" value="<?php echo (!empty($post['cc_code'][$ID])) ? $post['cc_code'][$ID] : ''; ?>"/>
88
  <input type="hidden" name="cc_sql[]" value="<?php echo (!empty($post['cc_sql'][$ID])) ? $post['cc_sql'][$ID] : ''; ?>"/>
89
+ <input type="hidden" name="cc_type[]" value="<?php echo $field_type; ?>"/>
90
+ <input type="hidden" name="cc_options[]" value="<?php echo $field_options; ?>"/>
91
  <input type="hidden" name="cc_value[]" value="<?php echo esc_attr($post['cc_value'][$ID]); ?>"/>
92
+ <input type="hidden" name="cc_name[]" value="<?php echo (strtoupper($field_name) == "ID") ? "id" : $field_name; ?>"/>
93
+ <input type="hidden" name="cc_settings[]" value="<?php echo (!empty($post['cc_settings'][$ID])) ? esc_attr($post['cc_settings'][$ID]) : ''; ?>"/>
94
  </div>
95
  </li>
96
  <?php
101
  elseif ($this->isWizard)
102
  {
103
  $new_export = true;
104
+ if ( empty($post['cpt']) and ! XmlExportWooCommerceOrder::$is_active and ! XmlExportUser::$is_active and ! XmlExportComment::$is_active ){
105
  $init_fields[] =
106
  array(
107
  'label' => 'post_type',
113
  ?>
114
  <li>
115
  <div class="custom_column" rel="<?php echo ($i + 1);?>">
116
+ <label class="wpallexport-xml-element"><?php echo $field['name']; ?></label>
117
  <input type="hidden" name="ids[]" value="1"/>
118
  <input type="hidden" name="cc_label[]" value="<?php echo $field['label']; ?>"/>
119
  <input type="hidden" name="cc_php[]" value=""/>
122
  <input type="hidden" name="cc_options[]" value="<?php echo (empty($field['options'])) ? '' : $field['options']; ?>"/>
123
  <input type="hidden" name="cc_type[]" value="<?php echo $field['type']; ?>"/>
124
  <input type="hidden" name="cc_value[]" value="<?php echo $field['label']; ?>"/>
125
+ <input type="hidden" name="cc_name[]" value="<?php echo (strtoupper($field['name']) == 'ID') ? 'id' : $field['name'];?>"/>
126
+ <input type="hidden" name="cc_settings[]" value=""/>
127
  </div>
128
  </li>
129
  <?php
130
  $i++;
131
+ }
 
132
  }
133
  ?>
134
  <li class="placeholder" <?php if ( ! empty($post['ids']) and count($post['ids']) > 1 or $new_export) echo 'style="display:none;"'; ?>><?php _e("Drag & drop data from \"Available Data\" on the right to include it in the export or click \"Add Field To Export\" below.", "wp_all_export_plugin"); ?></li>
149
  <input type="hidden" name="cc_options[]" value=""/>
150
  <input type="hidden" name="cc_value[]" value=""/>
151
  <input type="hidden" name="cc_name[]" value=""/>
152
+ <input type="hidden" name="cc_settings[]" value=""/>
153
  </div>
154
 
155
  <!-- Warning Messages -->
156
+ <?php if ( ! XmlExportWooCommerceOrder::$is_active && ! XmlExportComment::$is_active ) : ?>
157
  <div class="wp-all-export-warning" <?php if ( empty($post['ids']) or count($post['ids']) > 1 ) echo 'style="display:none;"'; ?>>
158
+ <p></p>
159
+ <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"); ?>"/>
160
  </div>
161
  <?php endif; ?>
162
 
163
  <?php if ( XmlExportWooCommerce::$is_active ) : ?>
164
+ <input type="hidden" id="is_product_export" value="1"/>
 
 
165
  <?php endif; ?>
166
 
167
+ <?php if ( empty($post['cpt']) and ! XmlExportWooCommerceOrder::$is_active and ! XmlExportUser::$is_active and ! XmlExportComment::$is_active ) : ?>
168
+ <input type="hidden" id="is_wp_query" value="1"/>
 
 
169
  <?php endif; ?>
170
+
171
+ </fieldset>
172
+
173
+ <!-- Add New Field Button -->
174
+ <div class="input" style="float:left; margin: 0 20px 15px;">
175
+ <input type="button" value="<?php _e('Add Field', 'wp_all_export_plugin');?>" class="add_column" style="float:left;">
176
+ <input type="button" value="<?php _e('Add All Fields', 'wp_all_export_plugin'); ?>" class="wp_all_export_auto_generate_data">
177
+ </div>
178
+
179
+ <!-- Preview a Row Button -->
180
+ <div class="input" style="float:right; margin: 0 20px 15px;">
181
+ <input type="button" value="<?php _e('Preview', 'wp_all_export_plugin');?>" class="preview_a_row">
182
+ </div>
183
+ </div>
184
+ </div>
185
+ </div>
186
+
187
+ <div class="wpallexport-collapsed wpallexport-section wpallexport-file-options closed" style="margin-top: -10px;">
188
+ <div class="wpallexport-content-section" style="padding-bottom: 15px; margin-bottom: 10px;">
189
+ <div class="wpallexport-collapsed-header" style="padding-left: 25px;">
190
+ <h3><?php _e('Export File Options','wp_all_export_plugin');?></h3>
191
+ </div>
192
+ <div class="wpallexport-collapsed-content" style="padding: 0; overflow: hidden; height: auto;">
193
+ <div class="wpallexport-collapsed-content-inner">
194
+ <div class="wpallexport-choose-data-type">
195
+ <h3 style="margin-top: 10px; margin-bottom: 40px;"><?php _e('Choose your export file type', 'wp_all_export_plugin'); ?></h3>
196
+ <a href="javascript:void(0);" class="wpallexport-import-to-format rad4 wpallexport-csv-type <?php if ($post['export_to'] != 'xml') echo 'selected'; ?>">
197
+ <span class="wpallexport-import-to-title"><?php _e('Spreadsheet', 'wp_all_export_plugin'); ?></span>
198
+ <span class="wpallexport-import-to-arrow"></span>
199
+ </a>
200
+ <a href="javascript:void(0);" class="wpallexport-import-to-format rad4 wpallexport-xml-type <?php if ($post['export_to'] == 'xml') echo 'selected'; ?>" style="margin-right:0;">
201
+ <span class="wpallexport-import-to-title"><?php _e('XML Feed', 'wp_all_export_plugin'); ?></span>
202
+ <span class="wpallexport-import-to-arrow"></span>
203
+ </a>
204
+ </div>
205
+
206
+ <div class="wpallexport-all-options">
207
+
208
+ <input type="hidden" name="export_to" value="<?php echo $post['export_to']; ?>"/>
209
+
210
+ <div class="wpallexport-file-format-options">
211
+
212
+ <div class="wpallexport-csv-options" <?php if ($post['export_to'] == 'xml') echo 'style="display:none;"'; ?>>
213
+ <!-- Export File Format -->
214
+ <div class="input wp-all-export-format">
215
+ <div class="input" style="float: left; padding-bottom: 5px; width: 100%;">
216
+ <div class="input" style="float: left; margin-right: 20px; height: 35px; vertical-align: middle;">
217
+ <label style="margin-right:10px;"><?php _e("File Format:", "wp_all_export_plugin"); ?></label>
218
+ <input type="radio" id="export_to_xls" class="switcher" name="export_to_sheet" value="xls" <?php echo 'xls' == $post['export_to_sheet'] ? 'checked="checked"': '' ?>/>
219
+ <label for="export_to_xls"><?php _e('XLS', 'wp_all_export_plugin' )?></label>
220
+ </div>
221
+ <div class="input" style="float:left; height: 35px; vertical-align: middle;">
222
+ <input type="radio" id="export_to_csv" class="switcher" name="export_to_sheet" value="csv" <?php echo 'csv' == $post['export_to_sheet'] ? 'checked="checked"': '' ?>/>
223
+ <label for="export_to_csv"><?php _e('CSV', 'wp_all_export_plugin' )?></label>
224
+ </div>
225
+ <div class="input switcher-target-export_to_csv" style="float: left; vertical-align:middle; height: 35px; position: relative; top: -6px;">
226
+ <label style="width: 80px; margin-left: 20px;"><?php _e('Separator:','wp_all_export_plugin');?></label>
227
+ <input type="text" name="delimiter" value="<?php echo esc_attr($post['delimiter']) ?>" style="width: 40px; height: 30px; top: 0px; text-align: center;"/>
228
+ </div>
229
+ <div class="wpallexport-clear"></div>
230
+ <div class="input switcher-target-export_to_xls" style="vertical-align:middle; height: 35px; position: relative; top: -13px;">
231
+ <span class="wpallexport-free-edition-notice">
232
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=wooco+orders&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to export to Excel. <br>If you already own it, remove the free edition and install the professional edition.','wp_all_export_plugin');?></a>
233
+ </span>
234
+ </div>
235
+ </div>
236
+ <div class="clear"></div>
237
+ </div>
238
+ <!-- Display each product in its own row -->
239
+ <?php if ( XmlExportWooCommerceOrder::$is_active ): ?>
240
+ <div class="input" style="float: left;">
241
+ <input type="hidden" name="order_item_per_row" value="0"/>
242
+ <input type="checkbox" id="order_item_per_row" name="order_item_per_row" value="1" <?php if ($post['order_item_per_row']):?>checked="checked"<?php endif; ?> class="switcher"/>
243
+ <label for="order_item_per_row"><?php _e("Display each product in its own row", "wp_all_export_plugin"); ?></label>
244
+ <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('If an order contains multiple products, each product will have its own row. If disabled, each product will have its own column.', 'wp_all_export_plugin'); ?>">?</a>
245
+ <div class="input switcher-target-order_item_per_row" style="margin-top: 10px; padding-left: 15px;">
246
+ <input type="hidden" name="order_item_fill_empty_columns" value="0"/>
247
+ <input type="checkbox" id="order_item_fill_empty_columns" name="order_item_fill_empty_columns" value="1" <?php if ($post['order_item_fill_empty_columns']):?>checked="checked"<?php endif; ?>/>
248
+ <label for="order_item_fill_empty_columns"><?php _e("Fill in empty columns", "wp_all_export_plugin"); ?></label>
249
+ <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('If enabled, each order item will appear as its own row with all order info filled in for every column. If disabled, order info will only display on one row with only the order item info displaying in additional rows.', 'wp_all_export_plugin'); ?>">?</a>
250
+ </div>
251
+ </div>
252
+ <?php endif; ?>
253
  </div>
254
+
255
+ <div class="wpallexport-xml-options" <?php if ($post['export_to'] != 'xml') echo 'style="display:none;"'; ?>>
256
+
257
+ <div class="input" style="display: inline-block; max-width: 360px; width: 40%; margin-right: 10px;">
258
+ <label for="main_xml_tag" style="float: left;"><?php _e('Root XML Element','wp_all_export_plugin');?></label>
259
+ <div class="input">
260
+ <input type="text" name="main_xml_tag" style="vertical-align:middle; background:#fff !important; width: 100%;" value="<?php echo esc_attr($post['main_xml_tag']) ?>" />
261
+ </div>
262
+ </div>
263
+ <div class="input" style="display: inline-block; max-width: 360px; width: 40%; ">
264
+ <?php
265
+ $post_type_details = ( ! empty($post['cpt'])) ? get_post_type_object( $post['cpt'][0] ) : '';
266
+ ?>
267
+ <label for="record_xml_tag" style="float: left;"><?php printf(__('Single %s XML Element','wp_all_export_plugin'), empty($post_type_details) ? 'Record' : $post_type_details->labels->singular_name); ?></label>
268
+ <div class="input">
269
+ <input type="text" name="record_xml_tag" style="vertical-align:middle; background:#fff !important; width: 100%;" value="<?php echo esc_attr($post['record_xml_tag']) ?>" />
270
+ </div>
 
 
 
 
 
 
 
 
271
  </div>
272
  </div>
273
+ </div>
274
+ </div>
275
+ </div>
276
  </div>
277
  </div>
278
  </div>
 
 
279
 
280
+ <hr>
281
+
282
  <div class="input wpallexport-section" style="padding-bottom: 8px; padding-left: 8px;">
283
 
284
  <p style="margin: 11px; float: left;">
294
  <select name="load_template" id="load_template" style="padding:2px; width: auto; height: 40px;">
295
  <option value=""><?php _e('Load Template...', 'wp_all_export_plugin') ?></option>
296
  <?php foreach ($templates->getBy()->convertRecords() as $t): ?>
297
+ <?php
298
  // When creating a new export you should be able to select existing saved export templates that were created for the same post type.
299
+ if ( $t->options['cpt'] != $post['cpt'] ) continue;
300
  ?>
301
  <option value="<?php echo $t->id ?>"><?php echo $t->name ?></option>
302
  <?php endforeach ?>
304
  </div>
305
 
306
  </div>
307
+
308
  <hr>
309
 
310
  <div class="wpallexport-submit-buttons">
315
 
316
  <?php if ( ! $this->isWizard ): ?>
317
  <a href="<?php echo remove_query_arg('id', remove_query_arg('action', $this->baseUrl)); ?>" class="back rad3" style="float:none;"><?php _e('Back to Manage Exports', 'wp_all_export_plugin') ?></a>
318
+ <?php else: ?>
319
+ <a href="<?php echo add_query_arg('action', 'index', $this->baseUrl); ?>" class="back rad3"><?php _e('Back', 'wp_all_export_plugin') ?></a>
320
  <?php endif; ?>
321
+ <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e( ($this->isWizard) ? 'Continue' : 'Update Template', 'wp_all_export_plugin') ?>" />
322
  </div>
323
 
324
  </div>
329
 
330
  </td>
331
 
332
+ <td class="right template-sidebar" style="position: relative; width: 18%; right: 0px; padding: 0;">
333
 
334
  <fieldset id="available_data" class="optionsset rad4">
335
 
336
  <div class="title"><?php _e('Available Data', 'wp_all_export_plugin'); ?></div>
337
 
338
+ <div class="wpallexport-xml resetable">
 
 
 
 
 
 
339
 
340
  <ul>
341
 
348
  </fieldset>
349
  </td>
350
  </tr>
351
+
352
  </table>
353
 
354
  <fieldset class="optionsset column rad4 wp-all-export-edit-column">
355
 
356
  <div class="title"><span class="wpallexport-add-row-title"><?php _e('Add Field To Export','wp_all_export_plugin');?></span><span class="wpallexport-edit-row-title"><?php _e('Edit Export Field','wp_all_export_plugin');?></span></div>
357
 
358
+ <?php include_once 'template/add_new_field.php'; ?>
359
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  </fieldset>
361
 
362
  <div class="wpallexport-overlay"></div>
views/admin/export/template/add_new_field.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <form>
2
+ <div class="wp-all-export-field-options">
3
+ <div class="input" style="margin-bottom:10px;">
4
+ <label for="column_value_default" style="padding:4px; display: block;"><?php _e('What field would you like to export?', 'wp_all_export_plugin' )?></label>
5
+ <div class="clear"></div>
6
+ <?php echo $available_fields_view; ?>
7
+ </div>
8
+
9
+ <div class="input">
10
+ <label style="padding:4px; display: block;"><?php _e('What would you like to name the column/element in your exported file?','wp_all_export_plugin');?></label>
11
+ <div class="clear"></div>
12
+ <input type="text" class="column_name" value="" style="width:50%"/>
13
+ </div>
14
+
15
+ <a href="javascript:void(0);" class="wp-all-export-advanced-field-options"><span>+</span> <?php _e("Advanced", 'wp_all_export_plugin'); ?></a>
16
+
17
+ <!-- Advanced Field Options -->
18
+
19
+ <?php include_once 'advanced_field_options.php'; ?>
20
+
21
+ </div>
22
+ <div class="input wp-all-export-edit-column-buttons">
23
+ <input type="button" class="delete_action" value="<?php _e("Delete", "wp_all_export_plugin"); ?>" style="border: none;"/>
24
+ <input type="button" class="save_action" value="<?php _e("Done", "wp_all_export_plugin"); ?>" style="border: none;"/>
25
+ <input type="button" class="close_action" value="<?php _e("Close", "wp_all_export_plugin"); ?>" style="border: none;"/>
26
+ </div>
27
+ </form>
views/admin/export/template/advanced_field_options.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wp-all-export-advanced-field-options-content">
2
+ <!-- Options for SQL field -->
3
+ <div class="input cc_field sql_field_type">
4
+ <a href="#help" rel="sql" class="help" style="display:none;" title="<?php _e('%%ID%% will be replaced with the ID of the post being exported, example: SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND meta_key=\'your_meta_key\';', 'wp_all_export_plugin'); ?>">?</a>
5
+ <textarea style="width:100%;" rows="5" class="column_value"></textarea>
6
+ </div>
7
+ <!-- Options for ACF Repeater field -->
8
+ <div class="input cc_field repeater_field_type">
9
+ <input type="hidden" name="repeater_field_item_per_line" value="0"/>
10
+ <input type="checkbox" id="repeater_field_item_per_line" class="switcher" name="repeater_field_item_per_line" value="1" style="margin: 2px;"/>
11
+ <label for="repeater_field_item_per_line"><?php _e("Display each repeater row in its own csv line", "wp_all_export_plugin"); ?></label>
12
+ <div class="input switcher-target-repeater_field_item_per_line" style="margin-top: 10px; padding-left: 15px;">
13
+ <input type="hidden" name="repeater_field_fill_empty_columns" value="0"/>
14
+ <input type="checkbox" id="repeater_field_fill_empty_columns" name="repeater_field_fill_empty_columns" value="1"/>
15
+ <label for="repeater_field_fill_empty_columns"><?php _e("Fill in empty columns", "wp_all_export_plugin"); ?></label>
16
+ <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('If enabled, each repeater row will appear as its own csv line with all post info filled in for every column.', 'wp_all_export_plugin'); ?>">?</a>
17
+ </div>
18
+ </div>
19
+ <!-- Options for Image field from Media section -->
20
+ <div class="input cc_field image_field_type">
21
+ <div class="input">
22
+ <input type="hidden" name="image_field_is_export_featured" value="0"/>
23
+ <input type="checkbox" id="is_image_export_featured" name="image_field_is_export_featured" value="1" style="margin: 2px;" checked="checked"/>
24
+ <label for="is_image_export_featured"><?php _e("Export featured image", "wp_all_export_plugin"); ?></label>
25
+ </div>
26
+ <div class="input">
27
+ <input type="hidden" name="image_field_is_export_attached_images" value="0"/>
28
+ <input type="checkbox" id="is_image_export_attached_images" class="switcher" name="image_field_is_export_attached_images" value="1" style="margin: 2px;" checked="checked"/>
29
+ <label for="is_image_export_attached_images"><?php _e("Export attached images", "wp_all_export_plugin"); ?></label>
30
+ <div class="switcher-target-is_image_export_attached_images" style="margin: 5px 2px;">
31
+ <label><?php _e("Separator", "wp_all_export_plugin"); ?></label>
32
+ <input type="text" name="image_field_separator" value="|" style="width: 40px; text-align:center;">
33
+ </div>
34
+ </div>
35
+ </div>
36
+ <!-- Options for Date field -->
37
+ <div class="input cc_field date_field_type">
38
+ <select class="date_field_export_data" style="width: 100%; height: 30px;">
39
+ <option value="unix"><?php _e("UNIX timestamp - PHP time()", "wp_all_export_plugin");?></option>
40
+ <option value="php"><?php _e("Natural Language PHP date()", "wp_all_export_plugin");?></option>
41
+ </select>
42
+ <div class="input pmxe_date_format_wrapper">
43
+ <label><?php _e("date() Format", "wp_all_export_plugin"); ?></label>
44
+ <br>
45
+ <input type="text" class="pmxe_date_format" value="" placeholder="Y-m-d H:i:s" style="width: 100%;"/>
46
+ </div>
47
+ </div>
48
+ <!-- Options for Up/Cross sells products -->
49
+ <div class="input cc_field linked_field_type">
50
+ <select class="linked_field_export_data" style="width: 100%; height: 30px;">
51
+ <option value="sku"><?php _e("Product SKU", "wp_all_export_plugin");?></option>
52
+ <option value="id"><?php _e("Product ID", "wp_all_export_plugin");?></option>
53
+ <option value="name"><?php _e("Product Name", "wp_all_export_plugin");?></option>
54
+ </select>
55
+ </div>
56
+ <!-- PHP snippet options -->
57
+ <div class="input php_snipped" style="margin-top:10px;">
58
+ <input type="checkbox" id="coperate_php" name="coperate_php" value="1" class="switcher" style="margin: 2px;"/>
59
+ <label for="coperate_php"><?php _e("Export the value returned by a PHP function", "wp_all_export_plugin"); ?></label>
60
+ <a href="#help" class="wpallexport-help" title="<?php _e('The value of the field chosen for export will be passed to the PHP function.', 'wp_all_export_plugin'); ?>" style="top: 0;">?</a>
61
+ <div class="switcher-target-coperate_php" style="margin-top:5px;">
62
+ <div class="wpallexport-free-edition-notice" style="margin: 15px 0;">
63
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=custom-php&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to enable custom PHP functions.','wp_all_export_plugin');?></a>
64
+ </div>
65
+ <?php echo "&lt;?php ";?>
66
+ <input type="text" class="php_code" value="" style="width:50%;" placeholder='your_function_name'/>
67
+ <?php echo "(\$value); ?&gt;"; ?>
68
+
69
+ <?php
70
+ $uploads = wp_upload_dir();
71
+ $functions = $uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
72
+ ?>
73
+
74
+ <div class="input" style="margin-top: 10px;">
75
+
76
+ <h4><?php _e('Function Editor', 'wp_all_export_plugin');?><a href="#help" class="wpallexport-help" title="<?php printf(__("Add functions here for use during your export. You can access this file at %s", "wp_all_export_plugin"), preg_replace("%.*wp-content%", "wp-content", $functions));?>" style="top: 0;">?</a></h4>
77
+
78
+ </div>
79
+
80
+ <textarea id="wp_all_export_code" name="wp_all_export_code"><?php echo "<?php\n\n?>";?></textarea>
81
+
82
+ <div class="input" style="margin-top: 10px;">
83
+
84
+ <div class="input" style="display:inline-block; margin-right: 20px;">
85
+ <input type="button" class="button-primary wp_all_export_save_functions" disabled="disabled" value="<?php _e("Save Functions", 'wp_all_export_plugin'); ?>"/>
86
+ <div class="wp_all_export_functions_preloader"></div>
87
+ </div>
88
+ <div class="input wp_all_export_saving_status" style="display:inline-block;"></div>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ </div>
views/admin/export/template/new_field_cpt.php DELETED
@@ -1,151 +0,0 @@
1
- <form>
2
- <div class="wp-all-export-field-options">
3
- <div class="input" style="margin-bottom:10px;">
4
- <label for="column_value_default" style="padding:4px; display: block;"><?php _e('What field would you like to export?', 'wp_all_export_plugin' )?></label>
5
- <div class="clear"></div>
6
- <select class="wp-all-export-chosen-select" name="column_value_type" style="width:350px;">
7
- <optgroup label="Standard">
8
- <option value="id"><?php _e("ID", "wp_all_export_plugin"); ?></option>
9
- <option value="title"><?php _e("Title", "wp_all_export_plugin"); ?></option>
10
- <option value="content"><?php _e("Content", "wp_all_export_plugin"); ?></option>
11
- <option value="excerpt"><?php _e("Excerpt", "wp_all_export_plugin"); ?></option>
12
- <option value="date"><?php _e("Date", "wp_all_export_plugin"); ?></option>
13
- <option value="post_type"><?php _e("Post Type", "wp_all_export_plugin"); ?></option>
14
- <option value="cats"><?php _e("Categories / Taxonomies", "wp_all_export_plugin"); ?></option>
15
- <option value="cf"><?php _e("Custom Field / Post Meta", "wp_all_export_plugin"); ?></option>
16
- <option value="media"><?php _e("Images / Media", "wp_all_export_plugin"); ?></option>
17
- <option value="attachments"><?php _e("Attachment", "wp_all_export_plugin"); ?></option>
18
- </optgroup>
19
- <optgroup label="Other">
20
- <option value="status"><?php _e("Post Status", "wp_all_export_plugin"); ?></option>
21
- <option value="author"><?php _e("Author", "wp_all_export_plugin"); ?></option>
22
- <option value="slug"><?php _e("Post Slug", "wp_all_export_plugin"); ?></option>
23
- <option value="format"><?php _e("Post Format", "wp_all_export_plugin"); ?></option>
24
- <option value="template"><?php _e("Template", "wp_all_export_plugin"); ?></option>
25
- <option value="parent"><?php _e("Parent", "wp_all_export_plugin"); ?></option>
26
- <option value="order"><?php _e("Menu Order", "wp_all_export_plugin"); ?></option>
27
- <option value="permalink"><?php _e("Permalink", "wp_all_export_plugin"); ?></option>
28
- </optgroup>
29
- <?php if ( class_exists( 'acf' ) or class_exists('WooCommerce')) : ?>
30
- <optgroup label="Integrations">
31
- <?php if ( class_exists('WooCommerce') and (empty($post['cpt']) or in_array('product', $post['cpt']))) : ?>
32
- <option value="woo"><?php _e("WooCommerce Data", "wp_all_export_plugin"); ?></option>
33
- <option value="attr"><?php _e("WooCommerce Taxonomies", "wp_all_export_plugin"); ?></option>
34
- <?php endif; ?>
35
- <?php if ( class_exists('WooCommerce') and (empty($post['cpt']) or in_array('shop_order', $post['cpt']))) : ?>
36
- <option value="woo_order"><?php _e("WooCommerce Order", "wp_all_export_plugin"); ?></option>
37
- <?php endif; ?>
38
- <?php if ( class_exists( 'acf' ) and ! empty($acf_groups) ) : ?>
39
- <option value="acf"><?php _e("Advanced Custom Fields", "wp_all_export_plugin"); ?></option>
40
- <?php endif; ?>
41
- </optgroup>
42
- <?php endif; ?>
43
- <optgroup label="Advanced">
44
- <option value="sql"><?php _e("SQL Query", "wp_all_export_plugin"); ?></option>
45
- </optgroup>
46
- </select>
47
- </div>
48
-
49
- <input type="hidden" name="export_data_type" value="cpt"/>
50
-
51
- <div class="input cc_field cf_field_type" style="margin-left: 20px; margin-bottom: 10px;">
52
- <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
53
- <input type="text" class="cf_direct_value autocomplete" value="" style="width:50%;"/>
54
- </div>
55
- <div class="input cc_field acf_field_type" style="margin-left: 20px; margin-bottom: 10px;">
56
- <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
57
- <input type="text" class="acf_direct_value autocomplete" value="" style="width:50%;"/>
58
- </div>
59
- <div class="input cc_field woo_field_type" style="margin-left: 20px; margin-bottom: 10px;">
60
- <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
61
- <input type="text" class="woo_direct_value autocomplete" value="" style="width:50%;"/>
62
- </div>
63
- <div class="input cc_field attr_field_type" style="margin-left: 20px; margin-bottom: 10px;">
64
- <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
65
- <input type="text" class="attr_direct_value autocomplete" value="" style="width:50%;"/>
66
- </div>
67
- <div class="input cc_field cats_field_type" style="margin-left: 20px; margin-bottom: 10px;">
68
- <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
69
- <input type="text" class="cats_direct_value autocomplete" value="" style="width:50%;"/>
70
- </div>
71
-
72
- <div class="input">
73
- <label style="padding:4px; display: block;"><?php _e('What would you like to name the column/element in your exported file?','wp_all_export_plugin');?></label>
74
- <div class="clear"></div>
75
- <input type="text" class="column_name" value="" style="width:50%"/>
76
- </div>
77
-
78
- <a href="javascript:void(0);" class="wp-all-export-advanced-field-options"><span>+</span> <?php _e("Advanced", 'wp_all_export_plugin'); ?></a>
79
-
80
- <div class="wp-all-export-advanced-field-options-content">
81
- <div class="input cc_field sql_field_type">
82
- <a href="#help" rel="sql" class="help" style="display:none;" title="<?php _e('%%ID%% will be replaced with the ID of the post being exported, example: SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND meta_key=\'your_meta_key\';', 'wp_all_export_plugin'); ?>">?</a>
83
- <textarea style="width:100%;" rows="5" class="column_value"></textarea>
84
- </div>
85
- <div class="input cc_field media_field_type">
86
- <select class="media_field_export_data">
87
- <option value="urls"><?php _e("Export Image URLs", "wp_all_export_plugin");?></option>
88
- <option value="filenames"><?php _e("Export Image Filenames", "wp_all_export_plugin");?></option>
89
- <option value="filepaths"><?php _e("Export Image File Paths", "wp_all_export_plugin");?></option>
90
- </select>
91
- </div>
92
- <div class="input cc_field date_field_type">
93
- <select class="date_field_export_data" style="width: 100%; height: 30px;">
94
- <option value="unix"><?php _e("UNIX timestamp - PHP time()", "wp_all_export_plugin");?></option>
95
- <option value="php"><?php _e("Natural Language PHP date()", "wp_all_export_plugin");?></option>
96
- </select>
97
- <div class="input pmxe_date_format_wrapper">
98
- <label><?php _e("date() Format", "wp_all_export_plugin"); ?></label>
99
- <br>
100
- <input type="text" class="pmxe_date_format" value="" placeholder="Y-m-d H:i:s" style="width: 100%;"/>
101
- </div>
102
- </div>
103
- <div class="input php_snipped" style="margin-top:10px;">
104
- <input type="checkbox" id="coperate_php" name="coperate_php" value="1" class="switcher" style="float: left; margin: 2px;"/>
105
- <label for="coperate_php"><?php _e("Export the value returned by a PHP function", "wp_all_export_plugin"); ?></label>
106
- <a href="#help" class="wpallexport-help" title="<?php _e('The value of the field chosen for export will be passed to the PHP function.', 'wp_all_export_plugin'); ?>" style="top: 0;">?</a>
107
- <div class="switcher-target-coperate_php" style="margin-top:5px;">
108
- <div class="wpallexport-free-edition-notice" style="margin: 15px 0;">
109
- <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=custom-php&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to enable custom PHP functions.','wp_all_export_plugin');?></a>
110
- </div>
111
-
112
- <?php echo "&lt;?php ";?>
113
- <input type="text" class="php_code" value="" style="width:50%;" placeholder='your_function_name'/>
114
- <?php echo "(\$value); ?&gt;"; ?>
115
-
116
- <?php
117
- $uploads = wp_upload_dir();
118
- $functions = $uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
119
- ?>
120
-
121
- <div class="input" style="margin-top: 10px;">
122
-
123
- <h4><?php _e('Function Editor', 'wp_all_export_plugin');?><a href="#help" class="wpallexport-help" title="<?php printf(__("Add functions here for use during your export. You can access this file at %s", "wp_all_export_plugin"), preg_replace("%.*wp-content%", "wp-content", $functions));?>" style="top: 0;">?</a></h4>
124
-
125
- </div>
126
-
127
- <textarea id="wp_all_export_code" name="wp_all_export_code"><?php echo "<?php\n\n?>";?></textarea>
128
-
129
- <div class="input" style="margin-top: 10px;">
130
-
131
- <div class="input" style="display:inline-block; margin-right: 20px;">
132
- <input type="button" class="button-primary wp_all_export_save_functions" disabled="disabled" value="<?php _e("Save Functions", 'wp_all_export_plugin'); ?>"/>
133
- <div class="wp_all_export_functions_preloader"></div>
134
- </div>
135
- <div class="input wp_all_export_saving_status" style="display:inline-block;">
136
-
137
- </div>
138
-
139
- </div>
140
- </div>
141
- </div>
142
- </div>
143
- </div>
144
- <br>
145
- <div class="input wp-all-export-edit-column-buttons">
146
- <input type="button" class="delete_action" value="<?php _e("Delete", "wp_all_export_plugin"); ?>" style="border: none;"/>
147
- <input type="button" class="save_action" value="<?php _e("Done", "wp_all_export_plugin"); ?>" style="border: none;"/>
148
- <input type="button" class="close_action" value="<?php _e("Close", "wp_all_export_plugin"); ?>" style="border: none;"/>
149
- </div>
150
-
151
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/export/template/new_field_shop_order.php DELETED
@@ -1,98 +0,0 @@
1
- <form>
2
- <div class="wp-all-export-field-options">
3
- <div class="input" style="margin-bottom:10px;">
4
- <label for="column_value_default" style="padding:4px; display: block;"><?php _e('What field would you like to export?', 'wp_all_export_plugin' )?></label>
5
- <div class="clear"></div>
6
- <select class="wp-all-export-chosen-select" name="column_value_type" style="width:350px;">
7
-
8
- <?php foreach (XmlExportWooCommerceOrder::$order_sections as $section_key => $section) : ?>
9
-
10
- <optgroup label="<?php echo $section['title']; ?>">
11
- <?php foreach ($section['meta'] as $field_key => $field) : ?>
12
- <option value="<?php echo $field_key; ?>" rel="<?php echo ( ! empty($field['options']) ) ? $field['options'] : $section_key; ?>"><?php echo (is_array($field)) ? $field['name'] : $field; ?></option>
13
- <?php endforeach; ?>
14
- </optgroup>
15
-
16
- <?php endforeach; ?>
17
-
18
- <optgroup label="Advanced Query">
19
- <option value="sql"><?php _e("SQL Query", "wp_all_export_plugin"); ?></option>
20
- </optgroup>
21
-
22
- </select>
23
- </div>
24
-
25
- <div class="input">
26
- <label style="padding:4px; display: block;"><?php _e('What would you like to name the column/element in your exported file?','wp_all_export_plugin');?></label>
27
- <div class="clear"></div>
28
- <input type="text" class="column_name" value="" style="width:50%"/>
29
- </div>
30
- <input type="hidden" class="column_name" value=""/>
31
- <input type="hidden" name="export_data_type" value="shop_order"/>
32
-
33
- <a href="javascript:void(0);" class="wp-all-export-advanced-field-options"><span>+</span> <?php _e("Advanced", 'wp_all_export_plugin'); ?></a>
34
-
35
- <div class="wp-all-export-advanced-field-options-content">
36
- <div class="input cc_field sql_field_type">
37
- <a href="#help" rel="sql" class="help" style="display:none;" title="<?php _e('%%ID%% will be replaced with the ID of the post being exported, example: SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND meta_key=\'your_meta_key\';', 'wp_all_export_plugin'); ?>">?</a>
38
- <textarea style="width:100%;" rows="5" class="column_value"></textarea>
39
- </div>
40
- <div class="input cc_field date_field_type">
41
- <select class="date_field_export_data" style="width: 100%; height: 30px;">
42
- <option value="unix"><?php _e("UNIX timestamp - PHP time()", "wp_all_export_plugin");?></option>
43
- <option value="php"><?php _e("Natural Language PHP date()", "wp_all_export_plugin");?></option>
44
- </select>
45
- <div class="input pmxe_date_format_wrapper">
46
- <label><?php _e("date() Format", "wp_all_export_plugin"); ?></label>
47
- <br>
48
- <input type="text" class="pmxe_date_format" value="" placeholder="Y-m-d H:i:s" style="width: 100%;"/>
49
- </div>
50
- </div>
51
- <div class="input php_snipped" style="margin-top:10px;">
52
- <input type="checkbox" id="coperate_php" name="coperate_php" value="1" class="switcher" style="float: left; margin: 2px;"/>
53
- <label for="coperate_php"><?php _e("Export the value returned by a PHP function", "wp_all_export_plugin"); ?></label>
54
- <a href="#help" class="wpallexport-help" title="<?php _e('The value of the field chosen for export will be passed to the PHP function.', 'wp_all_export_plugin'); ?>" style="top: 0;">?</a>
55
- <div class="switcher-target-coperate_php" style="margin-top:5px;">
56
- <div class="wpallexport-free-edition-notice" style="margin: 15px 0;">
57
- <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=custom-php&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to enable custom PHP functions.','wp_all_export_plugin');?></a>
58
- </div>
59
- <?php echo "&lt;?php ";?>
60
- <input type="text" class="php_code" value="" style="width:50%;" placeholder='your_function_name'/>
61
- <?php echo "(\$value); ?&gt;"; ?>
62
-
63
- <?php
64
- $uploads = wp_upload_dir();
65
- $functions = $uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
66
- ?>
67
-
68
- <div class="input" style="margin-top: 10px;">
69
-
70
- <h4><?php _e('Function Editor', 'wp_all_export_plugin');?><a href="#help" class="wpallexport-help" title="<?php printf(__("Add functions here for use during your export. You can access this file at %s", "wp_all_export_plugin"), preg_replace("%.*wp-content%", "wp-content", $functions));?>" style="top: 0;">?</a></h4>
71
-
72
- </div>
73
-
74
- <textarea id="wp_all_export_code" name="wp_all_export_code"><?php echo "<?php\n\n?>";?></textarea>
75
-
76
- <div class="input" style="margin-top: 10px;">
77
-
78
- <div class="input" style="display:inline-block; margin-right: 20px;">
79
- <input type="button" class="button-primary wp_all_export_save_functions" disabled="disabled" value="<?php _e("Save Functions", 'wp_all_export_plugin'); ?>"/>
80
- <div class="wp_all_export_functions_preloader"></div>
81
- </div>
82
- <div class="input wp_all_export_saving_status" style="display:inline-block;">
83
-
84
- </div>
85
-
86
- </div>
87
- </div>
88
- </div>
89
- </div>
90
- </div>
91
- <br>
92
- <div class="input wp-all-export-edit-column-buttons">
93
- <input type="button" class="delete_action" value="<?php _e("Delete", "wp_all_export_plugin"); ?>" style="border: none;"/>
94
- <input type="button" class="save_action" value="<?php _e("Done", "wp_all_export_plugin"); ?>" style="border: none;"/>
95
- <input type="button" class="close_action" value="<?php _e("Close", "wp_all_export_plugin"); ?>" style="border: none;"/>
96
- </div>
97
-
98
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/export/template/new_field_user.php DELETED
@@ -1,122 +0,0 @@
1
- <form>
2
- <div class="wp-all-export-field-options">
3
- <div class="input" style="margin-bottom:10px;">
4
- <label for="column_value_default" style="padding:4px; display: block;"><?php _e('What field would you like to export?', 'wp_all_export_plugin' )?></label>
5
- <div class="clear"></div>
6
- <select class="wp-all-export-chosen-select" name="column_value_type" style="width:350px;">
7
- <optgroup label="Standard">
8
- <option value="id"><?php _e("ID", "wp_all_export_plugin"); ?></option>
9
- <option value="user_login"><?php _e("Login", "wp_all_export_plugin"); ?></option>
10
- <option value="user_email"><?php _e("Email", "wp_all_export_plugin"); ?></option>
11
- <option value="first_name"><?php _e("First Name", "wp_all_export_plugin"); ?></option>
12
- <option value="last_name"><?php _e("Last Name", "wp_all_export_plugin"); ?></option>
13
- <option value="user_registered"><?php _e("Registered Date", "wp_all_export_plugin"); ?></option>
14
- <option value="user_nicename"><?php _e("Nicename", "wp_all_export_plugin"); ?></option>
15
- <option value="user_url"><?php _e("URL", "wp_all_export_plugin"); ?></option>
16
- <option value="display_name"><?php _e("Display Name", "wp_all_export_plugin"); ?></option>
17
- <option value="nickname"><?php _e("Nickname", "wp_all_export_plugin"); ?></option>
18
- <option value="description"><?php _e("Description", "wp_all_export_plugin"); ?></option>
19
- </optgroup>
20
- <optgroup label="Advanced">
21
- <option value="user_pass"><?php _e("Password", "wp_all_export_plugin"); ?></option>
22
- <option value="user_activation_key"><?php _e("Activation Key", "wp_all_export_plugin"); ?></option>
23
- <option value="user_status"><?php _e("Status", "wp_all_export_plugin"); ?></option>
24
- <option value="wp_capabilities"><?php _e("Roles", "wp_all_export_plugin"); ?></option>
25
- <option value="cf"><?php _e("Custom Field / User Meta", "wp_all_export_plugin"); ?></option>
26
- </optgroup>
27
- <?php if ( class_exists( 'acf' )) : ?>
28
- <optgroup label="Integrations">
29
- <?php if ( class_exists( 'acf' ) and ! empty($acf_groups) ) : ?>
30
- <option value="acf"><?php _e("Advanced Custom Fields", "wp_all_export_plugin"); ?></option>
31
- <?php endif; ?>
32
- </optgroup>
33
- <?php endif; ?>
34
- <optgroup label="Advanced">
35
- <option value="sql"><?php _e("SQL Query", "wp_all_export_plugin"); ?></option>
36
- </optgroup>
37
- </select>
38
- </div>
39
-
40
- <input type="hidden" name="export_data_type" value="user"/>
41
-
42
- <div class="input cc_field cf_field_type" style="margin-left: 20px; margin-bottom: 10px;">
43
- <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
44
- <input type="text" class="cf_direct_value autocomplete" value="" style="width:50%;"/>
45
- </div>
46
- <div class="input cc_field acf_field_type" style="margin-left: 20px; margin-bottom: 10px;">
47
- <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
48
- <input type="text" class="acf_direct_value autocomplete" value="" style="width:50%;"/>
49
- </div>
50
-
51
- <div class="input">
52
- <label style="padding:4px; display: block;"><?php _e('What would you like to name the column/element in your exported file?','wp_all_export_plugin');?></label>
53
- <div class="clear"></div>
54
- <input type="text" class="column_name" value="" style="width:50%"/>
55
- </div>
56
-
57
- <a href="javascript:void(0);" class="wp-all-export-advanced-field-options"><span>+</span> <?php _e("Advanced", 'wp_all_export_plugin'); ?></a>
58
-
59
- <div class="wp-all-export-advanced-field-options-content">
60
- <div class="input cc_field sql_field_type">
61
- <a href="#help" rel="sql" class="help" style="display:none;" title="<?php _e('%%ID%% will be replaced with the ID of the post being exported, example: SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND meta_key=\'your_meta_key\';', 'wp_all_export_plugin'); ?>">?</a>
62
- <textarea style="width:100%;" rows="5" class="column_value"></textarea>
63
- </div>
64
- <div class="input cc_field date_field_type">
65
- <select class="date_field_export_data" style="width: 100%; height: 30px;">
66
- <option value="unix"><?php _e("UNIX timestamp - PHP time()", "wp_all_export_plugin");?></option>
67
- <option value="php"><?php _e("Natural Language PHP date()", "wp_all_export_plugin");?></option>
68
- </select>
69
- <div class="input pmxe_date_format_wrapper">
70
- <label><?php _e("date() Format", "wp_all_export_plugin"); ?></label>
71
- <br>
72
- <input type="text" class="pmxe_date_format" value="" placeholder="Y-m-d H:i:s" style="width: 100%;"/>
73
- </div>
74
- </div>
75
- <div class="input php_snipped" style="margin-top:10px;">
76
- <input type="checkbox" id="coperate_php" name="coperate_php" value="1" class="switcher" style="float: left; margin: 2px;"/>
77
- <label for="coperate_php"><?php _e("Export the value returned by a PHP function", "wp_all_export_plugin"); ?></label>
78
- <a href="#help" class="wpallexport-help" title="<?php _e('The value of the field chosen for export will be passed to the PHP function.', 'wp_all_export_plugin'); ?>" style="top: 0;">?</a>
79
- <div class="switcher-target-coperate_php" style="margin-top:5px;">
80
- <div class="wpallexport-free-edition-notice" style="margin: 15px 0;">
81
- <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=custom-php&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to enable custom PHP functions.','wp_all_export_plugin');?></a>
82
- </div>
83
- <?php echo "&lt;?php ";?>
84
- <input type="text" class="php_code" value="" style="width:50%;" placeholder='your_function_name'/>
85
- <?php echo "(\$value); ?&gt;"; ?>
86
-
87
- <?php
88
- $uploads = wp_upload_dir();
89
- $functions = $uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
90
- ?>
91
-
92
- <div class="input" style="margin-top: 10px;">
93
-
94
- <h4><?php _e('Function Editor', 'wp_all_export_plugin');?><a href="#help" class="wpallexport-help" title="<?php printf(__("Add functions here for use during your export. You can access this file at %s", "wp_all_export_plugin"), preg_replace("%.*wp-content%", "wp-content", $functions));?>" style="top: 0;">?</a></h4>
95
-
96
- </div>
97
-
98
- <textarea id="wp_all_export_code" name="wp_all_export_code"><?php echo "<?php\n\n?>";?></textarea>
99
-
100
- <div class="input" style="margin-top: 10px;">
101
-
102
- <div class="input" style="display:inline-block; margin-right: 20px;">
103
- <input type="button" class="button-primary wp_all_export_save_functions" disabled="disabled" value="<?php _e("Save Functions", 'wp_all_export_plugin'); ?>"/>
104
- <div class="wp_all_export_functions_preloader"></div>
105
- </div>
106
- <div class="input wp_all_export_saving_status" style="display:inline-block;">
107
-
108
- </div>
109
-
110
- </div>
111
- </div>
112
- </div>
113
- </div>
114
- </div>
115
- <br>
116
- <div class="input wp-all-export-edit-column-buttons">
117
- <input type="button" class="delete_action" value="<?php _e("Delete", "wp_all_export_plugin"); ?>" style="border: none;"/>
118
- <input type="button" class="save_action" value="<?php _e("Done", "wp_all_export_plugin"); ?>" style="border: none;"/>
119
- <input type="button" class="close_action" value="<?php _e("Close", "wp_all_export_plugin"); ?>" style="border: none;"/>
120
- </div>
121
-
122
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/manage/index.php CHANGED
@@ -110,7 +110,7 @@ $columns = apply_filters('pmxe_manage_imports_columns', $columns);
110
 
111
  $class = '';
112
  ?>
113
- <?php foreach ($list as $item): ?>
114
  <?php $class = ('alternate' == $class) ? '' : 'alternate'; ?>
115
  <tr class="<?php echo $class; ?>" valign="middle">
116
  <th scope="row" class="check-column">
@@ -135,21 +135,21 @@ $columns = apply_filters('pmxe_manage_imports_columns', $columns);
135
  <span class="edit"><a class="edit" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'options'), $this->baseUrl)) ?>"><?php _e('Export Settings', 'wp_all_export_plugin') ?></a></span> |
136
 
137
  <?php if ( ! $is_secure_import and $item['attch_id']): ?>
138
- <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'get_file', '_wpnonce' => wp_create_nonce( '_wpnonce-download_feed' )), $this->baseUrl)) ?>"><?php echo strtoupper($item['options']['export_to']); ?></a></span> |
139
- <?php if (! empty($item['options']['tpl_data']) and (empty($item['options']['cpt']) or !in_array('shop_order', $item['options']['cpt']))):?>
140
  <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'bundle', '_wpnonce' => wp_create_nonce( '_wpnonce-download_bundle' )), $this->baseUrl)) ?>"><?php _e('Bundle', 'wp_all_export_plugin'); ?></a></span> |
141
  <?php endif; ?>
142
  <?php endif; ?>
143
-
144
  <?php if ($is_secure_import and ! empty($item['options']['filepath'])): ?>
145
- <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'get_file', '_wpnonce' => wp_create_nonce( '_wpnonce-download_feed' )), $this->baseUrl)) ?>"><?php echo strtoupper($item['options']['export_to']); ?></a></span> |
146
- <?php if (! empty($item['options']['tpl_data']) and (empty($item['options']['cpt']) or !in_array('shop_order', $item['options']['cpt']))):?>
147
  <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'bundle', '_wpnonce' => wp_create_nonce( '_wpnonce-download_bundle' )), $this->baseUrl)) ?>"><?php _e('Bundle', 'wp_all_export_plugin'); ?></a></span> |
148
  <?php endif; ?>
149
  <?php endif; ?>
150
 
151
  <?php if ( ! empty($item['options']['split_large_exports']) and ! empty($item['options']['split_files_list']) ): ?>
152
- <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'split_bundle', '_wpnonce' => wp_create_nonce( '_wpnonce-download_split_bundle' )), $this->baseUrl)) ?>"><?php printf(__('Split %ss', 'wp_all_export_plugin'), strtoupper($item['options']['export_to'])); ?></a></span> |
153
  <?php endif; ?>
154
 
155
  <span class="delete"><a class="delete" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'delete'), $this->baseUrl)) ?>"><?php _e('Delete', 'wp_all_export_plugin') ?></a></span>
@@ -163,8 +163,9 @@ $columns = apply_filters('pmxe_manage_imports_columns', $columns);
163
  <a href="<?php echo add_query_arg(array('id' => $item['id'], 'action' => 'scheduling'), $this->baseUrl)?>"><?php _e('Cron Scheduling', 'wp_all_export_plugin'); ?></a> <br>
164
  <?php
165
  $is_re_import_allowed = true;
166
- if ( ! empty($item['options']['ids']) ){
167
- $required_fields = array('id' => 'id');
 
168
  // re-import products
169
  if ((in_array('product', $item['options']['cpt']) or $item['options']['export_type'] == 'advanced') and class_exists('WooCommerce') and (empty($item['options']['wp_query_selector']) or $item['options']['wp_query_selector'] == 'wp_query')) {
170
  $required_fields['woo'] = '_sku';
@@ -178,13 +179,15 @@ $columns = apply_filters('pmxe_manage_imports_columns', $columns);
178
  $required_fields['post_type'] = 'post_type';
179
  }
180
  $defined_fields = array();
181
- foreach ($item['options']['ids'] as $ID => $value) {
182
- foreach ($required_fields as $type => $field) {
183
- if ($item['options']['cc_type'][$ID] == $type && $item['options']['cc_label'][$ID] == $field){
 
 
184
  $defined_fields[] = $field;
185
  }
186
  }
187
- }
188
 
189
  foreach ($required_fields as $type => $field) {
190
  if ( ! in_array($field, $defined_fields) ){
@@ -200,19 +203,19 @@ $columns = apply_filters('pmxe_manage_imports_columns', $columns);
200
  // $item['options']['import_id'] = 0;
201
  // }
202
  // }
203
- }
 
204
  ?>
205
  <?php if ( wp_all_export_is_compatible() and !empty($item['options']['import_id']) and $is_re_import_allowed): ?>
206
- <a href="<?php echo add_query_arg(array('page' => 'pmxi-admin-import', 'id' => $item['options']['import_id'], 'deligate' => 'wpallexport'), remove_query_arg('page', $this->baseUrl)); ?>"><?php _e("Import with WP All Import", "wp_all_export_plugin"); ?></a>
207
  <?php endif;?>
208
  <?php
209
- if ( empty($item['options']['cpt']) or ! in_array('shop_order', $item['options']['cpt'])) {
210
  //$template = new PMXI_Template_Record();
211
  if ( ! empty($item['options']['tpl_data'])) {
212
  //$template->getByName($item['options']['template_name']);
213
  //if ( ! $template->isEmpty() ){
214
- ?>
215
- <br/>
216
  <a href="<?php echo add_query_arg(array('id' => $item['id'], 'action' => 'templates'), $this->baseUrl)?>"><?php _e('Download Import Templates', 'wp_all_export_plugin'); ?></a>
217
  <?php
218
  //}
110
 
111
  $class = '';
112
  ?>
113
+ <?php foreach ($list as $item):?>
114
  <?php $class = ('alternate' == $class) ? '' : 'alternate'; ?>
115
  <tr class="<?php echo $class; ?>" valign="middle">
116
  <th scope="row" class="check-column">
135
  <span class="edit"><a class="edit" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'options'), $this->baseUrl)) ?>"><?php _e('Export Settings', 'wp_all_export_plugin') ?></a></span> |
136
 
137
  <?php if ( ! $is_secure_import and $item['attch_id']): ?>
138
+ <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'get_file', '_wpnonce' => wp_create_nonce( '_wpnonce-download_feed' )), $this->baseUrl)) ?>"><?php echo strtoupper(wp_all_export_get_export_format($item['options'])); ?></a></span> |
139
+ <?php if (! empty($item['options']['bundlepath']) and PMXE_Export_Record::is_bundle_supported($item['options'])):?>
140
  <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'bundle', '_wpnonce' => wp_create_nonce( '_wpnonce-download_bundle' )), $this->baseUrl)) ?>"><?php _e('Bundle', 'wp_all_export_plugin'); ?></a></span> |
141
  <?php endif; ?>
142
  <?php endif; ?>
143
+
144
  <?php if ($is_secure_import and ! empty($item['options']['filepath'])): ?>
145
+ <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'get_file', '_wpnonce' => wp_create_nonce( '_wpnonce-download_feed' )), $this->baseUrl)) ?>"><?php echo strtoupper(wp_all_export_get_export_format($item['options'])); ?></a></span> |
146
+ <?php if (! empty($item['options']['bundlepath']) and PMXE_Export_Record::is_bundle_supported($item['options'])):?>
147
  <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'bundle', '_wpnonce' => wp_create_nonce( '_wpnonce-download_bundle' )), $this->baseUrl)) ?>"><?php _e('Bundle', 'wp_all_export_plugin'); ?></a></span> |
148
  <?php endif; ?>
149
  <?php endif; ?>
150
 
151
  <?php if ( ! empty($item['options']['split_large_exports']) and ! empty($item['options']['split_files_list']) ): ?>
152
+ <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'split_bundle', '_wpnonce' => wp_create_nonce( '_wpnonce-download_split_bundle' )), $this->baseUrl)) ?>"><?php printf(__('Split %ss', 'wp_all_export_plugin'), strtoupper(wp_all_export_get_export_format($item['options']))); ?></a></span> |
153
  <?php endif; ?>
154
 
155
  <span class="delete"><a class="delete" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'delete'), $this->baseUrl)) ?>"><?php _e('Delete', 'wp_all_export_plugin') ?></a></span>
163
  <a href="<?php echo add_query_arg(array('id' => $item['id'], 'action' => 'scheduling'), $this->baseUrl)?>"><?php _e('Cron Scheduling', 'wp_all_export_plugin'); ?></a> <br>
164
  <?php
165
  $is_re_import_allowed = true;
166
+ if ( ! empty($item['options']['ids']) )
167
+ {
168
+ $required_fields = array('id' => 'id');
169
  // re-import products
170
  if ((in_array('product', $item['options']['cpt']) or $item['options']['export_type'] == 'advanced') and class_exists('WooCommerce') and (empty($item['options']['wp_query_selector']) or $item['options']['wp_query_selector'] == 'wp_query')) {
171
  $required_fields['woo'] = '_sku';
179
  $required_fields['post_type'] = 'post_type';
180
  }
181
  $defined_fields = array();
182
+ foreach ($item['options']['ids'] as $ID => $value)
183
+ {
184
+ foreach ($required_fields as $type => $field)
185
+ {
186
+ if (strtolower($item['options']['cc_type'][$ID]) == $type && strtolower($item['options']['cc_label'][$ID]) == strtolower($field)){
187
  $defined_fields[] = $field;
188
  }
189
  }
190
+ }
191
 
192
  foreach ($required_fields as $type => $field) {
193
  if ( ! in_array($field, $defined_fields) ){
203
  // $item['options']['import_id'] = 0;
204
  // }
205
  // }
206
+ }
207
+
208
  ?>
209
  <?php if ( wp_all_export_is_compatible() and !empty($item['options']['import_id']) and $is_re_import_allowed): ?>
210
+ <a href="<?php echo add_query_arg(array('page' => 'pmxi-admin-import', 'id' => $item['options']['import_id'], 'deligate' => 'wpallexport'), remove_query_arg('page', $this->baseUrl)); ?>"><?php _e("Import with WP All Import", "wp_all_export_plugin"); ?></a><br/>
211
  <?php endif;?>
212
  <?php
213
+ if ( !in_array($item['options']['wp_query_selector'], array('wp_comment_query')) and (empty($item['options']['cpt']) or ! in_array('shop_order', $item['options']['cpt']) and ! in_array('comments', $item['options']['cpt']))) {
214
  //$template = new PMXI_Template_Record();
215
  if ( ! empty($item['options']['tpl_data'])) {
216
  //$template->getByName($item['options']['template_name']);
217
  //if ( ! $template->isEmpty() ){
218
+ ?>
 
219
  <a href="<?php echo add_query_arg(array('id' => $item['id'], 'action' => 'templates'), $this->baseUrl)?>"><?php _e('Download Import Templates', 'wp_all_export_plugin'); ?></a>
220
  <?php
221
  //}
views/admin/manage/scheduling.php CHANGED
@@ -14,13 +14,17 @@
14
  <p>
15
  <?php _e('Trigger Script URL', 'wp_all_export_plugin');?><br />
16
  <small><?php _e('Run the trigger script when you want to update your export. Once per 24 hours is recommended.', 'wp_all_export_plugin'); ?></small><br />
17
- <input style='width: 700px;' type='text' value='<?php echo home_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=trigger'; ?>' disabled="disabled"/>
18
  <br /><br />
19
  <?php _e('Execution Script URL', 'wp_all_export_plugin');?><br />
20
  <small><?php _e('Run the execution script frequently. Once per two minutes is recommended.','wp_all_export_plugin');?></small><br />
21
- <input style='width: 700px;' type='text' value='<?php echo home_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=processing'; ?>' disabled="disabled"/><br /><br />
22
  <?php _e('Export File URL', 'wp_all_export_plugin'); ?><br />
23
  <input style='width: 700px;' type='text' value='<?php echo $file_path; ?>' disabled="disabled"/><br /><br />
 
 
 
 
24
  </p>
25
 
26
  <p><strong><?php _e('Trigger Script', 'wp_all_export_plugin'); ?></strong></p>
@@ -31,7 +35,7 @@
31
 
32
  <p><i><?php _e('Example:', 'wp_all_export_plugin'); ?></i></p>
33
 
34
- <p>wget -q -O /dev/null "<?php echo home_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=trigger'; ?>"</p>
35
 
36
  <p><strong><?php _e('Execution Script', 'wp_all_export_plugin'); ?></strong></p>
37
 
@@ -43,7 +47,7 @@
43
 
44
  <p><i><?php _e('Example:', 'wp_all_export_plugin'); ?></i></p>
45
 
46
- <p>wget -q -O /dev/null "<?php echo home_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=processing'; ?>"</p>
47
 
48
  <p><strong><?php _e('Notes', 'wp_all_export_plugin'); ?></strong></p>
49
 
14
  <p>
15
  <?php _e('Trigger Script URL', 'wp_all_export_plugin');?><br />
16
  <small><?php _e('Run the trigger script when you want to update your export. Once per 24 hours is recommended.', 'wp_all_export_plugin'); ?></small><br />
17
+ <input style='width: 700px;' type='text' value='<?php echo site_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=trigger'; ?>' disabled="disabled"/>
18
  <br /><br />
19
  <?php _e('Execution Script URL', 'wp_all_export_plugin');?><br />
20
  <small><?php _e('Run the execution script frequently. Once per two minutes is recommended.','wp_all_export_plugin');?></small><br />
21
+ <input style='width: 700px;' type='text' value='<?php echo site_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=processing'; ?>' disabled="disabled"/><br /><br />
22
  <?php _e('Export File URL', 'wp_all_export_plugin'); ?><br />
23
  <input style='width: 700px;' type='text' value='<?php echo $file_path; ?>' disabled="disabled"/><br /><br />
24
+ <?php if (! empty($bundle_url)): ?>
25
+ <?php _e('Export Bundle URL', 'wp_all_export_plugin'); ?><br />
26
+ <input style='width: 700px;' type='text' value='<?php echo $bundle_url; ?>' disabled="disabled"/><br /><br />
27
+ <?php endif; ?>
28
  </p>
29
 
30
  <p><strong><?php _e('Trigger Script', 'wp_all_export_plugin'); ?></strong></p>
35
 
36
  <p><i><?php _e('Example:', 'wp_all_export_plugin'); ?></i></p>
37
 
38
+ <p>wget -q -O /dev/null "<?php echo site_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=trigger'; ?>"</p>
39
 
40
  <p><strong><?php _e('Execution Script', 'wp_all_export_plugin'); ?></strong></p>
41
 
47
 
48
  <p><i><?php _e('Example:', 'wp_all_export_plugin'); ?></i></p>
49
 
50
+ <p>wget -q -O /dev/null "<?php echo site_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=processing'; ?>"</p>
51
 
52
  <p><strong><?php _e('Notes', 'wp_all_export_plugin'); ?></strong></p>
53
 
views/admin/manage/update.php CHANGED
@@ -1,19 +1,15 @@
1
  <?php
2
-
3
- $baseUrl = $this->baseUrl;
4
-
5
- $l10n = array(
6
- 'confirm_and_run' => __('Confirm & Run Export', 'wp_all_export_plugin'),
7
- 'save_configuration' => __('Save Export Configuration', 'wp_all_export_plugin')
8
- );
9
-
10
  ?>
11
  <script type="text/javascript">
12
  var wp_all_export_L10n = <?php echo json_encode($l10n); ?>;
13
  </script>
14
 
15
 
16
- <div class="wpallexport-step-4 wpallexport-re-run-export">
17
 
18
  <h2 class="wpallexport-wp-notices"></h2>
19
 
@@ -48,12 +44,11 @@ $l10n = array(
48
 
49
  <div id="filtering_result" class="wpallexport-ready-to-go <?php if (empty(PMXE_Plugin::$session->found_posts)):?>nothing_to_export<?php endif;?>">
50
  <?php if (empty(PMXE_Plugin::$session->found_posts)):?>
51
- <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
52
- <h4><?php printf(__("No matching %s found for selected filter rules.", "wp_all_export_plugin"), wp_all_export_get_cpt_name($post['cpt'])); ?></h4>
53
  <?php else: ?>
54
- <h3><?php _e('Your export is ready to run.', 'wp_all_export_plugin'); ?></h3>
55
- <h4><?php printf(__('WP All Export will export %d %s.'), PMXE_Plugin::$session->found_posts, wp_all_export_get_cpt_name($post['cpt'])); ?></h4>
56
  <?php endif; ?>
 
57
  </div>
58
 
59
  <form class="confirm <?php echo ! $isWizard ? 'edit' : '' ?>" method="post" style="float:right;">
@@ -70,124 +65,24 @@ $l10n = array(
70
 
71
  <form class="<?php echo ! $isWizard ? 'edit' : 'options' ?> choose-export-options" method="post" enctype="multipart/form-data" autocomplete="off" <?php echo ! $isWizard ? 'style="overflow:visible;"' : '' ?>>
72
 
73
- <?php if ( ! $isWizard and $post['export_type'] == 'specific'): ?>
74
-
75
- <div class="wpallexport-collapsed wpallexport-section closed">
76
- <div class="wpallexport-content-section">
77
- <div class="wpallexport-collapsed-header" style="padding-left: 25px;">
78
- <h3><?php _e('Filters','wp_all_export_plugin');?></h3>
79
- </div>
80
- <div class="wpallexport-collapsed-content" style="padding: 0;">
81
- <div class="wpallexport-collapsed-content-inner">
82
- <div class="wpallexport-free-edition-notice" style="padding: 20px; margin-bottom: 10px;">
83
- <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&amp;utm_medium=in-plugin&amp;utm_campaign=download-from-url"><?php _e('Upgrade to the professional edition of WP All Export to add filtering rules.','wp_all_export_plugin');?></a>
84
- </div>
85
- <input type="hidden" name="selected_post_type" value="<?php echo $post['cpt'][0]; ?>"/>
86
- <div class="wp_all_export_rule_inputs">
87
- <table>
88
- <tr>
89
- <th><?php _e('Element', 'wp_all_export_plugin'); ?></th>
90
- <th><?php _e('Rule', 'wp_all_export_plugin'); ?></th>
91
- <th><?php _e('Value', 'wp_all_export_plugin'); ?></th>
92
- <th>&nbsp;</th>
93
- </tr>
94
- <tr>
95
- <td style="width: 25%;">
96
- <select id="wp_all_export_xml_element">
97
- <option value=""><?php _e('Select Element', 'wp_all_export_plugin'); ?></option>
98
- <?php echo $engine->render_filters(); ?>
99
- </select>
100
- </td>
101
- <td style="width: 25%;" id="wp_all_export_available_rules">
102
- <select id="wp_all_export_rule">
103
- <option value=""><?php _e('Select Rule', 'wp_all_export_plugin'); ?></option>
104
- </select>
105
- </td>
106
- <td style="width: 25%;">
107
- <input id="wp_all_export_value" type="text" placeholder="value" value="" disabled="disabled"/>
108
- </td>
109
- <td style="width: 15%;">
110
- <a id="wp_all_export_add_rule" href="javascript:void(0);"><?php _e('Add Rule', 'wp_all_export_plugin');?></a>
111
- </td>
112
- </tr>
113
- </table>
114
- </div>
115
- <div id="wpallexport-filters" style="padding:0;">
116
- <div class="wpallexport-content-section" style="padding:0; border: none;">
117
- <fieldset id="wp_all_export_filtering_rules">
118
- <?php
119
- $filter_rules = $post['filter_rules_hierarhy'];
120
- $filter_rules_hierarhy = json_decode($filter_rules);
121
- if ( empty($filter_rules_hierarhy) or ! is_array($filter_rules_hierarhy) ):
122
- ?>
123
- <p style="margin:20px 0 5px; text-align:center;"><?php _e('No filtering options. Add filtering options to only export records matching some specified criteria.', 'wp_all_export_plugin');?></p>
124
- <?php
125
- endif;
126
- ?>
127
- <ol class="wp_all_export_filtering_rules">
128
- <?php
129
- if ( ! empty($filter_rules_hierarhy) and is_array($filter_rules_hierarhy) ):
130
- $rulenumber = 0;
131
- foreach ($filter_rules_hierarhy as $rule) {
132
-
133
- if ( is_null($rule->parent_id) )
134
- {
135
- $rulenumber++;
136
- ?>
137
- <li id="item_<?php echo $rulenumber;?>" class="dragging">
138
- <div class="drag-element">
139
- <input type="hidden" value="<?php echo $rule->element; ?>" class="wp_all_export_xml_element" name="wp_all_export_xml_element[<?php echo $rulenumber; ?>]"/>
140
- <input type="hidden" value="<?php echo $rule->title; ?>" class="wp_all_export_xml_element_title" name="wp_all_export_xml_element_title[<?php echo $rulenumber; ?>]"/>
141
- <input type="hidden" value="<?php echo $rule->condition; ?>" class="wp_all_export_rule" name="wp_all_export_rule[<?php echo $rulenumber; ?>]"/>
142
- <input type="hidden" value="<?php echo $rule->value; ?>" class="wp_all_export_value" name="wp_all_export_value[<?php echo $rulenumber; ?>]"/>
143
- <span class="rule_element"><?php echo $rule->title; ?></span>
144
- <span class="rule_as_is"><?php echo $rule->condition; ?></span>
145
- <span class="rule_condition_value"><?php echo $rule->value; ?></span>
146
- <span class="condition <?php if ($rulenumber == count($filter_rules_hierarhy)):?>last_condition<?php endif; ?>">
147
- <label for="rule_and_<?php echo $rulenumber; ?>">AND</label>
148
- <input id="rule_and_<?php echo $rulenumber; ?>" type="radio" value="and" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'AND'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
149
- <label for="rule_or_<?php echo $rulenumber; ?>">OR</label>
150
- <input id="rule_or_<?php echo $rulenumber; ?>" type="radio" value="or" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'OR'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
151
- </span>
152
- </div>
153
- <a href="javascript:void(0);" class="icon-item remove-ico"></a>
154
- <?php echo wp_all_export_reverse_rules_html($filter_rules_hierarhy, $rule, $rulenumber); ?>
155
- </li>
156
- <?php
157
- }
158
- }
159
- endif;
160
- ?>
161
- </ol>
162
- <div class="clear"></div>
163
- <div class="wp_all_export_filter_preloader"></div>
164
- </fieldset>
165
-
166
- <?php if ( @in_array("product", $post["cpt"]) and class_exists('WooCommerce')) : ?>
167
-
168
- <div class="input wp_all_export_product_matching_mode" <?php if (empty($filter_rules_hierarhy)): ?>style="display:none;"<?php endif; ?>>
169
- <?php $product_matching_mode = $post['product_matching_mode']; ?>
170
- <label><?php _e("Variable product matching rules: ", "wp_all_export_plugin"); ?></label>
171
- <select name="product_matching_mode">
172
- <option value="strict" <?php echo ( $product_matching_mode == 'strict' ) ? 'selected="selected"' : ''; ?>><?php _e("Strict", "wp_all_export_plugin"); ?></option>
173
- <option value="permissive" <?php echo ( $product_matching_mode == 'permissive' ) ? 'selected="selected"' : ''; ?>><?php _e("Permissive", "wp_all_export_plugin"); ?></option>
174
- </select>
175
- <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('Strict matching requires all variations to pass in order for the product to be exported. Permissive matching allows the product to be exported if any of the variations pass.', 'wp_all_export_plugin'); ?>">?</a>
176
- </div>
177
-
178
- <?php endif; ?>
179
-
180
- </div>
181
- </div>
182
- </div>
183
-
184
- <input type="hidden" class="hierarhy-output" name="filter_rules_hierarhy" value="<?php echo esc_html($post['filter_rules_hierarhy']);?>"/>
185
-
186
- </div>
187
- </div>
188
- </div>
189
 
190
- <?php endif; ?>
191
 
192
  <?php include_once PMXE_ROOT_DIR . '/views/admin/export/options/settings.php'; ?>
193
 
1
  <?php
2
+ $l10n = array(
3
+ 'confirm_and_run' => __('Confirm & Run Export', 'wp_all_export_plugin'),
4
+ 'save_configuration' => __('Save Export Configuration', 'wp_all_export_plugin')
5
+ );
 
 
 
 
6
  ?>
7
  <script type="text/javascript">
8
  var wp_all_export_L10n = <?php echo json_encode($l10n); ?>;
9
  </script>
10
 
11
 
12
+ <div class="wpallexport-step-4 wpallexport-export-options wpallexport-re-run-export">
13
 
14
  <h2 class="wpallexport-wp-notices"></h2>
15
 
44
 
45
  <div id="filtering_result" class="wpallexport-ready-to-go <?php if (empty(PMXE_Plugin::$session->found_posts)):?>nothing_to_export<?php endif;?>">
46
  <?php if (empty(PMXE_Plugin::$session->found_posts)):?>
47
+ <h3><?php _e('Nothing to export.', 'wp_all_export_plugin'); ?></h3>
 
48
  <?php else: ?>
49
+ <h3><?php _e('Your export is ready to run.', 'wp_all_export_plugin'); ?></h3>
 
50
  <?php endif; ?>
51
+ <div class="wp_all_export_preloader"></div>
52
  </div>
53
 
54
  <form class="confirm <?php echo ! $isWizard ? 'edit' : '' ?>" method="post" style="float:right;">
65
 
66
  <form class="<?php echo ! $isWizard ? 'edit' : 'options' ?> choose-export-options" method="post" enctype="multipart/form-data" autocomplete="off" <?php echo ! $isWizard ? 'style="overflow:visible;"' : '' ?>>
67
 
68
+ <?php
69
+ $selected_post_type = '';
70
+ if (XmlExportUser::$is_active):
71
+ $selected_post_type = empty($post['cpt'][0]) ? 'users' : $post['cpt'][0];
72
+ endif;
73
+ if (XmlExportComment::$is_active):
74
+ $selected_post_type = 'comments';
75
+ endif;
76
+ if (empty($selected_post_type) and ! empty($post['cpt'][0]))
77
+ {
78
+ $selected_post_type = $post['cpt'][0];
79
+ }
80
+ ?>
81
+
82
+ <input type="hidden" name="selected_post_type" value="<?php echo $selected_post_type; ?>"/>
83
+ <input type="hidden" name="export_type" value="<?php echo $post['export_type']; ?>"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
+ <?php XmlExportFiltering::render_filtering_block( $engine, $isWizard, $post ); ?>
86
 
87
  <?php include_once PMXE_ROOT_DIR . '/views/admin/export/options/settings.php'; ?>
88
 
wp-all-export.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP All Export
4
  Plugin URI: http://www.wpallimport.com/export/
5
  Description: Export any post type to a CSV or XML file. Edit the exported data, and then re-import it later using WP All Import.
6
- Version: 1.0.4
7
  Author: Soflyy
8
  */
9
 
@@ -50,7 +50,7 @@ else {
50
  */
51
  define('PMXE_PREFIX', 'pmxe_');
52
 
53
- define('PMXE_VERSION', '1.0.4');
54
 
55
  define('PMXE_EDITION', 'free');
56
 
@@ -139,6 +139,8 @@ else {
139
  const CRON_DIRECTORY = WP_ALL_EXPORT_CRON_DIRECTORY;
140
 
141
  public static $session = null;
 
 
142
 
143
  /**
144
  * Return singletone instance
@@ -342,7 +344,7 @@ else {
342
  $actionName = str_replace('-', '_', $action);
343
  if (method_exists($controllerName, $actionName)) {
344
 
345
- if ( ! get_current_user_id() or ! current_user_can('manage_options')) {
346
  // This nonce is not valid.
347
  die( 'Security check' );
348
 
@@ -585,16 +587,24 @@ else {
585
  $table = $this->getTablePrefix() . 'exports';
586
  $tablefields = $wpdb->get_results("DESCRIBE {$table};");
587
  $iteration = false;
 
 
588
 
589
  // Check if field exists
590
  foreach ($tablefields as $tablefield) {
591
  if ('iteration' == $tablefield->Field) $iteration = true;
 
 
592
  }
593
 
594
  if ( ! $iteration ){
595
-
596
  $wpdb->query("ALTER TABLE {$table} ADD `iteration` BIGINT(20) NOT NULL DEFAULT 0;");
597
-
 
 
 
 
 
598
  }
599
  }
600
 
@@ -608,15 +618,19 @@ else {
608
  'whereclause' => '',
609
  'joinclause' => '',
610
  'filter_rules_hierarhy' => '',
611
- 'product_matching_mode' => 'strict',
612
  'order_item_per_row' => 1,
613
  'order_item_fill_empty_columns' => 0,
614
- 'filepath' => '',
 
 
615
  'export_type' => 'specific',
616
  'wp_query' => '',
617
  'wp_query_selector' => 'wp_query',
618
  'is_user_export' => false,
 
619
  'export_to' => 'csv',
 
620
  'delimiter' => ',',
621
  'encoding' => 'UTF-8',
622
  'is_generate_templates' => 1,
@@ -634,6 +648,7 @@ else {
634
  'cc_code' => array(),
635
  'cc_sql' => array(),
636
  'cc_options' => array(),
 
637
  'friendly_name' => '',
638
  'fields' => array('default', 'other', 'cf', 'cats'),
639
  'ids' => array(),
@@ -650,7 +665,13 @@ else {
650
  'name' => '',
651
  'export_only_new_stuff' => 0,
652
  'creata_a_new_export_file' => 0,
653
- 'attachment_list' => array()
 
 
 
 
 
 
654
  );
655
  }
656
 
3
  Plugin Name: WP All Export
4
  Plugin URI: http://www.wpallimport.com/export/
5
  Description: Export any post type to a CSV or XML file. Edit the exported data, and then re-import it later using WP All Import.
6
+ Version: 1.0.5
7
  Author: Soflyy
8
  */
9
 
50
  */
51
  define('PMXE_PREFIX', 'pmxe_');
52
 
53
+ define('PMXE_VERSION', '1.0.5');
54
 
55
  define('PMXE_EDITION', 'free');
56
 
139
  const CRON_DIRECTORY = WP_ALL_EXPORT_CRON_DIRECTORY;
140
 
141
  public static $session = null;
142
+
143
+ public static $capabilities = 'manage_options';
144
 
145
  /**
146
  * Return singletone instance
344
  $actionName = str_replace('-', '_', $action);
345
  if (method_exists($controllerName, $actionName)) {
346
 
347
+ if ( ! get_current_user_id() or ! current_user_can(self::$capabilities)) {
348
  // This nonce is not valid.
349
  die( 'Security check' );
350
 
587
  $table = $this->getTablePrefix() . 'exports';
588
  $tablefields = $wpdb->get_results("DESCRIBE {$table};");
589
  $iteration = false;
590
+ $parent_id = false;
591
+ $export_post_type = false;
592
 
593
  // Check if field exists
594
  foreach ($tablefields as $tablefield) {
595
  if ('iteration' == $tablefield->Field) $iteration = true;
596
+ if ('parent_id' == $tablefield->Field) $parent_id = true;
597
+ if ('export_post_type' == $tablefield->Field) $export_post_type = true;
598
  }
599
 
600
  if ( ! $iteration ){
 
601
  $wpdb->query("ALTER TABLE {$table} ADD `iteration` BIGINT(20) NOT NULL DEFAULT 0;");
602
+ }
603
+ if ( ! $parent_id ){
604
+ $wpdb->query("ALTER TABLE {$table} ADD `parent_id` BIGINT(20) NOT NULL DEFAULT 0;");
605
+ }
606
+ if ( ! $export_post_type ){
607
+ $wpdb->query("ALTER TABLE {$table} ADD `export_post_type` VARCHAR(64) NOT NULL DEFAULT '';");
608
  }
609
  }
610
 
618
  'whereclause' => '',
619
  'joinclause' => '',
620
  'filter_rules_hierarhy' => '',
621
+ 'product_matching_mode' => 'parent',
622
  'order_item_per_row' => 1,
623
  'order_item_fill_empty_columns' => 0,
624
+ 'filepath' => '',
625
+ 'current_filepath' => '',
626
+ 'bundlepath' => '',
627
  'export_type' => 'specific',
628
  'wp_query' => '',
629
  'wp_query_selector' => 'wp_query',
630
  'is_user_export' => false,
631
+ 'is_comment_export' => false,
632
  'export_to' => 'csv',
633
+ 'export_to_sheet' => 'csv',
634
  'delimiter' => ',',
635
  'encoding' => 'UTF-8',
636
  'is_generate_templates' => 1,
648
  'cc_code' => array(),
649
  'cc_sql' => array(),
650
  'cc_options' => array(),
651
+ 'cc_settings' => array(),
652
  'friendly_name' => '',
653
  'fields' => array('default', 'other', 'cf', 'cats'),
654
  'ids' => array(),
665
  'name' => '',
666
  'export_only_new_stuff' => 0,
667
  'creata_a_new_export_file' => 0,
668
+ 'attachment_list' => array(),
669
+ 'order_include_poducts' => 0,
670
+ 'order_include_all_poducts' => 0,
671
+ 'order_include_coupons' => 0,
672
+ 'order_include_all_coupons' => 0,
673
+ 'order_include_customers' => 0,
674
+ 'order_include_all_customers' => 0
675
  );
676
  }
677