Import users from CSV with meta - Version 1.17.6.1

Version Description

  • Force users to reset their passwords is also compatible with WP User Manager forms
  • Improved the way data to replace is searched preparing the emails
  • Improved the way some data is shown to prevent notices from array to string conversions
Download this release

Release Info

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

Code changes from version 1.17.6 to 1.17.6.1

addons/woocommerce.php CHANGED
@@ -127,8 +127,8 @@ class ACUI_WooCommerce{
127
  return wc_get_page_permalink( 'myaccount' );
128
  }
129
 
130
- function force_reset_password_redirect_condition(){
131
- return is_account_page();
132
  }
133
 
134
  function force_reset_password_notice(){
127
  return wc_get_page_permalink( 'myaccount' );
128
  }
129
 
130
+ function force_reset_password_redirect_condition( $condition ){
131
+ return ( function_exists( 'is_account_page' ) ) ? is_account_page() : $condition;
132
  }
133
 
134
  function force_reset_password_notice(){
classes/columns.php CHANGED
@@ -189,19 +189,23 @@ class ACUI_Columns{
189
  }
190
 
191
  function save_extra_user_profile_fields( $user_id ){
 
 
 
 
192
  $acui_helper = new ACUI_Helper();
193
  $headers = get_option("acui_columns");
194
  $acui_restricted_fields = $acui_helper->get_restricted_fields();
195
-
196
- $post_filtered = filter_input_array( INPUT_POST );
197
-
198
  if( is_array( $headers ) && count( $headers ) > 0 ):
199
  foreach ( $headers as $column ){
200
  if( in_array( $column, $acui_restricted_fields ) )
201
  continue;
202
 
203
- $column_sanitized = str_replace(" ", "_", $column);
204
- update_user_meta( $user_id, $column, $post_filtered[$column_sanitized] );
 
 
205
  }
206
  endif;
207
  }
189
  }
190
 
191
  function save_extra_user_profile_fields( $user_id ){
192
+ $post_filtered = filter_input_array( INPUT_POST );
193
+ if( empty( $post_filtered ) || count( $post_filtered ) == 0 )
194
+ return;
195
+
196
  $acui_helper = new ACUI_Helper();
197
  $headers = get_option("acui_columns");
198
  $acui_restricted_fields = $acui_helper->get_restricted_fields();
199
+
 
 
200
  if( is_array( $headers ) && count( $headers ) > 0 ):
201
  foreach ( $headers as $column ){
202
  if( in_array( $column, $acui_restricted_fields ) )
203
  continue;
204
 
205
+ $column_sanitized = str_replace(" ", "_", $column );
206
+
207
+ if( isset( $post_filtered[ $column_sanitized ] ) )
208
+ update_user_meta( $user_id, $column, $post_filtered[$column_sanitized] );
209
  }
210
  endif;
211
  }
classes/email-options.php CHANGED
@@ -224,9 +224,14 @@ class ACUI_Email_Options{
224
  }
225
 
226
  for( $i = 0 ; $i < count( $headers ); $i++ ) {
 
 
 
 
 
227
  $data[ $i ] = ( is_array( $data[ $i ] ) ) ? implode( "-", $data[ $i ] ) : $data[ $i ];
228
- $body = str_replace( "**" . $headers[ $i ] . "**", $data[ $i ] , $body );
229
- $subject = str_replace( "**" . $headers[ $i ] . "**", $data[ $i ] , $subject );
230
  }
231
 
232
  $body = apply_filters( 'acui_import_email_body_before_wpautop', $body, $headers, $data, $created, $user_id );
224
  }
225
 
226
  for( $i = 0 ; $i < count( $headers ); $i++ ) {
227
+ $to_replace = "**" . $headers[ $i ] . "**";
228
+
229
+ if( strpos( $body, $to_replace ) === false && strpos( $subject, $to_replace ) === false )
230
+ continue;
231
+
232
  $data[ $i ] = ( is_array( $data[ $i ] ) ) ? implode( "-", $data[ $i ] ) : $data[ $i ];
233
+ $body = str_replace( $to_replace, $data[ $i ] , $body );
234
+ $subject = str_replace( $to_replace, $data[ $i ] , $subject );
235
  }
236
 
237
  $body = apply_filters( 'acui_import_email_body_before_wpautop', $body, $headers, $data, $created, $user_id );
classes/helper.php CHANGED
@@ -267,7 +267,12 @@ class ACUI_Helper{
267
  $i = 0;
268
 
269
  foreach( $element as $it => $el ){
270
- $element_string .= ( is_wp_error( $el ) ? $el->get_error_message() : $el );
 
 
 
 
 
271
 
272
  if(++$i !== count( $element ) ){
273
  $element_string .= ',';
@@ -349,7 +354,9 @@ class ACUI_Helper{
349
  ?>
350
  <script>
351
  jQuery( document ).ready( function( $ ){
352
- $( '#acui_results,#acui_errors' ).DataTable();
 
 
353
  } )
354
  </script>
355
  <?php
267
  $i = 0;
268
 
269
  foreach( $element as $it => $el ){
270
+ if( is_wp_error( $el ) )
271
+ $element_string .= $el->get_error_message();
272
+ elseif( is_array( $el ) )
273
+ $element_string .= serialize( $el );
274
+ else
275
+ $element_string .= $el;
276
 
277
  if(++$i !== count( $element ) ){
278
  $element_string .= ',';
354
  ?>
355
  <script>
356
  jQuery( document ).ready( function( $ ){
357
+ $( '#acui_results,#acui_errors' ).DataTable({
358
+ "scrollX": true,
359
+ });
360
  } )
361
  </script>
362
  <?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.17.6
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.17.6.1
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
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.7.2
7
- Stable tag: 1.17.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -103,6 +103,11 @@ Plugin will automatically detect:
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
106
  = 1.17.6 =
107
  * Now you can filter the columns that are going to be exported using the shortcode and the attribute columns
108
 
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.7.2
7
+ Stable tag: 1.17.6.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
103
 
104
  == Changelog ==
105
 
106
+ = 1.17.6.1 =
107
+ * Force users to reset their passwords is also compatible with WP User Manager forms
108
+ * Improved the way data to replace is searched preparing the emails
109
+ * Improved the way some data is shown to prevent notices from array to string conversions
110
+
111
  = 1.17.6 =
112
  * Now you can filter the columns that are going to be exported using the shortcode and the attribute columns
113