$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/www/wp-content/plugins/hellopack-client/modules/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home2/krtkhu/www/wp-content/plugins/hellopack-client/modules//elementor-pro.php
<?php
/**
 * Elementor Pro module.
 *
 * Redirects all Elementor Pro license API calls to GLS3 and manages
 * license v2 data, translation blocking, and API lock cleanup.
 *
 * @package HelloPack\Client
 */

declare( strict_types=1 );

namespace HelloPack\Modules;

use HelloPack\Client\Module\AbstractModule;
use HelloPack\Client\License\ApiRedirector;
use HelloPack\Client\Options;

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

/**
 * Elementor Pro license module.
 */
class Elementor_Pro extends AbstractModule {

	/**
	 * Minimum required Elementor Pro version.
	 *
	 * @var string
	 */
	private string $min_version = '3.9.2';

	/**
	 * Set up module properties.
	 */
	public function setup(): void {
		$this->id          = 'elementor-pro';
		$this->name        = 'Elementor Pro';
		$this->description = 'Manages Elementor Pro license via GLS3.';
		$this->category    = 'plugin';
		$this->version     = '2.0.0';
		$this->target      = array(
			'plugin_dir'  => 'elementor-pro',
			'plugin_file' => 'elementor-pro.php',
		);
		$this->target_id   = '1137004424';
	}

	/**
	 * Initialize module.
	 */
	public function init(): void {
		if ( ! $this->check_version() ) {
			return;
		}

		// Redirect all my.elementor.com API calls to GLS3.
		ApiRedirector::create(
			'https://my.elementor.com',
			HELLOPACK_GLS3_URL . '/elementor-pro'
		);

		// Set up license data.
		$this->setup_license();

		// Block Elementor Pro translation downloads.
		// `pre_set_*` runs when the transient is written (Elementor Updater at priority 50, we at 100).
		// `site_transient_*` runs on every read, so stale transients are filtered immediately.
		add_filter(
			'pre_set_site_transient_update_plugins',
			array( $this, 'block_translations' ),
			100
		);
		add_filter(
			'site_transient_update_plugins',
			array( $this, 'block_translations' ),
			100
		);

		// Remove Elementor "Upgrade" menu item.
		add_action( 'admin_menu', array( $this, 'remove_upgrade_menu' ), PHP_INT_MAX );

		// Set Connect data so the Library app reports is_connected = true.
		add_action( 'admin_init', array( $this, 'set_connect_data' ) );
	}

	/**
	 * Check Elementor Pro version compatibility.
	 *
	 * @return bool
	 */
	private function check_version(): bool {
		if ( defined( 'ELEMENTOR_PRO_VERSION' )
			&& ! version_compare( ELEMENTOR_PRO_VERSION, $this->min_version, '>=' )
		) {
			return false;
		}

		return true;
	}

	/**
	 * Set up Elementor Pro license key and v2 data.
	 */
	private function setup_license(): void {
		if ( ! defined( 'ELEMENTOR_PRO_VERSION' ) ) {
			return;
		}

		// Clean API request locks at most once per hour.
		if ( false === get_transient( 'hellopack_elementor_lock_cleaned' ) ) {
			delete_option( '_elementor_pro_api_requests_lock' );
			set_transient( 'hellopack_elementor_lock_cleaned', 1, HOUR_IN_SECONDS );
		}

		// Get HelloPack token.
		$token = Options::get( 'token' );
		if ( empty( $token ) ) {
			return;
		}

		$this->sync_license_key( (string) $token );
		$this->setup_license_v2_data();
	}

	/**
	 * Sync Elementor Pro license key with HelloPack token.
	 *
	 * @param string $token HelloPack API token.
	 */
	private function sync_license_key( string $token ): void {
		$current_key      = get_option( 'elementor_pro_license_key' );
		$hellopack_marker = get_option( 'elementor_hellopack_license_key' );

		// If keys are out of sync, reset.
		if ( $current_key !== $hellopack_marker ) {
			delete_option( 'elementor_pro_license_key' );
		}

		// Set marker if not present.
		if ( ! $hellopack_marker ) {
			delete_option( 'elementor_pro_license_key' );
			delete_option( '_elementor_pro_license_data' );
			add_option( 'elementor_hellopack_license_key', $token, '', 'yes' );
		}

		// Set license key if not present.
		if ( ! get_option( 'elementor_pro_license_key' ) ) {
			add_option( 'elementor_pro_license_key', $token, '', 'yes' );
		}
	}

