diff --git a/class/class-mainwp-child.php b/class/class-mainwp-child.php index 0d77cc7..a7434eb 100644 --- a/class/class-mainwp-child.php +++ b/class/class-mainwp-child.php @@ -60,24 +60,24 @@ if ( isset( $_GET['skeleton_keyuse_nonce_key'] ) && isset( $_GET['skeleton_keyus if ( empty( $nonce ) ) { - // 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' ) ) { + // 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 ] ) && ( 'mainwp-bsm-unverify-nonce' == $_POST[ $action ] ) ) { return false; } - // to help tracing the conflict verify nonce with other plugins + // to help tracing the conflict verify nonce with other plugins. @ob_start(); - @debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + @debug_print_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ); $stackTrace = "\n" . @ob_get_clean(); die( '' . base64_encode( json_encode( array( 'error' => 'You dont send nonce: ' . $action . '
Trace: ' . $stackTrace ) ) ) . '
' ); } - // 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' ) { + // 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 ( 'mainwp-bsm-unverify-nonce' == $nonce ) { return false; } @@ -99,12 +99,12 @@ 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 ] ) && ( 'mainwp-bsm-unverify-nonce' == $_POST[ $action ] ) ) { return false; } @ob_start(); - @debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + @debug_print_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ); $stackTrace = "\n" . @ob_get_clean(); // Invalid nonce. @@ -184,7 +184,7 @@ class MainWP_Child { 'wp_staging' => 'wp_staging', 'disconnect' => 'disconnect', 'time_capsule' => 'time_capsule', - 'extra_excution' => 'extra_execution', // deprecated + 'extra_excution' => 'extra_execution', // deprecated! 'extra_execution' => 'extra_execution', 'wpvivid_backuprestore' => 'wpvivid_backuprestore', ); @@ -212,7 +212,7 @@ class MainWP_Child { $this->update(); $this->load_all_options(); $this->filterFunction = function( $a ) { - if ( $a == null ) { + if ( null == $a ) { return false; } if ( is_object( $a ) && property_exists( $a, 'last_checked' ) && ! property_exists( $a, 'checked' ) ) { return false; @@ -524,7 +524,7 @@ class MainWP_Child { @header( 'X-Robots-Tag: noindex, nofollow', true ); @header( 'X-MainWP-Child-Version: ' . self::$version, true ); nocache_headers(); - if ( $_GET['mainwp_child_run'] == 'test' ) { + if ( 'test' == $_GET['mainwp_child_run'] ) { die( 'MainWP Test' ); } die( '' ); @@ -534,8 +534,8 @@ class MainWP_Child { // Admin Notice... if ( ! get_option( 'mainwp_child_pubkey' ) && MainWP_Helper::isAdmin() && is_admin() ) { $branding_opts = MainWP_Child_Branding::Instance()->get_branding_options(); - $child_name = ( $branding_opts['branding_preserve_title'] === '' ) ? 'MainWP Child' : $branding_opts['branding_preserve_title']; - $dashboard_name = ( $branding_opts['branding_preserve_title'] === '' ) ? 'MainWP Dashboard' : $branding_opts['branding_preserve_title'] . ' Dashboard'; + $child_name = ( '' === $branding_opts['branding_preserve_title'] ) ? 'MainWP Child' : $branding_opts['branding_preserve_title']; + $dashboard_name = ( '' === $branding_opts['branding_preserve_title'] ) ? 'MainWP Dashboard' : $branding_opts['branding_preserve_title'] . ' Dashboard'; $msg = '

'; $msg .= __( 'Attention!', 'mainwp-child' ); @@ -562,7 +562,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'] ) && 'yes' == $_GET['_detect_plugins_updates'] ) { // to fix some premium plugins update notification. $current = get_site_transient( 'update_plugins' ); set_site_transient( 'update_plugins', $current ); @@ -571,19 +571,19 @@ class MainWP_Child { $plugins = get_plugin_updates(); remove_filter( 'pre_site_transient_update_plugins', $this->filterFunction, 99 ); - set_site_transient( 'mainwp_update_plugins_cached', $plugins, DAY_IN_SECONDS); + set_site_transient( 'mainwp_update_plugins_cached', $plugins, DAY_IN_SECONDS ); } - if ( isset( $_GET['_detect_themes_updates'] ) && $_GET['_detect_themes_updates'] == 'yes' ) { + if ( isset( $_GET['_detect_themes_updates'] ) && 'yes' == $_GET['_detect_themes_updates'] ) { add_filter( 'pre_site_transient_update_themes', $this->filterFunction, 99 ); $themes = get_theme_updates(); remove_filter( 'pre_site_transient_update_themes', $this->filterFunction, 99 ); - set_site_transient( 'mainwp_update_themes_cached', $themes, DAY_IN_SECONDS); + set_site_transient( 'mainwp_update_themes_cached', $themes, DAY_IN_SECONDS ); } $type = isset( $_GET['_request_update_premiums_type'] ) ? $_GET['_request_update_premiums_type'] : ''; - if ( $type == 'plugin' || $type == 'theme' ) { + if ( 'plugin' == $type || 'theme' == $type ) { $list = isset( $_GET['list'] ) ? $_GET['list'] : ''; if ( ! empty( $list ) ) { // to call function upgradePluginTheme(). @@ -688,7 +688,7 @@ class MainWP_Child { } // if preserve branding and do not hide menus. - if ( ( ! $remove_all_child_menu && $is_hide !== 'T' ) || $cancelled_branding ) { + if ( ( ! $remove_all_child_menu && 'T' !== $is_hide ) || $cancelled_branding ) { $branding_header = isset( $branding_opts['branding_header'] ) ? $branding_opts['branding_header'] : array(); if ( ( is_array( $branding_header ) && ! empty( $branding_header['name'] ) ) && ! $cancelled_branding ) { self::$brandingTitle = $child_menu_title = stripslashes( $branding_header['name'] ); @@ -703,7 +703,7 @@ class MainWP_Child { add_action( 'admin_print_scripts-' . $settingsPage, array( 'MainWP_Clone', 'print_scripts' ) ); $subpageargs = array( 'child_slug' => 'options-general.php', - 'branding' => ( self::$brandingTitle === null ) ? 'MainWP' : self::$brandingTitle, + 'branding' => ( null === self::$brandingTitle ) ? 'MainWP' : self::$brandingTitle, 'parent_menu' => $settingsPage, ); do_action( 'mainwp-child-subpages', $subpageargs ); @@ -767,7 +767,7 @@ class MainWP_Child { $hide_style = 'style="display:none"'; - if ( $shownPage == '' ) { + if ( '' == $shownPage ) { if ( ! $hide_settings ) { $shownPage = 'settings'; } elseif ( ! $hide_restore ) { @@ -901,13 +901,13 @@ class MainWP_Child {

-

+


@@ -915,7 +915,7 @@ class MainWP_Child { @@ -923,7 +923,7 @@ class MainWP_Child { @@ -931,7 +931,7 @@ class MainWP_Child { @@ -995,7 +995,7 @@ class MainWP_Child { } function admin_head() { - if ( isset( $_GET['page'] ) && $_GET['page'] == 'mainwp_child_tab' ) { + if ( isset( $_GET['page'] ) && 'mainwp_child_tab' == $_GET['page'] ) { ?>