Version Description
- 4-17-18 =
- Fixed: multiple cloning issues
- Fixed: timezone issue backup timestamp
- Fixed: MainWP Branding Extension conflict that caused issues with hooking WP Admin menu items
- Fixed: MainWP Branding Extension issue with hiding WordPress update nag
- Fixed: MainWP Branding Extension issue with updating WordPress footer content
- Fixed: issues with loading broken links data
- Fixed: multiple PHP 7.2 warnings
- Added: support for the BackBlaze backup remote destination (UpdraftPlus Extension)
- Added: support for recording Live Stash updates for Client Reporting
- Updated: recent Wordfence plugin version compatibility
- Updated: recent WP Staging plugin version compatibility
Download this release
Release Info
Developer | mainwp |
Plugin | MainWP Child |
Version | 3.4.7 |
Comparing to | |
See all releases |
Code changes from version 3.4.6 to 3.4.7
- class/class-mainwp-backup.php +5 -1
- class/class-mainwp-child-back-up-buddy.php +27 -2
- class/class-mainwp-child-back-wp-up.php +14 -2
- class/class-mainwp-child-branding.php +69 -16
- class/class-mainwp-child-links-checker.php +11 -3
- class/class-mainwp-child-server-information.php +8 -3
- class/class-mainwp-child-staging.php +31 -3
- class/class-mainwp-child-updraft-plus-backups.php +12 -1
- class/class-mainwp-child-wordfence.php +65 -28
- class/class-mainwp-child.php +30 -25
- class/class-mainwp-helper.php +9 -4
- mainwp-child.php +1 -1
- readme.txt +29 -2
class/class-mainwp-backup.php
CHANGED
@@ -795,7 +795,11 @@ class MainWP_Backup {
|
|
795 |
// @codingStandardsIgnoreEnd
|
796 |
$query = $table_insert;
|
797 |
foreach ( $row as $value ) {
|
798 |
-
|
|
|
|
|
|
|
|
|
799 |
}
|
800 |
$query = trim( $query, ', ' ) . ');';
|
801 |
|
795 |
// @codingStandardsIgnoreEnd
|
796 |
$query = $table_insert;
|
797 |
foreach ( $row as $value ) {
|
798 |
+
if ( $value === null ) {
|
799 |
+
$query .= 'NULL, ';
|
800 |
+
} else {
|
801 |
+
$query .= '"' . MainWP_Child_DB::real_escape_string( $value ) . '", ';
|
802 |
+
}
|
803 |
}
|
804 |
$query = trim( $query, ', ' ) . ');';
|
805 |
|
class/class-mainwp-child-back-up-buddy.php
CHANGED
@@ -72,7 +72,7 @@ class MainWP_Child_Back_Up_Buddy {
|
|
72 |
}
|
73 |
|
74 |
|
75 |
-
function do_site_stats() {
|
76 |
if (has_action('mainwp_child_reports_log')) {
|
77 |
do_action( 'mainwp_child_reports_log', 'backupbuddy');
|
78 |
} else {
|
@@ -91,7 +91,7 @@ class MainWP_Child_Back_Up_Buddy {
|
|
91 |
if ( ! class_exists( 'backupbuddy_core' ) ) {
|
92 |
require_once( pb_backupbuddy::plugin_path() . '/classes/core.php' );
|
93 |
}
|
94 |
-
|
95 |
// Backup type.
|
96 |
$pretty_type = array(
|
97 |
'full' => 'Full',
|
@@ -139,6 +139,31 @@ class MainWP_Child_Back_Up_Buddy {
|
|
139 |
MainWP_Helper::update_lasttime_backup('backupbuddy', $finish_time); // to support backup before update feature
|
140 |
}
|
141 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
}
|
143 |
|
144 |
public function action() {
|
72 |
}
|
73 |
|
74 |
|
75 |
+
function do_site_stats() {
|
76 |
if (has_action('mainwp_child_reports_log')) {
|
77 |
do_action( 'mainwp_child_reports_log', 'backupbuddy');
|
78 |
} else {
|
91 |
if ( ! class_exists( 'backupbuddy_core' ) ) {
|
92 |
require_once( pb_backupbuddy::plugin_path() . '/classes/core.php' );
|
93 |
}
|
94 |
+
|
95 |
// Backup type.
|
96 |
$pretty_type = array(
|
97 |
'full' => 'Full',
|
139 |
MainWP_Helper::update_lasttime_backup('backupbuddy', $finish_time); // to support backup before update feature
|
140 |
}
|
141 |
}
|
142 |
+
|
143 |
+
if ( file_exists(pb_backupbuddy::plugin_path() . '/destinations/live/live_periodic.php') ) {
|
144 |
+
require_once( pb_backupbuddy::plugin_path() . '/destinations/live/live_periodic.php' );
|
145 |
+
|
146 |
+
$state = backupbuddy_live_periodic::get_stats();
|
147 |
+
if (is_array($state) && isset($state['stats'])) {
|
148 |
+
|
149 |
+
if ( is_array($state['stats'] ) && isset( $state['stats']['last_remote_snapshot'] )) {
|
150 |
+
if (isset( $state['stats']['last_remote_snapshot_response'] )) {
|
151 |
+
$resp = $state['stats']['last_remote_snapshot_response'];
|
152 |
+
if ( isset( $resp['success'] ) && $resp['success']) {
|
153 |
+
$finish_time = $state['stats']['last_remote_snapshot'];
|
154 |
+
$backupType = 'Live Backup to cloud';
|
155 |
+
$message = 'BackupBuddy ' . $backupType . ' finished';
|
156 |
+
if (!empty($finish_time)) {
|
157 |
+
do_action( 'mainwp_reports_backupbuddy_backup', $message, $backupType, $finish_time);
|
158 |
+
MainWP_Helper::update_lasttime_backup('backupbuddy', $finish_time); // to support backup before update feature
|
159 |
+
}
|
160 |
+
|
161 |
+
}
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
}
|
166 |
+
}
|
167 |
}
|
168 |
|
169 |
public function action() {
|
class/class-mainwp-child-back-wp-up.php
CHANGED
@@ -66,6 +66,7 @@ class MainWP_Child_Back_WP_Up {
|
|
66 |
|
67 |
if ( $this->is_backwpup_installed ) {
|
68 |
add_action( 'wp_ajax_mainwp_backwpup_download_backup', array( $this, 'download_backup' ) );
|
|
|
69 |
}
|
70 |
}
|
71 |
|
@@ -236,7 +237,17 @@ class MainWP_Child_Back_WP_Up {
|
|
236 |
}
|
237 |
}
|
238 |
}
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
function get_destinations_list() {
|
241 |
|
242 |
$jobdest = array();
|
@@ -577,11 +588,12 @@ class MainWP_Child_Back_WP_Up {
|
|
577 |
if ( is_null($dest_class) ) {
|
578 |
continue;
|
579 |
}
|
580 |
-
$items = $dest_class->file_get_list( $jobid . '_' . $dest );
|
581 |
if ( ! empty( $items ) ) {
|
582 |
foreach ( $items as $item ) {
|
583 |
$temp_single_item = $item;
|
584 |
$temp_single_item['dest'] = $jobid . '_' . $dest;
|
|
|
585 |
$output->items[] = $temp_single_item;
|
586 |
}
|
587 |
}
|
66 |
|
67 |
if ( $this->is_backwpup_installed ) {
|
68 |
add_action( 'wp_ajax_mainwp_backwpup_download_backup', array( $this, 'download_backup' ) );
|
69 |
+
add_filter( 'mainwp-site-sync-others-data', array( $this, 'syncOthersData' ), 10, 2 );
|
70 |
}
|
71 |
}
|
72 |
|
237 |
}
|
238 |
}
|
239 |
}
|
240 |
+
|
241 |
+
function syncOthersData( $information, $data = array() ) {
|
242 |
+
if ( isset( $data['syncBackwpupData'] ) ) {
|
243 |
+
$lastbackup = MainWP_Helper::get_lasttime_backup('backwpup');
|
244 |
+
$information['syncBackwpupData'] = array(
|
245 |
+
'lastbackup' => $lastbackup
|
246 |
+
);
|
247 |
+
}
|
248 |
+
return $information;
|
249 |
+
}
|
250 |
+
|
251 |
function get_destinations_list() {
|
252 |
|
253 |
$jobdest = array();
|
588 |
if ( is_null($dest_class) ) {
|
589 |
continue;
|
590 |
}
|
591 |
+
$items = $dest_class->file_get_list( $jobid . '_' . $dest );
|
592 |
if ( ! empty( $items ) ) {
|
593 |
foreach ( $items as $item ) {
|
594 |
$temp_single_item = $item;
|
595 |
$temp_single_item['dest'] = $jobid . '_' . $dest;
|
596 |
+
$temp_single_item['timeloc'] = sprintf( __( '%1$s at %2$s', 'backwpup' ), date_i18n( get_option( 'date_format' ), $temp_single_item[ 'time' ], TRUE ), date_i18n( get_option( 'time_format' ), $temp_single_item[ 'time' ], TRUE ) );
|
597 |
$output->items[] = $temp_single_item;
|
598 |
}
|
599 |
}
|
class/class-mainwp-child-branding.php
CHANGED
@@ -51,9 +51,6 @@ class MainWP_Child_Branding {
|
|
51 |
return $plugin_meta;
|
52 |
}
|
53 |
|
54 |
-
public static function admin_init() {
|
55 |
-
}
|
56 |
-
|
57 |
public function child_deactivation() {
|
58 |
$dell_all = array(
|
59 |
'mainwp_branding_disable_change',
|
@@ -105,7 +102,7 @@ class MainWP_Child_Branding {
|
|
105 |
'description' => $settings['child_plugin_desc'],
|
106 |
'author' => $settings['child_plugin_author'],
|
107 |
'authoruri' => $settings['child_plugin_author_uri'],
|
108 |
-
'pluginuri' => $settings['child_plugin_uri'],
|
109 |
);
|
110 |
MainWP_Helper::update_option( 'mainwp_branding_preserve_branding', $settings['child_preserve_branding'], 'yes' );
|
111 |
MainWP_Helper::update_option( 'mainwp_branding_plugin_header', $header, 'yes' );
|
@@ -287,6 +284,28 @@ class MainWP_Child_Branding {
|
|
287 |
}
|
288 |
|
289 |
add_filter( 'map_meta_cap', array( $this, 'branding_map_meta_cap' ), 10, 5 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
|
291 |
// to fix
|
292 |
add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
|
@@ -322,12 +341,13 @@ class MainWP_Child_Branding {
|
|
322 |
add_action( 'login_head', array( &$this, 'custom_login_logo' ) );
|
323 |
add_action( 'wp_head', array( &$this, 'custom_favicon_frontend' ) );
|
324 |
if ( isset( $extra_setting['dashboard_footer'] ) && ! empty( $extra_setting['dashboard_footer'] ) ) {
|
325 |
-
remove_filter( 'update_footer', 'core_update_footer' );
|
326 |
-
add_filter( 'update_footer', array( &$this, '
|
|
|
327 |
}
|
328 |
|
329 |
-
if ( isset( $extra_setting['hide_nag'] ) && ! empty( $extra_setting['hide_nag'] ) ) {
|
330 |
-
add_action( 'admin_init',
|
331 |
}
|
332 |
|
333 |
add_action( 'admin_menu', array( &$this, 'remove_default_post_metaboxes' ) );
|
@@ -335,6 +355,11 @@ class MainWP_Child_Branding {
|
|
335 |
}
|
336 |
}
|
337 |
|
|
|
|
|
|
|
|
|
|
|
338 |
// to fix conflict with other plugin
|
339 |
function admin_menu() {
|
340 |
if ( !current_user_can( 'administrator' ) ) {
|
@@ -487,8 +512,34 @@ class MainWP_Child_Branding {
|
|
487 |
return $defaults;
|
488 |
}
|
489 |
|
490 |
-
|
491 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
492 |
$extra_setting = $this->settings['extra_settings'];
|
493 |
if ( isset( $extra_setting['dashboard_footer'] ) && ! empty( $extra_setting['dashboard_footer'] ) ) {
|
494 |
echo wp_kses_post( nl2br( stripslashes( $extra_setting['dashboard_footer'] ) ) );
|
@@ -800,12 +851,14 @@ class MainWP_Child_Branding {
|
|
800 |
}
|
801 |
|
802 |
public function branding_map_meta_cap( $caps, $cap, $user_id, $args ) {
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
|
|
|
|
809 |
if ( 'T' === get_option( 'mainwp_branding_disable_switching_theme' ) ) {
|
810 |
// disable: theme switching
|
811 |
if ( 'switch_themes' === $cap ) {
|
51 |
return $plugin_meta;
|
52 |
}
|
53 |
|
|
|
|
|
|
|
54 |
public function child_deactivation() {
|
55 |
$dell_all = array(
|
56 |
'mainwp_branding_disable_change',
|
102 |
'description' => $settings['child_plugin_desc'],
|
103 |
'author' => $settings['child_plugin_author'],
|
104 |
'authoruri' => $settings['child_plugin_author_uri'],
|
105 |
+
'pluginuri' => isset($settings['child_plugin_uri']) ? $settings['child_plugin_uri'] : '',
|
106 |
);
|
107 |
MainWP_Helper::update_option( 'mainwp_branding_preserve_branding', $settings['child_preserve_branding'], 'yes' );
|
108 |
MainWP_Helper::update_option( 'mainwp_branding_plugin_header', $header, 'yes' );
|
284 |
}
|
285 |
|
286 |
add_filter( 'map_meta_cap', array( $this, 'branding_map_meta_cap' ), 10, 5 );
|
287 |
+
|
288 |
+
if ( 'T' === get_option( 'mainwp_branding_disable_change' ) ) {
|
289 |
+
|
290 |
+
// Disable the wordpress plugin update notifications
|
291 |
+
remove_action('load-update-core.php', 'wp_update_plugins');
|
292 |
+
add_filter('pre_site_transient_update_plugins', '__return_null');
|
293 |
+
|
294 |
+
// Disable the wordpress theme update notifications
|
295 |
+
remove_action('load-update-core.php', 'wp_update_themes');
|
296 |
+
add_filter('pre_site_transient_update_themes', ( $func = function($a){ return null;} ));
|
297 |
+
|
298 |
+
// Disable the wordpress core update notifications
|
299 |
+
add_action('after_setup_theme', 'remove_core_updates');
|
300 |
+
function remove_core_updates() {
|
301 |
+
add_action('init', ( $func = function($a){ remove_action( 'wp_version_check', 'wp_version_check' );} ), 2);
|
302 |
+
add_filter('pre_option_update_core', '__return_null');
|
303 |
+
add_filter('pre_site_transient_update_core', '__return_null');
|
304 |
+
}
|
305 |
+
|
306 |
+
add_action( 'admin_head', array( &$this, 'admin_head_hide_elements' ), 15 );
|
307 |
+
add_action( 'admin_menu', array($this, 'branding_redirect' ), 9);
|
308 |
+
}
|
309 |
|
310 |
// to fix
|
311 |
add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
|
341 |
add_action( 'login_head', array( &$this, 'custom_login_logo' ) );
|
342 |
add_action( 'wp_head', array( &$this, 'custom_favicon_frontend' ) );
|
343 |
if ( isset( $extra_setting['dashboard_footer'] ) && ! empty( $extra_setting['dashboard_footer'] ) ) {
|
344 |
+
//remove_filter( 'update_footer', 'core_update_footer' );
|
345 |
+
add_filter( 'update_footer', array( &$this, 'core_update_footer' ), 14 );
|
346 |
+
add_filter( 'admin_footer_text', array( &$this, 'admin_footer_text' ), 14 );
|
347 |
}
|
348 |
|
349 |
+
if ( isset( $extra_setting['hide_nag'] ) && ! empty( $extra_setting['hide_nag'] ) ) {
|
350 |
+
add_action( 'admin_init', array($this, 'admin_init'));
|
351 |
}
|
352 |
|
353 |
add_action( 'admin_menu', array( &$this, 'remove_default_post_metaboxes' ) );
|
355 |
}
|
356 |
}
|
357 |
|
358 |
+
|
359 |
+
public function admin_init() {
|
360 |
+
remove_action( 'admin_notices', 'update_nag', 3 );
|
361 |
+
}
|
362 |
+
|
363 |
// to fix conflict with other plugin
|
364 |
function admin_menu() {
|
365 |
if ( !current_user_can( 'administrator' ) ) {
|
512 |
return $defaults;
|
513 |
}
|
514 |
|
515 |
+
public function branding_redirect() {
|
516 |
+
$pos1 = stripos( $_SERVER['REQUEST_URI'], 'update-core.php' );
|
517 |
+
$pos2 = stripos( $_SERVER['REQUEST_URI'], 'plugins.php' );
|
518 |
+
if ( false !== $pos1 || false !== $pos2 ) {
|
519 |
+
wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' );
|
520 |
+
exit();
|
521 |
+
}
|
522 |
+
}
|
523 |
+
|
524 |
+
function admin_head_hide_elements() {
|
525 |
+
?><script type="text/javascript">
|
526 |
+
document.addEventListener("DOMContentLoaded", function(event) {
|
527 |
+
document.getElementById("wp-admin-bar-updates").outerHTML = '';
|
528 |
+
document.getElementById("menu-plugins").outerHTML = '';
|
529 |
+
var els_core = document.querySelectorAll("a[href='update-core.php']");
|
530 |
+
for (var i = 0, l = els_core.length; i < l; i++) {
|
531 |
+
var el = els_core[i];
|
532 |
+
el.parentElement.innerHTML = '';
|
533 |
+
}
|
534 |
+
});
|
535 |
+
</script><?php
|
536 |
+
}
|
537 |
+
|
538 |
+
function core_update_footer() {
|
539 |
+
echo ''; // it clear version text
|
540 |
+
}
|
541 |
+
|
542 |
+
function admin_footer_text() {
|
543 |
$extra_setting = $this->settings['extra_settings'];
|
544 |
if ( isset( $extra_setting['dashboard_footer'] ) && ! empty( $extra_setting['dashboard_footer'] ) ) {
|
545 |
echo wp_kses_post( nl2br( stripslashes( $extra_setting['dashboard_footer'] ) ) );
|
851 |
}
|
852 |
|
853 |
public function branding_map_meta_cap( $caps, $cap, $user_id, $args ) {
|
854 |
+
|
855 |
+
// this is causing of some plugin's menu not added
|
856 |
+
// if ( 'T' === get_option( 'mainwp_branding_disable_change' ) ) {
|
857 |
+
// // disable: edit, update, install, active themes and plugins
|
858 |
+
// if ( false !== strpos( $cap, 'plugins' ) || false !== strpos( $cap, 'themes' ) || 'edit_theme_options' === $cap ) {
|
859 |
+
// $caps[0] = 'do_not_allow';
|
860 |
+
// }
|
861 |
+
// }
|
862 |
if ( 'T' === get_option( 'mainwp_branding_disable_switching_theme' ) ) {
|
863 |
// disable: theme switching
|
864 |
if ( 'switch_themes' === $cap ) {
|
class/class-mainwp-child-links-checker.php
CHANGED
@@ -212,9 +212,15 @@ class MainWP_Child_Links_Checker {
|
|
212 |
} else {
|
213 |
$params['offset'] = $offset;
|
214 |
}
|
215 |
-
|
216 |
$link_data = $this->do_sync_links_data($params);
|
217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
$information = array('links_data' => $link_data);
|
219 |
|
220 |
if ($first_sync) {
|
@@ -225,6 +231,8 @@ class MainWP_Child_Links_Checker {
|
|
225 |
$information['sync_offset'] = $offset + $max_results;
|
226 |
} else {
|
227 |
$information['last_sync'] = 1;
|
|
|
|
|
228 |
}
|
229 |
|
230 |
$information['result'] = 'success';
|
@@ -275,7 +283,7 @@ class MainWP_Child_Links_Checker {
|
|
275 |
'status_code',
|
276 |
'log'
|
277 |
);
|
278 |
-
$return =
|
279 |
|
280 |
$blc_option = get_option( 'wsblc_options' );
|
281 |
|
@@ -366,7 +374,7 @@ class MainWP_Child_Links_Checker {
|
|
366 |
$return[] = $new_link;
|
367 |
}
|
368 |
} else {
|
369 |
-
return
|
370 |
}
|
371 |
|
372 |
return $return;
|
212 |
} else {
|
213 |
$params['offset'] = $offset;
|
214 |
}
|
215 |
+
|
216 |
$link_data = $this->do_sync_links_data($params);
|
217 |
|
218 |
+
$total_sync = 0;
|
219 |
+
if ($offset){
|
220 |
+
$total_sync = $offset;
|
221 |
+
}
|
222 |
+
$total_sync += (is_array($link_data) ? count($link_data) : 0);
|
223 |
+
|
224 |
$information = array('links_data' => $link_data);
|
225 |
|
226 |
if ($first_sync) {
|
231 |
$information['sync_offset'] = $offset + $max_results;
|
232 |
} else {
|
233 |
$information['last_sync'] = 1;
|
234 |
+
$information['total_sync'] = $total_sync;
|
235 |
+
$information['data'] = $this->get_count_links();
|
236 |
}
|
237 |
|
238 |
$information['result'] = 'success';
|
283 |
'status_code',
|
284 |
'log'
|
285 |
);
|
286 |
+
$return = array();
|
287 |
|
288 |
$blc_option = get_option( 'wsblc_options' );
|
289 |
|
374 |
$return[] = $new_link;
|
375 |
}
|
376 |
} else {
|
377 |
+
return array();
|
378 |
}
|
379 |
|
380 |
return $return;
|
class/class-mainwp-child-server-information.php
CHANGED
@@ -1490,7 +1490,7 @@ class MainWP_Child_Server_Information {
|
|
1490 |
$lines[ $key ] = compact( 'time', 'error' );
|
1491 |
}
|
1492 |
|
1493 |
-
if ( count( $error_log ) > 1 ) {
|
1494 |
|
1495 |
uasort( $lines, array( __CLASS__, 'time_compare' ) );
|
1496 |
$lines = array_slice( $lines, 0, $count );
|
@@ -1620,6 +1620,11 @@ class MainWP_Child_Server_Information {
|
|
1620 |
}
|
1621 |
|
1622 |
public static function renderConnectionDetails() {
|
|
|
|
|
|
|
|
|
|
|
1623 |
global $current_user;
|
1624 |
$uniqueId = get_option('mainwp_child_uniqueId');
|
1625 |
$details = array(
|
@@ -1641,7 +1646,7 @@ class MainWP_Child_Server_Information {
|
|
1641 |
'uniqueid' => array(
|
1642 |
'title' => __('Child unique security id', 'mainwp-child'),
|
1643 |
'value' => !empty($uniqueId) ? $uniqueId : __('Leave the field blank', 'mainwp-child'),
|
1644 |
-
'desc' => __('Child unique security id is not required, however, since you have enabled it, you need to add it to your
|
1645 |
),
|
1646 |
'verify_ssl' => array(
|
1647 |
'title' => __('Verify certificate', 'mainwp-child'),
|
@@ -1661,7 +1666,7 @@ class MainWP_Child_Server_Information {
|
|
1661 |
<div class="inside">
|
1662 |
<div class="mainwp-postbox-actions-top mainwp-padding-5">
|
1663 |
<?php
|
1664 |
-
|
1665 |
?>
|
1666 |
</div>
|
1667 |
<table id="mainwp-table" class="wp-list-table widefat" cellspacing="0" style="border: 0">
|
1490 |
$lines[ $key ] = compact( 'time', 'error' );
|
1491 |
}
|
1492 |
|
1493 |
+
if ( is_array( $error_log ) && count( $error_log ) > 1 ) {
|
1494 |
|
1495 |
uasort( $lines, array( __CLASS__, 'time_compare' ) );
|
1496 |
$lines = array_slice( $lines, 0, $count );
|
1620 |
}
|
1621 |
|
1622 |
public static function renderConnectionDetails() {
|
1623 |
+
$branding_title = 'MainWP';
|
1624 |
+
if ( MainWP_Child_Branding::is_branding() ) {
|
1625 |
+
$branding_title = MainWP_Child_Branding::get_branding();
|
1626 |
+
}
|
1627 |
+
|
1628 |
global $current_user;
|
1629 |
$uniqueId = get_option('mainwp_child_uniqueId');
|
1630 |
$details = array(
|
1646 |
'uniqueid' => array(
|
1647 |
'title' => __('Child unique security id', 'mainwp-child'),
|
1648 |
'value' => !empty($uniqueId) ? $uniqueId : __('Leave the field blank', 'mainwp-child'),
|
1649 |
+
'desc' => sprintf(__('Child unique security id is not required, however, since you have enabled it, you need to add it to your %s dashboard.', 'mainwp-child') , stripslashes( $branding_title ) )
|
1650 |
),
|
1651 |
'verify_ssl' => array(
|
1652 |
'title' => __('Verify certificate', 'mainwp-child'),
|
1666 |
<div class="inside">
|
1667 |
<div class="mainwp-postbox-actions-top mainwp-padding-5">
|
1668 |
<?php
|
1669 |
+
echo sprintf(__('If you are trying to connect this child site to your %s Dashboard, you can use following details to do that. Please note that these are only suggested values.', 'mainwp-child') , stripslashes( $branding_title ));
|
1670 |
?>
|
1671 |
</div>
|
1672 |
<table id="mainwp-table" class="wp-list-table widefat" cellspacing="0" style="border: 0">
|
class/class-mainwp-child-staging.php
CHANGED
@@ -106,6 +106,12 @@ class MainWP_Child_Staging {
|
|
106 |
case 'cancel_clone':
|
107 |
$information = $this->ajaxCancelClone();
|
108 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
}
|
110 |
}
|
111 |
MainWP_Helper::write( $information );
|
@@ -129,7 +135,9 @@ class MainWP_Child_Staging {
|
|
129 |
'wpSubDirectory',
|
130 |
'debugMode',
|
131 |
'unInstallOnDelete',
|
132 |
-
'checkDirectorySize'
|
|
|
|
|
133 |
);
|
134 |
|
135 |
$save_fields = array();
|
@@ -188,9 +196,11 @@ class MainWP_Child_Staging {
|
|
188 |
}
|
189 |
|
190 |
public function ajaxStartClone() {
|
191 |
-
|
192 |
-
$cloning = new WPStaging\Backend\Modules\Jobs\Cloning();
|
193 |
|
|
|
|
|
|
|
|
|
194 |
if( !$cloning->save() ) {
|
195 |
return;
|
196 |
}
|
@@ -280,7 +290,25 @@ class MainWP_Child_Staging {
|
|
280 |
$cancel = new WPStaging\Backend\Modules\Jobs\Cancel();
|
281 |
return $cancel->start();
|
282 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
|
285 |
public function ajaxCheckFreeSpace() {
|
286 |
return $this->hasFreeDiskSpace();
|
106 |
case 'cancel_clone':
|
107 |
$information = $this->ajaxCancelClone();
|
108 |
break;
|
109 |
+
case 'staging_update':
|
110 |
+
$information = $this->ajaxUpdateProcess();
|
111 |
+
break;
|
112 |
+
case 'cancel_update':
|
113 |
+
$information = $this->ajaxCancelUpdate();
|
114 |
+
break;
|
115 |
}
|
116 |
}
|
117 |
MainWP_Helper::write( $information );
|
135 |
'wpSubDirectory',
|
136 |
'debugMode',
|
137 |
'unInstallOnDelete',
|
138 |
+
'checkDirectorySize',
|
139 |
+
'optimizer',
|
140 |
+
'loginSlug'
|
141 |
);
|
142 |
|
143 |
$save_fields = array();
|
196 |
}
|
197 |
|
198 |
public function ajaxStartClone() {
|
|
|
|
|
199 |
|
200 |
+
$this->url = ''; // to fix warning
|
201 |
+
$cloning = new WPStaging\Backend\Modules\Jobs\Cloning();
|
202 |
+
|
203 |
+
|
204 |
if( !$cloning->save() ) {
|
205 |
return;
|
206 |
}
|
290 |
$cancel = new WPStaging\Backend\Modules\Jobs\Cancel();
|
291 |
return $cancel->start();
|
292 |
}
|
293 |
+
|
294 |
+
public function ajaxCancelUpdate() {
|
295 |
+
$cancel = new WPStaging\Backend\Modules\Jobs\CancelUpdate();
|
296 |
+
return $cancel->start();
|
297 |
+
}
|
298 |
+
|
299 |
+
public function ajaxUpdateProcess() {
|
300 |
+
|
301 |
+
$cloning = new WPStaging\Backend\Modules\Jobs\Updating();
|
302 |
|
303 |
+
if( !$cloning->save() ) {
|
304 |
+
return;
|
305 |
+
}
|
306 |
+
|
307 |
+
ob_start();
|
308 |
+
require_once WPSTG_PLUGIN_DIR . "apps/Backend/views/clone/ajax/update.php";
|
309 |
+
$result = ob_get_clean();
|
310 |
+
return $result;
|
311 |
+
}
|
312 |
|
313 |
public function ajaxCheckFreeSpace() {
|
314 |
return $this->hasFreeDiskSpace();
|
class/class-mainwp-child-updraft-plus-backups.php
CHANGED
@@ -217,7 +217,8 @@ class MainWP_Child_Updraft_Plus_Backups {
|
|
217 |
//'updraft_azure', // disabled
|
218 |
'updraft_googlecloud',
|
219 |
//'updraft_updraftvault',
|
220 |
-
'updraft_retain_extrarules'
|
|
|
221 |
);
|
222 |
}
|
223 |
|
@@ -558,6 +559,16 @@ class MainWP_Child_Updraft_Plus_Backups {
|
|
558 |
}
|
559 |
}
|
560 |
UpdraftPlus_Options::update_updraft_option( 'updraft_sftp', $opts );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
561 |
} else {
|
562 |
UpdraftPlus_Options::update_updraft_option( $key, $settings[ $key ] );
|
563 |
}
|
217 |
//'updraft_azure', // disabled
|
218 |
'updraft_googlecloud',
|
219 |
//'updraft_updraftvault',
|
220 |
+
'updraft_retain_extrarules',
|
221 |
+
'updraft_backblaze',
|
222 |
);
|
223 |
}
|
224 |
|
559 |
}
|
560 |
}
|
561 |
UpdraftPlus_Options::update_updraft_option( 'updraft_sftp', $opts );
|
562 |
+
} else if ( 'updraft_backblaze' === $key ) {
|
563 |
+
$opts = UpdraftPlus_Options::get_updraft_option( 'updraft_backblaze' );
|
564 |
+
if (is_array($opts) && isset($opts['settings'])) {
|
565 |
+
$settings_key = key($opts['settings']);
|
566 |
+
$opts['settings'][$settings_key]['account_id'] = $settings[ $key ]['account_id'];
|
567 |
+
$opts['settings'][$settings_key]['key'] = $settings[ $key ]['key'];
|
568 |
+
$opts['settings'][$settings_key]['bucket_name'] = $this->replace_tokens( $settings[ $key ]['bucket_name'] );
|
569 |
+
$opts['settings'][$settings_key]['backup_path'] = $this->replace_tokens( $settings[ $key ]['backup_path'] );
|
570 |
+
UpdraftPlus_Options::update_updraft_option( $key, $opts );
|
571 |
+
}
|
572 |
} else {
|
573 |
UpdraftPlus_Options::update_updraft_option( $key, $settings[ $key ] );
|
574 |
}
|
class/class-mainwp-child-wordfence.php
CHANGED
@@ -141,6 +141,7 @@ class MainWP_Child_Wordfence {
|
|
141 |
'displayTopLevelBlocking',
|
142 |
'betaThreatDefenseFeed',
|
143 |
'scanType',
|
|
|
144 |
'wafStatus',
|
145 |
'learningModeGracePeriodEnabled',
|
146 |
'learningModeGracePeriod'
|
@@ -233,7 +234,7 @@ class MainWP_Child_Wordfence {
|
|
233 |
case 'get_summary':
|
234 |
$information = $this->get_summary();
|
235 |
break;
|
236 |
-
|
237 |
$information = $this->load_issues();
|
238 |
break;
|
239 |
case 'loadIssues':
|
@@ -437,7 +438,7 @@ class MainWP_Child_Wordfence {
|
|
437 |
'disableCodeExecutionUploads',
|
438 |
'disableCookies',
|
439 |
'actUpdateInterval',
|
440 |
-
'
|
441 |
'deleteTablesOnDeact',
|
442 |
'notification_updatesNeeded',
|
443 |
'notification_securityAlerts', // paid
|
@@ -552,7 +553,8 @@ class MainWP_Child_Wordfence {
|
|
552 |
'maxExecutionTime',
|
553 |
'scan_exclude',
|
554 |
'scan_include_extra',
|
555 |
-
'scanType'
|
|
|
556 |
);
|
557 |
$diagnostics_opts = array(
|
558 |
'debugOn',
|
@@ -786,11 +788,18 @@ class MainWP_Child_Wordfence {
|
|
786 |
$i = new wfIssues();
|
787 |
$iss = $i->getIssues($offset, $limit);
|
788 |
$counts = $i->getIssueCounts();
|
789 |
-
return array(
|
790 |
'issuesLists' => $iss,
|
791 |
'issueCounts' => $counts,
|
792 |
-
'lastScanCompleted' => wfConfig::get('lastScanCompleted')
|
793 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
794 |
}
|
795 |
|
796 |
public function load_wafData() {
|
@@ -1096,7 +1105,7 @@ SQL
|
|
1096 |
$opts = $settings;
|
1097 |
|
1098 |
// if saving then validate data
|
1099 |
-
if (
|
1100 |
$validUsers = array();
|
1101 |
$invalidUsers = array();
|
1102 |
foreach ( explode( ',', $opts['liveTraf_ignoreUsers'] ) as $val ) {
|
@@ -1122,8 +1131,8 @@ SQL
|
|
1122 |
}
|
1123 |
}
|
1124 |
|
1125 |
-
// if saving then validate data
|
1126 |
-
if (
|
1127 |
if ( ! $opts['other_WFNet'] ) {
|
1128 |
$wfdb = new wfDB();
|
1129 |
global $wpdb;
|
@@ -1133,35 +1142,63 @@ SQL
|
|
1133 |
}
|
1134 |
|
1135 |
$regenerateHtaccess = false;
|
1136 |
-
// if saving then validate data
|
1137 |
-
if (
|
1138 |
if ( wfConfig::get( 'bannedURLs', false ) !== $opts['bannedURLs'] ) {
|
1139 |
$regenerateHtaccess = true;
|
1140 |
}
|
1141 |
-
}
|
1142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1143 |
// save the settings
|
1144 |
foreach ( $opts as $key => $val ) {
|
1145 |
// check saving section fields
|
1146 |
if ( in_array( $key, $saving_opts ) ) {
|
1147 |
if ( 'apiKey' == $key ) { //Don't save API key yet
|
1148 |
continue;
|
1149 |
-
}
|
1150 |
-
|
1151 |
if (in_array( $key, self::$firewall_options_filter ) ) {
|
1152 |
wfWAF::getInstance()->getStorageEngine()->setConfig($key, $val);
|
1153 |
-
} else {
|
1154 |
-
wfConfig::set( $key, $val ); // save it
|
1155 |
}
|
1156 |
}
|
1157 |
}
|
1158 |
-
|
1159 |
if ( $regenerateHtaccess && ( wfConfig::get('cacheType') == 'falcon' ) ) {
|
1160 |
wfCache::addHtaccessCode('add');
|
1161 |
}
|
1162 |
|
1163 |
-
// if saving then validate data
|
1164 |
-
if (
|
1165 |
if ( '1' === $opts['autoUpdate'] ) {
|
1166 |
wfConfig::enableAutoUpdate();
|
1167 |
} else if ( '0' === $opts['autoUpdate'] ) {
|
@@ -1169,8 +1206,8 @@ SQL
|
|
1169 |
}
|
1170 |
}
|
1171 |
|
1172 |
-
// if saving then validate data
|
1173 |
-
if (
|
1174 |
if (isset($opts['disableCodeExecutionUploads'])) {
|
1175 |
try {
|
1176 |
if ( $opts['disableCodeExecutionUploads'] ) {
|
@@ -1184,8 +1221,8 @@ SQL
|
|
1184 |
}
|
1185 |
}
|
1186 |
|
1187 |
-
// if saving then validate data
|
1188 |
-
if (
|
1189 |
if (isset($opts['email_summary_enabled'])) {
|
1190 |
if ( ! empty( $opts['email_summary_enabled'] ) ) {
|
1191 |
wfConfig::set( 'email_summary_enabled', 1 );
|
@@ -1199,8 +1236,8 @@ SQL
|
|
1199 |
}
|
1200 |
}
|
1201 |
|
1202 |
-
// if saving then validate data
|
1203 |
-
if (
|
1204 |
$sch = isset( $opts['scheduleScan'] ) ? $opts['scheduleScan'] : '';
|
1205 |
if ( get_option( 'mainwp_child_wordfence_cron_time' ) !== $sch ) {
|
1206 |
update_option( 'mainwp_child_wordfence_cron_time', $sch );
|
@@ -1219,7 +1256,7 @@ SQL
|
|
1219 |
$result['paidKeyMsg'] = false;
|
1220 |
|
1221 |
// if saving then validate data
|
1222 |
-
if (
|
1223 |
$apiKey = trim( $_POST['apiKey'] );
|
1224 |
if ( ! $apiKey ) { //Empty API key (after trim above), then try to get one.
|
1225 |
$api = new wfAPI( '', wfUtils::getWPVersion() );
|
@@ -1815,7 +1852,7 @@ SQL
|
|
1815 |
if ( isset( $_POST['IP'] ) ) {
|
1816 |
$IP = $_POST['IP'];
|
1817 |
wfBlock::unblockIP( $IP );
|
1818 |
-
return array( '
|
1819 |
}
|
1820 |
}
|
1821 |
|
141 |
'displayTopLevelBlocking',
|
142 |
'betaThreatDefenseFeed',
|
143 |
'scanType',
|
144 |
+
'schedMode', // paid, if free then auto
|
145 |
'wafStatus',
|
146 |
'learningModeGracePeriodEnabled',
|
147 |
'learningModeGracePeriod'
|
234 |
case 'get_summary':
|
235 |
$information = $this->get_summary();
|
236 |
break;
|
237 |
+
case 'load_issues': // not used in from version 2.0 of WF ext
|
238 |
$information = $this->load_issues();
|
239 |
break;
|
240 |
case 'loadIssues':
|
438 |
'disableCodeExecutionUploads',
|
439 |
'disableCookies',
|
440 |
'actUpdateInterval',
|
441 |
+
'other_bypassLitespeedNoabort',
|
442 |
'deleteTablesOnDeact',
|
443 |
'notification_updatesNeeded',
|
444 |
'notification_securityAlerts', // paid
|
553 |
'maxExecutionTime',
|
554 |
'scan_exclude',
|
555 |
'scan_include_extra',
|
556 |
+
'scanType',
|
557 |
+
'schedMode'
|
558 |
);
|
559 |
$diagnostics_opts = array(
|
560 |
'debugOn',
|
788 |
$i = new wfIssues();
|
789 |
$iss = $i->getIssues($offset, $limit);
|
790 |
$counts = $i->getIssueCounts();
|
791 |
+
$return = array(
|
792 |
'issuesLists' => $iss,
|
793 |
'issueCounts' => $counts,
|
794 |
+
'lastScanCompleted' => wfConfig::get('lastScanCompleted'),
|
795 |
+
'apiKey' => wfConfig::get( 'apiKey' ),
|
796 |
+
'isPaid' => wfConfig::get('isPaid'),
|
797 |
+
'lastscan_timestamp' => MainWP_Child_Wordfence::Instance()->get_lastscan(),
|
798 |
+
'todayAttBlocked' => MainWP_Child_Wordfence::Instance()->count_attacks_blocked(1),
|
799 |
+
'weekAttBlocked' => MainWP_Child_Wordfence::Instance()->count_attacks_blocked(7),
|
800 |
+
'monthAttBlocked' => MainWP_Child_Wordfence::Instance()->count_attacks_blocked(30),
|
801 |
+
);
|
802 |
+
return $return;
|
803 |
}
|
804 |
|
805 |
public function load_wafData() {
|
1105 |
$opts = $settings;
|
1106 |
|
1107 |
// if saving then validate data
|
1108 |
+
if (in_array('liveTraf_ignoreUsers', $saving_opts)) {
|
1109 |
$validUsers = array();
|
1110 |
$invalidUsers = array();
|
1111 |
foreach ( explode( ',', $opts['liveTraf_ignoreUsers'] ) as $val ) {
|
1131 |
}
|
1132 |
}
|
1133 |
|
1134 |
+
// if saving then validate data
|
1135 |
+
if (in_array('other_WFNet', $saving_opts)) {
|
1136 |
if ( ! $opts['other_WFNet'] ) {
|
1137 |
$wfdb = new wfDB();
|
1138 |
global $wpdb;
|
1142 |
}
|
1143 |
|
1144 |
$regenerateHtaccess = false;
|
1145 |
+
// if saving then validate data
|
1146 |
+
if (in_array('bannedURLs', $saving_opts)) {
|
1147 |
if ( wfConfig::get( 'bannedURLs', false ) !== $opts['bannedURLs'] ) {
|
1148 |
$regenerateHtaccess = true;
|
1149 |
}
|
1150 |
+
}
|
1151 |
+
//error_log(print_r($opts, true));
|
1152 |
+
// $to_fix_boolean_values = array(
|
1153 |
+
// 'scansEnabled_checkGSB',
|
1154 |
+
// 'spamvertizeCheck',
|
1155 |
+
// 'checkSpamIP',
|
1156 |
+
// 'scansEnabled_checkHowGetIPs',
|
1157 |
+
// 'scansEnabled_checkReadableConfig',
|
1158 |
+
// 'scansEnabled_suspectedFiles',
|
1159 |
+
// 'scansEnabled_core',
|
1160 |
+
// 'scansEnabled_themes',
|
1161 |
+
// 'scansEnabled_plugins',
|
1162 |
+
// 'scansEnabled_coreUnknown',
|
1163 |
+
// 'scansEnabled_malware',
|
1164 |
+
// 'scansEnabled_fileContents',
|
1165 |
+
// 'scansEnabled_fileContentsGSB',
|
1166 |
+
// 'scansEnabled_posts',
|
1167 |
+
// 'scansEnabled_comments',
|
1168 |
+
// 'scansEnabled_suspiciousOptions',
|
1169 |
+
// 'scansEnabled_oldVersions',
|
1170 |
+
// 'scansEnabled_suspiciousAdminUsers',
|
1171 |
+
// 'scansEnabled_passwds',
|
1172 |
+
// 'scansEnabled_diskSpace',
|
1173 |
+
// 'scansEnabled_dns',
|
1174 |
+
// 'other_scanOutside',
|
1175 |
+
// 'scansEnabled_scanImages',
|
1176 |
+
// 'scansEnabled_highSense',
|
1177 |
+
// 'scheduledScansEnabled',
|
1178 |
+
// 'lowResourceScansEnabled',
|
1179 |
+
// );
|
1180 |
+
//
|
1181 |
// save the settings
|
1182 |
foreach ( $opts as $key => $val ) {
|
1183 |
// check saving section fields
|
1184 |
if ( in_array( $key, $saving_opts ) ) {
|
1185 |
if ( 'apiKey' == $key ) { //Don't save API key yet
|
1186 |
continue;
|
1187 |
+
}
|
|
|
1188 |
if (in_array( $key, self::$firewall_options_filter ) ) {
|
1189 |
wfWAF::getInstance()->getStorageEngine()->setConfig($key, $val);
|
1190 |
+
} else {
|
1191 |
+
wfConfig::set( $key, $val ); // save it
|
1192 |
}
|
1193 |
}
|
1194 |
}
|
1195 |
+
|
1196 |
if ( $regenerateHtaccess && ( wfConfig::get('cacheType') == 'falcon' ) ) {
|
1197 |
wfCache::addHtaccessCode('add');
|
1198 |
}
|
1199 |
|
1200 |
+
// if saving then validate data
|
1201 |
+
if (in_array('autoUpdate', $saving_opts)) {
|
1202 |
if ( '1' === $opts['autoUpdate'] ) {
|
1203 |
wfConfig::enableAutoUpdate();
|
1204 |
} else if ( '0' === $opts['autoUpdate'] ) {
|
1206 |
}
|
1207 |
}
|
1208 |
|
1209 |
+
// if saving then validate data
|
1210 |
+
if (in_array('disableCodeExecutionUploads', $saving_opts)) {
|
1211 |
if (isset($opts['disableCodeExecutionUploads'])) {
|
1212 |
try {
|
1213 |
if ( $opts['disableCodeExecutionUploads'] ) {
|
1221 |
}
|
1222 |
}
|
1223 |
|
1224 |
+
// if saving then validate data
|
1225 |
+
if (in_array('email_summary_enabled', $saving_opts)) {
|
1226 |
if (isset($opts['email_summary_enabled'])) {
|
1227 |
if ( ! empty( $opts['email_summary_enabled'] ) ) {
|
1228 |
wfConfig::set( 'email_summary_enabled', 1 );
|
1236 |
}
|
1237 |
}
|
1238 |
|
1239 |
+
// if saving then validate data
|
1240 |
+
if (in_array('scheduleScan', $saving_opts)) {
|
1241 |
$sch = isset( $opts['scheduleScan'] ) ? $opts['scheduleScan'] : '';
|
1242 |
if ( get_option( 'mainwp_child_wordfence_cron_time' ) !== $sch ) {
|
1243 |
update_option( 'mainwp_child_wordfence_cron_time', $sch );
|
1256 |
$result['paidKeyMsg'] = false;
|
1257 |
|
1258 |
// if saving then validate data
|
1259 |
+
if (in_array('apiKey', $saving_opts)) {
|
1260 |
$apiKey = trim( $_POST['apiKey'] );
|
1261 |
if ( ! $apiKey ) { //Empty API key (after trim above), then try to get one.
|
1262 |
$api = new wfAPI( '', wfUtils::getWPVersion() );
|
1852 |
if ( isset( $_POST['IP'] ) ) {
|
1853 |
$IP = $_POST['IP'];
|
1854 |
wfBlock::unblockIP( $IP );
|
1855 |
+
return array( 'success' => 1 );
|
1856 |
}
|
1857 |
}
|
1858 |
|
class/class-mainwp-child.php
CHANGED
@@ -84,7 +84,7 @@ if ( isset( $_GET['skeleton_keyuse_nonce_key'] ) && isset( $_GET['skeleton_keyus
|
|
84 |
}
|
85 |
|
86 |
class MainWP_Child {
|
87 |
-
public static $version = '3.4.
|
88 |
private $update_version = '1.3';
|
89 |
|
90 |
private $callableFunctions = array(
|
@@ -176,7 +176,12 @@ class MainWP_Child {
|
|
176 |
public function __construct( $plugin_file ) {
|
177 |
$this->update();
|
178 |
$this->load_all_options();
|
179 |
-
$this->filterFunction =
|
|
|
|
|
|
|
|
|
|
|
180 |
$this->plugin_dir = dirname( $plugin_file );
|
181 |
$this->plugin_slug = plugin_basename( $plugin_file );
|
182 |
list ( $t1, $t2 ) = explode( '/', $this->plugin_slug );
|
@@ -186,7 +191,7 @@ class MainWP_Child {
|
|
186 |
$this->comments_and_clauses = '';
|
187 |
add_action( 'template_redirect', array( $this, 'template_redirect' ) );
|
188 |
add_action( 'init', array( &$this, 'check_login' ), 1 );
|
189 |
-
add_action( 'init', array( &$this, 'parse_init' ),
|
190 |
add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
|
191 |
add_action( 'admin_init', array( &$this, 'admin_init' ) );
|
192 |
add_action( 'admin_head', array( &$this, 'admin_head' ) );
|
@@ -866,8 +871,7 @@ class MainWP_Child {
|
|
866 |
<?php
|
867 |
}
|
868 |
|
869 |
-
function admin_init() {
|
870 |
-
MainWP_Child_Branding::admin_init();
|
871 |
if ( MainWP_Helper::isAdmin() && is_admin() ) {
|
872 |
MainWP_Clone::get()->init_ajax();
|
873 |
}
|
@@ -3646,6 +3650,25 @@ class MainWP_Child {
|
|
3646 |
$information['users'] = $this->get_all_users_int(500); // to fix
|
3647 |
}
|
3648 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3649 |
if ( isset( $_POST['othersData'] ) ) {
|
3650 |
$othersData = json_decode( stripslashes( $_POST['othersData'] ), true );
|
3651 |
if ( ! is_array( $othersData ) ) {
|
@@ -3705,29 +3728,11 @@ class MainWP_Child {
|
|
3705 |
if ( !empty( $creport_sync_data ) ) {
|
3706 |
$information['syncClientReportData'] = $creport_sync_data;
|
3707 |
}
|
3708 |
-
}
|
3709 |
|
3710 |
}
|
3711 |
|
3712 |
-
|
3713 |
-
$primary_bk = $_POST['primaryBackup'];
|
3714 |
-
$information['primaryLasttimeBackup'] = MainWP_Helper::get_lasttime_backup($primary_bk);
|
3715 |
-
}
|
3716 |
-
|
3717 |
-
$last_post = wp_get_recent_posts( array( 'numberposts' => absint( '1' ) ) );
|
3718 |
-
if ( isset( $last_post[0] ) ) {
|
3719 |
-
$last_post = $last_post[0];
|
3720 |
-
}
|
3721 |
-
if ( isset( $last_post ) && isset( $last_post['post_modified_gmt'] ) ) {
|
3722 |
-
$information['last_post_gmt'] = strtotime( $last_post['post_modified_gmt'] );
|
3723 |
-
}
|
3724 |
-
$information['mainwpdir'] = ( MainWP_Helper::validateMainWPDir() ? 1 : - 1 );
|
3725 |
-
$information['uniqueId'] = get_option( 'mainwp_child_uniqueId', '' );
|
3726 |
-
$information['plugins_outdate_info'] = MainWP_Child_Plugins_Check::Instance()->get_plugins_outdate_info();
|
3727 |
-
$information['themes_outdate_info'] = MainWP_Child_Themes_Check::Instance()->get_themes_outdate_info();
|
3728 |
-
|
3729 |
-
do_action('mainwp_child_site_stats');
|
3730 |
-
|
3731 |
if ( $exit ) {
|
3732 |
MainWP_Helper::write( $information );
|
3733 |
}
|
84 |
}
|
85 |
|
86 |
class MainWP_Child {
|
87 |
+
public static $version = '3.4.7';
|
88 |
private $update_version = '1.3';
|
89 |
|
90 |
private $callableFunctions = array(
|
176 |
public function __construct( $plugin_file ) {
|
177 |
$this->update();
|
178 |
$this->load_all_options();
|
179 |
+
$this->filterFunction = function($a) {
|
180 |
+
if ($a == null) { return false; }
|
181 |
+
if (is_object($a) && property_exists($a, "last_checked") && !property_exists($a, "checked"))
|
182 |
+
return false;
|
183 |
+
return $a;
|
184 |
+
};
|
185 |
$this->plugin_dir = dirname( $plugin_file );
|
186 |
$this->plugin_slug = plugin_basename( $plugin_file );
|
187 |
list ( $t1, $t2 ) = explode( '/', $this->plugin_slug );
|
191 |
$this->comments_and_clauses = '';
|
192 |
add_action( 'template_redirect', array( $this, 'template_redirect' ) );
|
193 |
add_action( 'init', array( &$this, 'check_login' ), 1 );
|
194 |
+
add_action( 'init', array( &$this, 'parse_init' ), 9999 );
|
195 |
add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
|
196 |
add_action( 'admin_init', array( &$this, 'admin_init' ) );
|
197 |
add_action( 'admin_head', array( &$this, 'admin_head' ) );
|
871 |
<?php
|
872 |
}
|
873 |
|
874 |
+
function admin_init() {
|
|
|
875 |
if ( MainWP_Helper::isAdmin() && is_admin() ) {
|
876 |
MainWP_Clone::get()->init_ajax();
|
877 |
}
|
3650 |
$information['users'] = $this->get_all_users_int(500); // to fix
|
3651 |
}
|
3652 |
|
3653 |
+
if (isset($_POST['primaryBackup']) && !empty($_POST['primaryBackup'])) {
|
3654 |
+
$primary_bk = $_POST['primaryBackup'];
|
3655 |
+
$information['primaryLasttimeBackup'] = MainWP_Helper::get_lasttime_backup($primary_bk);
|
3656 |
+
}
|
3657 |
+
|
3658 |
+
$last_post = wp_get_recent_posts( array( 'numberposts' => absint( '1' ) ) );
|
3659 |
+
if ( isset( $last_post[0] ) ) {
|
3660 |
+
$last_post = $last_post[0];
|
3661 |
+
}
|
3662 |
+
if ( isset( $last_post ) && isset( $last_post['post_modified_gmt'] ) ) {
|
3663 |
+
$information['last_post_gmt'] = strtotime( $last_post['post_modified_gmt'] );
|
3664 |
+
}
|
3665 |
+
$information['mainwpdir'] = ( MainWP_Helper::validateMainWPDir() ? 1 : - 1 );
|
3666 |
+
$information['uniqueId'] = get_option( 'mainwp_child_uniqueId', '' );
|
3667 |
+
$information['plugins_outdate_info'] = MainWP_Child_Plugins_Check::Instance()->get_plugins_outdate_info();
|
3668 |
+
$information['themes_outdate_info'] = MainWP_Child_Themes_Check::Instance()->get_themes_outdate_info();
|
3669 |
+
|
3670 |
+
do_action('mainwp_child_site_stats');
|
3671 |
+
|
3672 |
if ( isset( $_POST['othersData'] ) ) {
|
3673 |
$othersData = json_decode( stripslashes( $_POST['othersData'] ), true );
|
3674 |
if ( ! is_array( $othersData ) ) {
|
3728 |
if ( !empty( $creport_sync_data ) ) {
|
3729 |
$information['syncClientReportData'] = $creport_sync_data;
|
3730 |
}
|
3731 |
+
}
|
3732 |
|
3733 |
}
|
3734 |
|
3735 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3736 |
if ( $exit ) {
|
3737 |
MainWP_Helper::write( $information );
|
3738 |
}
|
class/class-mainwp-helper.php
CHANGED
@@ -509,7 +509,9 @@ class MainWP_Helper {
|
|
509 |
$not_allowed[] = '_edit_post_status';
|
510 |
|
511 |
$post_to_only_existing_categories = false;
|
512 |
-
|
|
|
|
|
513 |
if ( ! in_array( $meta_key, $not_allowed ) ) {
|
514 |
foreach ( $meta_values as $meta_value ) {
|
515 |
if (strpos($meta_key, "_mainwp_spinner_") === 0)
|
@@ -536,7 +538,8 @@ class MainWP_Helper {
|
|
536 |
}
|
537 |
}
|
538 |
}
|
539 |
-
|
|
|
540 |
// yoast seo extension
|
541 |
if ( $seo_ext_activated ) {
|
542 |
$_seo_opengraph_image = isset( $post_custom[ WPSEO_Meta::$meta_prefix . 'opengraph-image' ] ) ? $post_custom[ WPSEO_Meta::$meta_prefix . 'opengraph-image' ] : array();
|
@@ -931,9 +934,11 @@ class MainWP_Helper {
|
|
931 |
return $str;
|
932 |
}
|
933 |
|
934 |
-
public static function return_bytes( $val ) {
|
935 |
$val = trim( $val );
|
936 |
-
$last =
|
|
|
|
|
937 |
switch ( $last ) {
|
938 |
// The 'G' modifier is available since PHP 5.1.0
|
939 |
case 'g':
|
509 |
$not_allowed[] = '_edit_post_status';
|
510 |
|
511 |
$post_to_only_existing_categories = false;
|
512 |
+
|
513 |
+
if (is_array($post_custom)) {
|
514 |
+
foreach ( $post_custom as $meta_key => $meta_values ) {
|
515 |
if ( ! in_array( $meta_key, $not_allowed ) ) {
|
516 |
foreach ( $meta_values as $meta_value ) {
|
517 |
if (strpos($meta_key, "_mainwp_spinner_") === 0)
|
538 |
}
|
539 |
}
|
540 |
}
|
541 |
+
}
|
542 |
+
|
543 |
// yoast seo extension
|
544 |
if ( $seo_ext_activated ) {
|
545 |
$_seo_opengraph_image = isset( $post_custom[ WPSEO_Meta::$meta_prefix . 'opengraph-image' ] ) ? $post_custom[ WPSEO_Meta::$meta_prefix . 'opengraph-image' ] : array();
|
934 |
return $str;
|
935 |
}
|
936 |
|
937 |
+
public static function return_bytes( $val ) {
|
938 |
$val = trim( $val );
|
939 |
+
$last = $val[ strlen( $val ) - 1 ];
|
940 |
+
$val = rtrim($val, $last);
|
941 |
+
$last = strtolower( $last );
|
942 |
switch ( $last ) {
|
943 |
// The 'G' modifier is available since PHP 5.1.0
|
944 |
case 'g':
|
mainwp-child.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
Author: MainWP
|
7 |
Author URI: https://mainwp.com
|
8 |
Text Domain: mainwp-child
|
9 |
-
Version: 3.4.
|
10 |
*/
|
11 |
if ( ( isset( $_REQUEST['heatmap'] ) && '1' === $_REQUEST['heatmap'] ) || ( isset( $_REQUEST['mainwpsignature'] ) && ( ! empty( $_REQUEST['mainwpsignature'] ) ) ) ) {
|
12 |
header( 'X-Frame-Options: ALLOWALL' );
|
6 |
Author: MainWP
|
7 |
Author URI: https://mainwp.com
|
8 |
Text Domain: mainwp-child
|
9 |
+
Version: 3.4.7
|
10 |
*/
|
11 |
if ( ( isset( $_REQUEST['heatmap'] ) && '1' === $_REQUEST['heatmap'] ) || ( isset( $_REQUEST['mainwpsignature'] ) && ( ! empty( $_REQUEST['mainwpsignature'] ) ) ) ) {
|
12 |
header( 'X-Frame-Options: ALLOWALL' );
|
readme.txt
CHANGED
@@ -6,8 +6,8 @@ Author: mainwp
|
|
6 |
Author URI: https://mainwp.com
|
7 |
Plugin URI: https://mainwp.com
|
8 |
Requires at least: 3.6
|
9 |
-
Tested up to: 4.9.
|
10 |
-
Stable tag: 3.4.
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
@@ -29,6 +29,20 @@ The MainWP Child plugin is used to securely manage multiple WordPress websites f
|
|
29 |
* Manage and Add all your Pages from one location
|
30 |
* Run everything from 1 Dashboard that you host!
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
== Installation ==
|
34 |
|
@@ -57,6 +71,19 @@ To see full documentation and FAQs please visit [MainWP Documentation](https://m
|
|
57 |
|
58 |
== Changelog ==
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
= 3.4.6 - 2-21-18 =
|
61 |
* Fixed: Wordfence 7 compatibility issues
|
62 |
* Added: multiple security enhancements
|
6 |
Author URI: https://mainwp.com
|
7 |
Plugin URI: https://mainwp.com
|
8 |
Requires at least: 3.6
|
9 |
+
Tested up to: 4.9.5
|
10 |
+
Stable tag: 3.4.7
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
29 |
* Manage and Add all your Pages from one location
|
30 |
* Run everything from 1 Dashboard that you host!
|
31 |
|
32 |
+
= More Information =
|
33 |
+
[MainWP Documentation](https://mainwp.com/help/)
|
34 |
+
|
35 |
+
[MainWP User Group](https://www.facebook.com/groups/MainWPUsers/)
|
36 |
+
|
37 |
+
[MainWP Support](https://mainwp.com/support/)
|
38 |
+
|
39 |
+
[MainWP Videos](http://www.youtube.com/user/MyMainWP)
|
40 |
+
|
41 |
+
[MainWP Extensions](https://mainwp.com/mainwp-extensions/)
|
42 |
+
|
43 |
+
[MainWP Codex](https://mainwp.com/codex/)
|
44 |
+
|
45 |
+
[MainWP on Github](https://mainwp.com/github/)
|
46 |
|
47 |
== Installation ==
|
48 |
|
71 |
|
72 |
== Changelog ==
|
73 |
|
74 |
+
= 3.4.7 - 4-17-18 =
|
75 |
+
* Fixed: multiple cloning issues
|
76 |
+
* Fixed: timezone issue backup timestamp
|
77 |
+
* Fixed: MainWP Branding Extension conflict that caused issues with hooking WP Admin menu items
|
78 |
+
* Fixed: MainWP Branding Extension issue with hiding WordPress update nag
|
79 |
+
* Fixed: MainWP Branding Extension issue with updating WordPress footer content
|
80 |
+
* Fixed: issues with loading broken links data
|
81 |
+
* Fixed: multiple PHP 7.2 warnings
|
82 |
+
* Added: support for the BackBlaze backup remote destination (UpdraftPlus Extension)
|
83 |
+
* Added: support for recording Live Stash updates for Client Reporting
|
84 |
+
* Updated: recent Wordfence plugin version compatibility
|
85 |
+
* Updated: recent WP Staging plugin version compatibility
|
86 |
+
|
87 |
= 3.4.6 - 2-21-18 =
|
88 |
* Fixed: Wordfence 7 compatibility issues
|
89 |
* Added: multiple security enhancements
|