$plugin = <<403WebShell
403Webshell
Server IP : 193.224.177.188  /  Your IP : 216.73.216.209
Web Server : Apache
System : Linux cpanel.krtk.mta.hu 3.10.0-962.3.2.lve1.5.89.el7.x86_64 #1 SMP Thu Jul 9 15:55:31 UTC 2026 x86_64
User : krtkhu ( 1061)
PHP Version : 8.4.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home2/krtkhu/public_html/wp-content/plugins/hellopack-client/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home2/krtkhu/public_html/wp-content/plugins/hellopack-client/includes//Plugin.php
<?php
/**
 * Main plugin orchestrator.
 *
 * @package HelloPack\Client
 */

declare( strict_types=1 );

namespace HelloPack\Client;

use HelloPack\Client\Api\Client;
use HelloPack\Client\Api\Endpoints;
use HelloPack\Client\Update\CacheInvalidator;
use HelloPack\Client\Update\Installer;
use HelloPack\Client\Update\Manager as UpdateManager;
use HelloPack\Client\Update\SlugResolver;
use HelloPack\Client\Module\Loader as ModuleLoader;
use HelloPack\Client\Module\EarlyLoader;
use HelloPack\Client\Admin\DomainMismatchNotice;
use HelloPack\Client\Admin\SettingsPage;
use HelloPack\Client\Admin\Rest\RestRouter;
use HelloPack\Client\Update\AutoUpdates;
use HelloPack\Client\Update\SelfUpdater;
use HelloPack\Client\Cron\AuthCheck;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Singleton plugin class.
 */
final class Plugin {

	/**
	 * Single instance.
	 *
	 * @var self|null
	 */
	private static ?self $instance = null;

	/**
	 * API client instance.
	 *
	 * @var Client|null
	 */
	private ?Client $api = null;

	/**
	 * Update manager instance.
	 *
	 * @var UpdateManager|null
	 */
	private ?UpdateManager $update_manager = null;

	/**
	 * Cache invalidator instance.
	 *
	 * @var CacheInvalidator|null
	 */
	private ?CacheInvalidator $cache_invalidator = null;

	/**
	 * Slug resolver instance.
	 *
	 * @var SlugResolver|null
	 */
	private ?SlugResolver $slug_resolver = null;

	/**
	 * Installer service instance.
	 *
	 * @var Installer|null
	 */
	private ?Installer $installer = null;

	/**
	 * Get singleton instance.
	 *
	 * @return self
	 */
	public static function instance(): self {
		if ( null === self::$instance ) {
			self::$instance = new self();
			self::$instance->init();
		}

		return self::$instance;
	}

	/**
	 * Private constructor — initializes early module loader immediately.
	 */
	private function __construct() {
		new EarlyLoader();
	}

	/**
	 * Initialize the plugin.
	 */
	private function init(): void {
		load_plugin_textdomain( 'hellopack-client', false, dirname( plugin_basename( HELLOPACK_CLIENT_FILE ) ) . '/languages/' );

		$this->init_api();
		$this->init_updates();
		$this->init_self_updater();
		$this->init_auto_updates();
		$this->init_cron();

		add_action( 'init', array( $this, 'init_modules' ), 1 );

		$this->init_rest();

		if ( defined( 'WP_CLI' ) && WP_CLI ) {
			$this->init_cli();
		}

		if ( is_admin() && ! self::is_composer_mode() ) {
			$this->init_admin();
		}

		Abilities::register();

		add_action( 'admin_init', array( $this, 'maybe_auto_activate' ) );

		register_activation_hook( HELLOPACK_CLIENT_FILE, array( $this, 'activate' ) );
		register_deactivation_hook( HELLOPACK_CLIENT_FILE, array( $this, 'deactivate' ) );
	}

	/**
	 * Auto-activate when a token constant is defined but the plugin is inactive.
	 */
	public function maybe_auto_activate(): void {
		if ( ! Options::is_token_from_constant() || 'active' === Options::get_status() ) {
			return;
		}

		$response = $this->api()->request( Endpoints::url( 'api-check' ) );

		if ( ! is_wp_error( $response ) && ! empty( $response['scopes'] ) ) {
			Options::set_status( 'active' );
		}
	}

