mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-08-30 02:32:07 +08:00
Merge with branch01
This commit is contained in:
parent
033af5c759
commit
c3795a16a0
10 changed files with 76 additions and 33 deletions
|
@ -610,6 +610,12 @@ class MainWP_Child_Back_Up_Buddy {
|
|||
$information['schedules'] = pb_backupbuddy::$options['schedules'];
|
||||
$information['next_schedule_index'] = pb_backupbuddy::$options['next_schedule_index'];
|
||||
$information['schedules_run_time'] = $this->get_schedules_run_time();
|
||||
|
||||
// to fix missing destination notice
|
||||
if (isset(pb_backupbuddy::$options['remote_destinations'])) { // update
|
||||
$information['remote_destinations'] = pb_backupbuddy::$options['remote_destinations'];
|
||||
}
|
||||
|
||||
$information['result'] = 'SUCCESS';
|
||||
return $information;
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ class MainWP_Child_Branding {
|
|||
|
||||
$opts['contact_label'] = $label;
|
||||
$opts['extra_settings'] = get_option( 'mainwp_branding_extra_settings' );
|
||||
MainWP_Helper::update_option( 'mainwp_child_branding_settings', $opts );
|
||||
}
|
||||
|
||||
if ( !isset($opts['contact_label']) || empty($opts['contact_label']) ) {
|
||||
|
@ -382,7 +383,7 @@ class MainWP_Child_Branding {
|
|||
add_action( 'in_admin_footer', array( $this, 'in_admin_footer' ) );
|
||||
} else if (is_user_logged_in()) {
|
||||
// front end
|
||||
add_action( 'add_admin_bar_menus', array( $this, 'add_admin_bar_menus' ));
|
||||
add_action( 'wp_after_admin_bar_render', array( $this, 'after_admin_bar_render' ));
|
||||
}
|
||||
$opts = $this->child_branding_options;
|
||||
|
||||
|
@ -429,7 +430,7 @@ class MainWP_Child_Branding {
|
|||
|
||||
// to fix
|
||||
add_action( 'admin_menu', array( &$this, 'admin_menu' ) );//
|
||||
if ( $opts['disable_wp_branding'] !== 'Y' ) {
|
||||
if ( !isset($opts['disable_wp_branding']) || $opts['disable_wp_branding'] !== 'Y' ) {
|
||||
add_filter( 'wp_footer', array( &$this, 'branding_global_footer' ), 15 );
|
||||
add_action( 'wp_dashboard_setup', array( &$this, 'custom_dashboard_widgets' ), 999 );
|
||||
// branding site generator
|
||||
|
@ -986,7 +987,7 @@ class MainWP_Child_Branding {
|
|||
MainWP_Helper::update_option( 'mainwp_child_branding_settings', $this->child_branding_options );
|
||||
}
|
||||
|
||||
public function add_admin_bar_menus() {
|
||||
public function after_admin_bar_render() {
|
||||
|
||||
$hide_slugs = apply_filters('mainwp_child_hide_update_notice' , array());
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ class MainWP_Child_iThemes_Security {
|
|||
add_action( 'admin_menu', array( $this, 'remove_menu' ) );
|
||||
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
||||
add_action( 'admin_head', array( &$this, 'custom_admin_css' ) );
|
||||
if ( isset($_GET['page']) && ($_GET['page'] == 'itsec' || $_GET['page'] == 'itsec-logs' || $_GET['page'] == 'itsec-security-check') ) {
|
||||
if ( isset($_GET['page']) && ($_GET['page'] == 'itsec' || $_GET['page'] == 'itsec-security-check') ) {
|
||||
wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' );
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -342,7 +342,7 @@ class MainWP_Child_Pagespeed {
|
|||
//$page_stats_column = $strategy . '_page_stats';
|
||||
|
||||
|
||||
$data_typestocheck = self::getTypesToCheck( 'all' );
|
||||
$data_typestocheck = self::get_filter_options( 'all' );
|
||||
|
||||
$gpi_page_stats = $wpdb->prefix . 'gpi_page_stats';
|
||||
if ( ! empty( $data_typestocheck ) ) {
|
||||
|
@ -360,7 +360,7 @@ class MainWP_Child_Pagespeed {
|
|||
$allpagedata = array();
|
||||
}
|
||||
|
||||
$reports_typestocheck = self::getTypesToCheck( 'all' );
|
||||
$reports_typestocheck = self::get_filter_options( 'all' );
|
||||
$gpi_page_reports = $wpdb->prefix . 'gpi_page_reports';
|
||||
|
||||
if ( ! empty( $reports_typestocheck ) ) {
|
||||
|
@ -435,7 +435,7 @@ class MainWP_Child_Pagespeed {
|
|||
);
|
||||
}
|
||||
|
||||
static function getTypesToCheck($restrict_type = 'all') {
|
||||
static function get_filter_options($restrict_type = 'all') {
|
||||
|
||||
$types = array();
|
||||
$gpi_options = get_option('gpagespeedi_options');
|
||||
|
@ -496,6 +496,25 @@ class MainWP_Child_Pagespeed {
|
|||
}
|
||||
}
|
||||
|
||||
if ( $gpi_options['check_custom_urls'] ) {
|
||||
global $wpdb;
|
||||
|
||||
$gpi_custom_urls = $wpdb->prefix . 'gpi_custom_urls';
|
||||
$custom_url_types = $wpdb->get_col(
|
||||
"
|
||||
SELECT DISTINCT type
|
||||
FROM $gpi_custom_urls
|
||||
"
|
||||
);
|
||||
|
||||
if ( ! empty( $custom_url_types ) ) {
|
||||
foreach ( $custom_url_types as $custom_url_type ) {
|
||||
$typestocheck[] = 'type = %s';
|
||||
$types[1][] = $custom_url_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($typestocheck)) {
|
||||
$types[0] = '';
|
||||
foreach($typestocheck as $type)
|
||||
|
|
|
@ -826,8 +826,8 @@ class MainWP_Child_Server_Information {
|
|||
?>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><?php echo $plugin['Name']; ?></td>
|
||||
<td><?php echo $plugin['Version']; ?></td>
|
||||
<td><?php echo esc_html($plugin['Name']); ?></td>
|
||||
<td><?php echo esc_html($plugin['Version']); ?></td>
|
||||
<td><?php echo is_plugin_active($slug) ? 'Active' : 'Inactive'; ?></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
@ -1569,11 +1569,6 @@ class MainWP_Child_Server_Information {
|
|||
|
||||
public static function renderWPConfig() {
|
||||
?>
|
||||
<style>
|
||||
#mainwp-code-display code {
|
||||
background: none !important;
|
||||
}
|
||||
</style>
|
||||
<div class="postbox" id="mainwp-code-display">
|
||||
<h3 class="hndle" style="padding: 8px 12px; font-size: 14px;"><span>WP-Config.php</span></h3>
|
||||
|
||||
|
@ -1673,9 +1668,9 @@ class MainWP_Child_Server_Information {
|
|||
foreach ($details as $row) {
|
||||
?>
|
||||
<tr>
|
||||
<th style="width: 20%"><strong><?php echo $row['title']; ?></strong></th>
|
||||
<td style="width: 20%"><strong><?php echo $row['value']; ?></strong></td>
|
||||
<td><?php echo $row['desc']; ?></td>
|
||||
<th style="width: 20%"><strong><?php echo esc_html($row['title']); ?></strong></th>
|
||||
<td style="width: 20%"><strong><?php echo esc_html($row['value']); ?></strong></td>
|
||||
<td><?php echo esc_html($row['desc']); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
|
|
@ -31,6 +31,8 @@ class MainWP_Child_Staging {
|
|||
public function __construct() {
|
||||
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
if ( is_plugin_active( 'wp-staging/wp-staging.php' ) && defined('WPSTG_PLUGIN_DIR')) {
|
||||
$this->is_plugin_installed = true;
|
||||
} else if ( is_plugin_active( 'wp-staging-pro/wp-staging-pro.php' ) ) {
|
||||
$this->is_plugin_installed = true;
|
||||
}
|
||||
|
||||
|
@ -429,6 +431,10 @@ class MainWP_Child_Staging {
|
|||
unset( $value->response['wp-staging/wp-staging.php'] );
|
||||
}
|
||||
|
||||
if ( isset( $value->response['wp-staging-pro/wp-staging-pro.php'] ) ) {
|
||||
unset( $value->response['wp-staging-pro/wp-staging-pro.php'] );
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,10 +40,10 @@ class MainWP_Child_Timecapsule {
|
|||
|
||||
|
||||
public function init() {
|
||||
if ( get_option( 'mainwp_time_capsule_ext_enabled' ) !== 'Y' )
|
||||
if (!$this->is_plugin_installed)
|
||||
return;
|
||||
|
||||
if (!$this->is_plugin_installed)
|
||||
if ( get_option( 'mainwp_time_capsule_ext_enabled' ) !== 'Y' )
|
||||
return;
|
||||
|
||||
add_action( 'mainwp_child_site_stats', array( $this, 'do_site_stats' ) );
|
||||
|
@ -70,8 +70,6 @@ class MainWP_Child_Timecapsule {
|
|||
}
|
||||
|
||||
$information = array();
|
||||
if (get_option( 'mainwp_time_capsule_ext_enabled' ) !== 'Y')
|
||||
MainWP_Helper::update_option( 'mainwp_time_capsule_ext_enabled', 'Y', 'yes' );
|
||||
|
||||
$options_helper = new Wptc_Options_Helper();
|
||||
$options = WPTC_Factory::get('config');
|
||||
|
@ -245,6 +243,8 @@ class MainWP_Child_Timecapsule {
|
|||
public function syncOthersData( $information, $data = array() ) {
|
||||
if ( isset( $data['syncWPTimeCapsule'] ) && $data['syncWPTimeCapsule'] ) {
|
||||
$information['syncWPTimeCapsule'] = $this->get_sync_data();
|
||||
if (get_option( 'mainwp_time_capsule_ext_enabled' ) !== 'Y')
|
||||
MainWP_Helper::update_option( 'mainwp_time_capsule_ext_enabled', 'Y', 'yes' );
|
||||
}
|
||||
return $information;
|
||||
}
|
||||
|
@ -724,6 +724,10 @@ function get_sibling_files_callback_wptc() {
|
|||
}
|
||||
|
||||
$last_time = time() - 24 * 7 * 2 * 60 * 60; // 2 weeks ago
|
||||
$lasttime_logged = MainWP_Helper::get_lasttime_backup('wptimecapsule');
|
||||
if (empty($lasttime_logged))
|
||||
$last_time = time() - 24 * 7 * 8 * 60 * 60; // 8 weeks ago
|
||||
|
||||
$all_last_backups = $this->getBackups( $last_time );
|
||||
|
||||
if (is_array($all_last_backups)) {
|
||||
|
|
|
@ -940,7 +940,11 @@ class MainWP_Child_Updraft_Plus_Backups {
|
|||
|
||||
do_action( $event, apply_filters( 'updraft_backupnow_options', $options, array() ) );
|
||||
|
||||
return $msg;
|
||||
//return $msg;
|
||||
|
||||
// Control returns when the backup finished; but, the browser connection should have been closed before
|
||||
die;
|
||||
|
||||
|
||||
// not used anymore
|
||||
// if (wp_schedule_single_event(time()+5, $event, array($backupnow_nocloud)) === false) {
|
||||
|
|
|
@ -580,7 +580,7 @@ class MainWP_Child {
|
|||
remove_filter( 'pre_site_transient_update_plugins', $this->filterFunction, 99 );
|
||||
|
||||
set_site_transient( 'mainwp_update_plugins_cached', $plugins, DAY_IN_SECONDS);
|
||||
wp_destroy_current_session(); // to fix issue multi user session
|
||||
//wp_destroy_current_session(); // to fix issue multi user session
|
||||
|
||||
}
|
||||
|
||||
|
@ -590,7 +590,7 @@ class MainWP_Child {
|
|||
remove_filter( 'pre_site_transient_update_themes', $this->filterFunction, 99 );
|
||||
|
||||
set_site_transient( 'mainwp_update_themes_cached', $themes, DAY_IN_SECONDS);
|
||||
wp_destroy_current_session(); // to fix issue multi user session
|
||||
//wp_destroy_current_session(); // to fix issue multi user session
|
||||
}
|
||||
|
||||
|
||||
|
@ -607,7 +607,7 @@ class MainWP_Child {
|
|||
if (isset($this->callableFunctions[ $function ])) {
|
||||
call_user_func( array( $this, $this->callableFunctions[ $function ] ) );
|
||||
}
|
||||
wp_destroy_current_session(); // to fix issue multi user session
|
||||
//wp_destroy_current_session(); // to fix issue multi user session
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1593,7 +1593,7 @@ class MainWP_Child {
|
|||
if ( 1 === (int) get_option( 'mainwpKeywordLinks' ) ) {
|
||||
new MainWP_Keyword_Links();
|
||||
if ( ! is_admin() ) {
|
||||
add_filter( 'the_content', array( MainWP_Keyword_Links::Instance(), 'filter_content' ), 100 );
|
||||
//add_filter( 'the_content', array( MainWP_Keyword_Links::Instance(), 'filter_content' ), 100 );
|
||||
}
|
||||
MainWP_Keyword_Links::Instance()->update_htaccess(); // if needed
|
||||
MainWP_Keyword_Links::Instance()->redirect_cloak();
|
||||
|
@ -4013,6 +4013,14 @@ class MainWP_Child {
|
|||
$information['plugins_outdate_info'] = MainWP_Child_Plugins_Check::Instance()->get_plugins_outdate_info();
|
||||
$information['themes_outdate_info'] = MainWP_Child_Themes_Check::Instance()->get_themes_outdate_info();
|
||||
|
||||
if (isset( $_POST['user'] )) {
|
||||
$user = get_user_by( 'login', $_POST['user'] );
|
||||
if ( $user && property_exists($user, 'ID') && $user->ID) {
|
||||
$information['admin_nicename'] = $user->data->user_nicename;
|
||||
$information['admin_useremail'] = $user->data->user_email;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
do_action('mainwp_child_site_stats');
|
||||
} catch(Exception $e) {
|
||||
|
|
|
@ -1210,27 +1210,27 @@ class MainWP_Helper {
|
|||
switch($by) {
|
||||
case 'backupbuddy':
|
||||
if ( !is_plugin_active( 'backupbuddy/backupbuddy.php' ) && !is_plugin_active( 'Backupbuddy/backupbuddy.php' )) {
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 'backupwordpress':
|
||||
if ( !is_plugin_active( 'backupwordpress/backupwordpress.php' )) {
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 'backwpup':
|
||||
if ( !is_plugin_active( 'backwpup/backwpup.php' ) && !is_plugin_active( 'backwpup-pro/backwpup.php' ) ) {
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 'updraftplus':
|
||||
if ( !is_plugin_active( 'updraftplus/updraftplus.php' )) {
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 'wptimecapsule':
|
||||
if ( !is_plugin_active( 'wp-time-capsule/wp-time-capsule.php' )) {
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue