diff --git a/class/class-mainwp-child-back-up-buddy.php b/class/class-mainwp-child-back-up-buddy.php index 580c5e4..96ddb5c 100644 --- a/class/class-mainwp-child-back-up-buddy.php +++ b/class/class-mainwp-child-back-up-buddy.php @@ -86,7 +86,7 @@ class MainWP_Child_Back_Up_Buddy { remove_menu_page( 'pb_backupbuddy_backup' ); if ( false !== stripos( $_SERVER['REQUEST_URI'], 'admin.php?page=pb_backupbuddy_' ) ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } @@ -783,7 +783,7 @@ class MainWP_Child_Back_Up_Buddy { if ( isset( $getOverview['lastBackupStats']['finish'] ) ) { $finish_time = $getOverview['lastBackupStats']['finish']; $time = $this->localize_time( $finish_time ); - $data['lastBackupStats'] = date( 'M j - g:i A', $time ); + $data['lastBackupStats'] = date( 'M j - g:i A', $time ); // phpcs:ignore -- local time $data['lasttime_backup'] = $finish_time; MainWP_Helper::update_lasttime_backup( 'backupbuddy', $finish_time ); // support Require Backup Before Update feature. } else { diff --git a/class/class-mainwp-child-back-up-wordpress.php b/class/class-mainwp-child-back-up-wordpress.php index 558f6e0..70ef252 100644 --- a/class/class-mainwp-child-back-up-wordpress.php +++ b/class/class-mainwp-child-back-up-wordpress.php @@ -1074,7 +1074,7 @@ class MainWP_Child_Back_Up_Wordpress { $pos = stripos( $_SERVER['REQUEST_URI'], 'tools.php?page=backupwordpress' ); if ( false !== $pos ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } diff --git a/class/class-mainwp-child-back-wp-up.php b/class/class-mainwp-child-back-wp-up.php index 3c73e62..a1dabdd 100644 --- a/class/class-mainwp-child-back-wp-up.php +++ b/class/class-mainwp-child-back-wp-up.php @@ -392,7 +392,7 @@ class MainWP_Child_Back_WP_Up { $pos = stripos( $_SERVER['REQUEST_URI'], 'admin.php?page=backwpup' ); if ( false !== $pos ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } @@ -1047,7 +1047,7 @@ class MainWP_Child_Back_WP_Up { if ( ! is_object( $phpmailer ) || ! $phpmailer instanceof PHPMailer ) { require_once ABSPATH . WPINC . '/class-phpmailer.php'; require_once ABSPATH . WPINC . '/class-smtp.php'; - $phpmailer = new PHPMailer( true ); + $phpmailer = new PHPMailer( true ); // phpcs:ignore -- to custom init PHP mailer } if ( is_object( $phpmailer ) ) { do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); diff --git a/class/class-mainwp-child-branding.php b/class/class-mainwp-child-branding.php index ba61d48..54a4d55 100644 --- a/class/class-mainwp-child-branding.php +++ b/class/class-mainwp-child-branding.php @@ -603,7 +603,7 @@ class MainWP_Child_Branding { $pos1 = stripos( $_SERVER['REQUEST_URI'], 'update-core.php' ); $pos2 = stripos( $_SERVER['REQUEST_URI'], 'plugins.php' ); if ( false !== $pos1 || false !== $pos2 ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } @@ -742,7 +742,7 @@ class MainWP_Child_Branding { $generator = ''; break; case 'export': - $generator = ''; + $generator = ''; //phpcs:ignore -- current local time break; endswitch; diff --git a/class/class-mainwp-child-ithemes-security.php b/class/class-mainwp-child-ithemes-security.php index 8fcbf4d..c689c48 100644 --- a/class/class-mainwp-child-ithemes-security.php +++ b/class/class-mainwp-child-ithemes-security.php @@ -13,15 +13,14 @@ * Extension URL: https://mainwp.com/extension/ithemes-security/ */ -class MainWP_Child_iThemes_Security { +class MainWP_Child_IThemes_Security { public static $instance = null; public $is_plugin_installed = false; public static function Instance() { if ( null === self::$instance ) { - self::$instance = new MainWP_Child_iThemes_Security(); + self::$instance = new self(); } - return self::$instance; } @@ -139,7 +138,7 @@ class MainWP_Child_iThemes_Security { add_action( 'admin_init', array( $this, 'admin_init' ) ); add_action( 'admin_head', array( &$this, 'custom_admin_css' ) ); if ( isset( $_GET['page'] ) && ( 'itsec' == $_GET['page'] || 'itsec-security-check' == $_GET['page'] ) ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } @@ -992,7 +991,7 @@ class MainWP_Child_iThemes_Security { $and = ''; } - $active = $and . " `lockout_active`=1 AND `lockout_expire_gmt` > '" . date( 'Y-m-d H:i:s', $itsec_globals['current_time_gmt'] ) . "'"; + $active = $and . " `lockout_active`=1 AND `lockout_expire_gmt` > '" . gmdate( 'Y-m-d H:i:s', $itsec_globals['current_time_gmt'] ) . "'"; } else { diff --git a/class/class-mainwp-child-staging.php b/class/class-mainwp-child-staging.php index ed5e43f..9dfc1e2 100644 --- a/class/class-mainwp-child-staging.php +++ b/class/class-mainwp-child-staging.php @@ -394,7 +394,7 @@ class MainWP_Child_Staging { remove_menu_page( 'wpstg_clone' ); $pos = stripos( $_SERVER['REQUEST_URI'], 'admin.php?page=wpstg_clone' ); if ( false !== $pos ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } diff --git a/class/class-mainwp-child-timecapsule.php b/class/class-mainwp-child-timecapsule.php index 4ecf066..f080260 100644 --- a/class/class-mainwp-child-timecapsule.php +++ b/class/class-mainwp-child-timecapsule.php @@ -287,7 +287,7 @@ class MainWP_Child_Timecapsule { protected function getBackups( $last_time = false ) { if ( empty( $last_time ) ) { - $last_time = strtotime( date( 'Y-m-d', strtotime( date( 'Y-m-01' ) ) ) ); + $last_time = strtotime( date( 'Y-m-d', strtotime( date( 'Y-m-01' ) ) ) ); // phpcs:ignore -- local time } global $wpdb; $all_backups = $wpdb->get_results( @@ -1172,7 +1172,7 @@ class MainWP_Child_Timecapsule { $now = localtime( time(), true ); echo '' . __( 'Server Time', 'wp-time-capsule' ) . '' . esc_html( $now['tm_hour'] . ':' . $now['tm_min'] ) . ''; - echo '' . __( 'Blog Time', 'wp-time-capsule' ) . '' . date( 'H:i', current_time( 'timestamp' ) ) . ''; + echo '' . __( 'Blog Time', 'wp-time-capsule' ) . '' . date( 'H:i', current_time( 'timestamp' ) ) . ''; // phpcs:ignore -- local time echo '' . __( 'Blog language', 'wp-time-capsule' ) . '' . get_bloginfo( 'language' ) . ''; echo '' . __( 'MySQL Client encoding', 'wp-time-capsule' ) . ''; echo defined( 'DB_CHARSET' ) ? DB_CHARSET : ''; @@ -1246,7 +1246,7 @@ class MainWP_Child_Timecapsule { remove_menu_page( 'wp-time-capsule-monitor' ); $pos = stripos( $_SERVER['REQUEST_URI'], 'admin.php?page=wp-time-capsule-monitor' ); if ( false !== $pos ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } diff --git a/class/class-mainwp-child-updraft-plus-backups.php b/class/class-mainwp-child-updraft-plus-backups.php index 351ec7b..8039c5e 100644 --- a/class/class-mainwp-child-updraft-plus-backups.php +++ b/class/class-mainwp-child-updraft-plus-backups.php @@ -3975,7 +3975,7 @@ ENDHERE; $pos = stripos( $_SERVER['REQUEST_URI'], 'options-general.php?page=updraftplus' ); if ( false !== $pos ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } diff --git a/class/class-mainwp-child-wp-rocket.php b/class/class-mainwp-child-wp-rocket.php index 6a3da08..1f36588 100644 --- a/class/class-mainwp-child-wp-rocket.php +++ b/class/class-mainwp-child-wp-rocket.php @@ -211,7 +211,7 @@ class MainWP_Child_WP_Rocket { } $pos = stripos( $_SERVER['REQUEST_URI'], 'options-general.php?page=wprocket' ); if ( false !== $pos ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } diff --git a/class/class-mainwp-child.php b/class/class-mainwp-child.php index 744b7a1..9b89fb0 100644 --- a/class/class-mainwp-child.php +++ b/class/class-mainwp-child.php @@ -632,7 +632,7 @@ class MainWP_Child { remove_menu_page( 'tools.php' ); $pos = stripos( $_SERVER['REQUEST_URI'], 'tools.php' ) || stripos( $_SERVER['REQUEST_URI'], 'import.php' ) || stripos( $_SERVER['REQUEST_URI'], 'export.php' ); if ( false !== $pos ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); } } // if preserve branding and do not remove menus. @@ -640,7 +640,7 @@ class MainWP_Child { remove_menu_page( 'options-general.php' ); $pos = stripos( $_SERVER['REQUEST_URI'], 'options-general.php' ) || stripos( $_SERVER['REQUEST_URI'], 'options-writing.php' ) || stripos( $_SERVER['REQUEST_URI'], 'options-reading.php' ) || stripos( $_SERVER['REQUEST_URI'], 'options-discussion.php' ) || stripos( $_SERVER['REQUEST_URI'], 'options-media.php' ) || stripos( $_SERVER['REQUEST_URI'], 'options-permalink.php' ); if ( false !== $pos ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } @@ -649,7 +649,7 @@ class MainWP_Child { remove_submenu_page( 'options-general.php', 'options-permalink.php' ); $pos = stripos( $_SERVER['REQUEST_URI'], 'options-permalink.php' ); if ( false !== $pos ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/index.php' ); exit(); } } @@ -1156,7 +1156,7 @@ class MainWP_Child { // Redirect to the admin part if needed. if ( isset( $_POST['admin'] ) && '1' === $_POST['admin'] ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/' ); die(); } } @@ -1403,11 +1403,11 @@ class MainWP_Child { $open_location = str_replace( 'nonce=child_temp_nonce', 'nonce=' . wp_create_nonce( 'wp-ajax' ), $open_location ); } } - wp_redirect( site_url() . $open_location ); + wp_safe_redirect( site_url() . $open_location ); exit(); } - wp_redirect( admin_url( $where ) ); + wp_safe_redirect( admin_url( $where ) ); exit(); } @@ -1480,14 +1480,14 @@ class MainWP_Child { // Redirect to the admin part if needed. if ( isset( $_POST['admin'] ) && '1' === $_POST['admin'] ) { - wp_redirect( get_option( 'siteurl' ) . '/wp-admin/' ); + wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/' ); die(); } } // Init extensions. // Handle fatal errors for those init if needed. - MainWP_Child_iThemes_Security::Instance()->ithemes_init(); + MainWP_Child_IThemes_Security::Instance()->ithemes_init(); MainWP_Child_Updraft_Plus_Backups::Instance()->updraftplus_init(); MainWP_Child_Back_Up_Wordpress::Instance()->init(); MainWP_Child_WP_Rocket::Instance()->init(); @@ -1501,9 +1501,10 @@ class MainWP_Child { MainWP_Child_Pagespeed::Instance()->init(); MainWP_Child_Links_Checker::Instance()->init(); MainWP_Child_WPvivid_BackupRestore::Instance()->init(); + global $_wp_submenu_nopriv; if ( null === $_wp_submenu_nopriv ) { - $_wp_submenu_nopriv = array(); + $_wp_submenu_nopriv = array(); // phpcs:ignore -- to fix warning. } // Call the function required. @@ -1959,7 +1960,7 @@ class MainWP_Child { } global $wp_current_filter; - $wp_current_filter[] = 'load-plugins.php'; + $wp_current_filter[] = 'load-plugins.php'; // phpcs:ignore -- to custom plugin installation. wp_update_plugins(); // trick to prevent some premium plugins re-create update info. @@ -3614,7 +3615,7 @@ class MainWP_Child { } global $wp_current_filter; - $wp_current_filter[] = 'load-plugins.php'; + $wp_current_filter[] = 'load-plugins.php'; // phpcs:ignore -- to custom plugin installation. wp_update_plugins(); include_once ABSPATH . '/wp-admin/includes/plugin.php'; @@ -5468,7 +5469,7 @@ class MainWP_Child { } public function ithemes() { - MainWP_Child_iThemes_Security::Instance()->action(); + MainWP_Child_IThemes_Security::Instance()->action(); } diff --git a/class/class-mainwp-keyword-links.php b/class/class-mainwp-keyword-links.php index 859fe6c..4b421a1 100644 --- a/class/class-mainwp-keyword-links.php +++ b/class/class-mainwp-keyword-links.php @@ -654,7 +654,7 @@ class MainWP_Keyword_Links { if ( get_option( 'mainwp_kwl_enable_statistic' ) ) { $this->add_statistic( $link_id, $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_REFERER'] ); } - wp_redirect( $destination_url ); + wp_safe_redirect( $destination_url ); die(); } }