deleted plugin Companion Auto Update version 3.9.2

This commit is contained in:
KawaiiPunk 2024-12-16 13:52:00 +00:00 committed by Gitium
parent 9cbc2cb832
commit e3858f0710
23 changed files with 0 additions and 5027 deletions

View File

@ -1,577 +0,0 @@
<?php
// Event schedules failed
if ( !wp_next_scheduled ( 'cau_set_schedule_mail' ) ) {
echo '<div id="message" class="error"><p><b>'.__( 'Companion Auto Update was not able to set the event for sending you emails, please re-activate the plugin in order to set the event', 'companion-auto-update' ).'.</b></p></div>';
}
// Database requires an update
if ( cau_incorrectDatabaseVersion() ) {
echo '<div id="message" class="error"><p><b>'.__( 'Companion Auto Update Database Update', 'companion-auto-update' ).' &ndash;</b>
'.__( 'We need you to update to the latest database version', 'companion-auto-update' ).'. <a href="'.cau_url( 'status' ).'&run=db_update" class="button button-alt" style="background: #FFF;">'.__( 'Run updater now', 'companion-auto-update' ).'</a></p></div>';
}
// Update log DB is empty
if ( cau_updateLogDBisEmpty() ) {
echo '<div id="message" class="error"><p><b>'.__( 'Companion Auto Update Database Update', 'companion-auto-update' ).' &ndash;</b>
'.__( 'We need to add some information to your database', 'companion-auto-update' ).'. <a href="'.cau_url( 'status' ).'&run=db_info_update" class="button button-alt" style="background: #FFF;">'.__( 'Run updater now', 'companion-auto-update' ).'</a></p></div>';
}
// Save settings
if( isset( $_POST['submit'] ) ) {
check_admin_referer( 'cau_save_settings' );
global $wpdb;
$table_name = $wpdb->prefix . "auto_updates";
// Auto updater
$plugins = isset( $_POST['plugins'] ) ? sanitize_text_field( $_POST['plugins'] ) : '';
$themes = isset( $_POST['themes'] ) ? sanitize_text_field( $_POST['themes'] ) : '';
$minor = isset( $_POST['minor'] ) ? sanitize_text_field( $_POST['minor'] ) : '';
$major = isset( $_POST['major'] ) ? sanitize_text_field( $_POST['major'] ) : '';
$translations = isset( $_POST['translations'] ) ? sanitize_text_field( $_POST['translations'] ) : '';
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'plugins'", $plugins ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'themes'", $themes ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'minor'", $minor ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'major'", $major ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'translations'", $translations ) );
// Emails
$send = isset( $_POST['cau_send'] ) ? sanitize_text_field( $_POST['cau_send'] ) : '';
$sendupdate = isset( $_POST['cau_send_update'] ) ? sanitize_text_field( $_POST['cau_send_update'] ) : '';
$sendoutdated = isset( $_POST['cau_send_outdated'] ) ? sanitize_text_field( $_POST['cau_send_outdated'] ) : '';
$wpemails = isset( $_POST['wpemails'] ) ? sanitize_text_field( $_POST['wpemails'] ) : '';
$email = isset( $_POST['cau_email'] ) ? sanitize_text_field( $_POST['cau_email'] ) : '';
$html_or_text = isset( $_POST['html_or_text'] ) ? sanitize_text_field( $_POST['html_or_text'] ) : 'html';
$dbupdateemails = isset( $_POST['dbupdateemails'] ) ? sanitize_text_field( $_POST['dbupdateemails'] ) : '';
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'email'", $email ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'send'", $send ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'sendupdate'", $sendupdate ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'sendoutdated'", $sendoutdated ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'wpemails'", $wpemails ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'html_or_text'", $html_or_text ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'dbupdateemails'", $dbupdateemails ) );
// Advanced
$allow_editor = isset( $_POST['allow_editor'] ) ? sanitize_text_field( $_POST['allow_editor'] ) : '';
$allow_author = isset( $_POST['allow_author'] ) ? sanitize_text_field( $_POST['allow_author'] ) : '';
$advanced_info_emails = isset( $_POST['advanced_info_emails'] ) ? sanitize_text_field( $_POST['advanced_info_emails'] ) : '';
$plugin_links_emails = isset( $_POST['plugin_links_emails'] ) ? sanitize_text_field( $_POST['plugin_links_emails'] ) : '';
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'allow_editor'", $allow_editor ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'allow_author'", $allow_author ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'advanced_info_emails'", $advanced_info_emails ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'plugin_links_emails'", $plugin_links_emails ) );
// Delay
$update_delay = isset( $_POST['update_delay'] ) ? sanitize_text_field( $_POST['update_delay'] ) : '';
$update_delay_days = isset( $_POST['update_delay_days'] ) ? sanitize_text_field( $_POST['update_delay_days'] ) : '';
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'update_delay'", $update_delay ) );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'update_delay_days'", $update_delay_days ) );
// Intervals
// Set variables
$plugin_sc = sanitize_text_field( $_POST['plugin_schedule'] );
$theme_sc = sanitize_text_field( $_POST['theme_schedule'] );
$core_sc = sanitize_text_field( $_POST['core_schedule'] );
$schedule_mail = sanitize_text_field( $_POST['update_notifications'] );
$outdated_notifier = sanitize_text_field( $_POST['outdated_notifier'] );
// First clear schedules
wp_clear_scheduled_hook( 'wp_update_plugins' );
wp_clear_scheduled_hook( 'wp_update_themes' );
wp_clear_scheduled_hook( 'wp_version_check' );
wp_clear_scheduled_hook( 'cau_set_schedule_mail' );
wp_clear_scheduled_hook( 'cau_custom_hooks_plugins' );
wp_clear_scheduled_hook( 'cau_custom_hooks_themes' );
wp_clear_scheduled_hook( 'cau_log_updater' );
wp_clear_scheduled_hook( 'cau_outdated_notifier' );
// Then set the new times
// Plugins
if( $plugin_sc == 'daily' ) {
$date = date( 'Y-m-d' );
$hours = sanitize_text_field( $_POST['plugin_schedule-sethour'] );
$minutes = sanitize_text_field( $_POST['plugin_schedule-setminutes'] );
$seconds = date( 's' );
$fullDate = $date.' '.$hours.':'.$minutes.':'.$seconds;
$pluginSetTime = strtotime( $fullDate );
wp_schedule_event( $pluginSetTime, $plugin_sc, 'wp_update_plugins' );
wp_schedule_event( $pluginSetTime, $plugin_sc, 'cau_custom_hooks_plugins' );
wp_schedule_event( ( $pluginSetTime - 1800 ), $plugin_sc, 'cau_log_updater' );
} else {
wp_schedule_event( time(), $plugin_sc, 'wp_update_plugins' );
wp_schedule_event( time(), $plugin_sc, 'cau_custom_hooks_plugins' );
wp_schedule_event( ( time() - 1800 ), $plugin_sc, 'cau_log_updater' );
}
// Themes
if( $theme_sc == 'daily' ) {
$dateT = date( 'Y-m-d' );
$hoursT = sanitize_text_field( $_POST['theme_schedule-sethour'] );
$minutesT = sanitize_text_field( $_POST['theme_schedule-setminutes'] );
$secondsT = date( 's' );
$fullDateT = $dateT.' '.$hoursT.':'.$minutesT.':'.$secondsT;
$themeSetTime = strtotime( $fullDateT );
wp_schedule_event( $themeSetTime, $theme_sc, 'wp_update_themes' );
wp_schedule_event( $themeSetTime, $theme_sc, 'cau_custom_hooks_themes' );
} else {
wp_schedule_event( time(), $theme_sc, 'wp_update_themes' );
wp_schedule_event( time(), $theme_sc, 'cau_custom_hooks_themes' );
}
// Core
if( $core_sc == 'daily' ) {
$dateC = date( 'Y-m-d' );
$hoursC = sanitize_text_field( $_POST['core_schedule-sethour'] );
$minutesC = sanitize_text_field( $_POST['core_schedule-setminutes'] );
$secondsC = date( 's' );
$fullDateC = $dateC.' '.$hoursC.':'.$minutesC.':'.$secondsC;
$coreSetTime = strtotime( $fullDateC );
wp_schedule_event( $coreSetTime, $core_sc, 'wp_version_check' );
} else {
wp_schedule_event( time(), $core_sc, 'wp_version_check' );
}
// Update notifications
if( $schedule_mail == 'daily' ) {
$dateT = date( 'Y-m-d' );
$hoursT = sanitize_text_field( $_POST['update_notifications-sethour'] );
$minutesT = sanitize_text_field( $_POST['update_notifications-setminutes'] );
$secondsT = date( 's' );
$fullDateT = $dateT.' '.$hoursT.':'.$minutesT.':'.$secondsT;
$emailSetTime = strtotime( $fullDateT );
wp_schedule_event( $emailSetTime, $schedule_mail, 'cau_set_schedule_mail' );
} else {
wp_schedule_event( time(), $schedule_mail, 'cau_set_schedule_mail' );
}
// Outdated notifications
if( $outdated_notifier == 'daily' ) {
$dateT = date( 'Y-m-d' );
$hoursT = sanitize_text_field( $_POST['outdated_notifier-sethour'] );
$minutesT = sanitize_text_field( $_POST['outdated_notifier-setminutes'] );
$secondsT = date( 's' );
$fullDateT = $dateT.' '.$hoursT.':'.$minutesT.':'.$secondsT;
$emailSetTime = strtotime( $fullDateT );
wp_schedule_event( $emailSetTime, $outdated_notifier, 'cau_outdated_notifier' );
} else {
wp_schedule_event( time(), $outdated_notifier, 'cau_outdated_notifier' );
}
echo '<div id="message" class="updated"><p><b>'.__( 'Settings saved.' ).'</b></p></div>';
}
// Welcome screen for first time viewers
if( isset( $_GET['welcome'] ) ) {
echo '<div class="welcome-to-cau welcome-bg" style="margin-bottom: 0px;">
<div class="welcome-image">
</div><div class="welcome-content">
<h3>'.__( 'Welcome to Companion Auto Update', 'companion-auto-update' ).'</h3>
<br />
<p><strong>'.__( 'You\'re set and ready to go', 'companion-auto-update' ).'</strong></p>
<p>'.__( 'The plugin is all set and ready to go with the recommended settings, but if you\'d like you can change them below.' ).'</p>
<br />
<p><strong>'.__( 'Get Started' ).': </strong> <a href="'.cau_url( 'pluginlist' ).'">'.__( 'Update filter', 'companion-auto-update' ).'</a> &nbsp; | &nbsp;
<strong>'.__( 'More Actions' ).': </strong> <a href="http://codeermeneer.nl/cau_poll/" target="_blank">'.__('Give feedback', 'companion-auto-update').'</a> - <a href="https://translate.wordpress.org/projects/wp-plugins/companion-auto-update/" target="_blank">'.__( 'Help us translate', 'companion-auto-update' ).'</a></p>
</div>
</div>';
}
$cs_hooks_p = wp_get_schedule( 'cau_custom_hooks_plugins' );
$cs_hooks_t = wp_get_schedule( 'cau_custom_hooks_themes' );
?>
<div class="cau-dashboard cau-column-wide">
<form method="POST">
<div class="welcome-to-cau update-bg cau-dashboard-box">
<h2 class="title"><?php _e('Auto Updater', 'companion-auto-update');?></h2>
<table class="form-table">
<tr>
<td>
<fieldset>
<?php
$plugins_on = ( cau_get_db_value( 'plugins' ) == 'on' ) ? "CHECKED" : "";
$themes_on = ( cau_get_db_value( 'themes' ) == 'on' ) ? "CHECKED" : "";
$minor_on = ( cau_get_db_value( 'minor' ) == 'on' ) ? "CHECKED" : "";
$major_on = ( cau_get_db_value( 'major' ) == 'on' ) ? "CHECKED" : "";
$translations_on = ( cau_get_db_value( 'translations' ) == 'on' ) ? "CHECKED" : "";
echo "<p><input id='plugins' name='plugins' type='checkbox' {$plugins_on}/><label for='plugins'>".__( 'Auto update plugins?', 'companion-auto-update' )."</label></p>";
echo "<p><input id='themes' name='themes' type='checkbox' {$themes_on}/><label for='themes'>".__( 'Auto update themes?', 'companion-auto-update' )."</label></p>";
echo "<p><input id='minor' name='minor' type='checkbox' {$minor_on}/><label for='minor'>".__( 'Auto update minor core updates?', 'companion-auto-update' )." <code class='majorMinorExplain'>6.0.0 > 6.0.1</code></label></p>";
echo "<p><input id='major' name='major' type='checkbox' {$major_on}/><label for='major'>".__( 'Auto update major core updates?', 'companion-auto-update' )." <code class='majorMinorExplain'>6.0.0 > 6.1.0</code></label></p>";
echo "<p><input id='translations' name='translations' type='checkbox' {$translations_on}/><label for='translations'>".__( 'Auto update translation files?', 'companion-auto-update' )."</label></p>";
?>
</fieldset>
</td>
</tr>
</table>
</div>
<div class="welcome-to-cau email-bg cau-dashboard-box">
<h2 class="title"><?php _e( 'Email Notifications', 'companion-auto-update' );?></h2>
<?php
$db_email = cau_get_db_value( 'email' );
$toemail = ( $db_email == '' ) ? get_option( 'admin_email' ) : $db_email;
$hot = cau_get_db_value( 'html_or_text' );
?>
<table class="form-table">
<tr>
<th scope="row"><?php _e( 'Update notifications', 'companion-auto-update' );?></th>
<td>
<p>
<input id="cau_send_update" name="cau_send_update" type="checkbox" <?php if( cau_get_db_value( 'sendupdate' ) == 'on' ) { echo 'checked'; } ?> />
<label for="cau_send_update"><?php _e( 'Send me emails when something has been updated.', 'companion-auto-update' );?></label>
</p>
<p>
<input id="cau_send" name="cau_send" type="checkbox" <?php if( cau_get_db_value( 'send' ) == 'on' ) { echo 'checked'; } ?> />
<label for="cau_send"><?php _e( 'Send me emails when an update is available.', 'companion-auto-update' );?></label>
</p>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Check for outdated software', 'companion-auto-update' );?></th>
<td>
<p>
<input id="cau_send_outdated" name="cau_send_outdated" type="checkbox" <?php if( cau_get_db_value( 'sendoutdated' ) == 'on' ) { echo 'checked'; } ?> />
<label for="cau_send_outdated"><?php _e( 'Be notified of plugins that have not been tested with the 3 latest major versions of WordPress.', 'companion-auto-update' );?></label>
</p>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Email Address', 'companion-auto-update' );?></th>
<td>
<p>
<label for="cau_email"><?php _e( 'To', 'companion-auto-update' ); ?>:</label>
<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 ); ?>" />
</p>
<p class="description"><?php _e('Seperate email addresses using commas.', 'companion-auto-update');?></p>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Use HTML in emails?', 'companion-auto-update' );?></th>
<td>
<p>
<select id='html_or_text' name='html_or_text'>
<option value='html' <?php if( $hot == 'html' ) { echo "SELECTED"; } ?>><?php _e( 'Use HTML', 'companion-auto-update' ); ?></option>
<option value='text' <?php if( $hot == 'text' ) { echo "SELECTED"; } ?>><?php _e( 'Use plain text', 'companion-auto-update' ); ?></option>
</select>
</p>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Show more info in emails', 'companion-auto-update' );?></th>
<td>
<p>
<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>
</p>
<p>
<label for="plugin_links_emails"><input name="plugin_links_emails" type="checkbox" id="plugin_links_emails" <?php if( cau_get_db_value( 'plugin_links_emails' ) == 'on' ) { echo "CHECKED"; } ?>> <?php _e( 'Show links to WordPress.org pages', 'companion-auto-update' ); ?></label>
</p>
</td>
</tr>
<tr>
<th scope="row">
<?php _e( 'WordPress notifications', 'companion-auto-update' );?>
<span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
<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>
</span>
</th>
<td>
<p>
<input id="wpemails" name="wpemails" type="checkbox" <?php if( cau_get_db_value( 'wpemails' ) == 'on' ) { echo 'checked'; } ?> />
<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>
</p>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Database update required', 'companion-auto-update' );?></th>
<td>
<p>
<input id="dbupdateemails" name="dbupdateemails" type="checkbox" <?php if( cau_get_db_value( 'dbupdateemails' ) == 'on' ) { echo 'checked'; } ?> />
<label for="dbupdateemails"><?php _e( 'Sometimes we\'ll need your help updating our database version to the latest version, check this box to allow us to send you an email about this.', 'companion-auto-update' ); ?></label>
</p>
</td>
</tr>
</table>
</div>
<div class="welcome-to-cau interval-bg cau-dashboard-box" style="overflow: hidden;">
<h2 class="title"><?php _e( 'Intervals', 'companion-auto-update' );?></h2>
<?php
function cau_show_interval_selection( $identiefier, $schedule ) {
// Get the info
$setValue = wp_get_schedule( $schedule );
$setTime = wp_next_scheduled( $schedule );
$setHour = date( 'H' , $setTime );
$setMinutes = date( 'i' , $setTime );
// Show interval selection
echo "<p>";
echo "<select name='$identiefier' id='$identiefier' class='schedule_interval wide interval_scheduler' data-timeblock='$identiefier'>";
foreach ( cau_wp_get_schedules() as $key => $value ) {
echo "<option "; if( $setValue == $key ) { echo "selected "; } echo "value='".$key."'>".$value."</option>";
}
echo "</select>";
echo "</p>";
// Set the time when daily is selected
echo "<div class='timeblock-$identiefier' style='display: none;'>";
echo "<div class='cau_schedule_input'>
<input type='number' min='0' max='23' name='".$identiefier."-sethour' value='$setHour' maxlength='2' >
</div><div class='cau_schedule_input_div'>
:
</div><div class='cau_schedule_input'>
<input type='number' min='0' max='59' name='".$identiefier."-setminutes' value='$setMinutes' maxlength='2' >
</div><div class='cau_shedule_notation'>
<span class='cau_tooltip'><span class='dashicons dashicons-editor-help'></span>
<span class='cau_tooltip_text'>".__( 'At what time should the updater run? Only works when set to <u>daily</u>.', 'companion-auto-update' )." - ".__( 'Time notation: 24H', 'companion-auto-update' )."</span>
</span>
</div>";
echo "</div>";
}
?>
<div class="welcome-column">
<h4><?php _e( 'Plugin update interval', 'companion-auto-update' );?></h4>
<?php cau_show_interval_selection( 'plugin_schedule', 'wp_update_plugins' ); ?>
</div>
<div class="welcome-column">
<h4><?php _e( 'Theme update interval', 'companion-auto-update' );?></h4>
<?php cau_show_interval_selection( 'theme_schedule', 'wp_update_themes' ); ?>
</div>
<div class="welcome-column">
<h4><?php _e( 'Core update interval', 'companion-auto-update' );?></h4>
<?php cau_show_interval_selection( 'core_schedule', 'wp_version_check' ); ?>
</div>
<p></p>
<div class="welcome-column">
<h4><?php _e( 'Update notifications', 'companion-auto-update' );?></h4>
<?php cau_show_interval_selection( 'update_notifications', 'cau_set_schedule_mail' ); ?>
</div>
<div class="welcome-column">
<h4><?php _e( 'Outdated software', 'companion-auto-update' );?></h4>
<?php cau_show_interval_selection( 'outdated_notifier', 'cau_outdated_notifier' ); ?>
</div>
</div>
<div class="welcome-to-cau advanced-bg cau-dashboard-box">
<h2 class="title"><?php _e( 'Advanced settings', 'companion-auto-update' ); ?></h2>
<?php
// Access
$accessallowed = cau_allowed_user_rights_array();
$has_editor = in_array( 'editor', $accessallowed ) ? true : false;
$has_author = in_array( 'author', $accessallowed ) ? true : false;
// Update delays
$has_updatedelay = ( cau_get_db_value( 'update_delay' ) == 'on' ) ? true : false;
?>
<table class="form-table">
<tbody>
<tr>
<th scope="row"><label><?php _e( 'Allow access to:', 'companion-auto-update' ); ?></label></th>
<td>
<p><label for="allow_administrator"><input name="allow_administrator" type="checkbox" id="allow_administrator" disabled="" checked=""><?php _e( 'Administrator', 'companion-auto-update' ); ?></label></p>
<p><label for="allow_editor"><input name="allow_editor" type="checkbox" id="allow_editor" <?php if( $has_editor ) { echo "CHECKED"; } ?>><?php _e( 'Editor', 'companion-auto-update' ); ?></label></p>
<p><label for="allow_author"><input name="allow_author" type="checkbox" id="allow_author" <?php if( $has_author ) { echo "CHECKED"; } ?>><?php _e( 'Author', 'companion-auto-update' ); ?></label></p>
</td>
</tr>
<tr>
<th scope="row"><label><?php _e( 'Delay updates', 'companion-auto-update' ); ?></label></th>
<td>
<p><label for="update_delay"><input name="update_delay" type="checkbox" id="update_delay" <?php echo $has_updatedelay ? "CHECKED" : ""; ?> ><?php _e( 'Delay updates', 'companion-auto-update' ); ?></label></p>
</td>
</tr>
<tr id='update_delay_days_block' <?php echo !$has_updatedelay ? "class='disabled_option'" : ""; ?>>
<th scope="row"><label><?php _e( 'Number of days', 'companion-auto-update' ); ?></label></th>
<td>
<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' ); ?>" />
<p><?php _e( 'For how many days should updates be put on hold?', 'companion-auto-update' ); ?></p>
<p><small><strong>Please note:</strong> Delaying updates does not work with WordPress updates yet.</small></p>
</td>
</tr>
</tbody>
</table>
</div>
<?php wp_nonce_field( 'cau_save_settings' ); ?>
<div class="cau_save_button">
<?php submit_button(); ?>
</div>
<div class="cau_save_button__space"></div>
<script>jQuery( '.cau-dashboard input, .cau-dashboard select, .cau-dashboard textarea' ).on( 'change', function() { jQuery('.cau_save_button').addClass( 'fixed_button' ); } );</script>
</form>
</div><div class="cau-column-small">
<div class="welcome-to-cau help-bg cau-dashboard-box">
<div class="welcome-column welcome-column.welcome-column-half">
<h3 class="support-sidebar-title"><?php _e( 'Help' ); ?></h3>
<ul class="support-sidebar-list">
<li><a href="https://codeermeneer.nl/stuffs/faq-auto-updater/" target="_blank"><?php _e( 'Frequently Asked Questions', 'companion-auto-update' ); ?></a></li>
<li><a href="https://wordpress.org/support/plugin/companion-auto-update" target="_blank"><?php _e( 'Support Forums' ); ?></a></li>
</ul>
<h3 class="support-sidebar-title"><?php _e( 'Want to contribute?', 'companion-auto-update' ); ?></h3>
<ul class="support-sidebar-list">
<li><a href="http://codeermeneer.nl/cau_poll/" target="_blank"><?php _e( 'Give feedback', 'companion-auto-update' ); ?></a></li>
<li><a href="https://codeermeneer.nl/blog/companion-auto-update-and-its-future/" target="_blank"><?php _e( 'Feature To-Do List', 'companion-auto-update' ); ?></a></li>
<li><a href="https://translate.wordpress.org/projects/wp-plugins/companion-auto-update/" target="_blank"><?php _e( 'Help us translate', 'companion-auto-update' ); ?></a></li>
</ul>
</div>
<div class="welcome-column welcome-column.welcome-column-half">
<h3 class="support-sidebar-title"><?php _e( 'Developer?', 'companion-auto-update' ); ?></h3>
<ul class="support-sidebar-list">
<li><a href="https://codeermeneer.nl/documentation/auto-update/" target="_blank"><?php _e( 'Documentation' ); ?></a></li>
</ul>
</div>
</div>
<div class="welcome-to-cau support-bg cau-dashboard-box">
<div class="welcome-column welcome-column">
<h3><?php _e('Support', 'companion-auto-update');?></h3>
<p><?php _e('Feel free to reach out to us if you have any questions or feedback.', 'companion-auto-update'); ?></p>
<p><a href="https://codeermeneer.nl/contact/" target="_blank" class="button button-primary"><?php _e( 'Contact us', 'companion-auto-update' ); ?></a></p>
<p><a href="https://codeermeneer.nl/plugins/" target="_blank" class="button button-alt"><?php _e('Check out our other plugins', 'companion-auto-update');?></a></p>
</div>
</div>
<div class="welcome-to-cau love-bg cau-show-love cau-dashboard-box">
<h3><?php _e( 'Like our plugin?', 'companion-auto-update' ); ?></h3>
<p><?php _e('Companion Auto Update is free to use. It has required a great deal of time and effort to develop and you can help support this development by making a small donation.<br />You get useful software and we get to carry on making it better.', 'companion-auto-update'); ?></p>
<a href="https://wordpress.org/support/plugin/companion-auto-update/reviews/#new-post" target="_blank" class="button button-alt button-hero">
<?php _e('Rate us (5 stars?)', 'companion-auto-update'); ?>
</a>
<a href="<?php echo cau_donateUrl(); ?>" target="_blank" class="button button-primary button-hero">
<?php _e('Donate to help development', 'companion-auto-update'); ?>
</a>
<p style="font-size: 12px; color: #BDBDBD;"><?php _e( 'Donations via PayPal. Amount can be changed.', 'companion-auto-update'); ?></p>
</div>
<div class="welcome-to-cau cau-dashboard-box">
<h3><span style='background: #EBE3F7; color: #BCADD3; padding: 1px 5px; border-radius: 3px; font-size: .8em'>Plugin Promotion</span></h3>
<h3>Keep your site fast with our Revision Manager</h3>
<p>Post Revisions are great, but will also slow down your site. Take back control over revisions with Companion Revision Manager!</p>
<a href="https://codeermeneer.nl/portfolio/plugin/companion-revision-manager/" target="_blank" class="button button-alt">Read more</a>
</div>
</div>
<style>
.disabled_option {
opacity: .5;
}
</style>
<script type="text/javascript">
jQuery( '#update_delay' ).change( function() {
jQuery( '#update_delay_days_block' ).toggleClass( 'disabled_option' );
});
jQuery( '.interval_scheduler' ).change( function() {
var selected = jQuery(this).val(); // Selected value
var timeblock = jQuery(this).data( 'timeblock' ); // Corresponding time block
if( selected == 'daily' ) {
jQuery( '.timeblock-'+timeblock ).show();
} else {
jQuery( '.timeblock-'+timeblock ).hide();
}
});
jQuery( '.interval_scheduler' ).each( function() {
var selected = jQuery(this).val(); // Selected value
var timeblock = jQuery(this).data( 'timeblock' ); // Corresponding time block
if( selected == 'daily' ) {
jQuery( '.timeblock-'+timeblock ).show();
} else {
jQuery( '.timeblock-'+timeblock ).hide();
}
});
</script>

View File

@ -1,19 +0,0 @@
<?php
if( isset( $_GET['filter'] ) ) {
$filter = $_GET['filter'];
} else {
$filter = 'all';
}
?>
<ul class="subsubsub">
<li><a <?php if( $filter == 'all' ) { echo "class='current'"; } ?> href='<?php echo cau_url( 'log&filter=all' ); ?>'><?php _e( 'View full changelog', 'companion-auto-update' ); ?></a></li> |
<li><a <?php if( $filter == 'plugins' ) { echo "class='current'"; } ?> href='<?php echo cau_url( 'log&filter=plugins' ); ?>'><?php _e( 'Plugins', 'companion-auto-update' ); ?></a></li> |
<li><a <?php if( $filter == 'themes' ) { echo "class='current'"; } ?> href='<?php echo cau_url( 'log&filter=themes' ); ?>'><?php _e( 'Themes', 'companion-auto-update' ); ?></a></li> |
<li><a <?php if( $filter == 'translations' ) { echo "class='current'"; } ?> href='<?php echo cau_url( 'log&filter=translations' ); ?>'><?php _e( 'Translations', 'companion-auto-update' ); ?></a></li>
</ul>
<div class='cau_spacing'></div>
<?php
cau_fetch_log( 'all', 'table' );

View File

@ -1,185 +0,0 @@
<?php
// Get selected filter type
if( isset( $_GET['filter'] ) ) {
$filter = sanitize_key( $_GET['filter'] );
} else {
$filter = 'plugins';
}
// Select correct database row
switch ( $filter ) {
case 'themes':
$db_table = 'notUpdateListTh';
$filter_name = __( 'Themes', 'companion-auto-update' );
$filterFunction = wp_get_themes();
break;
case 'plugins':
$db_table = 'notUpdateList';
$filter_name = __( 'Plugins', 'companion-auto-update' );
$filterFunction = get_plugins();
break;
default:
$db_table = 'notUpdateList';
$filter_name = __( 'Plugins', 'companion-auto-update' );
$filterFunction = get_plugins();
break;
}
?>
<ul class="subsubsub">
<li><a <?php if( $filter == 'plugins' ) { echo "class='current'"; } ?> href='<?php echo cau_url( 'pluginlist&filter=plugins' ); ?>'><?php _e( 'Plugins', 'companion-auto-update' ); ?></a></li> |
<li><a <?php if( $filter == 'themes' ) { echo "class='current'"; } ?> href='<?php echo cau_url( 'pluginlist&filter=themes' ); ?>'><?php _e( 'Themes', 'companion-auto-update' ); ?></a></li>
</ul>
<div style='clear: both;'></div>
<?php if( $filter == 'themes' ) { ?>
<div id="message" class="cau">
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.
</div>
<?php } ?>
<p><?php echo sprintf( esc_html__( 'Prevent certain %s from updating automatically. %s that you select here will be skipped by Companion Auto Update and will require manual updating.', 'companion-auto-update' ), strtolower( $filter_name ), $filter_name ); ?></p>
<?php
global $wpdb;
$table_name = $wpdb->prefix."auto_updates";
// Save list
if( isset( $_POST['submit'] ) ) {
check_admin_referer( 'cau_save_pluginlist' );
$noUpdateList = '';
$i = 0;
$noUpdateCount = 0;
if( isset( $_POST['post'] ) ) {
$noUpdateCount = count( $_POST['post'] );
}
if( $noUpdateCount > 0 ) {
foreach ( $_POST['post'] as $key ) {
$noUpdateList .= sanitize_text_field( $key );
$i++;
if( $i != $noUpdateCount ) $noUpdateList .= ', ';
}
}
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = '%s' WHERE name = '%s'", $noUpdateList, $db_table ) );
echo '<div id="message" class="updated"><p><b>'.__( 'Succes', 'companion-auto-update' ).' &ndash;</b> '.sprintf( esc_html__( '%1$s %2$s have been added to the no-update-list', 'companion-auto-update' ), $noUpdateCount, strtolower( $filter_name ) ).'.</p></div>';
}
// Reset list
if( isset( $_POST['reset'] ) ) {
check_admin_referer( 'cau_save_pluginlist' );
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = '%s' WHERE name = %s", "", $db_table ) );
echo '<div id="message" class="updated"><p><b>'.__( 'Succes', 'companion-auto-update' ).' &ndash;</b> '.sprintf( esc_html__( 'The no-update-list has been reset, all %s will be auto-updated from now on', 'companion-auto-update' ), strtolower( $filter_name ) ).'.</p></div>';
}
?>
<form method="POST">
<div class='pluginListButtons'>
<?php submit_button(); ?>
<input type='submit' name='reset' id='reset' class='button button-alt' value='<?php _e( "Reset list", "companion-auto-update" ); ?>'>
</div>
<table class="wp-list-table widefat autoupdate striped">
<thead>
<tr>
<td>&nbsp;</td>
<th class="head-plugin"><strong><?php _e( 'Name', 'companion-auto-update' ); ?></strong></th>
<th class="head-status"><strong><?php _e( 'Status', 'companion-auto-update' ); ?></strong></th>
<th class="head-description"><strong><?php _e( 'Description' ); ?></strong></th>
</tr>
</thead>
<tbody id="the-list">
<?php
foreach ( $filterFunction as $key => $value ) {
$slug = $key;
$explosion = explode( '/', $slug );
$actualSlug = array_shift( $explosion );
$slug_hash = md5( $slug[0] );
if( $filter == 'themes' ) {
$theme = wp_get_theme( $actualSlug );
$name = $theme->get( 'Name' );
$description = $theme->get( 'Description' );
} else {
foreach ( $value as $k => $v ) {
if( $k == "Name" ) $name = $v;
if( $k == "Description" ) $description = $v;
}
}
if( in_array( $actualSlug, donotupdatelist( $filter ) ) ) {
$class = 'inactive';
$checked = 'CHECKED';
$statusicon = 'no';
$statusName = 'disabled';
} else {
$class = 'active';
$checked = '';
$statusicon = 'yes';
$statusName = 'enabled';
}
echo '<tr id="post-'.$slug_hash.'" class="'.$class.'">
<th class="check-column">
<label class="screen-reader-text" for="cb-select-'.$slug_hash.'">Select '. $name .'</label>
<input id="cb-select-'.$slug_hash.'" type="checkbox" name="post[]" value="'.$actualSlug.'" '.$checked.' ><label></label>
<div class="locked-indicator"></div>
</th>
<td class="column-name">
<p style="margin-bottom: 0px;"><strong>'. $name .'</strong></p>
<small class="description" style="opacity: 0.5; margin-bottom: 3px;">'.$actualSlug.'</small>
</td>
<td class="cau_hide_on_mobile column-status">
<p><span class="nowrap">'.__( 'Auto Updater', 'companion-auto-update' ).': <span class="cau_'.$statusName.'"><span class="dashicons dashicons-'.$statusicon.'"></span></span></span></p>
</td>
<td class="cau_hide_on_mobile column-description">
<p>'.$description.'</p>
</td>
</tr>';
}
?>
</tbody>
</table>
<?php wp_nonce_field( 'cau_save_pluginlist' ); ?>
<div class='pluginListButtons'>
<?php submit_button(); ?>
<input type='submit' name='reset' id='reset' class='button button-alt' value='<?php _e( "Reset list", "companion-auto-update" ); ?>'>
</div>
</form>

