Better Notifications for WordPress - Version 1.8.2

Version Description

  • 14th May 2020 =
  • Fixed: Email addresses stored in custom fields weren't being used in Comment notifications when the Custom Fields add-on was installed.
  • Fixed: Two PHP notices showing above the subscriptions form when the Subscriptions add-on was installed.
  • Fixed: 'The User Lost Password - For User' notification wasn't outputting shortcodes in the message subject.
  • Fixed: 'The User Lost Password - For User' notification had an incorrect shortcode when inserting the default email content.
Download this release

Release Info

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

Code changes from version 1.8.1 to 1.8.2

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: 5.4
7
  Requires PHP: 5.6
8
- Stable tag: 1.8.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -234,6 +234,12 @@ Yes, of course! The plugin is completely translation-friendly and if you send me
234
 
235
  == Changelog ==
236
 
 
 
 
 
 
 
237
  = 1.8.1 - 21st April 2020 =
238
  * Added: Core changes to allow the [Global Override add-on](https://betternotificationsforwp.com/downloads/per-post-override/) to only send out notifications once.
239
  * Fixed: A range of issues relating to the [Global Override add-on](https://betternotificationsforwp.com/downloads/per-post-override/).
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: 5.4.1
7
  Requires PHP: 5.6
8
+ Stable tag: 1.8.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
234
 
235
  == Changelog ==
236
 
237
+ = 1.8.2 - 14th May 2020 =
238
+ * Fixed: Email addresses stored in custom fields weren't being used in Comment notifications when the Custom Fields add-on was installed.
239
+ * Fixed: Two PHP notices showing above the subscriptions form when the Subscriptions add-on was installed.
240
+ * Fixed: 'The User Lost Password - For User' notification wasn't outputting shortcodes in the message subject.
241
+ * Fixed: 'The User Lost Password - For User' notification had an incorrect shortcode when inserting the default email content.
242
+
243
  = 1.8.1 - 21st April 2020 =
244
  * Added: Core changes to allow the [Global Override add-on](https://betternotificationsforwp.com/downloads/per-post-override/) to only send out notifications once.
245
  * Fixed: A range of issues relating to the [Global Override add-on](https://betternotificationsforwp.com/downloads/per-post-override/).
assets/js/bnfw.js CHANGED
@@ -383,7 +383,7 @@ jQuery(document).ready(function($) {
383
  subject = '[[global_site_title]] Password Reset';
384
  body = 'Someone has requested a password reset for the following account: <br>' +
385
  'Site Name: [global_site_title] <br>' +
386
- 'Username: [user_login] <br>' +
387
  'If this was a mistake, just ignore this email and nothing will happen. <br>' +
388
  'To reset your password, visit the following address: [password_reset_link]';
389
 
383
  subject = '[[global_site_title]] Password Reset';
384
  body = 'Someone has requested a password reset for the following account: <br>' +
385
  'Site Name: [global_site_title] <br>' +
386
+ 'Username: [email_user_login] <br>' +
387
  'If this was a mistake, just ignore this email and nothing will happen. <br>' +
388
  'To reset your password, visit the following address: [password_reset_link]';
389
 
bnfw.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Better Notifications for WP
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.8.1
7
  * Author: Made with Fuel
8
  * Author URI: https://betternotificationsforwp.com/
9
  * Author Email: hello@betternotificationsforwp.com
@@ -654,7 +654,7 @@ class BNFW {
654
  if ( '' === $user_data ) {
655
  return $this->engine->handle_shortcodes( $setting['subject'], 'user-password', $user_data->ID );
656
  } else {
657
- return $setting['subject'];
658
  }
659
  }
660
 
3
  * Plugin Name: Better Notifications for WP
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.8.2
7
  * Author: Made with Fuel
8
  * Author URI: https://betternotificationsforwp.com/
9
  * Author Email: hello@betternotificationsforwp.com
654
  if ( '' === $user_data ) {
655
  return $this->engine->handle_shortcodes( $setting['subject'], 'user-password', $user_data->ID );
656
  } else {
657
+ return $this->engine->handle_shortcodes( $setting['subject'], 'user-password', $user_data->ID );
658
  }
659
  }
660
 
includes/engine/class-bnfw-engine.php CHANGED
@@ -507,7 +507,6 @@ class BNFW_Engine {
507
  case 'admin-password':
508
  case 'admin-password-changed':
509
  case 'admin-email-changed':
510
- case 'user-password':
511
  case 'admin-user':
512
  case 'welcome-email':
513
  case 'user-login':
@@ -525,6 +524,7 @@ class BNFW_Engine {
525
  break;
526
 
527
  case 'email-changed':
 
528
  // handle users (lost password and new user registration)
529
  $message = $this->user_shortcodes( $message, $extra_data, 'email_' );
530
  break;
@@ -1196,9 +1196,10 @@ class BNFW_Engine {
1196
  $emails_from_user_roles = $this->get_emails_from_role( $user_roles, $exclude );
1197
 
1198
  if ( ! empty( $setting ) ) {
1199
- if ( $this->starts_with( $setting['notification'], 'comment-' ) || $this->starts_with( $setting['notification'], 'moderate-' ) ) {
1200
  // for new comment notifications, we need to use post id instead of comment id.
1201
- $post_id = bnfw_get_post_id_from_comment( $post_id );
 
 
1202
  }
1203
  }
1204
 
507
  case 'admin-password':
508
  case 'admin-password-changed':
509
  case 'admin-email-changed':
 
510
  case 'admin-user':
511
  case 'welcome-email':
512
  case 'user-login':
524
  break;
525
 
526
  case 'email-changed':
527
+ case 'user-password':
528
  // handle users (lost password and new user registration)
529
  $message = $this->user_shortcodes( $message, $extra_data, 'email_' );
530
  break;
1196
  $emails_from_user_roles = $this->get_emails_from_role( $user_roles, $exclude );
1197
 
1198
  if ( ! empty( $setting ) ) {
 
1199
  // for new comment notifications, we need to use post id instead of comment id.
1200
+ if ( bnfw_is_comment_notification( $setting['notification'] ) && $post_id ) {
1201
+ $comment = get_comment( $post_id );
1202
+ $post_id = $comment->comment_post_ID;
1203
  }
1204
  }
1205