Import Export WordPress Users and WooCommerce Customers - Version 2.0.2

Version Description

  • Fix: Batch count issue for quick export.
  • Fix: Issue with password migration for quick import.
  • Tested OK with WC 4.7.0.
  • Version 2.0.0 onward has been revamped majorly.
Download this release

Release Info

Developer webtoffee
Plugin Icon 128x128 Import Export WordPress Users and WooCommerce Customers
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0.1 to 2.0.2

admin/modules/export/export.php CHANGED
@@ -543,7 +543,13 @@ class Wt_Import_Export_For_Woo_Basic_Export
543
  $file_as=(isset($form_data['advanced_form_data']['wt_iew_file_as']) ? $form_data['advanced_form_data']['wt_iew_file_as'] : 'csv');
544
  $csv_delimiter=(isset($form_data['advanced_form_data']['wt_iew_delimiter']) ? $form_data['advanced_form_data']['wt_iew_delimiter'] : ',');
545
  $csv_delimiter=($csv_delimiter=="" ? ',' : $csv_delimiter);
546
- }
 
 
 
 
 
 
547
  $file_as=(isset($this->allowed_export_file_type[$file_as]) ? $file_as : 'csv');
548
 
549
 
543
  $file_as=(isset($form_data['advanced_form_data']['wt_iew_file_as']) ? $form_data['advanced_form_data']['wt_iew_file_as'] : 'csv');
544
  $csv_delimiter=(isset($form_data['advanced_form_data']['wt_iew_delimiter']) ? $form_data['advanced_form_data']['wt_iew_delimiter'] : ',');
545
  $csv_delimiter=($csv_delimiter=="" ? ',' : $csv_delimiter);
546
+ }
547
+
548
+ //for Quick method exicuted from step 2(method of export)
549
+ if(empty($form_data['advanced_form_data']['wt_iew_batch_count'])){
550
+ $form_data['advanced_form_data']['wt_iew_batch_count'] = $batch_count;
551
+ }
552
+
553
  $file_as=(isset($this->allowed_export_file_type[$file_as]) ? $file_as : 'csv');
554
 
555
 
admin/modules/import/import.php CHANGED
@@ -1144,8 +1144,11 @@ class Wt_Import_Export_For_Woo_Basic_Import
1144
  }
1145
  protected function evaluate_data($key, $value, $data_row, $mapping_fields, $input_date_format)
1146
  {
 
 
 
1147
  $value=$this->add_input_file_data($key, $value, $data_row, $mapping_fields, $input_date_format);
1148
- $value=$this->do_arithmetic($value);
1149
  $data_row=null;
1150
  unset($data_row);
1151
  return $value;
1144
  }
1145
  protected function evaluate_data($key, $value, $data_row, $mapping_fields, $input_date_format)
1146
  {
1147
+ if (preg_match('/{(.*?)}/', $value, $match) == 1) {
1148
+ $maping_key = $match[1] ? $match[1]:'';
1149
+ }
1150
  $value=$this->add_input_file_data($key, $value, $data_row, $mapping_fields, $input_date_format);
1151
+ $value= !empty($data_row[$maping_key]) ? $this->do_arithmetic($value) : $value;
1152
  $data_row=null;
1153
  unset($data_row);
1154
  return $value;
admin/modules/import/views/_import_mapping_page.php CHANGED
@@ -7,8 +7,8 @@ if (!defined('ABSPATH')) {
7
  $click_to_use=__('Click to use');
8
  ?>
9
  <script type="text/javascript">
10
- var wt_iew_file_head_default=<?php echo json_encode($file_heading_default_fields);?>;
11
- var wt_iew_file_head_meta=<?php echo json_encode($file_heading_meta_fields);?>;
12
  </script>
13
 
14
  <!-- Mapping field editor popup -->
7
  $click_to_use=__('Click to use');
8
  ?>
9
  <script type="text/javascript">
10
+ var wt_iew_file_head_default=<?php echo json_encode(wt_iew_utf8ize_basic($file_heading_default_fields));?>;
11
+ var wt_iew_file_head_meta=<?php echo json_encode(wt_iew_utf8ize_basic($file_heading_meta_fields));?>;
12
  </script>
13
 
14
  <!-- Mapping field editor popup -->
admin/modules/user/export/export.php CHANGED
@@ -26,7 +26,6 @@ class Wt_Import_Export_For_Woo_basic_User_Export {
26
  */
27
  public function prepare_data_to_export($form_data, $batch_offset) {
28
 
29
-
30
  $export_user_roles = !empty($form_data['filter_form_data']['wt_iew_roles']) ? $form_data['filter_form_data']['wt_iew_roles'] : array();
31
  $export_sortby = !empty($form_data['filter_form_data']['wt_iew_sort_columns']) ? $form_data['filter_form_data']['wt_iew_sort_columns'] : array('user_login');
32
  $export_sort_order = !empty($form_data['filter_form_data']['wt_iew_order_by']) ? $form_data['filter_form_data']['wt_iew_order_by'] : 'ASC';
@@ -34,15 +33,11 @@ class Wt_Import_Export_For_Woo_basic_User_Export {
34
  $export_start_date = !empty($form_data['filter_form_data']['wt_iew_date_from']) ? $form_data['filter_form_data']['wt_iew_date_from'] : '';
35
  $export_end_date = !empty($form_data['filter_form_data']['wt_iew_date_to']) ? $form_data['filter_form_data']['wt_iew_date_to'] : '';
36
 
37
- $v_export_guest_user = (!empty($form_data['advanced_form_data']['wt_iew_export_guest_user']) && $form_data['advanced_form_data']['wt_iew_export_guest_user'] == 'Yes') ? true : false;
38
-
39
-
40
  $export_limit = !empty($form_data['filter_form_data']['wt_iew_limit']) ? intval($form_data['filter_form_data']['wt_iew_limit']) : 999999999; //user limit
41
  $current_offset = !empty($form_data['filter_form_data']['wt_iew_offset']) ? intval($form_data['filter_form_data']['wt_iew_offset']) : 0; //user offset
42
- $batch_count = !empty($form_data['advanced_form_data']['wt_iew_batch_count']) ? $form_data['advanced_form_data']['wt_iew_batch_count'] : 10;
43
 
44
 
45
-
46
  $real_offset = ($current_offset + $batch_offset);
47
 
48
  if($batch_count<=$export_limit)
@@ -125,31 +120,7 @@ class Wt_Import_Export_For_Woo_basic_User_Export {
125
  $data = self::get_customers_csv_row($user);
126
  $data_array[] = apply_filters('hf_customer_csv_exclude_admin', $data);
127
  }
128
-
129
- if ($v_export_guest_user) {
130
- $query_args = array(
131
- 'fields' => 'ids',
132
- 'post_type' => 'shop_order',
133
- 'post_status' => 'any',
134
- 'posts_per_page' => -1,
135
- );
136
- $query_args['meta_query'] = array(array(
137
- 'key' => '_customer_user',
138
- 'value' => 0,
139
- 'compare' => '',
140
- ));
141
- $query = new WP_Query($query_args);
142
- $order_ids = $query->posts;
143
- foreach ($order_ids as $order_id) {
144
- $order = new WC_Order($order_id);
145
- $user = get_user_by('email', $order->get_billing_email());
146
- if (!isset($user->ID)) {
147
- $data = self::get_guest_customers_csv_row($order);
148
- $data_array[] = apply_filters('hf_customer_csv_exclude_admin', $data);
149
- }
150
- }
151
- }
152
-
153
  $return['total'] = $total_records;
154
  $return['data'] = $data_array;
155
  return $return;
26
  */
27
  public function prepare_data_to_export($form_data, $batch_offset) {
28
 
 
29
  $export_user_roles = !empty($form_data['filter_form_data']['wt_iew_roles']) ? $form_data['filter_form_data']['wt_iew_roles'] : array();
30
  $export_sortby = !empty($form_data['filter_form_data']['wt_iew_sort_columns']) ? $form_data['filter_form_data']['wt_iew_sort_columns'] : array('user_login');
31
  $export_sort_order = !empty($form_data['filter_form_data']['wt_iew_order_by']) ? $form_data['filter_form_data']['wt_iew_order_by'] : 'ASC';
33
  $export_start_date = !empty($form_data['filter_form_data']['wt_iew_date_from']) ? $form_data['filter_form_data']['wt_iew_date_from'] : '';
34
  $export_end_date = !empty($form_data['filter_form_data']['wt_iew_date_to']) ? $form_data['filter_form_data']['wt_iew_date_to'] : '';
35
 
 
 
 
36
  $export_limit = !empty($form_data['filter_form_data']['wt_iew_limit']) ? intval($form_data['filter_form_data']['wt_iew_limit']) : 999999999; //user limit
37
  $current_offset = !empty($form_data['filter_form_data']['wt_iew_offset']) ? intval($form_data['filter_form_data']['wt_iew_offset']) : 0; //user offset
38
+ $batch_count = !empty($form_data['advanced_form_data']['wt_iew_batch_count']) ? $form_data['advanced_form_data']['wt_iew_batch_count'] : Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('default_export_batch');
39
 
40
 
 
41
  $real_offset = ($current_offset + $batch_offset);
42
 
43
  if($batch_count<=$export_limit)
120
  $data = self::get_customers_csv_row($user);
121
  $data_array[] = apply_filters('hf_customer_csv_exclude_admin', $data);
122
  }
123
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  $return['total'] = $total_records;
125
  $return['data'] = $data_array;
126
  return $return;
admin/modules/user/import/import.php CHANGED
@@ -81,15 +81,16 @@ class Wt_Import_Export_For_Woo_basic_User_Import {
81
  }
82
 
83
  public function prepare_data_to_import($import_data,$form_data, $batch_offset, $is_last_batch){
84
-
85
  $this->skip_new = !empty($form_data['advanced_form_data']['wt_iew_skip_new']) ? 1 : 0;
86
  $this->merge_with = !empty($form_data['advanced_form_data']['wt_iew_merge_with']) ? $form_data['advanced_form_data']['wt_iew_merge_with'] : 'id';
87
  $this->found_action = !empty($form_data['advanced_form_data']['wt_iew_found_action']) ? $form_data['advanced_form_data']['wt_iew_found_action'] : 'skip';
88
- $this->use_same_password = !empty($form_data['advanced_form_data']['wt_iew_use_same_password']) ? 1 : 0;
89
  $this->merge_empty_cells = !empty($form_data['advanced_form_data']['wt_iew_merge_empty_cells']) ? 1 : 0;
90
  $this->send_mail = !empty($form_data['advanced_form_data']['wt_iew_send_mail']) ? 1 : 0;
91
  $this->delete_existing = !empty($form_data['advanced_form_data']['wt_iew_delete_products']) ? 1 : 0;
92
-
 
93
  wp_defer_term_counting(true);
94
  wp_defer_comment_counting(true);
95
  wp_suspend_cache_invalidation(true);
81
  }
82
 
83
  public function prepare_data_to_import($import_data,$form_data, $batch_offset, $is_last_batch){
84
+
85
  $this->skip_new = !empty($form_data['advanced_form_data']['wt_iew_skip_new']) ? 1 : 0;
86
  $this->merge_with = !empty($form_data['advanced_form_data']['wt_iew_merge_with']) ? $form_data['advanced_form_data']['wt_iew_merge_with'] : 'id';
87
  $this->found_action = !empty($form_data['advanced_form_data']['wt_iew_found_action']) ? $form_data['advanced_form_data']['wt_iew_found_action'] : 'skip';
88
+ $this->use_same_password = isset($form_data['advanced_form_data']['wt_iew_use_same_password']) ? $form_data['advanced_form_data']['wt_iew_use_same_password'] : 1;
89
  $this->merge_empty_cells = !empty($form_data['advanced_form_data']['wt_iew_merge_empty_cells']) ? 1 : 0;
90
  $this->send_mail = !empty($form_data['advanced_form_data']['wt_iew_send_mail']) ? 1 : 0;
91
  $this->delete_existing = !empty($form_data['advanced_form_data']['wt_iew_delete_products']) ? 1 : 0;
92
+
93
+
94
  wp_defer_term_counting(true);
95
  wp_defer_comment_counting(true);
96
  wp_suspend_cache_invalidation(true);
admin/modules/user/user.php CHANGED
@@ -77,7 +77,7 @@ class Wt_Import_Export_For_Woo_basic_User {
77
  if ($this->module_base != $base) {
78
  return $import_data;
79
  }
80
-
81
  if(0 == $batch_offset){
82
  $memory = size_format(wt_let_to_num_basic(ini_get('memory_limit')));
83
  $wp_memory = size_format(wt_let_to_num_basic(WP_MEMORY_LIMIT));
@@ -99,7 +99,7 @@ class Wt_Import_Export_For_Woo_basic_User {
99
  public function exporter_do_export($export_data, $base, $step, $form_data, $selected_template_data, $method_export, $batch_offset) {
100
  if ($this->module_base != $base) {
101
  return $export_data;
102
- }
103
 
104
  switch ($method_export) {
105
  case 'quick':
77
  if ($this->module_base != $base) {
78
  return $import_data;
79
  }
80
+
81
  if(0 == $batch_offset){
82
  $memory = size_format(wt_let_to_num_basic(ini_get('memory_limit')));
83
  $wp_memory = size_format(wt_let_to_num_basic(WP_MEMORY_LIMIT));
99
  public function exporter_do_export($export_data, $base, $step, $form_data, $selected_template_data, $method_export, $batch_offset) {
100
  if ($this->module_base != $base) {
101
  return $export_data;
102
+ }
103
 
104
  switch ($method_export) {
105
  case 'quick':
helpers/class-wt-common-helper.php CHANGED
@@ -282,3 +282,16 @@ function wt_removeBomUtf8_basic($s) {
282
  }
283
  }
284
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  }
283
  }
284
  }
285
+
286
+ if(!function_exists('wt_iew_utf8ize_basic')){
287
+ function wt_iew_utf8ize_basic($d) {
288
+ if (is_array($d)) {
289
+ foreach ($d as $k => $v) {
290
+ $d[$k] = wt_iew_utf8ize_basic($v);
291
+ }
292
+ } else if (is_string ($d)) {
293
+ return utf8_encode($d);
294
+ }
295
+ return $d;
296
+ }
297
+ }
includes/class-wt-import-export-for-woo.php CHANGED
@@ -80,7 +80,7 @@ class Wt_Import_Export_For_Woo_Basic {
80
  if ( defined( 'WT_U_IEW_VERSION' ) ) {
81
  $this->version = WT_U_IEW_VERSION;
82
  } else {
83
- $this->version = '2.0.1';
84
  }
85
  $this->plugin_name = 'wt-import-export-for-woo-basic';
86
 
80
  if ( defined( 'WT_U_IEW_VERSION' ) ) {
81
  $this->version = WT_U_IEW_VERSION;
82
  } else {
83
+ $this->version = '2.0.2';
84
  }
85
  $this->plugin_name = 'wt-import-export-for-woo-basic';
86
 
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === Import Export WordPress Users ===
2
  Contributors: webtoffee
3
  Donate link: https://www.webtoffee.com/plugins/
4
- Tags: user import, user export, export customers, import customers, export users to csv, import users from csv, woocommerce export customers, export import users, woocommerce import customers, woocommerce export customer email
5
  Requires at least: 3.0.1
6
  Tested up to: 5.5
7
  Requires PHP: 5.6
8
- Stable tag: 2.0.1
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -20,7 +20,7 @@ Import users and export users made fast and simple! Import Export WordPress User
20
 
21
  &#128312; Users Export - Export Users to CSV file.</li>
22
  &#128312; Users import - Import Users from CSV format to WordPress/WooCommerce Store.
23
- &#128312; Tested OK with WooCommerce 4.6.1
24
  &#128312; Tested OK with PHP 7.3.5
25
 
26
  Highlights: WordPress Users Export, WordPress Users CSV Import Suite, Export WordPress Users to CSV. Pro Version supports export and import of all additional user meta like WooCommerce details.
@@ -160,6 +160,11 @@ By default, admin and store manager are given access to export users. Please vis
160
  3. Premium export Screen
161
 
162
  == Changelog ==
 
 
 
 
 
163
  = 2.0.1 =
164
  * Fix: Browser popup blocker issue.
165
  * Tested OK with WC 4.6.1.
@@ -284,7 +289,8 @@ By default, admin and store manager are given access to export users. Please vis
284
 
285
  == Upgrade Notice ==
286
 
287
- = 2.0.1 =
288
- * Fix: Browser popup blocker issue.
289
- * Tested OK with WC 4.6.1.
 
290
  * Version 2.0.0 onward has been revamped majorly.
1
  === Import Export WordPress Users ===
2
  Contributors: webtoffee
3
  Donate link: https://www.webtoffee.com/plugins/
4
+ Tags: user import, user export, csv, woocommerce, customers, import, export, export customers, import customers, export users to csv, import users from csv, woocommerce export customers, export import users, woocommerce import customers, woocommerce export customer email
5
  Requires at least: 3.0.1
6
  Tested up to: 5.5
7
  Requires PHP: 5.6
8
+ Stable tag: 2.0.2
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
20
 
21
  &#128312; Users Export - Export Users to CSV file.</li>
22
  &#128312; Users import - Import Users from CSV format to WordPress/WooCommerce Store.
23
+ &#128312; Tested OK with WooCommerce 4.7.0
24
  &#128312; Tested OK with PHP 7.3.5
25
 
26
  Highlights: WordPress Users Export, WordPress Users CSV Import Suite, Export WordPress Users to CSV. Pro Version supports export and import of all additional user meta like WooCommerce details.
160
  3. Premium export Screen
161
 
162
  == Changelog ==
163
+ = 2.0.2 =
164
+ * Fix: Batch count issue for quick export.
165
+ * Fix: Issue with password migration for quick import.
166
+ * Tested OK with WC 4.7.0.
167
+ * Version 2.0.0 onward has been revamped majorly.
168
  = 2.0.1 =
169
  * Fix: Browser popup blocker issue.
170
  * Tested OK with WC 4.6.1.
289
 
290
  == Upgrade Notice ==
291
 
292
+ = 2.0.2 =
293
+ * Fix: Batch count issue for quick export.
294
+ * Fix: Issue with password migration for quick import.
295
+ * Tested OK with WC 4.7.0.
296
  * Version 2.0.0 onward has been revamped majorly.
users-customers-import-export-for-wp-woocommerce.php CHANGED
@@ -6,8 +6,8 @@
6
  Description: Export and Import User/Customers details From and To your WordPress/WooCommerce.
7
  Author: WebToffee
8
  Author URI: https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/
9
- Version: 2.0.1
10
- WC tested up to: 4.6.1
11
  Text Domain: users-customers-import-export-for-wp-woocommerce
12
  License: GPLv3
13
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -43,7 +43,7 @@ if ( ! defined( 'WT_IEW_DEBUG_BASIC' ) ) {
43
  * Start at version 1.0.0 and use SemVer - https://semver.org
44
  * Rename this for your plugin and update it as you release new versions.
45
  */
46
- define( 'WT_U_IEW_VERSION', '2.0.1' );
47
 
48
  /**
49
  * The code that runs during plugin activation.
@@ -123,7 +123,7 @@ function wt_uiew_plugin_action_links_basic_user($links)
123
 
124
  $links[] = '<a href="https://www.webtoffee.com/user-import-export-plugin-wordpress-user-guide/" target="_blank">'.__('Documentation').'</a>';
125
  $links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/">' . __('Support') . '</a>';
126
- $links[] = '<a target="_blank" href="https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/?utm_source=user-import-export&utm_medium=dashboard&utm_campaign=upgrade" style="color:#3db634;">' . __('Premium Upgrade') . '</a>';
127
  if (array_key_exists('deactivate', $links)) {
128
  $links['deactivate'] = str_replace('<a', '<a class="userimport-deactivate-link"', $links['deactivate']);
129
  }
6
  Description: Export and Import User/Customers details From and To your WordPress/WooCommerce.
7
  Author: WebToffee
8
  Author URI: https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/
9
+ Version: 2.0.2
10
+ WC tested up to: 4.7.0
11
  Text Domain: users-customers-import-export-for-wp-woocommerce
12
  License: GPLv3
13
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
43
  * Start at version 1.0.0 and use SemVer - https://semver.org
44
  * Rename this for your plugin and update it as you release new versions.
45
  */
46
+ define( 'WT_U_IEW_VERSION', '2.0.2' );
47
 
48
  /**
49
  * The code that runs during plugin activation.
123
 
124
  $links[] = '<a href="https://www.webtoffee.com/user-import-export-plugin-wordpress-user-guide/" target="_blank">'.__('Documentation').'</a>';
125
  $links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/">' . __('Support') . '</a>';
126
+ $links[] = '<a target="_blank" href="https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/?utm_source=free_plugin_listing&utm_medium=user_imp_exp_basic&utm_campaign=User_Import_Export&utm_content='.WT_U_IEW_VERSION.'" style="color:#3db634;">' . __('Premium Upgrade') . '</a>';
127
  if (array_key_exists('deactivate', $links)) {
128
  $links['deactivate'] = str_replace('<a', '<a class="userimport-deactivate-link"', $links['deactivate']);
129
  }