Import Export WordPress Users and WooCommerce Customers - Version 1.1.6

Version Description

  • Bug fix.
Download this release

Release Info

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

Code changes from version 1.1.4 to 1.1.6

customer-import-export.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: 1.1.4
10
- WC tested up to: 3.4.4
11
  Text Domain: wf_customer_import_export
12
  License: GPLv3
13
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -64,6 +64,9 @@ if (!class_exists('WF_Customer_Import_Export_CSV')) :
64
  add_action('init', array($this, 'catch_export_request'), 20);
65
  add_action('init', array($this, 'catch_save_settings'), 20);
66
  add_action('admin_init', array($this, 'register_importers'));
 
 
 
67
 
68
  if (!get_option('UEIPF_Webtoffee_storefrog_admin_notices_dismissed')) {
69
  add_action('admin_notices', array($this, 'webtoffee_storefrog_admin_notices'));
@@ -160,8 +163,8 @@ if (!class_exists('WF_Customer_Import_Export_CSV')) :
160
  }
161
  $screen = get_current_screen();
162
 
163
- $allowed_screen_ids = array('users_page_hf_wordpress_customer_im_ex', 'admin');
164
- if (in_array($screen->id, $allowed_screen_ids)) {
165
 
166
  $notice = __('<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', 'wf_customer_import_export');
167
  $notice .= __('<h3>Use StoreFrog Migration Services.</h3>', 'wf_customer_import_export');
@@ -189,6 +192,42 @@ if (!class_exists('WF_Customer_Import_Export_CSV')) :
189
  }
190
  wp_die(-1);
191
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
 
193
  }
194
 
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: 1.1.6
10
+ WC tested up to: 3.4.5
11
  Text Domain: wf_customer_import_export
12
  License: GPLv3
13
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
64
  add_action('init', array($this, 'catch_export_request'), 20);
65
  add_action('init', array($this, 'catch_save_settings'), 20);
66
  add_action('admin_init', array($this, 'register_importers'));
67
+
68
+ add_filter('admin_footer_text', array($this, 'WT_admin_footer_text'), 100);
69
+ add_action('wp_ajax_ucie_wt_review_plugin', array($this, "review_plugin"));
70
 
71
  if (!get_option('UEIPF_Webtoffee_storefrog_admin_notices_dismissed')) {
72
  add_action('admin_notices', array($this, 'webtoffee_storefrog_admin_notices'));
163
  }
164
  $screen = get_current_screen();
165
 
166
+ $allowed_screen_ids = array('users_page_hf_wordpress_customer_im_ex');
167
+ if (in_array($screen->id, $allowed_screen_ids)|| (isset($_GET['import']) && $_GET['import'] == 'wordpress_hf_user_csv')) {
168
 
169
  $notice = __('<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', 'wf_customer_import_export');
170
  $notice .= __('<h3>Use StoreFrog Migration Services.</h3>', 'wf_customer_import_export');
192
  }
193
  wp_die(-1);
194
  }
195
+
196
+ public function WT_admin_footer_text($footer_text) {
197
+ // if (!current_user_can('editor') || !current_user_can('administrator')) {
198
+ // return $footer_text;
199
+ // }
200
+ $screen = get_current_screen();
201
+ $allowed_screen_ids = array('users_page_hf_wordpress_customer_im_ex');
202
+ if (in_array($screen->id, $allowed_screen_ids) || (isset($_GET['import']) && $_GET['import'] == 'wordpress_hf_user_csv')) {
203
+ if (!get_option('ucie_wt_plugin_reviewed')) {
204
+ $footer_text = sprintf(
205
+ __('If you like the plugin please leave us a %1$s review.', 'wf_customer_import_export'), '<a href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews?rate=5#new-post" target="_blank" class="wt-review-link" data-rated="' . esc_attr__('Thanks :)', 'wf_customer_import_export') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
206
+ );
207
+
208
+ $user_js = "jQuery( 'a.wt-review-link' ).click( function() {
209
+ jQuery.post( '" . admin_url("admin-ajax.php") . "', { action: 'ucie_wt_review_plugin' } );
210
+ jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
211
+ });";
212
+ $js = "<!-- User Import JavaScript -->\n<script type=\"text/javascript\">\njQuery(function($) { $user_js });\n</script>\n";
213
+ echo $js;
214
+
215
+
216
+ } else {
217
+ $footer_text = __('Thank you for your review.', 'wf_customer_import_export');
218
+ }
219
+ }
220
+
221
+ return '<i>' . $footer_text . '</i>';
222
+ }
223
+
224
+ public function review_plugin() {
225
+ // if (!current_user_can('administrator')) {
226
+ // wp_die(-1);
227
+ // }
228
+ update_option('ucie_wt_plugin_reviewed', 1);
229
+ wp_die();
230
+ }
231
 
232
  }
233
 
images/calendar.png CHANGED
File without changes
images/documentation.png CHANGED
File without changes
images/storefrog.png CHANGED
File without changes
images/support.png CHANGED
File without changes
images/video.png CHANGED
File without changes
images/wf-ajax-loader.gif CHANGED
File without changes
images/wf-failed.png CHANGED
File without changes
images/wf-import.png CHANGED
File without changes
images/wf-notice.png CHANGED
File without changes
images/wf-success.png CHANGED
File without changes
includes/class-wf-customerimpexpcsv-admin-screen.php CHANGED
File without changes
includes/class-wf-customerimpexpcsv-ajax-handler.php CHANGED
File without changes
includes/exporter/class-wf-customerimpexpcsv-exporter.php CHANGED
File without changes
includes/exporter/data/data-wf-post-columns.php CHANGED
File without changes
includes/importer/class-wf-csv-parser.php CHANGED
File without changes
includes/importer/class-wf-customerimpexpcsv-customer-import.php CHANGED
@@ -478,7 +478,7 @@ class WF_CustomerImpExpCsv_Customer_Import extends WP_Importer {
478
  $record_offset = 0;
479
 
480
  $i = 0;
481
-
482
  foreach ($this->parsed_data as $key => &$item) {
483
  $user = $this->parser->parse_users($item, $this->raw_headers, $merging, $record_offset);
484
  if (!is_wp_error($user))
@@ -683,6 +683,7 @@ class WF_CustomerImpExpCsv_Customer_Import extends WP_Importer {
683
  }
684
 
685
  public function hf_create_customer($data) {
 
686
  $customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
687
  $username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
688
  $customer_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
@@ -717,15 +718,14 @@ class WF_CustomerImpExpCsv_Customer_Import extends WP_Importer {
717
  wp_insert_user(array('ID' => $found_customer,'user_login'=>$username,'user_email'=>$customer_email, 'user_pass' => $password));
718
 
719
  if (!is_wp_error($found_customer)) {
 
 
720
  $wp_user_object = new WP_User($found_customer);
721
  $roles = get_editable_roles();
722
- $new_roles_str = str_replace(' ','',$data['user_details']['roles']);
723
- $new_roles = explode(',', $new_roles_str);
724
  $new_roles = array_intersect( $new_roles, array_keys( $roles ) );
725
- error_log(print_r($new_roles,true));
726
  $roles_to_remove = array();
727
- $user_roles = array_intersect( array_values( $wp_user_object->roles ), array_keys( $roles ) ); //subscriber
728
-
729
  if ( ! $new_roles ) {
730
  // If there are no roles, delete all of the user's roles
731
  $roles_to_remove = $user_roles;
@@ -738,8 +738,8 @@ class WF_CustomerImpExpCsv_Customer_Import extends WP_Importer {
738
  if(!empty($new_roles)){
739
  // Make sure that we don't call $wp_user_object->add_role() any more than it's necessary
740
  $_new_roles = array_diff( $new_roles, array_intersect( array_values( $wp_user_object->roles ), array_keys( $roles ) ) );
741
- foreach ( $_new_roles as $_role1 ) {
742
- $wp_user_object->add_role( $_role1 );
743
  }
744
  }
745
  $user_nicename = (!empty($data['user_details']['user_nicename'])) ? $data['user_details']['user_nicename'] : '';
478
  $record_offset = 0;
479
 
480
  $i = 0;
481
+ //echo '<pre>';print_r($this->parsed_data);exit;
482
  foreach ($this->parsed_data as $key => &$item) {
483
  $user = $this->parser->parse_users($item, $this->raw_headers, $merging, $record_offset);
484
  if (!is_wp_error($user))
683
  }
684
 
685
  public function hf_create_customer($data) {
686
+
687
  $customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
688
  $username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
689
  $customer_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
718
  wp_insert_user(array('ID' => $found_customer,'user_login'=>$username,'user_email'=>$customer_email, 'user_pass' => $password));
719
 
720
  if (!is_wp_error($found_customer)) {
721
+
722
+
723
  $wp_user_object = new WP_User($found_customer);
724
  $roles = get_editable_roles();
725
+ $new_roles = explode(',', $data['user_details']['roles']);
 
726
  $new_roles = array_intersect( $new_roles, array_keys( $roles ) );
 
727
  $roles_to_remove = array();
728
+ $user_roles = array_intersect( array_values( $wp_user_object->roles ), array_keys( $roles ) );
 
729
  if ( ! $new_roles ) {
730
  // If there are no roles, delete all of the user's roles
731
  $roles_to_remove = $user_roles;
738
  if(!empty($new_roles)){
739
  // Make sure that we don't call $wp_user_object->add_role() any more than it's necessary
740
  $_new_roles = array_diff( $new_roles, array_intersect( array_values( $wp_user_object->roles ), array_keys( $roles ) ) );
741
+ foreach ( $_new_roles as $_role ) {
742
+ $wp_user_object->add_role( $_role );
743
  }
744
  }
745
  $user_nicename = (!empty($data['user_details']['user_nicename'])) ? $data['user_details']['user_nicename'] : '';
includes/importer/class-wf-customerimpexpcsv-importer.php CHANGED
File without changes
includes/importer/data/data-wf-reserved-fields-pair.php CHANGED
File without changes
includes/importer/views/html-wf-import-greeting.php CHANGED
File without changes
includes/importer/views/html-wf-import-options.php CHANGED
File without changes
includes/importer/views/market.php CHANGED
File without changes
includes/settings/class-wf-customerimpexpcsv-settings.php CHANGED
File without changes
includes/views/export/html-wf-export-customers.php CHANGED
@@ -87,8 +87,12 @@
87
  <p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Users', 'wf_customer_import_export'); ?>" /></p>
88
  </form>
89
  </div>
 
 
90
  <script>
91
- jQuery(document).ready(function() {
92
- jQuery('.wc-enhanced-select').select2();
93
- });
94
- </script>
 
 
87
  <p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Users', 'wf_customer_import_export'); ?>" /></p>
88
  </form>
89
  </div>
90
+
91
+ <?php if(!class_exists('WooCommerce')){ ?>
92
  <script>
93
+ jQuery(document).ready(function () {
94
+ jQuery('.wc-enhanced-select').select2();
95
+
96
+ });
97
+ </script>
98
+ <?php } ?>
includes/views/export/market.php CHANGED
@@ -77,7 +77,7 @@ if ( ! defined( 'ABSPATH' ) ) {
77
  .wf_customer_import_export .pipe-review-widget{
78
  background: #fff;
79
  padding: 5px;
80
- margin-top: 23px;
81
  }
82
  .wf_customer_import_export .pipe-review-widget p{
83
  margin-right:5px;
@@ -85,6 +85,11 @@ if ( ! defined( 'ABSPATH' ) ) {
85
  }
86
  </style>
87
  <div class="wf_customer_import_export market-box table-box-main">
 
 
 
 
 
88
  <div class="pipe-premium-features">
89
  <center><a href="http://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-primary button-go-pro"><?php _e('Upgrade to Premium Version', 'wf_customer_import_export'); ?></a></center>
90
  <span>
@@ -107,9 +112,5 @@ if ( ! defined( 'ABSPATH' ) ) {
107
 
108
  <a href="https://www.xadapter.com/category/documentation/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-doc-demo"><?php _e('Documentation', 'wf_customer_import_export'); ?></a></center>
109
  </div>
110
- <div class="pipe-review-widget">
111
- <?php
112
- echo sprintf(__('<div class=""><p><i>If you like the plugin please leave us a %1$s review!</i><p></div>', 'wf_customer_import_export'), '<a href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews?rate=5#new-post" target="_blank" class="xa-pipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'wf_customer_import_export') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>');
113
- ?>
114
- </div>
115
  </div>
77
  .wf_customer_import_export .pipe-review-widget{
78
  background: #fff;
79
  padding: 5px;
80
+ /*margin-top: 23px;*/
81
  }
82
  .wf_customer_import_export .pipe-review-widget p{
83
  margin-right:5px;
85
  }
86
  </style>
87
  <div class="wf_customer_import_export market-box table-box-main">
88
+ <div class="pipe-review-widget">
89
+ <?php
90
+ echo sprintf(__('<div class=""><p><i>If you like the plugin please leave us a %1$s review!</i><p></div>', 'wf_customer_import_export'), '<a href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews?rate=5#new-post" target="_blank" class="xa-pipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'wf_customer_import_export') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>');
91
+ ?>
92
+ </div>
93
  <div class="pipe-premium-features">
94
  <center><a href="http://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-primary button-go-pro"><?php _e('Upgrade to Premium Version', 'wf_customer_import_export'); ?></a></center>
95
  <span>
112
 
113
  <a href="https://www.xadapter.com/category/documentation/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-doc-demo"><?php _e('Documentation', 'wf_customer_import_export'); ?></a></center>
114
  </div>
115
+
 
 
 
 
116
  </div>
includes/views/html-wf-admin-screen.php CHANGED
File without changes
includes/views/html-wf-help-guide.php CHANGED
File without changes
includes/views/import/html-wf-import-customers.php CHANGED
File without changes
lang/wf_customer_import_export-fr_FR.po CHANGED
File without changes
license.txt CHANGED
File without changes
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.webtoffee.com/plugins/
4
  Tags: Export Users to CSV, Import Users from CSV, woocommerce export customers, user export, export import users, woocommerce import customers, woocommerce export customer email
5
  Requires at least: 3.0.1
6
  Tested up to: 4.9.8
7
- Stable tag: 1.1.4
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -19,7 +19,7 @@ Import users and export users made fast and simple! Import Export WordPress User
19
 
20
  &#128312; Users Export - Export Users to CSV file.</li>
21
  &#128312; Users import - Import Users from CSV format to WordPress/WooCommerce Store.
22
- &#128312; Tested OK with WooCommerce 3.4.4.
23
 
24
  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 deatils.
25
 
@@ -147,7 +147,12 @@ No. You may want to use https://wordpress.org/plugins/order-import-export-for-wo
147
  3. Premium export Screen
148
 
149
  == Changelog ==
150
-
 
 
 
 
 
151
  = 1.1.4 =
152
  * implement hashed/plaintext password processing during import.
153
  * Bug fix: User role import.
@@ -185,6 +190,5 @@ No. You may want to use https://wordpress.org/plugins/order-import-export-for-wo
185
 
186
  == Upgrade Notice ==
187
 
188
- = 1.1.4 =
189
- * implement hashed/plaintext password processing during import.
190
- * Bug fix: User role import.
4
  Tags: Export Users to CSV, Import Users from CSV, woocommerce export customers, user export, export import users, woocommerce import customers, woocommerce export customer email
5
  Requires at least: 3.0.1
6
  Tested up to: 4.9.8
7
+ Stable tag: 1.1.6
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
19
 
20
  &#128312; Users Export - Export Users to CSV file.</li>
21
  &#128312; Users import - Import Users from CSV format to WordPress/WooCommerce Store.
22
+ &#128312; Tested OK with WooCommerce 3.4.5.
23
 
24
  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 deatils.
25
 
147
  3. Premium export Screen
148
 
149
  == Changelog ==
150
+
151
+ = 1.1.6 =
152
+ * Bug fix.
153
+ = 1.1.5 =
154
+ * Tested OK with WC 3.4.5.
155
+ * Review link added on footer.
156
  = 1.1.4 =
157
  * implement hashed/plaintext password processing during import.
158
  * Bug fix: User role import.
190
 
191
  == Upgrade Notice ==
192
 
193
+ = 1.1.6 =
194
+ * Bug fix.
 
styles/select2.css CHANGED
File without changes
styles/select2.js CHANGED
File without changes
styles/wf-style.css CHANGED
File without changes