Import users from CSV with meta - Version 1.15.5.6

Version Description

  • In export, now user id is called "source_user_id" to avoid problems importing
Download this release

Release Info

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

Code changes from version 1.15.5.5 to 1.15.5.6

classes/export.php CHANGED
@@ -9,9 +9,10 @@ class ACUI_Exporter{
9
  $upload_dir = wp_upload_dir();
10
 
11
  $this->path_csv = $upload_dir['basedir'] . "/export-users.csv";
12
- $this->user_data = array( "user_login", "user_email", "ID", "user_pass", "user_nicename", "user_url", "user_registered", "display_name" );
13
 
14
  add_action( 'wp_ajax_acui_export_users_csv', array( $this, 'export_users_csv' ) );
 
15
  }
16
 
17
  public static function admin_gui(){
@@ -82,7 +83,7 @@ class ACUI_Exporter{
82
  function prepare( $key, $value, $datetime_format ){
83
  $timestamp_keys = array( 'wc_last_active' );
84
  $non_date_keys = apply_filters( 'acui_export_non_date_keys', array( 'billing_phone' ) );
85
-
86
  if( is_array( $value ) )
87
  return serialize( $value );
88
  elseif( in_array( $key, $non_date_keys ) ){
@@ -156,6 +157,7 @@ class ACUI_Exporter{
156
  $userdata = get_userdata( $user );
157
 
158
  foreach ( $this->user_data as $key ) {
 
159
  $row[] = $this->prepare( $key, $userdata->data->{$key}, $datetime_format );
160
  }
161
 
@@ -240,6 +242,10 @@ class ACUI_Exporter{
240
 
241
  return $list;
242
  }
 
 
 
 
243
  }
244
 
245
  $acui_exporter = new ACUI_Exporter();
9
  $upload_dir = wp_upload_dir();
10
 
11
  $this->path_csv = $upload_dir['basedir'] . "/export-users.csv";
12
+ $this->user_data = array( "user_login", "user_email", "source_user_id", "user_pass", "user_nicename", "user_url", "user_registered", "display_name" );
13
 
14
  add_action( 'wp_ajax_acui_export_users_csv', array( $this, 'export_users_csv' ) );
15
+ add_filter( 'acui_export_get_key_user_data', array( $this, 'filter_key_user_id' ) );
16
  }
17
 
18
  public static function admin_gui(){
83
  function prepare( $key, $value, $datetime_format ){
84
  $timestamp_keys = array( 'wc_last_active' );
85
  $non_date_keys = apply_filters( 'acui_export_non_date_keys', array( 'billing_phone' ) );
86
+
87
  if( is_array( $value ) )
88
  return serialize( $value );
89
  elseif( in_array( $key, $non_date_keys ) ){
157
  $userdata = get_userdata( $user );
158
 
159
  foreach ( $this->user_data as $key ) {
160
+ $key = apply_filters( 'acui_export_get_key_user_data', $key );
161
  $row[] = $this->prepare( $key, $userdata->data->{$key}, $datetime_format );
162
  }
163
 
242
 
243
  return $list;
244
  }
245
+
246
+ function filter_key_user_id( $key ){
247
+ return ( $key == 'source_user_id' ) ? 'ID' : $key;
248
+ }
249
  }
250
 
251
  $acui_exporter = new ACUI_Exporter();
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.15.5.5
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.15.5.6
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.3.2
7
- Stable tag: 1.15.5.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -98,6 +98,9 @@ Plugin will automatically detect:
98
 
99
  == Changelog ==
100
 
 
 
 
101
  = 1.15.5.5 =
102
  * Groups can be now imported by their name instead only of their ids
103
 
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.3.2
7
+ Stable tag: 1.15.5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
98
 
99
  == Changelog ==
100
 
101
+ = 1.15.5.6 =
102
+ * In export, now user id is called "source_user_id" to avoid problems importing
103
+
104
  = 1.15.5.5 =
105
  * Groups can be now imported by their name instead only of their ids
106