Better Notifications for WordPress - Version 1.3.8

Version Description

  • 16th December 2015 =
  • Fixed: Notifications weren't being sent out at all. After lots of testing, I think this should now be resolved.
  • Fixed: An issue where quotes in the Subject field were causing part of/all the field content to be removed.
  • Improved: If you have more than 100 users on your site, the User Roles / Users select box will show the first 100 users only. You can search through the rest by typing the first character of a username in the select box and it will show you any matching users.
Download this release

Release Info

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

Code changes from version 1.3.7 to 1.3.8

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://betternotificationsforwp.com/donate/
4
  Tags: notifications, email, mail, alerts, roles, user, users, admin, HTML, plain, wp_mail, shortcode, customize, post, page, updated, pending review, scheduled, category, tag, term, custom post type, comment, akismet, trackback, pingback, lost password, welcome, new user, bulk, notice, trigger, CC, BCC, from, author
5
  Requires at least: 3.5
6
  Tested up to: 4.4
7
- Stable tag: 1.3.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -175,6 +175,11 @@ It might do but this is untested.
175
 
176
  == Changelog ==
177
 
 
 
 
 
 
178
  = 1.3.7 - 11th December 2015 =
179
  * Fixed: An issue where EDD_SL_Plugin_Updater class was already declared by another plugin.
180
 
4
  Tags: notifications, email, mail, alerts, roles, user, users, admin, HTML, plain, wp_mail, shortcode, customize, post, page, updated, pending review, scheduled, category, tag, term, custom post type, comment, akismet, trackback, pingback, lost password, welcome, new user, bulk, notice, trigger, CC, BCC, from, author
5
  Requires at least: 3.5
6
  Tested up to: 4.4
7
+ Stable tag: 1.3.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
175
 
176
  == Changelog ==
177
 
178
+ = 1.3.8 - 16th December 2015 =
179
+ * Fixed: Notifications weren't being sent out at all. After lots of testing, I think this should now be resolved.
180
+ * Fixed: An issue where quotes in the Subject field were causing part of/all the field content to be removed.
181
+ * Improved: If you have more than 100 users on your site, the User Roles / Users select box will show the first 100 users only. You can search through the rest by typing the first character of a username in the select box and it will show you any matching users.
182
+
183
  = 1.3.7 - 11th December 2015 =
184
  * Fixed: An issue where EDD_SL_Plugin_Updater class was already declared by another plugin.
185
 
assets/js/bnfw.js CHANGED
@@ -36,7 +36,7 @@ jQuery(document).ready(function($) {
36
  };
37
  }
38
  },
39
- minimumInputLength: 3
40
  } );
41
 
42
  toggle_fields();
36
  };
37
  }
38
  },
39
+ minimumInputLength: 1
40
  } );
41
 
42
  toggle_fields();
bnfw.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Better Notifications for WordPress
4
  * Plugin URI: http://wordpress.org/plugins/bnfw/
5
  * Description: Send customisable emails to your users for different WordPress notifications.
6
- * Version: 1.3.7
7
  * Author: Voltronik
8
  * Author URI: https://betternotificationsforwp.com/
9
  * Author Email: plugins@voltronik.co.uk
3
  * Plugin Name: Better Notifications for WordPress
4
  * Plugin URI: http://wordpress.org/plugins/bnfw/
5
  * Description: Send customisable emails to your users for different WordPress notifications.
6
+ * Version: 1.3.8
7
  * Author: Voltronik
8
  * Author URI: https://betternotificationsforwp.com/
9
  * Author Email: plugins@voltronik.co.uk
includes/admin/class-bnfw-notification.php CHANGED
@@ -344,7 +344,7 @@ class BNFW_Notification {
344
  <?php _e( 'Subject', 'bnfw' ); ?>
345
  </th>
346
  <td>
347
- <input type="text" name="subject" value="<?php echo $setting['subject']; ?>" style="width:75%;">
348
  </td>
349
  </tr>
350
 
@@ -444,7 +444,7 @@ class BNFW_Notification {
444
 
445
  $setting = array(
446
  'notification' => $_POST['notification'],
447
- 'subject' => sanitize_text_field( $_POST['subject'] ),
448
  'message' => $_POST['notification_message'],
449
  'disabled' => isset( $_POST['disabled'] ) ? sanitize_text_field( $_POST['disabled'] ) : 'false',
450
  'email-formatting' => isset( $_POST['email-formatting'] ) ? sanitize_text_field( $_POST['email-formatting'] ) : 'html',
344
  <?php _e( 'Subject', 'bnfw' ); ?>
345
  </th>
346
  <td>
347
+ <input type="text" name="subject" value="<?php echo esc_attr( $setting['subject'] ); ?>" style="width:75%;">
348
  </td>
349
  </tr>
350
 
444
 
445
  $setting = array(
446
  'notification' => $_POST['notification'],
447
+ 'subject' => $_POST['subject'],
448
  'message' => $_POST['notification_message'],
449
  'disabled' => isset( $_POST['disabled'] ) ? sanitize_text_field( $_POST['disabled'] ) : 'false',
450
  'email-formatting' => isset( $_POST['email-formatting'] ) ? sanitize_text_field( $_POST['email-formatting'] ) : 'html',
includes/engine/class-bnfw-engine.php CHANGED
@@ -44,9 +44,9 @@ class BNFW_Engine {
44
  *
45
  * @since 1.3.6
46
  */
47
- $notification_enabled = apply_filters( 'bnfw_notification_enabled', true, $id, $notification_details );
48
 
49
- if ( 'false' != $notification_enabled ) {
50
  $subject = $this->handle_shortcodes( $setting['subject'], $setting['notification'], $id );
51
  $message = $this->handle_shortcodes( $setting['message'], $setting['notification'], $id );
52
  $emails = $this->get_emails( $setting, $id );
44
  *
45
  * @since 1.3.6
46
  */
47
+ $notification_enabled = apply_filters( 'bnfw_notification_enabled', true, $id, $setting );
48
 
49
+ if ( $notification_enabled ) {
50
  $subject = $this->handle_shortcodes( $setting['subject'], $setting['notification'], $id );
51
  $message = $this->handle_shortcodes( $setting['message'], $setting['notification'], $id );
52
  $emails = $this->get_emails( $setting, $id );
includes/helpers/ajax-helpers.php CHANGED
@@ -13,6 +13,23 @@
13
  function bnfw_search_users() {
14
  global $wp_roles;
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  $query = sanitize_text_field( $_GET['query'] );
17
  $users = get_users( array(
18
  'order_by' => 'email',
@@ -29,27 +46,10 @@ function bnfw_search_users() {
29
  );
30
  }
31
 
32
- $data = array(
33
- array(
34
- 'id' => 1,
35
- 'text' => __( 'Users', 'bnfw' ),
36
- 'children' => $user_data,
37
- ),
38
- );
39
-
40
- $roles_data = array();
41
- $roles = $wp_roles->get_names();
42
- foreach ( $roles as $role ) {
43
- $roles_data[] = array(
44
- 'id' => 'role-' . $role,
45
- 'text' => $role,
46
- );
47
- }
48
-
49
  $data[] = array(
50
  'id' => 2,
51
- 'text' => __( 'User Roles', 'bnfw' ),
52
- 'children' => $roles_data,
53
  );
54
 
55
  echo json_encode( $data );
13
  function bnfw_search_users() {
14
  global $wp_roles;
15
 
16
+ $roles_data = array();
17
+ $roles = $wp_roles->get_names();
18
+ foreach ( $roles as $role ) {
19
+ $roles_data[] = array(
20
+ 'id' => 'role-' . $role,
21
+ 'text' => $role,
22
+ );
23
+ }
24
+
25
+ $data = array(
26
+ array(
27
+ 'id' => 1,
28
+ 'text' => __( 'User Roles', 'bnfw' ),
29
+ 'children' => $roles_data,
30
+ ),
31
+ );
32
+
33
  $query = sanitize_text_field( $_GET['query'] );
34
  $users = get_users( array(
35
  'order_by' => 'email',
46
  );
47
  }
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  $data[] = array(
50
  'id' => 2,
51
+ 'text' => __( 'Users', 'bnfw' ),
52
+ 'children' => $user_data,
53
  );
54
 
55
  echo json_encode( $data );