updated plugin Companion Auto Update
version 3.8.5
This commit is contained in:
@ -26,10 +26,10 @@ if( isset( $_POST['submit'] ) ) {
|
||||
$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'] ) : '';
|
||||
$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 ) );
|
||||
@ -39,11 +39,11 @@ if( isset( $_POST['submit'] ) ) {
|
||||
$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'] ) : '';
|
||||
$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'] ) : '';
|
||||
$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'] ) : '';
|
||||
|
||||
@ -56,8 +56,8 @@ if( isset( $_POST['submit'] ) ) {
|
||||
$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'] ) : '';
|
||||
$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'] ) : '';
|
||||
|
||||
@ -67,8 +67,8 @@ if( isset( $_POST['submit'] ) ) {
|
||||
$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'] ) : '';
|
||||
$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 ) );
|
||||
@ -76,9 +76,9 @@ if( isset( $_POST['submit'] ) ) {
|
||||
// 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'] );
|
||||
$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'] );
|
||||
|
||||
@ -97,11 +97,11 @@ if( isset( $_POST['submit'] ) ) {
|
||||
// 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;
|
||||
$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' );
|
||||
@ -119,11 +119,11 @@ if( isset( $_POST['submit'] ) ) {
|
||||
// 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;
|
||||
$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' );
|
||||
@ -139,11 +139,11 @@ if( isset( $_POST['submit'] ) ) {
|
||||
// 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;
|
||||
$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' );
|
||||
@ -157,11 +157,11 @@ if( isset( $_POST['submit'] ) ) {
|
||||
// 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;
|
||||
$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' );
|
||||
@ -175,11 +175,11 @@ if( isset( $_POST['submit'] ) ) {
|
||||
// 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;
|
||||
$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' );
|
||||
@ -197,7 +197,7 @@ if( isset( $_POST['submit'] ) ) {
|
||||
|
||||
if( isset( $_GET['welcome'] ) ) {
|
||||
|
||||
echo '<div class="welcome-to-cau welcome-bg welcome-panel" style="margin-bottom: 0px;">
|
||||
echo '<div class="welcome-to-cau welcome-bg" style="margin-bottom: 0px;">
|
||||
<div class="welcome-image">
|
||||
</div><div class="welcome-content">
|
||||
|
||||
@ -222,7 +222,7 @@ $cs_hooks_t = wp_get_schedule( 'cau_custom_hooks_themes' );
|
||||
|
||||
<form method="POST">
|
||||
|
||||
<div class="welcome-to-cau update-bg welcome-panel cau-dashboard-box">
|
||||
<div class="welcome-to-cau update-bg cau-dashboard-box">
|
||||
|
||||
<h2 class="title"><?php _e('Auto Updater', 'companion-auto-update');?></h2>
|
||||
|
||||
@ -262,7 +262,7 @@ $cs_hooks_t = wp_get_schedule( 'cau_custom_hooks_themes' );
|
||||
|
||||
</div>
|
||||
|
||||
<div class="welcome-to-cau email-bg welcome-panel cau-dashboard-box">
|
||||
<div class="welcome-to-cau email-bg cau-dashboard-box">
|
||||
|
||||
<h2 class="title"><?php _e( 'Email Notifications', 'companion-auto-update' );?></h2>
|
||||
|
||||
@ -356,7 +356,7 @@ $cs_hooks_t = wp_get_schedule( 'cau_custom_hooks_themes' );
|
||||
|
||||
</div>
|
||||
|
||||
<div class="welcome-to-cau interval-bg welcome-panel cau-dashboard-box" style="overflow: hidden;">
|
||||
<div class="welcome-to-cau interval-bg cau-dashboard-box" style="overflow: hidden;">
|
||||
|
||||
<h2 class="title"><?php _e( 'Intervals', 'companion-auto-update' );?></h2>
|
||||
|
||||
@ -439,7 +439,7 @@ $cs_hooks_t = wp_get_schedule( 'cau_custom_hooks_themes' );
|
||||
|
||||
</div>
|
||||
|
||||
<div class="welcome-to-cau advanced-bg welcome-panel cau-dashboard-box">
|
||||
<div class="welcome-to-cau advanced-bg cau-dashboard-box">
|
||||
|
||||
<h2 class="title"><?php _e( 'Advanced settings', 'companion-auto-update' ); ?></h2>
|
||||
|
||||
@ -464,6 +464,7 @@ $cs_hooks_t = wp_get_schedule( 'cau_custom_hooks_themes' );
|
||||
<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>
|
||||
@ -484,7 +485,7 @@ $cs_hooks_t = wp_get_schedule( 'cau_custom_hooks_themes' );
|
||||
|
||||
</div><div class="cau-column-small">
|
||||
|
||||
<div class="welcome-to-cau help-bg welcome-panel cau-dashboard-box">
|
||||
<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">
|
||||
@ -507,7 +508,7 @@ $cs_hooks_t = wp_get_schedule( 'cau_custom_hooks_themes' );
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="welcome-to-cau support-bg welcome-panel cau-dashboard-box">
|
||||
<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>
|
||||
@ -516,7 +517,7 @@ $cs_hooks_t = wp_get_schedule( 'cau_custom_hooks_themes' );
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="welcome-to-cau love-bg cau-show-love welcome-panel cau-dashboard-box">
|
||||
<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">
|
||||
@ -528,7 +529,7 @@ $cs_hooks_t = wp_get_schedule( 'cau_custom_hooks_themes' );
|
||||
<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 welcome-panel cau-dashboard-box">
|
||||
<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>
|
||||
|
Reference in New Issue
Block a user