Weak hands cannot be planted, meager skills have no foundation. Shallow wisdom is futile, how can one hope for a good name?扰扰从役倦，屑屑身事微。少壮轻年月，迟暮惜光辉。
<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php

namespace Hostinger\Admin;

use Hostinger\Mcp\EventHandlerFactory;
use Hostinger\WpHelper\Requests\Client;
use Hostinger\WpHelper\Utils;
use WP_Error;

defined( 'ABSPATH' ) || exit;

class Proxy {

    public const HOSTINGER_FREE_SUBDOMAIN_URL     = 'hostingersite.com';
    public const HOSTINGER_DEV_FREE_SUBDOMAIN_URL = 'hostingersite.dev';


    private Client $client;
    private Utils $utils;
    private string $rest_base;

    public function __construct( Client $client, Utils $utils ) {
        $this->client    = $client;
        $this->utils     = $utils;
        $this->rest_base = '/api/v1/events/trigger';
    }

    public function trigger_event( string $event, array $params = array() ): array|WP_Error {
        if ( $this->is_free_subdomain() || ! $_SERVER['H_PLATFORM'] ) {
            return new WP_Error( 'domain-not_allowed', 'This domain is not eligible for triggering Hostinger events' );
        }

        $args = array(
            'domain' => $this->remove_www( $this->utils->getHostInfo() ),
            'event'  => array(
                '