mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-09 16:42:52 +08:00
merge with branch01 + version update
This commit is contained in:
parent
6335521c76
commit
5cb173494f
4 changed files with 88 additions and 53 deletions
|
@ -11,7 +11,7 @@ include_once(ABSPATH . '/wp-admin/includes/plugin.php');
|
|||
|
||||
class MainWPChild
|
||||
{
|
||||
private $version = '2.0.19';
|
||||
private $version = '2.0.20';
|
||||
private $update_version = '1.2';
|
||||
|
||||
private $callableFunctions = array(
|
||||
|
@ -333,7 +333,7 @@ class MainWPChild
|
|||
$child_menu_icon = 'data:image/png+xml;base64,' . base64_encode(file_get_contents($this->plugin_dir . '/images/mainwpicon.png'));
|
||||
}
|
||||
|
||||
add_menu_page($child_menu_name, $child_menu_name, 'read', $mainwp_child_menu_slug, false, $child_menu_icon, '80.00001');
|
||||
add_menu_page($child_menu_name, $child_menu_name, 'manage_options', $mainwp_child_menu_slug, false, $child_menu_icon, '80.00001');
|
||||
|
||||
if (!get_option('mainwp_branding_remove_setting') || $cancelled_branding)
|
||||
{
|
||||
|
@ -1162,10 +1162,27 @@ class MainWPChild
|
|||
include_once(ABSPATH . '/wp-admin/includes/update.php');
|
||||
if ($this->filterFunction != null) add_filter( 'pre_site_transient_update_plugins', $this->filterFunction , 99);
|
||||
|
||||
$plugins = explode(',', urldecode($_POST['list']));
|
||||
|
||||
// To fix: backupbuddy update
|
||||
if (in_array('backupbuddy/backupbuddy.php', $plugins)) {
|
||||
if (isset($GLOBALS['ithemes_updater_path'])) {
|
||||
if ( ! class_exists( 'Ithemes_Updater_Settings' ) ) {
|
||||
require( $GLOBALS['ithemes_updater_path'] . '/settings.php' );
|
||||
}
|
||||
if (class_exists('Ithemes_Updater_Settings')) {
|
||||
$ithemes_updater = new Ithemes_Updater_Settings();
|
||||
$ithemes_updater->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
////
|
||||
|
||||
global $wp_current_filter;
|
||||
$wp_current_filter[] = 'load-plugins.php';
|
||||
@wp_update_plugins();
|
||||
$information['plugin_updates'] = get_plugin_updates();
|
||||
|
||||
$plugins = explode(',', urldecode($_POST['list']));
|
||||
$premiumPlugins = array();
|
||||
$premiumUpdates = get_option('mainwp_premium_updates');
|
||||
if (is_array($premiumUpdates))
|
||||
|
@ -1185,13 +1202,6 @@ class MainWPChild
|
|||
$plugins = $newPlugins;
|
||||
}
|
||||
|
||||
//Fix bug
|
||||
if ((count($plugins) > 0) || (count($premiumPlugins) > 0)) {
|
||||
global $wp_current_filter;
|
||||
$wp_current_filter[] = 'load-update.php';
|
||||
wp_update_plugins();
|
||||
}
|
||||
|
||||
if (count($plugins) > 0)
|
||||
{
|
||||
//@see wp-admin/update.php
|
||||
|
@ -2472,6 +2482,10 @@ class MainWPChild
|
|||
remove_filter('option_active_plugins', array(&$this, 'default_option_active_plugins'));
|
||||
|
||||
if ($this->filterFunction != null) add_filter( 'pre_site_transient_update_plugins', $this->filterFunction , 99);
|
||||
|
||||
global $wp_current_filter;
|
||||
$wp_current_filter[] = 'load-plugins.php';
|
||||
|
||||
@wp_update_plugins();
|
||||
include_once(ABSPATH . '/wp-admin/includes/plugin.php');
|
||||
$plugin_updates = get_plugin_updates();
|
||||
|
|
|
@ -201,29 +201,32 @@ class MainWPChildUpdraftplusBackups
|
|||
foreach($keys as $key) {
|
||||
if (isset($settings[$key])) {
|
||||
if ($key == "updraft_dropbox") {
|
||||
if (isset($settings[$key])) {
|
||||
$opts = UpdraftPlus_Options::get_updraft_option('updraft_dropbox');
|
||||
$opts['appkey'] = $settings[$key]['appkey'];
|
||||
$opts['secret'] = $settings[$key]['secret'];
|
||||
$opts['folder'] = $settings[$key]['folder'];
|
||||
UpdraftPlus_Options::update_updraft_option($key, $opts);
|
||||
}
|
||||
$opts = UpdraftPlus_Options::get_updraft_option('updraft_dropbox');
|
||||
$opts['appkey'] = $settings[$key]['appkey'];
|
||||
$opts['secret'] = $settings[$key]['secret'];
|
||||
$opts['folder'] = $settings[$key]['folder'];
|
||||
UpdraftPlus_Options::update_updraft_option($key, $opts);
|
||||
} else if ($key == "updraft_googledrive") {
|
||||
if (isset($settings[$key])) {
|
||||
$opts = UpdraftPlus_Options::get_updraft_option('updraft_googledrive');
|
||||
$opts['clientid'] = $settings[$key]['clientid'];
|
||||
$opts['secret'] = $settings[$key]['secret'];
|
||||
$opts['folder'] = $settings[$key]['folder'];
|
||||
UpdraftPlus_Options::update_updraft_option($key, $opts);
|
||||
}
|
||||
$opts = UpdraftPlus_Options::get_updraft_option('updraft_googledrive');
|
||||
$opts['clientid'] = $settings[$key]['clientid'];
|
||||
$opts['secret'] = $settings[$key]['secret'];
|
||||
$opts['folder'] = $settings[$key]['folder'];
|
||||
UpdraftPlus_Options::update_updraft_option($key, $opts);
|
||||
} else if ($key == "updraft_onedrive") {
|
||||
if (isset($settings[$key])) {
|
||||
$opts = UpdraftPlus_Options::get_updraft_option('updraft_onedrive');
|
||||
$opts['clientid'] = $settings[$key]['clientid'];
|
||||
$opts['secret'] = $settings[$key]['secret'];
|
||||
$opts['folder'] = $settings[$key]['folder'];
|
||||
UpdraftPlus_Options::update_updraft_option($key, $opts);
|
||||
}
|
||||
$opts = UpdraftPlus_Options::get_updraft_option('updraft_onedrive');
|
||||
$opts['clientid'] = $settings[$key]['clientid'];
|
||||
$opts['secret'] = $settings[$key]['secret'];
|
||||
$opts['folder'] = $settings[$key]['folder'];
|
||||
UpdraftPlus_Options::update_updraft_option($key, $opts);
|
||||
} else if ($key == "updraft_email") {
|
||||
$value = $settings[$key];
|
||||
// free version
|
||||
if (!is_array($value)) {
|
||||
if (!empty($value)) {
|
||||
$value = htmlspecialchars(get_bloginfo('admin_email'));
|
||||
}
|
||||
}
|
||||
UpdraftPlus_Options::update_updraft_option($key, $value);
|
||||
} else {
|
||||
UpdraftPlus_Options::update_updraft_option($key, $settings[$key]);
|
||||
}
|
||||
|
@ -231,10 +234,18 @@ class MainWPChildUpdraftplusBackups
|
|||
}
|
||||
}
|
||||
global $updraftplus;
|
||||
if ($settings['updraft_interval']) {
|
||||
if (isset($settings['updraft_interval'])) {
|
||||
// fix for premium version
|
||||
$_POST['updraft_interval'] = $settings['updraft_interval'];
|
||||
$_POST['updraft_startday_files'] = $settings['updraft_startday_files'];
|
||||
$_POST['updraft_starttime_files'] = $settings['updraft_starttime_files'];
|
||||
$updraftplus->schedule_backup($settings['updraft_interval']);
|
||||
}
|
||||
if ($settings['updraft_interval_database']) {
|
||||
if (isset($settings['updraft_interval_database'])) {
|
||||
// fix for premium version
|
||||
$_POST['updraft_interval_database'] = $settings['updraft_interval_database'];
|
||||
$_POST['updraft_startday_database'] = $settings['updraft_startday_database'];
|
||||
$_POST['updraft_starttime_database'] = $settings['updraft_starttime_database'];
|
||||
$updraftplus->schedule_backup_database($settings['updraft_interval_database']);
|
||||
}
|
||||
|
||||
|
@ -840,13 +851,13 @@ class MainWPChildUpdraftplusBackups
|
|||
}
|
||||
|
||||
public function historystatus($remotescan = null, $rescan = null ) {
|
||||
global $updraftplus_admin, $updraftplus;
|
||||
if (empty($updraftplus_admin)) require_once(UPDRAFTPLUS_DIR.'/admin.php');
|
||||
global $updraftplus;
|
||||
|
||||
$remotescan = ($remotescan !== null) ? $remotescan : $_POST['remotescan'];
|
||||
$rescan = ($rescan !== null) ? $rescan : $_POST['rescan'];
|
||||
|
||||
if ($rescan) $messages = $updraftplus_admin->rebuild_backup_history($remotescan);
|
||||
if ($rescan)
|
||||
$messages = $this->rebuildBackupHistory($remotescan);
|
||||
|
||||
$backup_history = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
|
||||
$backup_history = (is_array($backup_history)) ? $backup_history : array();
|
||||
|
@ -1163,7 +1174,7 @@ class MainWPChildUpdraftplusBackups
|
|||
$backup_success = $this->restore_backup($_REQUEST['backup_timestamp']);
|
||||
if (empty($updraftplus->errors) && $backup_success === true) {
|
||||
// If we restored the database, then that will have out-of-date information which may confuse the user - so automatically re-scan for them.
|
||||
$updraftplus_admin->rebuild_backup_history();
|
||||
$this->rebuildBackupHistory();
|
||||
echo '<p><strong>';
|
||||
$updraftplus->log_e('Restore successful!');
|
||||
echo '</strong></p>';
|
||||
|
@ -2237,13 +2248,16 @@ ENDHERE;
|
|||
}
|
||||
}
|
||||
|
||||
// private function rebuildBackupHistory() {
|
||||
// global $updraftplus_admin;
|
||||
// $messages = $updraftplus_admin->rebuild_backup_history();
|
||||
// $out['updraft_backup_history'] = UpdraftPlus_Options::get_updraft_option('updraft_backup_history');
|
||||
// $out['messages'] = $messages;
|
||||
// return $out;
|
||||
// }
|
||||
private function rebuildBackupHistory($remotescan = false) {
|
||||
global $updraftplus_admin, $updraftplus;
|
||||
$messages = null;
|
||||
if (method_exists($updraftplus, 'rebuild_backup_history')) {
|
||||
$messages = $updraftplus->rebuild_backup_history($remotescan);
|
||||
} else if (method_exists($updraftplus_admin, 'rebuild_backup_history')) {
|
||||
$messages = $updraftplus_admin->rebuild_backup_history($remotescan);
|
||||
}
|
||||
return $messages;
|
||||
}
|
||||
|
||||
private function forceScheduledResumption() {
|
||||
global $updraftplus;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
Description: Child Plugin for MainWP. The plugin is used so the installed blog can be securely managed remotely by your network. Plugin documentation and options can be found here http://docs.mainwp.com
|
||||
Author: MainWP
|
||||
Author URI: http://mainwp.com
|
||||
Version: 2.0.19
|
||||
Version: 2.0.20
|
||||
*/
|
||||
if ((isset($_REQUEST['heatmap']) && $_REQUEST['heatmap'] == '1') || (isset($_REQUEST['mainwpsignature']) && (!empty($_REQUEST['mainwpsignature'])))) {
|
||||
header('X-Frame-Options: ALLOWALL');
|
||||
|
|
|
@ -7,7 +7,7 @@ Author URI: https://mainwp.com
|
|||
Plugin URI: https://mainwp.com
|
||||
Requires at least: 3.6
|
||||
Tested up to: 4.2.2
|
||||
Stable tag: 2.0.19
|
||||
Stable tag: 2.0.20
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
|
@ -58,6 +58,13 @@ To see full documentation and FAQs please visit [MainWP Documentation](http://do
|
|||
|
||||
== Changelog ==
|
||||
|
||||
= 2.0.20 - 7-6-15 =
|
||||
* Fixed: Bug with time schedule for the UpdraftPlus extension
|
||||
* Fixed: Bug in the Scan for backups feature for the UpdraftPlus extension
|
||||
* Fixed: Bug with saving email report option for free version of the UpdraftPuls plugin
|
||||
* Fixed: Bug that was causing the BackupBuddy updates to fail
|
||||
* Updated: Only users with the Administrator role can see the MainWP Child menu
|
||||
|
||||
= 2.0.19 - 6-10-15 =
|
||||
* Added: Filesystem Check on the Server Information page
|
||||
* Added: Support for the MainWP Child Report plugin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue