$plugin = <<403WebShell
403Webshell
Server IP : 193.224.177.188  /  Your IP : 216.73.217.123
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//memberdash.php
<?php
/**
 * MemberDash module.
 *
 * Uses LearnDash licensing system (checkout.learndash.com).
 * API calls redirected to GLS3 via the shared LearnDash handler.
 *
 * @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;
}

/**
 * MemberDash license module.
 */
class Memberdash extends AbstractModule {

	/**
	 * License option names (from MS_Licensing class).
	 *
	 * @var string
	 */
	private const OPT_LICENSE_KEY            = 'ms_license_key';
	private const OPT_LICENSE_EMAIL          = 'ms_license_email';
	private const OPT_LICENSE_KEY_ERROR      = 'ms_license_key_error';
	private const OPT_LICENSE_KEY_DATA       = 'ms_license_key_data';
	private const OPT_LICENSE_KEY_NEXT_CHECK = 'ms_license_key_next_check';

	/**
	 * Placeholder license key.
	 *
	 * @var string
	 */
	private const LICENSE_KEY = 'HPCK-0000-0000-0000';

	/**
	 * Placeholder email.
	 *
	 * @var string
	 */
	private const LICENSE_EMAIL = 'license@hellowp.io';

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

		$this->blocked_domains = array(
			'checkout.learndash.com/wp-json/learndash/v2/repo/' => self::generic_block(),
		);
	}

	/**
	 * Initialize module.
	 */
	public function init(): void {
		// MemberDash uses checkout.learndash.com — redirect to LearnDash GLS3 handler.
		ApiRedirector::create(
			'https://checkout.learndash.com',
			HELLOPACK_GLS3_URL . '/learndash'
		);

		$this->activate_license();
	}

	/**
	 * Activate MemberDash license.
	 *
	 * Sets license data in wp_options and MS_Model_Settings.
	 */
	private function activate_license(): void {
		$token = Options::get( 'token' );

		$license_data = array(
			'license_key'   => self::LICENSE_KEY,
			'license_email' => self::LICENSE_EMAIL,
			'subscription'  => array(
				'subscription_type' => 'lifetime',
				'plan_code'         => 'memberdash-pro',
				'site_limit'        => 999,
				'expiry'            => time() + ( 100 * 365 * 86400 ),
				'token'             => $token ? md5( $token . home_url() ) : '',
				'product'           => 'memberdash',
			),
		);

		hellopack_ensure_option( self::OPT_LICENSE_KEY, self::LICENSE_KEY );
		hellopack_ensure_option( self::OPT_LICENSE_EMAIL, self::LICENSE_EMAIL );
		hellopack_ensure_option( self::OPT_LICENSE_KEY_DATA, $license_data );
		hellopack_ensure_option( self::OPT_LICENSE_KEY_NEXT_CHECK, time() + ( 365 * 86400 ) );

		delete_option( self::OPT_LICENSE_KEY_ERROR );

		$this->update_model_settings();
	}

	/**
	 * Update MS_Model_Settings with license data.
	 *
	 * MemberDash stores settings as array or object depending on context.
	 * The license key and email must be set for the UI to display correctly.
	 */
	private function update_model_settings(): void {
		$settings = get_option( 'ms_model_settings' );

		if ( is_array( $settings ) ) {
			if ( self::LICENSE_KEY === ( $settings['license_key'] ?? '' ) ) {
				return;
			}

			$settings['license_key']   = self::LICENSE_KEY;
			$settings['license_email'] = self::LICENSE_EMAIL;
			update_option( 'ms_model_settings', $settings );
		} elseif ( is_object( $settings ) ) {
			if ( self::LICENSE_KEY === ( $settings->license_key ?? '' ) ) {
				return;
			}

			$settings->license_key   = self::LICENSE_KEY;
			$settings->license_email = self::LICENSE_EMAIL;
			update_option( 'ms_model_settings', $settings );
		}
	}

	/**
	 * Cleanup on disable.
	 */
	public function cleanup(): void {
		hellopack_delete_option( self::OPT_LICENSE_KEY );
		hellopack_delete_option( self::OPT_LICENSE_EMAIL );
		hellopack_delete_option( self::OPT_LICENSE_KEY_DATA );
		hellopack_delete_option( self::OPT_LICENSE_KEY_NEXT_CHECK );

		$settings = get_option( 'ms_model_settings' );

		if ( is_array( $settings ) ) {
			$settings['license_key']   = '';
			$settings['license_email'] = '';
			update_option( 'ms_model_settings', $settings );
		} elseif ( is_object( $settings ) ) {
			$settings->license_key   = '';
			$settings->license_email = '';
			update_option( 'ms_model_settings', $settings );
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit