diff --git a/class/class-mainwp-backup.php b/class/class-mainwp-backup.php index 6fe6f31..e46674d 100644 --- a/class/class-mainwp-backup.php +++ b/class/class-mainwp-backup.php @@ -91,7 +91,7 @@ class MainWP_Backup { $this->timeout = 20 * 60 * 60; $mem = '512M'; MainWP_Helper::set_limit( $this->timeout, $mem ); - + if ( null !== $this->archiver ) { $success = $this->archiver->create_full_backup( $filepath, $excludes, $addConfig, $includeCoreFiles, $excludezip, $excludenonwp, $append ); } elseif ( $this->check_zip_support() ) { @@ -113,7 +113,7 @@ class MainWP_Backup { $this->timeout = 20 * 60 * 60; $mem = '512M'; MainWP_Helper::set_limit( $this->timeout, $mem ); - + if ( ! is_array( $files ) ) { $files = array( $files ); } @@ -622,11 +622,11 @@ class MainWP_Backup { } public function create_backup_db( $filepath_prefix, $archiveExt = false, &$archiver = null ) { - + $timeout = 20 * 60 * 60; - $mem = '512M'; + $mem = '512M'; MainWP_Helper::set_limit( $timeout, $mem ); - + /** @var $wpdb wpdb */ global $wpdb; diff --git a/class/class-mainwp-child-callable.php b/class/class-mainwp-child-callable.php index cc4eb53..f77b571 100644 --- a/class/class-mainwp-child-callable.php +++ b/class/class-mainwp-child-callable.php @@ -99,15 +99,15 @@ class MainWP_Child_Callable { } public function init_call_functions( $auth = false ) { - $callable = false; + $callable = false; $callable_no_auth = false; - $call_func = false; + $call_func = false; // check to execute mainwp child's callable functions. - if ( isset( $_POST['function'] ) ) { - $call_func = $_POST['function']; - $callable = $this->is_callable_function( $call_func ); // check callable func. - $callable_no_auth = $this->is_callable_function_no_auth( $call_func ); // check callable no auth func. + if ( isset( $_POST['function'] ) ) { + $call_func = $_POST['function']; + $callable = $this->is_callable_function( $call_func ); // check callable func. + $callable_no_auth = $this->is_callable_function_no_auth( $call_func ); // check callable no auth func. } // Call the function required. @@ -580,9 +580,9 @@ class MainWP_Child_Callable { public function backup( $pWrite = true ) { - $timeout = 20 * 60 * 60; + $timeout = 20 * 60 * 60; MainWP_Helper::set_limit( $timeout ); - + MainWP_Helper::end_session(); // Cleanup pid files! diff --git a/class/class-mainwp-child-stats.php b/class/class-mainwp-child-stats.php index 816a43d..1f3a614 100644 --- a/class/class-mainwp-child-stats.php +++ b/class/class-mainwp-child-stats.php @@ -86,7 +86,7 @@ class MainWP_Child_Stats { include_once ABSPATH . '/wp-admin/includes/update.php'; $timeout = 3 * 60 * 60; - MainWP_Helper::set_limit( $timeout ); + MainWP_Helper::set_limit( $timeout ); // Check for new versions. $information['wp_updates'] = $this->stats_wp_update(); diff --git a/class/class-mainwp-child-wp-rocket.php b/class/class-mainwp-child-wp-rocket.php index 0f2c3ab..40bd715 100644 --- a/class/class-mainwp-child-wp-rocket.php +++ b/class/class-mainwp-child-wp-rocket.php @@ -158,7 +158,7 @@ class MainWP_Child_WP_Rocket { } } - + /** * Credit to the : wp-filters-extras */ diff --git a/class/class-mainwp-child.php b/class/class-mainwp-child.php index f14bf9e..8641036 100644 --- a/class/class-mainwp-child.php +++ b/class/class-mainwp-child.php @@ -36,12 +36,12 @@ class MainWP_Child { add_action( 'template_redirect', array( $this, 'template_redirect' ) ); add_action( 'init', array( &$this, 'check_login' ), 1 ); - add_action( 'init', array( &$this, 'parse_init' ), 9999 ); + add_action( 'init', array( &$this, 'parse_init' ), 9999 ); add_action( 'init', array( &$this, 'localization' ), 33 ); add_action( 'admin_init', array( &$this, 'admin_init' ) ); add_action( 'pre_current_active_plugins', array( MainWP_Child_Updates::get_instance(), 'detect_premium_themesplugins_updates' ) ); // to support detect premium plugins update. add_action( 'core_upgrade_preamble', array( MainWP_Child_Updates::get_instance(), 'detect_premium_themesplugins_updates' ) ); // to support detect premium themes. - + MainWP_Pages::get_instance()->init(); if ( is_admin() ) { @@ -57,7 +57,7 @@ class MainWP_Child { MainWP_Child_Plugins_Check::instance(); MainWP_Child_Themes_Check::instance(); MainWP_Utility::instance()->run_saved_snippets(); - + if ( ! get_option( 'mainwp_child_pubkey' ) ) { MainWP_Child_Branding::instance()->save_branding_options( 'branding_disconnected', 'yes' ); } @@ -348,14 +348,14 @@ class MainWP_Child { // auth here. $auth = MainWP_Connect::instance()->auth( isset( $_POST['mainwpsignature'] ) ? $_POST['mainwpsignature'] : '', isset( $_POST['function'] ) ? $_POST['function'] : '', isset( $_POST['nonce'] ) ? $_POST['nonce'] : '', isset( $_POST['nossl'] ) ? $_POST['nossl'] : 0 ); - + // parse auth, if it is not correct actions then exit with message or return. if ( ! MainWP_Connect::instance()->parse_init_auth( $auth ) ) { return; } - + $this->parse_init_extensions(); - + global $_wp_submenu_nopriv; if ( null === $_wp_submenu_nopriv ) { $_wp_submenu_nopriv = array(); // phpcs:ignore -- to fix warning. @@ -370,13 +370,13 @@ class MainWP_Child { public function check_login() { MainWP_Connect::instance()->check_login(); } - + public function admin_init() { if ( MainWP_Helper::is_admin() && is_admin() ) { MainWP_Clone::get()->init_ajax(); } } - + private function parse_init_extensions() { // Handle fatal errors for those init if needed. MainWP_Child_Branding::instance()->branding_init(); diff --git a/class/class-mainwp-connect.php b/class/class-mainwp-connect.php index 6c735da..f3f6f79 100644 --- a/class/class-mainwp-connect.php +++ b/class/class-mainwp-connect.php @@ -91,7 +91,7 @@ class MainWP_Connect { public function parse_init_auth( $auth = false ) { - + if ( ! $auth && isset( $_POST['mainwpsignature'] ) ) { // with 'mainwpsignature' then need to callable functions. MainWP_Helper::error( __( 'Authentication failed! Please deactivate & re-activate the MainWP Child plugin on this site and try again.', 'mainwp-child' ) ); } @@ -116,7 +116,7 @@ class MainWP_Connect { if ( $this->check_login_as( $_POST['alt_user'] ) ) { $auth_user = $_POST['alt_user']; // get alternative admin user. - $user = get_user_by( 'login', $auth_user ); + $user = get_user_by( 'login', $auth_user ); } } diff --git a/class/class-mainwp-helper.php b/class/class-mainwp-helper.php index f70e485..c76d6af 100644 --- a/class/class-mainwp-helper.php +++ b/class/class-mainwp-helper.php @@ -1014,8 +1014,8 @@ class MainWP_Helper { error_log( $msg ); // phpcs:ignore -- debug mode only. } } - - public static function set_limit( $timeout, $mem = false ){ + + public static function set_limit( $timeout, $mem = false ) { // phpcs:disable if ( ! empty( $mem ) ) { ini_set( 'memory_limit', $mem ); diff --git a/class/class-mainwp-pages.php b/class/class-mainwp-pages.php index 5f11750..4caa34f 100644 --- a/class/class-mainwp-pages.php +++ b/class/class-mainwp-pages.php @@ -3,14 +3,14 @@ namespace MainWP\Child; class MainWP_Pages { - + protected static $instance = null; - + public static $subPages; public static $subPagesLoaded = false; - + public static $brandingTitle = null; - + /** * Method get_class_name() * @@ -23,9 +23,8 @@ class MainWP_Pages { } public function __construct() { - } - + public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); @@ -33,15 +32,15 @@ class MainWP_Pages { return self::$instance; } - - public function init(){ - add_action( 'admin_menu', array( &$this, 'admin_menu' ) ); - add_action( 'admin_head', array( &$this, 'admin_head' ) ); + + public function init() { + add_action( 'admin_menu', array( &$this, 'admin_menu' ) ); + add_action( 'admin_head', array( &$this, 'admin_head' ) ); add_action( 'admin_notices', array( &$this, 'admin_notice' ) ); add_filter( 'plugin_row_meta', array( &$this, 'plugin_row_meta' ), 10, 2 ); } - - + + public function admin_notice() { // Admin Notice... if ( ! get_option( 'mainwp_child_pubkey' ) && MainWP_Helper::is_admin() && is_admin() ) { @@ -67,7 +66,7 @@ class MainWP_Pages { } MainWP_Child_Server_Information::show_warnings(); } - + public function admin_menu() { $branding_opts = MainWP_Child_Branding::instance()->get_branding_options(); $is_hide = isset( $branding_opts['hide'] ) ? $branding_opts['hide'] : ''; @@ -173,7 +172,7 @@ class MainWP_Pages { } } } - + public function plugin_row_meta( $plugin_meta, $plugin_file ) { global $mainWPChild; if ( $mainWPChild->plugin_slug !== $plugin_file ) { @@ -489,5 +488,5 @@ class MainWP_Pages {