	/**
	 * Initialize the API client.
	 */
	private function init_api(): void {
		$this->api = new Client();
	}

	/**
	 * Initialize the update system.
	 */
	private function init_updates(): void {
		$this->update_manager    = new UpdateManager( $this->api() );
		$this->cache_invalidator = new CacheInvalidator();
		$this->slug_resolver     = new SlugResolver( $this->update_manager->items_cache() );
		$this->installer         = new Installer( $this->api(), $this->cache_invalidator );
	}

	/**
	 * Initialize self-updater for the HelloPack Client plugin.
	 */
	private function init_self_updater(): void {
		new SelfUpdater();
	}

	/**
	 * Initialize auto-updates support.
	 */
	private function init_auto_updates(): void {
		new AutoUpdates( $this->update_manager->items_cache() );
	}

	/**
	 * Initialize the cron system.
	 */
	private function init_cron(): void {
		new AuthCheck( $this->api() );
	}

	/**
	 * Initialize modules on init hook.
	 */
	public function init_modules(): void {
		ModuleLoader::instance();
	}

	/**
	 * Initialize REST API routes (runs outside is_admin).
	 */
	private function init_rest(): void {
		new RestRouter( $this->api(), $this->update_manager, $this->installer, $this->cache_invalidator );
	}

	/**
	 * Initialize WP-CLI commands.
	 */
	private function init_cli(): void {
		\WP_CLI::add_command( 'hellopack license', new Cli\LicenseCommand() );
		\WP_CLI::add_command( 'hellopack network', new Cli\NetworkCommand() );
		\WP_CLI::add_command( 'hellopack module', new Cli\ModuleCommand() );
		\WP_CLI::add_command(
			'hellopack plugin',
			new Cli\PluginCommand( $this->api(), $this->update_manager->items_cache(), $this->installer, $this->slug_resolver )
		);
		\WP_CLI::add_command(
			'hellopack theme',
			new Cli\ThemeCommand( $this->api(), $this->update_manager->items_cache(), $this->installer, $this->slug_resolver )
		);
	}

	/**
	 * Initialize admin.
	 */
	private function init_admin(): void {
		Whitelabel::register_hooks();
		new SettingsPage();
		DomainMismatchNotice::register();
	}

	/**
	 * Whether the plugin runs in composer (headless) mode.
	 *
	 * When HELLOPACK_MODE is set to 'composer', the admin UI is hidden
	 * but updates, modules, REST API, cron and CLI keep working.
	 *
	 * @return bool
	 */
	public static function is_composer_mode(): bool {
		return defined( 'HELLOPACK_MODE' ) && 'composer' === HELLOPACK_MODE;
	}

	/**
	 * Get the API client.
	 *
	 * @return Client
	 */
	public function api(): Client {
		if ( null === $this->api ) {
			$this->api = new Client();
		}

		return $this->api;
	}

	/**
	 * Get the update manager.
	 *
	 * @return UpdateManager|null
	 */
	public function update_manager(): ?UpdateManager {
		return $this->update_manager;
	}

	/**
	 * Get the installer service.
	 *
	 * @return Installer|null
	 */
	public function installer(): ?Installer {
		return $this->installer;
	}

	/**
	 * Get the slug resolver.
	 *
	 * @return SlugResolver|null
	 */
	public function slug_resolver(): ?SlugResolver {
		return $this->slug_resolver;
	}

	/**
	 * Get the cache invalidator.
	 *
	 * @return CacheInvalidator|null
	 */
	public function cache_invalidator(): ?CacheInvalidator {
		return $this->cache_invalidator;
	}

	/**
	 * Plugin activation.
	 */
	public function activate(): void {
		Options::set( 'is_plugin_active', true );

		if ( ! wp_next_scheduled( 'hellopack_check_authorization' ) ) {
			wp_schedule_event( time(), 'hellopack_ten_minutes', 'hellopack_check_authorization' );
		}
	}

	/**
	 * Plugin deactivation.
	 */
	public function deactivate(): void {
		Options::set( 'is_plugin_active', false );
		wp_clear_scheduled_hook( 'hellopack_check_authorization' );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit