PHP 8.0.30
Preview: Redirects.php Size: 1.04 KB
/home/certprox/template.certproxywizard.com/wp-content/plugins/hostinger/includes/Admin/Redirects.php

<?php

namespace Hostinger\Admin;

use Hostinger\Settings;

defined( 'ABSPATH' ) || exit;

class Redirects {
    private string $platform;
    public const PLATFORM_HPANEL = 'hpanel';

    public function __construct() {

        if ( ! Settings::get_setting( 'first_login_at' ) ) {
            Settings::update_setting( 'first_login_at', gmdate( 'Y-m-d H:i:s' ) );
        }
        /** PHPCS:disable WordPress.Security.NonceVerification.Recommended */
        if ( ! isset( $_GET['platform'] ) ) {
            return;
        }

        $this->platform = sanitize_text_field( $_GET['platform'] );
        $this->login_redirect();
        /** PHPCS:enable */
    }

    public function login_redirect(): void {
        if ( $this->platform === self::PLATFORM_HPANEL ) {
            add_action(
                'init',
                static function () {
                    $redirect_url = admin_url( 'admin.php?page=hostinger' );
                    wp_safe_redirect( $redirect_url );
                    exit;
                }
            );
        }
    }
}

Directory Contents

Dirs: 3 × Files: 6

Name Size Perms Modified Actions
Jobs DIR
- drwxr-xr-x 2026-06-14 00:11:49
Edit Download
Options DIR
- drwxr-xr-x 2026-06-14 00:11:50
Edit Download
Views DIR
- drwxr-xr-x 2026-06-14 00:11:49
Edit Download
12.32 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
1.35 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
1.40 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
1.50 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
1.63 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download
1.04 KB lrw-r--r-- 2026-06-10 16:30:25
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).