Manage Notification E-mails - Version 1.8.1

Version Description

If you're one of the early installers, than you'll be happy to see that de new user notification is now splitted in admin and user e-mail management.

Download this release

Release Info

Developer Virgial
Plugin Icon 128x128 Manage Notification E-mails
Version 1.8.1
Comparing to
See all releases

Code changes from version 1.8.0 to 1.8.1

core/class.FAMNE.php CHANGED
@@ -36,9 +36,13 @@ if ( ! class_exists( 'FAMNE' ) ) :
36
  self::$network_managed = self::get_option( 'famne_network_managed' ) ? true : false;
37
  }
38
 
39
- public static function network_managed()
40
- {
41
- return self::$network_managed;
 
 
 
 
42
  }
43
 
44
  /**
@@ -125,7 +129,7 @@ if ( ! class_exists( 'FAMNE' ) ) :
125
  return get_site_option( $name );
126
  }
127
 
128
- return self::$network_managed ? get_site_option( $name ) : get_option( $name );
129
  }
130
 
131
  /**
@@ -144,7 +148,7 @@ if ( ! class_exists( 'FAMNE' ) ) :
144
  self::$network_managed = '1' === $options ? true : false;
145
  return update_site_option( $name, $options );
146
  }
147
- return self::$network_managed ? update_site_option( $name, $options ) : update_option( $name, $options );
148
  }
149
 
150
  /**
@@ -185,6 +189,13 @@ if ( ! class_exists( 'FAMNE' ) ) :
185
  return;
186
  }
187
 
 
 
 
 
 
 
 
188
  if ( version_compare( $current_version, '1.5.1' ) <= 0 ) {
189
  /** Update to 1.6.0
190
  * setting the newly added options to checked as default
36
  self::$network_managed = self::get_option( 'famne_network_managed' ) ? true : false;
37
  }
38
 
39
+ /**
40
+ * Network managed
41
+ *
42
+ * @return boolean
43
+ */
44
+ public static function network_managed() {
45
+ return self::get_option( 'famne_network_managed' ) ? true : false;
46
  }
47
 
48
  /**
129
  return get_site_option( $name );
130
  }
131
 
132
+ return self::network_managed() ? get_site_option( $name ) : get_option( $name );
133
  }
134
 
135
  /**
148
  self::$network_managed = '1' === $options ? true : false;
149
  return update_site_option( $name, $options );
150
  }
151
+ return self::network_managed() ? update_site_option( $name, $options ) : update_option( $name, $options );
152
  }
153
 
154
  /**
189
  return;
190
  }
191
 
192
+ if ( version_compare( $current_version, '1.8.0' ) <= 0 && self::network_managed() ) {
193
+ /** Update to 1.8.1
194
+ * setting the registrationnotification
195
+ */
196
+ update_site_option( 'registrationnotification', ! empty( $options['wp_new_user_notification_to_admin'] ) ? 'yes' : 'no' );
197
+ }
198
+
199
  if ( version_compare( $current_version, '1.5.1' ) <= 0 ) {
200
  /** Update to 1.6.0
201
  * setting the newly added options to checked as default
manage-notification-emails.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: Manage Notification E-mails
4
- Plugin URI: https://www.freeamigos.nl/wp-plugins/manage-notification-emails/1.8.0
5
  Description: This plugin gives you the option to disable some of the notification e-mails send by WordPress. It's a simple plugin but effective.
6
- Version: 1.8.0
7
  Author: Virgial Berveling
8
  Author URI: https://www.freeamigos.nl
9
  Text Domain: manage-notification-emails
@@ -60,7 +60,7 @@ if ( ! defined( 'ABSPATH' ) ) {
60
  die();
61
  }
62
 
63
- define( 'FA_MNE_VERSION', '1.8.0' );
64
  define( 'FA_MNE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
65
  define( 'FA_MNE_PLUGIN_DIR', untrailingslashit( dirname( __FILE__ ) ) );
66
  define( 'FA_MNE_SLUG', 'manage-notification-emails' );
1
  <?php
2
  /*
3
  Plugin Name: Manage Notification E-mails
4
+ Plugin URI: https://www.freeamigos.nl/wp-plugins/manage-notification-emails/1.8.1
5
  Description: This plugin gives you the option to disable some of the notification e-mails send by WordPress. It's a simple plugin but effective.
6
+ Version: 1.8.1
7
  Author: Virgial Berveling
8
  Author URI: https://www.freeamigos.nl
9
  Text Domain: manage-notification-emails
60
  die();
61
  }
62
 
63
+ define( 'FA_MNE_VERSION', '1.8.1' );
64
  define( 'FA_MNE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
65
  define( 'FA_MNE_PLUGIN_DIR', untrailingslashit( dirname( __FILE__ ) ) );
66
  define( 'FA_MNE_SLUG', 'manage-notification-emails' );
modules/settings-page/class.FAMNESettingsPage.php CHANGED
@@ -238,6 +238,13 @@ if ( ! class_exists( 'FAMNESettingsPage' ) ) :
238
 
239
  $options = $this->sanitize( $options );
240
 
 
 
 
 
 
 
 
241
  FAMNE::update_option( 'famne_options', $options );
242
  endif;
243
 
238
 
239
  $options = $this->sanitize( $options );
240
 
241
+ /* Since 1.8.1 */
242
+ if ( ! empty( $options['wp_new_user_notification_to_admin'] ) ) {
243
+ update_site_option( 'registrationnotification', 'yes' );
244
+ } else {
245
+ update_site_option( 'registrationnotification', 'no' );
246
+ }
247
+
248
  FAMNE::update_option( 'famne_options', $options );
249
  endif;
250
 
modules/settings-page/views/settings.php CHANGED
@@ -35,7 +35,20 @@ global $famne_options;
35
  <div class="section-part">
36
  <?php
37
  print_start_table_form();
38
- print_checkbox( $famne_options, 'wp_new_user_notification_to_admin', __( 'New user notification to admin', 'manage-notification-emails' ), __( 'Sends an e-mail to the site admin after a new user is registered.', 'manage-notification-emails' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  print_checkbox( $famne_options, 'wp_password_change_notification', __( 'Password change notification to admin', 'manage-notification-emails' ), __( 'Send e-mail to the blog admin of a user changing his or her password.', 'manage-notification-emails' ) );
40
 
41
  print_checkbox( $famne_options, 'auto_core_update_send_email', __( 'automatic WordPress core update e-mail', 'manage-notification-emails' ), __( 'Sends an e-mail after a successful automatic WordPress core update to administrators. E-mails about failed updates will always be sent to the administrators and cannot be disabled.', 'manage-notification-emails' ) );
35
  <div class="section-part">
36
  <?php
37
  print_start_table_form();
38
+ $user_noti_title = __( 'New user notification to site admin', 'manage-notification-emails' );
39
+ $user_noti_label = __( 'Sends an e-mail to the site admin after a new user is registered.', 'manage-notification-emails' );
40
+ if ( is_multisite() && ! FAMNE::network_managed() ) {
41
+ $user_noti = get_site_option( 'registrationnotification' ) === 'yes' ? true : false;
42
+ print '<div class="option-container">';
43
+ print '<label><input type="checkbox" disabled ' . ( $user_noti ? 'checked="checked"' : '' ) . ' />';
44
+
45
+ // translators: Adding network settings link.
46
+ print '<strong>' . $user_noti_title . '</strong><br/><em>' . sprintf( __( 'Globally managed in the multisite %1$snetwork settings menu%2$s.', 'manage-notification-emails' ), '<a href="' . network_admin_url( 'settings.php' ) . '">', '</a>' ) . '</em><br/>' . $user_noti_label;
47
+ print '</label>';
48
+ print '</div>';
49
+ } else {
50
+ print_checkbox( $famne_options, 'wp_new_user_notification_to_admin', $user_noti_title, $user_noti_label );
51
+ }
52
  print_checkbox( $famne_options, 'wp_password_change_notification', __( 'Password change notification to admin', 'manage-notification-emails' ), __( 'Send e-mail to the blog admin of a user changing his or her password.', 'manage-notification-emails' ) );
53
 
54
  print_checkbox( $famne_options, 'auto_core_update_send_email', __( 'automatic WordPress core update e-mail', 'manage-notification-emails' ), __( 'Sends an e-mail after a successful automatic WordPress core update to administrators. E-mails about failed updates will always be sent to the administrators and cannot be disabled.', 'manage-notification-emails' ) );