Import users from CSV with meta - Version 1.11.2

Version Description

  • Problem with WordPress default emails fixed
Download this release

Release Info

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

Code changes from version 1.11.1 to 1.11.2

Files changed (3) hide show
  1. import-users-from-csv-with-meta.php +1 -1
  2. importer.php +15 -13
  3. readme.txt +4 -1
import-users-from-csv-with-meta.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Import users from CSV with meta
4
  Plugin URI: https://www.codection.com
5
  Description: This plugins allows to import users using CSV files to WP database automatically
6
- Version: 1.11.1
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
3
  Plugin Name: Import users from CSV with meta
4
  Plugin URI: https://www.codection.com
5
  Description: This plugins allows to import users using CSV files to WP database automatically
6
+ Version: 1.11.2
7
  Author: codection
8
  Author URI: https://codection.com
9
  License: GPL2
importer.php CHANGED
@@ -69,7 +69,13 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
69
  update_option( "acui_manually_send_mail_updated", true );
70
  else
71
  update_option( "acui_manually_send_mail_updated", false );
72
-
 
 
 
 
 
 
73
  // action
74
  echo "<h3>" . __('Ready to registers','import-users-from-csv-with-meta') . "</h3>";
75
  echo "<p>" . __('First row represents the form of sheet','import-users-from-csv-with-meta') . "</p>";
@@ -500,11 +506,6 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
500
  $body_mail = str_replace("**" . $headers[ $i ] . "**", $data[ $i ] , $body_mail);
501
  }
502
 
503
- if( !get_option('acui_automattic_wordpress_email') ){
504
- add_filter( 'send_email_change_email', 'acui_return_false', 999 );
505
- add_filter( 'send_password_change_email', 'acui_return_false', 999 );
506
- }
507
-
508
  $body_mail = wpautop( $body_mail );
509
 
510
  add_filter( 'wp_mail_content_type', 'cod_set_html_content_type' );
@@ -523,13 +524,7 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
523
  else
524
  wp_mail( $email, $subject, $body_mail );
525
 
526
- remove_filter( 'wp_mail_content_type', 'cod_set_html_content_type' );
527
-
528
- if( !get_option('acui_automattic_wordpress_email') ){
529
- remove_filter( 'send_email_change_email', 'acui_return_false', 999 );
530
- remove_filter( 'send_password_change_email', 'acui_return_false', 999 );
531
- }
532
-
533
  endif;
534
 
535
  endif;
@@ -537,6 +532,13 @@ function acui_import_users( $file, $form_data, $attach_id = 0, $is_cron = false,
537
  $row++;
538
  endwhile;
539
 
 
 
 
 
 
 
 
540
  if( $attach_id != 0 )
541
  wp_delete_attachment( $attach_id );
542
 
69
  update_option( "acui_manually_send_mail_updated", true );
70
  else
71
  update_option( "acui_manually_send_mail_updated", false );
72
+
73
+ // disable WordPress default emails if this must be disabled
74
+ if( !get_option('acui_automattic_wordpress_email') ){
75
+ add_filter( 'send_email_change_email', 'acui_return_false', 999 );
76
+ add_filter( 'send_password_change_email', 'acui_return_false', 999 );
77
+ }
78
+
79
  // action
80
  echo "<h3>" . __('Ready to registers','import-users-from-csv-with-meta') . "</h3>";
81
  echo "<p>" . __('First row represents the form of sheet','import-users-from-csv-with-meta') . "</p>";
506
  $body_mail = str_replace("**" . $headers[ $i ] . "**", $data[ $i ] , $body_mail);
507
  }
508
 
 
 
 
 
 
509
  $body_mail = wpautop( $body_mail );
510
 
511
  add_filter( 'wp_mail_content_type', 'cod_set_html_content_type' );
524
  else
525
  wp_mail( $email, $subject, $body_mail );
526
 
527
+ remove_filter( 'wp_mail_content_type', 'cod_set_html_content_type' );
 
 
 
 
 
 
528
  endif;
529
 
530
  endif;
532
  $row++;
533
  endwhile;
534
 
535
+ // let the filter of default WordPress emails as it were before deactivating them
536
+ if( !get_option('acui_automattic_wordpress_email') ){
537
+ remove_filter( 'send_email_change_email', 'acui_return_false', 999 );
538
+ remove_filter( 'send_password_change_email', 'acui_return_false', 999 );
539
+ }
540
+
541
+
542
  if( $attach_id != 0 )
543
  wp_delete_attachment( $attach_id );
544
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://paypal.me/codection
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: 4.9.4
7
- Stable tag: 1.11.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,6 +71,9 @@ Plugin will automatically detect:
71
 
72
  == Changelog ==
73
 
 
 
 
74
  = 1.11.1 =
75
  * Sidebar changed
76
  * Readme completed
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: 4.9.4
7
+ Stable tag: 1.11.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
 
72
  == Changelog ==
73
 
74
+ = 1.11.2 =
75
+ * Problem with WordPress default emails fixed
76
+
77
  = 1.11.1 =
78
  * Sidebar changed
79
  * Readme completed