Better Notifications for WordPress - Version 1.6.13

Version Description

  • 5th April 2018 =
  • Added: Full support for the new Multisite add-on.
  • Fixed: Multisite-only - the user_id was being used instead of the username in the login URL in the Lost Password - For User notification.
  • Fixed: Multisite-only - the New User Registration - For User notification wasn't working at all.
  • Fixed: Multisite-only - Permalink shortcodes weren't using the correct structure and instead were using the default ?p=123 structure when used on sub-sites.
  • Fixed: Some user shortcodes were only being outputted for the first user in a user role.
  • Fixed: An occasional issue where some notifications weren't appearing for custom post types.
Download this release

Release Info

Developer voltronik
Plugin Icon 128x128 Better Notifications for WordPress
Version 1.6.13
Comparing to
See all releases

Code changes from version 1.6.12 to 1.6.13

README.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: voltronik
3
  Donate link: https://betternotificationsforwp.com/donate/
4
  Tags: notification, email, push, sms, alert, HTML, customize, bulk, trigger, CC, BCC
5
  Requires at least: 4.0
6
- Tested up to: 4.9.4
7
  Requires PHP: 5.6
8
- Stable tag: 1.6.12
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -30,6 +30,8 @@ Power-up your notifications using add-ons:
30
 
31
  [Custom Fields](https://betternotificationsforwp.com/downloads/custom-fields/) - Provides a number of new shortcodes allowing you to include data from custom fields and custom user fields created using [ACF](https://wordpress.org/plugins/advanced-custom-fields/).
32
 
 
 
33
  [Send to Any Email](https://betternotificationsforwp.com/downloads/send-to-any-email/) - Send notifications to non-WordPress Users.
34
 
35
  [Global Override](https://betternotificationsforwp.com/downloads/per-post-override/) - Override some of the settings of notifications directly when editing a post, page, or custom post type.
@@ -38,8 +40,6 @@ Power-up your notifications using add-ons:
38
 
39
  [Profile Builder](https://betternotificationsforwp.com/downloads/profile-builder/) - Adds compatibility and new notifications and shortcodes for Profile Builder Free, Hobbyist, and Pro plugins to Better Notifications for WordPress.
40
 
41
- [Multisite](https://betternotificationsforwp.com/downloads/multisite/) - Adds compatibility and new notifications and shortcodes for WordPress Multisite to Better Notifications for WordPress (Coming Soon).
42
-
43
  ...and more coming soon!
44
 
45
  = Notifications =
@@ -102,6 +102,19 @@ The notifications that are currently available to use are:
102
 
103
  * New Term
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  If you'd like to see a notification in the list above, please drop me a line in the forum and I'll see what I can do to add it.
106
 
107
  > Like this plugin? Please leave it [a great review](https://wordpress.org/support/plugin/bnfw/reviews/?rate=5#new-post)! Don't think the plugin is worthy of 5 stars? Having problems? Let me know in the [forum](https://wordpress.org/support/plugin/bnfw/) and I'll do my best to help.
@@ -148,7 +161,7 @@ Yes! There is an option for suppressing comments marked as SPAM in the plugin se
148
 
149
  = Does this plugin and the add-ons work with Multisite? =
150
 
151
- Yes and no - some notifications work, others don't, and some are missing entirely. I do plan on adding full Multisite support at a later date however, this will be in the form of an add-on.
152
 
153
  = What isn't this plugin? =
154
 
@@ -194,12 +207,18 @@ An older version might work but this is untested. A lot of the newer features re
194
 
195
  2. Add New / Edit Notification
196
 
197
- 3. Plugin Settings
198
-
199
 
200
 
201
  == Changelog ==
202
 
 
 
 
 
 
 
 
 
203
  = 1.6.12 - 1st March 2018 =
204
  * New: Lots of new global user shortcodes! It's always been a bit difficult to explain how the user shortcodes changes between notifications - sometimes they're for the author of a post, sometimes they're the recipient user. Now, all user shortcodes are used solely for the author and a new set of global user shortcodes are available for the recipient. Full details are on the [Shortcodes](https://betternotificationsforwp.com/documentation/notifications/shortcodes/) documentation page.
205
  * Added: Preliminary changes for the upcoming [Multisite](https://betternotificationsforwp.com/downloads/multisite/) add-on.
3
  Donate link: https://betternotificationsforwp.com/donate/
4
  Tags: notification, email, push, sms, alert, HTML, customize, bulk, trigger, CC, BCC
5
  Requires at least: 4.0
6
+ Tested up to: 4.9.5
7
  Requires PHP: 5.6
8
+ Stable tag: 1.6.13
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
30
 
31
  [Custom Fields](https://betternotificationsforwp.com/downloads/custom-fields/) - Provides a number of new shortcodes allowing you to include data from custom fields and custom user fields created using [ACF](https://wordpress.org/plugins/advanced-custom-fields/).
32
 
33
+ [Multisite](https://betternotificationsforwp.com/downloads/multisite/) - Adds new notifications and shortcodes for WordPress Multisite to Better Notifications for WordPress.
34
+
35
  [Send to Any Email](https://betternotificationsforwp.com/downloads/send-to-any-email/) - Send notifications to non-WordPress Users.
36
 
37
  [Global Override](https://betternotificationsforwp.com/downloads/per-post-override/) - Override some of the settings of notifications directly when editing a post, page, or custom post type.
40
 
41
  [Profile Builder](https://betternotificationsforwp.com/downloads/profile-builder/) - Adds compatibility and new notifications and shortcodes for Profile Builder Free, Hobbyist, and Pro plugins to Better Notifications for WordPress.
42
 
 
 
43
  ...and more coming soon!
44
 
45
  = Notifications =
102
 
103
  * New Term
104
 
105
+ **Multisite ([Multisite Add-on](https://betternotificationsforwp.com/downloads/multisite/))**
106
+ * New Site Activated or Created - For Network Admin
107
+ * New User Created - For Network Admin
108
+ * Network Admin Email Change Attempted - For New Network Admin
109
+ * Network Admin Email Changed - For Old Network Admin
110
+ * New Site Activated or Created - For Site Admin
111
+ * Site Deleted - For Site Admin
112
+ * Site Admin Email Change Attempted - For New Site Admin
113
+ * Site Admin Email Changed - For Old Site Admin
114
+ * New Site Activated - For User
115
+ * New User Created - For User
116
+ * New User Invited to Site - For User
117
+
118
  If you'd like to see a notification in the list above, please drop me a line in the forum and I'll see what I can do to add it.
119
 
120
  > Like this plugin? Please leave it [a great review](https://wordpress.org/support/plugin/bnfw/reviews/?rate=5#new-post)! Don't think the plugin is worthy of 5 stars? Having problems? Let me know in the [forum](https://wordpress.org/support/plugin/bnfw/) and I'll do my best to help.
161
 
162
  = Does this plugin and the add-ons work with Multisite? =
163
 
164
+ Yes! Full support for WordPress Multisite was added in 1.6.13, alongside the release of the [Multisite Add-on](https://betternotificationsforwp.com/downloads/multisite/).
165
 
166
  = What isn't this plugin? =
167
 
207
 
208
  2. Add New / Edit Notification
209
 
 
 
210
 
211
 
212
  == Changelog ==
213
 
214
+ = 1.6.13 - 5th April 2018 =
215
+ * Added: Full support for the new [Multisite](https://betternotificationsforwp.com/downloads/multisite/) add-on.
216
+ * Fixed: Multisite-only - the user_id was being used instead of the username in the login URL in the Lost Password - For User notification.
217
+ * Fixed: Multisite-only - the New User Registration - For User notification wasn't working at all.
218
+ * Fixed: Multisite-only - Permalink shortcodes weren't using the correct structure and instead were using the default `?p=123` structure when used on sub-sites.
219
+ * Fixed: Some user shortcodes were only being outputted for the first user in a user role.
220
+ * Fixed: An occasional issue where some notifications weren't appearing for custom post types.
221
+
222
  = 1.6.12 - 1st March 2018 =
223
  * New: Lots of new global user shortcodes! It's always been a bit difficult to explain how the user shortcodes changes between notifications - sometimes they're for the author of a post, sometimes they're the recipient user. Now, all user shortcodes are used solely for the author and a new set of global user shortcodes are available for the recipient. Full details are on the [Shortcodes](https://betternotificationsforwp.com/documentation/notifications/shortcodes/) documentation page.
224
  * Added: Preliminary changes for the upcoming [Multisite](https://betternotificationsforwp.com/downloads/multisite/) add-on.
assets/js/bnfw.js CHANGED
@@ -7,6 +7,8 @@ jQuery(document).ready(function($) {
7
  } else {
8
  $('#email, #cc, #bcc, #reply').hide();
9
  }
 
 
10
  }
11
 
12
  function toggle_users() {
@@ -59,10 +61,20 @@ jQuery(document).ready(function($) {
59
  'new-user' === notification || 'welcome-email' === notification || 'user-password' === notification ||
60
  'password-changed' === notification || 'email-changed' === notification || 'user-role' === notification ||
61
  'multisite-new-user-invited' === notification || 'multisite-new-user-created' === notification || 'multisite-new-user-welcome' === notification ||
62
- 'multisite-site-registered' === notification || 'multisite-site-created' === notification || 'multisite-site-welcome' === notification || 'multisite-site-deleted' === notification ) {
 
 
 
63
 
64
  $('#toggle-fields, #email, #cc, #bcc, #reply, #users, #current-user, #post-author').hide();
65
  $('#user-password-msg, #disable-autop, #email-formatting').show();
 
 
 
 
 
 
 
66
  } else if ( 'new-comment' === notification || 'new-trackback' === notification || 'new-pingback' === notification ||
67
  'admin-password' === notification || 'admin-user' === notification || 'admin-role' === notification ) {
68
 
@@ -107,10 +119,20 @@ jQuery(document).ready(function($) {
107
  'new-user' === notification || 'welcome-email' === notification || 'user-password' === notification ||
108
  'password-changed' === notification || 'email-changed' === notification || 'user-role' === notification ||
109
  'multisite-new-user-invited' === notification || 'multisite-new-user-created' === notification || 'multisite-new-user-welcome' === notification ||
110
- 'multisite-site-registered' === notification || 'multisite-site-created' === notification || 'multisite-site-welcome' === notification || 'multisite-site-deleted' === notification ) {
 
 
 
111
 
112
  $('#toggle-fields, #email, #cc, #bcc, #reply, #users, #current-user, #post-author').hide();
113
  $('#user-password-msg, #disable-autop, #email-formatting').show();
 
 
 
 
 
 
 
114
  } else if ( 'admin-password' === notification || 'admin-user' === notification || 'admin-role' === notification ) {
115
  $('#post-author').hide();
116
  $('#toggle-fields, #users, #email-formatting, #disable-autop, #current-user').show();
7
  } else {
8
  $('#email, #cc, #bcc, #reply').hide();
9
  }
10
+
11
+ $( '#subject-wrapper' ).show();
12
  }
13
 
14
  function toggle_users() {
61
  'new-user' === notification || 'welcome-email' === notification || 'user-password' === notification ||
62
  'password-changed' === notification || 'email-changed' === notification || 'user-role' === notification ||
63
  'multisite-new-user-invited' === notification || 'multisite-new-user-created' === notification || 'multisite-new-user-welcome' === notification ||
64
+ 'multisite-site-registered' === notification || 'multisite-site-welcome' === notification ||
65
+ 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
66
+ 'multisite-site-admin-email-change-attempted' === notification || 'multisite-site-admin-email-changed' === notification ||
67
+ 'multisite-network-admin-email-change-attempted' === notification || 'multisite-network-admin-email-changed' === notification) {
68
 
69
  $('#toggle-fields, #email, #cc, #bcc, #reply, #users, #current-user, #post-author').hide();
70
  $('#user-password-msg, #disable-autop, #email-formatting').show();
71
+
72
+ $( '#subject-wrapper' ).show();
73
+ if ( 'multisite-new-user-created' === notification || 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
74
+ 'multisite-site-admin-email-change-attempted' === notification || 'multisite-network-admin-email-change-attempted' === notification ) {
75
+
76
+ $( '#subject-wrapper' ).hide();
77
+ }
78
  } else if ( 'new-comment' === notification || 'new-trackback' === notification || 'new-pingback' === notification ||
79
  'admin-password' === notification || 'admin-user' === notification || 'admin-role' === notification ) {
80
 
119
  'new-user' === notification || 'welcome-email' === notification || 'user-password' === notification ||
120
  'password-changed' === notification || 'email-changed' === notification || 'user-role' === notification ||
121
  'multisite-new-user-invited' === notification || 'multisite-new-user-created' === notification || 'multisite-new-user-welcome' === notification ||
122
+ 'multisite-site-registered' === notification || 'multisite-site-welcome' === notification ||
123
+ 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
124
+ 'multisite-site-admin-email-change-attempted' === notification || 'multisite-site-admin-email-changed' === notification ||
125
+ 'multisite-network-admin-email-change-attempted' === notification || 'multisite-network-admin-email-changed' === notification) {
126
 
127
  $('#toggle-fields, #email, #cc, #bcc, #reply, #users, #current-user, #post-author').hide();
128
  $('#user-password-msg, #disable-autop, #email-formatting').show();
129
+
130
+ $( '#subject-wrapper' ).show();
131
+ if ( 'multisite-new-user-created' === notification || 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
132
+ 'multisite-site-admin-email-change-attempted' === notification || 'multisite-network-admin-email-change-attempted' === notification ) {
133
+
134
+ $( '#subject-wrapper' ).hide();
135
+ }
136
  } else if ( 'admin-password' === notification || 'admin-user' === notification || 'admin-role' === notification ) {
137
  $('#post-author').hide();
138
  $('#toggle-fields, #users, #email-formatting, #disable-autop, #current-user').show();
bnfw.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Better Notifications for WordPress
4
  * Plugin URI: https://wordpress.org/plugins/bnfw/
5
  * Description: Supercharge your WordPress notifications using a WYSIWYG editor and shortcodes. Default and new notifications available. Add more power with Add-ons.
6
- * Version: 1.6.12
7
  * Author: Made with Fuel
8
  * Author URI: https://betternotificationsforwp.com/
9
  * Author Email: hello@betternotificationsforwp.com
3
  * Plugin Name: Better Notifications for WordPress
4
  * Plugin URI: https://wordpress.org/plugins/bnfw/
5
  * Description: Supercharge your WordPress notifications using a WYSIWYG editor and shortcodes. Default and new notifications available. Add more power with Add-ons.
6
+ * Version: 1.6.13
7
  * Author: Made with Fuel
8
  * Author URI: https://betternotificationsforwp.com/
9
  * Author Email: hello@betternotificationsforwp.com
includes/admin/class-bnfw-notification.php CHANGED
@@ -470,7 +470,7 @@ foreach ( $taxs as $tax ) {
470
 
471
  <?php do_action( 'bnfw_after_send_to', $setting ); ?>
472
 
473
- <tr valign="top">
474
  <th scope="row">
475
  <?php esc_html_e( 'Subject', 'bnfw' ); ?>
476
  <div class="bnfw-help-tip"><p><?php esc_html_e( 'Notification subject. You can use ', 'bnfw' ); ?><a href="https://betternotificationsforwp.com/documentation/notifications/shortcodes/" target="_blank">shortcodes</a><?php esc_html_e(' here.', 'bnfw' ); ?></p></div>
470
 
471
  <?php do_action( 'bnfw_after_send_to', $setting ); ?>
472
 
473
+ <tr valign="top" id="subject-wrapper">
474
  <th scope="row">
475
  <?php esc_html_e( 'Subject', 'bnfw' ); ?>
476
  <div class="bnfw-help-tip"><p><?php esc_html_e( 'Notification subject. You can use ', 'bnfw' ); ?><a href="https://betternotificationsforwp.com/documentation/notifications/shortcodes/" target="_blank">shortcodes</a><?php esc_html_e(' here.', 'bnfw' ); ?></p></div>
includes/engine/class-bnfw-engine.php CHANGED
@@ -382,11 +382,15 @@ class BNFW_Engine {
382
  case 'user-role':
383
  case 'admin-role':
384
  case 'password-changed':
385
- case 'email-changed':
386
  // handle users (lost password and new user registration)
387
  $message = $this->user_shortcodes( $message, $extra_data );
388
  break;
389
 
 
 
 
 
 
390
  case 'new-category':
391
  // handle new category
392
  $message = $this->taxonomy_shortcodes( $message, 'category', $extra_data );
382
  case 'user-role':
383
  case 'admin-role':
384
  case 'password-changed':
 
385
  // handle users (lost password and new user registration)
386
  $message = $this->user_shortcodes( $message, $extra_data );
387
  break;
388
 
389
+ case 'email-changed':
390
+ // handle users (lost password and new user registration)
391
+ $message = $this->user_shortcodes( $message, $extra_data, 'email_' );
392
+ break;
393
+
394
  case 'new-category':
395
  // handle new category
396
  $message = $this->taxonomy_shortcodes( $message, 'category', $extra_data );
includes/license/class-bnfw-license.php CHANGED
@@ -92,6 +92,16 @@ class BNFW_License {
92
  * @return array
93
  */
94
  public function settings( $settings ) {
 
 
 
 
 
 
 
 
 
 
95
  $bnfw_license_settings = array(
96
  array(
97
  'id' => $this->item_shortname . '_license_key',
@@ -131,9 +141,13 @@ class BNFW_License {
131
  $api_params = array(
132
  'edd_action' => 'activate_license',
133
  'license' => $license,
134
- 'item_name' => urlencode( $this->item_name )
135
  );
136
 
 
 
 
 
137
  // Call the API
138
  $response = wp_remote_get(
139
  esc_url_raw( add_query_arg( $api_params, $this->api_url ) ),
@@ -177,9 +191,13 @@ class BNFW_License {
177
  $api_params = array(
178
  'edd_action' => 'deactivate_license',
179
  'license' => $this->license,
180
- 'item_name' => urlencode( $this->item_name )
181
  );
182
 
 
 
 
 
183
  // Call the API
184
  $response = wp_remote_get(
185
  esc_url_raw( add_query_arg( $api_params, $this->api_url ) ),
92
  * @return array
93
  */
94
  public function settings( $settings ) {
95
+ if ( 'Multisite Add-on' === $this->item_name && ! is_multisite() ) {
96
+ return $settings;
97
+ }
98
+
99
+ if ( 'Multisite Add-on' === $this->item_name && is_multisite() ) {
100
+ if ( ! is_main_site() ) {
101
+ return $settings;
102
+ }
103
+ }
104
+
105
  $bnfw_license_settings = array(
106
  array(
107
  'id' => $this->item_shortname . '_license_key',
141
  $api_params = array(
142
  'edd_action' => 'activate_license',
143
  'license' => $license,
144
+ 'item_name' => urlencode( $this->item_name ),
145
  );
146
 
147
+ if ( 'Multisite Add-on' === $this->item_name && is_multisite() ) {
148
+ $api_params['url'] = get_home_url( get_main_site_id() );
149
+ }
150
+
151
  // Call the API
152
  $response = wp_remote_get(
153
  esc_url_raw( add_query_arg( $api_params, $this->api_url ) ),
191
  $api_params = array(
192
  'edd_action' => 'deactivate_license',
193
  'license' => $this->license,
194
+ 'item_name' => urlencode( $this->item_name ),
195
  );
196
 
197
+ if ( 'Multisite Add-on' === $this->item_name && is_multisite() ) {
198
+ $api_params['url'] = get_home_url( get_main_site_id() );
199
+ }
200
+
201
  // Call the API
202
  $response = wp_remote_get(
203
  esc_url_raw( add_query_arg( $api_params, $this->api_url ) ),