Import users from CSV with meta - Version 1.14.3.7

Version Description

  • New filters added to custom message shown in log or regular import
  • Last roles used are remembered in import, to avoid you have to choose all time different roles
Download this release

Release Info

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

Code changes from version 1.14.3.6 to 1.14.3.7

classes/homepage.php CHANGED
@@ -4,6 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
4
 
5
  class ACUI_Homepage{
6
  public static function admin_gui(){
 
7
  $args_old_csv = array( 'post_type'=> 'attachment', 'post_mime_type' => 'text/csv', 'post_status' => 'inherit', 'posts_per_page' => -1 );
8
  $old_csv_files = new WP_Query( $args_old_csv );
9
 
@@ -73,10 +74,10 @@ class ACUI_Homepage{
73
  <th scope="row"><label for="role"><?php _e( 'Default role', 'import-users-from-csv-with-meta' ); ?></label></th>
74
  <td>
75
  <?php
76
- $list_roles = acui_get_editable_roles();
77
 
78
  foreach ($list_roles as $key => $value) {
79
- if($key == "subscriber")
80
  echo "<label style='margin-right:5px;'><input name='role[]' type='checkbox' checked='checked' value='$key'/>$value</label>";
81
  else
82
  echo "<label style='margin-right:5px;'><input name='role[]' type='checkbox' value='$key'/>$value</label>";
4
 
5
  class ACUI_Homepage{
6
  public static function admin_gui(){
7
+ $last_roles_used = empty( get_option( 'acui_last_roles_used' ) ) ? array( 'subscriber' ) : get_option( 'acui_last_roles_used' );
8
  $args_old_csv = array( 'post_type'=> 'attachment', 'post_mime_type' => 'text/csv', 'post_status' => 'inherit', 'posts_per_page' => -1 );
9
  $old_csv_files = new WP_Query( $args_old_csv );
10
 
74
  <th scope="row"><label for="role"><?php _e( 'Default role', 'import-users-from-csv-with-meta' ); ?></label></th>
75
  <td>
76
  <?php
77
+ $list_roles = acui_get_editable_roles();
78
 
79
  foreach ($list_roles as $key => $value) {
80
+ if( in_array( $key, $last_roles_used ) )
81
  echo "<label style='margin-right:5px;'><input name='role[]' type='checkbox' checked='checked' value='$key'/>$value</label>";
82
  else
83
  echo "<label style='margin-right:5px;'><input name='role[]' type='checkbox' value='$key'/>$value</label>";
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.14.3.6
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
@@ -11,7 +11,6 @@ License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
  Text Domain: import-users-from-csv-with-meta
12
  Domain Path: /languages
13
  */
14
-
15
  if ( ! defined( 'ABSPATH' ) ) exit;
16
 
17
  $wp_users_fields = array( "id", "user_nicename", "user_url", "display_name", "nickname", "first_name", "last_name", "description", "jabber", "aim", "yim", "user_registered", "password", "user_pass", "locale" );
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.14.3.7
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
11
  Text Domain: import-users-from-csv-with-meta
12
  Domain Path: /languages
13
  */
 
14
  if ( ! defined( 'ABSPATH' ) ) exit;
15
 
16
  $wp_users_fields = array( "id", "user_nicename", "user_url", "display_name", "nickname", "first_name", "last_name", "description", "jabber", "aim", "yim", "user_registered", "password", "user_pass", "locale" );
importer.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
4
 
5
  function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false, $is_frontend = false ){?>
6
  <div class="wrap">
7
- <h2><?php _e('Importing users','import-users-from-csv-with-meta'); ?></h2>
8
  <?php
9
  set_time_limit(0);
10
 
@@ -79,8 +79,9 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
79
  }
80
 
81
  // action
82
- echo "<h3>" . __('Ready to registers','import-users-from-csv-with-meta') . "</h3>";
83
- echo "<p>" . __('First row represents the form of sheet','import-users-from-csv-with-meta') . "</p>";
 
84
  $row = 0;
85
  $positions = array();
86
  $error_importing = false;
@@ -162,7 +163,7 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
162
  width:200px!important;
163
  }
164
  </style>
165
- <h3><?php _e( 'Inserting and updating data', 'import-users-from-csv-with-meta' ); ?></h3>
166
  <table>
167
  <tr><th><?php _e( 'Row', 'import-users-from-csv-with-meta' ); ?></th><?php foreach( $headers as $element ) echo "<th>" . $element . "</th>"; ?></tr>
168
  <?php
@@ -731,6 +732,7 @@ function acui_options(){
731
 
732
  switch ( $tab ){
733
  case 'homepage':
 
734
  acui_fileupload_process( $_POST, false );
735
  return;
736
  break;
4
 
5
  function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false, $is_frontend = false ){?>
6
  <div class="wrap">
7
+ <h2><?php echo apply_filters( 'acui_log_main_title', __('Importing users','import-users-from-csv-with-meta') ); ?></h2>
8
  <?php
9
  set_time_limit(0);
10
 
79
  }
80
 
81
  // action
82
+ echo apply_filters( "acui_log_header", "<h3>" . __('Ready to registers','import-users-from-csv-with-meta') . "</h3>" );
83
+ echo apply_filters( "acui_log_header_first_row_explanation", "<p>" . __('First row represents the form of sheet','import-users-from-csv-with-meta') . "</p>" );
84
+
85
  $row = 0;
86
  $positions = array();
87
  $error_importing = false;
163
  width:200px!important;
164
  }
165
  </style>
166
+ <h3><?php echo apply_filters( 'acui_log_inserting_updating_data_title', __( 'Inserting and updating data', 'import-users-from-csv-with-meta' ) ); ?></h3>
167
  <table>
168
  <tr><th><?php _e( 'Row', 'import-users-from-csv-with-meta' ); ?></th><?php foreach( $headers as $element ) echo "<th>" . $element . "</th>"; ?></tr>
169
  <?php
732
 
733
  switch ( $tab ){
734
  case 'homepage':
735
+ update_option( 'acui_last_roles_used', array_map( 'sanitize_text_field', $_POST['role'] ) );
736
  acui_fileupload_process( $_POST, false );
737
  return;
738
  break;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://codection.com/go/donate-import-users-from-csv-with-meta/
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: 5.2.3
7
- Stable tag: 1.14.3.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -91,6 +91,10 @@ Plugin will automatically detect:
91
 
92
  == Changelog ==
93
 
 
 
 
 
94
  = 1.14.3.6 =
95
  * Fixed a problem with a nonce that was bad named
96
 
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: 5.2.3
7
+ Stable tag: 1.14.3.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
91
 
92
  == Changelog ==
93
 
94
+ = 1.14.3.7 =
95
+ * New filters added to custom message shown in log or regular import
96
+ * Last roles used are remembered in import, to avoid you have to choose all time different roles
97
+
98
  = 1.14.3.6 =
99
  * Fixed a problem with a nonce that was bad named
100