Import users from CSV with meta - Version 1.10.11

Version Description

  • Administrator are not deleted in cron task
  • Some hashed passwords was not being imported correctly because of wp_unslash() function into wp_insert_user(), issue fixed
Download this release

Release Info

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

Code changes from version 1.10.10 to 1.10.11

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.10
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.11
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
importer.php CHANGED
@@ -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
- 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
@@ -536,7 +537,10 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false
536
  if( $is_cron && get_option( "acui_cron_delete_users" ) ):
537
  require_once( ABSPATH . 'wp-admin/includes/user.php');
538
 
539
- $all_users = get_users( array( 'fields' => array( 'ID' ) ) );
 
 
 
540
  $cron_delete_users_assign_posts = get_option( "acui_cron_delete_users_assign_posts");
541
 
542
  foreach ( $all_users as $user ) {
331
  continue;
332
  }
333
  elseif( strtolower( $headers[ $i ] ) == "user_pass" ){ // hashed pass
334
+ $wpdb->update( $wpdb->users, array( 'user_pass' => wp_slash( $data[ $i ] ) ), array( 'ID' => $user_id ) );
335
+ wp_cache_delete( $user_id, 'users' );
336
  continue;
337
  }
338
  elseif( in_array( $headers[ $i ], $wp_users_fields ) ){ // wp_user data
537
  if( $is_cron && get_option( "acui_cron_delete_users" ) ):
538
  require_once( ABSPATH . 'wp-admin/includes/user.php');
539
 
540
+ $all_users = get_users( array(
541
+ 'fields' => array( 'ID' ),
542
+ 'role__not_in' => array( 'administrator' )
543
+ ) );
544
  $cron_delete_users_assign_posts = get_option( "acui_cron_delete_users_assign_posts");
545
 
546
  foreach ( $all_users as $user ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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,6 +70,10 @@ Plugin will automatically detect:
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
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.11
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.11 =
74
+ * Administrator are not deleted in cron task
75
+ * Some hashed passwords was not being imported correctly because of wp_unslash() function into wp_insert_user(), issue fixed
76
+
77
  = 1.10.10 =
78
  * Thanks to Attainable Adventure Cruising Ltd now the system to import passwords hashed directly from the CSV has been fixed
79
  * Thanks to Kevin Price-Ward and Peri Lane now the system does not include the default role when creating a new user