Import users from CSV with meta - Version 1.21.3

Version Description

  • Fixed warning about not defined default value in settings class
  • Now the date filter when exporting users is inclusive, so that the days selected in the search are included in the search and not excluded as before
  • Fixed a problem in export that sometimes generate problems different number of columns in headers and in every user
  • Fixed a problem with the keys to reset password of users included in the emails
Download this release

Release Info

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

Code changes from version 1.21.2 to 1.21.3

addons/advanced-custom-fields.php CHANGED
@@ -78,7 +78,7 @@ class ACUI_ACF{
78
 
79
  function export_columns( $row ){
80
  foreach( $this->get_fields_with_url() as $field ){
81
- $row[] = $field . "_url";
82
  }
83
 
84
  return $row;
78
 
79
  function export_columns( $row ){
80
  foreach( $this->get_fields_with_url() as $field ){
81
+ $row[ $field . "_url" ] = $field . "_url";
82
  }
83
 
84
  return $row;
addons/buddypress.php CHANGED
@@ -149,11 +149,11 @@ class ACUI_Buddypress{
149
 
150
  function export_columns( $row ){
151
  foreach ( $this->fields as $key ) {
152
- $row[] = $key;
153
  }
154
 
155
- $row[] = 'bp_group_id';
156
- $row[] = 'bp_member_type';
157
 
158
  return $row;
159
  }
149
 
150
  function export_columns( $row ){
151
  foreach ( $this->fields as $key ) {
152
+ $row[ $key ] = $key;
153
  }
154
 
155
+ $row['bp_group_id'] = 'bp_group_id';
156
+ $row['bp_member_type'] = 'bp_member_type';
157
 
158
  return $row;
159
  }
addons/wp-private-content-plus.php CHANGED
@@ -21,7 +21,7 @@ class ACUI_WP_Private_Content_Plus{
21
  }
22
 
23
  function export_columns( $row ){
24
- $row[] = 'wp_private_content_plus_groups';
25
  return $row;
26
  }
27
 
21
  }
22
 
23
  function export_columns( $row ){
24
+ $row['wp_private_content_plus_groups'] = 'wp_private_content_plus_groups';
25
  return $row;
26
  }
27
 
addons/wp-user-avatar.php CHANGED
@@ -53,7 +53,7 @@ class ACUI_WPUA{
53
  }
54
 
55
  function export_columns( $row ){
56
- $row[] = 'user_avatar';
57
  return $row;
58
  }
59
 
53
  }
54
 
55
  function export_columns( $row ){
56
+ $row['user_avatar'] = 'user_avatar';
57
  return $row;
58
  }
59
 
assets/style.css CHANGED
@@ -19,6 +19,7 @@
19
  width: 100%;
20
  }
21
 
 
22
  .acui .sidebar_section.become_patreon,
23
  .acui .sidebar_section.buy_me_a_coffee,
24
  .acui .sidebar_section.vote_us,
@@ -60,6 +61,12 @@
60
  cursor: pointer;
61
  }
62
 
 
 
 
 
 
 
63
  .acui .patreon,
64
  .acui .ko-fi,
65
  .acui .vote-us,
19
  width: 100%;
20
  }
21
 
22
+ .acui .sidebar_section.premium_addons,
23
  .acui .sidebar_section.become_patreon,
24
  .acui .sidebar_section.buy_me_a_coffee,
25
  .acui .sidebar_section.vote_us,
61
  cursor: pointer;
62
  }
63
 
64
+ .acui a.premium-addons{
65
+ background-color: #8A2BE2 !important;
66
+ border-color: #8A2BE2 !important;
67
+ }
68
+
69
+ .acui .premium-addons,
70
  .acui .patreon,
71
  .acui .ko-fi,
72
  .acui .vote-us,
