Import users from CSV with meta - Version 1.15.3.4

Version Description

  • You can now use WordPress default user edited and created emails when importing users
  • WooCommerce Membership by RightPress compatibility included, now you can assign users to their plan while they are being imported
Download this release

Release Info

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

Code changes from version 1.15.3.3 to 1.15.3.4

addons/woocommerce-membership-rightpress.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) exit;
4
+
5
+ if( !is_plugin_active( 'woocommerce-membership/woocommerce-membership.php' ) ){
6
+ return;
7
+ }
8
+
9
+ add_filter( 'acui_restricted_fields', 'acui_wmr_restricted_fields', 10, 1 );
10
+ add_action( 'acui_documentation_after_plugins_activated', 'acui_wmr_documentation_after_plugins_activated' );
11
+ add_action( 'post_acui_import_single_user', 'acui_wmr_post_import_single_user', 10, 3 );
12
+
13
+ function acui_wmr_restricted_fields( $acui_restricted_fields ){
14
+ return array_merge( $acui_restricted_fields, array( 'plan_id' ) );
15
+ }
16
+
17
+ function acui_wmr_documentation_after_plugins_activated(){
18
+ ?>
19
+ <tr valign="top">
20
+ <th scope="row"><?php _e( "WooCommerce Membership by RightPress is activated", 'import-users-from-csv-with-meta' ); ?></th>
21
+ <td>
22
+ <ol>
23
+ <li><strong><?php _e( "Add users to membership plans", 'import-users-from-csv-with-meta' ); ?></strong>: <?php _e( "In this case you will only have to use <strong>plan_id</strong> column in order to associate a user to their membership plan", 'import-users-from-csv-with-meta' ); ?>.</li>
24
+ </ol>
25
+ </td>
26
+ </tr>
27
+ <?php
28
+ }
29
+
30
+ function acui_wmr_post_import_single_user( $headers, $row, $user_id ){
31
+ $pos = array_search( 'plan_id', $headers );
32
+
33
+ if( $pos === FALSE )
34
+ return;
35
+
36
+ $plan_id = absint( $row[ $pos ] );
37
+ $resultado = WooCommerce_Membership_Plan::add_member( $plan_id, $user_id );
38
+ }
addons/woocommerce-membership.php CHANGED
@@ -17,7 +17,7 @@ function acui_wm_restricted_fields( $acui_restricted_fields ){
17
  function acui_wm_documentation_after_plugins_activated(){
18
  ?>
19
  <tr valign="top">
20
- <th scope="row"><?php _e( "WooCommerce Membership is activated", 'import-users-from-csv-with-meta' ); ?></th>
21
  <td>
22
  <ol>
23
  <li><strong><?php _e( "Import all membership information", 'import-users-from-csv-with-meta' ); ?></strong>: <?php _e( "You can use the <strong>columns in the CSV format created by WooCommercer Membership</strong> in order to import data from this plugin.", 'import-users-from-csv-with-meta' ); ?>. <a href="https://docs.woocommerce.com/document/woocommerce-memberships-import-and-export/"><?php _e( "Read more about columns and formats", 'import-users-from-csv-with-meta' ); ?></a>.</li>
17
  function acui_wm_documentation_after_plugins_activated(){
18
  ?>
19
  <tr valign="top">
20
+ <th scope="row"><?php _e( "WooCommerce Memberships is activated", 'import-users-from-csv-with-meta' ); ?></th>
21
  <td>
22
  <ol>
23
  <li><strong><?php _e( "Import all membership information", 'import-users-from-csv-with-meta' ); ?></strong>: <?php _e( "You can use the <strong>columns in the CSV format created by WooCommercer Membership</strong> in order to import data from this plugin.", 'import-users-from-csv-with-meta' ); ?>. <a href="https://docs.woocommerce.com/document/woocommerce-memberships-import-and-export/"><?php _e( "Read more about columns and formats", 'import-users-from-csv-with-meta' ); ?></a>.</li>
classes/email-options.php CHANGED
@@ -9,29 +9,48 @@ class ACUI_Email_Options{
9
  }
10
 
11
  public static function admin_gui(){
 
 
 
12
  $subject_mail = get_option( "acui_mail_subject" );
13
  $body_mail = get_option( "acui_mail_body" );
14
  $template_id = get_option( "acui_mail_template_id" );
15
  $attachment_id = get_option( "acui_mail_attachment_id" );
16
  $enable_email_templates = get_option( "acui_enable_email_templates" );
17
- $automatic_wordpress_email = get_option( "acui_automatic_wordpress_email" );
18
  ?>
19
  <form method="POST" enctype="multipart/form-data" action="" accept-charset="utf-8">
20
- <h3><?php _e('Mail options','import-users-from-csv-with-meta'); ?></h3>
21
 
22
  <table class="optiontable form-table">
23
  <tbody>
24
  <tr valign="top">
25
- <th scope="row"><?php _e( 'WordPress automatic emails users updated', 'import-users-from-csv-with-meta' ); ?></th>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  <td>
27
  <fieldset>
28
  <legend class="screen-reader-text">
29
- <span><?php _e( 'Send automatic WordPress emails?', 'import-users-from-csv-with-meta' ); ?></span>
30
  </legend>
31
  <label for="automatic_wordpress_email">
32
  <select name="automatic_wordpress_email" id="automatic_wordpress_email">
33
- <option <?php if( $automatic_wordpress_email == 'false' ) echo "selected='selected'"; ?> value="false"><?php _e( "Deactivate WordPress automatic email when an user is updated or his password is changed", 'import-users-from-csv-with-meta' ) ;?></option>
34
- <option <?php if( $automatic_wordpress_email == 'true' ) echo "selected='selected'"; ?> value="true"><?php _e( 'Activate WordPress automatic email when an user is updated or his password is changed', 'import-users-from-csv-with-meta' ); ?></option>
35
  </select>
36
  <span class="description"><? _e( "When you update an user or change his password, WordPress prepare and send automatic email, you can deactivate it here.", 'import-users-from-csv-with-meta' ); ?></span>
37
  </label>
9
  }
10
 
11
  public static function admin_gui(){
12
+ $automatic_created_edited_wordpress_email = get_option( "acui_automatic_created_edited_wordpress_email" );
13
+ $automatic_wordpress_email = get_option( "acui_automatic_wordpress_email" );
14
+
15
  $subject_mail = get_option( "acui_mail_subject" );
16
  $body_mail = get_option( "acui_mail_body" );
17
  $template_id = get_option( "acui_mail_template_id" );
18
  $attachment_id = get_option( "acui_mail_attachment_id" );
19
  $enable_email_templates = get_option( "acui_enable_email_templates" );
 
20
  ?>
21
  <form method="POST" enctype="multipart/form-data" action="" accept-charset="utf-8">
22
+ <h3><?php _e('WordPress automatic emails','import-users-from-csv-with-meta'); ?></h3>
23
 
24
  <table class="optiontable form-table">
25
  <tbody>
26
  <tr valign="top">
27
+ <th scope="row"><?php _e( 'User created or edited', 'import-users-from-csv-with-meta' ); ?></th>
28
+ <td>
29
+ <fieldset>
30
+ <legend class="screen-reader-text">
31
+ <span><?php _e( 'User created or edited', 'import-users-from-csv-with-meta' ); ?></span>
32
+ </legend>
33
+ <label for="automatic_created_edited_wordpress_email">
34
+ <select name="automatic_created_edited_wordpress_email" id="automatic_created_edited_wordpress_email">
35
+ <option <?php selected( $automatic_created_edited_wordpress_email, false ); ?> value="false"><?php _e( "Deactivate WordPress automatic email when an user is created or edited", 'import-users-from-csv-with-meta' ) ;?></option>
36
+ <option <?php selected( $automatic_created_edited_wordpress_email, true ); ?> value="true"><?php _e( 'Activate WordPress automatic email when an user is created or edited', 'import-users-from-csv-with-meta' ); ?></option>
37
+ </select>
38
+ <span class="description"><? _e( "When you create or update an user, WordPress prepare and send automatic email, you can deactivate it here.", 'import-users-from-csv-with-meta' ); ?></span>
39
+ </label>
40
+ </fieldset>
41
+ </td>
42
+ </tr>
43
+ <tr valign="top">
44
+ <th scope="row"><?php _e( 'Password changed', 'import-users-from-csv-with-meta' ); ?></th>
45
  <td>
46
  <fieldset>
47
  <legend class="screen-reader-text">
48
+ <span><?php _e( 'Send automatic change password WordPress emails?', 'import-users-from-csv-with-meta' ); ?></span>
49
  </legend>
50
  <label for="automatic_wordpress_email">
51
  <select name="automatic_wordpress_email" id="automatic_wordpress_email">
52
+ <option <?php selected( $automatic_wordpress_email, false ); ?> value="false"><?php _e( "Deactivate WordPress automatic email when an user is updated or his password is changed", 'import-users-from-csv-with-meta' ) ;?></option>
53
+ <option <?php selected( $automatic_wordpress_email, true ); ?> value="true"><?php _e( 'Activate WordPress automatic email when an user is updated or his password is changed', 'import-users-from-csv-with-meta' ); ?></option>
54
  </select>
55
  <span class="description"><? _e( "When you update an user or change his password, WordPress prepare and send automatic email, you can deactivate it here.", 'import-users-from-csv-with-meta' ); ?></span>
56
  </label>
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.3.3
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
@@ -107,10 +107,12 @@ function acui_get_default_options_list(){
107
  'acui_frontend_role' => '',
108
  'acui_frontend_update_existing_users' => false,
109
  'acui_frontend_update_roles_existing_users' => false,
110
- // others
111
  'acui_manually_send_mail' => false,
112
  'acui_manually_send_mail_updated' => false,
113
  'acui_automatic_wordpress_email' => false,
 
 
114
  'acui_show_profile_fields' => false
115
  );
116
  }
@@ -358,12 +360,14 @@ function acui_save_mail_template( $form_data ){
358
  }
359
 
360
  $automatic_wordpress_email = sanitize_text_field( $form_data["automatic_wordpress_email"] );
 
361
  $subject_mail = sanitize_text_field( $form_data["subject_mail"] );
362
  $body_mail = wp_kses_post( stripslashes( $form_data["body_mail"] ) );
363
  $template_id = intval( $form_data["template_id"] );
364
  $email_template_attachment_id = intval( $form_data["email_template_attachment_id"] );
365
 
366
  update_option( "acui_automatic_wordpress_email", $automatic_wordpress_email );
 
367
  update_option( "acui_mail_subject", $subject_mail );
368
  update_option( "acui_mail_body", $body_mail );
369
  update_option( "acui_mail_template_id", $template_id );
@@ -382,7 +386,7 @@ function acui_save_mail_template( $form_data ){
382
  }
383
  ?>
384
  <div class="updated">
385
- <p><?php _e( 'Mail template updated correctly', 'import-users-from-csv-with-meta' )?></p>
386
  </div>
387
  <?php
388
  }
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.3.4
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
107
  'acui_frontend_role' => '',
108
  'acui_frontend_update_existing_users' => false,
109
  'acui_frontend_update_roles_existing_users' => false,
110
+ // emials
111
  'acui_manually_send_mail' => false,
112
  'acui_manually_send_mail_updated' => false,
113
  'acui_automatic_wordpress_email' => false,
114
+ 'acui_automatic_created_edited_wordpress_email' => false,
115
+ // profile fields
116
  'acui_show_profile_fields' => false
117
  );
118
  }
360
  }
361
 
362
  $automatic_wordpress_email = sanitize_text_field( $form_data["automatic_wordpress_email"] );
363
+ $automatic_created_edited_wordpress_email = sanitize_text_field( $form_data["automatic_created_edited_wordpress_email"] );
364
  $subject_mail = sanitize_text_field( $form_data["subject_mail"] );
365
  $body_mail = wp_kses_post( stripslashes( $form_data["body_mail"] ) );
366
  $template_id = intval( $form_data["template_id"] );
367
  $email_template_attachment_id = intval( $form_data["email_template_attachment_id"] );
368
 
369
  update_option( "acui_automatic_wordpress_email", $automatic_wordpress_email );
370
+ update_option( "acui_automatic_created_edited_wordpress_email", $automatic_created_edited_wordpress_email );
371
  update_option( "acui_mail_subject", $subject_mail );
372
  update_option( "acui_mail_body", $body_mail );
373
  update_option( "acui_mail_template_id", $template_id );
386
  }
387
  ?>
388
  <div class="updated">
389
+ <p><?php _e( 'Mail template and options updated correctly', 'import-users-from-csv-with-meta' )?></p>
390
  </div>
391
  <?php
392
  }
importer.php CHANGED
@@ -546,6 +546,15 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
546
  $mail_for_this_user = true;
