Import users from CSV with meta - Version 1.16.1.1

Version Description

  • New wildcards included in emails for WooCommerce: woocommercelostpasswordurl, woocommercepasswordreseturl and woocommercepasswordreseturllink
Download this release

Release Info

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

Code changes from version 1.16.1 to 1.16.1.1

addons/woocommerce.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  if ( ! defined( 'ABSPATH' ) ) exit;
4
 
5
  if( !is_plugin_active( 'woocommerce/woocommerce.php' ) ){
@@ -14,6 +13,8 @@ class ACUI_WooCommerce{
14
  add_action( 'acui_documentation_after_plugins_activated', array( $this, 'documentation' ) );
15
  add_action( 'post_acui_import_single_user', array( $this, 'sync_wc_customer' ), 10, 4 );
16
  add_action( 'after_acui_import_users', array( $this, 'clear_transients' ) );
 
 
17
  }
18
 
19
  function fields(){
@@ -94,6 +95,29 @@ class ACUI_WooCommerce{
94
  wc_delete_shop_order_transients();
95
  delete_transient( 'wc_count_comments' );
96
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  }
98
 
99
  new ACUI_WooCommerce();
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
  if( !is_plugin_active( 'woocommerce/woocommerce.php' ) ){
13
  add_action( 'acui_documentation_after_plugins_activated', array( $this, 'documentation' ) );
14
  add_action( 'post_acui_import_single_user', array( $this, 'sync_wc_customer' ), 10, 4 );
15
  add_action( 'after_acui_import_users', array( $this, 'clear_transients' ) );
16
+ add_filter( 'acui_import_email_body_before_wpautop', array( $this, 'include_overrides_email' ), 10, 5 );
17
+ add_action( 'acui_email_wildcards_list_elements', array( $this, 'new_wildcards_email' ) );
18
  }
19
 
20
  function fields(){
95
  wc_delete_shop_order_transients();
96
  delete_transient( 'wc_count_comments' );
97
  }
98
+
99
+ function include_overrides_email( $body, $headers, $data, $created, $user_id ){
100
+ $user_data = get_user_by( 'ID', $user_id );
101
+ $reset_key = get_password_reset_key( $user_data );
102
+
103
+ $body = str_replace( "**woocommercelostpasswordurl**", wc_lostpassword_url(), $body );
104
+
105
+ $woocommerce_password_reset_url = esc_url( add_query_arg( array( 'key' => $reset_key, 'id' => $user_id ), wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) ) ) );
106
+ $body = str_replace( "**woocommercepasswordreseturl**", $woocommerce_password_reset_url, $body );
107
+
108
+ $woocommerce_password_reset_url_link = wp_sprintf( '<a href="%s">%s</a>', $woocommerce_password_reset_url, __( 'Password reset link', 'import-users-from-csv-with-meta' ) );
109
+ $body = str_replace( "**woocommercepasswordreseturllink**", $woocommerce_password_reset_url_link, $body );
110
+
111
+ return $body;
112
+ }
113
+
114
+ function new_wildcards_email(){
115
+ ?>
116
+ <li>**woocommercelostpasswordurl** = <?php _e( 'WooCommerce lost password url', 'import-users-from-csv-with-meta' ); ?></li>
117
+ <li>**woocommercepasswordreseturl** = <?php _e( 'WooCommerce password reset url', 'import-users-from-csv-with-meta' ); ?>
118
+ <li>**woocommercepasswordreseturllink** = <?php _e( 'WooCommerce password reset url with HTML link', 'import-users-from-csv-with-meta' ); ?>
119
+ <?php
120
+ }
121
  }
122
 
123
  new ACUI_WooCommerce();
classes/email-templates.php CHANGED
@@ -82,6 +82,7 @@ class ACUI_Email_Template{
82
  <li>**passwordreseturllink** = <?php _e( 'password reset url with HTML link', 'import-users-from-csv-with-meta' ); ?></li>
83
  <li>**email** = <?php _e( 'user email', 'import-users-from-csv-with-meta' ); ?></li>
84
  <li><?php _e( "You can also use any WordPress user standard field or an own metadata, if you have used it in your CSV. For example, if you have a first_name column, you could use **first_name** or any other meta_data like **my_custom_meta**", 'import-users-from-csv-with-meta' ) ;?></li>
 
85
  </ul>
86
  <?php
87
  }
