Companion Auto Update - Version 3.4.0

Version Description

(April 4, 2019) = * (Actually) Fixed: Cronjobs disabled shouldn't be a 'critical error' * New status icon at the status tab to quicker see issues * Fixed: You're not allowed to view error

Download this release

Release Info

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

Code changes from version 3.3.9 to 3.4.0

Files changed (5) hide show
  1. admin/status.php +10 -2
  2. backend/style.css +19 -0
  3. cau_emails.php +5 -7
  4. companion-auto-update.php +29 -18
  5. readme.txt +8 -3
admin/status.php CHANGED
@@ -209,6 +209,7 @@ if( checkAutomaticUpdaterDisabled() ) { ?>
209
  <tr>
210
  <th class="cau_plugin_issue_name"><strong><?php _e( 'Critical Error', 'companion-auto-update' ); ?></strong></th>
211
  <th class="cau_plugin_issue_explain"> </th>
 
212
  <th class="cau_plugin_issue_fixit"><strong><?php _e( 'How to fix', 'companion-auto-update' ); ?></strong></th>
213
  </tr>
214
  </thead>
@@ -219,6 +220,9 @@ if( checkAutomaticUpdaterDisabled() ) { ?>
219
  <td class="cau_plugin_issue_explain">
220
  <?php _e( 'Updating is globally disabled.', 'companion-auto-update' ); ?>
221
  </td>
 
 
 
222
  <td class="cau_plugin_issue_fixit">
223
  <form method="POST">
224
  <button type="submit" name="fixit" class="button button-primary"><?php _e( 'Fix it', 'companion-auto-update' ); ?></button>
@@ -238,7 +242,8 @@ if( checkCronjobsDisabled() ) { ?>
238
 
239
  <thead>
240
  <tr>
241
- <th class="cau_plugin_issue_name"><strong><?php _e( 'Critical Error', 'companion-auto-update' ); ?></strong></th>
 
242
  <th class="cau_plugin_issue_explain"> </th>
243
  <th class="cau_plugin_issue_fixit"><strong><?php _e( 'How to fix', 'companion-auto-update' ); ?></strong></th>
244
  </tr>
@@ -246,10 +251,13 @@ if( checkCronjobsDisabled() ) { ?>
246
 
247
  <tbody id="the-list">
248
  <tr>
249
- <td class="cau_plugin_issue_name"><span class='cau_disabled'><span class="dashicons dashicons-no"></span> <?php _e( 'Critical Error', 'companion-auto-update' ); ?></span></td>
250
  <td class="cau_plugin_issue_explain">
251
  <?php _e( 'Cronjobs are disabled.', 'companion-auto-update' ); ?>
252
  </td>
 
 
 
253
  <td class="cau_plugin_issue_fixit">
254
  <a href="<?php echo cau_url( 'support' ); ?>" class="button"><?php _e( 'Contact for support', 'companion-auto-update' ); ?></a>
255
  </td>
209
  <tr>
210
  <th class="cau_plugin_issue_name"><strong><?php _e( 'Critical Error', 'companion-auto-update' ); ?></strong></th>
211
  <th class="cau_plugin_issue_explain"> </th>
212
+ <th class="cau_plugin_issue_explain"> </th>
213
  <th class="cau_plugin_issue_fixit"><strong><?php _e( 'How to fix', 'companion-auto-update' ); ?></strong></th>
214
  </tr>
215
  </thead>
220
  <td class="cau_plugin_issue_explain">
221
  <?php _e( 'Updating is globally disabled.', 'companion-auto-update' ); ?>
222
  </td>
223
+ <td class="cau_plugin_issue_explain">
224
+ <code>AUTOMATIC_UPDATER_DISABLED true</code>
225
+ </td>
226
  <td class="cau_plugin_issue_fixit">
227
  <form method="POST">
228
  <button type="submit" name="fixit" class="button button-primary"><?php _e( 'Fix it', 'companion-auto-update' ); ?></button>
242
 
243
  <thead>
244
  <tr>
245
+ <th class="cau_plugin_issue_name"><strong><?php _e( 'Warning', 'companion-auto-update' ); ?></strong></th>
246
+ <th class="cau_plugin_issue_explain"> </th>
247
  <th class="cau_plugin_issue_explain"> </th>
248
  <th class="cau_plugin_issue_fixit"><strong><?php _e( 'How to fix', 'companion-auto-update' ); ?></strong></th>
249
  </tr>
251
 
252
  <tbody id="the-list">
253
  <tr>
254
+ <td class="cau_plugin_issue_name"><span class='cau_warning'><span class="dashicons dashicons-warning"></span> <?php _e( 'Warning', 'companion-auto-update' ); ?></span></td>
255
  <td class="cau_plugin_issue_explain">
256
  <?php _e( 'Cronjobs are disabled.', 'companion-auto-update' ); ?>
257
  </td>
258
+ <td class="cau_plugin_issue_explain">
259
+ <code>DISABLE_WP_CRON true</code>
260
+ </td>
261
  <td class="cau_plugin_issue_fixit">
262
  <a href="<?php echo cau_url( 'support' ); ?>" class="button"><?php _e( 'Contact for support', 'companion-auto-update' ); ?></a>
263
  </td>
backend/style.css CHANGED
@@ -88,6 +88,25 @@
88
  margin-left: 0px;
89
  margin-top: 10px;
90
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
  /* Table Styling */
93
  .widefat td {
88
  margin-left: 0px;
89
  margin-top: 10px;
90
  }
91
+ .nav-tab {
92
+ position: relative;
93
+ }
94
+ .nav-tab .cau_melding {
95
+ display: inline-block;
96
+ width: 11px;
97
+ height: 11px;
98
+ border-radius: 10px;
99
+ margin-left: 5px;
100
+ }
101
+ .nav-tab .cau_melding.level-okay {
102
+ background: #7AD03A;
103
+ }
104
+ .nav-tab .cau_melding.level-low {
105
+ background: #FFBA00;
106
+ }
107
+ .nav-tab .cau_melding.level-high {
108
+ background: #FF0000;
109
+ }
110
 
111
  /* Table Styling */
112
  .widefat td {
cau_emails.php CHANGED
@@ -5,7 +5,7 @@ function cau_check_updates_mail() {
5
 
6
  global $wpdb;
7
  $table_name = $wpdb->prefix . "auto_updates";
8
- $cau_configs = $wpdb->get_results( "SELECT * FROM {$table_name}" );
9
 
10
  if( $cau_configs[5]->onoroff == 'on' ) {
11
  cau_list_theme_updates(); // Check for theme updates
@@ -20,7 +20,7 @@ function cau_set_email() {
20
 
21
  global $wpdb;
22
  $table_name = $wpdb->prefix . "auto_updates";
23
- $cau_configs = $wpdb->get_results( "SELECT * FROM {$table_name}" );
24
  $emailArray = array();
25
 
26
  if( $cau_configs[4]->onoroff == '' ) {
@@ -40,12 +40,10 @@ function cau_set_email() {
40
  // Set the content for the emails about pending updates
41
  function cau_pending_message( $single, $plural ) {
42
 
43
- $text = sprintf( esc_html__( 'There are one or more %s updates waiting on your WordPress site at %s but we noticed that you disabled auto-updating for %s.
44
 
45
  Leaving your site outdated is a security risk so please consider manually updating them via your dashboard.', 'companion-auto-update' ), $single, get_site_url(), $plural );
46
 
47
- return $text;
48
-
49
  }
50
 
51
  // Set the content for the emails about recent updates
@@ -70,7 +68,7 @@ function cau_list_theme_updates() {
70
  global $wpdb;
71
  $table_name = $wpdb->prefix . "auto_updates";
72
 
73
- $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'themes'");
74
  foreach ( $configs as $config ) {
75
 
76
  if( $config->onoroff != 'on' ) {
@@ -105,7 +103,7 @@ function cau_list_plugin_updates() {
105
  global $wpdb;
106
  $table_name = $wpdb->prefix . "auto_updates";
107
 
108
- $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'plugins'");
109
  foreach ( $configs as $config ) {
110
 
111
  if( $config->onoroff != 'on' ) {
5
 
6
  global $wpdb;
7
  $table_name = $wpdb->prefix . "auto_updates";
8
+ $cau_configs = $wpdb->get_results( "SELECT * FROM $table_name" );
9
 
10
  if( $cau_configs[5]->onoroff == 'on' ) {
11
  cau_list_theme_updates(); // Check for theme updates
20
 
21
  global $wpdb;
22
  $table_name = $wpdb->prefix . "auto_updates";
23
+ $cau_configs = $wpdb->get_results( "SELECT * FROM $table_name" );
24
  $emailArray = array();
25
 
26
  if( $cau_configs[4]->onoroff == '' ) {
40
  // Set the content for the emails about pending updates
41
  function cau_pending_message( $single, $plural ) {
42
 
43
+ return sprintf( esc_html__( 'There are one or more %1$s updates waiting on your WordPress site at %2$s but we noticed that you disabled auto-updating for %3$s.
44
 
45
  Leaving your site outdated is a security risk so please consider manually updating them via your dashboard.', 'companion-auto-update' ), $single, get_site_url(), $plural );
46
 
 
 
47
  }
48
 
49
  // Set the content for the emails about recent updates
68
  global $wpdb;
69
  $table_name = $wpdb->prefix . "auto_updates";
70
 
71
+ $configs = $wpdb->get_results( "SELECT * FROM $table_name WHERE name = 'themes'");
72
  foreach ( $configs as $config ) {
73
 
74
  if( $config->onoroff != 'on' ) {
103
  global $wpdb;
104
  $table_name = $wpdb->prefix . "auto_updates";
105
 
106
+ $configs = $wpdb->get_results( "SELECT * FROM $table_name WHERE name = 'plugins'");
107
  foreach ( $configs as $config ) {
108
 
109
  if( $config->onoroff != 'on' ) {
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.9
7
  * Author: Papin Schipper
8
  * Author URI: http://codeermeneer.nl/
9
  * Contributors: papin
@@ -167,9 +167,6 @@ function cau_frontend() { ?>
167
  <hr class="wp-header-end">
168
 
169
  <?php
170
-
171
- // Force tab parameter
172
- if( !isset( $_GET['tab'] ) ) header( "Location: ".cau_url( 'dashboard' ) );
173
 
174
  // Allow only access to these pages
175
  $allowedPages = array(
@@ -183,11 +180,26 @@ function cau_frontend() { ?>
183
 
184
  // Show subtabs
185
  echo "<h2 class='nav-tab-wrapper wp-clearfix'>";
186
- foreach ( $allowedPages as $page => $title ) echo "<a href='".cau_url( $page )."' class='nav-tab "._active_tab( $page )."'>".$title."</a>";
 
 
 
 
 
 
 
 
 
 
187
  echo "</h2>";
188
 
189
  // Show page content
190
- $requestedPage = $_GET['tab'];
 
 
 
 
 
191
 
192
  if( array_key_exists( $requestedPage, $allowedPages ) ) {
193
  require_once( plugin_dir_path( __FILE__ ) . 'admin/'.$requestedPage.'.php' );
@@ -333,19 +345,18 @@ function cau_checkForIssues( $admin_bar ) {
333
 
334
  if( cau_pluginIssueLevels() == 'high' ) {
335
  $cauWaningBarTitle = __( 'Companion Auto Update ran into a critical error. View the status log for more info.', 'companion-auto-update' );
336
- } else {
337
- $cauWaningBarTitle = '';
338
- }
339
 
340
- $admin_bar->add_menu( array(
341
- 'id' => 'cau-has-issues',
342
- 'title' => '<span class="ab-icon"></span><span class="cau-level-'.cau_pluginIssueLevels().'">'.cau_pluginIssueCount().'</span>',
343
- 'href' => cau_url( 'status' ),
344
- 'meta' => array(
345
- 'target' => '_self',
346
- 'title' => $cauWaningBarTitle,
347
- ),
348
- ));
 
 
349
 
350
  }
351
 
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.4.0
7
  * Author: Papin Schipper
8
  * Author URI: http://codeermeneer.nl/
9
  * Contributors: papin
167
  <hr class="wp-header-end">
168
 
169
  <?php
 
 
 
170
 
171
  // Allow only access to these pages
172
  $allowedPages = array(
180
 
181
  // Show subtabs
182
  echo "<h2 class='nav-tab-wrapper wp-clearfix'>";
183
+ foreach ( $allowedPages as $page => $title ) {
184
+ echo "<a href='".cau_url( $page )."' id='tab-".$page."' class='nav-tab "._active_tab( $page )."'>".$title;
185
+ if( $page == 'status' ) {
186
+ if( cau_pluginHasIssues() ) {
187
+ echo "<span class='cau_melding level-".cau_pluginIssueLevels()."'></span>";
188
+ } else {
189
+ echo "<span class='cau_melding level-okay'></span>";
190
+ }
191
+ }
192
+ echo "</a>";
193
+ }
194
  echo "</h2>";
195
 
196
  // Show page content
197
+ if( !isset( $_GET['tab'] ) ) {
198
+ $requestedPage = 'dashboard';
199
+ echo "<script>jQuery('#tab-dashboard').addClass('nav-tab-active');</script>"; // Set active tab class
200
+ } else {
201
+ $requestedPage = $_GET['tab'];
202
+ }
203
 
204
  if( array_key_exists( $requestedPage, $allowedPages ) ) {
205
  require_once( plugin_dir_path( __FILE__ ) . 'admin/'.$requestedPage.'.php' );
345
 
346
  if( cau_pluginIssueLevels() == 'high' ) {
347
  $cauWaningBarTitle = __( 'Companion Auto Update ran into a critical error. View the status log for more info.', 'companion-auto-update' );
 
 
 
348
 
349
+ $admin_bar->add_menu( array(
350
+ 'id' => 'cau-has-issues',
351
+ 'title' => '<span class="ab-icon"></span><span class="cau-level-'.cau_pluginIssueLevels().'">'.cau_pluginIssueCount().'</span>',
352
+ 'href' => cau_url( 'status' ),
353
+ 'meta' => array(
354
+ 'target' => '_self',
355
+ 'title' => $cauWaningBarTitle,
356
+ ),
357
+ ));
358
+
359
+ }
360
 
361
  }
362
 
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === Companion Auto Update ===
2
  Contributors: Papin, qweb
3
- 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.1
7
  Requires PHP: 5.1
8
- Stable tag: 3.3.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -72,6 +72,11 @@ For some reason this plugin seems to have trouble with updating themes by Elegan
72
 
73
  == Changelog ==
74
 
 
 
 
 
 
75
  = 3.3.9 (March 11, 2019) =
76
  * Fix: Sometimes emails would be sent twice
77
  * Fix: Cronjobs disabled shouldn't be a critical error
1
  === Companion Auto Update ===
2
  Contributors: Papin, qweb
3
+ Donate link: https://www.paypal.me/dakel/10/
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.2
7
  Requires PHP: 5.1
8
+ Stable tag: 3.4.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
72
 
73
  == Changelog ==
74
 
75
+ = 3.4.0 (April 4, 2019) =
76
+ * (Actually) Fixed: Cronjobs disabled shouldn't be a 'critical error'
77
+ * New status icon at the status tab to quicker see issues
78
+ * Fixed: You're not allowed to view error
79
+
80
  = 3.3.9 (March 11, 2019) =
81
  * Fix: Sometimes emails would be sent twice
82
  * Fix: Cronjobs disabled shouldn't be a critical error