Companion Auto Update - Version 3.2.3

Version Description

(October 25, 2018) = * Improved: New error notification when plugins runs into a critical error

Download this release

Release Info

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

Code changes from version 3.2.2 to 3.2.3

admin/status.php CHANGED
@@ -165,19 +165,6 @@
165
  </table>
166
 
167
  <?php
168
- function checkAutomaticUpdaterDisabled() {
169
-
170
- if( doing_filter( 'AUTOMATIC_UPDATER_DISABLED' ) ) {
171
- return true;
172
- } elseif( automatic_updater_disabled == 'true' ) {
173
- return true;
174
- } elseif( automatic_updater_disabled == 'minor' ) {
175
- return true;
176
- } else {
177
- return false;
178
- }
179
-
180
- }
181
 
182
  if( checkAutomaticUpdaterDisabled() ) { ?>
183
 
165
  </table>
166
 
167
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
168
 
169
  if( checkAutomaticUpdaterDisabled() ) { ?>
170
 
cau_emails.php CHANGED
@@ -211,7 +211,7 @@ function cau_plugin_updated() {
211
  if( $fileDate >= $lastday ) {
212
 
213
  // Get theme name
214
- array_push( $themeNames , $path_parts['filename'] );
215
  array_push( $themeDates, $fileDate );
216
 
217
  }
211
  if( $fileDate >= $lastday ) {
212
 
213
  // Get theme name
214
+ array_push( $themeNames, $path_parts['filename'] );
215
  array_push( $themeDates, $fileDate );
216
 
217
  }
cau_functions.php CHANGED
@@ -1,5 +1,19 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  function cau_menloc() {
4
 
5
  return 'tools.php';
@@ -223,7 +237,7 @@ function cau_plugin_info( $slug, $what ) {
223
  $cau_transient_name = 'cau' . $slug;
224
  $cau_info = get_transient( $cau_transient_name );
225
 
226
- require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
227
  $cau_info = plugins_api( 'plugin_information', array( 'slug' => $slug ) );
228
 
229
  if ( ! $cau_info or is_wp_error( $cau_info ) ) {
1
  <?php
2
 
3
+ function checkAutomaticUpdaterDisabled() {
4
+
5
+ if( doing_filter( 'AUTOMATIC_UPDATER_DISABLED' ) ) {
6
+ return true;
7
+ } elseif( automatic_updater_disabled == 'true' OR AUTOMATIC_UPDATER_DISABLED == 'true' ) {
8
+ return true;
9
+ } elseif( automatic_updater_disabled == 'minor' OR AUTOMATIC_UPDATER_DISABLED == 'minor' ) {
10
+ return true;
11
+ } else {
12
+ return false;
13
+ }
14
+
15
+ }
16
+
17
  function cau_menloc() {
18
 
19
  return 'tools.php';
237
  $cau_transient_name = 'cau' . $slug;
238
  $cau_info = get_transient( $cau_transient_name );
239
 
240
+ require_once( plugin_dir_path( __FILE__ ) . 'wp-admin/includes/plugin-install.php' );
241
  $cau_info = plugins_api( 'plugin_information', array( 'slug' => $slug ) );
242
 
243
  if ( ! $cau_info or is_wp_error( $cau_info ) ) {
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.2.2
7
  * Author: Papin Schipper
8
  * Author URI: http://codeermeneer.nl/
9
  * Contributors: papin
@@ -123,7 +123,7 @@ function cau_update_db_check() {
123
  add_action( 'plugins_loaded', 'cau_update_db_check' );
124
 
125
  // Load custom functions
126
- require_once( 'cau_functions.php' );
127
 
128
  // Add plugin to menu
129
  function register_cau_menu_page() {
@@ -178,7 +178,7 @@ function cau_frontend() { ?>
178
 
179
  if( !isset( $_GET['tab'] ) ) {
180
 
181
- require_once( 'admin/dashboard.php' );
182
 
183
  } else {
184
 
@@ -186,7 +186,7 @@ function cau_frontend() { ?>
186
  $allowedPages = array( 'dashboard', 'log', 'pluginlist', 'rollback', 'schedule', 'status', 'support' );
187
 
188
  if( in_array( $requestedPage, $allowedPages) ) {
189
- require_once( 'admin/'.$requestedPage.'.php' );
190
  } else {
191
  wp_die( 'You\'re not allowed to view <strong>'.$requestedPage.'</strong>.' );
192
  }
@@ -226,7 +226,7 @@ function load_cau_sytyles( $hook ) {
226
  add_action( 'admin_enqueue_scripts', 'load_cau_sytyles' );
227
 
228
  // Send e-mails
229
- require_once( 'cau_emails.php' );
230
 
231
  // Add settings link on plugin page
232
  function cau_settings_link( $links ) {
@@ -247,6 +247,21 @@ function cau_settings_link( $links ) {
247
  $plugin = plugin_basename(__FILE__);
248
  add_filter( "plugin_action_links_$plugin", "cau_settings_link" );
249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  // Auto Update Class
251
  class CAU_auto_update {
252
 
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.2.3
7
  * Author: Papin Schipper
8
  * Author URI: http://codeermeneer.nl/
9
  * Contributors: papin
123
  add_action( 'plugins_loaded', 'cau_update_db_check' );
124
 
125
  // Load custom functions
126
+ require_once( plugin_dir_path( __FILE__ ) . 'cau_functions.php' );
127
 
128
  // Add plugin to menu
129
  function register_cau_menu_page() {
178
 
179
  if( !isset( $_GET['tab'] ) ) {
180
 
181
+ require_once( plugin_dir_path( __FILE__ ) . 'admin/dashboard.php' );
182
 
183
  } else {
184
 
186
  $allowedPages = array( 'dashboard', 'log', 'pluginlist', 'rollback', 'schedule', 'status', 'support' );
187
 
188
  if( in_array( $requestedPage, $allowedPages) ) {
189
+ require_once( plugin_dir_path( __FILE__ ) . 'admin/'.$requestedPage.'.php' );
190
  } else {
191
  wp_die( 'You\'re not allowed to view <strong>'.$requestedPage.'</strong>.' );
192
  }
226
  add_action( 'admin_enqueue_scripts', 'load_cau_sytyles' );
227
 
228
  // Send e-mails
229
+ require_once( plugin_dir_path( __FILE__ ) . 'cau_emails.php' );
230
 
231
  // Add settings link on plugin page
232
  function cau_settings_link( $links ) {
247
  $plugin = plugin_basename(__FILE__);
248
  add_filter( "plugin_action_links_$plugin", "cau_settings_link" );
249
 
250
+ // Check for critical errors
251
+ function cau_critical_errors() {
252
+
253
+ if( checkAutomaticUpdaterDisabled() ) {
254
+ return true;
255
+ } else {
256
+ return false;
257
+ }
258
+
259
+ }
260
+
261
+ if( cau_critical_errors() ) {
262
+ echo "<div class='error'><p><strong>".__( 'Critical Error', 'companion-auto-update' )."</strong> &dash; ".__( 'Companion Auto Update ran into a critical error. View the status log for more info.', 'companion-auto-update' )." <a href='".admin_url('tools.php?page=cau-settings&tab=status&cau_page=system')."'>Status log</a></p></div>";
263
+ }
264
+
265
  // Auto Update Class
266
  class CAU_auto_update {
267
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Papin, qweb
3
  Donate link: https://www.paypal.me/dakel/2
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: 4.9
7
- Stable tag: 3.2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,6 +71,9 @@ For some reason this plugin seems to have trouble with updating themes by Elegan
71
 
72
  == Changelog ==
73
 
 
 
 
74
  = 3.2.2 (October 5, 2018) =
75
  * Fix: Parse error: syntax error, unexpected �[� in cau_functions.php on line 247
76
 
3
  Donate link: https://www.paypal.me/dakel/2
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.2.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
 
72
  == Changelog ==
73
 
74
+ = 3.2.3 (October 25, 2018) =
75
+ * Improved: New error notification when plugins runs into a critical error
76
+
77
  = 3.2.2 (October 5, 2018) =
78
  * Fix: Parse error: syntax error, unexpected �[� in cau_functions.php on line 247
79