diff --git a/readme.txt b/readme.txt index a490302..4bbbeb5 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: http://l3rady.com/donate Tags: admin, theme, monitor, plugin, notification, upgrade, security Requires at least: 3.1 Tested up to: 3.8.1 -Stable tag: 1.4.1 +Stable tag: 1.4.2 Sends email to notify you if there are any updates for your WordPress site. Can notify about core, plugin and theme updates. @@ -53,8 +53,9 @@ This plugin is a fork of [Update Notifier](http://wordpress.org/extend/plugins/u == Changelog == -= 1.4.1 = += 1.4.2 = * Switch from using site_url() to home_url() in email subject line so not to link to a 404 page. +* Add new setting to deal with resending update notifications. = 1.4 = * Added external cron method allowing users check for updates as often or as little as they want diff --git a/wp-updates-notifier.php b/wp-updates-notifier.php index fa3cdc0..8843e49 100755 --- a/wp-updates-notifier.php +++ b/wp-updates-notifier.php @@ -4,7 +4,7 @@ Plugin URI: https://github.com/l3rady/wp-updates-notifier Description: Sends email to notify you if there are any updates for your WordPress site. Can notify about core, plugin and theme updates. Author: Scott Cariss -Version: 1.4.1 +Version: 1.4.2 Author URI: http://l3rady.com/ Text Domain: wp-updates-notifier Domain Path: /languages @@ -34,7 +34,7 @@ class sc_WPUpdatesNotifier { const OPT_FIELD = "sc_wpun_settings"; const OPT_VERSION_FIELD = "sc_wpun_settings_ver"; - const OPT_VERSION = "5.0"; + const OPT_VERSION = "6.0"; const CRON_NAME = "sc_wpun_update_check"; public static function init() { @@ -76,6 +76,7 @@ private function settingsUpToDate() { $defaults = array( // Here are our default values for this plugin 'cron_method' => 'wordpress', // Cron method to be used for scheduling scans 'frequency' => 'hourly', + 'resend' => 0, 'notify_to' => get_option( 'admin_email' ), 'notify_from' => get_option( 'admin_email' ), 'notify_plugins' => 1, @@ -562,6 +563,7 @@ public function admin_settings_init() { add_settings_section( "sc_wpun_settings_main", __( "Settings", "wp-updates-notifier" ), array( __CLASS__, "sc_wpun_settings_main_text" ), "wp-updates-notifier" ); // Make settings main section add_settings_field( "sc_wpun_settings_main_cron_method", __( "Cron Method", "wp-updates-notifier" ), array( __CLASS__, "sc_wpun_settings_main_field_cron_method" ), "wp-updates-notifier", "sc_wpun_settings_main" ); add_settings_field( "sc_wpun_settings_main_frequency", __( "Frequency to check", "wp-updates-notifier" ), array( __CLASS__, "sc_wpun_settings_main_field_frequency" ), "wp-updates-notifier", "sc_wpun_settings_main" ); + add_settings_field( "sc_wpun_settings_main_resend", __( "Resend notifications", "wp-updates-notifier" ), array( __CLASS__, "sc_wpun_settings_main_field_resend" ), "wp-updates-notifier", "sc_wpun_settings_main" ); add_settings_field( "sc_wpun_settings_main_notify_to", __( "Notify email to", "wp-updates-notifier" ), array( __CLASS__, "sc_wpun_settings_main_field_notify_to" ), "wp-updates-notifier", "sc_wpun_settings_main" ); add_settings_field( "sc_wpun_settings_main_notify_from", __( "Notify email from", "wp-updates-notifier" ), array( __CLASS__, "sc_wpun_settings_main_field_notify_from" ), "wp-updates-notifier", "sc_wpun_settings_main" ); add_settings_field( "sc_wpun_settings_main_notify_plugins", __( "Notify about plugin updates?", "wp-updates-notifier" ), array( __CLASS__, "sc_wpun_settings_main_field_notify_plugins" ), "wp-updates-notifier", "sc_wpun_settings_main" ); @@ -591,6 +593,14 @@ public function sc_wpun_settings_validate( $input ) { add_settings_error( "sc_wpun_settings_main_frequency", "sc_wpun_settings_main_frequency_error", __( "Invalid frequency entered", "wp-updates-notifier" ), "error" ); } + $sanitized_resend = absint( isset( $input['resend'] ) ? $input['resend'] : 0 ); + if ( $sanitized_resend >= 0 && $sanitized_resend <= 2 ) { + $valid['resend'] = $sanitized_resend; + } + else { + add_settings_error( "sc_wpun_settings_main_resend", "sc_wpun_settings_main_resend_error", __( "Invalid resend notifications value entered", "wp-updates-notifier" ), "error" ); + } + $emails_to = explode( ",", $input['notify_to'] ); if ( $emails_to ) { $sanitized_emails = array(); @@ -679,10 +689,22 @@ public function sc_wpun_settings_main_field_frequency() { $options = self::getSetOptions( self::OPT_FIELD ); ?> + $v ): ?> + + + + +
+
+