$27 GRAYBYTE WORDPRESS FILE MANAGER $77

SERVER : premium267.web-hosting.com #1 SMP Wed Jun 4 13:01:13 UTC 2025
SERVER IP : 69.57.162.29 | ADMIN IP 216.73.216.187
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/njinenkb/tadkon.org/wp-content/plugins/wp-smushit/core/

HOME
Current File : /home/njinenkb/tadkon.org/wp-content/plugins/wp-smushit/core//class-cache-controller.php
<?php

namespace Smush\Core;

class Cache_Controller extends Controller {
	const SHOW_CACHE_NOTICE_TRANSIENT = 'wp_smush_show_cache_notice';
	const CLEAR_CACHE_ACTION = 'wp_smush_clear_page_cache';

	public function __construct() {
		$this->register_action( 'wp_smush_avif_status_changed', array( $this, 'avif_status_changed' ) );
		$this->register_action( 'wp_smush_webp_status_changed', array( $this, 'webp_status_changed' ) );
		$this->register_action( 'wp_smush_webp_method_changed', array( $this, 'webp_method_changed' ) );
		$this->register_action( 'wp_smush_cdn_status_changed', array( $this, 'cdn_status_changed' ) );
		// TODO: identify other cases where cache should be cleared and call the clear_third_party_cache method

		$this->register_action( 'wp_ajax_smush_dismiss_cache_notice', array( $this, 'dismiss_cache_notice' ) );
		$this->register_action( 'wp_smush_header_notices', array( $this, 'maybe_show_cache_notice' ) );
	}

	public function cdn_status_changed() {
		$this->clear_third_party_cache( 'cdn' );
	}

	public function webp_method_changed() {
		$this->clear_third_party_cache( 'next_gen_method' );
	}

	public function webp_status_changed() {
		$this->clear_third_party_cache( 'next_gen' );
	}

	public function avif_status_changed() {
		$this->clear_third_party_cache( 'next_gen' );
	}

	private function clear_third_party_cache( $notice_key = '' ) {
		do_action( self::CLEAR_CACHE_ACTION );
		if ( ! has_action( self::CLEAR_CACHE_ACTION ) && $notice_key ) {
			// If no one is handling the cache clearing then show a notice
			set_transient( self::SHOW_CACHE_NOTICE_TRANSIENT, $notice_key );
		}
	}

	public function dismiss_cache_notice() {
		check_ajax_referer( 'wp-smush-ajax' );
		// Check for permission.
		if ( ! Helper::is_user_allowed( 'manage_options' ) ) {
			wp_die( esc_html__( 'Unauthorized', 'wp-smushit' ), 403 );
		}
		delete_transient( self::SHOW_CACHE_NOTICE_TRANSIENT );
		wp_send_json_success();
	}

	public function maybe_show_cache_notice() {
		$notice = $this->get_cache_notice();
		if ( empty( $notice ) ) {
			return;
		}
		?>
		<div class="sui-notice sui-notice-info" id="wp-smush-cache-notice">
			<div class="sui-notice-content">
				<div class="sui-notice-message">
					<i class="sui-notice-icon sui-icon-info" aria-hidden="true"></i>
					<p><?php echo wp_kses_post( $notice ); ?></p>
				</div>
				<div class="sui-notice-actions">
					<button class="sui-button-icon smush-dismiss-notice-button">
						<i class="sui-icon-check" aria-hidden="true"></i>
						<span class="sui-screen-reader-text"><?php esc_html_e( 'Dismiss', 'wp-smushit' ); ?></span>
					</button>
				</div>
			</div>
		</div>
		<?php
	}

	private function get_cache_notice() {
		$notice_key = get_transient( self::SHOW_CACHE_NOTICE_TRANSIENT );
		if ( empty( $notice_key ) ) {
			return;
		}

		$settings = Settings::get_instance();
		if ( 'cdn' === $notice_key ) {
			return $settings->has_cdn_page() ? __( 'CDN status has changed.<br/>If you have a page caching plugin or server caching, please clear it to ensure everything works as expected.', 'wp-smushit' ) : '';
		}

		if ( 'next_gen' === $notice_key || 'next_gen_method' === $notice_key ) {
			$notice = 'next_gen' === $notice_key ? __( 'Next-Gen Formats status has changed.<br/>If you have a page caching plugin or server caching, please clear it to ensure everything works as expected.', 'wp-smushit' ) :
												__( 'Next-Gen conversion method has been updated.<br/>If you have a page caching plugin or server caching, please clear it to ensure everything works as expected.', 'wp-smushit' );
			return $settings->has_next_gen_page() ? $notice : '';
		}
	}
}

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
13 Apr 2026 7.46 AM
njinenkb / njinenkb
0755
api
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
avif
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
backups
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
cdn
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
cli
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
external
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
integrations
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
lazy-load
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
media
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
media-library
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
modules
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
next-gen
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
parser
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
photon
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
png2jpg
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
resize
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
s3
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
security
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
smush
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
stats
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
threads
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
transform
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
webp
--
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0755
class-animated-status-controller.php
2.749 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-array-utils.php
1.732 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-attachment-id-list.php
2.38 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-backup-size.php
1.503 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-cache-controller.php
3.569 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-configs.php
24.694 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-controller.php
1.589 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-core.php
17.214 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-cron-controller.php
0.764 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-deprecated-hooks.php
3.8 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-error-handler.php
8.017 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-file-system.php
1.996 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-file-utils.php
0.664 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-format-utils.php
0.237 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-helper.php
28.246 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-installer.php
10.703 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-keyword-exclusions.php
6.888 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-modules.php
5.89 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-optimization-controller.php
1.029 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-plugin-settings-watcher.php
3.702 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-product-analytics.php
7.809 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-rest.php
2.98 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-server-utils.php
5.604 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-settings.php
43.201 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-smush-file.php
0.304 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-stats.php
37.542 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-time-utils.php
0.269 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-timer.php
0.272 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-upload-dir.php
3.354 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644
class-url-utils.php
2.405 KB
27 Apr 2025 10.47 PM
njinenkb / njinenkb
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF