- Toggle
+
$version ) {
+ if( $version == '' ) $version = __( "Unknown", "companion-auto-update" );
$text .= "- ".sprintf( esc_html__( "%s tested up to: %s", "companion-auto-update" ), $plugin, $version )."\n";
}
@@ -306,7 +318,7 @@ function cau_plugin_updated() {
$dateFormat = get_option( 'date_format' );
$timestamp = date_i18n( $dateFormat, filemtime( $fullPath ) );
- $timestamp .= ' ‐ '.date( 'H:i', filemtime( $fullPath ) );
+ $timestamp .= ' - '.date( 'H:i', filemtime( $fullPath ) );
if( $fileDate >= $lastday ) {
@@ -348,7 +360,7 @@ function cau_plugin_updated() {
$dateFormat = get_option( 'date_format' );
$timestamp = date_i18n( $dateFormat, filemtime( $fullPath ) );
- $timestamp .= ' ‐ '.date( 'H:i', filemtime( $fullPath ) );
+ $timestamp .= ' - '.date( 'H:i', filemtime( $fullPath ) );
if( $fileDate >= $lastday ) {
array_push( $themeNames, $path_parts['filename'] );
diff --git a/wp-content/plugins/companion-auto-update/cau_functions.php b/wp-content/plugins/companion-auto-update/cau_functions.php
index 6a17bac..9d82ee8 100644
--- a/wp-content/plugins/companion-auto-update/cau_functions.php
+++ b/wp-content/plugins/companion-auto-update/cau_functions.php
@@ -173,6 +173,11 @@ function cau_incorrectDatabaseVersion() {
// Run custom hooks on plugin update
function cau_run_custom_hooks_p() {
+ // Check if function exists
+ if ( ! function_exists( 'get_plugins' ) ) {
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
+ }
+
// Create array
$allDates = array();
@@ -551,7 +556,12 @@ function cau_fetch_log( $limit, $format = 'simple' ) {
$dateFormat = get_option( 'date_format' );
// PLUGINS
- if( $plugins ) {
+ if( $plugins ) {
+
+ // Check if function exists
+ if ( ! function_exists( 'get_plugins' ) ) {
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
+ }
// Where to look for plugins
$plugdir = plugin_dir_path( __DIR__ );
@@ -1010,7 +1020,12 @@ function cau_plugin_info( $slug, $what ) {
// Get list of outdated plugins
function cau_list_outdated() {
- $outdatedList = array();
+ $outdatedList = array();
+
+ // Check if function exists
+ if ( ! function_exists( 'get_plugins' ) ) {
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
+ }
foreach ( get_plugins() as $key => $value) {
@@ -1052,6 +1067,11 @@ function cau_version_compare( $ver1, $ver2, $operator = null ) {
// Get plugin information of currently installed plugins
function cau_active_plugin_info( $slug, $what ) {
+ // Check if function exists
+ if ( ! function_exists( 'get_plugins' ) ) {
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
+ }
+
$allPlugins = get_plugins();
foreach ($allPlugins as $key => $value) {
@@ -1081,19 +1101,19 @@ function cau_addMoreIntervals( $schedules ) {
// Add a weekly interval.
$schedules['weekly'] = array(
'interval' => 604800,
- 'display' => __( 'Once Weekly', 'companion-auto-update' ),
+ 'display' => __( 'Every week', 'companion-auto-update' ),
);
// Add a twice montly interval.
$schedules['twice_monthly'] = array(
- 'interval' => 1317600,
- 'display' => __( 'Twice a month', 'companion-auto-update' ),
+ 'interval' => 1209600,
+ 'display' => __( 'Every 2 weeks', 'companion-auto-update' ),
);
// Add a montly interval.
$schedules['once_monthly'] = array(
- 'interval' => 2635200,
- 'display' => __( 'Once a month', 'companion-auto-update' ),
+ 'interval' => 2419200,
+ 'display' => __( 'Every 4 weeks', 'companion-auto-update' ),
);
return $schedules;
@@ -1118,19 +1138,48 @@ function cau_wp_get_schedules() {
// Do a bunch of checks to format them the right way
foreach ( $value as $display => $interval ) {
- if( $display == 'display' ) {
- $intervalNames[$counter] = $interval; // Add the display name (i.e. "Once a month" or "Once Daily")
- $counter++; // Make sure the next interval gets a new "key" value
- } else {
- if( $interval == '86400' ) $key = 'daily'; // Force the daily interval to be called daily, requires by a bunch of handles of this plugin
+ if( $display == 'interval' ) {
+
+ if( $interval == '86400' ) $key = 'daily'; // Force the daily interval to be called daily, required by a bunch of handles of this plugin
+
$intervalTimes[$counter] = $key; // Add the backend name (i.e. "once_monthly" or "daily")
$intervalUniques[$counter] = $interval; // Add the unix timestamp of this interval, used to identify unique items
+
+ // Format display name in a proper way
+ $numOfMinutes = ($interval/60);
+ $identifier = __( 'minutes', 'companion-auto-update' );
+
+ // I just know there's an easier way for this, but I can't come up with it and this works so...
+ if( $interval >= (60*60) ) {
+ $numOfMinutes = ($numOfMinutes/60);
+ $identifier = __( 'hours', 'companion-auto-update' );
+ }
+ if( $interval >= (60*60*24) ) {
+ $numOfMinutes = ($numOfMinutes/24);
+ $identifier = __( 'days', 'companion-auto-update' );
+ }
+ if( $interval >= (60*60*24*7) ) {
+ $numOfMinutes = ($numOfMinutes/7);
+ $identifier = __( 'weeks', 'companion-auto-update' );
+ }
+ if( $interval >= (60*60*24*7*(52/12)) ) {
+ $numOfMinutes = ($numOfMinutes/(52/12));
+ $identifier = __( 'months', 'companion-auto-update' );
+ }
+
+ $display = sprintf( esc_html__( 'Every %s %s', 'companion-auto-update' ), round( $numOfMinutes, 2 ), $identifier ); // Translateble
+ $intervalNames[$counter] = $display; // Add the display name (i.e. "Once a month" or "Once Daily")
+
+ $counter++; // Make sure the next interval gets a new "key" value
}
}
}
+ // Sort the interval from smallest to largest
+ asort( $intervalUniques );
+
// Prevent duplicates
foreach ( array_unique( $intervalUniques ) as $key => $value ) {
// $value is the timestamp
@@ -1162,6 +1211,12 @@ function cau_updateLogDBisEmpty() {
// Plugin information to DB
function cau_savePluginInformation( $method = 'New' ) {
+ // Check if function exists
+ if ( ! function_exists( 'get_plugins' ) ) {
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
+ }
+
+ // Set variables
global $wpdb;
$updateDB = "update_log";
$updateLog = $wpdb->prefix.$updateDB;
diff --git a/wp-content/plugins/companion-auto-update/companion-auto-update.php b/wp-content/plugins/companion-auto-update/companion-auto-update.php
index 367b879..9099e5e 100644
--- a/wp-content/plugins/companion-auto-update/companion-auto-update.php
+++ b/wp-content/plugins/companion-auto-update/companion-auto-update.php
@@ -3,7 +3,7 @@
* Plugin Name: Companion Auto Update
* Plugin URI: http://codeermeneer.nl/portfolio/companion-auto-update/
* Description: This plugin auto updates all plugins, all themes and the wordpress core.
- * Version: 3.7.1.1
+ * Version: 3.8.0
* Author: Papin Schipper
* Author URI: http://codeermeneer.nl/
* Contributors: papin
@@ -37,12 +37,14 @@ function cau_install( $network_wide ) {
} else {
cau_database_creation();
}
- if (! wp_next_scheduled ( 'cau_set_schedule_mail' )) wp_schedule_event( time(), 'daily', 'cau_set_schedule_mail'); // Set schedule for mail etc.
+ if (! wp_next_scheduled ( 'cau_set_schedule_mail' )) wp_schedule_event( time(), 'daily', 'cau_set_schedule_mail'); // Set schedule for basic notifcations
if (! wp_next_scheduled ( 'cau_custom_hooks_plugins' )) wp_schedule_event( time(), 'daily', 'cau_custom_hooks_plugins'); // Run custom hooks on plugin updates
if (! wp_next_scheduled ( 'cau_custom_hooks_themes' )) wp_schedule_event( time(), 'daily', 'cau_custom_hooks_themes'); // Run custom hooks on theme updates
if (! wp_next_scheduled ( 'cau_log_updater' )) wp_schedule_event( ( time() - 1800 ), 'daily', 'cau_log_updater'); // Keep the log up to date
+ if (! wp_next_scheduled ( 'cau_outdated_notifier' )) wp_schedule_event( time(), 'daily', 'cau_outdated_notifier'); // Set schedule for basic notifcations
}
add_action( 'cau_set_schedule_mail', 'cau_check_updates_mail' );
+add_action( 'cau_outdated_notifier', 'cau_outdated_notifier_mail' );
add_action( 'wp_update_plugins', 'cau_run_custom_hooks_p' );
add_action( 'wp_update_themes', 'cau_run_custom_hooks_t' );
add_action( 'wp_version_check', 'cau_run_custom_hooks_c' );
@@ -77,25 +79,28 @@ function cau_donateUrl() {
// Database version
function cau_db_version() {
- return '3.7.0';
+ return '3.7.2';
}
function cau_database_creation() {
global $wpdb;
+ // Plugin db info
$cau_db_version = cau_db_version();
$autoupdates = $wpdb->prefix."auto_updates";
$updateLog = $wpdb->prefix."update_log";
- // Create db table
+ // WordPress db info
+ $charset_collate = $wpdb->get_charset_collate();
+
+ // DB table creation queries
$sql = "CREATE TABLE $autoupdates (
id INT(9) NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
onoroff TEXT NOT NULL,
UNIQUE KEY id (id)
- )";
+ ) $charset_collate;";
- // Create second db table
$sql2 = "CREATE TABLE $updateLog (
id INT(9) NOT NULL AUTO_INCREMENT,
slug VARCHAR(255) NOT NULL,
@@ -104,8 +109,9 @@ function cau_database_creation() {
method VARCHAR(10) NOT NULL,
put_on_hold VARCHAR(100) DEFAULT '0',
UNIQUE KEY id (id)
- )";
+ ) $charset_collate;";
+ // Create DB tables
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
dbDelta( $sql2 );
@@ -202,11 +208,28 @@ register_deactivation_hook( __FILE__, 'cau_remove' );
// Update
function cau_update_db_check() {
+
$cau_db_version = cau_db_version();
+
if ( get_site_option( 'cau_db_version' ) != $cau_db_version ) {
+
cau_database_creation();
+
+ // In 3.7.2 we've added $wpdb->get_charset_collate
+ if( get_site_option( 'cau_db_version' ) < '3.7.2' ) {
+
+ global $wpdb;
+ $autoupdates = $wpdb->prefix."auto_updates";
+ $updateLog = $wpdb->prefix."update_log";
+ $db_charset = constant( 'DB_CHARSET' );
+ $wpdb->query( "ALTER TABLE $autoupdates CONVERT TO CHARACTER SET $db_charset" );
+ $wpdb->query( "ALTER TABLE $updateLog CONVERT TO CHARACTER SET $db_charset" );
+
+ }
+
update_option( "cau_db_version", $cau_db_version );
}
+
}
add_action( 'upgrader_process_complete', 'cau_update_db_check' );
diff --git a/wp-content/plugins/companion-auto-update/readme.txt b/wp-content/plugins/companion-auto-update/readme.txt
index 34ed8a6..64d568b 100644
--- a/wp-content/plugins/companion-auto-update/readme.txt
+++ b/wp-content/plugins/companion-auto-update/readme.txt
@@ -3,9 +3,9 @@ Contributors: Papin, qweb
Donate link: https://www.paypal.me/dakel/10/
Tags: auto, automatic, background, update, updates, updating, automatic updates, automatic background updates, easy update, wordpress update, theme update, plugin update, up-to-date, security, update latest version, update core, update wp, update wp core, major updates, minor updates, update to new version, update core, update plugin, update plugins, update plugins automatically, update theme, plugin, theme, advance, control, mail, notifations, enable
Requires at least: 3.6.0
-Tested up to: 5.5
+Tested up to: 5.6
Requires PHP: 5.1
-Stable tag: 3.7.1.1
+Stable tag: 3.8.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -81,6 +81,11 @@ So obviously, some of you wondered what the difference would be between the defa
== Changelog ==
+= 3.8.0 (January 14, 2020) =
+* New: Better handling of plugins with an unknown WP version
+* New: More intervals for notifications
+* Fix: Call to undefined function errors
+
= 3.7.1.1 (November 2, 2020) =
* Fix: Type in wp_next_scheduled
|