$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/modules/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home2/krtkhu/public_html/wp-content/plugins/hellopack-client/modules/shortpixel-hellopack.php
<?php
/**
 * ShortPixel (HelloPack) module.
 *
 * Sets the ShortPixel API key using the HelloPack API key.
 *
 * @package HelloPack\Client
 */

declare( strict_types=1 );

namespace HelloPack\Modules;

use HelloPack\Client\Module\AbstractModule;
use HelloPack\Client\Options;

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

/**
 * ShortPixel (HelloPack) license module.
 */
class Shortpixel_Hellopack extends AbstractModule {

	/**
	 * Set up module properties.
	 */
	public function setup(): void {
		$this->id          = 'shortpixel-hellopack';
		$this->name        = 'ShortPixel Image Optimizer (HelloPack)';
		$this->description = 'Manages ShortPixel (HelloPack) API key via the HelloPack API key.';
		$this->category    = 'plugin';
		$this->version     = '2.0.0';
		$this->target      = array(
			'plugin_dir'  => 'shortpixel-hellopack',
			'plugin_file' => 'shortpixel-hellopack.php',
		);
	}

	/**
	 * Initialize module.
	 */
	public function init(): void {
		$this->prime_settings_defaults();
		$this->configure_api_key();
	}

	/**
	 * Pre-populate spio_settings with array defaults to avoid a render fatal.
	 *
	 * ShortPixel 6.5.0 introduced a SettingsModel::__get() that returns null
	 * for any model field whose default is a non-callable array (excludeSizes,
	 * currentStats, excludePatterns). On a fresh install, the option is missing
	 * those keys, getData() emits null for them, and class/view/settings/part-exclusions.php
	 * passes null to in_array() — TypeError fatal under PHP 8+.
	 *
	 * Writing empty arrays for these keys before the Settings page renders
	 * resolves the fatal without patching the ShortPixel codebase. The first
	 * Save in the UI fills in the rest of the model defaults.
	 */
	private function prime_settings_defaults(): void {
		$opts = get_option( 'spio_settings', array() );
		if ( ! is_array( $opts ) ) {
			$opts = array();
		}

		$changed = false;
		foreach ( array( 'excludeSizes', 'currentStats', 'excludePatterns' ) as $key ) {
			if ( ! array_key_exists( $key, $opts ) || ! is_array( $opts[ $key ] ) ) {
				$opts[ $key ] = array();
				$changed      = true;
			}
		}

		if ( $changed ) {
			update_option( 'spio_settings', $opts, true );
		}
	}

	/**
	 * Configure ShortPixel API key with the HelloPack API key.
	 *
	 * ShortPixel stores its key in the spio_key option as an array
	 * with apiKey, verifiedKey, and apiKeyTried fields.
	 */
	private function configure_api_key(): void {
		$token = (string) Options::get( 'token', '' );
		if ( '' === $token ) {
			return;
		}

		$spio_key = get_option( 'spio_key', array() );

		if (
			is_array( $spio_key ) &&
			( $spio_key['apiKey'] ?? '' ) === $token &&
			! empty( $spio_key['verifiedKey'] )
		) {
			return;
		}

		update_option(
			'spio_key',
			array(
				'apiKey'      => sanitize_text_field( $token ),
				'verifiedKey' => true,
				'apiKeyTried' => null,
			),
			true
		);
	}

	/**
	 * Cleanup on disable.
	 */
	public function cleanup(): void {
		hellopack_delete_option( 'spio_key' );
		hellopack_delete_option( 'wp-short-pixel-apiKey' );
		hellopack_delete_option( 'wp-short-pixel-verifiedKey' );
		hellopack_delete_option( 'wp-short-pixel-apiKeyTried' );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit