Import users from CSV with meta - Version 1.10.10

Version Description

  • Thanks to Attainable Adventure Cruising Ltd now the system to import passwords hashed directly from the CSV has been fixed
  • Thanks to Kevin Price-Ward and Peri Lane now the system does not include the default role when creating a new user
  • Plugin tested up to WordPress 4.9.4
Download this release

Release Info

Developer carazo
Plugin Icon 128x128 Import users from CSV with meta
Version 1.10.10
Comparing to
See all releases

Code changes from version 1.10.9.1 to 1.10.10

import-users-from-csv-with-meta.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Import users from CSV with meta
4
  Plugin URI: https://www.codection.com
5
  Description: This plugins allows to import users using CSV files to WP database automatically
6
- Version: 1.10.9.1
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
3
  Plugin Name: Import users from CSV with meta
4
  Plugin URI: https://www.codection.com
5
  Description: This plugins allows to import users using CSV files to WP database automatically
6
+ Version: 1.10.10
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
importer.php CHANGED
@@ -278,7 +278,7 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false
278
  if( $created || $update_roles_existing_users != 'no' ){
279
  if(!( in_array("administrator", acui_get_roles($user_id), FALSE) || is_multisite() && is_super_admin( $user_id ) )){
280
 
281
- if( $update_roles_existing_users == 'yes' ){
282
  $default_roles = $user_object->roles;
283
  foreach ( $default_roles as $default_role ) {
284
  $user_object->remove_role( $default_role );
@@ -331,7 +331,8 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false
331
  continue;
332
  }
333
  elseif( strtolower( $headers[ $i ] ) == "user_pass" ){ // hashed pass
334
- $wpdb->update( $wpdb->users, array( 'user_pass' => $data[ $i ] ), array( 'ID' => $user_id ) );
 
335
  }
336
  elseif( in_array( $headers[ $i ], $wp_users_fields ) ){ // wp_user data
337
  if( empty( $data[ $i ] ) && $empty_cell_action == "leave" ){
278
  if( $created || $update_roles_existing_users != 'no' ){
279
  if(!( in_array("administrator", acui_get_roles($user_id), FALSE) || is_multisite() && is_super_admin( $user_id ) )){
280
 
281
+ if( $update_roles_existing_users == 'yes' || $created ){
282
  $default_roles = $user_object->roles;
283
  foreach ( $default_roles as $default_role ) {
284
  $user_object->remove_role( $default_role );
331
  continue;
332
  }
333
  elseif( strtolower( $headers[ $i ] ) == "user_pass" ){ // hashed pass
334
+ wp_insert_user( array( 'ID' => $user_id, 'user_pass' => $data[ $i ] ) );
335
+ continue;
336
  }
337
  elseif( in_array( $headers[ $i ], $wp_users_fields ) ){ // wp_user data
338
  if( empty( $data[ $i ] ) && $empty_cell_action == "leave" ){
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: carazo, hornero
3
  Donate link: http://paypal.me/codection
4
  Tags: csv, import, importer, meta data, meta, user, users, user meta, editor, profile, custom, fields, delimiter, update, insert
5
  Requires at least: 3.4
6
- Tested up to: 4.9.1
7
- Stable tag: 1.10.9.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -70,6 +70,11 @@ Plugin will automatically detect:
70
 
71
  == Changelog ==
72
 
 
 
 
 
 
73
  = 1.10.9.1 =
74
  * Thanks to @lucile-agence-pulsi for reporting a bug (https://wordpress.org/support/topic/show-extra-profile-fields/) now this is solved
75
 
3
  Donate link: http://paypal.me/codection
4
  Tags: csv, import, importer, meta data, meta, user, users, user meta, editor, profile, custom, fields, delimiter, update, insert
5
  Requires at least: 3.4
6
+ Tested up to: 4.9.4
7
+ Stable tag: 1.10.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
70
 
71
  == Changelog ==
72
 
73
+ = 1.10.10 =
74
+ * Thanks to Attainable Adventure Cruising Ltd now the system to import passwords hashed directly from the CSV has been fixed
75
+ * Thanks to Kevin Price-Ward and Peri Lane now the system does not include the default role when creating a new user
76
+ * Plugin tested up to WordPress 4.9.4
77
+
78
  = 1.10.9.1 =
79
  * Thanks to @lucile-agence-pulsi for reporting a bug (https://wordpress.org/support/topic/show-extra-profile-fields/) now this is solved
80