Import users from CSV with meta - Version 1.16.1.2

Version Description

  • Usability improve when using delete users not present in CSV (change role options is disabled because they can't run)
  • Performance optimization, if user is deleted, it cannot be tried to change role
Download this release

Release Info

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

Code changes from version 1.16.1.1 to 1.16.1.2

classes/cron.php CHANGED
@@ -280,7 +280,7 @@ class ACUI_Cron{
280
  <th scope="row"><label for="cron-delete-users"><?php _e( 'Delete users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
281
  <td>
282
  <div style="float:left; margin-top: 10px;">
283
- <input type="checkbox" name="cron-delete-users" value="yes" <?php if( $cron_delete_users == true ) echo "checked='checked'"; ?>/>
284
  </div>
285
  <div style="margin-left:25px;">
286
  <select id="cron-delete-users-assign-posts" name="cron-delete-users-assign-posts">
@@ -309,10 +309,10 @@ class ACUI_Cron{
309
  <th scope="row"><label for="cron-change-role-not-present"><?php _e( 'Change role of users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
310
  <td>
311
  <div style="float:left; margin-top: 10px;">
312
- <input type="checkbox" name="cron-change-role-not-present" value="yes" <?php checked( $cron_change_role_not_present ); ?> />
313
  </div>
314
  <div style="margin-left:25px;">
315
- <select id="cron-change-role-not-present-role" name="cron-change-role-not-present-role">
316
  <?php
317
  $list_roles = acui_get_editable_roles();
318
  foreach ($list_roles as $key => $value):
@@ -362,6 +362,22 @@ class ACUI_Cron{
362
 
363
  <script>
364
  jQuery( document ).ready( function( $ ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
  $( "[name='cron-delete-users']" ).change(function() {
366
  if( $(this).is( ":checked" ) ) {
367
  var returnVal = confirm("<?php _e( 'Are you sure to delete all users that are not present in the CSV? This action cannot be undone.', 'import-users-from-csv-with-meta' ); ?>");
280
  <th scope="row"><label for="cron-delete-users"><?php _e( 'Delete users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
281
  <td>
282
  <div style="float:left; margin-top: 10px;">
283
+ <input type="checkbox" name="cron-delete-users" id="cron-delete-users" value="yes" <?php if( $cron_delete_users == true ) echo "checked='checked'"; ?>/>
284
  </div>
285
  <div style="margin-left:25px;">
286
  <select id="cron-delete-users-assign-posts" name="cron-delete-users-assign-posts">
309
  <th scope="row"><label for="cron-change-role-not-present"><?php _e( 'Change role of users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
310
  <td>
311
  <div style="float:left; margin-top: 10px;">
312
+ <input type="checkbox" name="cron-change-role-not-present" id="cron-change-role-not-present" value="yes" <?php checked( $cron_change_role_not_present ); ?> />
313
  </div>
314
  <div style="margin-left:25px;">
315
+ <select name="cron-change-role-not-present-role" id="cron-change-role-not-present-role">
316
  <?php
317
  $list_roles = acui_get_editable_roles();
318
  foreach ($list_roles as $key => $value):
362
 
363
  <script>
364
  jQuery( document ).ready( function( $ ){
365
+ check_delete_users_checked();
366
+
367
+ $( '#cron-delete-users' ).on( 'click', function() {
368
+ check_delete_users_checked();
369
+ });
370
+
371
+ function check_delete_users_checked(){
372
+ if( $('#cron-delete-users').is(':checked') ){
373
+ $( '#cron-change-role-not-present-role' ).prop( 'disabled', true );
374
+ $( '#cron-change-role-not-present' ).prop( 'disabled', true );
375
+ } else {
376
+ $( '#cron-change-role-not-present-role' ).prop( 'disabled', false );
377
+ $( '#cron-change-role-not-present' ).prop( 'disabled', false );
378
+ }
379
+ }
380
+
381
  $( "[name='cron-delete-users']" ).change(function() {
382
  if( $(this).is( ":checked" ) ) {
383
  var returnVal = confirm("<?php _e( 'Are you sure to delete all users that are not present in the CSV? This action cannot be undone.', 'import-users-from-csv-with-meta' ); ?>");
classes/donate.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  if ( ! defined( 'ABSPATH' ) ) exit;
4
 
5
  class ACUI_Donate{
@@ -24,7 +23,7 @@ class ACUI_Donate{
24
  <h3 class="hndle"><span>&nbsp;<?php _e( 'Or if you prefer, you can also help us becoming a Patreon:', 'import-users-from-csv-with-meta' ); ?></span></h3>
25
 
26
  <div class="inside acui" style="display: block;">
27
- <a class="patreon" color="primary" type="button" name="become-a-patron" data-tag="become-patron-button" href="https://www.patreon.com/bePatron?c=1741454" role="button">
28
  <div class="oosjif-1 jFPfxp"><span>Become a patron</span></div>
29
  </a>
30
  </div>
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
  class ACUI_Donate{
23
  <h3 class="hndle"><span>&nbsp;<?php _e( 'Or if you prefer, you can also help us becoming a Patreon:', 'import-users-from-csv-with-meta' ); ?></span></h3>
24
 
25
  <div class="inside acui" style="display: block;">
26
+ <a class="patreon" color="primary" type="button" name="become-a-patron" data-tag="become-patron-button" href="https://www.patreon.com/carazo" role="button">
27
  <div class="oosjif-1 jFPfxp"><span>Become a patron</span></div>
28
  </a>
29
  </div>
classes/frontend.php CHANGED
@@ -144,7 +144,7 @@ class ACUI_Frontend{
144
  <th scope="row"><label for="delete-users-frontend"><?php _e( 'Delete users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
145
  <td>
146
  <div style="float:left; margin-top: 10px;">
147
- <input type="checkbox" name="delete-users-frontend" value="yes" <?php if( $delete_users_frontend == true ) echo "checked='checked'"; ?>/>
148
  </div>
149
  <div style="margin-left:25px;">
150
  <select id="delete-users-assign-posts-frontend" name="delete-users-assign-posts-frontend">
@@ -173,10 +173,10 @@ class ACUI_Frontend{
173
  <th scope="row"><label for="change-role-not-present-frontend"><?php _e( 'Change role of users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
174
  <td>
175
  <div style="float:left; margin-top: 10px;">
176
- <input type="checkbox" id="change-role-not-present-frontend" name="change-role-not-present-frontend" value="yes" <?php checked( $change_role_not_present_frontend ); ?> />
177
  </div>
178
  <div style="margin-left:25px;">
179
- <select id="change-role-not-present-role-frontend" name="change-role-not-present-role-frontend">
180
  <?php
181
  $list_roles = acui_get_editable_roles();
182
  foreach ($list_roles as $key => $value):
@@ -197,6 +197,12 @@ class ACUI_Frontend{
197
 
198
  <script>
199
  jQuery( document ).ready( function( $ ){
 
 
 
 
 
 
200
  $( '#copy_to_clipboard' ).click( function(){
201
  var $temp = $("<input>");
202
  $("body").append($temp);
@@ -204,6 +210,16 @@ class ACUI_Frontend{
204
  document.execCommand("copy");
205
  $temp.remove();
206
  } );
 
 
 
 
 
 
 
 
 
 
207
  });
208
  </script>
209
  <?php
144
  <th scope="row"><label for="delete-users-frontend"><?php _e( 'Delete users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
145
  <td>
146
  <div style="float:left; margin-top: 10px;">
147
+ <input type="checkbox" name="delete-users-frontend" id="delete-users-frontend" value="yes" <?php if( $delete_users_frontend == true ) echo "checked='checked'"; ?>/>
148
  </div>
149
  <div style="margin-left:25px;">
150
  <select id="delete-users-assign-posts-frontend" name="delete-users-assign-posts-frontend">
173
  <th scope="row"><label for="change-role-not-present-frontend"><?php _e( 'Change role of users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
174
  <td>
175
  <div style="float:left; margin-top: 10px;">
176
+ <input type="checkbox" name="change-role-not-present-frontend" id="change-role-not-present-frontend" value="yes" <?php checked( $change_role_not_present_frontend ); ?> />
177
  </div>
178
  <div style="margin-left:25px;">
179
+ <select name="change-role-not-present-role-frontend" id="change-role-not-present-role-frontend">
180
  <?php
181
  $list_roles = acui_get_editable_roles();
182
  foreach ($list_roles as $key => $value):
197
 
198
  <script>
199
  jQuery( document ).ready( function( $ ){
200
+ check_delete_users_checked();
201
+
202
+ $( '#delete-users-frontend' ).on( 'click', function() {
203
+ check_delete_users_checked();
204
+ });
205
+
206
  $( '#copy_to_clipboard' ).click( function(){
207
  var $temp = $("<input>");
208
  $("body").append($temp);
210
  document.execCommand("copy");
211
  $temp.remove();
212
  } );
213
+
214
+ function check_delete_users_checked(){
215
+ if( $('#delete-users-frontend').is(':checked') ){
216
+ $( '#change-role-not-present-role-frontend' ).prop( 'disabled', true );
217
+ $( '#change-role-not-present-frontend' ).prop( 'disabled', true );
218
+ } else {
219
+ $( '#change-role-not-present-role-frontend' ).prop( 'disabled', false );
220
+ $( '#change-role-not-present-frontend' ).prop( 'disabled', false );
221
+ }
222
+ }
223
  });
224
  </script>
225
  <?php
classes/homepage.php CHANGED
@@ -131,7 +131,7 @@ class ACUI_Homepage{
131
  <th scope="row"><label for="delete_users"><?php _e( 'Delete users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
132
  <td>
133
  <div style="float:left; margin-top: 10px;">
134
- <input type="checkbox" name="delete_users" value="yes"/>
135
  </div>
136
  <div style="margin-left:25px;">
137
  <select id="delete_users_assign_posts" name="delete_users_assign_posts">
@@ -153,7 +153,7 @@ class ACUI_Homepage{
153
  <th scope="row"><label for="change_role_not_present"><?php _e( 'Change role of users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
154
  <td>
155
  <div style="float:left; margin-top: 10px;">
156
- <input type="checkbox" name="change_role_not_present" value="yes"/>
157
  </div>
158
  <div style="margin-left:25px;">
159
  <select id="change_role_not_present_role" name="change_role_not_present_role">
@@ -183,7 +183,7 @@ class ACUI_Homepage{
183
 
184
  <div class="sidebar">
185
  <div class="sidebar_section become_patreon">
186
- <a class="patreon" color="primary" type="button" name="become-a-patron" data-tag="become-patron-button" href="https://www.patreon.com/bePatron?c=1741454" role="button">
187
  <div><span><?php _e( 'Become a patron', 'import-users-from-csv-with-meta'); ?></span></div>
188
  </a>
189
  </div>
@@ -224,6 +224,12 @@ class ACUI_Homepage{
224
  }
225
 
226
  jQuery( document ).ready( function( $ ){
 
 
 
 
 
 
227
  $( ".delete_attachment" ).click( function(){
228
  var answer = confirm( "<?php _e( 'Are you sure to delete this file?', 'import-users-from-csv-with-meta' ); ?>" );
229
  if( answer ){
@@ -274,6 +280,15 @@ class ACUI_Homepage{
274
  win.focus();
275
  });
276
 
 
 
 
 
 
 
 
 
 
277
  } );
278
  </script>
279
  <?php
131
  <th scope="row"><label for="delete_users"><?php _e( 'Delete users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
132
  <td>
133
  <div style="float:left; margin-top: 10px;">
134
+ <input type="checkbox" name="delete_users" id="delete_users" value="yes"/>
135
  </div>
136
  <div style="margin-left:25px;">
137
  <select id="delete_users_assign_posts" name="delete_users_assign_posts">
153
  <th scope="row"><label for="change_role_not_present"><?php _e( 'Change role of users that are not present in the CSV?', 'import-users-from-csv-with-meta' ); ?></label></th>
154
  <td>
155
  <div style="float:left; margin-top: 10px;">
156
+ <input type="checkbox" name="change_role_not_present" id="change_role_not_present" value="yes"/>
157
  </div>
158
  <div style="margin-left:25px;">
159
  <select id="change_role_not_present_role" name="change_role_not_present_role">
183
 
184
  <div class="sidebar">
185
  <div class="sidebar_section become_patreon">
186
+ <a class="patreon" color="primary" type="button" name="become-a-patron" data-tag="become-patron-button" href="https://www.patreon.com/carazo" role="button">
187
  <div><span><?php _e( 'Become a patron', 'import-users-from-csv-with-meta'); ?></span></div>
188
  </a>
189
  </div>
224
  }
225
 
226
  jQuery( document ).ready( function( $ ){
227
+ check_delete_users_checked();
228
+
229
+ $( '#delete_users' ).on( 'click', function() {
230
+ check_delete_users_checked();
231
+ });
232
+
233
  $( ".delete_attachment" ).click( function(){
234
  var answer = confirm( "<?php _e( 'Are you sure to delete this file?', 'import-users-from-csv-with-meta' ); ?>" );
235
  if( answer ){
280
  win.focus();
281
  });
282
 
283
+ function check_delete_users_checked(){
284
+ if( $('#delete_users').is(':checked') ){
285
+ $( '#change_role_not_present' ).prop( 'disabled', true );
286
+ $( '#change_role_not_present_role' ).prop( 'disabled', true );
287
+ } else {
288
+ $( '#change_role_not_present' ).prop( 'disabled', false );
289
+ $( '#change_role_not_present_role' ).prop( 'disabled', false );
290
+ }
291
+ }
292
  } );
293
  </script>
294
  <?php
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.16.1.1
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
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.16.1.2
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
importer.php CHANGED
@@ -742,7 +742,7 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
742
  }
743
  endif;
744
 
745
- if( $change_role_not_present ):
746
  require_once( ABSPATH . 'wp-admin/includes/user.php');
747
 
748
  $all_users = get_users( array(
742
  }
743
  endif;
744
 
745
+ if( $change_role_not_present && !$delete_users_flag ):
746
  require_once( ABSPATH . 'wp-admin/includes/user.php');
747
 
748
  $all_users = get_users( array(
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.5.1
7
- Stable tag: 1.16.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -99,6 +99,10 @@ Plugin will automatically detect:
99
 
100
  == Changelog ==
101
 
 
 
 
 
102
  = 1.16.1.1 =
103
  * New wildcards included in emails for WooCommerce: woocommercelostpasswordurl, woocommercepasswordreseturl and woocommercepasswordreseturllink
104
 
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.5.1
7
+ Stable tag: 1.16.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
99
 
100
  == Changelog ==
101
 
102
+ = 1.16.1.2 =
103
+ * Usability improve when using delete users not present in CSV (change role options is disabled because they can't run)
104
+ * Performance optimization, if user is deleted, it cannot be tried to change role
105
+
106
  = 1.16.1.1 =
107
  * New wildcards included in emails for WooCommerce: woocommercelostpasswordurl, woocommercepasswordreseturl and woocommercepasswordreseturllink
108