classes/batch_exporter.php CHANGED
@@ -104,14 +104,14 @@ class ACUI_Batch_Exporter{
104
  $row = array();
105
 
106
  foreach ( $this->get_user_data() as $key ) {
107
- $row[] = $key;
108
  }
109
 
110
  if( count( $this->get_filtered_columns() ) == 0 || in_array( 'role', $this->get_filtered_columns() ) )
111
- $row[] = "role";
112
 
113
  foreach ( $this->get_user_meta_keys() as $key ) {
114
- $row[] = $key;
115
  }
116
 
117
  $this->set_columns_to_export( apply_filters( 'acui_export_columns', $row, array( 'order_fields_alphabetically' => $this->get_order_fields_alphabetically(), 'double_encapsulate_serialized_values' => $this->get_double_encapsulate_serialized_values(), 'filtered_columns' => $this->get_filtered_columns() ) ) );
@@ -536,10 +536,10 @@ class ACUI_Batch_Exporter{
536
  $date_query = array();
537
 
538
  if( !empty( $this->get_from() ) )
539
- $date_query[] = array( 'after' => $this->get_from() );
540
 
541
  if( !empty( $this->get_to() ) )
542
- $date_query[] = array( 'before' => $this->get_to() );
543
 
544
  if( !empty( $date_query ) ){
545
  $date_query['inclusive'] = true;
@@ -684,6 +684,7 @@ class ACUI_Batch_Exporter{
684
  $meta_keys = array();
685
 
686
  $usermeta = get_transient( 'acui_export_user_meta_keys' );
 
687
 
688
  if( empty( $usermeta ) ){
689
  $usermeta = $wpdb->get_results( "SELECT distinct $wpdb->usermeta.meta_key FROM $wpdb->usermeta", ARRAY_A );
104
  $row = array();
105
 
106
  foreach ( $this->get_user_data() as $key ) {
107
+ $row[ $key ] = $key;
108
  }
109
 
110
  if( count( $this->get_filtered_columns() ) == 0 || in_array( 'role', $this->get_filtered_columns() ) )
111
+ $row[ "role" ] = "role";
112
 
113
  foreach ( $this->get_user_meta_keys() as $key ) {
114
+ $row[ $key ] = $key;
115
  }
116
 
117
  $this->set_columns_to_export( apply_filters( 'acui_export_columns', $row, array( 'order_fields_alphabetically' => $this->get_order_fields_alphabetically(), 'double_encapsulate_serialized_values' => $this->get_double_encapsulate_serialized_values(), 'filtered_columns' => $this->get_filtered_columns() ) ) );
536
  $date_query = array();
537
 
538
  if( !empty( $this->get_from() ) )
539
+ $date_query[] = array( 'after' => $this->get_from(), 'inclusive' => true );
540
 
541
  if( !empty( $this->get_to() ) )
542
+ $date_query[] = array( 'before' => $this->get_to(), 'inclusive' => true );
543
 
544
  if( !empty( $date_query ) ){
545
  $date_query['inclusive'] = true;
684
  $meta_keys = array();
685
 
686
  $usermeta = get_transient( 'acui_export_user_meta_keys' );
687
+ $usermeta = '';
688
 
689
  if( empty( $usermeta ) ){
690
  $usermeta = $wpdb->get_results( "SELECT distinct $wpdb->usermeta.meta_key FROM $wpdb->usermeta", ARRAY_A );
classes/email-options.php CHANGED
@@ -199,12 +199,13 @@ class ACUI_Email_Options{
199
  static function send_email( $user_object, $positions = array(), $headers = array(), $data = array(), $created = false, $password = '' ){
200
  $user_id = $user_object->ID;
201
  $user_email = $user_object->user_email;
 
202
 
203
  $body = apply_filters( 'acui_import_email_body_source', get_option( "acui_mail_body" ), $headers, $data, $created, $user_id );
204
  $subject = apply_filters( 'acui_import_email_subject_source', get_option( "acui_mail_subject" ), $headers, $data, $created, $user_id );
205
 
206
- $body = self::apply_wildcards( $body, $user_object, $created, $positions, $headers, $data, $password );
207
- $subject = self::apply_wildcards( $subject, $user_object, $created, $positions, $headers, $data, $password );
208
 
209
  $body = apply_filters( 'acui_import_email_body_before_wpautop', $body, $headers, $data, $created, $user_id );
210
 
@@ -222,12 +223,10 @@ class ACUI_Email_Options{
222
  wp_mail( $email_to, $subject, $body, $headers_mail, $attachments );
223
  }
224
 
225
- static function apply_wildcards( $string, $user_object, $created, $positions, $headers, $data, $password ){
226
  $acui_helper = new ACUI_Helper();
227
- $key = get_password_reset_key( $user_object );
228
  $wp_users_fields = $acui_helper->get_wp_users_fields();
229
 
230
- $user_id = $user_object->ID;
231
  $user_login= $user_object->user_login;
232
  $user_email = $user_object->user_email;
233
 
199
  static function send_email( $user_object, $positions = array(), $headers = array(), $data = array(), $created = false, $password = '' ){
200
  $user_id = $user_object->ID;
201
  $user_email = $user_object->user_email;
202
+ $key = get_password_reset_key( $user_object );
203
 
204
  $body = apply_filters( 'acui_import_email_body_source', get_option( "acui_mail_body" ), $headers, $data, $created, $user_id );
205
  $subject = apply_filters( 'acui_import_email_subject_source', get_option( "acui_mail_subject" ), $headers, $data, $created, $user_id );
206
 
207
+ $body = self::apply_wildcards( $body, $user_object, $created, $positions, $headers, $data, $password, $key );
208
+ $subject = self::apply_wildcards( $subject, $user_object, $created, $positions, $headers, $data, $password, $key );
209
 
210
  $body = apply_filters( 'acui_import_email_body_before_wpautop', $body, $headers, $data, $created, $user_id );
211
 
223
  wp_mail( $email_to, $subject, $body, $headers_mail, $attachments );
224
  }
225
 
226
+ static function apply_wildcards( $string, $user_object, $created, $positions, $headers, $data, $password, $key ){
227
  $acui_helper = new ACUI_Helper();
 
228
  $wp_users_fields = $acui_helper->get_wp_users_fields();
229
 
 
230
  $user_login= $user_object->user_login;
231
  $user_email = $user_object->user_email;
232
 
classes/homepage.php CHANGED
@@ -268,6 +268,12 @@ class ACUI_Homepage{
268
  </div>
269
 
270
  <div class="sidebar">
 
 
 
 
 
 
271
  <div class="sidebar_section become_patreon">
272
  <a class="patreon" color="primary" type="button" name="become-a-patron" data-tag="become-patron-button" href="https://www.patreon.com/carazo" role="button" target="_blank">
273
  <div><span><?php _e( 'Become a patron', 'import-users-from-csv-with-meta'); ?></span></div>
268
  </div>
269
 
270
  <div class="sidebar">
271
+ <div class="sidebar_section premium_addons">
272
+ <a class="premium-addons" color="primary" type="button" name="premium-addons" data-tag="premium-addons" href="https://www.import-wp.com/" role="button" target="_blank">
273
+ <div><span><?php _e( 'Premium Addons', 'import-users-from-csv-with-meta'); ?></span></div>
274
+ </a>
275
+ </div>
276
+
277
  <div class="sidebar_section become_patreon">
278
  <a class="patreon" color="primary" type="button" name="become-a-patron" data-tag="become-patron-button" href="https://www.patreon.com/carazo" role="button" target="_blank">
279
  <div><span><?php _e( 'Become a patron', 'import-users-from-csv-with-meta'); ?></span></div>
classes/settings.php CHANGED
@@ -203,6 +203,9 @@ class ACUI_Settings{
203
 
204
  case 'checkbox':
205
  return false;
 
 
 
206
  }
207
  }
208
 
203
 
204
  case 'checkbox':
205
  return false;
206
+
207
+ default:
208
+ return false;
209
  }
210
  }
211
 
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.21.2
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
@@ -11,11 +11,10 @@ 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' ) )
16
  exit;
17
 
18
- define( 'ACUI_VERSION', '1.21.2' );
19
 
20
  class ImportExportUsersCustomers{
21
  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.21.3
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' ) )
15
  exit;
16
 
17
+ define( 'ACUI_VERSION', '1.21.3' );
18
 
19
  class ImportExportUsersCustomers{
20
  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.1
7
- Stable tag: 1.21.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -108,6 +108,12 @@ Plugin will automatically detect:
108
 
109
  == Changelog ==
110
 
 
 
 
 
 
 
111
  = 1.21.2 =
112
  * Improved compatibility with ACF, now the fields of type image or file, generate in the export a new field, with the suffix _url where to show the url of the content and not only the identifier of the attachment in the database as before that was not representative.
113
  * Improved user interface
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.1
7
+ Stable tag: 1.21.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
108
 
109
  == Changelog ==
110
 
111
+ = 1.21.3 =
112
+ * Fixed warning about not defined default value in settings class
113
+ * Now the date filter when exporting users is inclusive, so that the days selected in the search are included in the search and not excluded as before
114
+ * Fixed a problem in export that sometimes generate problems different number of columns in headers and in every user
115
+ * Fixed a problem with the keys to reset password of users included in the emails
116
+
117
  = 1.21.2 =
118
  * Improved compatibility with ACF, now the fields of type image or file, generate in the export a new field, with the suffix _url where to show the url of the content and not only the identifier of the attachment in the database as before that was not representative.
119
  * Improved user interface