View File

@ -1,2 +0,0 @@
<?php
// Currently working on this

View File

@ -1,435 +0,0 @@
<?php
// Define globals
global $wpdb;
// Define variables
$dateFormat = get_option( 'date_format' );
$dateFormat .= ' '.get_option( 'time_format' );
$table_name = $wpdb->prefix . "auto_updates";
$schedules = wp_get_schedules();
$interval_names = cau_wp_get_schedules();
// Update the database
if( isset( $_GET['run'] ) && $_GET['run'] == 'db_update' ) {
cau_manual_update();
echo '<div id="message" class="updated"><p><b>'.__( 'Database update completed' ).'</b></p></div>';
}
if( isset( $_GET['run'] ) && $_GET['run'] == 'db_info_update' ) {
cau_savePluginInformation();
echo '<div id="message" class="updated"><p><b>'.__( 'Database information update completed' ).'</b></p></div>';
}
if( isset( $_GET['ignore_report'] ) ) {
$report_to_ignore = sanitize_text_field( $_GET['ignore_report'] );
$allowedValues = array( 'seo', 'cron' );
if( !in_array( $report_to_ignore, $allowedValues ) ) {
wp_die( 'Trying to cheat eh?' );
} else {
$table_name = $wpdb->prefix . "auto_updates";
$wpdb->query( $wpdb->prepare( "UPDATE {$table_name} SET onoroff = %s WHERE name = 'ignore_$report_to_ignore'", 'yes' ) );
$__ignored = __( 'This report will now be ignored', 'companion-auto-update' );
echo "<div id='message' class='updated'><p><b>$__ignored</b></p></div>";
}
}
?>
<div class="cau_status_page">
<?php
$events = array(
0 => array(
'name' => __( 'Events', 'companion-auto-update' ),
'fields' => array(
'plugins' => __( 'Plugins', 'companion-auto-update' ),
'themes' => __( 'Themes', 'companion-auto-update' ),
'minor' => __( 'Core (Minor)', 'companion-auto-update' ),
'major' => __( 'Core (Major)', 'companion-auto-update' ),
'send' => __( 'Update available', 'companion-auto-update' ),
'sendupdate' => __( 'Successful update', 'companion-auto-update' ),
'wpemails' => __( 'Core notifications', 'companion-auto-update' ),
'update_delay' => __( 'Log updater', 'companion-auto-update' ),
),
'values' => array(
'plugins' => 'wp_update_plugins',
'themes' => 'wp_update_themes',
'minor' => 'wp_version_check',
'major' => 'wp_version_check',
'send' => 'cau_set_schedule_mail',
'sendupdate' => 'cau_set_schedule_mail',
'wpemails' => 'cau_set_schedule_mail',
'update_delay' => 'cau_log_updater',
),
'explain' => array(
'plugins' => __('Auto update plugins?', 'companion-auto-update'),
'themes' => __('Auto update themes?', 'companion-auto-update'),
'minor' => __('Auto update minor core updates?', 'companion-auto-update'),
'major' => __('Auto update major core updates?', 'companion-auto-update'),
'send' => __( 'Will notify you of available updates.', 'companion-auto-update' ),
'sendupdate' => __( 'Will notify you after successful updates.', 'companion-auto-update' ),
'wpemails' => __( 'The default WordPress notifications.', 'companion-auto-update' ),
'update_delay' => __( 'Will keep track of the update log and make sure updates are delayed when needed.', 'companion-auto-update' ),
)
),
);
$__sta = __( 'Status', 'companion-auto-update' );
$__int = __( 'Interval', 'companion-auto-update' );
$__nxt = __( 'Next', 'companion-auto-update' );
foreach( $events as $event => $info ) {
echo "<table class='cau_status_list widefat striped'>
<thead>
<tr>
<th class='cau_status_name' colspan='2'><strong>{$info['name']}</strong></th>
<th class='cau_status_active_state'><strong>{$__sta}</strong></th>
<th class='cau_status_interval'><strong>{$__int}</strong></th>
<th class='cau_status_next'><strong>{$__nxt}</strong></th>
</tr>
</thead>
<tbody id='the-list'>";
foreach ( $info['fields'] as $key => $value ) {
$is_on = ( cau_get_db_value( $key ) == 'on' && wp_get_schedule( $info['values'][$key] ) ) ? true : false;
$__status = $is_on ? 'enabled' : 'warning';
$__icon = $is_on ? 'yes-alt' : 'marker';
$__text = $is_on ? __( 'Enabled', 'companion-auto-update' ) : __( 'Disabled', 'companion-auto-update' );
$__interval = $is_on ? $interval_names[wp_get_schedule( $info['values'][$key] )] : '&dash;';
$__next = $is_on ? date_i18n( $dateFormat, wp_next_scheduled( $info['values'][$key] ) ) : '&dash;';
$__exp = !empty( $info['explain'][$key] ) ? '<br /><small>'.$info['explain'][$key].'</small>' : '';
$__nxt = __( 'Next', 'companion-auto-update' );
echo "<tr>
<td class='cau_status_icon'><span class='dashicons dashicons-$__icon cau_$__status'></span></td>
<td class='cau_status_name'><strong>$value</strong>$__exp</td>
<td class='cau_status_active_state'><span class='cau_$__status'>$__text</span></td>
<td class='cau_status_interval'>$__interval</td>
<td class='cau_status_next'><span class='cau_mobile_prefix'>$__nxt: </span>$__next</td>
</tr>";
}
echo "</tbody>
</table>";
}
?>
<table class="cau_status_list widefat striped cau_status_warnings">
<thead>
<tr>
<th class="cau_plugin_issue_name" colspan="5"><strong><?php _e( 'Status' ); ?></strong></th>
</tr>
</thead>
<tbody id="the-list">
<!-- checkAutomaticUpdaterDisabled -->
<tr>
<td class='cau_status_icon'><span class="dashicons dashicons-update"></span></td>
<td><?php _e( 'Auto updates', 'companion-auto-update' ); ?></td>
<?php if ( checkAutomaticUpdaterDisabled() ) { ?>
<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>
<td>
<form method="POST">
<?php wp_nonce_field( 'cau_fixit' ); ?>
<button type="submit" name="fixit" class="button button-primary"><?php _e( 'Fix it', 'companion-auto-update' ); ?></button>
<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>
</form>
</td>
<?php } else { ?>
<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>
<td></td>
<?php } ?>
<td></td>
</tr>
<!-- Connection with WP.org -->
<tr>
<td class='cau_status_icon'><span class="dashicons dashicons-wordpress"></span></td>
<td><?php _e( 'Connection with WordPress.org', 'companion-auto-update' ); ?></td>
<?php if( wp_http_supports( array( 'ssl' ) ) == '1' ) {
$__text = __( 'No issues detected', 'companion-auto-update' );
echo "<td colspan='3' class='cau_status_active_state'><span class='cau_enabled'><span class='dashicons dashicons-yes-alt'></span> $__text</span></td>";
} else {
$__text = __( 'Disabled', 'companion-auto-update' );
echo "<td colspan='3' class='cau_status_active_state'><span class='cau_disabled'><span class='dashicons dashicons-no'></span> $__text</span></td>";
}
?>
</tr>
<!-- ignore_seo check -->
<tr <?php if( cau_get_db_value( 'ignore_seo' ) == 'yes' ) { echo "class='report_hidden'"; } ?> >
<td class='cau_status_icon'><span class="dashicons dashicons-search"></span></td>
<td><?php _e( 'Search Engine Visibility', 'companion-auto-update' ); ?></td>
<?php if( get_option( 'blog_public' ) == 0 ) { ?>
<td colspan="2" class="cau_status_active_state">
<span class='cau_warning'><span class="dashicons dashicons-warning"></span></span>
<?php _e( 'Youve 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' ); ?>
</td>
<td>
<a href="<?php echo admin_url( 'options-reading.php' ); ?>" class="button"><?php _e( 'Fix it', 'companion-auto-update' ); ?></a>
<a href="<?php echo cau_url( 'status' ); ?>&ignore_report=seo" class="button button-alt"><?php _e( 'Ignore this report', 'companion-auto-update' ); ?></a>
</td>
<?php } else { ?>
<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>
<?php } ?>
</tr>
<!-- ignore_cron check -->
<tr <?php if( cau_get_db_value( 'ignore_cron' ) == 'yes' ) { echo "class='report_hidden'"; } ?> >
<td class='cau_status_icon'><span class="dashicons dashicons-admin-generic"></span></td>
<td><?php _e( 'Cronjobs', 'companion-auto-update' ); ?></td>
<?php if( checkCronjobsDisabled() ) { ?>
<td class="cau_status_active_state"><span class='cau_warning'><span class="dashicons dashicons-warning"></span> <?php _e( 'Disabled', 'companion-auto-update' ); ?></span></td>
<td><code>DISABLE_WP_CRON true</code></td>
<td>
<a href="https://codeermeneer.nl/contact/" class="button"><?php _e( 'Contact for support', 'companion-auto-update' ); ?></a>
<a href="<?php echo cau_url( 'status' ); ?>&ignore_report=cron" class="button button-alt"><?php _e( 'Ignore this report', 'companion-auto-update' ); ?></a>
</td>
<?php } else { ?>
<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>
<?php } ?>
</tr>
<!-- wp_version_check -->
<tr>
<td class='cau_status_icon'><span class="dashicons dashicons-wordpress-alt"></span></td>
<td>wp_version_check</td>
<?php if ( !has_filter( 'wp_version_check', 'wp_version_check' ) ) { ?>
<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>
<td><a href="https://codeermeneer.nl/contact/" class="button"><?php _e( 'Contact for support', 'companion-auto-update' ); ?></a></td>
<?php } else { ?>
<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>
<?php } ?>
</tr>
<!-- VCD -->
<tr>
<td class='cau_status_icon'><span class="dashicons dashicons-open-folder"></span></td>
<td>VCS</td>
<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>
</tr>
</tbody>
</table>
<table class="autoupdate cau_status_list widefat striped cau_status_warnings">
<thead>
<tr>
<th colspan="5"><strong><?php _e( 'Systeminfo', 'companion-auto-update' ); ?></strong></th>
</tr>
</thead>
<tbody id="the-list">
<tr>
<td class='cau_status_icon'><span class="dashicons dashicons-wordpress"></span></td>
<td>WordPress</td>
<td><?php echo get_bloginfo( 'version' ); ?></td>
<td></td>
<td></td>
</tr>
<tr <?php if( version_compare( PHP_VERSION, '5.1.0', '<' ) ) { echo "class='inactive'"; } ?>>
<td class='cau_status_icon'><span class="dashicons dashicons-media-code"></span></td>
<td>PHP</td>
<td><?php echo phpversion(); ?> <code>(Required: 5.1.0 or up)</code></td>
<td></td>
<td></td>
</tr>
<tr <?php if( cau_incorrectDatabaseVersion() ) { echo "class='inactive'"; } ?>>
<td class='cau_status_icon'><span class="dashicons dashicons-database"></span></td>
<td>Database</td>
<td><?php echo get_option( "cau_db_version" ); ?> <code>(Latest: <?php echo cau_db_version(); ?>)</code></td>
<td></td>
<td></td>
</tr>
<tr>
<td class='cau_status_icon'><span class="dashicons dashicons-calendar"></span></td>
<td class="cau_status_name"><?php _e( 'Timezone' ); ?></td>
<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>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<?php
// If has incomptable plugins
if( cau_incompatiblePlugins() ) { ?>
<table class="cau_status_list no_column_width widefat striped cau_status_warnings">
<thead>
<tr>
<th class="cau_plugin_issue_name" colspan="4"><strong><?php _e( 'Possible plugin issues', 'companion-auto-update' ); ?></strong></th>
</tr>
</thead>
<tbody id="the-list">
<?php
foreach ( cau_incompatiblePluginlist() as $key => $value ) {
if( is_plugin_active( $key ) ) {
echo '<tr>
<td class="cau_plugin_issue_name"><strong>'.$key.'</strong></td>
<td colspan="2" class="cau_plugin_issue_explain">'.$value.'</td>
<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>
</tr>';
}
}
?>
</tbody>
</table>
<?php } ?>
<!-- Advanced info -->
<table class="autoupdate cau_status_list widefat striped cau_status_warnings">
<thead>
<tr>
<th><strong><?php _e( 'Advanced info', 'companion-auto-update' ); ?></strong> &dash; <?php _e( 'For when you need our help fixing an issue.', 'companion-auto-update' ); ?></th>
</tr>
</thead>
<tbody id="the-list">
<tr>
<td>
<div class='button button-primary toggle_advanced_button'><?php _e( 'Toggle', 'companion-auto-update' ); ?></div>
<div class='toggle_advanced_content' style='display: none;'>
<?php
$cau_configs = $wpdb->get_results( "SELECT * FROM $table_name" );
array_push( $cau_configs, "WordPress: ".get_bloginfo( 'version' ) );
array_push( $cau_configs, "PHP: ".phpversion() );
array_push( $cau_configs, "DB: ".get_option( "cau_db_version" ).' / '.cau_db_version() );
echo "<textarea style='width: 100%; height: 750px;'>";
print_r( $cau_configs );
echo "</textarea>";
?>
</div>
</td>
</tr>
</tbody>
</table>
<script>jQuery( '.toggle_advanced_button' ).click( function() { jQuery( '.toggle_advanced_content' ).toggle(); });</script>
<!-- Delay updates -->
<table class="autoupdate cau_status_list widefat striped cau_status_warnings">
<thead>
<tr>
<th><strong><?php _e( 'Delay updates', 'companion-auto-update' ); ?></strong> &dash; <?php echo ( cau_get_db_value( 'update_delay' ) == 'on' ) ? __( 'Enabled', 'companion-auto-update' ).' ('.sprintf( esc_html__( '%s days', 'companion-auto-update' ).')', cau_get_db_value( 'update_delay_days' ) ) : __( 'Disabled', 'companion-auto-update' ); ?></th>
<th><?php _e( 'Till', 'companion-auto-update' ); ?></th>
</tr>
</thead>
<tbody id="the-list">
<?php
$updateLog = "{$wpdb->prefix}update_log";
$put_on_hold = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$updateLog} WHERE put_on_hold <> '%s'", '0' ) );
foreach ( $put_on_hold as $plugin ) {
$__name = $plugin->slug;
$__poh = $plugin->put_on_hold;
$__udd = ( cau_get_db_value( 'update_delay_days' ) != '' ) ? cau_get_db_value( 'update_delay_days' ) : '2';
$__date = date_i18n( $dateFormat, strtotime( "+".$__udd." days", $__poh ) );
echo "<tr>
<td>{$__name}</td>
<td>{$__date}</td>
</tr>";
}
echo empty( $put_on_hold ) ? "<tr><td>".__( 'No plugins have been put on hold.', 'companion-auto-update' )."</td></tr>" : "";
?>
</tbody>
</table>
</div>
<?php
// Remove the line
if( isset( $_POST['fixit'] ) ) {
check_admin_referer( 'cau_fixit' );
cau_removeErrorLine();
}
// Get wp-config location
function cau_configFile() {
// Config file
if ( file_exists( ABSPATH . 'wp-config.php') ) {
$conFile = ABSPATH . 'wp-config.php';
} else {
$conFile = dirname(ABSPATH) . '/wp-config.php';
}
return $conFile;
}
// Change the AUTOMATIC_UPDATER_DISABLED line
function cau_removeErrorLine() {
// Config file
$conFile = cau_configFile();
// Lines to check and replace
$revLine = "define('AUTOMATIC_UPDATER_DISABLED', false);"; // We could just remove the line, but replacing it will be safer
$posibleLines = array( "define( 'AUTOMATIC_UPDATER_DISABLED', true );", "define( 'AUTOMATIC_UPDATER_DISABLED', minor );" ); // The two base options
foreach ( $posibleLines as $value ) array_push( $posibleLines, strtolower( $value ) ); // Support lowercase variants
foreach ( $posibleLines as $value ) array_push( $posibleLines, str_replace( ' ', '', $value ) ); // For variants without spaces
$melding = __( "We couldn't fix the error for you. Please contact us for further support", 'companion-auto-update' ).'.';
$meldingS = 'error';
// Check for each string if it exists
foreach ( $posibleLines as $key => $string ) {
if( strpos( file_get_contents( $conFile ), $string ) !== false) {
$contents = file_get_contents( $conFile );
$contents = str_replace( $string, $revLine, $contents );
file_put_contents( $conFile, $contents );
$melding = __( "We've fixed the error for you", 'companion-auto-update' ).' :)';
$meldingS = 'updated';
}
}
echo "<div id='message' class='$meldingS'><p><strong>$melding</strong></p></div>";
}

View File

@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="417pt"
viewBox="0 -46 417.81333 417"
width="417pt"
version="1.1"
id="svg4"
sodipodi:docname="check.svg"
inkscape:version="0.92.0 r15299">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2560"
inkscape:window-height="1017"
id="namedview6"
showgrid="false"
inkscape:zoom="0.42446043"
inkscape:cx="278"
inkscape:cy="278"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="m 185.111,248.00297 c -2.2287,2.2418 -5.26943,3.49257 -8.42804,3.49257 -3.15861,0 -6.19935,-1.25077 -8.42805,-3.49257 l -67.30869,-67.31961 c -6.985172,-6.98517 -6.985172,-18.31207 0,-25.28413 l 8.42805,-8.43023 c 6.98735,-6.98518 18.30114,-6.98518 25.28632,0 l 42.02237,42.02454 113.55053,-113.552722 c 6.98736,-6.985172 18.31207,-6.985172 25.28633,0 l 8.42805,8.43023 c 6.98516,6.985175 6.98516,18.309882 0,25.284142 z m 0,0"
id="path2"
style="fill:#9178b7;fill-opacity:1;stroke-width:0.55881381"
inkscape:connector-curvature="0" />
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 505 505"
style="enable-background:new 0 0 505 505;"
xml:space="preserve"
sodipodi:docname="email.svg"
inkscape:version="0.92.0 r15299"><metadata
id="metadata43"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
id="defs41" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1017"
id="namedview39"
showgrid="false"
inkscape:zoom="0.6608998"
inkscape:cx="-110.05455"
inkscape:cy="410.34145"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1"
borderlayer="true" /><path
style="fill:#ded1f2;fill-opacity:1;stroke-width:1.194754"
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"
id="path2"
inkscape:connector-curvature="0" /><g
id="g8"
transform="scale(1.3026177)" /><g
id="g10"
transform="scale(1.3026177)" /><g
id="g12"
transform="scale(1.3026177)" /><g
id="g14"
transform="scale(1.3026177)" /><g
id="g16"
transform="scale(1.3026177)" /><g
id="g18"
transform="scale(1.3026177)" /><g
id="g20"
transform="scale(1.3026177)" /><g
id="g22"
transform="scale(1.3026177)" /><g
id="g24"
transform="scale(1.3026177)" /><g
id="g26"
transform="scale(1.3026177)" /><g
id="g28"
transform="scale(1.3026177)" /><g
id="g30"
transform="scale(1.3026177)" /><g
id="g32"
transform="scale(1.3026177)" /><g
id="g34"
transform="scale(1.3026177)" /><g
id="g36"
transform="scale(1.3026177)" /><path
inkscape:connector-curvature="0"
d="m 281.76716,529.19554 c 27.99462,9.77382 58.38437,-1.99616 72.99376,-26.55557 L 241.14037,462.9714 c -3.82831,28.32342 12.63218,56.45033 40.62679,66.22414 z m 0,0"
id="path4"
style="fill:#9178b7;fill-opacity:1;stroke-width:1.53536594" /><path
inkscape:connector-curvature="0"
d="m 454.97461,381.50764 c -0.0736,-0.0257 -0.11887,-0.0415 -0.18687,-0.0653 -59.67543,-20.8346 -91.29336,-86.33378 -70.45084,-146.03188 5.72511,-16.39813 14.92428,-30.59236 26.36198,-42.26448 -3.29602,-1.51283 -6.65995,-2.92233 -10.15928,-4.14406 -59.766,-20.86622 -125.15573,10.65649 -146.03184,70.45084 l -15.05215,43.11307 c -10.68122,30.59363 -34.17187,54.79029 -64.63445,66.47768 -10.17733,3.96817 -17.38414,13.4202 -18.20325,24.79116 -0.9164,13.28721 8.329,25.17993 20.89938,29.56865 l 251.64586,87.85762 c 13.1706,4.59829 28.58431,0.40642 35.75467,-11.56127 5.54241,-9.2518 5.48702,-20.48337 0.002,-29.68445 -15.90548,-26.7325 -19.22019,-58.96007 -9.94599,-88.50764 z m 0,0"