Advanced Automatic Updates - Version 0.8.5

Version Description

  • FIXED: Disable email notifications option was being set, but not showing up as set
  • FIXED: Only write to the options table when options have actually change
  • FIXED: Funky email layout if svn up'ing multiple things in one go
  • FIXED: Possible PHP error caused by including some core class definitions multiple times
Download this release

Release Info

Developer pento
Plugin Icon wp plugin Advanced Automatic Updates
Version 0.8.5
Comparing to
See all releases

Code changes from version 0.8.4 to 0.8.5

Files changed (4) hide show
  1. admin.php +1 -1
  2. automatic-updater.php +21 -6
  3. readme.txt +7 -1
  4. updater-skin.php +1 -1
admin.php CHANGED
@@ -105,7 +105,7 @@ class Automatic_Updater_Admin {
105
  ?>
106
 
107
  <p><?php esc_html_e( "If you don't want to receive an email when updates are installed, you can disable them completely.", 'automatic-updater' ); ?></p>
108
- <p><input type="checkbox" name="disable-email" id="disable-email" value="1"> <label for="disable-email"><?php esc_html_e( 'Disable email notifications.', 'automatic-updater' ); ?></label></p>
109
 
110
  <br>
111
  <h3><?php esc_html_e( 'Retries', 'automatic-updater' ); ?></h3>
105
  ?>
106
 
107
  <p><?php esc_html_e( "If you don't want to receive an email when updates are installed, you can disable them completely.", 'automatic-updater' ); ?></p>
108
+ <p><input type="checkbox" name="disable-email" id="disable-email" value="1"<?php echo $checked; ?>> <label for="disable-email"><?php esc_html_e( 'Disable email notifications.', 'automatic-updater' ); ?></label></p>
109
 
110
  <br>
111
  <h3><?php esc_html_e( 'Retries', 'automatic-updater' ); ?></h3>
automatic-updater.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://pento.net/projects/automatic-updater-for-wordpress/
5
  * Description: Automatically update your WordPress site, as soon as updates are released! Never worry about falling behing on updating again!
6
  * Author: pento
7
- * Version: 0.8.4
8
  * Author URI: http://pento.net/
9
  * License: GPL2+
10
  * Text Domain: automatic-updater
@@ -25,6 +25,7 @@ Automatic_Updater::$basename = plugin_basename( $automatic_updater_file );
25
  class Automatic_Updater {
26
  private $running = false;
27
  private $options = array();
 
28
 
29
  public static $basename;
30
 
@@ -43,6 +44,7 @@ class Automatic_Updater {
43
 
44
  // Load the options, and check that they're all up to date.
45
  $this->options = get_option( 'automatic-updater', array() );
 
46
  $this->plugin_upgrade();
47
 
48
  add_action( 'shutdown', array( &$this, 'shutdown' ) );
@@ -102,6 +104,10 @@ class Automatic_Updater {
102
  }
103
 
104
  function shutdown() {
 
 
 
 
105
  update_option( 'automatic-updater', $this->options );
106
  }
107
 
@@ -495,13 +501,16 @@ class Automatic_Updater {
495
  }
496
 
497
  function update_svn() {
498
- $output = array();
499
- $return = null;
 
 
500
 
501
- $message = '';
 
502
 
503
- $found_error = false;
504
- $found_update = false;
505
 
506
  $source_control = $this->under_source_control();
507
 
@@ -513,6 +522,7 @@ class Automatic_Updater {
513
 
514
  if ( 0 !== strpos( $update, "At revision" ) ) {
515
  $found_update = true;
 
516
 
517
  if ( 0 === $return ) {
518
  $message .= esc_html__( 'We successfully upgraded WordPress Core from SVN!', 'automatic-updater' );
@@ -555,6 +565,7 @@ class Automatic_Updater {
555
  if ( 0 !== strpos( $update, "At revision" ) ) {
556
  $plugin_upgrades++;
557
  $found_update = true;
 
558
 
559
  if ( 0 !== $return )
560
  $found_error = true;
@@ -564,6 +575,8 @@ class Automatic_Updater {
564
  }
565
 
566
  if ( ! empty( $plugin_message ) ) {
 
 
567
  $message .= esc_html( _n( 'We upgraded the following plugin:', 'We upgraded the following plugins:', $plugin_upgrades, 'automatic-updater' ) );
568
  $message .= "<br><br>$plugin_message";
569
  }
@@ -603,6 +616,8 @@ class Automatic_Updater {
603
  }
604
 
605
  if ( ! empty( $theme_message ) ) {
 
 
606
  $message .= esc_html( _n( 'We upgraded the following theme:', 'We upgraded the following themes:', $theme_upgrades, 'automatic-updater' ) );
607
  $message .= "<br><br>$theme_message";
608
  }
4
  * Plugin URI: http://pento.net/projects/automatic-updater-for-wordpress/
5
  * Description: Automatically update your WordPress site, as soon as updates are released! Never worry about falling behing on updating again!
6
  * Author: pento
7
+ * Version: 0.8.5
8
  * Author URI: http://pento.net/
9
  * License: GPL2+
10
  * Text Domain: automatic-updater
25
  class Automatic_Updater {
26
  private $running = false;
27
  private $options = array();
28
+ private $options_serialized = '';
29
 
30
  public static $basename;
31
 
44
 
45
  // Load the options, and check that they're all up to date.
46
  $this->options = get_option( 'automatic-updater', array() );
47
+ $this->options_serialized = serialize( $this->options );
48
  $this->plugin_upgrade();
49
 
50
  add_action( 'shutdown', array( &$this, 'shutdown' ) );
104
  }
105
 
106
  function shutdown() {
107
+ // No need to write to the DB if the options haven't changed
108
+ if ( serialize( $this->options ) === $this->options_serialized )
109
+ return;
110
+
111
  update_option( 'automatic-updater', $this->options );
112
  }
113
 
501
  }
502
 
503
  function update_svn() {
504
+ $output = array();
505
+ $return = null;
506
+
507
+ $message = '';
508
 
509
+ $found_error = false;
510
+ $found_update = false;
511
 
512
+ $found_core_update = false;
513
+ $found_plugin_update = false;
514
 
515
  $source_control = $this->under_source_control();
516
 
522
 
523
  if ( 0 !== strpos( $update, "At revision" ) ) {
524
  $found_update = true;
525
+ $found_core_update = true;
526
 
527
  if ( 0 === $return ) {
528
  $message .= esc_html__( 'We successfully upgraded WordPress Core from SVN!', 'automatic-updater' );
565
  if ( 0 !== strpos( $update, "At revision" ) ) {
566
  $plugin_upgrades++;
567
  $found_update = true;
568
+ $found_plugin_update = true;
569
 
570
  if ( 0 !== $return )
571
  $found_error = true;
575
  }
576
 
577
  if ( ! empty( $plugin_message ) ) {
578
+ if ( $found_core_update )
579
+ $message .= '<br><br>';
580
  $message .= esc_html( _n( 'We upgraded the following plugin:', 'We upgraded the following plugins:', $plugin_upgrades, 'automatic-updater' ) );
581
  $message .= "<br><br>$plugin_message";
582
  }
616
  }
617
 
618
  if ( ! empty( $theme_message ) ) {
619
+ if ( $found_core_update || $found_plugin_update )
620
+ $message .= '<br><br>';
621
  $message .= esc_html( _n( 'We upgraded the following theme:', 'We upgraded the following themes:', $theme_upgrades, 'automatic-updater' ) );
622
  $message .= "<br><br>$theme_message";
623
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://pento.net/donate/
4
  Tags: updates, core, plugins, themes, stable, nightly, svn, wordpress automatic upgrader
5
  Requires at least: 3.4
6
  Tested up to: 3.5
7
- Stable tag: 0.8.3
8
  License: GPL2+
9
 
10
  Automatically update WordPress, your themes and plugins! Never have to click the update button again!
@@ -43,6 +43,12 @@ There are some Actions and Filters provided, check the [Documentation](http://pe
43
 
44
  == Changelog ==
45
 
 
 
 
 
 
 
46
  = 0.8.4 =
47
  * ADDED: A link to the SVN log browser for Core, when it updates
48
  * ADDED: Japanese (日本語) (ja) translation. Props [Tai](http://tekapo.com/)
4
  Tags: updates, core, plugins, themes, stable, nightly, svn, wordpress automatic upgrader
5
  Requires at least: 3.4
6
  Tested up to: 3.5
7
+ Stable tag: 0.8.4
8
  License: GPL2+
9
 
10
  Automatically update WordPress, your themes and plugins! Never have to click the update button again!
43
 
44
  == Changelog ==
45
 
46
+ = 0.8.5 =
47
+ * FIXED: Disable email notifications option was being set, but not showing up as set
48
+ * FIXED: Only write to the options table when options have actually change
49
+ * FIXED: Funky email layout if svn up'ing multiple things in one go
50
+ * FIXED: Possible PHP error caused by including some core class definitions multiple times
51
+
52
  = 0.8.4 =
53
  * ADDED: A link to the SVN log browser for Core, when it updates
54
  * ADDED: Japanese (日本語) (ja) translation. Props [Tai](http://tekapo.com/)
updater-skin.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
4
 
5
  class Auto_Updater_Skin extends WP_Upgrader_Skin {
6
  var $messages = array();
1
  <?php
2
 
3
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
4
 
5
  class Auto_Updater_Skin extends WP_Upgrader_Skin {
6
  var $messages = array();