| @@ -11,22 +11,26 @@ | ||
| 11 | 11 | if ( ! Hostinger_Settings::get_setting( 'first_login_at' ) ) { |
| 12 | 12 | Hostinger_Settings::update_setting( 'first_login_at', gmdate( 'Y-m-d H:i:s' ) ); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - if ( isset( $_GET['platform'] ) ) { | |
| 16 | - $platform = sanitize_text_field( $_GET['platform'] ); | |
| 17 | - $this->platform = $platform; | |
| 18 | - $this->loginRedirect(); | |
| 15 | + if ( ! isset( $_GET['platform'] ) ) { | |
| 16 | + return; | |
| 19 | 17 | } |
| 18 | + | |
| 19 | + $this->platform = sanitize_text_field( $_GET['platform'] ); | |
| 20 | + $this->login_redirect(); | |
| 20 | 21 | } |
| 21 | 22 | |
| 22 | - private function loginRedirect(): void { | |
| 23 | + private function login_redirect(): void { | |
| 23 | 24 | if ( $this->platform === self::PLATFORM_HPANEL ) { |
| 24 | - add_action( 'init', static function () { | |
| 25 | - $redirect_url = admin_url( 'admin.php?page=hostinger' ); | |
| 26 | - wp_redirect( $redirect_url ); | |
| 27 | - exit; | |
| 28 | - } ); | |
| 25 | + add_action( | |
| 26 | + 'init', | |
| 27 | + static function () { | |
| 28 | + $redirect_url = admin_url( 'admin.php?page=hostinger' ); | |
| 29 | + wp_redirect( $redirect_url ); | |
| 30 | + exit; | |
| 31 | + } | |
| 32 | + ); | |
| 29 | 33 | } |
| 30 | 34 | } |
| 31 | 35 | } |
| 32 | 36 | |