547
  }
548
  }
 
 
 
 
 
 
 
 
 
549
 
550
  // send mail
551
  if( isset( $mail_for_this_user ) && $mail_for_this_user ):
546
  $mail_for_this_user = true;
547
  }
548
  }
549
+
550
+ // wordpress default user created and edited emails
551
+ if( get_option('acui_automatic_created_edited_wordpress_email') && $created ){
552
+ do_action( 'register_new_user', $user_id );
553
+ }
554
+
555
+ if( get_option('acui_automatic_created_edited_wordpress_email') && !$created ){
556
+ do_action( 'edit_user_created_user', $user_id, 'both' );
557
+ }
558
 
559
  // send mail
560
  if( isset( $mail_for_this_user ) && $mail_for_this_user ):
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.3.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -32,7 +32,7 @@ Clean and easy-to-use Import users plugin. It includes custom user meta to be in
32
  Moreover this plugin is compatible with:
33
 
34
  * WooCommerce: to import the customer data
35
- * WooCommerce Membership: to import memberships
36
  * BuddyPress: to import custom BuddyPress fields, groups and roles
37
  * Paid Membership Pro: to import memberships
38
  * Indeed Ultimate Membership Pro: to import memberships
@@ -43,12 +43,12 @@ Moreover this plugin is compatible with:
43
  * WP LMS Course: to enroll users in the courses while importing
