Companion Auto Update - Version 3.7.1

Version Description

(October 30, 2020) = * Fix: PHP Warning: strtotime() expects parameter 2 to be integer, string given

Download this release

Release Info

Developer Papin
Plugin Icon 128x128 Companion Auto Update
Version 3.7.1
Comparing to
See all releases

Code changes from version 3.7.0 to 3.7.1

Files changed (3) hide show
  1. cau_functions.php +9 -6
  2. companion-auto-update.php +15 -2
  3. readme.txt +5 -2
cau_functions.php CHANGED
@@ -201,8 +201,9 @@ function cau_run_custom_hooks_p() {
201
  $lastday = date( 'YmdHi', strtotime( '-1 day', time() ) );
202
  }
203
 
204
- $range_start = date( 'Hi', strtotime( '-30 minutes', $updateSched ) );
205
- $range_end = date( 'Hi', strtotime( '+30 minutes', $updateSched ) );
 
206
 
207
  if( $fileDate >= $lastday ) {
208
 
@@ -313,8 +314,9 @@ function cau_run_custom_hooks_c() {
313
  }
314
 
315
  // Check manual or automatic
316
- $range_start = date( 'Hi', strtotime( '-30 minutes', $updateSched ) );
317
- $range_end = date( 'Hi', strtotime( '+30 minutes', $updateSched ) );
 
318
 
319
  if( $fileDate >= $lastday ) {
320
 
@@ -782,8 +784,9 @@ function cau_fetch_log( $limit, $format = 'simple' ) {
782
  $date_tod = date ( 'ydm' );
783
  $fileDay = date ( 'ydm', filemtime( $coreFile ) );
784
  $fileTime = date ( 'Hi', filemtime( $coreFile ) );
785
- $range_start = date( 'Hi', strtotime( '-30 minutes', $updateSched ) );
786
- $range_end = date( 'Hi', strtotime( '+30 minutes', $updateSched ) );
 
787
 
788
  if( $date_tod == $fileDay ) {
789
 
201
  $lastday = date( 'YmdHi', strtotime( '-1 day', time() ) );
202
  }
203
 
204
+ $update_time = wp_next_schedule( 'wp_update_plugins' );
205
+ $range_start = date( 'Hi', strtotime( '-30 minutes', $update_time ) );
206
+ $range_end = date( 'Hi', strtotime( '+30 minutes', $update_time ) );
207
 
208
  if( $fileDate >= $lastday ) {
209
 
314
  }
315
 
316
  // Check manual or automatic
317
+ $update_time = wp_next_schedule( 'wp_version_check' );
318
+ $range_start = date( 'Hi', strtotime( '-30 minutes', $update_time ) );
319
+ $range_end = date( 'Hi', strtotime( '+30 minutes', $update_time ) );
320
 
321
  if( $fileDate >= $lastday ) {
322
 
784
  $date_tod = date ( 'ydm' );
785
  $fileDay = date ( 'ydm', filemtime( $coreFile ) );
786
  $fileTime = date ( 'Hi', filemtime( $coreFile ) );
787
+ $update_time = wp_next_schedule( 'wp_version_check' );
788
+ $range_start = date( 'Hi', strtotime( '-30 minutes', $update_time ) );
789
+ $range_end = date( 'Hi', strtotime( '+30 minutes', $update_time ) );
790
 
791
  if( $date_tod == $fileDay ) {
792
 
companion-auto-update.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Companion Auto Update
4
  * Plugin URI: http://codeermeneer.nl/portfolio/companion-auto-update/
5
  * Description: This plugin auto updates all plugins, all themes and the wordpress core.
6
- * Version: 3.7.0
7
  * Author: Papin Schipper
8
  * Author URI: http://codeermeneer.nl/
9
  * Contributors: papin
@@ -178,12 +178,25 @@ register_activation_hook( __FILE__, 'cau_install' );
178
 
179
  // Clear everything on deactivation
180
  function cau_remove() {
 
 
181
  global $wpdb;
182
  $autoupdates = $wpdb->prefix."auto_updates";
183
  $updateLog = $wpdb->prefix."update_log";
184
  $wpdb->query( "DROP TABLE IF EXISTS $autoupdates" );
185
  $wpdb->query( "DROP TABLE IF EXISTS $updateLog" );
186
- wp_clear_scheduled_hook('cau_set_schedule_mail');
 
 
 
 
 
 
 
 
 
 
 
187
  }
188
  register_deactivation_hook( __FILE__, 'cau_remove' );
189
 
3
  * Plugin Name: Companion Auto Update
4
  * Plugin URI: http://codeermeneer.nl/portfolio/companion-auto-update/
5
  * Description: This plugin auto updates all plugins, all themes and the wordpress core.
6
+ * Version: 3.7.1
7
  * Author: Papin Schipper
8
  * Author URI: http://codeermeneer.nl/
9
  * Contributors: papin
178
 
179
  // Clear everything on deactivation
180
  function cau_remove() {
181
+
182
+ // Delete tables
183
  global $wpdb;
184
  $autoupdates = $wpdb->prefix."auto_updates";
185
  $updateLog = $wpdb->prefix."update_log";
186
  $wpdb->query( "DROP TABLE IF EXISTS $autoupdates" );
187
  $wpdb->query( "DROP TABLE IF EXISTS $updateLog" );
188
+
189
+ // Clear schedules
190
+ wp_clear_scheduled_hook( 'cau_set_schedule_mail' );
191
+ wp_clear_scheduled_hook( 'cau_custom_hooks_plugins' );
192
+ wp_clear_scheduled_hook( 'cau_custom_hooks_themes' );
193
+ wp_clear_scheduled_hook( 'cau_log_updater' );
194
+
195
+ // Restore WordPress default update functionality
196
+ add_filter( 'plugins_auto_update_enabled', '__return_true' );
197
+ add_filter( 'themes_auto_update_enabled', '__return_true' );
198
+ add_filter( 'auto_plugin_update_send_email', '__return_true' );
199
+ add_filter( 'auto_theme_update_send_email', '__return_true' );
200
  }
201
  register_deactivation_hook( __FILE__, 'cau_remove' );
202
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: auto, automatic, background, update, updates, updating, automatic updates,
5
  Requires at least: 3.6.0
6
  Tested up to: 5.5
7
  Requires PHP: 5.1
8
- Stable tag: 3.7.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -20,7 +20,7 @@ We understand that you might not always be able to check if your WordPress site
20
  = Main features =
21
  1. Auto-updating for plugins, themes, core and translation files
22
  1. Filter plugins and themes to not be updated
23
- 1. E-mail notifications about old software, pending updates and completed updates
24
  1. An update log with all updates
25
  1. Option to delay automatic updates with an x number of days
26
 
@@ -81,6 +81,9 @@ So obviously, some of you wondered what the difference would be between the defa
81
 
82
  == Changelog ==
83
 
 
 
 
84
  = 3.7 (September 8, 2020) =
85
  * New: Delay updates with an x number of days
86
  * New: Be notified of plugins that have not been tested with the latest 3 major releases of WordPress.
5
  Requires at least: 3.6.0
6
  Tested up to: 5.5
7
  Requires PHP: 5.1
8
+ Stable tag: 3.7.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
20
  = Main features =
21
  1. Auto-updating for plugins, themes, core and translation files
22
  1. Filter plugins and themes to not be updated
23
+ 1. E-mail notifications about old software, pending updates and complete updates
24
  1. An update log with all updates
25
  1. Option to delay automatic updates with an x number of days
26
 
81
 
82
  == Changelog ==
83
 
84
+ = 3.7.1 (October 30, 2020) =
85
+ * Fix: PHP Warning: strtotime() expects parameter 2 to be integer, string given
86
+
87
  = 3.7 (September 8, 2020) =
88
  * New: Delay updates with an x number of days
89
  * New: Be notified of plugins that have not been tested with the latest 3 major releases of WordPress.