82
  <li>**passwordreseturllink** = <?php _e( 'password reset url with HTML link', 'import-users-from-csv-with-meta' ); ?></li>
83
  <li>**email** = <?php _e( 'user email', 'import-users-from-csv-with-meta' ); ?></li>
84
  <li><?php _e( "You can also use any WordPress user standard field or an own metadata, if you have used it in your CSV. For example, if you have a first_name column, you could use **first_name** or any other meta_data like **my_custom_meta**", 'import-users-from-csv-with-meta' ) ;?></li>
85
+ <?php do_action( 'acui_email_wildcards_list_elements' ); ?>
86
  </ul>
87
  <?php
88
  }
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
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.1
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
importer.php CHANGED
@@ -644,7 +644,9 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
644
  $data[ $i ] = ( is_array( $data[ $i ] ) ) ? implode( "-", $data[ $i ] ) : $data[ $i ];
645
  $body = str_replace( "**" . $headers[ $i ] . "**", $data[ $i ] , $body );
646
  $subject = str_replace( "**" . $headers[ $i ] . "**", $data[ $i ] , $subject );
647
- }
 
 
648
 
649
  $body = wpautop( $body );
650
 
@@ -653,11 +655,11 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
653
  if( !empty( $attachment_id ) )
654
  $attachments[] = get_attached_file( $attachment_id );
655
 
656
- $email_to = apply_filters( 'acui_import_email_to', $email, $headers, $data, $created );
657
- $subject = apply_filters( 'acui_import_email_subject', $subject, $headers, $data, $created );
658
- $body = apply_filters( 'acui_import_email_body', $body, $headers, $data, $created );
659
- $headers_mail = apply_filters( 'acui_import_email_headers', array( 'Content-Type: text/html; charset=UTF-8' ), $headers, $data );
660
- $attachments = apply_filters( 'acui_import_email_attachments', $attachments, $headers, $data, $created );
661
 
662
  wp_mail( $email_to, $subject, $body, $headers_mail, $attachments );
663
  endif;
644
  $data[ $i ] = ( is_array( $data[ $i ] ) ) ? implode( "-", $data[ $i ] ) : $data[ $i ];
645
  $body = str_replace( "**" . $headers[ $i ] . "**", $data[ $i ] , $body );
646
  $subject = str_replace( "**" . $headers[ $i ] . "**", $data[ $i ] , $subject );
647
+ }
648
+
649
+ $body = apply_filters( 'acui_import_email_body_before_wpautop', $body, $headers, $data, $created, $user_id );
650
 
651
  $body = wpautop( $body );
652
 
655
  if( !empty( $attachment_id ) )
656
  $attachments[] = get_attached_file( $attachment_id );
657
 
658
+ $email_to = apply_filters( 'acui_import_email_to', $email, $headers, $data, $created, $user_id );
659
+ $subject = apply_filters( 'acui_import_email_subject', $subject, $headers, $data, $created, $user_id );
660
+ $body = apply_filters( 'acui_import_email_body', $body, $headers, $data, $created, $user_id );
661
+ $headers_mail = apply_filters( 'acui_import_email_headers', array( 'Content-Type: text/html; charset=UTF-8' ), $headers, $data, $created, $user_id );
662
+ $attachments = apply_filters( 'acui_import_email_attachments', $attachments, $headers, $data, $created, $user_id );
663
 
664
  wp_mail( $email_to, $subject, $body, $headers_mail, $attachments );
665
  endif;
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
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -99,10 +99,12 @@ Plugin will automatically detect:
99
 
100
  == Changelog ==
101
 
 
 
 
102
  = 1.16.1 =
103
  * Multisite check and fix issues
104
  * Addon to include compatibility included Paid Member Subscriptions by Cozmoslabs thanks to Marian Lowe
105
- * Fixed with email templates not being created
106
 
107
  = 1.16 =
108
  * Code is being rewritten to make it easy to update
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
 
100
  == Changelog ==
101
 
102
+ = 1.16.1.1 =
103
+ * New wildcards included in emails for WooCommerce: woocommercelostpasswordurl, woocommercepasswordreseturl and woocommercepasswordreseturllink
104
+
105
  = 1.16.1 =
106
  * Multisite check and fix issues
107
  * Addon to include compatibility included Paid Member Subscriptions by Cozmoslabs thanks to Marian Lowe
 
108
 
109
  = 1.16 =
110
  * Code is being rewritten to make it easy to update