Import users from CSV with meta - Version 1.20.2

Version Description

  • Improved section on forcing password reset, including new explanations in the documentation and a tool to reset user data in case a redirection loop problem is encountered
Download this release

Release Info

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

Code changes from version 1.20.1 to 1.20.2

classes/doc.php CHANGED
@@ -67,6 +67,18 @@ class ACUI_Doc{
67
  <td><?php _e( "Plugin can also import arrays with string keys. Use this separator:", 'import-users-from-csv-with-meta'); ?> <strong>::</strong> <?php _e("two colons, inside the cell in order to split the string in a list of items. Every item should be splitted using => to separate the key from the value. For example: ", 'import-users-from-csv-with-meta' ); ?>key1=>value1::key2=>value2::key3=>value3
68
  </td>
69
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
70
  <tr valign="top">
71
  <th scope="row"><?php _e( 'WordPress default profile data', 'import-users-from-csv-with-meta' ); ?></th>
72
  <td><?php _e( "You can use those labels if you want to set data adapted to the WordPress default user columns (the ones who use the function", 'import-users-from-csv-with-meta' ); ?> <a href="http://codex.wordpress.org/Function_Reference/wp_update_user">wp_update_user</a>)
@@ -116,6 +128,30 @@ class ACUI_Doc{
116
  </table>
117
  <br/>
118
  <div style="width:775px;margin:0 auto"><img src="<?php echo esc_url( plugins_url( 'csv_example.png', dirname( __FILE__ ) ) ); ?>"/></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  <?php
120
  }
121
  }
67
  <td><?php _e( "Plugin can also import arrays with string keys. Use this separator:", 'import-users-from-csv-with-meta'); ?> <strong>::</strong> <?php _e("two colons, inside the cell in order to split the string in a list of items. Every item should be splitted using => to separate the key from the value. For example: ", 'import-users-from-csv-with-meta' ); ?>key1=>value1::key2=>value2::key3=>value3
68
  </td>
69
  </tr>
70
+ <tr valign="top" id="force_user_reset_password">
71
+ <th scope="row"><?php _e( "Force users to reset their passwords", 'import-users-from-csv-with-meta' ); ?></th>
72
+ <td>
73
+ <ul style="list-style:disc outside none; margin-left:2em;">
74
+ <li><?php _e( "This option will force users to go to their edit password screen after being created with this plugin. As this is an option that deals with profile screens and password edit actions that can change, <strong>you should be careful if you use a plugin to modify any of these functions</strong>.", 'import-users-from-csv-with-meta'); ?></li>
75
+ <li><?php _e( "We <strong>support the standard WordPress method and WooCommerce</strong> but if you use other plugins that modify these views or actions you may have problems with infinite redirection loops with users who have this option checked.", 'import-users-from-csv-with-meta'); ?></li>
76
+ <li><?php _e( "If you have this redirection problem, you can delete the metadata that forces you to change the password and causes the redirection loop problem for all users using the following button:", 'import-users-from-csv-with-meta'); ?></li>
77
+ </ul>
78
+
79
+ <input type="button" id="delete_all_metadata_forcing_password_change" class="button button-primary" value="<?php _e( 'Delete all metadata forcing password change for all users', 'import-users-from-csv-with-meta' ); ?>">
80
+ </td>
81
+ </tr>
82
  <tr valign="top">
83
  <th scope="row"><?php _e( 'WordPress default profile data', 'import-users-from-csv-with-meta' ); ?></th>
84
  <td><?php _e( "You can use those labels if you want to set data adapted to the WordPress default user columns (the ones who use the function", 'import-users-from-csv-with-meta' ); ?> <a href="http://codex.wordpress.org/Function_Reference/wp_update_user">wp_update_user</a>)
128
  </table>
129
  <br/>
130
  <div style="width:775px;margin:0 auto"><img src="<?php echo esc_url( plugins_url( 'csv_example.png', dirname( __FILE__ ) ) ); ?>"/></div>
131
+
132
+ <script>
133
+ jQuery( document ).ready( function( $ ){
134
+ $( '#delete_all_metadata_forcing_password_change' ).click( function(){
135
+ var r = confirm( '<?php _e( 'Are you sure?', 'import-users-from-csv-with-meta' ); ?>' );
136
+
137
+ if( !r )
138
+ return;
139
+
140
+ var data = {
141
+ 'action': 'acui_force_reset_password_delete_metas',
142
+ 'security': '<?php echo wp_create_nonce( "codection-security" ); ?>'
143
+ };
144
+
145
+ $.post( ajaxurl, data, function( response ) {
146
+ if( response == "ERROR" )
147
+ alert( "<?php _e( 'Problems executing task: ', 'import-users-from-csv-with-meta' ); ?>" + response );
148
+ else{
149
+ alert( "<?php _e( 'Task successfully executed: ', 'import-users-from-csv-with-meta' ); ?> " + response + " <?php _e( ' rows deleted', 'import-users-from-csv-with-meta' ); ?>" );
150
+ }
151
+ });
152
+ } );
153
+ } )
154
+ </script>
155
  <?php
156
  }
157
  }
classes/force-reset-password.php CHANGED
@@ -12,6 +12,7 @@ class ACUI_Force_Reset_Password{
12
  add_action( 'template_redirect', array( $this, 'redirect' ) );
13
  add_action( 'current_screen', array( $this, 'redirect' ) );
14
  add_action( 'admin_notices', array( $this, 'notice' ) );
 
15
  }
16
 
17
  function new_user( $headers, $data, $user_id, $role, $positions, $form_data, $is_frontend, $is_cron, $password_changed ){
@@ -59,6 +60,15 @@ class ACUI_Force_Reset_Password{
59
  printf( '<div class="error"><p>%s</p></div>', apply_filters( 'acui_force_reset_password_message', __( 'Please change your password', 'import-users-from-csv-with-meta' ) ) );
60
  }
61
  }
 
 
 
 
 
 
 
 
 
62
  }
63
 
64
  $acui_force_reset_password = new ACUI_Force_Reset_Password();
12
  add_action( 'template_redirect', array( $this, 'redirect' ) );
13
  add_action( 'current_screen', array( $this, 'redirect' ) );
14
  add_action( 'admin_notices', array( $this, 'notice' ) );
15
+ add_action( 'wp_ajax_acui_force_reset_password_delete_metas', array( $this, 'ajax_force_reset_password_delete_metas' ) );
16
  }
17
 
18
  function new_user( $headers, $data, $user_id, $role, $positions, $form_data, $is_frontend, $is_cron, $password_changed ){
60
  printf( '<div class="error"><p>%s</p></div>', apply_filters( 'acui_force_reset_password_message', __( 'Please change your password', 'import-users-from-csv-with-meta' ) ) );
61
  }
62
  }
63
+
64
+ function ajax_force_reset_password_delete_metas(){
65
+ global $wpdb;
66
+ $rows = $wpdb->delete( $wpdb->usermeta, array( 'meta_key' => 'acui_force_reset_password' ) );
67
+ $result = ( $rows === false ) ? 'ERROR' : $rows;
68
+
69
+ echo $result;
70
+ wp_die();
71
+ }
72
  }
73
 
74
  $acui_force_reset_password = new ACUI_Force_Reset_Password();
classes/homepage.php CHANGED
@@ -134,6 +134,7 @@ class ACUI_Homepage{
134
  <th scope="row"><label for=""><?php _e( 'Force users to reset their passwords?', 'import-users-from-csv-with-meta' ); ?></label></th>
135
  <td>
136
  <?php ACUIHTML()->checkbox( array( 'name' => 'force_user_reset_password', 'label' => __( 'If a password is set to an user and you activate this option, the user will be forced to reset their password in their first login', 'import-users-from-csv-with-meta' ), 'current' => 'yes', 'compare_value' => $settings->get( 'force_user_reset_password' ) ) ); ?>
 
137
  </td>
138
  </tr>
139
 
134
  <th scope="row"><label for=""><?php _e( 'Force users to reset their passwords?', 'import-users-from-csv-with-meta' ); ?></label></th>
135
  <td>
136
  <?php ACUIHTML()->checkbox( array( 'name' => 'force_user_reset_password', 'label' => __( 'If a password is set to an user and you activate this option, the user will be forced to reset their password in their first login', 'import-users-from-csv-with-meta' ), 'current' => 'yes', 'compare_value' => $settings->get( 'force_user_reset_password' ) ) ); ?>
137
+ <p class="description"><?php echo sprintf( __( 'Please, <a href="%s">read the documentation</a> before activating this option', 'import-users-from-csv-with-meta' ), admin_url( 'tools.php?page=acui&tab=doc#force_user_reset_password' ) ); ?></p>
138
  </td>
139
  </tr>
140
 
classes/html.php CHANGED
@@ -189,7 +189,8 @@ class ACUI_HTML{
189
  'options' => array(
190
  'disabled' => false,
191
  'readonly' => false
192
- )
 
193
  );
194
 
195
  $args = wp_parse_args( $args, $defaults );
@@ -220,6 +221,9 @@ class ACUI_HTML{
220
  if( !empty( $args['label'] ) )
221
  $output .= '</label>';
222
 
 
 
 
223
  if( $args['echo'] )
224
  echo $output;
225
 
189
  'options' => array(
190
  'disabled' => false,
191
  'readonly' => false
192
+ ),
193
+ 'description' => '',
194
  );
195
 
196
  $args = wp_parse_args( $args, $defaults );
221
  if( !empty( $args['label'] ) )
222
  $output .= '</label>';
223
 
224
+ if( !empty( $args['description'] ) )
225
+ $output .= '<div class="description">' . $args['description'] . '</div>';
226
+
227
  if( $args['echo'] )
228
  echo $output;
229
 
import-users-from-csv-with-meta.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Import and export users and customers
4
  Plugin URI: https://www.codection.com
5
  Description: Using this plugin you will be able to import and export users or customers choosing many options and interacting with lots of other plugins
6
- Version: 1.20.1
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
@@ -11,10 +11,11 @@ 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
  if ( ! defined( 'ABSPATH' ) )
15
  exit;
16
 
17
- define( 'ACUI_VERSION', '1.20.1' );
18
 
19
  class ImportExportUsersCustomers{
20
  var $file;
3
  Plugin Name: Import and export users and customers
4
  Plugin URI: https://www.codection.com
5
  Description: Using this plugin you will be able to import and export users or customers choosing many options and interacting with lots of other plugins
6
+ Version: 1.20.2
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
+
15
  if ( ! defined( 'ABSPATH' ) )
16
  exit;
17
 
18
+ define( 'ACUI_VERSION', '1.20.2' );
19
 
20
  class ImportExportUsersCustomers{
21
  var $file;
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: 6.0.2
7
- Stable tag: 1.20.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -107,6 +107,9 @@ Plugin will automatically detect:
107
 
108
  == Changelog ==
109
 
 
 
 
110
  = 1.20.1 =
111
  * Fixed an issue that caused the new import screen to be displayed as part of the import results screen
112
  * Improved the way this plugin displays with the other WordPress export tools
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: 6.0.2
7
+ Stable tag: 1.20.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
107
 
108
  == Changelog ==
109
 
110
+ = 1.20.2 =
111
+ * Improved section on forcing password reset, including new explanations in the documentation and a tool to reset user data in case a redirection loop problem is encountered
112
+
113
  = 1.20.1 =
114
  * Fixed an issue that caused the new import screen to be displayed as part of the import results screen
115
  * Improved the way this plugin displays with the other WordPress export tools