44
  * WP Members: to import memberships
45
  * WP Users Group: to assign users to groups while importing
 
46
 
47
  In Codection we have more plugins, please take a look to them.
48
 
49
  * [RedSys Gateway for WooCommerce Pro a plugin to connect your WooCommerce to RedSys](https://codection.com/producto/redsys-gateway-for-woocommerce) (premium)
50
  * [Ceca Gateway for WooCommerce Pro a plugin to connect your WooCommerce to Ceca](https://codection.com/producto/ceca-gateway-for-woocommerce-pro/) (premium)
51
- * [BBVA Bancomer for WooCommerce Pro a plugin to connect your WooCommerce to BBVA Bancomer](https://codection.com/producto/bbva-bancomer-mexico-gateway-for-woocommerce-pro/) (premium)
52
  * [RedSys Button for WordPress a plugin to receive payments using RedSys in WordPress without using WooCommerce](https://codection.com/producto/redsys-button-wordpress/) (premium)
53
  * [RedSys Gateway for Contact Form 7 a plugin to receive payments using RedSys in WordPress using the popular contact plugin Contact Form 7](https://codection.com/producto/redsys-gateway-for-contact-form-7/) (premium)
54
  * [Ceca Gateway for Contact Form 7 a plugin to receive payments using Ceca in WordPress using the popular contact plugin Contact Form 7](https://codection.com/producto/ceca-gateway-for-contact-form-7/) (premium)
@@ -98,6 +98,10 @@ Plugin will automatically detect:
98
 
99
  == Changelog ==
100
 
 
 
 
 
101
  = 1.15.3.3 =
102
  * WooCommerce Membership addon improved, now you can only assign users to a plan using the membership_plan_id
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.3.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
32
  Moreover this plugin is compatible with:
33
 
34
  * WooCommerce: to import the customer data
35
+ * WooCommerce Memberships: to import memberships
36
  * BuddyPress: to import custom BuddyPress fields, groups and roles
37
  * Paid Membership Pro: to import memberships
38
  * Indeed Ultimate Membership Pro: to import memberships
43
  * WP LMS Course: to enroll users in the courses while importing
44
  * WP Members: to import memberships
45
  * WP Users Group: to assign users to groups while importing
46
+ * WooCommerce Membership by RightPress: to create memberships while users are being imported
47
 
48
  In Codection we have more plugins, please take a look to them.
49
 
50
  * [RedSys Gateway for WooCommerce Pro a plugin to connect your WooCommerce to RedSys](https://codection.com/producto/redsys-gateway-for-woocommerce) (premium)
51
  * [Ceca Gateway for WooCommerce Pro a plugin to connect your WooCommerce to Ceca](https://codection.com/producto/ceca-gateway-for-woocommerce-pro/) (premium)
 
52
  * [RedSys Button for WordPress a plugin to receive payments using RedSys in WordPress without using WooCommerce](https://codection.com/producto/redsys-button-wordpress/) (premium)
53
  * [RedSys Gateway for Contact Form 7 a plugin to receive payments using RedSys in WordPress using the popular contact plugin Contact Form 7](https://codection.com/producto/redsys-gateway-for-contact-form-7/) (premium)
54
  * [Ceca Gateway for Contact Form 7 a plugin to receive payments using Ceca in WordPress using the popular contact plugin Contact Form 7](https://codection.com/producto/ceca-gateway-for-contact-form-7/) (premium)
98
 
99
  == Changelog ==
100
 
101
+ = 1.15.3.4 =
102
+ * You can now use WordPress default user edited and created emails when importing users
103
+ * WooCommerce Membership by RightPress compatibility included, now you can assign users to their plan while they are being imported
104
+
105
  = 1.15.3.3 =
106
  * WooCommerce Membership addon improved, now you can only assign users to a plan using the membership_plan_id
107