Companion Auto Update - Version 3.7.0

Version Description

Download this release

Release Info

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

Code changes from version 3.6.0 to 3.7.0

admin/dashboard.php CHANGED
@@ -41,6 +41,7 @@ if( isset( $_POST['submit'] ) ) {
41
  // Emails
42
  if( isset( $_POST['cau_send'] ) ) $send = sanitize_text_field( $_POST['cau_send'] ); else $send = '';
43
  if( isset( $_POST['cau_send_update'] ) ) $sendupdate = sanitize_text_field( $_POST['cau_send_update'] ); else $sendupdate = '';
 
44
  if( isset( $_POST['wpemails'] ) ) $wpemails = sanitize_text_field( $_POST['wpemails'] ); else $wpemails = '';
45
  if( isset( $_POST['cau_email'] ) ) $email = sanitize_text_field( $_POST['cau_email'] );
46
  if( isset( $_POST['html_or_text'] ) ) $html_or_text = sanitize_text_field( $_POST['html_or_text'] );
@@ -48,14 +49,23 @@ if( isset( $_POST['submit'] ) ) {
48
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'email'", $email ) );
49
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'send'", $send ) );
50
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'sendupdate'", $sendupdate ) );
 
51
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'wpemails'", $wpemails ) );
52
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'html_or_text'", $html_or_text ) );
53
 
54
  // Advanced
55
- $allow_editor = $_POST['allow_editor'];
56
- $allow_author = $_POST['allow_author'];
 
57
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'allow_editor'", $allow_editor ) );
58
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'allow_author'", $allow_author ) );
 
 
 
 
 
 
 
59
 
60
  // Intervals
61
 
@@ -73,6 +83,7 @@ if( isset( $_POST['submit'] ) ) {
73
  wp_clear_scheduled_hook('cau_set_schedule_mail');
74
  wp_clear_scheduled_hook('cau_custom_hooks_plugins');
75
  wp_clear_scheduled_hook('cau_custom_hooks_themes');
 
76
 
77
  // Then set the new times
78
 
@@ -88,11 +99,13 @@ if( isset( $_POST['submit'] ) ) {
88
 
89
  wp_schedule_event( $pluginSetTime, $plugin_sc, 'wp_update_plugins' );
90
  wp_schedule_event( $pluginSetTime, $plugin_sc, 'cau_custom_hooks_plugins' );
 
91
 
92
  } else {
93
 
94
  wp_schedule_event( time(), $plugin_sc, 'wp_update_plugins' );
95
  wp_schedule_event( time(), $plugin_sc, 'cau_custom_hooks_plugins' );
 
96
 
97
  }
98
 
@@ -252,7 +265,16 @@ $availableIntervals = cau_wp_get_schedules();
252
  <td>
253
  <p>
254
  <input id="cau_send_update" name="cau_send_update" type="checkbox" <?php if( cau_get_db_value( 'sendupdate' ) == 'on' ) { echo 'checked'; } ?> />
255
- <label for="cau_send_update"><?php _e('Send me emails when something has been updated.', 'companion-auto-update');?></label>
 
 
 
 
 
 
 
 
 
256
  </p>
257
  </td>
258
  </tr>
@@ -260,7 +282,7 @@ $availableIntervals = cau_wp_get_schedules();
260
  <th scope="row"><?php _e( 'Email Address' );?></th>
261
  <td>
262
  <p>
263
- <label for="cau_email"><?php _e('To', 'companion-auto-update');?>:</label>
264
  <input type="text" name="cau_email" id="cau_email" class="regular-text" placeholder="<?php echo get_option('admin_email'); ?>" value="<?php echo esc_html( $toemail ); ?>" />
265
  </p>
266
 
@@ -278,17 +300,27 @@ $availableIntervals = cau_wp_get_schedules();
278
  </p>
279
  </td>
280
  </tr>
 
 
 
 
 
 
 
 
281
  <tr>
282
  <th scope="row">
283
- <?php _e('Core notifications', 'companion-auto-update');?>
284
  <span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
285
- <span class='cau_tooltip_text'><?php _e('Core notifications are handled by WordPress and not by this plugin. You can only disable them, changing your email address in the settings above will not affect these notifications.', 'companion-auto-update');?></span>
 
 
286
  </span>
287
  </th>
288
  <td>
289
  <p>
290
  <input id="wpemails" name="wpemails" type="checkbox" <?php if( cau_get_db_value( 'wpemails' ) == 'on' ) { echo 'checked'; } ?> />
291
- <label for="wpemails"><?php _e( 'By default WordPress sends an email when a core update has occurred. Uncheck this box to disable these emails.', 'companion-auto-update' );?></label>
292
  </p>
293
  </td>
294
  </tr>
@@ -321,11 +353,11 @@ $availableIntervals = cau_wp_get_schedules();
321
  ?>
322
 
323
  <div class='cau_schedule_input'>
324
- <input type='number' max='23' name='pluginScheduleTimeH' value='<?php echo $setTimePluginsHour; ?>' maxlength='2' >
325
  </div><div class='cau_schedule_input_div'>
326
  :
327
  </div><div class='cau_schedule_input'>
328
- <input type='number' max='59' name='pluginScheduleTimeM' value='<?php echo $setTimePluginsMin; ?>' maxlength='2' >
329
  </div><div class='cau_shedule_notation'>
330
  <span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
331
  <span class='cau_tooltip_text'><?php _e('At what time should the updater run? Only works when set to <u>daily</u>.', 'companion-auto-update'); ?> - <?php _e( 'Time notation: 24H', 'companion-auto-update'); ?></span>
@@ -355,11 +387,11 @@ $availableIntervals = cau_wp_get_schedules();
355
  ?>
356
 
357
  <div class='cau_schedule_input'>
358
- <input type='number' max='23' name='ThemeScheduleTimeH' value='<?php echo $setTimeThemesHour; ?>' maxlength='2' >
359
  </div><div class='cau_schedule_input_div'>
360
  :
361
  </div><div class='cau_schedule_input'>
362
- <input type='number' max='59' name='ThemeScheduleTimeM' value='<?php echo $setTimeThemesMins; ?>' maxlength='2' >
363
  </div><div class='cau_shedule_notation'>
364
  <span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
365
  <span class='cau_tooltip_text'><?php _e('At what time should the updater run? Only works when set to <u>daily</u>.', 'companion-auto-update'); ?> - <?php _e( 'Time notation: 24H', 'companion-auto-update'); ?></span>
@@ -388,11 +420,11 @@ $availableIntervals = cau_wp_get_schedules();
388
  ?>
389
 
390
  <div class='cau_schedule_input'>
391
- <input type='number' max='23' name='CoreScheduleTimeH' value='<?php echo $setTimeCoreHour; ?>' maxlength='2' >
392
  </div><div class='cau_schedule_input_div'>
393
  :
394
  </div><div class='cau_schedule_input'>
395
- <input type='number' max='59' name='CoreScheduleTimeM' value='<?php echo $setTimeCoreMins; ?>' maxlength='2' >
396
  </div><div class='cau_shedule_notation'>
397
  <span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
398
  <span class='cau_tooltip_text'><?php _e('At what time should the updater run? Only works when set to <u>daily</u>.', 'companion-auto-update'); ?> - <?php _e( 'Time notation: 24H', 'companion-auto-update'); ?></span>
@@ -421,11 +453,11 @@ $availableIntervals = cau_wp_get_schedules();
421
  ?>
422
 
423
  <div class='cau_schedule_input'>
424
- <input type='number' max='23' name='timeScheduleEmailTimeH' value='<?php echo $setTimeEmailHour; ?>' maxlength='2' >
425
  </div><div class='cau_schedule_input_div'>
426
  :
427
  </div><div class='cau_schedule_input'>
428
- <input type='number' max='59' name='timeScheduleEmailTimeM' value='<?php echo $setTimeEmailMins; ?>' maxlength='2' >
429
  </div><div class='cau_shedule_notation'>
430
  <span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
431
  <span class='cau_tooltip_text'><?php _e( 'Time notation: 24H', 'companion-auto-update'); ?></span>
@@ -443,11 +475,24 @@ $availableIntervals = cau_wp_get_schedules();
443
  <table class="form-table">
444
  <tbody>
445
  <tr>
446
- <th scope="row"><label for="blogname"><?php _e( 'Allow access to:', 'companion-auto-update' ); ?></label></th>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
447
  <td>
448
- <p><label for="allow_administrator"><input name="allow_administrator" type="checkbox" id="allow_administrator" disabled="" checked=""><?php _e( 'Administrator', '' ); ?></label></p>
449
- <p><label for="allow_editor"><input name="allow_editor" type="checkbox" id="allow_editor" <?php if( cau_get_db_value( 'allow_editor' ) == 'on' ) { echo "CHECKED"; } ?>><?php _e( 'Editor', '' ); ?></label></p>
450
- <p><label for="allow_author"><input name="allow_author" type="checkbox" id="allow_author" <?php if( cau_get_db_value( 'allow_author' ) == 'on' ) { echo "CHECKED"; } ?>><?php _e( 'Author', '' ); ?></label></p>
451
  </td>
452
  </tr>
453
  </tbody>
@@ -508,8 +553,18 @@ $availableIntervals = cau_wp_get_schedules();
508
 
509
  </div>
510
 
 
 
 
 
 
 
511
  <script type="text/javascript">
512
 
 
 
 
 
513
  jQuery( '#plugin_schedule' ).change( function() {
514
 
515
  var selected = jQuery(this).val();
41
  // Emails
42
  if( isset( $_POST['cau_send'] ) ) $send = sanitize_text_field( $_POST['cau_send'] ); else $send = '';
43
  if( isset( $_POST['cau_send_update'] ) ) $sendupdate = sanitize_text_field( $_POST['cau_send_update'] ); else $sendupdate = '';
44
+ if( isset( $_POST['cau_send_outdated'] ) ) $sendoutdated = sanitize_text_field( $_POST['cau_send_outdated'] ); else $sendoutdated = '';
45
  if( isset( $_POST['wpemails'] ) ) $wpemails = sanitize_text_field( $_POST['wpemails'] ); else $wpemails = '';
46
  if( isset( $_POST['cau_email'] ) ) $email = sanitize_text_field( $_POST['cau_email'] );
47
  if( isset( $_POST['html_or_text'] ) ) $html_or_text = sanitize_text_field( $_POST['html_or_text'] );
49
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'email'", $email ) );
50
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'send'", $send ) );
51
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'sendupdate'", $sendupdate ) );
52
+ $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'sendoutdated'", $sendoutdated ) );
53
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'wpemails'", $wpemails ) );
54
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'html_or_text'", $html_or_text ) );
55
 
56
  // Advanced
57
+ if( isset( $_POST['allow_editor'] ) ) $allow_editor = sanitize_text_field( $_POST['allow_editor'] ); else $allow_editor = '';
58
+ if( isset( $_POST['allow_author'] ) ) $allow_author = sanitize_text_field( $_POST['allow_author'] ); else $allow_author = '';
59
+ if( isset( $_POST['advanced_info_emails'] ) ) $advanced_info_emails = sanitize_text_field( $_POST['advanced_info_emails'] ); else $advanced_info_emails = '';
60
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'allow_editor'", $allow_editor ) );
61
  $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'allow_author'", $allow_author ) );
62
+ $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'advanced_info_emails'", $advanced_info_emails ) );
63
+
64
+ // Delay
65
+ if( isset( $_POST['update_delay'] ) ) $update_delay = sanitize_text_field( $_POST['update_delay'] ); else $update_delay = '';
66
+ if( isset( $_POST['update_delay_days'] ) ) $update_delay_days = sanitize_text_field( $_POST['update_delay_days'] ); else $update_delay_days = '';
67
+ $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'update_delay'", $update_delay ) );
68
+ $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'update_delay_days'", $update_delay_days ) );
69
 
70
  // Intervals
71
 
83
  wp_clear_scheduled_hook('cau_set_schedule_mail');
84
  wp_clear_scheduled_hook('cau_custom_hooks_plugins');
85
  wp_clear_scheduled_hook('cau_custom_hooks_themes');
86
+ wp_clear_scheduled_hook('cau_log_updater');
87
 
88
  // Then set the new times
89
 
99
 
100
  wp_schedule_event( $pluginSetTime, $plugin_sc, 'wp_update_plugins' );
101
  wp_schedule_event( $pluginSetTime, $plugin_sc, 'cau_custom_hooks_plugins' );
102
+ wp_schedule_event( ( $pluginSetTime - 1800 ), $plugin_sc, 'cau_log_updater' );
103
 
104
  } else {
105
 
106
  wp_schedule_event( time(), $plugin_sc, 'wp_update_plugins' );
107
  wp_schedule_event( time(), $plugin_sc, 'cau_custom_hooks_plugins' );
108
+ wp_schedule_event( ( time() - 1800 ), $plugin_sc, 'cau_log_updater' );
109
 
110
  }
111
 
265
  <td>
266
  <p>
267
  <input id="cau_send_update" name="cau_send_update" type="checkbox" <?php if( cau_get_db_value( 'sendupdate' ) == 'on' ) { echo 'checked'; } ?> />
268
+ <label for="cau_send_update"><?php _e( 'Send me emails when something has been updated.', 'companion-auto-update' );?></label>
269
+ </p>
270
+ </td>
271
+ </tr>
272
+ <tr>
273
+ <th scope="row"><?php _e( 'Outdated software', 'companion-auto-update' );?></th>
274
+ <td>
275
+ <p>
276
+ <input id="cau_send_outdated" name="cau_send_outdated" type="checkbox" <?php if( cau_get_db_value( 'sendoutdated' ) == 'on' ) { echo 'checked'; } ?> />
277
+ <label for="cau_send_outdated"><?php _e( 'Be notified of plugins that have not been tested with your current version of WordPress.', 'companion-auto-update' );?></label>
278
  </p>
279
  </td>
280
  </tr>
282
  <th scope="row"><?php _e( 'Email Address' );?></th>
283
  <td>
284
  <p>
285
+ <label for="cau_email"><?php _e( 'To', 'companion-auto-update' ); ?>:</label>
286
  <input type="text" name="cau_email" id="cau_email" class="regular-text" placeholder="<?php echo get_option('admin_email'); ?>" value="<?php echo esc_html( $toemail ); ?>" />
287
  </p>
288
 
300
  </p>
301
  </td>
302
  </tr>
303
+ <tr>
304
+ <th scope="row"><?php _e( 'Show more info in emails', 'companion-auto-update' );?></th>
305
+ <td>
306
+ <p>
307
+ <label for="advanced_info_emails"><input name="advanced_info_emails" type="checkbox" id="advanced_info_emails" <?php if( cau_get_db_value( 'advanced_info_emails' ) == 'on' ) { echo "CHECKED"; } ?>> <?php _e( 'Show the time of the update', 'companion-auto-update' ); ?></label>
308
+ </p>
309
+ </td>
310
+ </tr>
311
  <tr>
312
  <th scope="row">
313
+ <?php _e( 'WordPress notifications', 'companion-auto-update' );?>
314
  <span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
315
+ <span class='cau_tooltip_text'>
316
+ <?php _e( 'Core notifications are handled by WordPress and not by this plugin. You can only disable them, changing your email address in the settings above will not affect these notifications.', 'companion-auto-update' );?>
317
+ </span>
318
  </span>
319
  </th>
320
  <td>
321
  <p>
322
  <input id="wpemails" name="wpemails" type="checkbox" <?php if( cau_get_db_value( 'wpemails' ) == 'on' ) { echo 'checked'; } ?> />
323
+ <label for="wpemails"><?php _e( 'By default WordPress sends an email when a core update has occurred. Uncheck this box to disable these emails.', 'companion-auto-update' ); ?></label>
324
  </p>
325
  </td>
326
  </tr>
353
  ?>
354
 
355
  <div class='cau_schedule_input'>
356
+ <input type='number' min='0' max='23' name='pluginScheduleTimeH' value='<?php echo $setTimePluginsHour; ?>' maxlength='2' >
357
  </div><div class='cau_schedule_input_div'>
358
  :
359
  </div><div class='cau_schedule_input'>
360
+ <input type='number' min='0' max='59' name='pluginScheduleTimeM' value='<?php echo $setTimePluginsMin; ?>' maxlength='2' >
361
  </div><div class='cau_shedule_notation'>
362
  <span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
363
  <span class='cau_tooltip_text'><?php _e('At what time should the updater run? Only works when set to <u>daily</u>.', 'companion-auto-update'); ?> - <?php _e( 'Time notation: 24H', 'companion-auto-update'); ?></span>
387
  ?>
388
 
389
  <div class='cau_schedule_input'>
390
+ <input type='number' min='0' max='23' name='ThemeScheduleTimeH' value='<?php echo $setTimeThemesHour; ?>' maxlength='2' >
391
  </div><div class='cau_schedule_input_div'>
392
  :
393
  </div><div class='cau_schedule_input'>
394
+ <input type='number' min='0' max='59' name='ThemeScheduleTimeM' value='<?php echo $setTimeThemesMins; ?>' maxlength='2' >
395
  </div><div class='cau_shedule_notation'>
396
  <span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
397
  <span class='cau_tooltip_text'><?php _e('At what time should the updater run? Only works when set to <u>daily</u>.', 'companion-auto-update'); ?> - <?php _e( 'Time notation: 24H', 'companion-auto-update'); ?></span>
420
  ?>
421
 
422
  <div class='cau_schedule_input'>
423
+ <input type='number' min='0' max='23' name='CoreScheduleTimeH' value='<?php echo $setTimeCoreHour; ?>' maxlength='2' >
424
  </div><div class='cau_schedule_input_div'>
425
  :
426
  </div><div class='cau_schedule_input'>
427
+ <input type='number' min='0' max='59' name='CoreScheduleTimeM' value='<?php echo $setTimeCoreMins; ?>' maxlength='2' >
428
  </div><div class='cau_shedule_notation'>
429
  <span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
430
  <span class='cau_tooltip_text'><?php _e('At what time should the updater run? Only works when set to <u>daily</u>.', 'companion-auto-update'); ?> - <?php _e( 'Time notation: 24H', 'companion-auto-update'); ?></span>
453
  ?>
454
 
455
  <div class='cau_schedule_input'>
456
+ <input type='number' min='0' max='23' name='timeScheduleEmailTimeH' value='<?php echo $setTimeEmailHour; ?>' maxlength='2' >
457
  </div><div class='cau_schedule_input_div'>
458
  :
459
  </div><div class='cau_schedule_input'>
460
+ <input type='number' min='0' max='59' name='timeScheduleEmailTimeM' value='<?php echo $setTimeEmailMins; ?>' maxlength='2' >
461
  </div><div class='cau_shedule_notation'>
462
  <span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
463
  <span class='cau_tooltip_text'><?php _e( 'Time notation: 24H', 'companion-auto-update'); ?></span>
475
  <table class="form-table">
476
  <tbody>
477
  <tr>
478
+ <th scope="row"><label><?php _e( 'Allow access to:', 'companion-auto-update' ); ?></label></th>
479
+ <td>
480
+ <p><label for="allow_administrator"><input name="allow_administrator" type="checkbox" id="allow_administrator" disabled="" checked=""><?php _e( 'Administrator' ); ?></label></p>
481
+ <p><label for="allow_editor"><input name="allow_editor" type="checkbox" id="allow_editor" <?php if( cau_get_db_value( 'allow_editor' ) == 'on' ) { echo "CHECKED"; } ?>><?php _e( 'Editor' ); ?></label></p>
482
+ <p><label for="allow_author"><input name="allow_author" type="checkbox" id="allow_author" <?php if( cau_get_db_value( 'allow_author' ) == 'on' ) { echo "CHECKED"; } ?>><?php _e( 'Author' ); ?></label></p>
483
+ </td>
484
+ </tr>
485
+ <tr>
486
+ <th scope="row"><label><?php _e( 'Delay updates', 'companion-auto-update' ); ?></label></th>
487
+ <td>
488
+ <p><label for="update_delay"><input name="update_delay" type="checkbox" id="update_delay" <?php if( cau_get_db_value( 'update_delay' ) == 'on' ) { echo "CHECKED"; } ?>><?php _e( 'Delay updates' ); ?></label></p>
489
+ </td>
490
+ </tr>
491
+ <tr id='update_delay_days_block' <?php if( cau_get_db_value( 'update_delay' ) != 'on' ) { echo "class='disabled_option'"; } ?>>
492
+ <th scope="row"><label><?php _e( 'Number of days', 'companion-auto-update' ); ?></label></th>
493
  <td>
494
+ <input type="number" min="0" max="31" name="update_delay_days" id="update_delay_days" class="regular-text" value="<?php echo cau_get_db_value( 'update_delay_days' ); ?>" />
495
+ <p><?php _e( 'For how many days should updates be put on hold?', 'companion-auto-update' ); ?></p>
 
496
  </td>
497
  </tr>
498
  </tbody>
553
 
554
  </div>
555
 
556
+ <style>
557
+ .disabled_option {
558
+ opacity: .5;
559
+ }
560
+ </style>
561
+
562
  <script type="text/javascript">
563
 
564
+ jQuery( '#update_delay' ).change( function() {
565
+ jQuery( '#update_delay_days_block' ).toggleClass( 'disabled_option' );
566
+ });
567
+
568
  jQuery( '#plugin_schedule' ).change( function() {
569
 
570
  var selected = jQuery(this).val();
admin/log.php CHANGED
@@ -1,5 +1,3 @@
1
- <h2><?php _e( 'Update log', 'companion-auto-update' ); ?></h2>
2
-
3
  <?php
4
  if( isset( $_GET['filter'] ) ) {
5
  $filter = $_GET['filter'];
 
 
1
  <?php
2
  if( isset( $_GET['filter'] ) ) {
3
  $filter = $_GET['filter'];
admin/pluginlist.php CHANGED
@@ -157,7 +157,6 @@ if( isset( $_POST['reset'] ) ) {
157
  <td class="column-name">
158
  <p style="margin-bottom: 0px;"><strong>'. $name .'</strong></p>
159
  <small class="description" style="opacity: 0.5; margin-bottom: 3px;">'.$actualSlug.'</small>
160
- <p>'.cau_updatePluginInformation( $actualSlug, 'Auto', 'Version' ).'</p>
161
  </td>
162
 
163
  <td class="cau_hide_on_mobile column-status">
157
  <td class="column-name">
158
  <p style="margin-bottom: 0px;"><strong>'. $name .'</strong></p>
159
  <small class="description" style="opacity: 0.5; margin-bottom: 3px;">'.$actualSlug.'</small>
 
160
  </td>
161
 
162
  <td class="cau_hide_on_mobile column-status">
admin/status.php CHANGED
@@ -10,454 +10,307 @@
10
  cau_savePluginInformation();
11
  echo '<div id="message" class="updated"><p><b>'.__( 'Database information update completed' ).'</b></p></div>';
12
  }
13
-
14
- // Date format
15
- $dateFormat = get_option( 'date_format' );
16
- $dateFormat .= ' '.get_option( 'time_format' );
17
-
18
- global $wpdb;
19
- $table_name = $wpdb->prefix . "auto_updates";
20
-
21
- // Minor updates
22
- $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'minor'");
23
- foreach ( $configs as $config ) {
24
-
25
- if( $config->onoroff == 'on' && wp_get_schedule( 'wp_version_check' ) ) {
26
- $minorUpdates = true;
27
- $minorStatus = 'enabled';
28
- $minorIcon = 'yes-alt';
29
- $minorInterval = wp_get_schedule( 'wp_version_check' );
30
- $minorNext = date_i18n( $dateFormat, wp_next_scheduled( 'wp_version_check' ) );
31
- $minorText = __( 'Enabled', 'companion-auto-update' );
32
- } else {
33
- $minorUpdates = false;
34
- $minorStatus = 'disabled';
35
- $minorIcon = 'marker';
36
- $minorInterval = '&dash;';
37
- $minorNext = '&dash;';
38
- $minorText = __( 'Disabled', 'companion-auto-update' );
39
- }
40
-
41
- }
42
-
43
- // Major updates
44
- $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'major'");
45
- foreach ( $configs as $config ) {
46
-
47
- if( $config->onoroff == 'on' && wp_get_schedule( 'wp_version_check' ) ) {
48
- $majorUpdates = true;
49
- $majorStatus = 'enabled';
50
- $majorIcon = 'yes-alt';
51
- $majorInterval = wp_get_schedule( 'wp_version_check' );
52
- $majorNext = date_i18n( $dateFormat, wp_next_scheduled( 'wp_version_check' ) );
53
- $majorText = __( 'Enabled', 'companion-auto-update' );
54
- } else {
55
- $majorUpdates = false;
56
- $majorStatus = 'disabled';
57
- $majorIcon = 'marker';
58
- $majorInterval = '&dash;';
59
- $majorNext = '&dash;';
60
- $majorText = __( 'Disabled', 'companion-auto-update' );
61
- }
62
-
63
- }
64
 
65
- // Plugin updates
66
- $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'plugins'");
67
- foreach ( $configs as $config ) {
68
-
69
- if( $config->onoroff == 'on' && wp_get_schedule( 'wp_update_plugins' ) ) {
70
- $pluginsUpdates = true;
71
- $pluginsStatus = 'enabled';
72
- $pluginsIcon = 'yes-alt';
73
- $pluginsInterval = wp_get_schedule( 'wp_update_plugins' );
74
- $pluginsNext = date_i18n( $dateFormat, wp_next_scheduled( 'wp_update_plugins' ) );
75
- $pluginsText = __( 'Enabled', 'companion-auto-update' );
76
- } else {
77
- $pluginsUpdates = false;
78
- $pluginsStatus = 'disabled';
79
- $pluginsIcon = 'marker';
80
- $pluginsInterval = '&dash;';
81
- $pluginsNext = '&dash;';
82
- $pluginsText = __( 'Disabled', 'companion-auto-update' );
83
- }
84
 
85
- }
 
86
 
87
- // Themes updates
88
- $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'themes'");
89
- foreach ( $configs as $config ) {
90
-
91
- if( $config->onoroff == 'on' && wp_get_schedule( 'wp_update_plugins' ) ) {
92
- $themesUpdates = true;
93
- $themesStatus = 'enabled';
94
- $themesIcon = 'yes-alt';
95
- $themesInterval = wp_get_schedule( 'wp_update_plugins' );
96
- $themesNext = date_i18n( $dateFormat, wp_next_scheduled( 'wp_update_plugins' ) );
97
- $themesText = __( 'Enabled', 'companion-auto-update' );
98
  } else {
99
- $themesUpdates = false;
100
- $themesStatus = 'disabled';
101
- $themesIcon = 'marker';
102
- $themesInterval = '&dash;';
103
- $themesNext = '&dash;';
104
- $themesText = __( 'Disabled', 'companion-auto-update' );
105
  }
106
 
107
  }
108
 
109
- // E-mail notifications
110
- if ( wp_next_scheduled ( 'cau_set_schedule_mail' ) ) {
111
-
112
- $emailCase = false;
113
-
114
- $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'send'");
115
- foreach ( $configs as $config ) {
116
- if( $config->onoroff == 'on' ) {
117
- $emailCase = true;
118
- }
119
- }
120
- $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'sendupdate'");
121
- foreach ( $configs as $config ) {
122
- if( $config->onoroff == 'on' ) {
123
- $emailCase = true;
124
- }
125
- }
126
-
127
- if( $emailCase ) {
128
- $setScheduleStatus = 'enabled';
129
- $setScheduleIcon = 'yes-alt';
130
- $setScheduleInterval = wp_get_schedule( 'cau_set_schedule_mail' );
131
- $setScheduleNext = date_i18n( $dateFormat, wp_next_scheduled( 'cau_set_schedule_mail' ) );
132
- $setScheduleText = __( 'Enabled', 'companion-auto-update' );
133
- } else {
134
- $setScheduleStatus = 'warning';
135
- $setScheduleIcon = 'marker';
136
- $setScheduleInterval = '&dash;';
137
- $setScheduleNext = '&dash;';
138
- $setScheduleText = __( 'Disabled', 'companion-auto-update' );
139
- }
140
-
141
- } else {
142
- $setScheduleStatus = 'disabled';
143
- $setScheduleIcon = 'dismiss';
144
- $setScheduleInterval = '&dash;';
145
- $setScheduleNext = '&dash;';
146
- $setScheduleText = __( 'Error', 'companion-auto-update' );
147
- }
148
-
149
- // Core notifcations
150
- $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'wpemails'");
151
- foreach ( $configs as $config ) {
152
- if( $config->onoroff == 'on' ) {
153
- $setCoreStatus = 'enabled';
154
- $setCoreIcon = 'yes-alt';
155
- $setCoreInterval = wp_get_schedule( 'cau_set_schedule_mail' );
156
- $setCoreNext = date_i18n( $dateFormat, wp_next_scheduled( 'cau_set_schedule_mail' ) );
157
- $setCoreText = __( 'Enabled', 'companion-auto-update' );
158
- } else {
159
- $setCoreStatus = 'warning';
160
- $setCoreIcon = 'marker';
161
- $setCoreInterval = '&dash;';
162
- $setCoreNext = '&dash;';
163
- $setCoreText = __( 'Disabled', 'companion-auto-update' );
164
- }
165
- }
166
-
167
- $schedules = wp_get_schedules();
168
-
169
- $support = wp_http_supports( array( 'ssl' ) );
170
- switch ($support) {
171
- case '1':
172
- $wpORGStatus = 'enabled';
173
- $wpORGIcon = 'yes-alt';
174
- $wpORGText = __( 'Enabled', 'companion-auto-update' );;
175
- break;
176
- default:
177
- $wpORGStatus = 'disabled';
178
- $wpORGIcon = 'no';
179
- $wpORGText = __( 'Disabled', 'companion-auto-update' );;
180
- break;
181
- }
182
 
 
 
 
 
 
 
 
183
 
184
  ?>
185
 
186
- <h2><?php _e('Status', 'companion-auto-update'); ?></h2>
187
-
188
  <div class="cau_status_page">
189
 
190
- <div id="message" class="cau">
191
- <strong>Got a moment?</strong> &dash; <a href="https://forms.gle/FbnokrbdLFhVHgDZA" target="_blank" class="tell_me_more">Please answer a few questions about the future of the status page in this plugin.</a>
192
- </div>
193
-
194
- <table class="cau_status_list widefat striped">
195
-
196
- <thead>
197
- <tr>
198
- <th width="300" class="cau_status_name"><strong><?php _e( 'Auto Updater', 'companion-auto-update' ); ?></strong></th>
199
- <th class="cau_status_active_state"><strong><?php _e( 'Status', 'companion-auto-update' ); ?></strong></th>
200
- <th class="cau_status_interval"><strong><?php _e( 'Interval', 'companion-auto-update' ); ?></strong></th>
201
- <th class="cau_status_next"><strong><?php _e( 'Next', 'companion-auto-update' ); ?></strong></th>
202
- </tr>
203
- </thead>
204
-
205
- <tbody id="the-list">
206
- <tr>
207
- <td class="cau_status_name"><?php _e( 'Plugins', 'companion-auto-update' ); ?></td>
208
- <td class="cau_status_active_state"><span class='cau_<?php echo $pluginsStatus; ?>'><span class="dashicons dashicons-<?php echo $pluginsIcon; ?>"></span> <?php echo $pluginsText; ?></span></td>
209
- <td class="cau_status_interval"><?php echo $schedules[$pluginsInterval]['display']; ?></td>
210
- <td class="cau_status_next"><span class="cau_mobile_prefix"><?php _e( 'Next', 'companion-auto-update' ); ?>: </span><?php echo $pluginsNext; ?></td>
211
- </tr>
212
- <tr>
213
- <td class="cau_status_name"><?php _e( 'Themes', 'companion-auto-update' ); ?></td>
214
- <td class="cau_status_active_state"><span class='cau_<?php echo $themesStatus; ?>'><span class="dashicons dashicons-<?php echo $themesIcon; ?>"></span> <?php echo $themesText; ?></span></td>
215
- <td class="cau_status_interval"><?php echo $schedules[$themesInterval]['display']; ?></td>
216
- <td class="cau_status_next"><span class="cau_mobile_prefix"><?php _e( 'Next', 'companion-auto-update' ); ?>: </span><?php echo $themesNext; ?></td>
217
- </tr>
218
- <tr>
219
- <td class="cau_status_name"><?php _e( 'Core (Minor)', 'companion-auto-update' ); ?></td>
220
- <td class="cau_status_active_state"><span class='cau_<?php echo $minorStatus; ?>'><span class="dashicons dashicons-<?php echo $minorIcon; ?>"></span> <?php echo $minorText; ?></span></td>
221
- <td class="cau_status_interval"><?php echo $schedules[$minorInterval]['display']; ?></td>
222
- <td class="cau_status_next"><span class="cau_mobile_prefix"><?php _e( 'Next', 'companion-auto-update' ); ?>: </span><?php echo $minorNext; ?></td>
223
- </tr>
224
- <tr>
225
- <td class="cau_status_name"><?php _e( 'Core (Major)', 'companion-auto-update' ); ?></td>
226
- <td class="cau_status_active_state"><span class='cau_<?php echo $majorStatus; ?>'><span class="dashicons dashicons-<?php echo $majorIcon; ?>"></span> <?php echo $majorText; ?></span></td>
227
- <td class="cau_status_interval"><?php echo $schedules[$majorInterval]['display']; ?></td>
228
- <td class="cau_status_next"><span class="cau_mobile_prefix"><?php _e( 'Next', 'companion-auto-update' ); ?>: </span><?php echo $majorNext; ?></td>
229
- </tr>
230
- </tbody>
231
-
232
- </table>
233
-
234
- <table class="cau_status_list widefat striped">
235
-
236
- <thead>
237
- <tr>
238
- <th width="300" class="cau_status_name"><strong><?php _e( 'Email Notifications', 'companion-auto-update' ); ?></strong></th>
239
- <th class="cau_status_active_state"><strong><?php _e( 'Status', 'companion-auto-update' ); ?></strong></th>
240
- <th class="cau_status_interval"><strong><?php _e( 'Interval', 'companion-auto-update' ); ?></strong></th>
241
- <th class="cau_status_next"><strong><?php _e( 'Next', 'companion-auto-update' ); ?></strong></th>
242
- </tr>
243
- </thead>
244
-
245
- <tbody id="the-list">
246
- <tr>
247
- <td class="cau_status_name"><?php _e( 'Email Notifications', 'companion-auto-update' ); ?></td>
248
- <td class="cau_status_active_state"><span class='cau_<?php echo $setScheduleStatus; ?>'><span class="dashicons dashicons-<?php echo $setScheduleIcon; ?>"></span> <?php echo $setScheduleText; ?></span></td>
249
- <td class="cau_status_interval"><?php echo $schedules[$setScheduleInterval]['display']; ?></td>
250
- <td class="cau_status_next"><span class="cau_mobile_prefix"><?php _e( 'Next', 'companion-auto-update' ); ?>: </span><?php echo $setScheduleNext; ?></td>
251
- </tr>
252
- <tr>
253
- <td class="cau_status_name"><?php _e( 'Core notifications', 'companion-auto-update' ); ?></td>
254
- <td class="cau_status_active_state"><span class='cau_<?php echo $setCoreStatus; ?>'><span class="dashicons dashicons-<?php echo $setCoreIcon; ?>"></span> <?php echo $setCoreText; ?></span></td>
255
- <td class="cau_status_interval"><?php echo $schedules[$setCoreInterval]['display']; ?></td>
256
- <td class="cau_status_next"><span class="cau_mobile_prefix"><?php _e( 'Next', 'companion-auto-update' ); ?>: </span><?php echo $setCoreNext; ?></td>
257
- </tr>
258
- </tbody>
259
-
260
- </table>
261
-
262
- <table class="cau_status_list widefat striped cau_status_warnings">
263
-
264
- <thead>
265
- <tr>
266
- <th class="cau_plugin_issue_name" colspan="4"><strong><?php _e( 'Status' ); ?></strong></th>
267
- </tr>
268
- </thead>
269
-
270
- <tbody id="the-list">
271
-
272
- <tr>
273
- <td width="300"><?php _e( 'Connection with WordPress.org', 'companion-auto-update' ); ?></td>
274
- <td class="cau_status_active_state"><span class='cau_<?php echo $wpORGStatus; ?>'><span class="dashicons dashicons-<?php echo $wpORGIcon; ?>"></span> <?php echo $wpORGText; ?></span></td>
275
- <td></td>
276
- <td></td>
277
- </tr>
278
-
279
- <tr>
280
- <td><?php _e( 'Search Engine Visibility', 'companion-auto-update' ); ?></td>
281
- <?php if( get_option( 'blog_public' ) == 0 ) { ?>
282
- <td class="cau_status_active_state"><span class='cau_disabled'><span class="dashicons dashicons-warning"></span> <?php _e( 'Disabled', 'companion-auto-update' ); ?></span></td>
283
- <td><?php _e( 'You’ve chosen to disscourage Search Engines from indexing your site. Auto-updating works best on sites with more traffic, consider enabling indexing for your site.', 'companion-auto-update' ); ?></td>
284
- <td><a href="<?php echo admin_url( 'options-reading.php' ); ?>" class="button button-alt"><?php _e( 'Fix it', 'companion-auto-update' ); ?></a></td>
285
- <?php } else { ?>
286
- <td class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'Enabled', 'companion-auto-update' ); ?></span></td>
287
- <td></td>
288
- <td></td>
289
- <?php } ?>
290
- </tr>
291
-
292
- <tr>
293
- <td><?php _e( 'Cronjobs', 'companion-auto-update' ); ?></td>
294
- <?php if( checkCronjobsDisabled() ) { ?>
295
- <td class="cau_status_active_state"><span class='cau_disabled'><span class="dashicons dashicons-warning"></span> <?php _e( 'Disabled', 'companion-auto-update' ); ?></span></td>
296
- <td><code>DISABLE_WP_CRON true</code></td>
297
- <td><a href="https://codeermeneer.nl/contact/" class="button"><?php _e( 'Contact for support', 'companion-auto-update' ); ?></a></td>
298
- <?php } else { ?>
299
- <td class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'Enabled', 'companion-auto-update' ); ?></span></td>
300
- <td></td>
301
- <td></td>
302
- <?php } ?>
303
- </tr>
304
-
305
- <tr>
306
- <td>wp_version_check</td>
307
- <?php if ( !has_filter( 'wp_version_check', 'wp_version_check' ) ) { ?>
308
- <td class="cau_status_active_state"><span class='cau_disabled'><span class="dashicons dashicons-no"></span> <?php _e( 'Disabled', 'companion-auto-update' ); ?></span></td>
309
- <td><?php sprintf( __( 'A plugin has prevented updates by disabling <code>%s</code>.', 'companion-auto-update' ), 'wp_version_check()' ); ?></td>
310
- <td><a href="https://codeermeneer.nl/contact/" class="button"><?php _e( 'Contact for support', 'companion-auto-update' ); ?></a></td>
311
- <?php } else { ?>
312
- <td class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'No issues detected' , 'companion-auto-update' ); ?></span></td>
313
- <td></td>
314
- <td></td>
315
- <?php } ?>
316
- </tr>
317
-
318
- <tr>
319
- <td><?php _e( 'Auto updates', 'companion-auto-update' ); ?></td>
320
- <?php if ( checkAutomaticUpdaterDisabled() ) { ?>
321
- <td class="cau_status_active_state"><span class='cau_disabled'><span class="dashicons dashicons-no"></span> <?php _e( 'Disabled', 'companion-auto-update' ); ?></span></td>
322
- <td><?php _e( 'Updating is globally disabled.', 'companion-auto-update' ); ?></td>
323
- <td>
324
- <form method="POST">
325
- <?php wp_nonce_field( 'cau_fixit' ); ?>
326
- <button type="submit" name="fixit" class="button button-primary"><?php _e( 'Fix it', 'companion-auto-update' ); ?></button>
327
- <a href="https://codeermeneer.nl/contact/" class="button"><?php _e( 'Contact for support', 'companion-auto-update' ); ?></a>
328
- </form>
329
- </td>
330
- <?php } else { ?>
331
- <td class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'Enabled', 'companion-auto-update' ); ?></span></td>
332
- <td></td>
333
- <td></td>
334
- <?php } ?>
335
- </tr>
336
-
337
- <tr>
338
- <td>VCS</td>
339
- <td class="cau_status_active_state"><span class='cau_<?php echo cau_test_is_vcs_checkout( ABSPATH )['status']; ?>'><span class="dashicons dashicons-<?php echo cau_test_is_vcs_checkout( ABSPATH )['icon']; ?>"></span> <?php echo cau_test_is_vcs_checkout( ABSPATH )['description']; ?></span></td>
340
- <td></td>
341
- <td></td>
342
- </tr>
343
-
344
- </tbody>
345
-
346
- </table>
347
-
348
- <?php
349
-
350
- // Remove the line
351
- if( isset( $_POST['fixit'] ) ) {
352
- check_admin_referer( 'cau_fixit' );
353
- cau_removeErrorLine();
354
- echo "<div id='message' class='updated'><p><strong>".__( 'Error fixed', 'companion-auto-update' )."</strong></p></div>";
355
- }
356
 
357
- // Get wp-config location
358
- function cau_configFile() {
 
 
 
 
 
 
359
 
360
- // Config file
361
- if ( file_exists( ABSPATH . 'wp-config.php') ) {
362
- $conFile = ABSPATH . 'wp-config.php';
363
- } else {
364
- $conFile = dirname(ABSPATH) . '/wp-config.php';
365
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
 
367
- return $conFile;
368
 
369
- }
 
 
 
 
 
 
370
 
371
- // Change the AUTOMATIC_UPDATER_DISABLED line
372
- function cau_removeErrorLine() {
373
 
374
- // Config file
375
- $conFile = cau_configFile();
376
 
377
- // Lines to check and replace
378
- $revLine = "define('AUTOMATIC_UPDATER_DISABLED', false);"; // We could just remove the line, but replacing it will be safer
379
- $posibleLines = array( "define( 'AUTOMATIC_UPDATER_DISABLED', true );", "define( 'AUTOMATIC_UPDATER_DISABLED', minor );" ); // The two base options
380
- foreach ( $posibleLines as $value ) array_push( $posibleLines, strtolower( $value ) ); // Support lowercase variants
381
- foreach ( $posibleLines as $value ) array_push( $posibleLines, str_replace( ' ', '', $value ) ); // For variants without spaces
382
 
383
- // Check for each string if it exists
384
- foreach ( $posibleLines as $key => $string ) {
 
 
 
 
 
 
385
 
386
- if( strpos( file_get_contents( $conFile ), $string ) !== false) {
387
- $contents = file_get_contents( $conFile );
388
- $contents = str_replace( $string, $revLine, $contents );
389
- file_put_contents( $conFile, $contents );
390
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
 
392
- }
393
 
394
- }
 
 
 
 
 
 
395
 
396
- // If has incomptable plugins
397
- if( cau_incompatiblePlugins() ) { ?>
398
 
399
- <p>&nbsp;</p>
400
- <h2 style="margin-bottom: 3px"><?php _e('Possible plugin issues', 'companion-auto-update'); ?></h2>
401
- <span class='cau_disabled'><?php _e("You're using one or more plugins that <i>might</i> cause issues.", "companion-auto-update"); ?></span>
402
 
403
  <table class="cau_status_list widefat striped cau_status_warnings">
404
 
405
  <thead>
406
  <tr>
407
- <th class="cau_plugin_issue_name"><strong><?php _e( 'Name', 'companion-auto-update' ); ?></strong></th>
408
- <th class="cau_plugin_issue_explain"><strong><?php _e( 'Possible issue', 'companion-auto-update' ); ?></strong></th>
409
- <th class="cau_plugin_issue_fixit"><strong><?php _e( 'How to fix', 'companion-auto-update' ); ?></strong></th>
410
  </tr>
411
  </thead>
412
 
413
  <tbody id="the-list">
414
- <?php
415
- foreach ( cau_incompatiblePluginlist() as $key => $value ) {
416
- if( is_plugin_active( $key ) ) {
417
-
418
- echo '<tr>
419
- <td class="cau_plugin_issue_name">'.$key.'</td>
420
- <td class="cau_plugin_issue_explain">'.$value.'</td>
421
- <td class="cau_plugin_issue_fixit"><a href="https://codeermeneer.nl/documentation/known-issues-fixes/#plugins" target="_blank" class="button">'.__( 'How to fix', 'companion-auto-update' ).'</a></td>
422
- </tr>';
423
-
424
- }
425
- }
426
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
427
  </tbody>
428
 
429
  </table>
430
 
431
- <?php } ?>
432
-
433
  <table class="autoupdate cau_status_list widefat striped cau_status_warnings">
434
 
435
  <thead>
436
  <tr>
437
- <th colspan="2"><strong><?php _e( 'Systeminfo', 'companion-auto-update' ); ?></strong></th>
438
  </tr>
439
  </thead>
440
 
441
  <tbody id="the-list">
442
  <tr>
443
- <td width="300">WordPress</td>
444
  <td><?php echo get_bloginfo( 'version' ); ?></td>
 
 
445
  </tr>
446
  <tr>
447
  <td>PHP</td>
448
  <td><?php echo phpversion(); ?></td>
 
 
449
  </tr>
450
  <tr <?php if( cau_incorrectDatabaseVersion() ) { echo "class='inactive'"; } ?>>
451
  <td>Database</td>
452
  <td><?php echo get_option( "cau_db_version" ); ?> <code>(Latest: <?php echo cau_db_version(); ?>)</code></td>
 
 
453
  </tr>
454
  <tr>
455
  <td class="cau_status_name"><?php _e( 'Timezone' ); ?></td>
456
  <td class="cau_status_active_state"><?php echo cau_get_proper_timezone(); ?> (GMT <?php echo get_option('gmt_offset'); ?>) - <?php echo date_default_timezone_get(); ?></td>
 
 
457
  </tr>
458
  </tbody>
459
 
460
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
 
462
  <table class="autoupdate cau_status_list widefat striped cau_status_warnings">
463
 
@@ -476,10 +329,13 @@ if( cau_incompatiblePlugins() ) { ?>
476
  global $wpdb;
477
  $autoupdates = $wpdb->prefix."auto_updates";
478
  $cau_configs = $wpdb->get_results( "SELECT * FROM $autoupdates" );
 
 
 
479
 
480
- echo "<pre>";
481
  print_r( $cau_configs );
482
- echo "</pre>";
483
  ?>
484
  </div>
485
  </td>
@@ -487,6 +343,62 @@ if( cau_incompatiblePlugins() ) { ?>
487
  </tbody>
488
  </table>
489
 
 
 
490
  </div>
491
 
492
- <script>jQuery( '.toggle_advanced_button' ).click( function() { jQuery( '.toggle_advanced_content' ).toggle(); });</script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  cau_savePluginInformation();
11
  echo '<div id="message" class="updated"><p><b>'.__( 'Database information update completed' ).'</b></p></div>';
12
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ if( isset( $_GET['ignore_report'] ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
+ $report_to_ignore = sanitize_text_field( $_GET['ignore_report'] );
17
+ $allowedValues = array( 'seo', 'cron' );
18
 
19
+ if( !in_array( $report_to_ignore, $allowedValues ) ) {
20
+ wp_die( 'Trying to cheat eh?' );
 
 
 
 
 
 
 
 
 
21
  } else {
22
+ global $wpdb;
23
+ $table_name = $wpdb->prefix . "auto_updates";
24
+ $wpdb->query( $wpdb->prepare( "UPDATE {$table_name} SET onoroff = %s WHERE name = 'ignore_$report_to_ignore'", 'yes' ) );
25
+ $__ignored = __( 'This report will now be ignored', 'companion-auto-update' );
26
+ echo "<div id='message' class='updated'><p><b>$__ignored</b></p></div>";
 
27
  }
28
 
29
  }
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
+
33
+ // Variables
34
+ $dateFormat = get_option( 'date_format' );
35
+ $dateFormat .= ' '.get_option( 'time_format' );
36
+ global $wpdb;
37
+ $table_name = $wpdb->prefix . "auto_updates";
38
+ $schedules = wp_get_schedules();
39
 
40
  ?>
41
 
 
 
42
  <div class="cau_status_page">
43
 
44
+ <table class="cau_status_list widefat striped">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
+ <thead>
47
+ <tr>
48
+ <th class="cau_status_name"><strong><?php _e( 'Auto Updater', 'companion-auto-update' ); ?></strong></th>
49
+ <th class="cau_status_active_state"><strong><?php _e( 'Status', 'companion-auto-update' ); ?></strong></th>
50
+ <th class="cau_status_interval"><strong><?php _e( 'Interval', 'companion-auto-update' ); ?></strong></th>
51
+ <th class="cau_status_next"><strong><?php _e( 'Next', 'companion-auto-update' ); ?></strong></th>
52
+ </tr>
53
+ </thead>
54
 
55
+ <tbody id="the-list">
56
+ <?php
57
+
58
+ $auto_updaters = array(
59
+ 'plugins' => __( 'Plugins', 'companion-auto-update' ),
60
+ 'themes' => __( 'Themes', 'companion-auto-update' ),
61
+ 'minor' => __( 'Core (Minor)', 'companion-auto-update' ),
62
+ 'major' => __( 'Core (Major)', 'companion-auto-update' )
63
+ );
64
+
65
+ $eventNames = array(
66
+ 'plugins' => 'wp_update_plugins',
67
+ 'themes' => 'wp_update_themes',
68
+ 'minor' => 'wp_version_check',
69
+ 'major' => 'wp_version_check'
70
+ );
71
+
72
+ foreach ( $auto_updaters as $key => $value ) {
73
+
74
+ if( cau_get_db_value( $key ) == 'on' ) {
75
+ $__status = 'enabled';
76
+ $__icon = 'yes-alt';
77
+ $__text = __( 'Enabled', 'companion-auto-update' );
78
+ $__interval = wp_get_schedule( $eventNames[$key] );
79
+ $__next = date_i18n( $dateFormat, wp_next_scheduled( $eventNames[$key] ) );
80
+ } else {
81
+ $__status = 'disabled';
82
+ $__icon = 'marker';
83
+ $__text = __( 'Disabled', 'companion-auto-update' );
84
+ $__interval = '&dash;';
85
+ $__next = '&dash;';
86
+ }
87
 
88
+ $__nxt = __( 'Next', 'companion-auto-update' );
89
 
90
+ echo "<tr>
91
+ <td class='cau_status_name'>$value</td>
92
+ <td class='cau_status_active_state'><span class='cau_$__status'><span class='dashicons dashicons-$__icon'></span> $__text</span></td>
93
+ <td class='cau_status_interval'>$__interval</td>
94
+ <td class='cau_status_next'><span class='cau_mobile_prefix'>$__nxt: </span>$__next</td>
95
+ </tr>";
96
+ }
97
 
98
+ ?>
99
+ </tbody>
100
 
101
+ </table>
 
102
 
103
+ <table class="cau_status_list widefat striped">
 
 
 
 
104
 
105
+ <thead>
106
+ <tr>
107
+ <th class="cau_status_name"><strong><?php _e( 'Email Notifications', 'companion-auto-update' ); ?></strong></th>
108
+ <th class="cau_status_active_state"><strong><?php _e( 'Status', 'companion-auto-update' ); ?></strong></th>
109
+ <th class="cau_status_interval"><strong><?php _e( 'Interval', 'companion-auto-update' ); ?></strong></th>
110
+ <th class="cau_status_next"><strong><?php _e( 'Next', 'companion-auto-update' ); ?></strong></th>
111
+ </tr>
112
+ </thead>
113
 
114
+ <tbody id="the-list">
115
+ <?php
116
+
117
+ $other_events = array(
118
+ 'send' => __( 'Update available', 'companion-auto-update' ),
119
+ 'sendupdate' => __( 'Successful update', 'companion-auto-update' ),
120
+ 'wpemails' => __( 'Core notifications', 'companion-auto-update' )
121
+ );
122
+
123
+ $other_eventNames = array(
124
+ 'send' => 'cau_set_schedule_mail',
125
+ 'sendupdate' => 'cau_set_schedule_mail',
126
+ 'wpemails' => 'cau_set_schedule_mail',
127
+ );
128
+
129
+ foreach ( $other_events as $key => $value ) {
130
+
131
+ if( cau_get_db_value( $key ) == 'on' ) {
132
+ $__status = 'enabled';
133
+ $__icon = 'yes-alt';
134
+ $__text = __( 'Enabled', 'companion-auto-update' );
135
+ $__interval = wp_get_schedule( $other_eventNames[$key] );
136
+ $__next = date_i18n( $dateFormat, wp_next_scheduled( $other_eventNames[$key] ) );
137
+ } else {
138
+ $__status = 'warning';
139
+ $__icon = 'marker';
140
+ $__text = __( 'Disabled', 'companion-auto-update' );
141
+ $__interval = '&dash;';
142
+ $__next = '&dash;';
143
+ }
144
 
145
+ $__nxt = __( 'Next', 'companion-auto-update' );
146
 
147
+ echo "<tr>
148
+ <td class='cau_status_name'>$value</td>
149
+ <td class='cau_status_active_state'><span class='cau_$__status'><span class='dashicons dashicons-$__icon'></span> $__text</span></td>
150
+ <td class='cau_status_interval'>$__interval</td>
151
+ <td class='cau_status_next'><span class='cau_mobile_prefix'>$__nxt: </span>$__next</td>
152
+ </tr>";
153
+ }
154
 
155
+ ?>
156
+ </tbody>
157
 
158
+ </table>
 
 
159
 
160
  <table class="cau_status_list widefat striped cau_status_warnings">
161
 
162
  <thead>
163
  <tr>
164
+ <th class="cau_plugin_issue_name" colspan="4"><strong><?php _e( 'Status' ); ?></strong></th>
 
 
165
  </tr>
166
  </thead>
167
 
168
  <tbody id="the-list">
169
+
170
+ <tr>
171
+ <td><?php _e( 'Auto updates', 'companion-auto-update' ); ?></td>
172
+ <?php if ( checkAutomaticUpdaterDisabled() ) { ?>
173
+ <td class="cau_status_active_state"><span class='cau_disabled'><span class="dashicons dashicons-no"></span> <?php _e( 'All automatic updates are disabled', 'companion-auto-update' ); ?></span></td>
174
+ <td>
175
+ <form method="POST">
176
+ <?php wp_nonce_field( 'cau_fixit' ); ?>
177
+ <button type="submit" name="fixit" class="button button-primary"><?php _e( 'Fix it', 'companion-auto-update' ); ?></button>
178
+ <a href="https://codeermeneer.nl/documentation/known-issues-fixes/#updates_disabled" target="_blank" class="button"><?php _e( 'How to fix this', 'companion-auto-update' ); ?></a>
179
+ </form>
180
+ </td>
181
+ <?php } else { ?>
182
+ <td class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'No issues detected', 'companion-auto-update' ); ?></span></td>
183
+ <td></td>
184
+ <?php } ?>
185
+ <td></td>
186
+ </tr>
187
+
188
+ <tr>
189
+ <td><?php _e( 'Connection with WordPress.org', 'companion-auto-update' ); ?></td>
190
+ <?php if( wp_http_supports( array( 'ssl' ) ) == '1' ) {
191
+ $__text = __( 'No issues detected', 'companion-auto-update' );
192
+ echo "<td colspan='3' class='cau_status_active_state'><span class='cau_enabled'><span class='dashicons dashicons-yes-alt'></span> $__text</span></td>";
193
+ } else {
194
+ $__text = __( 'Disabled', 'companion-auto-update' );
195
+ echo "<td colspan='3' class='cau_status_active_state'><span class='cau_disabled'><span class='dashicons dashicons-no'></span> $__text</span></td>";
196
+ } ?>
197
+ </tr>
198
+
199
+ <tr <?php if( cau_get_db_value( 'ignore_seo' ) == 'yes' ) { echo "class='report_hidden'"; } ?> >
200
+ <td><?php _e( 'Search Engine Visibility', 'companion-auto-update' ); ?></td>
201
+ <?php if( get_option( 'blog_public' ) == 0 ) { ?>
202
+ <td colspan="2" class="cau_status_active_state">
203
+ <span class='cau_warning'><span class="dashicons dashicons-warning"></span></span>
204
+ <?php _e( 'You’ve chosen to discourage Search Engines from indexing your site. Auto-updating works best on sites with more traffic, consider enabling indexing for your site.', 'companion-auto-update' ); ?>
205
+ </td>
206
+ <td>
207
+ <a href="<?php echo admin_url( 'options-reading.php' ); ?>" class="button"><?php _e( 'Fix it', 'companion-auto-update' ); ?></a>
208
+ <a href="<?php echo cau_url( 'status' ); ?>&ignore_report=seo" class="button button-alt"><?php _e( 'Ignore this report', 'companion-auto-update' ); ?></a>
209
+ </td>
210
+ <?php } else { ?>
211
+ <td colspan="3" class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'No issues detected', 'companion-auto-update' ); ?></span></td>
212
+ <?php } ?>
213
+ </tr>
214
+
215
+ <tr <?php if( cau_get_db_value( 'ignore_cron' ) == 'yes' ) { echo "class='report_hidden'"; } ?> >
216
+ <td><?php _e( 'Cronjobs', 'companion-auto-update' ); ?></td>
217
+ <?php if( checkCronjobsDisabled() ) { ?>
218
+ <td class="cau_status_active_state"><span class='cau_warning'><span class="dashicons dashicons-warning"></span> <?php _e( 'Disabled', 'companion-auto-update' ); ?></span></td>
219
+ <td><code>DISABLE_WP_CRON true</code></td>
220
+ <td>
221
+ <a href="https://codeermeneer.nl/contact/" class="button"><?php _e( 'Contact for support', 'companion-auto-update' ); ?></a>
222
+ <a href="<?php echo cau_url( 'status' ); ?>&ignore_report=cron" class="button button-alt"><?php _e( 'Ignore this report', 'companion-auto-update' ); ?></a>
223
+ </td>
224
+ <?php } else { ?>
225
+ <td colspan="3" class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'No issues detected', 'companion-auto-update' ); ?></span></td>
226
+ <?php } ?>
227
+ </tr>
228
+
229
+ <tr>
230
+ <td>wp_version_check</td>
231
+ <?php if ( !has_filter( 'wp_version_check', 'wp_version_check' ) ) { ?>
232
+ <td colspan="2" class="cau_status_active_state"><span class='cau_disabled'><span class="dashicons dashicons-no"></span> <?php _e( 'A plugin has prevented updates by disabling wp_version_check', 'companion-auto-update' ); ?></span></td>
233
+ <td><a href="https://codeermeneer.nl/contact/" class="button"><?php _e( 'Contact for support', 'companion-auto-update' ); ?></a></td>
234
+ <?php } else { ?>
235
+ <td colspan="3" class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'No issues detected' , 'companion-auto-update' ); ?></span></td>
236
+ <?php } ?>
237
+ </tr>
238
+
239
+ <tr>
240
+ <td>VCS</td>
241
+ <td colspan="3" class="cau_status_active_state"><span class='cau_<?php echo cau_test_is_vcs_checkout( ABSPATH )['status']; ?>'><span class="dashicons dashicons-<?php echo cau_test_is_vcs_checkout( ABSPATH )['icon']; ?>"></span> <?php echo cau_test_is_vcs_checkout( ABSPATH )['description']; ?></span></td>
242
+ </tr>
243
+
244
  </tbody>
245
 
246
  </table>
247
 
 
 
248
  <table class="autoupdate cau_status_list widefat striped cau_status_warnings">
249
 
250
  <thead>
251
  <tr>
252
+ <th colspan="4"><strong><?php _e( 'Systeminfo', 'companion-auto-update' ); ?></strong></th>
253
  </tr>
254
  </thead>
255
 
256
  <tbody id="the-list">
257
  <tr>
258
+ <td>WordPress</td>
259
  <td><?php echo get_bloginfo( 'version' ); ?></td>
260
+ <td></td>
261
+ <td></td>
262
  </tr>
263
  <tr>
264
  <td>PHP</td>
265
  <td><?php echo phpversion(); ?></td>
266
+ <td></td>
267
+ <td></td>
268
  </tr>
269
  <tr <?php if( cau_incorrectDatabaseVersion() ) { echo "class='inactive'"; } ?>>
270
  <td>Database</td>
271
  <td><?php echo get_option( "cau_db_version" ); ?> <code>(Latest: <?php echo cau_db_version(); ?>)</code></td>
272
+ <td></td>
273
+ <td></td>
274
  </tr>
275
  <tr>
276
  <td class="cau_status_name"><?php _e( 'Timezone' ); ?></td>
277
  <td class="cau_status_active_state"><?php echo cau_get_proper_timezone(); ?> (GMT <?php echo get_option('gmt_offset'); ?>) - <?php echo date_default_timezone_get(); ?></td>
278
+ <td></td>
279
+ <td></td>
280
  </tr>
281
  </tbody>
282
 
283
  </table>
284
+
285
+ <?php
286
+ // If has incomptable plugins
287
+ if( cau_incompatiblePlugins() ) { ?>
288
+
289
+ <table class="cau_status_list no_column_width widefat striped cau_status_warnings">
290
+
291
+ <thead>
292
+ <tr>
293
+ <th class="cau_plugin_issue_name" colspan="4"><strong><?php _e( 'Possible plugin issues', 'companion-auto-update' ); ?></strong></th>
294
+ </tr>
295
+ </thead>
296
+
297
+ <tbody id="the-list">
298
+ <?php
299
+ foreach ( cau_incompatiblePluginlist() as $key => $value ) {
300
+ if( is_plugin_active( $key ) ) {
301
+ echo '<tr>
302
+ <td class="cau_plugin_issue_name"><strong>'.$key.'</strong></td>
303
+ <td colspan="2" class="cau_plugin_issue_explain">'.$value.'</td>
304
+ <td class="cau_plugin_issue_fixit"><a href="https://codeermeneer.nl/documentation/known-issues-fixes/#plugins" target="_blank" class="button">'.__( 'How to fix this', 'companion-auto-update' ).'</a></td>
305
+ </tr>';
306
+ }
307
+ }
308
+ ?>
309
+ </tbody>
310
+
311
+ </table>
312
+
313
+ <?php } ?>
314
 
315
  <table class="autoupdate cau_status_list widefat striped cau_status_warnings">
316
 
329
  global $wpdb;
330
  $autoupdates = $wpdb->prefix."auto_updates";
331
  $cau_configs = $wpdb->get_results( "SELECT * FROM $autoupdates" );
332
+ array_push( $cau_configs, "WordPress: ".get_bloginfo( 'version' ) );
333
+ array_push( $cau_configs, "PHP: ".phpversion() );
334
+ array_push( $cau_configs, "DB: ".get_option( "cau_db_version" ).' / '.cau_db_version() );
335
 
336
+ echo "<textarea style='width: 100%; height: 750px;'>";
337
  print_r( $cau_configs );
338
+ echo "</textarea>";
339
  ?>
340
  </div>
341
  </td>
343
  </tbody>
344
  </table>
345
 
346
+ <script>jQuery( '.toggle_advanced_button' ).click( function() { jQuery( '.toggle_advanced_content' ).toggle(); });</script>
347
+
348
  </div>
349
 
350
+ <?php
351
+
352
+ // Remove the line
353
+ if( isset( $_POST['fixit'] ) ) {
354
+ check_admin_referer( 'cau_fixit' );
355
+ cau_removeErrorLine();
356
+ }
357
+
358
+ // Get wp-config location
359
+ function cau_configFile() {
360
+
361
+ // Config file
362
+ if ( file_exists( ABSPATH . 'wp-config.php') ) {
363
+ $conFile = ABSPATH . 'wp-config.php';
364
+ } else {
365
+ $conFile = dirname(ABSPATH) . '/wp-config.php';
366
+ }
367
+
368
+ return $conFile;
369
+
370
+ }
371
+
372
+ // Change the AUTOMATIC_UPDATER_DISABLED line
373
+ function cau_removeErrorLine() {
374
+
375
+ // Config file
376
+ $conFile = cau_configFile();
377
+
378
+ // Lines to check and replace
379
+ $revLine = "define('AUTOMATIC_UPDATER_DISABLED', false);"; // We could just remove the line, but replacing it will be safer
380
+ $posibleLines = array( "define( 'AUTOMATIC_UPDATER_DISABLED', true );", "define( 'AUTOMATIC_UPDATER_DISABLED', minor );" ); // The two base options
381
+ foreach ( $posibleLines as $value ) array_push( $posibleLines, strtolower( $value ) ); // Support lowercase variants
382
+ foreach ( $posibleLines as $value ) array_push( $posibleLines, str_replace( ' ', '', $value ) ); // For variants without spaces
383
+
384
+ $melding = __( "We couldn't fix the error for you. Please contact us for further support", 'companion-auto-update' ).'.';
385
+ $meldingS = 'error';
386
+
387
+ // Check for each string if it exists
388
+ foreach ( $posibleLines as $key => $string ) {
389
+
390
+ if( strpos( file_get_contents( $conFile ), $string ) !== false) {
391
+ $contents = file_get_contents( $conFile );
392
+ $contents = str_replace( $string, $revLine, $contents );
393
+ file_put_contents( $conFile, $contents );
394
+ $melding = __( "We've fixed the error for you", 'companion-auto-update' ).' :)';
395
+ $meldingS = 'updated';
396
+ }
397
+
398
+ }
399
+
400
+ echo "<div id='message' class='$meldingS'><p><strong>$melding</strong></p></div>";
401
+
402
+ }
403
+
404
+ ?>
backend/images/settings.svg ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+
4
+ <svg
5
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+ xmlns:cc="http://creativecommons.org/ns#"
7
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8
+ xmlns:svg="http://www.w3.org/2000/svg"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+ version="1.1"
13
+ id="Layer_1"
14
+ x="0px"
15
+ y="0px"
16
+ viewBox="0 0 505 505"
17
+ style="enable-background:new 0 0 505 505;"
18
+ xml:space="preserve"
19
+ sodipodi:docname="settings.svg"
20
+ inkscape:version="0.92.0 r15299"><metadata
21
+ id="metadata43"><rdf:RDF><cc:Work
22
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
23
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
24
+ id="defs41" /><sodipodi:namedview
25
+ pagecolor="#ffffff"
26
+ bordercolor="#666666"
27
+ borderopacity="1"
28
+ objecttolerance="10"
29
+ gridtolerance="10"
30
+ guidetolerance="10"
31
+ inkscape:pageopacity="0"
32
+ inkscape:pageshadow="2"
33
+ inkscape:window-width="1920"
34
+ inkscape:window-height="1017"
35
+ id="namedview39"
36
+ showgrid="false"
37
+ inkscape:zoom="0.3304499"
38
+ inkscape:cx="-433.02666"
39
+ inkscape:cy="120.52743"
40
+ inkscape:window-x="-8"
41
+ inkscape:window-y="-8"
42
+ inkscape:window-maximized="1"
43
+ inkscape:current-layer="Layer_1" /><path
44
+ style="fill:#ded1f2;fill-opacity:1;stroke-width:1.194754"
45
+ d="m 54.471192,356.14658 c 0,-166.66819 135.007198,-301.675388 301.675388,-301.675388 166.5487,0 301.67538,135.007198 301.67538,301.675388 0,166.66817 -135.12668,301.67538 -301.67538,301.67538 -166.66819,0 -301.675388,-135.00721 -301.675388,-301.67538 z"
46
+ id="path2"
47
+ inkscape:connector-curvature="0" /><g
48
+ id="g8"
49
+ transform="scale(1.3026177)" /><g
50
+ id="g10"
51
+ transform="scale(1.3026177)" /><g
52
+ id="g12"
53
+ transform="scale(1.3026177)" /><g
54
+ id="g14"
55
+ transform="scale(1.3026177)" /><g
56
+ id="g16"
57
+ transform="scale(1.3026177)" /><g
58
+ id="g18"
59
+ transform="scale(1.3026177)" /><g
60
+ id="g20"
61
+ transform="scale(1.3026177)" /><g
62
+ id="g22"
63
+ transform="scale(1.3026177)" /><g
64
+ id="g24"
65
+ transform="scale(1.3026177)" /><g
66
+ id="g26"
67
+ transform="scale(1.3026177)" /><g
68
+ id="g28"
69
+ transform="scale(1.3026177)" /><g
70
+ id="g30"
71
+ transform="scale(1.3026177)" /><g
72
+ id="g32"
73
+ transform="scale(1.3026177)" /><g
74
+ id="g34"
75
+ transform="scale(1.3026177)" /><g
76
+ id="g36"
77
+ transform="scale(1.3026177)" /><g
78
+ transform="translate(107.14129,82.560247)"
79
+ id="g8-7"
80
+ style="fill:#90a4ae;fill-opacity:1" /><g
81
+ transform="translate(107.14129,82.560247)"
82
+ id="g48" /><g
83
+ transform="translate(107.14129,82.560247)"
84
+ id="g50" /><g
85
+ transform="translate(107.14129,82.560247)"
86
+ id="g52" /><g
87
+ transform="translate(107.14129,82.560247)"
88
+ id="g54" /><g
89
+ transform="translate(107.14129,82.560247)"
90
+ id="g56" /><g
91
+ transform="translate(107.14129,82.560247)"
92
+ id="g58" /><g
93
+ transform="translate(107.14129,82.560247)"
94
+ id="g60" /><g
95
+ transform="translate(107.14129,82.560247)"
96
+ id="g62" /><g
97
+ transform="translate(107.14129,82.560247)"
98
+ id="g64" /><g
99
+ transform="translate(107.14129,82.560247)"
100
+ id="g66" /><g
101
+ transform="translate(107.14129,82.560247)"
102
+ id="g68" /><g
103
+ transform="translate(107.14129,82.560247)"
104
+ id="g70" /><g
105
+ transform="translate(107.14129,82.560247)"
106
+ id="g72" /><g
107
+ transform="translate(107.14129,82.560247)"
108
+ id="g74" /><g
109
+ transform="translate(107.14129,82.560247)"
110
+ id="g76" /><path
111
+ inkscape:connector-curvature="0"
112
+ d="m 407.30702,633.58604 h -30.82827 c -24.93373,0 -45.22015,-20.28545 -45.22015,-45.21919 v -10.42958 c -10.60035,-3.38666 -20.89946,-7.66173 -30.79371,-12.78202 l -7.39118,7.39117 c -17.90135,17.92343 -46.57672,17.39768 -63.95808,-0.007 L 207.3268,550.75171 c -17.41207,-17.39287 -17.91288,-46.05864 0.006,-63.95809 l 7.38543,-7.38542 c -5.12029,-9.89424 -9.3944,-20.19143 -12.78202,-30.79371 h -10.42863 c -24.93276,0 -45.21918,-20.28546 -45.21918,-45.21918 v -30.82908 c 0,-24.93372 20.28642,-45.21919 45.22014,-45.21919 h 10.42862 c 3.38764,-10.60132 7.66174,-20.89946 12.78203,-30.79371 l -7.39118,-7.39022 c -17.90807,-17.88889 -17.41399,-46.55754 0.006,-63.95809 l 21.79075,-21.78979 c 17.42166,-17.44565 46.0903,-17.88122 63.95713,0.006 l 7.38447,7.38446 c 9.89423,-5.11933 20.19335,-9.3944 30.7937,-12.78202 v -10.42863 c 0,-24.93373 20.28546,-45.21918 45.22014,-45.21918 h 30.82827 c 24.93373,0 45.21919,20.28545 45.21919,45.21918 v 10.42958 c 10.60035,3.38667 20.89946,7.66174 30.7937,12.78203 l 7.39119,-7.39118 c 17.90135,-17.92343 46.57672,-17.39768 63.95809,0.007 l 21.78882,21.78787 c 17.41207,17.39289 17.91287,46.05866 -0.009,63.9581 l -7.38543,7.38542 c 5.12029,9.89425 9.3944,20.19143 12.78202,30.79371 h 10.42864 c 24.93372,0 45.22013,20.28546 45.22013,45.21919 v 30.8292 c 0,24.93373 -20.28641,45.21919 -45.22013,45.21919 h -10.42864 c -3.38762,10.60132 -7.66173,20.89946 -12.78202,30.7937 l 7.39119,7.39119 c 17.90806,17.88888 17.41397,46.55754 -0.009,63.95809 l -21.79074,21.78978 c -17.42166,17.44565 -46.09031,17.88122 -63.95713,-0.006 l -7.38447,-7.38447 c -9.89424,5.11933 -20.19335,9.3944 -30.7937,12.78202 v 10.42959 c 0,24.93181 -20.28546,45.21726 -45.22014,45.21726 z M 305.27626,534.93141 c 13.74525,8.12896 28.53914,14.27005 43.97005,18.2525 6.35504,1.63961 10.79512,7.37104 10.79512,13.93426 v 21.24868 c 0,9.06341 7.37486,16.43733 16.43827,16.43733 h 30.82828 c 9.0634,0 16.43827,-7.37392 16.43827,-16.43733 v -21.24868 c 0,-6.56322 4.44008,-12.29465 10.79512,-13.93426 15.43091,-3.98245 30.2248,-10.12354 43.97005,-18.2525 5.65564,-3.34445 12.8559,-2.43494 17.50224,2.21141 l 15.05101,15.05196 c 6.48934,6.49702 16.91029,6.34639 23.24039,0.007 l 21.80417,-21.80321 c 6.31474,-6.30707 6.5258,-16.72994 0.009,-23.24136 L 541.06052,492.0995 c -4.6454,-4.64538 -5.5549,-11.8466 -2.21141,-17.50128 8.12895,-13.7443 14.26908,-28.53818 18.25154,-43.97005 1.64057,-6.35504 7.37199,-10.79416 13.93425,-10.79416 h 21.24774 c 9.06341,0 16.43827,-7.37391 16.43827,-16.43732 v -30.82921 c 0,-9.06341 -7.37486,-16.43731 -16.43827,-16.43731 H 571.0349 c -6.56322,0 -12.29368,-4.44009 -13.93425,-10.79416 -3.98246,-15.43188 -10.12355,-30.22576 -18.25154,-43.97005 -3.34349,-5.65468 -2.43399,-12.8559 2.21141,-17.50129 l 15.05195,-15.05195 c 6.50661,-6.49895 6.3368,-16.91798 0.009,-23.24136 l -21.80131,-21.80239 c -6.31955,-6.32818 -16.74241,-6.51334 -23.24136,-0.006 l -15.05675,15.05771 c -4.64539,4.64634 -11.84853,5.55586 -17.50224,2.21141 -13.74526,-8.12897 -28.53914,-14.27005 -43.97006,-18.25251 -6.35502,-1.6396 -10.79512,-7.37103 -10.79512,-13.93426 v -21.2506 c 0,-9.06341 -7.37486,-16.43733 -16.43827,-16.43733 h -30.82827 c -9.06341,0 -16.43828,7.37392 -16.43828,16.43733 v 21.24868 c 0,6.56323 -4.44008,12.29467 -10.79512,13.93427 -15.43091,3.98245 -30.22479,10.12354 -43.97004,18.2525 -5.6566,3.34348 -12.85686,2.43398 -17.50225,-2.21141 L 272.73141,223.7668 c -6.48936,-6.49702 -16.91126,-6.34639 -23.2404,-0.007 l -21.80418,21.80322 c -6.31473,6.30707 -6.5258,16.72898 -0.006,23.24136 l 15.05771,15.05771 c 4.64538,4.64539 5.55489,11.84661 2.2114,17.50128 -8.12896,13.7443 -14.26909,28.53818 -18.25154,43.97005 -1.64056,6.35503 -7.372,10.79415 -13.93426,10.79415 h -21.24868 c -9.06341,9.7e-4 -16.43829,7.37488 -16.43829,16.43829 v 30.82921 c 0,9.06341 7.37488,16.43731 16.43829,16.43731 h 21.24772 c 6.56322,0 12.2937,4.44008 13.93426,10.79416 3.98245,15.43188 10.12354,30.22576 18.25154,43.97005 3.34349,5.65468 2.43398,12.8559 -2.2114,17.50129 l -15.05196,15.05195 c -6.50662,6.49895 -6.33681,16.91798 -0.006,23.24136 l 21.80225,21.80225 c 6.31954,6.32818 16.74241,6.51335 23.24136,0.006 l 15.05674,-15.05771 c 3.42313,-3.42215 10.54472,-6.32625 17.50321,-2.21044 z"
113
+ id="path2-7"
114
+ style="fill:#9178b7;fill-opacity:1;stroke-width:0.95939529" /><path
115
+ inkscape:connector-curvature="0"
116
+ d="m 391.89337,494.85747 c -58.9328,0 -106.87666,-47.94482 -106.87666,-106.87664 0,-58.93182 47.94386,-106.87664 106.87666,-106.87664 58.93278,0 106.87664,47.94482 106.87664,106.87664 0,58.93182 -47.94386,106.87664 -106.87664,106.87664 z m 0,-184.97142 c -43.06248,0 -78.0948,35.03329 -78.0948,78.09478 0,43.0615 35.03328,78.09478 78.0948,78.09478 43.0615,0 78.09478,-35.03328 78.09478,-78.09478 0,-43.06149 -35.03232,-78.09478 -78.09478,-78.09478 z"
117
+ id="path4-6"
118
+ style="fill:#9178b7;fill-opacity:1;stroke-width:0.95939529" /><rect
119
+ style="opacity:0.5;fill:#ffffff;fill-opacity:0.78431373;fill-rule:evenodd;stroke:none;stroke-width:5.62767839;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers"
120
+ id="rect4504"
121
+ width="768.56519"
122
+ height="678.05548"
123
+ x="-25.146145"
124
+ y="32.319691" /></svg>
backend/style.css CHANGED
@@ -251,6 +251,9 @@ table.autoupdatelog .dashicons {
251
  table.cau_status_list {
252
  margin-top: 25px;
253
  }
 
 
 
254
  .cau_enabled {
255
  color: #7AD03A;
256
  }
251
  table.cau_status_list {
252
  margin-top: 25px;
253
  }
254
+ table.cau_status_list:not(.no_column_width) th, table.cau_status_list:not(.no_column_width) td {
255
+ width: 25%;
256
+ }
257
  .cau_enabled {
258
  color: #7AD03A;
259
  }
cau_emails.php CHANGED
@@ -9,6 +9,8 @@ function cau_check_updates_mail() {
9
  }
10
 
11
  if( cau_get_db_value( 'sendupdate' ) == 'on' && cau_get_db_value( 'plugins' ) == 'on' ) cau_plugin_updated(); // Check for updated plugins
 
 
12
  }
13
 
14
  // Ge the emailadresses it should be send to
@@ -44,6 +46,34 @@ function cau_is_html() {
44
 
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  // Set the content for the emails about pending updates
48
  function cau_pending_message( $single, $plural, $list ) {
49
 
@@ -113,6 +143,28 @@ For more info on what is new visit your dashboard and check the changelog.', 'co
113
 
114
  }
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  // Checks if theme updates are available
117
  function cau_list_theme_updates() {
118
 
@@ -177,8 +229,8 @@ function cau_list_plugin_updates() {
177
  }
178
 
179
  $subject = '[' . get_bloginfo( 'name' ) . '] ' . __( 'Plugin update available.', 'companion-auto-update' );
180
- $type = __('plugin', 'companion-auto-update');
181
- $type_plural = __('plugins', 'companion-auto-update');
182
  $message = cau_pending_message( $type, $type_plural, $list );
183
 
184
  foreach ( cau_set_email() as $key => $value) {
@@ -200,13 +252,18 @@ function cau_plugin_updated() {
200
  // Check if cau_get_db_value() function exists.
201
  if ( !function_exists( 'cau_get_db_value' ) ) require_once( plugin_dir_path( __FILE__ ) . 'cau_function.php' );
202
 
 
 
 
203
  // Create arrays
204
  $pluginNames = array();
205
  $pluginDates = array();
206
  $pluginVersion = array();
207
  $pluginSlug = array();
 
208
  $themeNames = array();
209
  $themeDates = array();
 
210
 
211
  // Where to look for plugins
212
  $plugdir = plugin_dir_path( __DIR__ );
@@ -237,16 +294,20 @@ function cau_plugin_updated() {
237
 
238
  switch ( $schedule_mail ) {
239
  case 'hourly':
240
- $lastday = date( 'YmdHi', strtotime( '-1 hour' ) );
241
  break;
242
  case 'twicedaily':
243
- $lastday = date( 'YmdHi', strtotime( '-12 hours' ) );
244
  break;
245
  default:
246
- $lastday = date( 'YmdHi', strtotime( '-1 day' ) );
247
  break;
248
  }
249
 
 
 
 
 
250
  if( $fileDate >= $lastday ) {
251
 
252
  // Get plugin name
@@ -261,6 +322,7 @@ function cau_plugin_updated() {
261
 
262
  array_push( $pluginDates, $fileDate );
263
  array_push( $pluginSlug, $actualSlug );
 
264
  }
265
 
266
  }
@@ -277,22 +339,23 @@ function cau_plugin_updated() {
277
  $fileDate = date ( 'YmdHi', filemtime( $fullPath ) );
278
 
279
  if( $schedule_mail == 'hourly' ) {
280
- $lastday = date( 'YmdHi', strtotime( '-1 hour' ) );
281
  } elseif( $schedule_mail == 'twicedaily' ) {
282
- $lastday = date( 'YmdHi', strtotime( '-12 hours' ) );
283
  } elseif( $schedule_mail == 'daily' ) {
284
- $lastday = date( 'YmdHi', strtotime( '-1 day' ) );
285
  }
286
 
287
- if( $fileDate >= $lastday ) {
 
 
288
 
289
- // Get theme name
290
  array_push( $themeNames, $path_parts['filename'] );
291
  array_push( $themeDates, $fileDate );
292
-
293
  }
294
 
295
-
296
  }
297
 
298
  $totalNumP = 0;
@@ -306,22 +369,40 @@ function cau_plugin_updated() {
306
  }
307
 
308
  foreach ( $pluginDates as $key => $value ) {
 
309
  if( cau_get_db_value( 'html_or_text' ) == 'html' ) {
310
- $updatedListP .= "<li><strong>".$pluginNames[$key]." </strong><br />
311
- to version ".$pluginVersion[$key]." <a href='https://wordpress.org/plugins/".$pluginSlug[$key]."/#developers'>".__( "Release notes", "companion-auto-update" )."</a></li>";
 
 
 
 
 
 
 
 
312
  } else {
313
- $updatedListP .= "- ".$pluginNames[$key]." to version ".$pluginVersion[$key]."\n";
314
- $updatedListP .= " Release notes: https://wordpress.org/plugins/".$pluginSlug[$key]."/#developers\n";
 
 
315
  }
 
316
  $totalNumP++;
317
  }
318
 
319
  foreach ( $themeNames as $key => $value ) {
 
320
  if( cau_get_db_value( 'html_or_text' ) == 'html' ) {
321
- $updatedListT .= "<li>".$themeNames[$key]."</li>";
 
 
 
 
322
  } else {
323
  $updatedListT .= "- ".$themeNames[$key]."\n";
324
  }
 
325
  $totalNumT++;
326
  }
327
 
9
  }
10
 
11
  if( cau_get_db_value( 'sendupdate' ) == 'on' && cau_get_db_value( 'plugins' ) == 'on' ) cau_plugin_updated(); // Check for updated plugins
12
+
13
+ if( cau_get_db_value( 'sendoutdated' ) == 'on' ) cau_list_outdated_software(); // Check for oudated plugins
14
  }
15
 
16
  // Ge the emailadresses it should be send to
46
 
47
  }
48
 
49
+ // Set the content for the emails about pending updates
50
+ function cau_outdated_message( $single, $plural, $list ) {
51
+
52
+ // WP version
53
+ $wpversion = get_bloginfo( 'version' );
54
+
55
+ // Base text
56
+ $text = sprintf( esc_html__( "You have %s on your WordPress site at %s that have not been tested with the latest 3 major releases of WordPress.", "companion-auto-update" ), $plural, get_site_url() );
57
+ $text .= "\n";
58
+ $text .= "\n";
59
+
60
+ // The list
61
+ if( !empty( $list ) ) {
62
+
63
+ $text .= sprintf( esc_html__( "The following %s have not been tested with WordPress %s:", "companion-auto-update" ), $plural, $wpversion );
64
+ $text .= "\n";
65
+ $text .= "\n";
66
+
67
+ foreach ( $list as $plugin => $version ) {
68
+ $text .= "- ".sprintf( esc_html__( "%s tested up to: %s", "companion-auto-update" ), $plugin, $version )."\n";
69
+ }
70
+
71
+ }
72
+
73
+ return $text;
74
+
75
+ }
76
+
77
  // Set the content for the emails about pending updates
78
  function cau_pending_message( $single, $plural, $list ) {
79
 
143
 
144
  }
145
 
146
+ // Checks if plugins are out of date
147
+ function cau_list_outdated_software() {
148
+
149
+ // Check if cau_get_db_value() function exists.
150
+ if ( !function_exists( 'cau_get_db_value' ) ) require_once( plugin_dir_path( __FILE__ ) . 'cau_function.php' );
151
+
152
+ // Set up mail
153
+ $subject = '['.get_bloginfo( 'name' ).'] ' . __( 'You have outdated plugins on your site.', 'companion-auto-update' );
154
+ $type = __( 'plugin', 'companion-auto-update' );
155
+ $type_plural = __( 'plugins', 'companion-auto-update' );
156
+ $message = cau_outdated_message( $type, $type_plural, cau_list_outdated() );
157
+
158
+ // Send to all addresses
159
+ foreach ( cau_set_email() as $key => $value ) {
160
+ foreach ( $value as $k => $v ) {
161
+ wp_mail( $v, $subject, $message );
162
+ }
163
+ break;
164
+ }
165
+
166
+ }
167
+
168
  // Checks if theme updates are available
169
  function cau_list_theme_updates() {
170
 
229
  }
230
 
231
  $subject = '[' . get_bloginfo( 'name' ) . '] ' . __( 'Plugin update available.', 'companion-auto-update' );
232
+ $type = __( 'plugin', 'companion-auto-update' );
233
+ $type_plural = __( 'plugins', 'companion-auto-update' );
234
  $message = cau_pending_message( $type, $type_plural, $list );
235
 
236
  foreach ( cau_set_email() as $key => $value) {
252
  // Check if cau_get_db_value() function exists.
253
  if ( !function_exists( 'cau_get_db_value' ) ) require_once( plugin_dir_path( __FILE__ ) . 'cau_function.php' );
254
 
255
+ // Set the correct timezone for emails
256
+ date_default_timezone_set( cau_get_proper_timezone() );
257
+
258
  // Create arrays
259
  $pluginNames = array();
260
  $pluginDates = array();
261
  $pluginVersion = array();
262
  $pluginSlug = array();
263
+ $pluginTimes = array();
264
  $themeNames = array();
265
  $themeDates = array();
266
+ $themeTimes = array();
267
 
268
  // Where to look for plugins
269
  $plugdir = plugin_dir_path( __DIR__ );
294
 
295
  switch ( $schedule_mail ) {
296
  case 'hourly':
297
+ $lastday = date( 'YmdHi', strtotime( '-1 hour', time() ) );
298
  break;
299
  case 'twicedaily':
300
+ $lastday = date( 'YmdHi', strtotime( '-12 hours', time() ) );
301
  break;
302
  default:
303
+ $lastday = date( 'YmdHi', strtotime( '-1 day', time() ) );
304
  break;
305
  }
306
 
307
+ $dateFormat = get_option( 'date_format' );
308
+ $timestamp = date_i18n( $dateFormat, filemtime( $fullPath ) );
309
+ $timestamp .= ' &dash; '.date( 'H:i', filemtime( $fullPath ) );
310
+
311
  if( $fileDate >= $lastday ) {
312
 
313
  // Get plugin name
322
 
323
  array_push( $pluginDates, $fileDate );
324
  array_push( $pluginSlug, $actualSlug );
325
+ array_push( $pluginTimes, $timestamp );
326
  }
327
 
328
  }
339
  $fileDate = date ( 'YmdHi', filemtime( $fullPath ) );
340
 
341
  if( $schedule_mail == 'hourly' ) {
342
+ $lastday = date( 'YmdHi', strtotime( '-1 hour', time() ) );
343
  } elseif( $schedule_mail == 'twicedaily' ) {
344
+ $lastday = date( 'YmdHi', strtotime( '-12 hours', time() ) );
345
  } elseif( $schedule_mail == 'daily' ) {
346
+ $lastday = date( 'YmdHi', strtotime( '-1 day', time() ) );
347
  }
348
 
349
+ $dateFormat = get_option( 'date_format' );
350
+ $timestamp = date_i18n( $dateFormat, filemtime( $fullPath ) );
351
+ $timestamp .= ' &dash; '.date( 'H:i', filemtime( $fullPath ) );
352
 
353
+ if( $fileDate >= $lastday ) {
354
  array_push( $themeNames, $path_parts['filename'] );
355
  array_push( $themeDates, $fileDate );
356
+ array_push( $themeTimes, $timestamp );
357
  }
358
 
 
359
  }
360
 
361
  $totalNumP = 0;
369
  }
370
 
371
  foreach ( $pluginDates as $key => $value ) {
372
+
373
  if( cau_get_db_value( 'html_or_text' ) == 'html' ) {
374
+
375
+ $more_info = '';
376
+ if( cau_get_db_value( 'advanced_info_emails' ) == 'on' ) $more_info = "<br /><span style='opacity: 0.5;'>".__( "Time of update", "companion-auto-update" ).": ".$pluginTimes[$key]."</span>";
377
+
378
+ $updatedListP .= "<li>
379
+ <strong>".$pluginNames[$key]." </strong><br />
380
+ ".__( "to version", "companion-auto-update" )." ".$pluginVersion[$key]." <a href='https://wordpress.org/plugins/".$pluginSlug[$key]."/#developers'>".__( "Release notes", "companion-auto-update" )."</a>
381
+ ".$more_info."
382
+ </li>";
383
+
384
  } else {
385
+
386
+ $updatedListP .= "- ".$pluginNames[$key]." ".__( "to version", "companion-auto-update" )." ".$pluginVersion[$key]."\n";
387
+ $updatedListP .= " ".__( "Release notes", "companion-auto-update" ).": https://wordpress.org/plugins/".$pluginSlug[$key]."/#developers\n";
388
+
389
  }
390
+
391
  $totalNumP++;
392
  }
393
 
394
  foreach ( $themeNames as $key => $value ) {
395
+
396
  if( cau_get_db_value( 'html_or_text' ) == 'html' ) {
397
+
398
+ $more_info = '';
399
+ if( cau_get_db_value( 'advanced_info_emails' ) == 'on' ) $more_info = "<br /><span style='opacity: 0.5;'>".__( "Time of update", "companion-auto-update" ).": ".$themeTimes[$key]."</span>";
400
+ $updatedListT .= "<li><strong>".$themeNames[$key]."</strong>".$more_info."</li>";
401
+
402
  } else {
403
  $updatedListT .= "- ".$themeNames[$key]."\n";
404
  }
405
+
406
  $totalNumT++;
407
  }
408
 
cau_functions.php CHANGED
@@ -85,8 +85,8 @@ function cau_incompatiblePluginlist() {
85
 
86
  // Pluginlist, write as Plugin path => Issue
87
  $pluginList = array(
88
- 'better-wp-security/better-wp-security.php' => 'May block auto-updating for everything.',
89
- 'updraftplus/updraftplus.php' => 'Does not update automatically, needs to be done manually. Causes no issues with other plugins.'
90
  );
91
 
92
  return $pluginList;
@@ -111,7 +111,7 @@ function cau_pluginHasIssues() {
111
 
112
  $return = false;
113
 
114
- if( get_option( 'blog_public' ) == 0 ) {
115
  $return = true;
116
  }
117
 
@@ -119,7 +119,7 @@ function cau_pluginHasIssues() {
119
  $return = true;
120
  }
121
 
122
- if( checkCronjobsDisabled() ) {
123
  $return = true;
124
  }
125
 
@@ -174,11 +174,14 @@ function cau_incorrectDatabaseVersion() {
174
  function cau_run_custom_hooks_p() {
175
 
176
  // Create array
177
- $allDates = array();
178
 
179
  // Where to look for plugins
180
- $dirr = plugin_dir_path( __DIR__ );
181
- $listOfAll = get_plugins();
 
 
 
182
 
183
  // Loop trough all plugins
184
  foreach ( $listOfAll as $key => $value ) {
@@ -191,16 +194,15 @@ function cau_run_custom_hooks_p() {
191
 
192
  // Check when the last update was
193
  if( $updateSched == 'hourly' ) {
194
- $lastday = date( 'YmdHi', strtotime( '-1 hour' ) );
195
  } elseif( $updateSched == 'twicedaily' ) {
196
- $lastday = date( 'YmdHi', strtotime( '-12 hours' ) );
197
  } elseif( $updateSched == 'daily' ) {
198
- $lastday = date( 'YmdHi', strtotime( '-1 day' ) );
199
  }
200
 
201
- $update_time = wp_next_scheduled( 'wp_update_plugins' );
202
- $range_start = date( 'Hi', strtotime( '-30 minutes', $update_time ) );
203
- $range_end = date( 'Hi', strtotime( '+30 minutes', $update_time ) );
204
 
205
  if( $fileDate >= $lastday ) {
206
 
@@ -213,19 +215,17 @@ function cau_run_custom_hooks_p() {
213
  } else {
214
  $status = __( 'Manual', 'companion-auto-update' );
215
  }
 
 
 
216
  cau_updatePluginInformation( $key, $status );
217
 
218
  }
219
 
220
  }
221
 
222
- $totalNum = 0;
223
-
224
- // Count number of updated plugins
225
- foreach ( $allDates as $key => $value ) $totalNum++;
226
-
227
  // If there have been plugin updates run hook
228
- if( $totalNum > 0 ) {
229
  do_action( 'cau_after_plugin_update' );
230
  }
231
 
@@ -247,15 +247,16 @@ function cau_run_custom_hooks_t() {
247
  // Get data
248
  $fullPath = $dirr.'/'.$key;
249
  $fileDate = date ( 'YmdHi', filemtime( $fullPath ) );
 
250
  $updateSched = wp_get_schedule( 'wp_update_themes' );
251
 
252
  // Check when the last update was
253
  if( $updateSched == 'hourly' ) {
254
- $lastday = date( 'YmdHi', strtotime( '-1 hour' ) );
255
  } elseif( $updateSched == 'twicedaily' ) {
256
- $lastday = date( 'YmdHi', strtotime( '-12 hours' ) );
257
  } elseif( $updateSched == 'daily' ) {
258
- $lastday = date( 'YmdHi', strtotime( '-1 day' ) );
259
  }
260
 
261
  $update_time = wp_next_scheduled( 'wp_update_themes' );
@@ -304,17 +305,16 @@ function cau_run_custom_hooks_c() {
304
 
305
  // Check when the last update was
306
  if( $updateSched == 'hourly' ) {
307
- $lastday = date( 'YmdHi', strtotime( '-1 hour' ) );
308
  } elseif( $updateSched == 'twicedaily' ) {
309
- $lastday = date( 'YmdHi', strtotime( '-12 hours' ) );
310
  } elseif( $updateSched == 'daily' ) {
311
- $lastday = date( 'YmdHi', strtotime( '-1 day' ) );
312
  }
313
 
314
  // Check manual or automatic
315
- $update_time = wp_next_scheduled( 'wp_version_check' );
316
- $range_start = date( 'Hi', strtotime( '-30 minutes', $update_time ) );
317
- $range_end = date( 'Hi', strtotime( '+30 minutes', $update_time ) );
318
 
319
  if( $fileDate >= $lastday ) {
320
 
@@ -373,22 +373,12 @@ function checkAutomaticUpdaterDisabled() {
373
  // Check if cronjobs are disabled
374
  function checkCronjobsDisabled() {
375
 
376
- // I mean, I know this can be done waaaay better but I's quite late and I need to push a fix so take it or leave it untill I decide to fix this :)
377
-
378
- if ( defined( 'disable_wp_cron' ) ) {
379
- if( constant( 'disable_wp_cron' ) == 'true' ) {
380
- return true;
381
- } else {
382
- return false;
383
- }
384
-
385
- } else if ( defined( 'DISABLE_WP_CRON' ) ) {
386
- if( constant( 'DISABLE_WP_CRON' ) == 'true' ) {
387
  return true;
388
  } else {
389
  return false;
390
  }
391
-
392
  } else {
393
  return false;
394
  }
@@ -467,7 +457,20 @@ function donotupdatelist( $filter = 'plugins' ) {
467
 
468
  }
469
  function plugins_donotupdatelist() {
470
- return donotupdatelist( 'plugins' );
 
 
 
 
 
 
 
 
 
 
 
 
 
471
  }
472
  function themes_donotupdatelist() {
473
  return donotupdatelist( 'themes' );
@@ -740,7 +743,8 @@ function cau_fetch_log( $limit, $format = 'simple' ) {
740
  }
741
 
742
  } else {
743
- $transDate = date('YmdHi');
 
744
  $transDateF = 'Could not read translations date.';
745
 
746
  array_push( $pluginNames, 'Translations' );
@@ -944,15 +948,11 @@ function cau_dontUpdateThemes( $update, $item ) {
944
 
945
  $themes = themes_donotupdatelist();
946
 
947
- if( !empty( $themes ) ) {
948
- if ( in_array( $item->slug, $themes ) ) {
949
- return false; // Don't update these themes
950
- } else {
951
- return true; // Always update these themes
952
- }
953
- } else {
954
- return true;
955
- }
956
 
957
 
958
  }
@@ -964,7 +964,7 @@ function cau_plugin_info( $slug, $what ) {
964
  $cau_transient_name = 'cau' . $slug;
965
  $cau_info = get_transient( $cau_transient_name );
966
 
967
- require_once( ABSPATH.'wp-admin/includes/plugin-install.php' );
968
  $cau_info = plugins_api( 'plugin_information', array( 'slug' => $slug ) );
969
 
970
  if ( ! $cau_info or is_wp_error( $cau_info ) ) {
@@ -990,6 +990,48 @@ function cau_plugin_info( $slug, $what ) {
990
 
991
  }
992
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
993
  // Get plugin information of currently installed plugins
994
  function cau_active_plugin_info( $slug, $what ) {
995
 
@@ -1009,18 +1051,11 @@ function cau_active_plugin_info( $slug, $what ) {
1009
 
1010
  // Remove update nag when major updates are disabled
1011
  function cau_hideUpdateNag() {
1012
-
1013
- global $wpdb;
1014
- $table_name = $wpdb->prefix . "auto_updates";
1015
- $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'major'");
1016
- foreach ( $configs as $config ) {
1017
- if( $config->onoroff != 'on' ) {
1018
- remove_action( 'admin_notices', 'update_nag', 3 );
1019
- remove_action( 'network_admin_notices', 'maintenance_nag', 10 );
1020
- }
1021
  }
1022
  }
1023
-
1024
  add_action( 'admin_head', 'cau_hideUpdateNag', 100 );
1025
 
1026
  // Add more intervals to event schedules
@@ -1029,19 +1064,19 @@ function cau_addMoreIntervals( $schedules ) {
1029
  // Add a weekly interval.
1030
  $schedules['weekly'] = array(
1031
  'interval' => 604800,
1032
- 'display' => __( 'Once Weekly' ),
1033
  );
1034
 
1035
  // Add a twice montly interval.
1036
  $schedules['twice_monthly'] = array(
1037
  'interval' => 1317600,
1038
- 'display' => __( 'Twice a month' ),
1039
  );
1040
 
1041
  // Add a montly interval.
1042
  $schedules['once_monthly'] = array(
1043
  'interval' => 2635200,
1044
- 'display' => __( 'Once a month' ),
1045
  );
1046
 
1047
  return $schedules;
@@ -1146,38 +1181,12 @@ function cau_siteHealthSignature() {
1146
 
1147
  function cau_add_siteHealthTest( $tests ) {
1148
  $tests['direct']['cau_disabled'] = array( 'label' => __( 'Companion Auto Update', 'companion-auto-update' ), 'test' => 'cau_disabled_test' );
1149
- $tests['direct']['cau_cronjobs'] = array( 'label' => __( 'Companion Auto Update', 'companion-auto-update' ), 'test' => 'cau_cronjobs_test' );
1150
- $tests['direct']['cau_siteinde'] = array( 'label' => __( 'Companion Auto Update', 'companion-auto-update' ), 'test' => 'cau_siteindex_test' );
1151
  return $tests;
1152
  }
1153
  add_filter( 'site_status_tests', 'cau_add_siteHealthTest' );
1154
-
1155
- function cau_siteindex_test() {
1156
- $result = array(
1157
- 'label' => __( 'Search Engine Visibility', 'companion-auto-update' ),
1158
- 'status' => 'good',
1159
- 'badge' => array(
1160
- 'label' => __( 'Performance' ),
1161
- 'color' => 'blue',
1162
- ),
1163
- 'description' => sprintf( '<p>%s</p>', __( "Search Engines can index your site just fine.", 'companion-auto-update' ) ),
1164
- 'actions' => '',
1165
- 'test' => 'cau_siteinde',
1166
- );
1167
-
1168
- if ( get_option( 'blog_public' ) == 0 ) {
1169
- $result['status'] = 'recommended';
1170
- $result['label'] = __( 'Search Engine Visibility ', 'companion-auto-update' );
1171
- $result['description'] = sprintf( '<p>%s</p>', __( "You’ve chosen to disscourage Search Engines from indexing your site. Auto-updating works best on sites with more traffic, consider enabling indexing for your site.", 'companion-auto-update' ) );
1172
- $result['actions'] .= sprintf( '<p><a href="%s">%s</a>', esc_url( admin_url( 'options-reading.php' ) ), __( 'Fix it', 'companion-auto-update' ) );
1173
- }
1174
-
1175
- $result['actions'] .= cau_siteHealthSignature();
1176
-
1177
- return $result;
1178
- }
1179
 
1180
  function cau_disabled_test() {
 
1181
  $result = array(
1182
  'label' => __( 'Auto updating is enabled', 'companion-auto-update' ),
1183
  'status' => 'good',
@@ -1190,40 +1199,12 @@ function cau_disabled_test() {
1190
  'test' => 'cau_disabled',
1191
  );
1192
 
1193
- if ( checkAutomaticUpdaterDisabled() ) {
1194
  $result['status'] = 'critical';
1195
  $result['label'] = __( 'Auto updating is disabled', 'companion-auto-update' );
1196
- $result['description'] = sprintf( '<p>%s</p>', __( "Automatic updating is disabled on this site by either WordPress, another plugin or your webhost.", 'companion-auto-update' ) );
1197
- $result['description'] .= sprintf( '<p>%s</p>', __( "Error code", 'companion-auto-update' ).': <code>AUTOMATIC_UPDATER_DISABLED true</code>' );
1198
- $result['actions'] .= sprintf( '<p><a href="%s">%s</a>', esc_url( cau_url( 'status' ) ), __( 'Fix it', 'companion-auto-update' ) );
1199
- $result['actions'] .= sprintf( ' - <a href="%s">%s</a></p>', esc_url( cau_url( 'support' ) ), __( 'Contact for support', 'companion-auto-update' ) );
1200
- }
1201
-
1202
- $result['actions'] .= cau_siteHealthSignature();
1203
-
1204
- return $result;
1205
- }
1206
-
1207
- function cau_cronjobs_test() {
1208
- $result = array(
1209
- 'label' => __( 'Cronjobs are enabled', 'companion-auto-update' ),
1210
- 'status' => 'good',
1211
- 'badge' => array(
1212
- 'label' => __( 'Performance' ),
1213
- 'color' => 'blue',
1214
- ),
1215
- 'description' => sprintf( '<p>%s</p>', __( "Cronjobs are enabled on this site.", 'companion-auto-update' ) ),
1216
- 'actions' => '',
1217
- 'test' => 'cau_cronjobs',
1218
- );
1219
-
1220
- if ( checkCronjobsDisabled() ) {
1221
- $result['status'] = 'recommended';
1222
- $result['label'] = __( 'Cronjobs are disabled', 'companion-auto-update' );
1223
- $result['description'] = sprintf( '<p>%s</p>', __( "Cronjobs are disabled on this site by either you, WordPress, another plugin or your webhost. Companion Auto Update might experience issues when cronjobs are disabled. ", 'companion-auto-update' ) );
1224
- $result['description'] .= sprintf( '<p>%s</p>', __( "Error code", 'companion-auto-update' ).': <code>DISABLE_WP_CRON true</code>' );
1225
- $result['actions'] .= sprintf( '<p><a href="%s">%s</a>', esc_url( cau_url( 'status' ) ), __( 'Fix it', 'companion-auto-update' ) );
1226
- $result['actions'] .= sprintf( ' - <a href="%s">%s</a></p>', esc_url( cau_url( 'support' ) ), __( 'Contact for support', 'companion-auto-update' ) );
1227
  }
1228
 
1229
  $result['actions'] .= cau_siteHealthSignature();
@@ -1278,4 +1259,100 @@ function cau_test_is_vcs_checkout( $context ) {
1278
  }
1279
 
1280
  return $result;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1281
  }
85
 
86
  // Pluginlist, write as Plugin path => Issue
87
  $pluginList = array(
88
+ 'better-wp-security/better-wp-security.php' => "<span class='cau_disabled'><span class='dashicons dashicons-no'></span></span> May block auto-updating for everything.",
89
+ 'updraftplus/updraftplus.php' => "<span class='cau_warning'><span class='dashicons dashicons-warning'></span></span> By default this plugin will not be auto-updated. You'll have to do this manually or enable auto-updating in the settings. <u>Causes no issues with other plugins.</u>"
90
  );
91
 
92
  return $pluginList;
111
 
112
  $return = false;
113
 
114
+ if( get_option( 'blog_public' ) == 0 && cau_get_db_value( 'ignore_seo' ) != 'yes' ) {
115
  $return = true;
116
  }
117
 
119
  $return = true;
120
  }
121
 
122
+ if( checkCronjobsDisabled() && cau_get_db_value( 'ignore_cron' ) != 'yes' ) {
123
  $return = true;
124
  }
125
 
174
  function cau_run_custom_hooks_p() {
175
 
176
  // Create array
177
+ $allDates = array();
178
 
179
  // Where to look for plugins
180
+ $dirr = plugin_dir_path( __DIR__ );
181
+ $listOfAll = get_plugins();
182
+
183
+ // Number of updates
184
+ $numOfUpdates = 0;
185
 
186
  // Loop trough all plugins
187
  foreach ( $listOfAll as $key => $value ) {
194
 
195
  // Check when the last update was
196
  if( $updateSched == 'hourly' ) {
197
+ $lastday = date( 'YmdHi', strtotime( '-1 hour', time() ) );
198
  } elseif( $updateSched == 'twicedaily' ) {
199
+ $lastday = date( 'YmdHi', strtotime( '-12 hours', time() ) );
200
  } elseif( $updateSched == 'daily' ) {
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
 
215
  } else {
216
  $status = __( 'Manual', 'companion-auto-update' );
217
  }
218
+
219
+ $numOfUpdates++;
220
+
221
  cau_updatePluginInformation( $key, $status );
222
 
223
  }
224
 
225
  }
226
 
 
 
 
 
 
227
  // If there have been plugin updates run hook
228
+ if( $numOfUpdates >= 1 ) {
229
  do_action( 'cau_after_plugin_update' );
230
  }
231
 
247
  // Get data
248
  $fullPath = $dirr.'/'.$key;
249
  $fileDate = date ( 'YmdHi', filemtime( $fullPath ) );
250
+ $fileTime = date ( 'Hi', filemtime( $fullPath ) );
251
  $updateSched = wp_get_schedule( 'wp_update_themes' );
252
 
253
  // Check when the last update was
254
  if( $updateSched == 'hourly' ) {
255
+ $lastday = date( 'YmdHi', strtotime( '-1 hour', time() ) );
256
  } elseif( $updateSched == 'twicedaily' ) {
257
+ $lastday = date( 'YmdHi', strtotime( '-12 hours', time() ) );
258
  } elseif( $updateSched == 'daily' ) {
259
+ $lastday = date( 'YmdHi', strtotime( '-1 day', time() ) );
260
  }
261
 
262
  $update_time = wp_next_scheduled( 'wp_update_themes' );
305
 
306
  // Check when the last update was
307
  if( $updateSched == 'hourly' ) {
308
+ $lastday = date( 'YmdHi', strtotime( '-1 hour', time() ) );
309
  } elseif( $updateSched == 'twicedaily' ) {
310
+ $lastday = date( 'YmdHi', strtotime( '-12 hours', time() ) );
311
  } elseif( $updateSched == 'daily' ) {
312
+ $lastday = date( 'YmdHi', strtotime( '-1 day', time() ) );
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
 
373
  // Check if cronjobs are disabled
374
  function checkCronjobsDisabled() {
375
 
376
+ if ( defined( 'disable_wp_cron' ) OR defined( 'DISABLE_WP_CRON' ) ) {
377
+ if( constant( 'disable_wp_cron' ) == 'true' OR constant( 'DISABLE_WP_CRON' ) == 'true' ) {
 
 
 
 
 
 
 
 
 
378
  return true;
379
  } else {
380
  return false;
381
  }
 
382
  } else {
383
  return false;
384
  }
457
 
458
  }
459
  function plugins_donotupdatelist() {
460
+
461
+ // Base array
462
+ $array = array();
463
+
464
+ // Filtered plugins
465
+ $filteredplugins = donotupdatelist( 'plugins' );
466
+ foreach ( $filteredplugins as $filteredplugin ) array_push( $array, $filteredplugin );
467
+
468
+ // Plugin added to the delay list
469
+ $delayedplugins = cau_delayed_updates__formated();
470
+ foreach ( $delayedplugins as $delayedplugin ) array_push( $array, $delayedplugin );
471
+
472
+ // Return array
473
+ return $array;
474
  }
475
  function themes_donotupdatelist() {
476
  return donotupdatelist( 'themes' );
743
  }
744
 
745
  } else {
746
+
747
+ $transDate = date('YmdHi');
748
  $transDateF = 'Could not read translations date.';
749
 
750
  array_push( $pluginNames, 'Translations' );
948
 
949
  $themes = themes_donotupdatelist();
950
 
951
+ if ( in_array( $item->slug, $themes ) ) {
952
+ return false; // Don't update these themes
953
+ } else {
954
+ return true; // Always update these themes
955
+ }
 
 
 
 
956
 
957
 
958
  }
964
  $cau_transient_name = 'cau' . $slug;
965
  $cau_info = get_transient( $cau_transient_name );
966
 
967
+ if( !function_exists( 'plugins_api' ) ) require_once( ABSPATH.'wp-admin/includes/plugin-install.php' );
968
  $cau_info = plugins_api( 'plugin_information', array( 'slug' => $slug ) );
969
 
970
  if ( ! $cau_info or is_wp_error( $cau_info ) ) {
990
 
991
  }
992
 
993
+ // Get list of outdated plugins
994
+ function cau_list_outdated() {
995
+
996
+ $outdatedList = array();
997
+
998
+ foreach ( get_plugins() as $key => $value) {
999
+
1000
+ $slug = $key;
1001
+ $explosion = explode( '/', $slug );
1002
+ $actualSlug = array_shift( $explosion );
1003
+
1004
+ // Get plugin name
1005
+ foreach ( $value as $k => $v ) if( $k == "Name" ) $name = $v;
1006
+
1007
+ // Get plugins tested up to version
1008
+ if( !function_exists( 'plugins_api' ) ) require_once( ABSPATH.'wp-admin/includes/plugin-install.php' );
1009
+ $api = plugins_api( 'plugin_information', array( 'slug' => wp_unslash( $actualSlug ) ) );
1010
+
1011
+ // Version compare
1012
+ $tested_version = substr( $api->tested, 0, 3 ); // Format version number
1013
+ $current_version = substr( get_bloginfo( 'version' ), 0, 3 ); // Format version number
1014
+ $version_difference = ($current_version - $tested_version); // Get the difference
1015
+ // $tested_wp = ( empty( $api->tested ) || cau_version_compare( get_bloginfo( 'version' ), $api->tested, '<' ) );
1016
+
1017
+ if( $version_difference >= '0.3' ) {
1018
+ $outdatedList[$name] = substr( $api->tested, 0, 3 );
1019
+ }
1020
+
1021
+ }
1022
+
1023
+ return $outdatedList;
1024
+
1025
+ }
1026
+
1027
+ // Better version compare
1028
+ function cau_version_compare( $ver1, $ver2, $operator = null ) {
1029
+ $p = '#(\.0+)+($|-)#';
1030
+ $ver1 = preg_replace( $p, '', $ver1 );
1031
+ $ver2 = preg_replace( $p, '', $ver2 );
1032
+ return isset( $operator ) ? version_compare( $ver1, $ver2, $operator ) : version_compare( $ver1, $ver2 );
1033
+ }
1034
+
1035
  // Get plugin information of currently installed plugins
1036
  function cau_active_plugin_info( $slug, $what ) {
1037
 
1051
 
1052
  // Remove update nag when major updates are disabled
1053
  function cau_hideUpdateNag() {
1054
+ if( cau_get_db_value( 'major' ) != 'on' ) {
1055
+ remove_action( 'admin_notices', 'update_nag', 3 );
1056
+ remove_action( 'network_admin_notices', 'maintenance_nag', 10 );
 
 
 
 
 
 
1057
  }
1058
  }
 
1059
  add_action( 'admin_head', 'cau_hideUpdateNag', 100 );
1060
 
1061
  // Add more intervals to event schedules
1064
  // Add a weekly interval.
1065
  $schedules['weekly'] = array(
1066
  'interval' => 604800,
1067
+ 'display' => __( 'Once Weekly', 'companion-auto-update' ),
1068
  );
1069
 
1070
  // Add a twice montly interval.
1071
  $schedules['twice_monthly'] = array(
1072
  'interval' => 1317600,
1073
+ 'display' => __( 'Twice a month', 'companion-auto-update' ),
1074
  );
1075
 
1076
  // Add a montly interval.
1077
  $schedules['once_monthly'] = array(
1078
  'interval' => 2635200,
1079
+ 'display' => __( 'Once a month', 'companion-auto-update' ),
1080
  );
1081
 
1082
  return $schedules;
1181
 
1182
  function cau_add_siteHealthTest( $tests ) {
1183
  $tests['direct']['cau_disabled'] = array( 'label' => __( 'Companion Auto Update', 'companion-auto-update' ), 'test' => 'cau_disabled_test' );
 
 
1184
  return $tests;
1185
  }
1186
  add_filter( 'site_status_tests', 'cau_add_siteHealthTest' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1187
 
1188
  function cau_disabled_test() {
1189
+
1190
  $result = array(
1191
  'label' => __( 'Auto updating is enabled', 'companion-auto-update' ),
1192
  'status' => 'good',
1199
  'test' => 'cau_disabled',
1200
  );
1201
 
1202
+ if ( checkAutomaticUpdaterDisabled() OR !has_filter( 'wp_version_check', 'wp_version_check' ) ) {
1203
  $result['status'] = 'critical';
1204
  $result['label'] = __( 'Auto updating is disabled', 'companion-auto-update' );
1205
+ $result['description'] = __( 'Automatic updating is disabled on this site by either WordPress, another plugin or your webhost.', 'companion-auto-update' );
1206
+ $result['description'] .= ' '.__( 'For more information about this error check the status page.', 'companion-auto-update' );
1207
+ $result['actions'] .= sprintf( '<p><a href="%s">%s</a>', esc_url( cau_url( 'status' ) ), __( 'Check the status page', 'companion-auto-update' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1208
  }
1209
 
1210
  $result['actions'] .= cau_siteHealthSignature();
1259
  }
1260
 
1261
  return $result;
1262
+ }
1263
+
1264
+ // Check if plugins need to be delayed
1265
+ function cau_check_delayed() {
1266
+ if( cau_get_db_value( 'update_delay' ) == 'on' ) {
1267
+ cau_hold_updates();
1268
+ cau_unhold_updates();
1269
+ } else {
1270
+ cau_unhold_all_updates();
1271
+ }
1272
+ }
1273
+
1274
+ // List of all delayed plugins
1275
+ function cau_delayed_updates() {
1276
+
1277
+ global $wpdb;
1278
+ $plugin_list = array();
1279
+ $updateLog = $wpdb->prefix."update_log";
1280
+ $put_on_hold = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$updateLog} WHERE put_on_hold <> '%s'", '0' ) );
1281
+ foreach ( $put_on_hold as $plugin ) {
1282
+ array_push( $plugin_list, $plugin->slug );
1283
+ }
1284
+ return $plugin_list;
1285
+
1286
+ }
1287
+
1288
+ // List of all delayed plugins for the update function
1289
+ function cau_delayed_updates__formated() {
1290
+
1291
+ $plugin_list = array();
1292
+ foreach ( cau_delayed_updates() as $plugin ) {
1293
+ $explosion = explode( '/', $plugin );
1294
+ $short_slug = array_shift( $explosion );
1295
+ array_push( $plugin_list, $short_slug );
1296
+ }
1297
+ return $plugin_list;
1298
+
1299
+ }
1300
+
1301
+ // Add "put on hold" timestamp to the database if it hasn't been set yet
1302
+ function cau_hold_updates() {
1303
+
1304
+ require_once( ABSPATH.'wp-admin/includes/plugin-install.php' );
1305
+ $plugins = get_plugin_updates();
1306
+
1307
+ if ( !empty( $plugins ) ) {
1308
+ $list = array();
1309
+ foreach ( (array)$plugins as $plugin_file => $plugin_data ) {
1310
+ if( !in_array( $plugin_file, cau_delayed_updates() ) ) {
1311
+ global $wpdb;
1312
+ $updateDB = "update_log";
1313
+ $updateLog = $wpdb->prefix.$updateDB;
1314
+ $wpdb->query( $wpdb->prepare( "UPDATE $updateLog SET put_on_hold = '%s' WHERE slug = '%s'", strtotime( "now" ), $plugin_file ) );
1315
+ }
1316
+ }
1317
+ }
1318
+ }
1319
+
1320
+ // Remove plugins from "put on hold" after x days
1321
+ function cau_unhold_updates() {
1322
+
1323
+ if( cau_get_db_value( 'update_delay_days' ) != '' ) {
1324
+ $after_x_days = cau_get_db_value( 'update_delay_days' );
1325
+ } else {
1326
+ $after_x_days = '2';
1327
+ }
1328
+
1329
+ global $wpdb;
1330
+
1331
+ $today = strtotime( "now" );
1332
+ $updateLog = $wpdb->prefix."update_log";
1333
+ $put_on_hold = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$updateLog} WHERE put_on_hold <> '%s'", '0' ) );
1334
+
1335
+ foreach ( $put_on_hold as $plugin ) {
1336
+
1337
+ $plugin_file = $plugin->slug;
1338
+ $put_on_hold_date = $plugin->put_on_hold;
1339
+ $remove_after = strtotime( '+'.$after_x_days.' days', $put_on_hold_date );
1340
+
1341
+ if( $remove_after <= $today ) {
1342
+ $wpdb->query( $wpdb->prepare( "UPDATE {$updateLog} SET put_on_hold = '%s' WHERE slug = '%s'", '0', $plugin_file ) );
1343
+ }
1344
+
1345
+ }
1346
+
1347
+ }
1348
+
1349
+ // Remove all plugins from "put on hold" if option is disabled
1350
+ function cau_unhold_all_updates() {
1351
+ global $wpdb;
1352
+ $updateLog = $wpdb->prefix."update_log";
1353
+ $put_on_hold = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$updateLog} WHERE put_on_hold <> '%s'", '0' ) );
1354
+ foreach ( $put_on_hold as $plugin ) {
1355
+ $plugin_file = $plugin->slug;
1356
+ $wpdb->query( $wpdb->prepare( "UPDATE {$updateLog} SET put_on_hold = '%s' WHERE slug = '%s'", '0', $plugin_file ) );
1357
+ }
1358
  }
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.6.0
7
  * Author: Papin Schipper
8
  * Author URI: http://codeermeneer.nl/
9
  * Contributors: papin
@@ -18,9 +18,9 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
18
 
19
  // Load translations
20
  function cau_init() {
21
- load_plugin_textdomain( 'companion-auto-update', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
22
- add_filter( 'plugins_auto_update_enabled', '__return_false' );
23
- add_filter( 'themes_auto_update_enabled', '__return_false' );
24
  }
25
  add_action( 'init', 'cau_init' );
26
 
@@ -40,12 +40,20 @@ function cau_install( $network_wide ) {
40
  if (! wp_next_scheduled ( 'cau_set_schedule_mail' )) wp_schedule_event( time(), 'daily', 'cau_set_schedule_mail'); // Set schedule for mail etc.
41
  if (! wp_next_scheduled ( 'cau_custom_hooks_plugins' )) wp_schedule_event( time(), 'daily', 'cau_custom_hooks_plugins'); // Run custom hooks on plugin updates
42
  if (! wp_next_scheduled ( 'cau_custom_hooks_themes' )) wp_schedule_event( time(), 'daily', 'cau_custom_hooks_themes'); // Run custom hooks on theme updates
 
43
  }
44
  add_action( 'cau_set_schedule_mail', 'cau_check_updates_mail' );
45
  add_action( 'wp_update_plugins', 'cau_run_custom_hooks_p' );
46
  add_action( 'wp_update_themes', 'cau_run_custom_hooks_t' );
47
  add_action( 'wp_version_check', 'cau_run_custom_hooks_c' );
48
 
 
 
 
 
 
 
 
49
  // Redirect to welcome screen on activation of plugin
50
  function cau_pluginActivateWelcome() {
51
  add_option( 'cau_redirectToWelcomeScreen', true );
@@ -60,7 +68,7 @@ function cau_pluginRedirectWelcomeScreen() {
60
  }
61
  }
62
  }
63
- add_action('admin_init', 'cau_pluginRedirectWelcomeScreen');
64
 
65
  // Donate url
66
  function cau_donateUrl() {
@@ -69,7 +77,7 @@ function cau_donateUrl() {
69
 
70
  // Database version
71
  function cau_db_version() {
72
- return '3.6.0';
73
  }
74
  function cau_database_creation() {
75
 
@@ -94,6 +102,7 @@ function cau_database_creation() {
94
  oldVersion VARCHAR(10) NOT NULL,
95
  newVersion VARCHAR(10) NOT NULL,
96
  method VARCHAR(10) NOT NULL,
 
97
  UNIQUE KEY id (id)
98
  )";
99
 
@@ -134,30 +143,35 @@ function cau_install_data() {
134
  $toemail = get_option('admin_email');
135
 
136
  // Update configs
137
- if( !cau_check_if_exists( 'plugins' ) ) $wpdb->insert( $table_name, array( 'name' => 'plugins', 'onoroff' => 'on' ) ); // 0
138
- if( !cau_check_if_exists( 'themes' ) ) $wpdb->insert( $table_name, array( 'name' => 'themes', 'onoroff' => 'on' ) ); // 1
139
- if( !cau_check_if_exists( 'minor' ) ) $wpdb->insert( $table_name, array( 'name' => 'minor', 'onoroff' => 'on' ) ); // 2
140
- if( !cau_check_if_exists( 'major' ) ) $wpdb->insert( $table_name, array( 'name' => 'major', 'onoroff' => '' ) ); // 3
141
 
142
  // Email configs
143
- if( !cau_check_if_exists( 'email' ) ) $wpdb->insert( $table_name, array( 'name' => 'email', 'onoroff' => '' ) ); // 4
144
- if( !cau_check_if_exists( 'send' ) ) $wpdb->insert( $table_name, array( 'name' => 'send', 'onoroff' => '' ) ); // 5
145
- if( !cau_check_if_exists( 'sendupdate' ) ) $wpdb->insert( $table_name, array( 'name' => 'sendupdate', 'onoroff' => '' ) ); // 6
 
146
 
147
  // Advanced
148
- if( !cau_check_if_exists( 'notUpdateList' ) ) $wpdb->insert( $table_name, array( 'name' => 'notUpdateList', 'onoroff' => '' ) ); // 7
149
- if( !cau_check_if_exists( 'translations' ) ) $wpdb->insert( $table_name, array( 'name' => 'translations', 'onoroff' => 'on' ) ); // 8
150
- if( !cau_check_if_exists( 'wpemails' ) ) $wpdb->insert( $table_name, array( 'name' => 'wpemails', 'onoroff' => 'on' ) ); // 9
151
- if( !cau_check_if_exists( 'notUpdateListTh' ) ) $wpdb->insert( $table_name, array( 'name' => 'notUpdateListTh', 'onoroff' => '' ) ); // 10
152
 
153
  // Stuff
154
- if( !cau_check_if_exists( 'html_or_text' ) ) $wpdb->insert( $table_name, array( 'name' => 'html_or_text', 'onoroff' => 'html' ) ); // 11
155
 
156
  // Advanced
157
- if( !cau_check_if_exists( 'allow_administrator' ) ) $wpdb->insert( $table_name, array( 'name' => 'allow_administrator', 'onoroff' => 'on' ) ); // 12
158
- if( !cau_check_if_exists( 'allow_editor' ) ) $wpdb->insert( $table_name, array( 'name' => 'allow_editor', 'onoroff' => '' ) ); // 13
159
- if( !cau_check_if_exists( 'allow_author' ) ) $wpdb->insert( $table_name, array( 'name' => 'allow_author', 'onoroff' => '' ) ); // 14
160
-
 
 
 
 
161
 
162
  }
163
  register_activation_hook( __FILE__, 'cau_install' );
@@ -202,7 +216,7 @@ function cau_frontend() { ?>
202
 
203
  <div class='wrap cau_content_wrap cau_content'>
204
 
205
- <h1 class="wp-heading-inline"><?php _e('Companion Auto Update', 'companion-auto-update'); ?></h1>
206
 
207
  <hr class="wp-header-end">
208
 
@@ -224,7 +238,7 @@ function cau_frontend() { ?>
224
  foreach ( $allowedPages as $page => $title ) {
225
  echo "<a href='".cau_url( $page )."' id='tab-".$page."' class='nav-tab "._active_tab( $page )."'>".$title;
226
  if( $page == 'status' ) {
227
- if( cau_pluginHasIssues() ) {
228
  echo "<span class='cau_melding level-".cau_pluginIssueLevels()."'></span>";
229
  } else {
230
  echo "<span class='cau_melding level-okay'></span>";
@@ -305,7 +319,6 @@ require_once( plugin_dir_path( __FILE__ ) . 'cau_emails.php' );
305
  // Add settings link on plugin page
306
  function cau_settings_link( $links ) {
307
 
308
-
309
  $settings_link = '<a href="'.cau_url( 'dashboard' ).'">'.__( 'Settings' ).'</a>';
310
  $settings_link2 = '<a href="https://translate.wordpress.org/projects/wp-plugins/companion-auto-update">'.__( 'Help us translate', 'companion-auto-update' ).'</a>';
311
  $settings_link3 = '<a href="'.cau_donateUrl().'">'.__( 'Donate to help development', 'companion-auto-update' ).'</a>';
@@ -335,6 +348,10 @@ class CAU_auto_update {
335
  global $wpdb;
336
  $table_name = $wpdb->prefix . "auto_updates";
337
 
 
 
 
 
338
  // Enable for major updates
339
  $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'major'");
340
  foreach ( $configs as $config ) {
@@ -375,12 +392,8 @@ class CAU_auto_update {
375
  foreach ( $configs as $config ) {
376
  if( $config->onoroff == 'on' ) {
377
  add_filter( 'auto_core_update_send_email', '__return_true' ); // Core updates
378
- add_filter( 'auto_plugin_update_send_email', '__return_true' ); // Plugin updates
379
- add_filter( 'auto_theme_update_send_email', '__return_true' ); // Theme updates
380
  } else {
381
  add_filter( 'auto_core_update_send_email', '__return_false' ); // Core updates
382
- add_filter( 'auto_plugin_update_send_email', '__return_false' ); // Plugin updates
383
- add_filter( 'auto_theme_update_send_email', '__return_false' ); // Theme updates
384
  }
385
  }
386
 
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
18
 
19
  // Load translations
20
  function cau_init() {
21
+ load_plugin_textdomain( 'companion-auto-update', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); // Load language files (for backwards compat mostly)
22
+ add_filter( 'plugins_auto_update_enabled', '__return_false' ); // Turn off default WP5.5 plugin update features to avoid confusion
23
+ add_filter( 'themes_auto_update_enabled', '__return_false' ); // Turn off default WP5.5 theme update features to avoid confusion
24
  }
25
  add_action( 'init', 'cau_init' );
26
 
40
  if (! wp_next_scheduled ( 'cau_set_schedule_mail' )) wp_schedule_event( time(), 'daily', 'cau_set_schedule_mail'); // Set schedule for mail etc.
41
  if (! wp_next_scheduled ( 'cau_custom_hooks_plugins' )) wp_schedule_event( time(), 'daily', 'cau_custom_hooks_plugins'); // Run custom hooks on plugin updates
42
  if (! wp_next_scheduled ( 'cau_custom_hooks_themes' )) wp_schedule_event( time(), 'daily', 'cau_custom_hooks_themes'); // Run custom hooks on theme updates
43
+ if (! wp_next_scheduled ( 'cau_log_updater' )) wp_schedule_event( ( time() - 1800 ), 'daily', 'cau_log_updater'); // Keep the log up to date
44
  }
45
  add_action( 'cau_set_schedule_mail', 'cau_check_updates_mail' );
46
  add_action( 'wp_update_plugins', 'cau_run_custom_hooks_p' );
47
  add_action( 'wp_update_themes', 'cau_run_custom_hooks_t' );
48
  add_action( 'wp_version_check', 'cau_run_custom_hooks_c' );
49
 
50
+ // Hourly event to keep the log up to date
51
+ function cau_keep_log_uptodate() {
52
+ cau_savePluginInformation(); // Check for new plugins and themes
53
+ cau_check_delayed(); // Check for plugin delays
54
+ }
55
+ add_action( 'cau_log_updater', 'cau_keep_log_uptodate' );
56
+
57
  // Redirect to welcome screen on activation of plugin
58
  function cau_pluginActivateWelcome() {
59
  add_option( 'cau_redirectToWelcomeScreen', true );
68
  }
69
  }
70
  }
71
+ add_action( 'admin_init', 'cau_pluginRedirectWelcomeScreen' );
72
 
73
  // Donate url
74
  function cau_donateUrl() {
77
 
78
  // Database version
79
  function cau_db_version() {
80
+ return '3.7.0';
81
  }
82
  function cau_database_creation() {
83
 
102
  oldVersion VARCHAR(10) NOT NULL,
103
  newVersion VARCHAR(10) NOT NULL,
104
  method VARCHAR(10) NOT NULL,
105
+ put_on_hold VARCHAR(100) DEFAULT '0',
106
  UNIQUE KEY id (id)
107
  )";
108
 
143
  $toemail = get_option('admin_email');
144
 
145
  // Update configs
146
+ if( !cau_check_if_exists( 'plugins' ) ) $wpdb->insert( $table_name, array( 'name' => 'plugins', 'onoroff' => 'on' ) );
147
+ if( !cau_check_if_exists( 'themes' ) ) $wpdb->insert( $table_name, array( 'name' => 'themes', 'onoroff' => 'on' ) );
148
+ if( !cau_check_if_exists( 'minor' ) ) $wpdb->insert( $table_name, array( 'name' => 'minor', 'onoroff' => 'on' ) );
149
+ if( !cau_check_if_exists( 'major' ) ) $wpdb->insert( $table_name, array( 'name' => 'major', 'onoroff' => '' ) );
150
 
151
  // Email configs
152
+ if( !cau_check_if_exists( 'email' ) ) $wpdb->insert( $table_name, array( 'name' => 'email', 'onoroff' => '' ) );
153
+ if( !cau_check_if_exists( 'send' ) ) $wpdb->insert( $table_name, array( 'name' => 'send', 'onoroff' => '' ) );
154
+ if( !cau_check_if_exists( 'sendupdate' ) ) $wpdb->insert( $table_name, array( 'name' => 'sendupdate', 'onoroff' => '' ) );
155
+ if( !cau_check_if_exists( 'sendoutdated' ) ) $wpdb->insert( $table_name, array( 'name' => 'sendoutdated', 'onoroff' => '' ) );
156
 
157
  // Advanced
158
+ if( !cau_check_if_exists( 'notUpdateList' ) ) $wpdb->insert( $table_name, array( 'name' => 'notUpdateList', 'onoroff' => '' ) );
159
+ if( !cau_check_if_exists( 'translations' ) ) $wpdb->insert( $table_name, array( 'name' => 'translations', 'onoroff' => 'on' ) );
160
+ if( !cau_check_if_exists( 'wpemails' ) ) $wpdb->insert( $table_name, array( 'name' => 'wpemails', 'onoroff' => 'on' ) );
161
+ if( !cau_check_if_exists( 'notUpdateListTh' ) ) $wpdb->insert( $table_name, array( 'name' => 'notUpdateListTh', 'onoroff' => '' ) );
162
 
163
  // Stuff
164
+ if( !cau_check_if_exists( 'html_or_text' ) ) $wpdb->insert( $table_name, array( 'name' => 'html_or_text', 'onoroff' => 'html' ) );
165
 
166
  // Advanced
167
+ if( !cau_check_if_exists( 'allow_administrator' ) ) $wpdb->insert( $table_name, array( 'name' => 'allow_administrator', 'onoroff' => 'on' ) );
168
+ if( !cau_check_if_exists( 'allow_editor' ) ) $wpdb->insert( $table_name, array( 'name' => 'allow_editor', 'onoroff' => '' ) );
169
+ if( !cau_check_if_exists( 'allow_author' ) ) $wpdb->insert( $table_name, array( 'name' => 'allow_author', 'onoroff' => '' ) );
170
+ if( !cau_check_if_exists( 'ignore_seo' ) ) $wpdb->insert( $table_name, array( 'name' => 'ignore_seo', 'onoroff' => '' ) );
171
+ if( !cau_check_if_exists( 'ignore_cron' ) ) $wpdb->insert( $table_name, array( 'name' => 'ignore_cron', 'onoroff' => '' ) );
172
+ if( !cau_check_if_exists( 'advanced_info_emails' ) ) $wpdb->insert( $table_name, array( 'name' => 'advanced_info_emails', 'onoroff' => '' ) );
173
+ if( !cau_check_if_exists( 'update_delay' ) ) $wpdb->insert( $table_name, array( 'name' => 'update_delay', 'onoroff' => '' ) );
174
+ if( !cau_check_if_exists( 'update_delay_days' ) ) $wpdb->insert( $table_name, array( 'name' => 'update_delay_days', 'onoroff' => '' ) );
175
 
176
  }
177
  register_activation_hook( __FILE__, 'cau_install' );
216
 
217
  <div class='wrap cau_content_wrap cau_content'>
218
 
219
+ <h1 class="wp-heading-inline"><?php _e( 'Companion Auto Update', 'companion-auto-update' ); ?></h1>
220
 
221
  <hr class="wp-header-end">
222
 
238
  foreach ( $allowedPages as $page => $title ) {
239
  echo "<a href='".cau_url( $page )."' id='tab-".$page."' class='nav-tab "._active_tab( $page )."'>".$title;
240
  if( $page == 'status' ) {
241
+ if( cau_pluginHasIssues() ) {
242
  echo "<span class='cau_melding level-".cau_pluginIssueLevels()."'></span>";
243
  } else {
244
  echo "<span class='cau_melding level-okay'></span>";
319
  // Add settings link on plugin page
320
  function cau_settings_link( $links ) {
321
 
 
322
  $settings_link = '<a href="'.cau_url( 'dashboard' ).'">'.__( 'Settings' ).'</a>';
323
  $settings_link2 = '<a href="https://translate.wordpress.org/projects/wp-plugins/companion-auto-update">'.__( 'Help us translate', 'companion-auto-update' ).'</a>';
324
  $settings_link3 = '<a href="'.cau_donateUrl().'">'.__( 'Donate to help development', 'companion-auto-update' ).'</a>';
348
  global $wpdb;
349
  $table_name = $wpdb->prefix . "auto_updates";
350
 
351
+ // Disable WP emails
352
+ add_filter( 'auto_plugin_update_send_email', '__return_false' ); // Plugin updates
353
+ add_filter( 'auto_theme_update_send_email', '__return_false' ); // Theme updates
354
+
355
  // Enable for major updates
356
  $configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'major'");
357
  foreach ( $configs as $config ) {
392
  foreach ( $configs as $config ) {
393
  if( $config->onoroff == 'on' ) {
394
  add_filter( 'auto_core_update_send_email', '__return_true' ); // Core updates
 
 
395
  } else {
396
  add_filter( 'auto_core_update_send_email', '__return_false' ); // Core updates
 
 
397
  }
398
  }
399
 
index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ # Silence is golden.
readme.txt CHANGED
@@ -5,31 +5,37 @@ 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.6.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
- This plugin automatically updates all plugins, all themes and the wordpress core in the background.
13
 
14
  == Description ==
15
 
16
- = Keep your website safe! =
17
- We understand that you might not always be able to check if your wordpress site has any updates that need to be installed, especially when you maintain multiple websites keeping them up-to-date can be a lot of work.
18
- This plugin enables background auto-updating for all plugins, all themes and the wordpress core (both major and minor updates).
19
- We give you full control over what is updated and what isn't, via the settings page you can easily disallow auto-updating for either plugins, themes or wordpress core.
20
 
21
- = Available settings =
22
- Full control, that's what this plugin is all about. We offer settings to enable or disable automatic updating for plugins, themes, wordpress core updates (both minor and major can be changed separately) and for translation files.
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  = Know what's happening =
25
  We want you to know what's happening on your website. This plugin offers settings for various email notifications. We can send you an email when an update is available, when a plugin has been updated or when wordpress has been updated.
26
  But if you don't want to recieve emails about this you can still log in and view the changelog to see what happened.
27
 
28
- = Advanced Controls =
29
- You might not want to update all plugins or themes automatically, no problem! With the advanced filters you can easily select single plugins and/or themes that you want the plugin to skip. We can notify you when one of the selected plugins has an update ready so you can then head over to your dashboard and update them manually.
30
-
31
- = Scheduling =
32
- By default the updater will run twice a day, but you can change this to every hour or to daily. When set to daily you can even set the time at which it should run, this way you can make sure that it will not overload your server by letting it run at times with less activity. The same settings can be set for notifications.
33
 
34
  == Installation ==
35
 
@@ -58,6 +64,13 @@ Settings can be found trough Tools > Auto Updater
58
 
59
  Your feedback is what made this plugin what is and what it’ll become so keep the feedback coming! To see what features you've suggested and what we're working on [read our blogpost here](https://codeermeneer.nl/blog/companion-auto-update-and-its-future/)
60
 
 
 
 
 
 
 
 
61
 
62
  == Screenshots ==
63
 
@@ -68,15 +81,31 @@ Your feedback is what made this plugin what is and what it’ll become so keep t
68
 
69
  == Changelog ==
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  = 3.6 (August 12, 2020) =
72
- * Tweak: Added Theme and Core update method the log
73
- * Tweak: Few WordPress 5.5 improvements
74
  * New: Added an "after core update" hook [More info](https://codeermeneer.nl/documentation/codex-auto-updater/)
75
  * New: Select which userroles can access settings. (Defaults to only administrators)
 
 
76
 
77
  = 3.5.5 (August 5, 2020) =
78
  * Fix: Added better multisite support
79
- * Better status log: We've added a bunch more checks and you can now see more passed checks.
80
  * Support for WordPress 5.5
81
 
82
  = 3.5.4.1 (June 20, 2020) =
@@ -88,12 +117,9 @@ Your feedback is what made this plugin what is and what it’ll become so keep t
88
  * Fix: Error with Companion Auto Update Database Update
89
  * Fix: Schedule interval duplicates
90
 
91
- Also: Check out what features we're working on at [our blogpost](https://codeermeneer.nl/blog/companion-auto-update-and-its-future/)
92
-
93
  = 3.5.3 (June 5, 2020) =
94
- * NEW: We're working on a better update log. You should see the Update method (Manual/Automatic) in the log now. (Only works for Plugins right now)
95
  Please report any issues with this feature over at our sticky post: [Problems with the Update method in the new update log?](https://wordpress.org/support/topic/problems-with-the-update-method-in-the-new-update-log/)
96
-
97
  * Fix: Not able to see checks in boxes (reverted back to before it all went wrong)
98
  * Fix: Error date_default_timezone_set(): Timezone ID +00:00 is invalid
99
  * Tweak: The status tab will no longer show turned-off settings as an error
@@ -109,181 +135,10 @@ Please report any issues with this feature over at our sticky post: [Problems wi
109
  * Tweak: Various minor security improvements
110
 
111
  = 3.5.0 (March 5, 2020) =
112
- * We've had to (temporarily) disable the theme filter because it was causing issues on some installations. We'll try to get it working again in a future update.
113
- * We should've fixed an issue where on occasion nothing would update
114
- * Made some improvements to the "Fix it" button for the AUTOMATIC_UPDATER_DISABLED error
115
- * In version 3.4.6 we've changed to HTML emails rather than plain text, in this version you can opt to change it back to plain text emails
116
- * Redesigned dashboard: We've changed the dashboard, moved both the settings page and de support page to the dashboard. Please let us know if you like this change or not.
117
-
118
- = 3.4.8 (January 2, 2020) =
119
- * This update brings a few under the hood changes to ensure better updates in the future
120
- * We've also fixed a (rare) Undefined variable: headers error
121
-
122
- = 3.4.7 (January 1, 2020) =
123
- * Fix: Cronjob error
124
-
125
- = 3.4.6 (December 31, 2019) =
126
- * New: Filter themes, just like you do with plugins
127
- * New: Link to the release notes of the plugin in the email
128
- * Fixed: Sometimes the pluginfilter wouldn't save when using a lot of plugins
129
- * Fixed: A few errors regarding emails
130
- * Fixed: Errors regarding the set timezone
131
- * Tweak: Changing settings no longer requires page reload to see the changes
132
- * Few tweaks in code for better performance
133
-
134
- = 3.4.5 (November 26, 2019) =
135
- * Fix: Some of you reported several database errors in version 3.4.4, these are fixed now
136
- * Tweak: Few minor design changes to fit the changes made in WordPress 5.3
137
- * Tweak: Explained that emails will also be sent on manual plugin updates
138
-
139
- = 3.4.4 (November 16, 2019) =
140
- * Sometimes the database wouldn't correctly update to the newest version, we've added a manual button for this now.
141
- * Sometimes plugins excluded from the updater would still update, this should be fixed now.
142
-
143
- = 3.4.3 (November 8, 2019) =
144
- * New: Options for "Weekly", "Twice a month" and "Monthly" for scheduling
145
- * New: Added Database version to status page
146
- * Tweak: cau_database_creation() query is no longer running on every page load, just on activation or updating of the plugin
147
-
148
- = 3.4.2 (June 28, 2019) =
149
- * Fixed: Times being all messed up
150
- * New: Set the time of email notifications
151
- * Fixed: Email notifications will no longer show as active on the status page when they actually aren't active
152
-
153
- = 3.4.1 (May 4, 2019) =
154
- * Fixed issue where sometimes settings wouldn't safe
155
- * Fixed issue where sometimes the status page would show incorrect times at events
156
-
157
- = 3.4.0 (April 4, 2019) =
158
- * (Actually) Fixed: Cronjobs disabled shouldn't be a 'critical error'
159
- * New status icon at the status tab to quicker see issues
160
- * Fixed: You're not allowed to view error
161
-
162
- = 3.3.9 (March 11, 2019) =
163
- * Fix: Sometimes emails would be sent twice
164
- * Fix: Cronjobs disabled shouldn't be a critical error
165
- * Fix: Sometimes update reminder emails would not send at all
166
- * Improvement: Removed "Howdy" from emails
167
- * Improvement: Fixed a few typos
168
-
169
- = 3.3.8 (March 1, 2019) =
170
- * Fix: Show correct timestamp in log
171
- * Fix: Fixed a few typos
172
- * New: Filter the log for Plugins, Themes or All
173
- * New: Click on a plugins' name to show the changelog
174
- * Improvement: Added more checks to the status log
175
- * Improvement: Added better documentation when issues show up
176
-
177
- = 3.3.7 (February 2, 2019) =
178
- * Fix: In some rare cases various errors showed up when saving settings, this is fixed now
179
-
180
- = 3.3.6 (January 14, 2019) =
181
- * Security improvements
182
-
183
- = 3.3.5 (January 5, 2019) =
184
- * New: See WordPress & PHP version on the status page
185
- * New: WordPress core updates now show in status log
186
- * Improvement: Split Update log and Status tab
187
- * Improvement: Update log now shows new version (no old version yet, sorry)
188
- * Improvement: If major updates are disabled the update nag will no longer show
189
- * Fix: Error Notice: Undefined index: menloc
190
-
191
- = 3.3.4 (December 24, 2018) =
192
- * Improved: Few tweaks to the new warning icon
193
- * Improved: Changed a few strings to be clearer to understand
194
-
195
- = 3.3.3 (December 22, 2018) =
196
- * New: Set the time for Core updates
197
- * New: Welcome screen after plugin activation to help new users find their way
198
- * New: Warning icon in the top bar when something is wrong
199
- * Improvement: More logs have been added to the status page
200
- * Improvement: Redesigned support tab
201
- * Improvement: We've checked all the text in the plugin and made some changes to make translating this plugin a little bit easier
202
- * Improvement: The mobile design has been improved big time
203
- * Fix: Some sites still recieved core update emails even when disabled, this should not happen anymore.
204
-
205
- = 3.3.2 (December 20, 2018) =
206
- * Global error? No need to contact us anymore, let the plugin fix it for you!
207
-
208
- = 3.3.1 (November 15, 2018) =
209
- * Fix: Can't Find constant error
210
- * Improvement: We've listened, Scheduling and Plugin filter are now two seperate tabs and Plugin filter is renamed to Select plugins
211
- * Improvement: Major core updates are now disabled by default for new installs
212
-
213
- = 3.3.0 (November 5, 2018) =
214
- * New: Custom hooks afer succesfull update, [How to use custom hooks in Companion Auto Update](https://codeermeneer.nl/stuffs/codex-auto-updater/)
215
-
216
- = 3.2.5 (October 26, 2018) =
217
- * Improvement: Few minor tweaks to the critical error messages
218
-
219
- = 3.2.4 (October 25, 2018) =
220
- * Fix: Errors with PHP 7.2
221
-
222
- = 3.2.3 (October 25, 2018) =
223
- * Improved: New error notification when plugins runs into a critical error
224
-
225
- = 3.2.2 (October 5, 2018) =
226
- * Fix: Parse error: syntax error, unexpected [ in cau_functions.php on line 247
227
-
228
- = 3.2.1 ( October 2, 2018) =
229
- * Fix: Cross-site request forgery (CSRF)/local file inclusion (LFI) vulnerability.
230
-
231
- = 3.2.0 (August 11, 2018) =
232
- * Improved: Email notifications just got better and now contain version numbers.
233
- * Improved: Explained the difference between major and minor WordPress core updates.
234
-
235
- = 3.1.5 (August 9, 2018) =
236
- * I almost feel silly for pushing this as an update but the theme update notification said theme instead of themes.
237
-
238
- = 3.1.4 (August 8, 2018) =
239
- * Fix: No theme update notification
240
-
241
- = 3.1.3 (August 3, 2018) =
242
- * Fix: Issue with , in links in email notifications
243
-
244
- = 3.1.2 (May 14, 2018) =
245
- * Fix error: Notice: Undefined index: cau_page
246
-
247
- = 3.1.1 (May 12, 2018) =
248
- * Reorganized the dashboard to cleaner
249
-
250
- = 3.1.0 (May 11, 2018) =
251
- * New: Status page. We've introduced a status page to be able to provide better help when an error occurs. This page will be updated with even more info in coming updates.
252
-
253
- = 3.0.9 (April 17, 2018) =
254
- * Fix: Successful update emails to multiple adresses. We took our time to really test this one but it works now! Promise!
255
- * Update available emails might still be broken.
256
- * Improvement: Email notifications no long show updates done in the last 2 days but instead changed depending on the interval of the emails.
257
-
258
- = 3.0.8 (March 22, 2018) =
259
- * Fix: Error "Notice: Only variables should be passed by reference"
260
-
261
- = 3.0.7 (March 15, 2018) =
262
- * We've recieved a bunch of feedback since the last few updates and we've listened!
263
- * If the schedule is NOT daily - hide the hours object. show it only when daily is selected.
264
- * Disable Notifications: Many requested a "Never" option for email notifications, this was already there, just on the dashboard. We want to keep this plugin clean so we're not going to add 2 settings for this, instead we now show a message stating "To disable email notifications go to the dashboard and uncheck everything under Email Notifications".
265
- * Some people reported settings on the schedule page not saving, they were saved but the page required a reload to display the changes. We get how this can be confusing so we've fixed this.
266
-
267
- = 3.0.6 (March 14, 2018) =
268
- * Fix: Support & Feedback tab not working
269
-
270
- = 3.0.5 (March 14, 2018) =
271
- * Fix: Time schedule scheduling an hour before set time
272
- * New: Support & Feedback page
273
-
274
- = 3.0.4 (March 12, 2018) =
275
- * Fix: Schedule Time not able to set! [Read support topic here](https://wordpress.org/support/topic/schedule-time-not-able-to-set/)
276
-
277
- = 3.0.3 (February 28, 2018) =
278
- * Added update time to changelog
279
- * Minor tweaks to mobile design
280
-
281
- = 3.0.2 (February 10, 2018) =
282
- * Security improvements
283
-
284
- = 3.0 (February 10, 2018) =
285
- * New: Set the update time, many requested this feature so here it is :)
286
- * New: Update log
287
- * Fixed issue where multiple emailaddresses wouldn't work.
288
 
289
  [View full changelog](https://codeermeneer.nl/stuffs/auto-updater-changelog/)
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
 
12
+ Manage all updates on your WordPress site. Stay in the know with several optional e-mail notifications and logs. For free.
13
 
14
  == Description ==
15
 
16
+ Companion Auto Update is a powerful and completely free plugin that allows you to manage all the updates on your WordPress site. Our aim is to give you the best control over these updates and stay in the know at all times.
 
 
 
17
 
18
+ We understand that you might not always be able to check if your WordPress site has any updates that need to be installed. Especially when you maintain multiple websites keeping them up-to-date can be a lot of work. This plugin can help you with that. We'll keep your site up-to-date and keep you posted about what's happening and notify you when we need your help with something.
19
+
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
+
27
+ = Full control over everything =
28
+ Full control, that's what this plugin is all about. With this plugin you can enable (or disable) automatic updating for plugins, themes, WordPress core updates (both minor and major can be changed separately) and for translation files. Don't want to run the updater for all plugins? Don't worry, just disable auto updating for the plugins you'd like to skip and we can even notify you when there's an update for these plugins so you can go and update them yourself.
29
+
30
+ = Scheduling =
31
+ By default we'll check for updates twice a day but you can change this to several different options if you'd like. When choosing to update on a daily basis you can even select at what time you'd like it to run. Besides the updaters you can also schedule te notifications, want to update every hour but only recieve notifications once a day? No problem!
32
+ Sometimes developers will push an update that will cause errors on your site, they'll often fix it within a day but if the updater has run in the mean time it can cause all kinds of issues. Now you can choose to delay updates with an x number of days to prevent this from happening.
33
 
34
  = Know what's happening =
35
  We want you to know what's happening on your website. This plugin offers settings for various email notifications. We can send you an email when an update is available, when a plugin has been updated or when wordpress has been updated.
36
  But if you don't want to recieve emails about this you can still log in and view the changelog to see what happened.
37
 
38
+ If you have a feature suggestion or idea you’d like to see in the plugin, we’d love to hear about it! [Suggest a Feature](https://codeermeneer.nl/contact/)
 
 
 
 
39
 
40
  == Installation ==
41
 
64
 
65
  Your feedback is what made this plugin what is and what it’ll become so keep the feedback coming! To see what features you've suggested and what we're working on [read our blogpost here](https://codeermeneer.nl/blog/companion-auto-update-and-its-future/)
66
 
67
+ = What's the difference between WordPress 5.5 and this plugin? =
68
+
69
+ WordPress 5.5 was released recently and it packs tons of new features. One of those features is auto-updates for plugins and themes. Something Companion Auto Update does too.
70
+ So obviously, some of you wondered what the difference would be between the default WordPress method and the one offered by Companion Auto Update and I figured I’d quickly write a blog about it, explaining the differences.
71
+
72
+ [You can read this blogpost here](https://codeermeneer.nl/blog/wordpress-5-5-versus-companion-auto-update/)
73
+
74
 
75
  == Screenshots ==
76
 
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.
87
+ * New: Choose to see more info in the emails (like the time at which the update happened)
88
+ * Fix: "Contact for support" button will work again
89
+ * Fix: Fixed a few PHP errors
90
+ * Tweak: Made improvements to the "Fix it" button for the "All automatic updates are disabled" error.
91
+ * Tweak: You can now choose to ignore the "Search Engine Visibility" and "Cronjobs" warnings
92
+ * Tweak: Reports on the Site Health page will only show a summary and point to the status page for more information and possible fixes
93
+ * Tweak: Removed cronjob check and Search Engine Visibility check from site health
94
+ * Tweak: E-mails are now fully translatable
95
+ * Tweak: Renamed Core notifications to WordPress notifications
96
+ * Tweak: WordPress plugin and theme update notifications are now disabled
97
+
98
+ Also: Check out what features we're working on at [our blogpost](https://codeermeneer.nl/blog/companion-auto-update-and-its-future/)
99
+
100
  = 3.6 (August 12, 2020) =
 
 
101
  * New: Added an "after core update" hook [More info](https://codeermeneer.nl/documentation/codex-auto-updater/)
102
  * New: Select which userroles can access settings. (Defaults to only administrators)
103
+ * Tweak: Added Theme and Core update method the log
104
+ * Tweak: Few WordPress 5.5 improvements
105
 
106
  = 3.5.5 (August 5, 2020) =
107
  * Fix: Added better multisite support
108
+ * Tweak: We've added a bunch more checks to the status page and you can now see more passed checks.
109
  * Support for WordPress 5.5
110
 
111
  = 3.5.4.1 (June 20, 2020) =
117
  * Fix: Error with Companion Auto Update Database Update
118
  * Fix: Schedule interval duplicates
119
 
 
 
120
  = 3.5.3 (June 5, 2020) =
121
+ * New: We're working on a better update log. You should see the Update method (Manual/Automatic) in the log now. (Only works for Plugins right now)
122
  Please report any issues with this feature over at our sticky post: [Problems with the Update method in the new update log?](https://wordpress.org/support/topic/problems-with-the-update-method-in-the-new-update-log/)
 
123
  * Fix: Not able to see checks in boxes (reverted back to before it all went wrong)
124
  * Fix: Error date_default_timezone_set(): Timezone ID +00:00 is invalid
125
  * Tweak: The status tab will no longer show turned-off settings as an error
135
  * Tweak: Various minor security improvements
136
 
137
  = 3.5.0 (March 5, 2020) =
138
+ * New: In version 3.4.6 we've changed to HTML emails rather than plain text, in this version you can opt to change it back to plain text emails
139
+ * Fix: We've 'fixed an issue where on occasion nothing would update
140
+ * Tweak: Made some improvements to the "Fix it" button for the AUTOMATIC_UPDATER_DISABLED error
141
+ * Tweak: We've changed the dashboard, moved both the settings page and de support page to the dashboard. Please let us know if you like this change or not.
142
+ * Bug: We've had to (temporarily) disable the theme filter because it was causing issues on some installations. We'll try to get it working again in a future update.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
 
144
  [View full changelog](https://codeermeneer.nl/stuffs/auto-updater-changelog/)