403Webshell
Server IP : 82.64.35.208  /  Your IP : 172.20.0.1
Web Server : Apache/2.4.67 (Debian)
System : Linux c1d185609d2c 6.12.76-linuxkit #1 SMP Thu May 28 18:54:18 UTC 2026 aarch64
User : root ( 0)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/wp-content/plugins/custom-twitter-feeds/inc/Admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/wp-content/plugins/custom-twitter-feeds/inc/Admin/CTF_Cache_Handler.php
<?php

namespace TwitterFeed\Admin;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
 * Custom Twitter Feed Cache Handler.
 *
 * @since 2.0
 */
class CTF_Cache_Handler {

	/**
	 * Clears all cache.
	 *
	 * @return void
	 */
	public function clear_all_cache() {
		$this->clear_db_caches();
		$this->clear_third_party_caches();
	}

	/**
	 * Clear the stored caches from the database.
	 *
	 * @since 2.0
	 */
	public function clear_db_caches() {
		global $wpdb;

		$cache_table_name = $wpdb->prefix . 'ctf_feed_caches';

		$sql = "UPDATE $cache_table_name
				SET cache_value = ''
				WHERE cache_key NOT LIKE 'ctf_!_%';";

		$wpdb->query( $sql );

		$sql = "DELETE FROM $cache_table_name
				WHERE feed_id LIKE '%_CUSTOMIZER';";

		$wpdb->query( $sql );

		$this->clear_legacy_caches();
	}

	public function clear_single_feed_cache( $feed_id ) {
		global $wpdb;

		$cache_table_name = $wpdb->prefix . 'ctf_feed_caches';

		$wpdb->query( $wpdb->prepare(
			"UPDATE $cache_table_name
				SET cache_value = ''
				WHERE cache_key NOT LIKE 'ctf_!_%'
				AND feed_id = %s;", $feed_id
		) );

		$wpdb->query( $wpdb->prepare(
			"UPDATE $cache_table_name
				SET cache_value = ''
				WHERE cache_key NOT LIKE 'ctf_!_%'
				AND feed_id = %s;", $feed_id . '_CUSTOMIZER'
		) );

		$wpdb->query( $wpdb->prepare(
			"UPDATE $cache_table_name
				SET last_updated = '2000-04-04 00:00:00'
				WHERE cache_key NOT LIKE 'ctf_!_%'
				AND feed_id = %s;", $feed_id . '_CUSTOMIZER'
		) );

		$wpdb->query( $wpdb->prepare(
			"UPDATE $cache_table_name
				SET last_updated = '2000-04-04 00:00:00'
				WHERE cache_key NOT LIKE 'ctf_!_%'
				AND feed_id = %s;", $feed_id
		) );
	}

	public function clear_legacy_caches() {
		global $wpdb;

		$cache_table_name = $wpdb->prefix . 'ctf_feed_caches';

		$sql = "UPDATE $cache_table_name
				SET cache_value = ''
				WHERE feed_id = 'legacy';";

		$wpdb->query( $sql );

		global $wpdb;

		//Delete all CTF transients
		$table_name = $wpdb->prefix . "options";
		$wpdb->query( "
                    DELETE
                    FROM $table_name
                    WHERE `option_name` LIKE ('%\_transient\_ctf\_%')
                    " );
		$wpdb->query( "
                    DELETE
                    FROM $table_name
                    WHERE `option_name` LIKE ('%\_transient\_timeout\_ctf\_%')
                    " );
		$wpdb->query( "
			        DELETE
			        FROM $table_name
			        WHERE `option_name` LIKE ('%\_transient\_&ctf\_%')
			        " );
		$wpdb->query( "
			        DELETE
			        FROM $table_name
			        WHERE `option_name` LIKE ('%\_transient\_timeout\_&ctf\_%')
			        " );
		$wpdb->query( "
                    DELETE
                    FROM $table_name
                    WHERE `option_name` LIKE ('%\_transient\_\$ctf\_%')
                    " );
		$wpdb->query( "
                    DELETE
                    FROM $table_name
                    WHERE `option_name` LIKE ('%\_transient\_timeout\_\$ctf\_%')
                    " );
	}

	/**
	 * Clears the third party cache.
	 *
	 * When certain events occur, page caches need to
	 * clear or errors occur or changes will not be seen
	 *
	 * @since 2.0
	 */
	public function clear_third_party_caches() {
		/**
		 * Filters whether to clear page caches.
		 *
		 * @since 2.0
		 *
		 * @param bool Whether to clear cache.
		 */
		$clear_page_caches = apply_filters( 'ctf_clear_page_caches', true );

		if ( ! $clear_page_caches ) {
			return;
		}

		// Clear WP Fastest Cache.
		if ( isset( $GLOBALS['wp_fastest_cache'] ) && method_exists( $GLOBALS['wp_fastest_cache'], 'deleteCache' ) ){
			$GLOBALS['wp_fastest_cache']->deleteCache();
		}

		// Clear WP Super Cache
		if ( function_exists( 'wp_cache_clear_cache' ) ) {
			wp_cache_clear_cache();
		}

		// Clear W3 Total Cache.
		if ( class_exists('W3_Plugin_TotalCacheAdmin') && function_exists( 'w3_instance' ) ) {
			$plugin_total_cache_admin = &w3_instance('W3_Plugin_TotalCacheAdmin');

			$plugin_total_cache_admin->flush_all();
		}

		// Clear WP Rocket cache.
		if ( function_exists( 'rocket_clean_domain' ) ) {
			rocket_clean_domain();
		}
	}

	/**
	 * Clear the stored caches from the database.
	 *
	 * @since 2.0
	 */
	public function clear_persistent_cache() {
		global $wpdb;

		$cache_table_name = $wpdb->prefix . 'ctf_feed_caches';

		$sql = "UPDATE $cache_table_name
				SET cache_value = ''";
		$wpdb->query( $sql );
	}


}

Youez - 2016 - github.com/yon3zu
LinuXploit