| Server IP : 93.127.179.54 / Your IP :
216.73.216.151 [
Web Server : LiteSpeed System : Linux nl-srv-web1124.main-hosting.eu 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64 User : u964240598 ( 964240598) PHP Version : 8.4.19 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u964240598/public_html/jobs/wp-content/plugins/hostinger/includes/Mcp/ |
Upload File : |
<?php
namespace Hostinger\Mcp;
use Hostinger\Admin\Proxy;
use Hostinger\Mcp\Handlers\WebsiteMcpOptInToggled;
use Hostinger\Mcp\Handlers\WebsitePageUpdated;
use Hostinger\Mcp\Handlers\WebsiteUpdated;
defined( 'ABSPATH' ) || exit;
class EventHandlerFactory {
public const MCP_EVENT_UPDATED = 'wordpress.website.updated';
public const MCP_EVENT_PAGE_UPDATED = 'wordpress.website.page_updated';
public const MCP_EVENT_OPTIN_TOGGLED = 'wordpress.website.mcp.opt_in_toggled';
private array $handlers;
private Proxy $proxy;
public function __construct( Proxy $proxy ) {
$this->proxy = $proxy;
$this->handlers = array(
self::MCP_EVENT_UPDATED => WebsiteUpdated::class,
self::MCP_EVENT_PAGE_UPDATED => WebsitePageUpdated::class,
self::MCP_EVENT_OPTIN_TOGGLED => WebsiteMcpOptInToggled::class,
);
}
public function get_handler( string $event ) {
$handler = $this->handlers[ $event ] ?? false;
if ( ! $handler ) {
throw new \WP_Exception( 'Invalid event' );
}
return new $handler( $this->proxy );
}
}
Anon7 - 2022
AnonSec Team
