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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

declare( strict_types=1 );

namespace HelloPack\Client\Cli;

use WP_CLI;

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

/**
 * Manage HelloPack licence modules.
 */
class ModuleCommand {

	use SiteIterator;

	/**
	 * List licence modules.
	 *
	 * "enabled" is the module switch (network-wide when network activated);
	 * "active" tells whether the module actually runs on the current site,
	 * i.e. the plugin it manages is active there and covered by the licence.
	 *
	 * ## OPTIONS
	 *
	 * [--all-sites]
	 * : On a network, also list the site IDs where each module is active.
	 *
	 * [--format=<format>]
	 * : Output format: table, json, csv, yaml. Default: table.
	 *
	 * ## EXAMPLES
	 *
	 *     wp hellopack module list
	 *     wp hellopack module list --all-sites
	 *
	 * @subcommand list
	 * @when after_wp_load
	 *
	 * @param array<int, string>   $args       Positional arguments.
	 * @param array<string, mixed> $assoc_args Flags.
	 */
	public function list_( array $args, array $assoc_args ): void {
		$format    = (string) ( $assoc_args['format'] ?? 'table' );
		$all_sites = isset( $assoc_args['all-sites'] ) && is_multisite();

		$this->warm_api_access();

		$active_on = array();

		if ( $all_sites ) {
			$this->for_each_site(
				array(),
				function ( int $blog_id ) use ( &$active_on ): void {
					foreach ( $this->loader()->get_modules() as $module ) {
						if ( $module->should_load() ) {
							$active_on[ $module->get_id() ][] = $blog_id;
						}
					}
				}
			);
		}

		$rows    = array();
		$columns = array( 'id', 'name', 'category', 'enabled', 'active' );

		if ( $all_sites ) {
			$columns[] = 'active_on';
		}

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

			$row = array(
				'id'       => $module->get_id(),
				'name'     => $module->get_name(),
				'category' => $module->get_category(),
				'enabled'  => $module->is_enabled() ? 'yes' : 'no',
				'active'   => $module->should_load() ? 'yes' : 'no',
			);

			if ( $all_sites ) {
				$sites            = $active_on[ $module->get_id() ] ?? array();
				$row['active_on'] = empty( $sites ) ? '-' : implode( ',', $sites );
			}

			$rows[] = $row;
		}

		WP_CLI\Utils\format_items( $format, $rows, $columns );
	}

	/**
	 * Enable a module.
	 *
	 * ## OPTIONS
	 *
	 * <module>
	 * : Module ID (see `wp hellopack module list`).
	 *
	 * ## EXAMPLES
	 *
	 *     wp hellopack module enable translatepress-business
	 *
	 * @when after_wp_load
	 *
	 * @param array<int, string> $args Positional arguments.
	 */
	public function enable( array $args ): void {
		$this->set_enabled( (string) $args[0], true );
	}

	/**
	 * Disable a module.
	 *
	 * ## OPTIONS
	 *
	 * <module>
	 * : Module ID (see `wp hellopack module list`).
	 *
	 * ## EXAMPLES
	 *
	 *     wp hellopack module disable translatepress-business
	 *
	 * @when after_wp_load
	 *
	 * @param array<int, string> $args Positional arguments.
	 */
	public function disable( array $args ): void {
		$this->set_enabled( (string) $args[0], false );
	}

	/**
	 * Flip a module switch and report.
	 *
	 * @param string $module_id Module ID.
	 * @param bool   $enabled   Desired state.
	 */
	private function set_enabled( string $module_id, bool $enabled ): void {
		$module = $this->loader()->set_module_enabled( $module_id, $enabled );

		if ( null === $module ) {
			/* translators: %s: module ID. */
			WP_CLI::error( sprintf( __( 'Module not found: %s', 'hellopack-client' ), $module_id ) );
		}

		$scope = HELLOPACK_CLIENT_NETWORK_ACTIVATED
			? __( 'for the whole network', 'hellopack-client' )
			: __( 'for this site', 'hellopack-client' );

		WP_CLI::success(
			$enabled
				/* translators: 1: module name, 2: scope ("for this site" / "for the whole network"). */
				? sprintf( __( 'Module %1$s enabled %2$s.', 'hellopack-client' ), $module->get_name(), $scope )
				/* translators: 1: module name, 2: scope ("for this site" / "for the whole network"). */
				: sprintf( __( 'Module %1$s disabled %2$s.', 'hellopack-client' ), $module->get_name(), $scope )
		);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit