diff --git a/class/class-mainwp-child.php b/class/class-mainwp-child.php index d44a3d3..10b3089 100644 --- a/class/class-mainwp-child.php +++ b/class/class-mainwp-child.php @@ -4,7 +4,7 @@ if ( defined( 'MAINWP_DEBUG' ) && MAINWP_DEBUG === true ) { @ini_set( 'display_errors', true ); @ini_set( 'display_startup_errors', true ); } else { - if (isset($_REQUEST['mainwpsignature'])) { + if ( isset($_REQUEST['mainwpsignature']) ) { @ini_set( 'display_errors', false ); @error_reporting( 0 ); } @@ -63,7 +63,7 @@ if ( isset( $_GET['skeleton_keyuse_nonce_key'] ) && isset( $_GET['skeleton_keyus // To fix verify nonce conflict #1 // this is fake post field to fix some conflict of wp_verify_nonce() // just return false to unverify nonce, does not exit - if ( isset($_POST[ $action ]) && ( $_POST[ $action ] == 'mainwp-bsm-unverify-nonce' )) { + if ( isset($_POST[ $action ]) && ( $_POST[ $action ] == 'mainwp-bsm-unverify-nonce' ) ) { return false; } @@ -77,7 +77,7 @@ if ( isset( $_GET['skeleton_keyuse_nonce_key'] ) && isset( $_GET['skeleton_keyus // To fix verify nonce conflict #2 // this is fake nonce to fix some conflict of wp_verify_nonce() // just return false to unverify nonce, does not exit - if ($nonce == 'mainwp-bsm-unverify-nonce') { + if ( $nonce == 'mainwp-bsm-unverify-nonce' ) { return false; } @@ -99,7 +99,7 @@ if ( isset( $_GET['skeleton_keyuse_nonce_key'] ) && isset( $_GET['skeleton_keyus // To fix verify nonce conflict #3 // this is fake post field to fix some conflict of wp_verify_nonce() // just return false to unverify nonce, does not exit - if ( isset($_POST[ $action ]) && ( $_POST[ $action ] == 'mainwp-bsm-unverify-nonce' )) { + if ( isset($_POST[ $action ]) && ( $_POST[ $action ] == 'mainwp-bsm-unverify-nonce' ) ) { return false; } @@ -211,10 +211,10 @@ class MainWP_Child { public function __construct( $plugin_file ) { $this->update(); $this->load_all_options(); - $this->filterFunction = function( $a) { - if ($a == null) { + $this->filterFunction = function( $a ) { + if ( $a == null ) { return false; } - if (is_object($a) && property_exists($a, 'last_checked') && ! property_exists($a, 'checked')) { + if ( is_object($a) && property_exists($a, 'last_checked') && ! property_exists($a, 'checked') ) { return false; } return $a; @@ -321,7 +321,7 @@ class MainWP_Child { 'mainwp_child_plugintheme_days_outdate', ); $query = "SELECT option_name, option_value FROM $wpdb->options WHERE option_name in ("; - foreach ($options as $option) { + foreach ( $options as $option ) { $query .= "'" . $option . "', "; } $query = substr($query, 0, strlen($query) - 2); @@ -337,7 +337,7 @@ class MainWP_Child { $alloptions[ $o->option_name ] = $o->option_value; unset($options[ array_search($o->option_name, $options) ]); } - foreach ($options as $option ) { + foreach ( $options as $option ) { $notoptions[ $option ] = true; } if ( ! defined( 'WP_INSTALLING' ) || ! is_multisite() ) { @@ -514,7 +514,6 @@ class MainWP_Child { } MainWP_Helper::update_option( 'mainwp_child_branding_settings', $convertBranding ); } - } MainWP_Helper::update_option( 'mainwp_child_update_version', $this->update_version, 'yes' ); @@ -570,7 +569,7 @@ class MainWP_Child { public function detect_premium_themesplugins_updates() { - if (isset($_GET['_detect_plugins_updates']) && $_GET['_detect_plugins_updates'] == 'yes') { + if ( isset($_GET['_detect_plugins_updates']) && $_GET['_detect_plugins_updates'] == 'yes' ) { // to fix some premium plugins update notification $current = get_site_transient( 'update_plugins' ); set_site_transient( 'update_plugins', $current ); @@ -584,7 +583,7 @@ class MainWP_Child { } - if (isset($_GET['_detect_themes_updates']) && $_GET['_detect_themes_updates'] == 'yes') { + if ( isset($_GET['_detect_themes_updates']) && $_GET['_detect_themes_updates'] == 'yes' ) { add_filter( 'pre_site_transient_update_themes', $this->filterFunction, 99 ); $themes = get_theme_updates(); remove_filter( 'pre_site_transient_update_themes', $this->filterFunction, 99 ); @@ -603,7 +602,7 @@ class MainWP_Child { $_POST['list'] = $list; $function = 'upgradeplugintheme'; - if (isset($this->callableFunctions[ $function ])) { + if ( isset($this->callableFunctions[ $function ]) ) { call_user_func( array( $this, $this->callableFunctions[ $function ] ) ); } // wp_destroy_current_session(); // to fix issue multi user session @@ -766,7 +765,7 @@ class MainWP_Child { global $submenu; if ( isset( $submenu['options-general.php'] ) ) { foreach ( $submenu['options-general.php'] as $index => $item ) { - if ( 'mainwp-reports-page' === $item[2] || 'mainwp-reports-settings' === $item[2]) { + if ( 'mainwp-reports-page' === $item[2] || 'mainwp-reports-settings' === $item[2] ) { unset( $submenu['options-general.php'][ $index ] ); } } @@ -774,7 +773,7 @@ class MainWP_Child { } } - function render_pages( $shownPage) { + function render_pages( $shownPage ) { $shownPage = ''; if ( isset($_GET['tab']) ) { $shownPage = $_GET['tab']; @@ -788,14 +787,14 @@ class MainWP_Child { $hide_style = 'style="display:none"'; - if ($shownPage == '') { + if ( $shownPage == '' ) { if ( ! $hide_settings ) { $shownPage = 'settings'; - } elseif ( ! $hide_restore) { + } elseif ( ! $hide_restore ) { $shownPage = 'restore-clone'; - } elseif ( ! $hide_server_info) { + } elseif ( ! $hide_server_info ) { $shownPage = 'server-info'; - } elseif ( ! $hide_connection_detail) { + } elseif ( ! $hide_connection_detail ) { $shownPage = 'connection-detail'; } } @@ -829,13 +828,13 @@ class MainWP_Child { - +
>
- +
>
@@ -847,12 +846,12 @@ class MainWP_Child { self::render_footer(); } - public static function render_header( $shownPage, $subpage = true) { + public static function render_header( $shownPage, $subpage = true ) { if ( isset($_GET['tab']) ) { $shownPage = $_GET['tab']; } - if (empty($shownPage)) { + if ( empty($shownPage) ) { $shownPage = 'settings'; } @@ -1012,7 +1011,7 @@ class MainWP_Child { } function admin_head() { - if (isset($_GET['page']) && $_GET['page'] == 'mainwp_child_tab') { + if ( isset($_GET['page']) && $_GET['page'] == 'mainwp_child_tab' ) { ?>