$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/includes/Cli/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home2/krtkhu/www/wp-content/plugins/hellopack-client/includes/Cli/LicenseCommand.php
<?php
/**
 * WP-CLI license commands.
 *
 * @package HelloPack\Client
 */

declare( strict_types=1 );

namespace HelloPack\Client\Cli;

use HelloPack\Client\Api\Client;
use HelloPack\Client\Api\Endpoints;
use HelloPack\Client\License\OptionRecorder;
use HelloPack\Client\Options;
use WP_CLI;

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

/**
 * Manage the HelloPack API license.
 */
class LicenseCommand {

	use SiteIterator;

	/**
	 * Activate the HelloPack license with an API token.
	 *
	 * ## OPTIONS
	 *
	 * <token>
	 * : The API token for HelloPack.
	 *
	 * ## EXAMPLES
	 *
	 *     wp hellopack license activate eyJ0eXAiOiJKV1QiLCJhbGci...
	 *
	 * @when after_wp_load
	 *
	 * @param array<int, string> $args Positional arguments.
	 */
	public function activate( array $args ): void {
		$token = $args[0];

		if ( strlen( $token ) < 20 ) {
			WP_CLI::error( __( 'Invalid API token — must be at least 20 characters.', 'hellopack-client' ) );
		}

		Options::set( 'token', $token );

		$client   = new Client();
		$response = $client->request( Endpoints::url( 'api-check' ) );

		if ( is_wp_error( $response ) ) {
			Options::set_status( 'inactive' );
			WP_CLI::error( $response->get_error_message() );
		}

		if ( ! empty( $response['scopes'] ) ) {
			Options::set_status( 'active' );
			$this->clear_all_transients();
			WP_CLI::success( __( 'API token activated successfully.', 'hellopack-client' ) );
			return;
		}

		Options::set_status( 'inactive' );
		WP_CLI::error( __( 'Invalid token or insufficient permissions.', 'hellopack-client' ) );
	}

	/**
	 * Deactivate the HelloPack license.
	 *
	 * ## EXAMPLES
	 *
	 *     wp hellopack license deactivate
	 *
	 * @when after_wp_load
	 */
	public function deactivate(): void {
		Options::set( 'token', '' );
		Options::set_status( 'inactive' );
		$this->clear_all_transients();

		WP_CLI::success( __( 'HelloPack license deactivated.', 'hellopack-client' ) );
	}

	/**
	 * Show the current license status.
	 *
	 * ## EXAMPLES
	 *
	 *     wp hellopack license status
	 *
	 * @when after_wp_load
	 */
	public function status(): void {
		$status = Options::get_status();
		$token  = (string) Options::get( 'token' );
		$domain = Options::get_domain();

		WP_CLI::line( sprintf( 'Status: %s', $status ) );
		WP_CLI::line( sprintf( 'Domain: %s', $domain ) );

		if ( ! empty( $token ) ) {
			WP_CLI::line( sprintf( 'Token:  %s', Options::mask_token( $token ) ) );
		} else {
			WP_CLI::line( 'Token:  (not set)' );
		}
	}

	/**
	 * Write the licence options of every managed plugin, on every site.
	 *
	 * Modules normally set their plugin's licence when a request runs on the
	 * site where that plugin is active. This does it immediately for all sites,
	 * which matters right after enabling HelloPack on a network. With --clean
	 * it also removes the options left behind by modules that were disabled.
	 *
	 * ## OPTIONS
	 *
	 * [--sites=<ids>]
	 * : Comma-separated site IDs to include. Default: all sites.
	 *
	 * [--clean]
	 * : Also remove licence options of disabled modules.
	 *
	 * [--dry-run]
	 * : Show what would be written without changing anything.
	 *
	 * ## EXAMPLES
	 *
	 *     wp hellopack license sync
	 *     wp hellopack license sync --sites=2,3 --dry-run
	 *     wp hellopack license sync --clean
	 *
	 * @when after_wp_load
	 *
	 * @param array<int, string>   $args       Positional arguments.
	 * @param array<string, mixed> $assoc_args Flags.
	 */
	public function sync( array $args, array $assoc_args ): void {
		$dry_run = isset( $assoc_args['dry-run'] );
		$clean   = isset( $assoc_args['clean'] );

		$this->warm_api_access();

		$total_written = 0;
		$total_cleaned = 0;

		$this->for_each_site(
			$assoc_args,
			function ( int $blog_id, string $url ) use ( $dry_run, $clean, &$total_written, &$total_cleaned ): void {
				$written = array();
				$cleaned = array();

				foreach ( $this->loader()->get_modules() as $module ) {
					if ( 'system' === $module->get_category() ) {
						continue;
					}

					if ( $module->should_load() ) {
						OptionRecorder::start( $dry_run );
						$module->init();
						$written = array_merge( $written, array_keys( OptionRecorder::stop() ) );
						continue;
					}

					if ( $clean && ! $module->is_enabled() && ! $dry_run ) {
						$module->cleanup();
						$cleaned[] = $module->get_id();
					}
				}

				$total_written += count( $written );
				$total_cleaned += count( $cleaned );

				WP_CLI::log(
					sprintf(
						'[%d] %s  written: %s%s',
						$blog_id,
						$url,
						empty( $written ) ? '-' : implode( ', ', array_unique( $written ) ),
						empty( $cleaned ) ? '' : '  cleaned: ' . implode( ', ', $cleaned )
					)
				);
			}
		);

		if ( $dry_run ) {
			/* translators: %d: number of options. */
			WP_CLI::success( sprintf( __( 'Dry run: %d licence options would be written.', 'hellopack-client' ), $total_written ) );
			return;
		}

		WP_CLI::success(
			/* translators: 1: number of options written, 2: number of modules cleaned. */
			sprintf( __( '%1$d licence options written, %2$d modules cleaned.', 'hellopack-client' ), $total_written, $total_cleaned )
		);
	}

	/**
	 * Clear all related transients.
	 */
	private function clear_all_transients(): void {
		Options::clear_all_transients();
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit