Companion Auto Update - Version 3.3.5

Version Description

(January 5, 2019) = * New: See WordPress & PHP version on the status page * New: WordPress core updates now show in status log * Improvement: Split Update log and Status tab * Improvement: Update log now shows new version (no old version yet, sorry) * Improvement: If major updates are disabled the update nag will no longer show * Fix: Error Notice: Undefined index: menloc

Download this release

Release Info

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

Code changes from version 3.3.4 to 3.3.5

admin/dashboard.php CHANGED
@@ -25,7 +25,6 @@
25
  $send = $_POST['cau_send'];
26
  $sendupdate = $_POST['cau_send_update'];
27
  $wpemails = $_POST['wpemails'];
28
- $menloc = $_POST['menloc'];
29
 
30
  $email = sanitize_text_field( $_POST['cau_email'] );
31
 
@@ -38,7 +37,6 @@
38
  $wpdb->query( " UPDATE $table_name SET onoroff = '$send' WHERE name = 'send' " );
39
  $wpdb->query( " UPDATE $table_name SET onoroff = '$sendupdate' WHERE name = 'sendupdate' " );
40
  $wpdb->query( " UPDATE $table_name SET onoroff = '$wpemails' WHERE name = 'wpemails' " );
41
- $wpdb->query( " UPDATE $table_name SET onoroff = '$menloc' WHERE name = 'menloc' " );
42
 
43
  echo '<div id="message" class="updated"><p><b>'.__( 'Settings saved.' ).'</b></p></div>';
44
 
25
  $send = $_POST['cau_send'];
26
  $sendupdate = $_POST['cau_send_update'];
27
  $wpemails = $_POST['wpemails'];
 
28
 
29
  $email = sanitize_text_field( $_POST['cau_email'] );
30
 
37
  $wpdb->query( " UPDATE $table_name SET onoroff = '$send' WHERE name = 'send' " );
38
  $wpdb->query( " UPDATE $table_name SET onoroff = '$sendupdate' WHERE name = 'sendupdate' " );
39
  $wpdb->query( " UPDATE $table_name SET onoroff = '$wpemails' WHERE name = 'wpemails' " );
 
40
 
41
  echo '<div id="message" class="updated"><p><b>'.__( 'Settings saved.' ).'</b></p></div>';
42
 
admin/status.php CHANGED
@@ -307,4 +307,25 @@ if( cau_incompatiblePlugins() ) { ?>
307
 
308
  <?php } ?>
309
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  </div>
307
 
308
  <?php } ?>
309
 
310
+ <table class="cau_status_list widefat striped cau_status_warnings">
311
+
312
+ <thead>
313
+ <tr>
314
+ <th colspan="2"><strong><?php _e( 'Systemifo', 'companion-auto-update' ); ?></strong></th>
315
+ </tr>
316
+ </thead>
317
+
318
+ <tbody id="the-list">
319
+ <tr>
320
+ <td width="200">WordPress</td>
321
+ <td><?php echo get_bloginfo( 'version' ); ?></td>
322
+ </tr>
323
+ <tr>
324
+ <td>PHP</td>
325
+ <td><?php echo phpversion(); ?></td>
326
+ </tr>
327
+ </tbody>
328
+
329
+ </table>
330
+
331
  </div>
admin/support.php CHANGED
@@ -5,7 +5,7 @@
5
  <ul>
6
  <li><a href="https://codeermeneer.nl/stuffs/faq-auto-updater/" target="_blank"><?php _e( 'Frequently Asked Questions', 'companion-auto-update' ); ?></a></li>
7
  <li><a href="https://wordpress.org/support/plugin/companion-auto-update" target="_blank"><?php _e( 'Support Forums' ); ?></a></li>
8
- <li><a href="<?php echo admin_url( cau_menloc().'?page=cau-settings&tab=status&cau_page=system' ); ?>"><?php _e( 'Systeminfo', 'companion-auto-update' ); ?> &raquo; <?php _e( 'Status', 'companion-auto-update' ); ?></a></li>
9
  </ul>
10
  </div><div class="welcome-column welcome-column welcome-column-third">
11
  <h3><?php _e( 'Want to contribute?', 'companion-auto-update' ); ?></h3>
5
  <ul>
6
  <li><a href="https://codeermeneer.nl/stuffs/faq-auto-updater/" target="_blank"><?php _e( 'Frequently Asked Questions', 'companion-auto-update' ); ?></a></li>
7
  <li><a href="https://wordpress.org/support/plugin/companion-auto-update" target="_blank"><?php _e( 'Support Forums' ); ?></a></li>
8
+ <li><a href="<?php echo admin_url( cau_menloc().'?page=cau-settings&tab=status&cau_page=status' ); ?>"><?php _e( 'Systeminfo', 'companion-auto-update' ); ?> &raquo; <?php _e( 'Status', 'companion-auto-update' ); ?></a></li>
9
  </ul>
10
  </div><div class="welcome-column welcome-column welcome-column-third">
11
  <h3><?php _e( 'Want to contribute?', 'companion-auto-update' ); ?></h3>
cau_functions.php CHANGED
@@ -256,6 +256,7 @@ function cau_fetch_log( $limit, $format = 'simple' ) {
256
 
257
  // Create arrays
258
  $pluginNames = array();
 
259
  $pluginDates = array();
260
  $pluginDatesF = array();
261
  $type = array();
@@ -264,6 +265,9 @@ function cau_fetch_log( $limit, $format = 'simple' ) {
264
  $plugdir = plugin_dir_path( __DIR__ );
265
  $allPlugins = get_plugins();
266
 
 
 
 
267
  // Loop trough all plugins
268
  foreach ( $allPlugins as $key => $value) {
269
 
@@ -277,10 +281,12 @@ function cau_fetch_log( $limit, $format = 'simple' ) {
277
  if( $dataKey == 'Name') {
278
  array_push( $pluginNames , $dataValue );
279
  }
 
 
 
280
  }
281
 
282
  // Get last update date
283
- $dateFormat = get_option( 'date_format' );
284
  $fileDate = date ( 'YmdHi', filemtime( $fullPath ) );
285
  if( $format == 'table' ) {
286
  $fileDateF = date_i18n ( $dateFormat, filemtime( $fullPath ) );
@@ -306,15 +312,14 @@ function cau_fetch_log( $limit, $format = 'simple' ) {
306
  $getFile = $path_parts = pathinfo( $fullPath );
307
 
308
  // Get theme name
309
- // array_push( $pluginNames , $path_parts['filename'] );
310
-
311
- $theme_data = wp_get_theme( $path_parts['filename'] );
312
- $themeName = $theme_data->get( 'Name' );
313
- array_push( $pluginNames , $themeName );
314
 
315
 
316
  // Get last update date
317
- $dateFormat = get_option( 'date_format' );
318
  $fileDate = date ( 'YmdHi', filemtime( $fullPath ) );
319
 
320
  if( $format == 'table' ) {
@@ -330,6 +335,24 @@ function cau_fetch_log( $limit, $format = 'simple' ) {
330
 
331
  }
332
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  // Sort array by date
334
  arsort( $pluginDates );
335
 
@@ -354,6 +377,7 @@ function cau_fetch_log( $limit, $format = 'simple' ) {
354
  <tr>
355
  <th><strong>'.__( 'Name', 'companion-auto-update' ).'</strong></th>
356
  <th><strong>'.__( 'Type', 'companion-auto-update' ).'</strong></th>
 
357
  <th><strong>'.__( 'Last updated on', 'companion-auto-update' ).'</strong></th>
358
  </tr>
359
  </thead>';
@@ -387,9 +411,12 @@ function cau_fetch_log( $limit, $format = 'simple' ) {
387
  $thisType = __( 'Plugin', 'companion-auto-update' );
388
  } else if( $type[$key] == 'Theme' ) {
389
  $thisType = __( 'Theme', 'companion-auto-update' );
 
 
390
  }
391
 
392
  echo '<td class="cau_hide_on_mobile column-description"><p>'. $thisType .'</p></td>';
 
393
 
394
  }
395
 
@@ -461,4 +488,19 @@ function cau_active_plugin_info( $slug, $what ) {
461
 
462
  }
463
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
  ?>
256
 
257
  // Create arrays
258
  $pluginNames = array();
259
+ $pluginVersion = array();
260
  $pluginDates = array();
261
  $pluginDatesF = array();
262
  $type = array();
265
  $plugdir = plugin_dir_path( __DIR__ );
266
  $allPlugins = get_plugins();
267
 
268
+ // Date format
269
+ $dateFormat = get_option( 'date_format' );
270
+
271
  // Loop trough all plugins
272
  foreach ( $allPlugins as $key => $value) {
273
 
281
  if( $dataKey == 'Name') {
282
  array_push( $pluginNames , $dataValue );
283
  }
284
+ if( $dataKey == 'Version') {
285
+ array_push( $pluginVersion , $dataValue );
286
+ }
287
  }
288
 
289
  // Get last update date
 
290
  $fileDate = date ( 'YmdHi', filemtime( $fullPath ) );
291
  if( $format == 'table' ) {
292
  $fileDateF = date_i18n ( $dateFormat, filemtime( $fullPath ) );
312
  $getFile = $path_parts = pathinfo( $fullPath );
313
 
314
  // Get theme name
315
+ $theme_data = wp_get_theme( $path_parts['filename'] );
316
+ $themeName = $theme_data->get( 'Name' );
317
+ $themeVersion = $theme_data->get( 'Version' );
318
+ array_push( $pluginNames , $themeName );
319
+ array_push( $pluginVersion , $themeVersion );
320
 
321
 
322
  // Get last update date
 
323
  $fileDate = date ( 'YmdHi', filemtime( $fullPath ) );
324
 
325
  if( $format == 'table' ) {
335
 
336
  }
337
 
338
+ // Core
339
+ // There is no way (at this time) to check if someone changed this link, so therefore it won't work when it's changed, sorry
340
+ $coreFile = get_home_path().'wp-admin/about.php';
341
+ if( file_exists( $coreFile ) ) {
342
+ $coreDate = date ( 'YmdHi', filemtime( $coreFile ) );
343
+ $coreDateF = date_i18n ( $dateFormat, filemtime( $coreFile ) );
344
+ $coreDateF .= ' &dash; '.date ( 'H:i', filemtime( $coreFile ) );
345
+ } else {
346
+ $coreDate = date('YmdHi');
347
+ $coreDateF = 'Could not read core date.';
348
+ }
349
+
350
+ array_push( $pluginNames, 'WordPress' );
351
+ array_push( $type, 'WordPress' );
352
+ array_push( $pluginVersion, get_bloginfo( 'version' ) );
353
+ array_push( $pluginDates, $coreDate );
354
+ array_push( $pluginDatesF, $coreDateF );
355
+
356
  // Sort array by date
357
  arsort( $pluginDates );
358
 
377
  <tr>
378
  <th><strong>'.__( 'Name', 'companion-auto-update' ).'</strong></th>
379
  <th><strong>'.__( 'Type', 'companion-auto-update' ).'</strong></th>
380
+ <th><strong>'.__( 'To', 'companion-auto-update' ).'</strong></th>
381
  <th><strong>'.__( 'Last updated on', 'companion-auto-update' ).'</strong></th>
382
  </tr>
383
  </thead>';
411
  $thisType = __( 'Plugin', 'companion-auto-update' );
412
  } else if( $type[$key] == 'Theme' ) {
413
  $thisType = __( 'Theme', 'companion-auto-update' );
414
+ } else {
415
+ $thisType = $type[$key];
416
  }
417
 
418
  echo '<td class="cau_hide_on_mobile column-description"><p>'. $thisType .'</p></td>';
419
+ echo '<td class="cau_hide_on_mobile column-version" style="min-width: 100px;"><p>'. $pluginVersion[$key] .'</p></td>';
420
 
421
  }
422
 
488
 
489
  }
490
 
491
+ // Remove update nag when major updates are disabled
492
+ function cau_hideUpdateNag() {
493
+
494
+ global $wpdb;
495
+ $table_name = $wpdb->prefix . "auto_updates";
496
+ $configs = $wpdb->get_results( "SELECT * FROM $table_name WHERE name = 'major'");
497
+ foreach ( $configs as $config ) {
498
+ if( $config->onoroff != 'on' ) {
499
+ remove_action( 'admin_notices', 'update_nag', 3 );
500
+ remove_action( 'network_admin_notices', 'maintenance_nag', 10 );
501
+ }
502
+ }
503
+ }
504
+ add_action( 'admin_head', 'cau_hideUpdateNag', 100 );
505
+
506
  ?>
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.3.4
7
  * Author: Papin Schipper
8
  * Author URI: http://codeermeneer.nl/
9
  * Contributors: papin
@@ -162,7 +162,7 @@ function cau_frontend() { ?>
162
 
163
  <div class='wrap cau_content_wrap'>
164
 
165
- <h1 class="wp-heading-inline"><?php _e('Auto Updater', 'companion-auto-update'); ?></h1>
166
 
167
  <div class='cau_support_buttons'>
168
  <a href="<?php echo cau_donateUrl(); ?>" target="_blank" class="donate-button page-title-action cau_hide_on_mobile"><?php _e('Donate to help development', 'companion-auto-update'); ?></a>
@@ -174,24 +174,11 @@ function cau_frontend() { ?>
174
  <a href="<?php echo cau_menloc(); ?>?page=cau-settings" class="nav-tab <?php active_tab(''); ?>"><?php _e('Dashboard' ); ?></a>
175
  <a href="<?php echo cau_menloc(); ?>?page=cau-settings&amp;tab=schedule&cau_page=advanced" class="nav-tab <?php active_tab('schedule', 'tab'); ?>"><?php _e('Advanced settings', 'companion-auto-update'); ?></a>
176
  <a href="<?php echo cau_menloc(); ?>?page=cau-settings&amp;tab=pluginlist&cau_page=advanced" class="nav-tab <?php active_tab('pluginlist', 'tab'); ?>"><?php _e('Select plugins', 'companion-auto-update'); ?></a>
177
- <a href="<?php echo cau_menloc(); ?>?page=cau-settings&amp;tab=log&amp;cau_page=system" class="systeminfoTab nav-tab <?php active_tab('system', 'cau_page'); ?>"><?php _e('Systeminfo', 'companion-auto-update'); ?></a>
 
178
  <a href="<?php echo cau_menloc(); ?>?page=cau-settings&amp;tab=support" class="nav-tab <?php active_tab('support'); ?>"><?php _e('Support', 'companion-auto-update'); ?></a>
179
  </h2>
180
 
181
- <?php
182
- $cau_page = ( isset($_GET['cau_page'] ) ? $_GET['cau_page'] : null );
183
-
184
- if( $cau_page == 'system' ) { ?>
185
-
186
- <ul class="subsubsub">
187
- <li><a class="<?php active_subtab('log'); ?>" href="<?php echo cau_menloc(); ?>?page=cau-settings&amp;tab=log&amp;cau_page=system"><?php _e('Update log', 'companion-auto-update'); ?></a> | </li>
188
- <li><a class="systeminfoSubtab <?php active_subtab('status'); ?>" href="<?php echo cau_menloc(); ?>?page=cau-settings&amp;tab=status&amp;cau_page=system"><?php _e('Status', 'companion-auto-update'); ?></a></li>
189
- </ul>
190
-
191
- <br class="clear" />
192
-
193
- <?php } ?>
194
-
195
  <?php
196
 
197
  if( !isset( $_GET['tab'] ) ) {
@@ -227,7 +214,7 @@ function cau_widget() {
227
  echo '<p>'.__('Below are the last 7 updates ran on this site. Includes plugins and themes, both automatically updated and manually updated.', 'companion-auto-update').'</p>';
228
  cau_fetch_log( '7' );
229
  echo '<p>
230
- <a href="'.admin_url( cau_menloc().'?page=cau-settings&tab=log&cau_page=system').'">'.__('View full changelog', 'companion-auto-update').'</a>
231
  <span class="cau_divide">|</span>
232
  <a href="'.admin_url( cau_menloc().'?page=cau-settings').'">'.__( 'Settings' ).'</a>
233
  </p>';
@@ -346,7 +333,7 @@ function cau_checkForIssues( $admin_bar ) {
346
  $admin_bar->add_menu( array(
347
  'id' => 'cau-has-issues',
348
  'title' => '<span class="ab-icon"></span><span class="cau-level-'.cau_pluginIssueLevels().'">'.cau_pluginIssueCount().'</span>',
349
- 'href' => admin_url( cau_menloc().'?page=cau-settings&tab=status&cau_page=system' ),
350
  'meta' => array(
351
  'target' => '_self',
352
  'title' => $cauWaningBarTitle,
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.3.5
7
  * Author: Papin Schipper
8
  * Author URI: http://codeermeneer.nl/
9
  * Contributors: papin
162
 
163
  <div class='wrap cau_content_wrap'>
164
 
165
+ <h1 class="wp-heading-inline"><?php _e('Companion Auto Update', 'companion-auto-update'); ?></h1>
166
 
167
  <div class='cau_support_buttons'>
168
  <a href="<?php echo cau_donateUrl(); ?>" target="_blank" class="donate-button page-title-action cau_hide_on_mobile"><?php _e('Donate to help development', 'companion-auto-update'); ?></a>
174
  <a href="<?php echo cau_menloc(); ?>?page=cau-settings" class="nav-tab <?php active_tab(''); ?>"><?php _e('Dashboard' ); ?></a>
175
  <a href="<?php echo cau_menloc(); ?>?page=cau-settings&amp;tab=schedule&cau_page=advanced" class="nav-tab <?php active_tab('schedule', 'tab'); ?>"><?php _e('Advanced settings', 'companion-auto-update'); ?></a>
176
  <a href="<?php echo cau_menloc(); ?>?page=cau-settings&amp;tab=pluginlist&cau_page=advanced" class="nav-tab <?php active_tab('pluginlist', 'tab'); ?>"><?php _e('Select plugins', 'companion-auto-update'); ?></a>
177
+ <a href="<?php echo cau_menloc(); ?>?page=cau-settings&amp;tab=log&amp;cau_page=log" class="systeminfoTab nav-tab <?php active_tab('log', 'cau_page'); ?>"><?php _e('Update log', 'companion-auto-update'); ?></a>
178
+ <a href="<?php echo cau_menloc(); ?>?page=cau-settings&amp;tab=status&amp;cau_page=status" class="systeminfoTab nav-tab <?php active_tab('status', 'cau_page'); ?>"><?php _e('Status', 'companion-auto-update'); ?></a>
179
  <a href="<?php echo cau_menloc(); ?>?page=cau-settings&amp;tab=support" class="nav-tab <?php active_tab('support'); ?>"><?php _e('Support', 'companion-auto-update'); ?></a>
180
  </h2>
181
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  <?php
183
 
184
  if( !isset( $_GET['tab'] ) ) {
214
  echo '<p>'.__('Below are the last 7 updates ran on this site. Includes plugins and themes, both automatically updated and manually updated.', 'companion-auto-update').'</p>';
215
  cau_fetch_log( '7' );
216
  echo '<p>
217
+ <a href="'.admin_url( cau_menloc().'?page=cau-settings&tab=log&cau_page=log').'">'.__('View full changelog', 'companion-auto-update').'</a>
218
  <span class="cau_divide">|</span>
219
  <a href="'.admin_url( cau_menloc().'?page=cau-settings').'">'.__( 'Settings' ).'</a>
220
  </p>';
333
  $admin_bar->add_menu( array(
334
  'id' => 'cau-has-issues',
335
  'title' => '<span class="ab-icon"></span><span class="cau-level-'.cau_pluginIssueLevels().'">'.cau_pluginIssueCount().'</span>',
336
+ 'href' => admin_url( cau_menloc().'?page=cau-settings&tab=status&cau_page=status' ),
337
  'meta' => array(
338
  'target' => '_self',
339
  'title' => $cauWaningBarTitle,
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/dakel/5/
4
  Tags: auto, automatic, background, update, updates, updating, automatic updates, automatic background updates, easy update, wordpress update, theme update, plugin update, up-to-date, security, update latest version, update core, update wp, update wp core, major updates, minor updates, update to new version, update core, update plugin, update plugins, update plugins automatically, update theme, plugin, theme, advance, control, mail, notifations, enable
5
  Requires at least: 3.5.0
6
  Tested up to: 5.0
7
- Stable tag: 3.3.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,6 +71,14 @@ For some reason this plugin seems to have trouble with updating themes by Elegan
71
 
72
  == Changelog ==
73
 
 
 
 
 
 
 
 
 
74
  = 3.3.4 (December 24, 2018) =
75
  * Improved: Few tweaks to the new warning icon
76
  * Improved: Changed a few strings to be clearer to understand
4
  Tags: auto, automatic, background, update, updates, updating, automatic updates, automatic background updates, easy update, wordpress update, theme update, plugin update, up-to-date, security, update latest version, update core, update wp, update wp core, major updates, minor updates, update to new version, update core, update plugin, update plugins, update plugins automatically, update theme, plugin, theme, advance, control, mail, notifations, enable
5
  Requires at least: 3.5.0
6
  Tested up to: 5.0
7
+ Stable tag: 3.3.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
 
72
  == Changelog ==
73
 
74
+ = 3.3.5 (January 5, 2019) =
75
+ * New: See WordPress & PHP version on the status page
76
+ * New: WordPress core updates now show in status log
77
+ * Improvement: Split Update log and Status tab
78
+ * Improvement: Update log now shows new version (no old version yet, sorry)
79
+ * Improvement: If major updates are disabled the update nag will no longer show
80
+ * Fix: Error Notice: Undefined index: menloc
81
+
82
  = 3.3.4 (December 24, 2018) =
83
  * Improved: Few tweaks to the new warning icon
84
  * Improved: Changed a few strings to be clearer to understand