	/**
	 * Set up Elementor Pro license v2 data with agency tier.
	 */
	private function setup_license_v2_data(): void {
		$data     = get_option( '_elementor_pro_license_v2_data' );
		$fallback = get_option( '_elementor_pro_license_v2_data_fallback' );

		// Only update if data is missing or invalid.
		if ( ! $this->is_license_data_invalid( $data )
			&& ! $this->is_license_data_invalid( $fallback )
		) {
			return;
		}

		$expires_date = gmdate( 'Y-m-d H:i:s', time() + YEAR_IN_SECONDS );

		$license_data = array(
			'expires'         => $expires_date,
			'subscription_id' => 1315476,
			'status'          => 'ACTIVE',
			'recurring'       => true,
			'tier'            => 'agency',
			'features'        => array(
				'experts',
				'editor_comments',
				'template_access_level_20',
				'kit_access_level_20',
				'form-submissions',
				'custom_code',
				'popup',
			),
			'activated'       => true,
			'success'         => true,
		);

		$transient_data = array(
			'timeout' => time() + YEAR_IN_SECONDS,
			'value'   => wp_json_encode( $license_data ),
		);

		update_option( '_elementor_pro_license_v2_data', $transient_data, 'off' );
		update_option( '_elementor_pro_license_v2_data_fallback', $transient_data, 'off' );
	}

	/**
	 * Check if license v2 data is invalid.
	 *
	 * @param mixed $data License data.
	 * @return bool True if invalid.
	 */
	private function is_license_data_invalid( mixed $data ): bool {
		if ( ! $data || ! is_array( $data ) || ! isset( $data['value'] ) ) {
			return true;
		}

		$decoded = json_decode( $data['value'], true );

		if ( ! $decoded || ! is_array( $decoded ) ) {
			return true;
		}

		if ( ! isset( $decoded['success'] ) || false === $decoded['success'] ) {
			return true;
		}

		return false;
	}

	/**
	 * Block Elementor Pro translation downloads.
	 *
	 * Removes Elementor Pro translations from the update transient to prevent
	 * persistent "translation update available" notices. Used on both
	 * `pre_set_site_transient_update_plugins` (write) and
	 * `site_transient_update_plugins` (read) to cover stale transients.
	 *
	 * @param mixed $transient Update plugins transient.
	 * @return mixed Modified transient.
	 */
	public function block_translations( mixed $transient ): mixed {
		if ( ! is_object( $transient ) ) {
			return $transient;
		}

		if ( isset( $transient->translations ) && is_array( $transient->translations ) ) {
			$transient->translations = array_values(
				array_filter(
					$transient->translations,
					static function ( array $translation ): bool {
						return ! isset( $translation['slug'] )
							|| 'elementor-pro' !== $translation['slug'];
					}
				)
			);
		}

		return $transient;
	}

	/**
	 * Set Elementor Connect common data for the current user.
	 *
	 * The Library app checks is_connected() which reads
	 * 'elementor_connect_common_data' user option for 'access_token'.
	 * Without this, users see "Connect to Template Library" popup.
	 */
	public function set_connect_data(): void {
		$user_id = get_current_user_id();
		if ( ! $user_id ) {
			return;
		}

		$connect_data = get_user_option( 'elementor_connect_common_data', $user_id );

		// Skip if already set correctly (access_token present and user is an object).
		if ( is_array( $connect_data )
			&& ! empty( $connect_data['access_token'] )
			&& isset( $connect_data['user'] )
			&& is_object( $connect_data['user'] )
		) {
			return;
		}

		update_user_option(
			$user_id,
			'elementor_connect_common_data',
			array(
				'access_token'        => 'hellopack-managed',
				'access_token_secret' => 'hellopack-managed',
				'user'                => (object) array( 'email' => 'support@hellowp.io' ),
			)
		);
	}

	/**
	 * Remove Elementor "Upgrade" submenu item.
	 */
	public function remove_upgrade_menu(): void {
		remove_submenu_page( 'elementor-home', 'elementor-one-upgrade' );
	}

	/**
	 * Cleanup on disable — remove all license data.
	 */
	public function cleanup(): void {
		hellopack_delete_option( 'elementor_pro_license_key' );
		hellopack_delete_option( 'elementor_hellopack_license_key' );
		hellopack_delete_option( '_elementor_pro_license_data' );
		hellopack_delete_option( '_elementor_pro_license_v2_data' );
		hellopack_delete_option( '_elementor_pro_license_v2_data_fallback' );
		hellopack_delete_option( '_elementor_pro_api_requests_lock' );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit