$plugin = <<403WebShell
403Webshell
Server IP : 193.224.177.188  /  Your IP : 216.73.217.123
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/Update/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home2/krtkhu/www/wp-content/plugins/hellopack-client/includes/Update/AutoUpdates.php
<?php
/**
 * Auto-updates support for HelloPack-managed plugins.
 *
 * Adds premium plugins to the no_update array so WordPress
 * displays the standard auto-update toggle on the Plugins page.
 *
 * @package HelloPack\Client
 */

declare( strict_types=1 );

namespace HelloPack\Client\Update;

use HelloPack\Client\Options;
use stdClass;

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

/**
 * Enables WordPress auto-update UI for HelloPack-managed plugins.
 */
class AutoUpdates {

	/**
	 * Option key for the auto-updates feature toggle.
	 */
	public const OPTION_KEY = 'auto_updates';

	/**
	 * Items cache.
	 *
	 * @var ItemsCache
	 */
	private ItemsCache $cache;

	/**
	 * Constructor.
	 *
	 * @param ItemsCache $cache Items cache.
	 */
	public function __construct( ItemsCache $cache ) {
		$this->cache = $cache;

		if ( self::is_enabled() ) {
			$this->register_hooks();
		}
	}

	/**
	 * Register hooks.
	 */
	private function register_hooks(): void {
		add_filter( 'site_transient_update_plugins', array( $this, 'add_no_update_entries' ), PHP_INT_MAX );
		add_filter( 'transient_update_plugins', array( $this, 'add_no_update_entries' ), PHP_INT_MAX );
	}

	/**
	 * Add HelloPack-managed plugins to the no_update array.
	 *
	 * This makes WordPress display the auto-update toggle for these plugins.
	 *
	 * @param mixed $transient The update_plugins transient.
	 * @return object
	 */
	public function add_no_update_entries( mixed $transient ): object {
		if ( ! is_object( $transient ) ) {
			$transient = new stdClass();
		}

		if ( ! isset( $transient->no_update ) ) {
			$transient->no_update = array();
		}

		$this->add_hellopack_client( $transient );
		$this->add_managed_plugins( $transient );

		return $transient;
	}

	/**
	 * Add HelloPack Client itself to the no_update array.
	 *
	 * @param object $transient The update_plugins transient.
	 */
	private function add_hellopack_client( object &$transient ): void {
		$plugin_file = plugin_basename( HELLOPACK_CLIENT_FILE );

		if ( isset( $transient->response[ $plugin_file ] ) ) {
			return;
		}

		$transient->no_update[ $plugin_file ] = (object) array(
			'id'            => $plugin_file,
			'slug'          => dirname( $plugin_file ),
			'plugin'        => $plugin_file,
			'new_version'   => HELLOPACK_CLIENT_VERSION,
			'url'           => '',
			'package'       => '',
			'icons'         => array(),
			'banners'       => array(),
			'banners_rtl'   => array(),
			'tested'        => '',
			'requires_php'  => '',
			'compatibility' => new stdClass(),
		);
	}

	/**
	 * Add all HelloPack-managed plugins to the no_update array.
	 *
	 * @param object $transient The update_plugins transient.
	 */
	private function add_managed_plugins( object &$transient ): void {
		$plugins_data = $this->cache->get_plugins();
		$installed    = array_merge(
			$plugins_data['active'] ?? array(),
			$plugins_data['installed'] ?? array()
		);
		$wp_plugins   = $this->cache->wp_plugins();

		foreach ( $installed as $plugin_file => $premium ) {
			if ( ! isset( $wp_plugins[ $plugin_file ] ) ) {
				continue;
			}

			// Skip plugins that already have an update pending.
			if ( isset( $transient->response[ $plugin_file ] ) ) {
				continue;
			}

			$transient->no_update[ $plugin_file ] = (object) array(
				'id'            => $plugin_file,
				'slug'          => dirname( $plugin_file ),
				'plugin'        => $plugin_file,
				'new_version'   => $wp_plugins[ $plugin_file ]['Version'],
				'url'           => $premium['url'] ?? '',
				'package'       => '',
				'icons'         => array(),
				'banners'       => array(),
				'banners_rtl'   => array(),
				'tested'        => '',
				'requires_php'  => '',
				'compatibility' => new stdClass(),
			);
		}
	}

	/**
	 * Check if auto-updates feature is enabled.
	 *
	 * @return bool
	 */
	public static function is_enabled(): bool {
		return (bool) Options::get( self::OPTION_KEY, false );
	}

	/**
	 * Enable the auto-updates feature.
	 */
	public static function enable(): void {
		Options::set( self::OPTION_KEY, true );
	}

	/**
	 * Disable the auto-updates feature.
	 */
	public static function disable(): void {
		Options::set( self::OPTION_KEY, false );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit