$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/NetworkCommand.php
<?php
/**
 * WP-CLI network commands.
 *
 * @package HelloPack\Client
 */

declare( strict_types=1 );

namespace HelloPack\Client\Cli;

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

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

/**
 * Inspect HelloPack across a multisite network.
 */
class NetworkCommand {

	use SiteIterator;

	/**
	 * Show the HelloPack state of every site on the network.
	 *
	 * Lists, per site, which managed plugins are active there and whether the
	 * licence options HelloPack maintains for them are present. Read-only.
	 *
	 * ## OPTIONS
	 *
	 * [--sites=<ids>]
	 * : Comma-separated site IDs to include. Default: all sites.
	 *
	 * [--format=<format>]
	 * : Output format: table, json, csv, yaml. Default: table.
	 *
	 * ## EXAMPLES
	 *
	 *     wp hellopack network status
	 *     wp hellopack network status --sites=1,5 --format=json
	 *
	 * @when after_wp_load
	 *
	 * @param array<int, string>   $args       Positional arguments.
	 * @param array<string, mixed> $assoc_args Flags.
	 */
	public function status( array $args, array $assoc_args ): void {
		$format = (string) ( $assoc_args['format'] ?? 'table' );

		if ( 'table' === $format ) {
			$this->print_header();
		}

		$this->warm_api_access();

		$rows = array();

		$this->for_each_site(
			$assoc_args,
			function ( int $blog_id, string $url ) use ( &$rows ): void {
				$managed  = array();
				$missing  = array();
				$expected = 0;

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

					$managed[] = $module->get_id();

					// Dry run: learn which options the module would write here
					// without writing anything.
					OptionRecorder::start( true );
					$module->init();
					$options = OptionRecorder::stop();

					// Presence is the signal: some values carry a timestamp taken at
					// write time, so an exact comparison would never match.
					foreach ( array_keys( $options ) as $option ) {
						++$expected;

						if ( false === get_option( $option ) ) {
							$missing[] = $option;
						}
					}
				}

				$rows[] = array(
					'blog_id'         => $blog_id,
					'url'             => $url,
					'managed_plugins' => empty( $managed ) ? '-' : implode( ', ', $managed ),
					'licence_options' => $this->describe_options( $expected, $missing ),
				);
			}
		);

		WP_CLI\Utils\format_items( $format, $rows, array( 'blog_id', 'url', 'managed_plugins', 'licence_options' ) );

		if ( 'table' === $format && ! is_multisite() ) {
			WP_CLI::line( __( 'This is not a multisite install; showing the single site.', 'hellopack-client' ) );
		}
	}

	/**
	 * Print the network-level connection summary.
	 */
	private function print_header(): void {
		$token = (string) Options::get( 'token' );

		WP_CLI::line(
			sprintf(
				'Token: %s   Domain: %s   Status: %s   Scope: %s',
				'' === $token ? '(not set)' : Options::mask_token( $token ),
				Options::get_domain(),
				Options::get_status(),
				HELLOPACK_CLIENT_NETWORK_ACTIVATED ? 'network' : 'site'
			)
		);
		WP_CLI::line( '' );
	}

	/**
	 * Summarise the licence options of one site.
	 *
	 * @param int                $expected Number of options a module would write.
	 * @param array<int, string> $missing  Options absent or holding another value.
	 * @return string
	 */
	private function describe_options( int $expected, array $missing ): string {
		if ( 0 === $expected ) {
			return '-';
		}

		if ( empty( $missing ) ) {
			return sprintf( 'ok (%d)', $expected );
		}

		return sprintf( 'missing %d/%d: %s', count( $missing ), $expected, implode( ', ', $missing ) );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit