WP Updates Notifier - Version 1.2

Version Description

  • Added the ability to allow multiple email address to be added to the notify to setting. Multiple email addresses to be comma separated.
  • Removed code from last version that was left in from dev. Caused WP to check for update on every admin page load.
Download this release

Release Info

Developer l3rady
Plugin Icon wp plugin WP Updates Notifier
Version 1.2
Comparing to
See all releases

Code changes from version 1.1 to 1.2

Files changed (2) hide show
  1. readme.txt +7 -2
  2. wp-updates-notifier.php +22 -10
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://l3rady.com/donate
4
  Tags: admin, theme, monitor, plugin, notification, upgrade, security
5
  Requires at least: 3.1
6
  Tested up to: 3.2.1
7
- Stable tag: 1.1
8
 
9
  Sends email to notify you if there are any updates for your WordPress site. Can notify about core, plugin and theme updates.
10
 
@@ -28,6 +28,7 @@ This plugin is a fork of [Update Notifier](http://wordpress.org/extend/plugins/u
28
  - You can set the cron interval, allowing for more frequent checks.
29
  - Update checks trigger WordPress internal update check before notification.
30
  - Allows you to set the 'from address'.
 
31
  - Makes use of the Settings API.
32
  - A number of available hooks and filters for advanced users.
33
  - Active support and development.
@@ -47,8 +48,12 @@ This plugin is a fork of [Update Notifier](http://wordpress.org/extend/plugins/u
47
 
48
  == Changelog ==
49
 
 
 
 
 
50
  = 1.1 =
51
- * Plugin update notification email now includes links to new theme/plugin description and changelog page.
52
  * Plugin update notification email now shows compatibility of a new plugin. This is same functionality that appears in the WP update area.
53
  * On plugin activation the first update check is scheduled to run an hour after rather than straight away. This stops current awaiting updates being sent to admin email before you've had chance to change the email settings.
54
 
4
  Tags: admin, theme, monitor, plugin, notification, upgrade, security
5
  Requires at least: 3.1
6
  Tested up to: 3.2.1
7
+ Stable tag: 1.2
8
 
9
  Sends email to notify you if there are any updates for your WordPress site. Can notify about core, plugin and theme updates.
10
 
28
  - You can set the cron interval, allowing for more frequent checks.
29
  - Update checks trigger WordPress internal update check before notification.
30
  - Allows you to set the 'from address'.
31
+ - Allows you to set multiple 'to addresses'.
32
  - Makes use of the Settings API.
33
  - A number of available hooks and filters for advanced users.
34
  - Active support and development.
48
 
49
  == Changelog ==
50
 
51
+ = 1.2 =
52
+ * Added the ability to allow multiple email address to be added to the `notify to` setting. Multiple email addresses to be comma separated.
53
+ * Removed code from last version that was left in from dev. Caused WP to check for update on every admin page load.
54
+
55
  = 1.1 =
56
+ * Plugin update notification email now includes links to new plugin description and changelog page.
57
  * Plugin update notification email now shows compatibility of a new plugin. This is same functionality that appears in the WP update area.
58
  * On plugin activation the first update check is scheduled to run an hour after rather than straight away. This stops current awaiting updates being sent to admin email before you've had chance to change the email settings.
59
 
wp-updates-notifier.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Updates Notifier
4
  Plugin URI: http://l3rady.com/projects/wp-updates-notifier/
5
  Description: Sends email to notify you if there are any updates for your WordPress site. Can notify about core, plugin and theme updates.
6
  Author: Scott Cariss
7
- Version: 1.1
8
  Author URI: http://l3rady.com/
9
  Text Domain: wp-updates-notifier
10
  Domain Path: /languages
@@ -417,7 +417,6 @@ if (!class_exists('sc_WPUpdatesNotifier')) {
417
  add_settings_field("sc_wpun_settings_main_notify_plugins", __("Notify about plugin updates?", "wp-updates-notifier"), array(&$this, "sc_wpun_settings_main_field_notify_plugins"), "wp-updates-notifier", "sc_wpun_settings_main");
418
  add_settings_field("sc_wpun_settings_main_notify_themes", __("Notify about theme updates?", "wp-updates-notifier"), array(&$this, "sc_wpun_settings_main_field_notify_themes"), "wp-updates-notifier", "sc_wpun_settings_main");
419
  add_settings_field("sc_wpun_settings_main_hide_updates", __("Hide core WP update nag from non-admin users?", "wp-updates-notifier"), array(&$this, "sc_wpun_settings_main_field_hide_updates"), "wp-updates-notifier", "sc_wpun_settings_main");
420
- $this->plugins_update_check($message, 1);
421
  }
422
  public function sc_wpun_settings_validate($input) {
423
  $valid = get_option(self::$options_field);
@@ -428,13 +427,26 @@ if (!class_exists('sc_WPUpdatesNotifier')) {
428
  } else {
429
  add_settings_error("sc_wpun_settings_main_frequency", "sc_wpun_settings_main_frequency_error", __("Invalid frequency entered", "wp-updates-notifier"), "error");
430
  }
431
-
432
- $sanitized_email_to = sanitize_email($input['notify_to']);
433
- if(is_email($sanitized_email_to)) {
434
- $valid['notify_to'] = $sanitized_email_to;
435
- } else {
436
- add_settings_error("sc_wpun_settings_main_notify_to", "sc_wpun_settings_main_notify_to_error", __("Invalid email to entered", "wp-updates-notifier"), "error");
437
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
438
 
439
  $sanitized_email_from = sanitize_email($input['notify_from']);
440
  if(is_email($sanitized_email_from)) {
@@ -478,7 +490,7 @@ if (!class_exists('sc_WPUpdatesNotifier')) {
478
  }
479
  public function sc_wpun_settings_main_field_notify_to() {
480
  $options = get_option(self::$options_field);
481
- ?><input id="sc_wpun_settings_main_notify_to" class="regular-text" name="<?php echo self::$options_field; ?>[notify_to]" value="<?php echo $options['notify_to']; ?>" /><?php
482
  }
483
  public function sc_wpun_settings_main_field_notify_from() {
484
  $options = get_option(self::$options_field);
4
  Plugin URI: http://l3rady.com/projects/wp-updates-notifier/
5
  Description: Sends email to notify you if there are any updates for your WordPress site. Can notify about core, plugin and theme updates.
6
  Author: Scott Cariss
7
+ Version: 1.2
8
  Author URI: http://l3rady.com/
9
  Text Domain: wp-updates-notifier
10
  Domain Path: /languages
417
  add_settings_field("sc_wpun_settings_main_notify_plugins", __("Notify about plugin updates?", "wp-updates-notifier"), array(&$this, "sc_wpun_settings_main_field_notify_plugins"), "wp-updates-notifier", "sc_wpun_settings_main");
418
  add_settings_field("sc_wpun_settings_main_notify_themes", __("Notify about theme updates?", "wp-updates-notifier"), array(&$this, "sc_wpun_settings_main_field_notify_themes"), "wp-updates-notifier", "sc_wpun_settings_main");
419
  add_settings_field("sc_wpun_settings_main_hide_updates", __("Hide core WP update nag from non-admin users?", "wp-updates-notifier"), array(&$this, "sc_wpun_settings_main_field_hide_updates"), "wp-updates-notifier", "sc_wpun_settings_main");
 
420
  }
421
  public function sc_wpun_settings_validate($input) {
422
  $valid = get_option(self::$options_field);
427
  } else {
428
  add_settings_error("sc_wpun_settings_main_frequency", "sc_wpun_settings_main_frequency_error", __("Invalid frequency entered", "wp-updates-notifier"), "error");
429
  }
430
+
431
+ $emails_to = explode(",", $input['notify_to']);
432
+ if($emails_to) {
433
+ $sanitized_emails = array();
434
+ $was_error = false;
435
+ foreach($emails_to as $email_to) {
436
+ $address = sanitize_email(trim($email_to));
437
+ if(!is_email($address)) {
438
+ add_settings_error("sc_wpun_settings_main_notify_to", "sc_wpun_settings_main_notify_to_error", __("One or more email to addresses are invalid", "wp-updates-notifier"), "error");
439
+ $was_error = true;
440
+ break;
441
+ }
442
+ $sanitized_emails[] = $address;
443
+ }
444
+ if(!$was_error) {
445
+ $valid['notify_to'] = implode(',', $sanitized_emails);
446
+ }
447
+ } else {
448
+ add_settings_error("sc_wpun_settings_main_notify_to", "sc_wpun_settings_main_notify_to_error", __("No email to address entered", "wp-updates-notifier"), "error");
449
+ }
450
 
451
  $sanitized_email_from = sanitize_email($input['notify_from']);
452
  if(is_email($sanitized_email_from)) {
490
  }
491
  public function sc_wpun_settings_main_field_notify_to() {
492
  $options = get_option(self::$options_field);
493
+ ?><input id="sc_wpun_settings_main_notify_to" class="regular-text" name="<?php echo self::$options_field; ?>[notify_to]" value="<?php echo $options['notify_to']; ?>" /> <span class="description"><?php _e("Separate multiple email address with a comma (,)", "wp-updates-notifier"); ?></span><?php
494
  }
495
  public function sc_wpun_settings_main_field_notify_from() {
496
  $options = get_option(self::$options_field);