File: //proc/self/root/proc/thread-self/root/proc/thread-self/root/home/coopserp/www/speedycache.zip
PK 9+l\���� � speedycache.phpnu �[��� <?php
/*
Plugin Name: SpeedyCache
Plugin URI: https://speedycache.com
Description: SpeedyCache is a plugin that helps you reduce the load time of your website by means of caching, minification, and compression of your website.
Version: 1.3.7
Author: Softaculous Team
Author URI: https://speedycache.com/
Text Domain: speedycache
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
// We need the ABSPATH
if (!defined('ABSPATH')) exit;
if(!function_exists('add_action')){
echo 'You are not allowed to access this page directly.';
exit;
}
$_tmp_plugins = get_option('active_plugins', []);
// Is the premium plugin loaded ?
if(!defined('SITEPAD') && in_array('speedycache-pro/speedycache-pro.php', $_tmp_plugins) ){
$speedycache_pro_info = get_option('speedycache_pro_version');
if(!empty($speedycache_pro_info) && version_compare($speedycache_pro_info, '1.1.1', '>=')){
// Let SpeedyCache load
// Lets check for older versions
}else{
if(!function_exists('get_plugin_data')){
include_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$speedycache_pro_info = get_plugin_data(WP_PLUGIN_DIR . '/speedycache-pro/speedycache-pro.php');
if(
!empty($speedycache_pro_info) &&
version_compare($speedycache_pro_info['Version'], '1.1.1', '<')
){
return;
}
}
}
// If SPEEDYCACHE_VERSION exists then the plugin is loaded already !
if(defined('SPEEDYCACHE_VERSION')) {
return;
}
define('SPEEDYCACHE_VERSION', '1.3.7');
define('SPEEDYCACHE_DIR', dirname(__FILE__));
define('SPEEDYCACHE_FILE', __FILE__);
define('SPEEDYCACHE_BASE', plugin_basename(SPEEDYCACHE_FILE));
define('SPEEDYCACHE_URL', plugins_url('', __FILE__));
define('SPEEDYCACHE_BASE_NAME', basename(SPEEDYCACHE_DIR));
define('SPEEDYCACHE_WP_CONTENT_DIR', defined('SITEPAD') ? 'sitepad-data' : (defined('WP_CONTENT_FOLDERNAME') ? WP_CONTENT_FOLDERNAME : 'wp-content'));
define('SPEEDYCACHE_CACHE_DIR', WP_CONTENT_DIR . '/cache/speedycache');
define('SPEEDYCACHE_WP_CONTENT_URL', content_url());
define('SPEEDYCACHE_CONFIG_DIR', WP_CONTENT_DIR . '/speedycache-config');
define('SPEEDYCACHE_CACHE_URL', content_url('/cache/speedycache'));
define('SPEEDYCACHE_DEV', file_exists(SPEEDYCACHE_DIR.'/DEV.php'));
if(SPEEDYCACHE_DEV){
include_once SPEEDYCACHE_DIR .'/DEV.php';
}
if(!defined('SPEEDYCACHE_API')){
define('SPEEDYCACHE_API', 'https://api.speedycache.com/');
}
function speedycache_autoloader($class){
if(!preg_match('/^SpeedyCache\\\(.*)/is', $class, $m)){
return;
}
$m[1] = str_replace('\\', '/', $m[1]);
if(strpos($class, 'SpeedyCache\lib') === 0){
if(file_exists(SPEEDYCACHE_DIR.'/'.$m[1].'.php')){
include_once(SPEEDYCACHE_DIR.'/'.$m[1].'.php');
}
}
// For Free
if(file_exists(SPEEDYCACHE_DIR.'/main/'.strtolower($m[1]).'.php')){
include_once(SPEEDYCACHE_DIR.'/main/'.strtolower($m[1]).'.php');
}
// For Pro
if(defined('SPEEDYCACHE_PRO_DIR') && file_exists(SPEEDYCACHE_PRO_DIR.'/main/'.strtolower($m[1]).'.php')){
include_once(SPEEDYCACHE_PRO_DIR.'/main/'.strtolower($m[1]).'.php');
}
}
spl_autoload_register(__NAMESPACE__.'\speedycache_autoloader');
if(!class_exists('SpeedyCache')){
#[\AllowDynamicProperties]
class SpeedyCache{}
}
register_activation_hook(__FILE__, '\SpeedyCache\Install::activate');
register_deactivation_hook(__FILE__, '\SpeedyCache\Install::deactivate');
register_uninstall_hook(__FILE__, '\SpeedyCache\Install::uninstall');
add_action('plugins_loaded', 'speedycache_load_plugin');
function speedycache_load_plugin(){
global $speedycache;
if(empty($speedycache)){
$speedycache = new SpeedyCache();
}
speedycache_update_check();
if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE){
return;
}
// This file is just to handle deprecation.
include_once __DIR__ . '/functions.php';
$speedycache->options = get_option('speedycache_options', []);
$speedycache->settings['noscript'] = '';
$speedycache->cdn = get_option('speedycache_cdn', []);
$speedycache->settings['cdn'] = $speedycache->cdn;
$speedycache->image['settings'] = get_option('speedycache_img', []);
$speedycache->object = get_option('speedycache_object_cache', ['admin' => true, 'persistent' => true]);
$speedycache->bloat = get_option('speedycache_bloat', []);
if(!is_dir(SPEEDYCACHE_CACHE_DIR) && is_writable(WP_CONTENT_DIR)){
if(mkdir(SPEEDYCACHE_CACHE_DIR, 0755, true)){
touch(SPEEDYCACHE_CACHE_DIR .'/index.html');
}
}
// Creating config folder if it dosent exists
if(!is_dir(SPEEDYCACHE_CONFIG_DIR) && is_writable(WP_CONTENT_DIR)){
if(mkdir(SPEEDYCACHE_CONFIG_DIR, 0755, true)){
touch(SPEEDYCACHE_CONFIG_DIR .'/index.html');
}
}
add_action('cron_schedules', '\SpeedyCache\Util::custom_cron');
if(wp_doing_ajax() && !empty($_REQUEST['action']) && strpos($_REQUEST['action'], 'speedycache') === 0){
\SpeedyCache\Ajax::hooks();
return; // we don't want to process anything else if it is Ajax
}
// NOTE:: If actions or code which are required to run on both admin and front grows then move that to a seperate file and keep this file small.
add_action('speedycache_purge_cache', '\SpeedyCache\Delete::expired_cache'); // Schedule action for cache lifespan
add_action('cron_schedules', '\SpeedyCache\Util::custom_expiry_cron');
add_action('cron_schedules', '\SpeedyCache\Util::custom_preload_cron');
add_action('init', '\SpeedyCache\Util::lifespan_cron');
add_action('init', '\SpeedyCache\Util::preload_cron');
add_action('speedycache_preload_split', '\SpeedyCache\Preload::cache');
add_action('speedycache_preload', '\SpeedyCache\Preload::build_preload_list');
add_action('after_switch_theme', '\SpeedyCache\Delete::run'); // Deletes cache when Theme changes
add_action('wp_update_nav_menu', '\SpeedyCache\Delete::run'); // Deletes cache when Menu is saved
add_action('transition_post_status', '\SpeedyCache\Delete::on_status_change', 10, 3);
add_action('transition_comment_status', '\SpeedyCache\Delete::on_comment_status', 10, 3);
add_action('admin_bar_menu', '\SpeedyCache\Admin::admin_bar', PHP_INT_MAX);
add_action('woocommerce_order_status_changed', '\SpeedyCache\Delete::order');
if(!empty($speedycache->options['status']) && !empty($speedycache->cdn['enabled']) && !empty($speedycache->cdn['cdn_url'])){
add_action('wp_head','\SpeedyCache\CDN::cdn_preconnect', 5);
}
if(!empty($speedycache->options['speculation_loading'])){
add_filter('wp_speculation_rules_configuration', 'speedycache_speculation_rules_config');
}
if(class_exists('\SpeedyCache\Bloat') && !empty($speedycache->bloat)){
\SpeedyCache\Bloat::actions();
}
if(!is_admin()){
\SpeedyCache\Cache::init();
return;
}
\SpeedyCache\Admin::hooks();
}
// Looks if SpeedyCache just got updated
function speedycache_update_check(){
$current_version = get_option('speedycache_version');
$version = (int) str_replace('.', '', $current_version);
// No update required
if($current_version == SPEEDYCACHE_VERSION){
return true;
}
// Is it first run ?
if(empty($current_version)){
\SpeedyCache\Install::activate();
return;
}
if(version_compare($current_version, '1.2.0', '<')){
// Cleaning the cache because we have a new way
if(file_exists(SPEEDYCACHE_CACHE_DIR)){
\SpeedyCache\Delete::rmdir(SPEEDYCACHE_CACHE_DIR);
}
\SpeedyCache\Install::activate();
\SpeedyCache\Util::set_config_file();
}
// TODO: Remove when the version above 1.2.7 is 90% in adoption.
if(version_compare($current_version, '1.2.8', '<')){
$options = get_option('speedycache_options', []);
$options['logged_in_user'] = false;
update_option('speedycache_options', $options);
}
// Save the new Version
update_option('speedycache_version', SPEEDYCACHE_VERSION);
}PK @+l\�>r�vg vg assets/css/admin.cssnu �[��� :root {
--speedycache-color: #3d5afe;
--speedycache-txcolor: #0f172a;
--speedycache-red: #dc3545;
--speedycache-promo-primary: #6366f1;
--speedycache-promo-primary-dark: #4f46e5;
--speedycache-promo-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
--speedycache-promo-bg-surface: #ffffff;
--speedycache-promo-text-main: #1f2937;
--speedycache-promo-text-muted: #6b7280;
}
#speedycache-admin{
display:flex;
flex-direction:row;
margin-top: 20px;
color: var(--speedycache-txcolor);
}
#speedycache-navigation{
display:flex;
flex-direction:column;
flex:0 0 200px;
padding: 10px;
margin-right:10px;
}
#speedycache-admin *{
box-sizing:border-box;
}
.speedycache-tabs{
display:flex;
flex-direction:column;
flex: 1 1 auto;
max-width: 960px;
}
.speedycache-tab{
position:relative;
display:none;
flex-direction: column;
background-color:white;
color: #0F172A;
border-radius: 8px;
padding: 20px 25px;
box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;
}
.speedycache-disabled{
position:relative;
}
.speedycache-disabled::after{
position:absolute;
height:100%;
width:100%;
top:0;
left:0;
background: rgba(0, 0, 0, 0.3);
}
.speedycache-tab svg{
color:#0F172A;
}
.speedycache-tab h2{
display: flex;
align-items: center;
gap:10px;
padding: 0 0 15px 0;
border-bottom: 1px solid #e0e0e0;
font-size:1.3rem;
line-height:2rem;
}
.speedycache-tab h3{
display: flex;
align-items: center;
gap:10px;
padding: 0 0 15px 0;
border-bottom: 1px solid #e0e0e0;
}
.speedycache-tab h4{
font-size:1rem;
margin: 0;
padding: 0;
}
.speedycache-logo{
text-align:center;
padding: 20px 0;
}
.speedycache-logo span{
display:inline-block;
color: #6b6b6b;
}
#speedycache-navigation li a {
display:flex;
align-items: center;
gap:10px;
color: black;
padding: 10px;
text-decoration:none;
font-size: 16px;
font-weight:500;
border-radius:5px;
cursor:pointer;
border: 1px solid transparent;
}
#speedycache-navigation li a:hover{
background-color: #2ca5eb22;
border: 1px solid #106fa5;
}
#speedycache-navigation li a:focus{
outline: none;
background-color: #2ca5eb22;
border: 1px solid #106fa5;
box-shadow:none;
}
#speedycache-navigation li a.speedycache-nav-selected:not(:focus){
background-color: #2ca5eb22;
border: 1px solid #106fa5;
}
.speedycache-sidebar{
display:flex;
flex-direction:column;
flex: 0 0 250px;
padding: 0 10px 10px 10px;
margin-left: 10px;
}
.speedycache-need-help{
display:flex;
flex-direction:column;
word-wrap:wrap;
border-radius: 20px;
padding: 5px;
background-color:#FFF;
}
.speedycache-quick-links{
background-color:#f1f1f191;
border-radius: 15px;
padding: 10px;
}
.speedycache-quick-access-item{
display:flex;
gap:10px;
align-items:center;
padding: 7px 4px;
}
.speedycache-quick-access-item a{
text-decoration:none;
color: #000;
}
.speedycache-need-help p{
font-size:0.8rem;
font-weight:500;
line-height:1rem;
text-align:center;
margin: 0 0 4px 0;
color:#000;
}
.speedycache-admin-row{
display:flex;
gap: 10px;
margin-bottom: 20px;
}
.speedycache-admin-row .speedycache-is-block{
border: 1px solid #E2E8F0;
padding: 10px;
width: 100%;
border-radius:1px;
}
.speedycache-perf-score{
flex: 0 0 60%;
}
.speedycache-dashboard-info{
display:flex;
flex-direction:column;
gap: 8px;
width:100%;
}
.speedycache-dashboard-info > div{
display:flex;
flex-direction:column;
gap: 6px;
}
.speedycache-dashboard-info > div > h4{
display:flex;
align-items:center;
gap:5px;
margin-bottom:9px;
}
.speedycache-perf-score-meter{
display:flex;
flex-direction: column;
width:50%;
}
.speedycache-perf-score-meter-heading{
display: flex;
align-items: center;
gap:10px;
}
#speedycache-analyze{
display:inline-flex;
font-size: 12px;
font-weight:400;
color: blue;
cursor:pointer;
}
.speedycache-perf-score-donut{
display: flex;
justify-content: center;
}
.speedycache-perf-score-guide{
display:flex;
justify-content: space-evenly;
font-size: 12px;
}
.speedycache-perf-score-guide span{
display: inline-block;
height: 10px;
width: 10px;
border-radius: 50px;
background-color: red;
}
/* CSS for Single option starts here */
div.speedycache-option-wrap{
display:flex;
flex-direction:row;
align-items:center;
column-gap: 13px;
margin: 4px 0 4px 0;
padding-top: 5px;
line-height: 18px;
}
.speedycache-option-info > span {
display:block;
}
.speedycache-option-info span.speedycache-option-desc {
font-size: 0.85rem;
line-height: 1.5rem;
color: #6b6b6b;
}
.speedycache-option-info .speedycache-option-name {
font-weight: 600;
color: #212529de;
font-size: 1rem;
line-height:1.5rem;
}
.speedycache-stacked-option-wrap{
display:flex;
flex-direction:column;
gap: 5px;
margin: 10px 0 4px 0;
padding-top: 5px;
line-height: 18px;
}
.speedycache-custom-checkbox {
display:inline-block;
width:40px;
height:22px;
position:relative;
flex-shrink: 0;
}
.speedycache-custom-checkbox input {
display:none;
}
.speedycache-input-slider {
background-color: #ccc;
bottom: 0;
cursor: pointer;
left: 0;
position: absolute;
right: 0;
top: 0;
transition: background-color .4s;
border-radius: 4px;
width:40px;
}
.speedycache-input-slider:before {
content: "";
background-color: #fff;
top:50%;
transform: translateY(-50%);
height: 15px;
left: 4px;
position: absolute;
transition: transform .4s;
width: 15px;
border-radius:4px;
}
input:checked + .speedycache-input-slider {
background-color: var(--speedycache-color);
}
input:checked + .speedycache-input-slider:before {
transform: translate(18px, -50%);
}
/* CSS for Single option ends here */
/* Components */
/* Buttons */
.speedycache-button{
display: inline-flex;
outline: 0;
text-align: center;
cursor: pointer;
padding: 8px 13px;
border-radius: 3px;
border: 1px solid transparent;
transition: background .3s ease, border-color .3s ease;
font-weight: 600;
text-transform: uppercase;
font-size: 11px;
text-decoration: none;
gap: 8px;
align-items:center;
justify-content:center;
}
.speedycache-btn-black{
background: var(--speedycache-txcolor);
border-color: var(--speedycache-txcolor);
color: #fff;
}
.speedycache-btn-black:hover{
background: #e4461b;
border-color: #e4461b;
}
.speedycache-btn-transparent{
background-color:transparent;
color: currentcolor;
}
.speedycache-btn-transparent:active{
outline:0;
}
.speedycache-100{
width:100%;
}
.speedycache-delay-suggestions{
position: absolute;
top: 12px;
right: 40px;
background: var(--speedycache-color);
color: #fff;
border: none;
border-radius: 7px;
box-shadow: 1px 0 5px 0 #ccc;
padding: 8px 20px;
font-weight: bold;
cursor: pointer;
display: flex;
align-items: center;
gap: 10px;
}
/*Modal Classes start here*/
.speedycache-modal{
display:flex !important;
visibility:hidden;
justify-content:center;
align-items:center;
position:fixed;
top:0;
left:0;
width: 100%;
height: 100% !important;
z-index:99999;
background-color: #00000040 !important; /*hexa decimal opacity used here*/
backdrop-filter: blur(2px);
}
.speedycache-close-modal {
cursor: pointer;
}
.speedycache-modal-wrap{
padding: 6px;
height: auto;
width: 440px;
z-index: 10001;
background-color:#FFF;
/* box-shadow: 0 0 8px 0 #ccc; */
box-shadow: 0 3px 10px 2px rgba(0 0 0 / 30%);
transition: height 1s ease-in;
border-radius: 6px;
}
.speedycache-modal-wrap * {
box-sizing:border-box;
}
.speedycache-modal-header {
color: #000;
font-weight:bold;
display:flex;
justify-content: space-between;
align-items:center;
padding:15px;
border-radius: 3px 3px 0 0;
border-bottom: 1px dashed #ccc;
}
.speedycache-modal-header > * {
font-size:20px !important;
}
.speedycache-modal-content{
padding:10px;
background-color: #FFF;
overflow-y:auto;
max-height: 75vh;
background: /* Shadow covers */
linear-gradient(white 30%, rgba(255, 255, 255, 0)), linear-gradient(rgba(255, 255, 255, 0), white 70%) 0 100%, /* Shadows */
radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 0 100%;
background-repeat: no-repeat;
background-color: white;
background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
background-attachment: local, local, scroll, scroll;
}
.speedycache-modal-content .speedycache-form-input {
display:flex;
justify-content:space-between;
width:100%;
margin:7px 0;
float: none !important;
}
.speedycache-modal-content .speedycache-modal-block {
padding: 15px;
border-bottom: 1px dashed #ccc;
}
.speedycache-modal-content .speedycache-modal-block:first-child {
padding-top: 5px;
}
.speedycache-modal-content .speedycache-modal-block:last-of-type {
border:none;
padding-bottom:0;
}
.speedycache-modal-footer{
background-color: #FFF;
padding:10px;
display:flex;
width:100%;
justify-content:center;
}
.speedycache-modal-footer > button {
outline:none;
border:none;
background-color:#24b974;
color: #FFF;
border-radius:3px;
box-shadow: 1px 0 5px 0 #ccc;
padding: 8px 20px;
font-weight:bold;
cursor:pointer;
}
.speedycache-info-modal {
margin: 10px;
}
.speedycache-info-modal p{
/* color:#666; */
background-color: #f2f2f2;
padding: 10px;
border-radius: 6px;
font-family: monospace;
}
.speedycache-modal-highlight {
background-color: #e4dcdc;
border-radius: 6px;
padding: 10px;
}
.speedycache-modal-scripts{
display: block;
max-height: 100px;
overflow-y: auto;
}
/*Ends Modal Classes*/
.speedycache-db-row{
display:flex;
width: 100%;
justify-content:space-between;
padding: 10px 7px;
align-items:center;
}
.speedycache-db-row > div{
display:flex;
align-items:center;
gap:4px;
padding: 5px 0;
}
.speedycache-db-info{
display:flex;
flex-direction:column;
gap:4px;
}
.speedycache-db-info > div:first-child{
font-weight: 600;
font-size: 1rem;
line-height: 1.5rem;
}
.speedycache-db-info > div:last-child{
font-size: 0.85rem;
line-height: 1.5rem;
color: #6b6b6b;
font-style: italic;
}
.speedycache-db-row:not(:last-child){
border-bottom: 1px solid #e0e0e0;
}
.speedycache-save-settings-wrapper{
position:sticky;
bottom:0px;
background-color:white;
padding:15px 10px;
border-top:1px solid #e2e2e2;
margin-top:30px;
}
.speedycache-spinner{
display:none;
border: 2px solid #dddcdc80;
border-left-color: #e3e3e3;
height: 15px;
width: 15px;
border-radius:50%;
animation: speedycache-spinner 1s linear infinite;
}
.speedycache-spinner-active{
display:inline-block;
}
.speedycache-spinner-done{
display:none;
}
.speedycache-spinner-done-active{
display:inline-block;
}
@keyframes speedycache-spinner{
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.speedycache-table-actions{
display:flex;
justify-content:space-between;
}
.speedycache-table{
width:100%;
margin-top:10px;
}
.speedycache-table > table{
width:100%;
border-collapse: collapse;
}
.speedycache-table thead tr {
}
.speedycache-table thead th {
border-bottom: 1px solid #595b5e;
text-align:left;
}
.speedycache-table th,
.speedycache-table td {
padding: 16px;
border-bottom: 1px solid rgb(228, 228, 231);
}
.speedycache-table tr:hover{
background-color: rgba(244, 244, 245, 0.5)
}
.speedycache-radio-input{
display:flex;
justify-content:center;
align-items:center;
gap:10px;
width:100%;
}
.speedycache-radio-input label{
padding:8px 10px;
border:2px solid var(--speedycache-color);
border-radius:7px;
font-weight:500;
}
.speedycache-radio-input label:hover{
box-shadow: 0 0 0 0.1rem rgba(61, 90, 254, 0.4);
}
#speedycache_delayjs_selected,
#speedycache_delayjs_all{
display:none;
}
#speedycache_delayjs_selected:checked ~ div.speedycache-radio-input > label[for="speedycache_delayjs_selected"],
#speedycache_delayjs_all:checked ~ div.speedycache-radio-input > label[for="speedycache_delayjs_all"]{
box-shadow: 0 0 0 0.20rem rgba(61, 90, 254, 0.4);
}
.speedycache-delay_js_list label{
display:none;
font-weight:500;
margin:10px 0 3px 0;
}
.speedycache-delay_js_list textarea,
.speedycache-unusedcss-excludes textarea{
width: 100%;
}
#speedycache_delayjs_selected:checked ~ div.speedycache-delay_js_list > label[for="speedycache_delay_js_scripts"],
#speedycache_delayjs_all:checked ~ div.speedycache-delay_js_list > label[for="speedycache_delay_js_excludes"]{
display:block;
}
#speedycache_unusedcss_async,
#speedycache_unusedcss_interaction,
#speedycache_unusedcss_remove{
display:none;
}
#speedycache_unusedcss_async:checked ~ div.speedycache-radio-input > label[for="speedycache_unusedcss_async"],
#speedycache_unusedcss_interaction:checked ~ div.speedycache-radio-input > label[for="speedycache_unusedcss_interaction"],
#speedycache_unusedcss_remove:checked ~ div.speedycache-radio-input > label[for="speedycache_unusedcss_remove"]{
box-shadow: 0 0 0 0.20rem rgba(61, 90, 254, 0.4);
}
.speedycache-exclude-btn-wrap{
margin-top:2.2rem;
}
.speedycache-input-wrap{
display:flex;
justify-content:space-between;
align-items:center;
gap: 10px;
margin-bottom: 15px;
}
.speedycache-info-modal .speedycache-input-wrap select,
.speedycache-info-modal .speedycache-input-wrap input{
max-width: 60%;
}
.speedycache-modal-settings-link,
.speedycache-action-link{
font-size:0.75rem;
color: var(--speedycache-color);
cursor: pointer;
}
.speedycache-premium-tag{
position:relative;
display:inline-block;
font-size: 12px;
margin-left: 10px;
padding: 0 8px;
border-radius: 3px;
background-color: gold;
}
.speedycache-premium-tag::before {
content: '';
display: inline-block;
position: absolute;
background: rgba(255, 255, 255, 0.5);
width: 10px;
height: 100%;
top: 0;
left:0;
filter:blur(3px);
transform: skewX(-15deg);
animation: speedycache-shine 2s ease-in-out infinite;
}
@keyframes speedycache-shine {
0% {
opacity: 0.5;
left: 60px;
transition-property: opacity, left;
},
100% {
opacity: 0.6;
left: 50px;
transition-property: opacity, left;
}
}
/* Terminal CSS Here */
.speedycache-logs{
background: #22212c;
box-shadow: 0 22px 70px 4px rgba(0, 0, 0, 0.46);
width: 100%;
border-radius: 6px;
color:#fff;
}
.speedycache-logs-header{
height: 40px;
background: #191a22;
border-radius: 6px 6px 0px 0px;
display: flex;
align-items: center;
justify-content:center;
padding: 0px 14px;
position: relative;
text-align:center;
font-weight:500;
}
.speedycache-logs-content{
padding: 20px;
min-height: 30vh;
border-radius: 6px 6px 0px 0px;
max-height: 50vh;
overflow-y: scroll;
}
.speedycache-hidden{
display:none;
}
.speedycache-logs-row{
padding: 5px 0;
font-family:monospace;
}
.speedycache-stat-status{
display:inline-flex;
align-items:center;
justify-content:center;
padding: 3px 10px;
margin-top:10px;
border-radius: 50px;
border:1px solid #e2e2e2;
line-height: 1.3;
}
.speedycache-stats-block{
position:relative;
overflow:hidden;
}
.speedycache-stats-block img{
position: absolute;
width: 80px;
top: 0px;
right: -12px;
transform: rotate(40deg);
opacity: 0.1;
}
.speedycache-stats-name{
margin-bottom:5px;
font-weight:500;
}
.speedycache-stat-status-indicator{
border-radius:50%;
width: 12px;
height:12px;
background-color: #e2e2e2;
margin-right: 10px;
}
.speedycache-stats-number{
font-size:2.5rem;
line-height:3.2rem;
}
.speedycache-object-stat{
display:flex;
flex-direction:column;
max-width: 350px;
gap: 5px;
}
.speedycache-flush-db{
margin-top:10px;
width: 40%;
display:flex;
gap:10px;
align-items:center;
}
.speedycache-img-stat-info {
display: flex;
flex-wrap:wrap;
align-items:top;
justify-content:flex-end;
}
.speedycache-img-main-stat {
display:flex;
flex-direction:column;
justify-content: flex-start;
align-items: center;
flex-grow: 1;
flex-basis: calc(100% / 3);
padding: 5px;
min-width: 85px;
max-width: 100px;
font-size:0.9rem;
border-right: 1px dashed #ccc;
}
.speedycache-img-main-stat:last-child{
border-right: none;
}
.speedycache-img-main-stat span {
font-size: 1.1rem;
padding-top:4px;
font-weight: bold;
}
.speedycache-img-optimize-all {
margin-top: 30px;
align-items:flex-end;
}
.speedycache-optm-close {
display : flex;
justify-content : center;
margin-top: 10px;
gap:5px;
}
.speedycache-optm-close button{
padding: 7px 20px;
font-weight: bold;
}
.speedycache-disabled-methods > *:not(.speedycache-more-info, .speedycache-img-method-actions){
opacity:0.5;
cursor: not-allowed;
}
.speedycache-img-remain-optm{
margin-left:auto;
display:flex;
align-items: center;
vertical-align: middle;
font-weight: 500;
}
.speedycache_img_optm_status{
height: 15px;
width: 15px;
margin-right: 5px;
border-radius: 50%;
display: inline-block;
}
.speedycache-img-delete-all-conv {
margin-left:5px;
}
.speedycache-img-start-optm{
display:flex;
flex-direction:column;
justify-content: space-around;
align-items:center;
height:100%;
}
.speedycache-img-opt-stat {
display:flex;
flex-direction:column;
justify-content:center;
align-items:center;
width:100%;
}
.speedycache-img-optm-count {
font-size:3.3rem !important;
font-weight:400;
line-height:1.4;
}
.speedycache-img-optm-count-text{
font-size:1rem;
line-height:1.2;
padding:20px;
text-align:center;
}
.speedycache-img-reduced-size{
color:var(--speedycache-color);
font-weight:bold;
font-size:1rem;
}
.speedycache-img-optm-close{
display:none;
}
.speedycache-tooltip {
position:absolute;
top:-50px;
background-color: rgba(0, 0, 0, 0.9);
color: #FFF;
padding: 5px;
border-radius: 3px;
}
.speedycache-already-optm{
text-align:center;
margin : 30px;
}
.speedycache-already-optm i {
font-size: 5em;
color: var(--speedycache-color);
}
.speedycache-already-optm span {
font-size:1.5rem;
font-weight: 500;
display: block;
margin-top: 10px;
line-height: normal;
}
.speedycache-img-optm-counter {
font-size: 3.3rem;
line-height: 1.5;
text-align: center;
font-weight: bold;
}
.speedycache-scheduled-count {
position: relative;
color: var(--speedycache-color);
cursor: pointer;
}
.speedycache-scheduled-count-indicator::after {
content: '';
position: absolute;
height: 12px;
width: 12px;
margin-right: 5px;
border-radius: 50%;
display: inline-block;
top:8px;
right: -25px;
background: rgb(220,105,53);
background: radial-gradient(circle, rgba(220,105,53,1) 24%, rgba(242,242,242,0.89) 100%);
animation: speedycache-blink 2s ease-out 0s infinite;
}
@keyframes speedycache-blink {
0%{
opacity: 1;
},
25% {
opacity: 0.5;
}
50% {
opacity: 0.0;
}
}
.speedycache-table-item {
padding: 10px 5px;
text-align: left;
border-bottom: 1px dashed #ccc;
}
.speedycache-table-hitem{
border-bottom: 2px solid #ccc;
padding: 10px 5px;
text-align: left;
}
.speedycache-img-optm-error{
display:block;
text-align:center;
}
.speedycache-img-optm-error > i {
font-size: 5rem;
color: var(--speedycache-red);
}
.speedycache-img-optm-error > p {
font-size: 1.4rem;
font-weight: 500;
}
.speedycache-more-info{
position:relative;
cursor:pointer;
}
.speedycache-more-info:hover:before{
content: attr(data-info);
position: absolute;
bottom: 16px;
left:auto;
padding: 10px;
background-color: rgba(0 0 0 / 90%);
color: #FFF;
width: 170px;
border-radius:3px;
max-width: 200px;
}
.speedycache-img-method-actions{
display:block;
}
td div.speedycache-revert:before{
font-family: "dashicons";
content: "\f531";
}
td div.speedycache-revert{
width:30px;
height:28px;
vertical-align: middle;
margin: auto;
position:relative;
cursor:pointer;
border-radius: 3px 3px;
border:1px solid #aaa;
background:#ddd;
padding:3px;
background-color: white;
}
td div.speedycache-revert:hover{
border-color:#000;
background-color: white;
}
td div.speedycache-revert:active{
background-color: #F5F5F5;
}
#speedycache-revert-loader{
display: none;
background: rgba(255, 255, 255, .7) url(../images/loader.gif) no-repeat center;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 9998;
}
.speedycache-perf-extras{
display:flex;
flex-direction:column;
gap:5px;
font-size:14px;
justify-content:space-around;
width:50%;
}
.speedycache-perf-extras div {
display:flex;
justify-content:space-between;
align-items:center;
}
.speedycache-perf-extras div span{
margin-left: 10px;
padding: 6px;
border-radius: 2px;
background-color: #0c6;
color: white;
}
#speedycache-exact-time-selector{
display:flex;
flex-direction:column;
gap:5px;
margin-top:8px;
}
.speedycache-link-tooltip{
display:none;
position:absolute;
left:50%;
transform: translate(-50%, -50%);
background-color: white;
border-radius: 15px;
max-width: 300px;
width: 300px;
padding: 13px 18px;
z-index:20;
border: 1px solid rgb(0 0 0 / 5%);
box-shadow: 0 0 #0000, 0 0 #0000, 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
}
.speedycache-link-tooltip h4{
color:black;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.speedycache-link-tooltip p{
margin:5px 0 0 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.speedycache-tooltip-link{
position:relative;
margin: 0 2px;
}
.speedycache-deletion-roles{
display:flex;
flex-direction:row;
flex-wrap:wrap;
gap:15px;
max-width:500px;
}
.speedycache-stacked-label{
display:inline-flex;
margin:5px 5px 5px 0;
}
.speedycache-stacked-label label{
display:inline-flex;
flex-direction:column;
gap:2px;
}
.speedycache-promo-modern-card {
margin-top:20px;
background: var(--speedycache-promo-bg-surface);
border-radius: 8px;
padding: 24px;
/* Modern 'floating' shadow */
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
border: 1px solid rgba(0,0,0,0.05);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
max-width: 100%;
box-sizing: border-box;
position: relative;
overflow: hidden;
}
/* Subtle radial sheen in background */
.speedycache-promo-modern-card::before {
content: '';
position: absolute;
top: -50px;
right: -50px;
width: 150px;
height: 150px;
background: var(--speedycache-promo-gradient);
opacity: 0.1;
filter: blur(40px);
border-radius: 50%;
pointer-events: none;
}
.speedycache-promo-header-group {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
}
.speedycache-promo-title {
font-size: 18px;
font-weight: 700;
color: var(--speedycache-promo-text-main);
margin: 0;
letter-spacing: -0.025em;
}
.speedycache-promo-badge-pro {
background: var(--speedycache-promo-gradient);
color: #fff;
font-size: 10px;
font-weight: 800;
text-transform: uppercase;
padding: 4px 8px;
border-radius: 20px;
letter-spacing: 0.05em;
line-height: 1;
}
.speedycache-promo-desc {
font-size: 13px;
color: var(--speedycache-promo-text-muted);
margin: 0 0 20px 0;
line-height: 1.5;
}
.speedycache-promo-feature-list {
list-style: none;
padding: 0;
margin: 0 0 24px 0;
}
.speedycache-promo-feature-item {
display: flex;
align-items: center;
margin-bottom: 12px;
font-size: 14px;
color: var(--speedycache-promo-text-main);
font-weight: 500;
}
/* Custom Gradient Checkmark */
.speedycache-promo-check-circle {
width: 20px;
height: 20px;
border-radius: 50%;
background: rgba(99, 102, 241, 0.1); /* Low opacity brand color */
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
flex-shrink: 0;
}
.speedycache-promo-check-icon {
width: 10px;
height: 6px;
border-left: 2px solid var(--speedycache-promo-primary);
border-bottom: 2px solid var(--speedycache-promo-primary);
transform: rotate(-45deg);
margin-top: -2px;
}
.speedycache-promo-btn-main {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
padding: 12px;
background: var(--speedycache-promo-gradient);
color: #ffffff;
text-decoration: none;
border-radius: 8px;
font-weight: 600;
font-size: 14px;
transition: all 0.2s ease;
box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
border: none;
cursor: pointer;
}
.speedycache-promo-btn-main:hover {
transform: translateY(-1px);
box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
color: #ffffff;
}
.speedycache-promo-btn-main:active {
transform: translateY(0);
}
.speedycache-promo-btn-text {
margin-right: 6px;
}
/* Simple arrow animation on hover */
.speedycache-promo-arrow {
transition: transform 0.2s ease;
}
.speedycache-promo-btn-main:hover .speedycache-promo-arrow {
transform: translateX(3px);
}
/* TOOL TIP */
[spdf-hover-tooltip] {
position: relative;
color:black;
cursor: default;
}
[spdf-hover-tooltip]:hover::before {
content: attr(spdf-hover-tooltip);
font-size: 14px;
text-align: center;
position: absolute;
display: block;
left: 50%;
min-width: 150px;
max-width: 200px;
bottom: calc(100% + 10px);
transform: translate(-50%);
animation: fade-in 300ms ease;
background: #272727;
border-radius: 4px;
padding: 10px;
color: #ffffff;
z-index: 999999;
}
[spdf-hover-tooltip]:hover::after {
content: '';
position: absolute;
display: block;
left: 50%;
width: 0;
height: 0;
bottom: calc(100% + 6px);
margin-left: -3px;
border: 1px solid black;
border-color: #272727 transparent transparent transparent;
border-width: 4px 6px 0;
animation: spdf-fade-in 300ms ease;
z-index: 1;
}
[spdf-hover-tooltip][spdf-tooltip-position="bottom"]:hover::before {
bottom: auto;
top: calc(100% + 10px);
}
[spdf-hover-tooltip][spdf-tooltip-position="bottom"]:hover::after {
bottom: auto;
top: calc(100% + 6px);
border-color: transparent transparent #272727;
border-width: 0 6px 4px;
}
@keyframes spdf-fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* END Tooltip */
.speedycache-already-optm .dashicons{
width:100%;
}PK H+l\��l� � assets/js/admin.jsnu �[��� (function($){
window.addEventListener('DOMContentLoaded', function(){
speedycache_handle_tab();
window.addEventListener('hashchange', speedycache_handle_tab);
jQuery('.speedycache-save-settings-wrapper button, .speedycache-btn-spl-wrapper button').on('click', speedycache_save_settings);
jQuery('#speedycache-analyze').on('click', speedycache_analyze_speed);
jQuery('.speedycache-tooltip-link').on('mouseover', function(){
let jEle = jQuery(this),
tooltip = jEle.find('.speedycache-link-tooltip'),
elementHeight = Math.ceil(tooltip.outerHeight()/2);
tooltip.fadeIn('fast').css({
top: `-${elementHeight+10}px`, // Position it above the parent
});
});
jQuery('.speedycache-tooltip-link').on('mouseleave', function(){
let jEle = jQuery(this);
jEle.find('.speedycache-link-tooltip').hide();
});
// Delay JS
jQuery('#speedycache_delay_js').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
jQuery('#speedycache_purge_varnish').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
jQuery('#speedycache_critical_images').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
jQuery('#speedycache_lazy_load_html').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
jQuery('#speedycache_preload').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
jQuery('#speedycache_dns_prefetch').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
jQuery('#speedycache_speculative_loading').on('change',function(){
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
let instant_page = jQuery('#speedycache_instant_page');
if(instant_page && instant_page.is(':checked')){
instant_page.prop('checked', false);
alert('Instant page and Speculation loading are similar feature, so you should not use them together');
}
})
jQuery('#speedycache_preload_resources').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
jQuery('#speedycache_render_blocking').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
// Critical CSS Status
jQuery('#speedycache_critical_css').on('change', function(e) {
let prevent_open = true;
if(e.isTrigger){
prevent_open = false;
}
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this), prevent_open);
});
jQuery('#speedycache_pre_connect').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
jQuery('#speedycache_unused_css').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
jQuery('.speedycache-action-link').on('click', function(){
let action_name = jQuery(this).attr('action-name');
switch(action_name){
case 'speedycache_critical_css':
speedycache_critical_css();
break;
}
});
// Lazy Load
jQuery('#speedycache_lazy_load').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
jQuery('#speedycache_update_heartbeat').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
jQuery('#speedycache_limit_post_revision').on('change', function() {
if(!jQuery(this).is(':checked')){
speedycache_toggle_settings_link(jQuery(this));
return;
}
speedycache_toggle_settings_link(jQuery(this));
speedycache_open_modal(jQuery(this));
});
// Add Suggested Scripts
var $textarea = jQuery('#speedycache_delay_js_scripts');
jQuery('.speedycache-delay-suggestions').on('click', function(event) {
event.preventDefault();
if($textarea.length){
var $suggestions_text = jQuery('.speedycache-modal-scripts').text().trim().replace(/<br\s*\/?>/gi, '\n').replace(/\n\s+/g, '\n').replace(/\s+\n/g, '\n').replace(/\n+/g, '\n'),
current_text = $textarea.val().trim(),
new_text = current_text ? current_text + '\n' + $suggestions_text : $suggestions_text;
//Only add unique values
var unique_text = [...new Set(new_text.split('\n'))].join('\n');
$textarea.val(unique_text);
}
});
//Event Listener for Settings link for popup options
jQuery('.speedycache-modal-settings-link').off('click').on('click', function() {
var id = jQuery(this).attr('setting-id'),
input = jQuery('#'+id);
input.trigger('change');
});
// Add Excludes Btn
jQuery('#speedycache_add_excludes').on('click', function() {
speedycache_open_modal(jQuery(this));
});
jQuery('#speedycache-cdn-type').on('change', function(e){
let cdn_type = jQuery(e.target).val(),
cdn_key = jQuery('#speedycache-cdn-key').closest('.speedycache-stacked-option-wrap'),
cdn_url = jQuery('#speedycache-cdn-url').closest('.speedycache-stacked-option-wrap');
if(cdn_type == 'cloudflare'){
cdn_url.hide();
cdn_key.show();
return;
}else if(cdn_type == 'bunny'){
cdn_url.show();
cdn_key.show();
return;
}
// For other we only need to show the URL field
cdn_url.show();
cdn_key.hide();
return;
});
// Toggle exact time field of cache lifespan
jQuery('#speedycache-run-exact-time').on('click', function(e){
if(jQuery(this).is(':checked')){
jQuery('#speedycache-exact-time-selector').css('display', 'flex');
return;
}
jQuery('#speedycache-exact-time-selector').hide();
});
jQuery('#speedycache-ll-type').on('change', function(e){
let type = jQuery(e.target).val(),
custom_input = jQuery('#speedycache-custom-ll-url');
if(type == 'default'){
custom_input.hide();
return;
}
custom_input.show();
});
jQuery('#speedycache-import-export').on('change', function(e){
let task = jQuery(e.target).val(),
import_block = jQuery('.speedycache-import-block'),
export_block = jQuery('.speedycache-export-block');
if(task == 'import'){
import_block.show();
export_block.hide();
} else if(task == 'export'){
export_block.show();
import_block.hide();
}
})
jQuery('#speedycache-cdn-type').trigger('change');
jQuery('#speedycache-exclude-type').on('change', speedycache_update_excluded_options);
jQuery('#speedycache-exclude-rule-prefix').on('change', speedycache_update_excluded_prefix);
jQuery('.speedycache-exclude-btn-wrap button').on('click', speedycache_update_excludes);
jQuery('#speedycache-type-filter').on('change', speedycache_filter_exclude_type);
jQuery(document).on('click', '.speedycache-delete-rule', speedycache_delete_exclude_rule);
jQuery('.speedycache-db-optm-btn').on('click', speedycache_db_optm);
jQuery('.speedycache-preloading-add').on('click', speedycache_add_preload_resource);
jQuery('.speedycache-preloading-table').on('click', '.dashicons-trash', speedycache_delete_preload_resource);
jQuery('.speedycache-flush-db').on('click', speedycache_flush_objects);
jQuery('.speedycache-import-settings').on('click', speedycache_import_settings);
jQuery('.speedycache-export-settings').on('click', speedycache_export_settings);
jQuery('#speedycache-license-btn').on('click', speedycache_verify_license);
});
})(jQuery);
function speedycache_handle_tab(){
let hash = location.hash.trim().replace('#', ''),
nav = jQuery('#speedycache-navigation');
if(!hash.length){
let tab = jQuery('#speedycache-dashboard');
tab.siblings().hide();
tab.css('display', 'flex');
nav.find('.speedycache-nav-selected').removeClass('speedycache-nav-selected');
nav.find('a[href=\\#'+hash+']').addClass('speedycache-nav-selected')
return
}
let tab = jQuery('#speedycache-'+hash);
// Loading the stats for DB tab
if(hash == 'db' && typeof speedycache_pro_get_db_optm === 'function'){
speedycache_pro_get_db_optm();
}
// Loading the stats for image optm tab
if(hash == 'image' && !speedycache_ajax.load_img){
speedycache_ajax.load_img = true;
speedycache_image_optimization();
}
tab.siblings().hide();
tab.css('display', 'flex');
nav.find('.speedycache-nav-selected').removeClass('speedycache-nav-selected');
nav.find('a[href=\\#'+hash+']').addClass('speedycache-nav-selected')
}
function speedycache_save_settings(){
event.preventDefault();
let jEle = jQuery(event.target),
has_error = false;
jEle.find('span.speedycache-spinner').addClass('speedycache-spinner-active');
form_data = jEle.closest('form').serializeArray();
jQuery.ajax({
url : speedycache_ajax.url,
method : "POST",
data : form_data,
success: function(res){
if(res.success){
return;
}
has_error = true;
if(res.data){
alert(res.data);
}
alert("Something went wrong");
}
}).always(function(){
jEle.find('span.speedycache-spinner')?.removeClass('speedycache-spinner-active');
// Need to show a tick if the save was success
if(!has_error){
let check = jEle.find('svg.speedycache-spinner-done');
if(check){
check.addClass('speedycache-spinner-done-active');
setTimeout(() => {
check.removeClass('speedycache-spinner-done-active');
}, 2000);
}
}
});
}
function speedycache_filter_exclude_type(){
let jEle = jQuery(event.target),
list = jQuery('.speedycache-exclude-list'),
filter = jEle.val();
list.find('tbody tr').filter(function(){
jQuery(this).toggle(jQuery(this).find('td').eq(0).text().toLowerCase().indexOf(filter) > - 1);
});
}
function speedycache_delete_exclude_rule(){
event.preventDefault();
let jEle = jQuery(event.target),
tr = jEle.closest('tr'),
rule_id = tr.data('id')
jEle.find('span').addClass('speedycache-spinner-active');
jQuery.ajax({
url : speedycache_ajax.url,
method : "POST",
data : {
'_ajax_nonce' : speedycache_ajax.nonce,
'action' : 'speedycache_delete_exclude_rule',
'rule_id' : rule_id
},
success: function(res){
if(res.success){
tr.slideUp();
return;
}
if(res.data){
alert(res.data);
return;
}
alert('Something went wrong deleting the rule');
}
}).always(function(){
jEle.find('span').removeClass('speedycache-spinner-active');
});
}
function speedycache_toggle_settings_link(jEle) {
var wrap = jEle.closest('.speedycache-option-wrap'),
setting = wrap.find('.speedycache-modal-settings-link, .speedycache-action-link');
if(jEle.is(':checked')) {
setting.show();
return;
}
setting.hide();
}
function speedycache_open_modal(jEle, prevent_open) {
var id_attr = 'id';
if(prevent_open){
return;
}
if(jEle.attr('modal-id')) {
id_attr = 'modal-id'
}
//For Settings Link
if(jEle.attr('setting-id')) {
id_attr = 'setting-id';
}
var modal_id = jEle.attr(id_attr),
speedycache_modal = jQuery("div[modal-id='"+modal_id+"']");
if(speedycache_modal && speedycache_modal.css('visibility') === 'hidden') {
speedycache_modal.css('visibility','visible');
speedycache_close_modal();
}
}
function speedycache_update_excluded_options(){
let jEle = jQuery(event.target),
prefix = jQuery('#speedycache-exclude-rule-prefix'),
exclude_type = jEle.val();
prefix.val(""); // Resets to select value option
prefix.find('option').filter(function(){
jQuery(this).toggle(jQuery(this).data('partof').toLowerCase().indexOf(exclude_type) > - 1);
});
}
// Toggles content input of excludes settings
function speedycache_update_excluded_prefix(){
let jEle = jQuery(event.target),
val = jEle.val(),
content = jQuery('[for="speedycache-exclude-rule-content"]').closest('.speedycache-input-wrap');
if(val == 'contain' || val == 'exact' || val == 'startwith' || val == 'post_id' || val == 'shortcode'){
content.show();
content.find('textarea, input')?.remove();
let input = jQuery('<input>', {
type: 'text',
name: 'content',
id: 'speedycache-exclude-rule-content',
'class': 'speedycache-100',
});
content.append(input);
return;
}
content.hide();
}
function speedycache_update_excludes(){
event.preventDefault();
let jEle = jQuery(event.target),
form = jEle.closest('form');
jEle.find('span').addClass('speedycache-spinner-active');
form_data = form.serializeArray();
let prefix_field = form_data.find(field => field.name === 'prefix');
let content_field = form_data.find(field => field.name === 'content');
if (prefix_field && prefix_field.value === 'post_id' && content_field) {
if (!/^\d+(,\d+)*$/.test(content_field.value)) {
alert("Invalid format! Only numbers and commas are allowed, without starting, ending, or consecutive commas.");
jEle.find('span').removeClass('speedycache-spinner-active');
return;
}
}
jQuery.ajax({
url : speedycache_ajax.url,
method : "POST",
data : form_data,
success: function(res){
if(res.success){
form.trigger('reset');
jQuery('#speedycache-exclude-list').load(window.location.href + ' #speedycache-exclude-list');
return;
}
if(res.data){
alert(res.data);
return;
}
alert('Something went wrong saving the details');
}
}).always(function(){
jEle.find('span').removeClass('speedycache-spinner-active');
});
}
//Close SpeedyCache Modal
function speedycache_close_modal() {
jQuery('.speedycache-modal-footer > button, .speedycache-close-modal').on('click', function() {
//Remove duplicate entries when Submit or Close Button is clicked
var $textarea = jQuery(this).closest('.speedycache-modal').find('#speedycache_delay_js_scripts');
if ($textarea.length) {
var current_text = $textarea.val().trim();
var unique_text = [...new Set(current_text.split('\n'))].join('\n');
$textarea.val(unique_text);
}
jQuery(this).closest('.speedycache-modal').find('form').trigger('reset');
jQuery(this).closest('.speedycache-modal *').off();
jQuery(this).closest('.speedycache-modal').css('visibility','hidden');
});
}
function speedycache_analyze_speed(){
jEle = jQuery(event.target);
jEle.text('[Analysing...]');
jQuery.ajax({
url : speedycache_ajax.url,
method : 'GET',
data : {
security : speedycache_ajax.nonce,
action : 'speedycache_test_pagespeed',
},
success : function(res){
if(!res.data || !res.data['score']){
return
}
let donut = jQuery('.speedycache-perf-score-donut'),
tspan = donut.find('tspan'),
lowerCircle = donut.find('circle:first-child'),
strokeCircle = lowerCircle.next();
lowerCircle.attr('fill', res.data['color'][1]);
strokeCircle.css('stroke', res.data['color'][0]);
strokeCircle.attr('stroke-dasharray', res.data['score']+' '+(100 - res.data['score']));
tspan.text(res.data['score']); // Updated the score
tspan.css('fill', res.data['color'][2]);
}
}).always(function(){
jEle.text('[Updating results]');
setTimeout(() => {jEle.text('[Analyse]')}, 1000)
});
}
function speedycache_db_optm(){
event.preventDefault();
let proceed = confirm('Are you sure you want to proceed with this DB optimization action');
if(!proceed){
return;
}
let jEle = jQuery(event.target),
db_action = jEle.closest('.speedycache-db-row').attr('speedycache-db-name'),
spinner = jEle.find('.speedycache-spinner');
spinner.addClass('speedycache-spinner-active');
jQuery.ajax({
url : speedycache_ajax.url,
method : 'POST',
data : {
security : speedycache_ajax.nonce,
action : 'speedycache_optm_db',
db_action : db_action,
},
success: function(res){
if(res.success){
// TODO: make this update the UI too chaning the numbers.
return false;
}
if(res.message){
alert(res.message);
return;
}
alert("Something went wrong unable to optimize this option");
}
}).always(function(){
spinner.removeClass('speedycache-spinner-active');
});
}
function speedycache_add_preload_resource() {
event.preventDefault();
let ele = jQuery(event.target),
loader = ele.find('.speedycache-spinner'),
form = ele.closest('form'),
error = false;
if(!form){
alert('Unable to get the form details!');
return;
}
let form_type = form.data('type');
// Disabling Add Button
ele.prop('disabled', true);
let form_val = {};
form_data = form.serializeArray();
form_data.forEach((field) => {
form_val[field.name] = field.value;
let non_required_fields = ['fetch_priority', 'device'];
if(!field.value && !non_required_fields.includes(field.name)){
error = true;
}
});
if(error){
alert('Fill all the fields before adding');
ele.prop('disabled', false);
return;
}
loader.addClass('speedycache-spinner-active');
jQuery.ajax({
'method' : 'POST',
'url' : speedycache_ajax.url,
'data' : {
action : 'speedycache_preloading_add_settings',
settings : form_val,
type : form_type,
security : speedycache_ajax.nonce
},
'success' : function(res){
ele.prop('disabled', false);
if(!res){
alert('Something went wrong, the response returned is empty');
return;
}
if(!res.success){
alert(res.data);
return;
}
let table = ele.closest('.speedycache-modal-content').find('table');
html = `<td>${form_val.resource}</td>
${form_type != 'pre_connect_list' ? '<td>'+form_val.type+'</td>' : ''}
<td>${form_val.crossorigin ? 'Yes' : 'No'}</td>
${form_type != 'pre_connect_list' ? '<td>'+(form_val.fetch_priority ? form_val.fetch_priority : 'Auto')+'</td><td>'+(form_val.device ? form_val.device : 'All')+'</td>' : ''}
<td data-key="${res.data}"><span class="dashicons dashicons-trash"></span></td>`;
if(table.find('.speedycache-preloading-empty').length > 0){
let tr = table.find('.speedycache-preloading-empty').closest('tr');
table.find('.speedycache-preloading-empty').remove();
tr.append(html);
} else {
let tbody = table.find('tbody');
tbody.append('<tr>'+html+'</tr>');
}
// Resetting the form
form.find('input, select').map(function(){
let type = jQuery(this).prop('type');
if(type == 'checkbox'){
jQuery(this).prop('checked', false);
return;
} else
jQuery(this).val('');
});
alert('Settings Saved Successfully');
}
}).always(function(){
loader.removeClass('speedycache-spinner-active');
});
}
function speedycache_delete_preload_resource(){
let ele = jQuery(event.target),
key = ele.closest('td').data('key'),
type = ele.closest('table').data('type'),
tr = ele.closest('tr');
tr.css('backgroundColor', 'rgba(255,0,0,0.2)');
jQuery.ajax({
'method' : 'POST',
'url' : speedycache_ajax.url,
'data' : {
action : 'speedycache_preloading_delete_resource',
type : type,
key : key,
security : speedycache_ajax.nonce
},
success : function(res){
if(!res || !res.success){
alert(res.data ? res.data : 'Unable to delete this resource');
return;
}
ele.closest('tr').remove();
}
});
}
function speedycache_flush_objects() {
event.preventDefault();
let jEle = jQuery(event.target),
spinner = jEle.find('.speedycache-spinner');
spinner.addClass('speedycache-spinner-active');
jQuery.ajax({
'method' : 'GET',
'url' : speedycache_ajax.url + '?action=speedycache_flush_objects&security='+speedycache_ajax.nonce,
'success' : function(res){
if(res.success){
return;
}
if(res.data){
alert(res.data);
return;
}
alert("Unable to flush Object Cache");
}
}).always(function(){
spinner.removeClass('speedycache-spinner-active');
});
}
function speedycache_import_settings(){
event.preventDefault();
let jEle = jQuery(event.target),
spinner = jEle.find('.speedycache-spinner');
spinner.addClass('.speedycache-spinner-active');
let fileInput = jQuery('#speedycache_import_file')[0];
if(!fileInput.files.length){
alert('Please select a JSON file to import.');
return;
}
if(fileInput.files[0].type && fileInput.files[0].type != 'application/json'){
alert('The file you have uploaded is not a JSON file.');
return;
}
if(!fileInput.files[0].size){
alert('Your settings file is empty.');
return;
}
let expected_file_name_reg = /speedycache-settings-\d{4}-\d{2}-\d{2}.*\.json/;
if(fileInput.files[0].name && !expected_file_name_reg.test(fileInput.files[0].name)){
alert('The format of the name of the file is not valid.');
return;
}
let formData = new FormData();
formData.append('security', speedycache_ajax.nonce);
formData.append('file', fileInput.files[0]);
jQuery.ajax({
url : speedycache_ajax.url + '?action=speedycache_import_settings',
type : 'POST',
data : formData,
processData : false,
contentType : false,
success : function(response){
if(response.success){
alert('Settings imported successfully');
location.reload();
} else {
alert(response.data || 'Something went wrong while importing.');
}
},
error: function(){
alert('Ajax error occurred');
}
}).always(function(){
spinner.removeClass('speedycache-spinner-active');
})
}
function speedycache_export_settings(){
event.preventDefault();
let jEle = jQuery(event.target),
spinner = jEle.find('.speedycache-spinner');
spinner.addClass('speedycache-spinner-active');
jQuery.ajax({
url : speedycache_ajax.url + '?action=speedycache_export_settings',
type : 'POST',
data : {
'security' : speedycache_ajax.nonce
},
success: function(response){
const blob = new Blob([JSON.stringify(response.data, null, 2)], { type: 'application/json' });
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = 'speedycache-settings-' + new Date().toISOString().slice(0,10) + '.json';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
error: function(){
alert('Export failed. Please try again.');
}
}).always(function(){
spinner.removeClass('speedycache-spinner-active');
});
}
function speedycache_image_optimization() {
var stats,
total_page = {
value: 0,
set: function (value) {
this.value = value;
this.update_num();
disabling_paging_btn(jQuery('#speedycache-image-list'));
},
update_num : function(){
jQuery('.speedycache-total-pages').text(this.value);
}
},
current_page = {
value: 0,
set: function (value) {
this.value = value;
this.update_num();
disabling_paging_btn(jQuery('#speedycache-image-list'));
},
update_num : function(){
jQuery('.speedycache-current-page').text(this.value+1);
}
};
//Gets Stats
var get_stats = function(onload = false) {
jQuery.ajax({
type : 'GET',
url : speedycache_ajax.url + '?action=speedycache_statics_ajax_request',
cache : false,
data : {
'security' : speedycache_ajax.nonce
},
beforeSend: function(){
jQuery('.speedycache-img-stat-update-status').show();
},
success : function(res){
stats = res;
jQuery('.speedycache-img-stat-update-status').hide();
//For pagination
var $total_page = jQuery('.speedycache-total-pages'),
optimized = res.optimized
$total_page.text(Math.ceil(optimized/5));
total_page.set($total_page.text());
if(total_page == '1') {
jQuery('.speedycache-image-list-next-page').addClass('disabled');
jQuery('.speedycache-image-list-last-page').addClass('disabled');
}
if(!onload) {
optm_count = `${optimized}/${stats.total_image_number}`;
jQuery('.speedycache-img-optm-count').text(optm_count);
reduction = res.reduction > 10000 ? (res.reduction/1000).toFixed(2) + 'MB' : res.reduction.toFixed(2) + 'KB';
var stat_block = jQuery('.speedycache-img-stats');
stat_block.find('.speedycache-img-reduced-size').text(reduction);
stat_block.find('.speedycache-donut-percent').text(res.percent + '%');
stat_block.find('.speedycache-img-success-per').text(res.percent + '%');
stat_block.find('.speedycache-img-error-count').text(res.error);
var sub = 100 - parseInt(res.percent);
stat_block.find('.speedycache-donut-segment-2').attr('stroke-dasharray', res.percent+' '+sub);
var donut_style = stat_block.closest('.speedycache-tab-image').find('style').eq(0);
//this regex wont work in PHP as it dosent supports look behind without fixed size
var dash_array = donut_style.text();
//(?<=100%\s*{(?:\s*|\n)stroke-dasharray\s*:\s*)([\d]+\s*[\d]+[^;]) this reg ex can be used too its more precise and gets just numbers but need to update it to handle floats
dash_array = dash_array.replace(/100%.*(?:[\d]|[\d]+\.[\d]+)[^;]/, `100%{stroke-dasharray:${res.percent}, ${sub}`);
var segment = stat_block.find('.speedycache-donut-segment-2');
segment.removeClass('speedycache-donut-segment-2');
segment.addClass('speedycache-donut-segment-2');
donut_style.text(dash_array);
}
if(res.uncompressed > 0) {
jQuery('.speedycache_img_optm_status').css('backgroundColor', '#EED202');
jQuery('.speedycache_img_optm_status').next().text(`${res.uncompressed} File(s) needed to be optimized`);
}else {
jQuery('.speedycache_img_optm_status').css('backgroundColor', '#90ee90');
jQuery('.speedycache_img_optm_status').next().text(`All images are optimized`);
}
}
});
}
//Updates Image Optimization Stats on load
get_stats();
jQuery('.speedycache-img-opt-settings input').on('change', function() {
var settings = jQuery('.speedycache-img-opt-settings').serializeArray();
settings = speedycache_convert_serialized(settings);
jQuery.ajax({
type: 'POST',
url : speedycache_ajax.url + '?action=speedycache_update_image_settings',
data : {
'security' : speedycache_ajax.nonce,
'settings' : settings
},
success: function(res) {
//Succeed or Fail silently
}
});
});
var file_counter = 1,
optm_stopped = false,
optm_ajax;
jQuery('.speedycache-img-optm-btn').on('click', function() {
if(optm_ajax && optm_stopped) {
optm_ajax.abort();
optm_stopped = false;
file_counter = 1;
return;
}
var inner_content = `
<div class="speedycache-img-optm-counter">${file_counter - 1}/${stats.uncompressed}</div>
<div class="speedycache-progress">
<div class="speedycache-progress-value"></div>
</div>
<div class="speedycache-optm-close">
<button class="speedycache-button speedycache-image-optm-stop speedycache-btn-black">Stop</button>
<button class="speedycache-button speedycache-img-optm-close">Close</button></div>
</div>`;
//If all images are optimized
if(stats.uncompressed == 0) {
inner_content = `
<div class="speedycache-already-optm">
<span class="dashicons dashicons-yes-alt"></span>
<span>All images are Optimized</span>
</div>
<div class="speedycache-optm-close">
<button class="speedycache-btn speedycache-btn-success speedycache-img-optm-close" style="display:block;">Close</button></div>
</div>
`;
}
var inc_per = parseInt(100/stats.uncompressed),
modal_html = `<div modal-id="speedycache-modal-optimize-all" class="speedycache-modal">
<div class="speedycache-modal-wrap" style="padding:10px;">
<div style="text-align:center;"><h2>Optimizing Images</h2></div>
<div class="speedycache-optm-prog-list">
</div>
${inner_content}
</div>
</div>`;
var optm_modal = jQuery('[modal-id="speedycache-modal-optimize-all"]');
if(optm_modal.length == 0) {
jQuery('body').append(modal_html);
speedycache_open_modal(jQuery(this));
optm_modal = jQuery('[modal-id="speedycache-modal-optimize-all"]');
}
optm_modal.find('.speedycache-optm-close button').off('click').on('click', function() {
optm_modal.remove();
speedycache_update_list();
get_stats();
if(stats.uncompressed != 0) {
optm_stopped = true;
}
file_counter++;
});
optm_ajax = jQuery.ajax({
type : 'POST',
url : speedycache_ajax.url + '?action=speedycache_optimize_image_ajax_request',
data : {
'id' : null,
'security' : speedycache_ajax.nonce
},
success: function(res) {
var progress = jQuery('[modal-id="speedycache-modal-optimize-all"] .speedycache-progress-value'),
new_per = file_counter * inc_per;
progress.css('width', `${new_per}%`);
file_counter++
var modal = progress.closest('.speedycache-modal-wrap');
if(!res.id && res.message != 'finish') {
var error_html = `<div class="speedycache-img-optm-error">
<p>Something Went Wrong<br/>
${res.message}
</p>
</div>`;
progress.parent().before(error_html);
progress.css({'width': '100%', 'backgroundColor' : 'var(--speedycache-red)'});
setTimeout( () => {
optm_modal.find('.speedycache-img-optm-close').show();
optm_modal.find('.speedycache-image-optm-stop').hide();
},700);
return;
}
if(res.message != 'finish' && file_counter <= stats.uncompressed + 1) {
modal.find('.speedycache-img-optm-counter').text((file_counter) - 1 +'/'+stats.uncompressed);
jQuery('.speedycache-img-optm-btn').trigger('click');
return;
}
progress.css('width', '100%');
//To show when Optimization completes
var success_html = `
<div class="speedycache-already-optm" style="display:none;">
<span class="dashicons dashicons-yes-alt"></span>
<span>Images optimized Successfully</span>
</div>
`;
progress.parent().before(success_html);
modal.find('.speedycache-img-optm-counter').hide('slow');
modal.find('.speedycache-already-optm').show('slow');
setTimeout( () => {
optm_modal.find('.speedycache-img-optm-close').show();
optm_modal.find('.speedycache-image-optm-stop').hide();
},700);
}
});
});
//revert Image
var revert_image = function() {
var jEle = jQuery(this),
post_id = jEle.find('input').val();
if(!post_id) {
return;
}
//speedycache_add_loader();
jQuery.ajax({
type : 'GET',
url : speedycache_ajax.url + '?action=speedycache_revert_image_ajax_request&id='+post_id,
data : {
'security' : speedycache_ajax.nonce,
},
beforeSend : function(){
jEle.closest('tr').css('backgroundColor', 'rgba(255,0,0,0.2)');
},
success : function(res) {
speedycache_update_list(jEle);
get_stats();
//speedycache_hide_loader();
},
error: function(err) {
//speedycache_hide_loader();
jEle.closest('tr').css('backgroundColor', 'rgb(255,255,255)');
}
});
}
//Revert the image conversion listener
jQuery('.speedycache-revert').on('click', revert_image);
jQuery('.speedycache-img-delete-all-conv').on('click', function(e) {
e.preventDefault();
var confirm_modal = jQuery('[modal-id="speedycache-modal-all-img-revert"]');
if(confirm_modal.length == 0) {
return;
}
speedycache_open_modal(confirm_modal);
confirm_modal.find('.speedycache-db-confirm-yes').off().on('click', function() {
//speedycache_add_loader();
confirm_modal.css('visibility','hidden');
jQuery.ajax({
type : 'GET',
url : speedycache_ajax.url + '?action=speedycache_img_revert_all',
data : {
'security' : speedycache_ajax.nonce
},
success : function(res) {
if(res.success) {
//speedycache_hide_loader();
speedycache_update_list();
get_stats();
return;
}
//speedycache_hide_loader();
alert(res.message);
}
});
});
confirm_modal.find('.speedycache-db-confirm-no').off().on('click', function() {
confirm_modal.css('visibility','hidden');
});
});
var speedycache_update_list = function(jEle = null) {
var img_list = jQuery('#speedycache-image-list'),
search = img_list.find('#speedycache-image-search-input'),
per_page = img_list.find('#speedycache-image-per-page'),
per_page_val = per_page.val() ? per_page.val() : 5,
filter = img_list.find('#speedycache-image-list-filter'),
page = 0;
if(jEle) {
if(jEle.hasClass('disabled')) {
return;
}
if(jEle.data('page-action')) {
switch(jEle.data('page-action')) {
case 'last-page':
current_page.set(total_page.value - 1);
break;
case 'next-page':
current_page.set(current_page.value + 1);
break;
case 'first-page':
current_page.set(0);
break;
case 'prev-page':
current_page.set(current_page.value > 0 ? current_page.value - 1 : 0);
break;
}
}
}
var optimized = stats.total_image_number - stats.uncompressed;
if(optimized <= per_page_val) {
current_page.set(0);
}
jQuery.ajax({
type : 'GET',
url : speedycache_ajax.url + '?action=speedycache_update_image_list_ajax_request',
data : {
'search' : search.val(),
'per_page' : per_page_val,
'filter' : filter.val(),
'page' : current_page.value,
'security' : speedycache_ajax.nonce
},
success: function(res) {
if(!res.content) {
return;
}
total_page.set(Math.ceil(res.result_count/per_page_val));
if(total_page.value - 1 == current_page.value) {
img_list.find('.speedycache-image-list-next-page').addClass('disabled');
img_list.find('.speedycache-image-list-last-page').addClass('disabled');
}
jQuery('#speedycache-image-list tbody').empty();
jQuery('#speedycache-image-list tbody').append(res.content);
jQuery('.speedycache-revert').on('click', revert_image);
jQuery('.speedycache-open-image-details').on('click', open_img_details);
}
});
}
var disabling_paging_btn = function(img_list) {
if(current_page.value == 0 && total_page.value - 1 == 0) {
img_list.find('.speedycache-image-list-first-page').addClass('disabled');
img_list.find('.speedycache-image-list-prev-page').addClass('disabled');
img_list.find('.speedycache-image-list-last-page').addClass('disabled');
img_list.find('.speedycache-image-list-next-page').addClass('disabled');
}else if(current_page.value == 0) {
img_list.find('.speedycache-image-list-first-page').addClass('disabled');
img_list.find('.speedycache-image-list-prev-page').addClass('disabled');
img_list.find('.speedycache-image-list-last-page').removeClass('disabled');
img_list.find('.speedycache-image-list-next-page').removeClass('disabled');
} else if(current_page.value == total_page.value - 1) {
img_list.find('.speedycache-image-list-first-page').removeClass('disabled');
img_list.find('.speedycache-image-list-prev-page').removeClass('disabled');
img_list.find('.speedycache-image-list-last-page').addClass('disabled');
img_list.find('.speedycache-image-list-next-page').addClass('disabled');
} else {
img_list.find('.speedycache-image-list-first-page').removeClass('disabled');
img_list.find('.speedycache-image-list-prev-page').removeClass('disabled');
img_list.find('.speedycache-image-list-last-page').removeClass('disabled');
img_list.find('.speedycache-image-list-next-page').removeClass('disabled');
}
}
//Toggles the image variants
var open_img_details = function() {
var post_id = jQuery(this).closest('tr').attr('post-id');
if(!post_id) {
return;
}
var details = jQuery('tr[post-id="'+post_id+'"][post-type="detail"]');
if(details.is(':hidden')) {
details.show();
jQuery(this).find("span").attr('class', 'dashicons dashicons-arrow-up-alt2')
} else {
details.hide();
jQuery(this).find("span").attr('class', 'dashicons dashicons-arrow-down-alt2');
}
}
//Downloading cwebp
jQuery('button.speedycache-webp-download').on('click', function(e) {
e.preventDefault();
type = jQuery(this).data('type') ? jQuery(this).data('type') : 'cwebp';
jQuery.ajax({
url : speedycache_ajax.url + '?action=speedycache_download_cwebp',
type : 'GET',
data : {
security : speedycache_ajax.nonce,
type : type
},
beforeSend : function() {
//speedycache_add_loader();
},
success : function(res) {
//speedycache_hide_loader();
if(res.success) {
location.reload();
return;
}
if(!res.error_message) {
alert('Something went wrong try again later!');
}
alert(res.error_message);
}
})
});
//Listener For Scheduled Count
jQuery('span.speedycache-scheduled-count').on('click', function() {
speedycache_open_modal(jQuery(this));
});
//Listeners Starts here
//Search button listener
jQuery('#speedycache-image-search-button').on('click', function() {
speedycache_update_list(jQuery(this));
});
//All or Error image filter
jQuery('#speedycache-image-list-filter').on('change', function() {
speedycache_update_list(jQuery(this));
});
//Per page listener
jQuery('#speedycache-image-per-page').on('change', function() {
speedycache_update_list(jQuery(this));
});
//Paging Number Listeners
jQuery('.speedycache-image-list-first-page, .speedycache-image-list-prev-page, .speedycache-image-list-next-page, .speedycache-image-list-last-page').on('click', function() {
speedycache_update_list(jQuery(this));
});
//Toggles the image variants Listener
jQuery('.speedycache-open-image-details').on('click', open_img_details);
}
/*
Converts the format of jQuery serializeArray
i.e, [ 0:{name:someName, value:expectedvalue} ] to
{ someName:expectedvalue }
*/
function speedycache_convert_serialized(arr) {
var converted_obj = {};
for(var i of arr) {
converted_obj[i.name] = i.value;
}
return converted_obj;
}
function speedycache_critical_css(){
jQuery.ajax({
type: 'GET',
url : speedycache_ajax.url + '?action=speedycache_critical_css&security='+speedycache_ajax.nonce,
success: function(res){
if(!res.success){
alert(res.data.message ? res.data.message : 'Something went wrong ! Unable to intitiate Critical CSS!');
return;
}
alert(res.data.message);
}
})
}
function speedycache_verify_license(){
event.preventDefault();
let jEle = jQuery(event.target),
form = jEle.closest('form'),
form_data = form.serializeArray(),
spinner = jEle.find('.speedycache-spinner');
spinner.addClass('speedycache-spinner-active');
jQuery.ajax({
type: 'GET',
url : speedycache_ajax.url,
data : form_data,
success: function(res){
if(res.success){
alert('License verified, please reload the page');
return;
}
if(res.data){
alert(res.data);
return;
}
alert('Something went wrong when trying to verify license');
}
}).always(function(){
spinner.removeClass('speedycache-spinner-active');
})
}
PK M+l\vj�� � assets/config-template.phpnu �[��� <?php
if(!defined('ABSPATH')){
exit();
}
$speedycache_ac_config = 'REPLACE_CONFIG';
if(empty($speedycache_ac_config) || !is_array($speedycache_ac_config)){
$speedycache_ac_config = [];
}PK U+l\V�{5�) �) assets/images/icon.svgnu �[��� <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="18.089701"
height="18.049311"
viewBox="0 0 18.089701 18.951776"
version="1.1"
id="svg116"
sodipodi:docname="icon.svg"
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview118"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="25.420489"
inkscape:cx="9.3428573"
inkscape:cy="6.7465264"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="svg116" />
<defs
id="defs101">
<filter
id="alpha"
filterUnits="objectBoundingBox"
x="0"
y="0"
width="1"
height="1">
<feColorMatrix
type="matrix"
in="SourceGraphic"
values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"
id="feColorMatrix2" />
</filter>
<mask
id="mask0">
<g
filter="url(#alpha)"
id="g7">
<rect
x="0"
y="0"
width="20"
height="21"
style="fill:#000000;fill-opacity:0.901961;stroke:none"
id="rect5" />
</g>
</mask>
<linearGradient
id="linear0"
gradientUnits="userSpaceOnUse"
x1="10.6"
y1="381.39999"
x2="211.5"
y2="381.39999">
<stop
offset="1"
style="stop-color:rgb(100%,100%,100%);stop-opacity:1;"
id="stop10" />
<stop
offset="1"
style="stop-color:rgb(26.27451%,66.27451%,96.862745%);stop-opacity:1;"
id="stop12" />
</linearGradient>
<clipPath
id="clip1">
<rect
x="0"
y="0"
width="20"
height="21"
id="rect15" />
</clipPath>
<g
id="surface5"
clip-path="url(#clip1)">
<path
style="fill:url(#linear0);fill-rule:nonzero;stroke:#000000;stroke-width:0.6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
d="m 111.36328,295.76079 99.85742,61.54762 -0.33593,109.71912 -8.98633,-0.26228 -9.91016,-1.74851 L 10.917969,356.2593 Z m 0,0"
transform="scale(0.0465116,0.0446809)"
id="path18" />
</g>
<mask
id="mask1">
<g
filter="url(#alpha)"
id="g23">
<rect
x="0"
y="0"
width="20"
height="21"
style="fill:#000000;fill-opacity:0.8;stroke:none"
id="rect21" />
</g>
</mask>
<linearGradient
id="linear1"
gradientUnits="userSpaceOnUse"
x1="210.60001"
y1="352.20001"
x2="413.29999"
y2="352.20001">
<stop
offset="1"
style="stop-color:rgb(100%,100%,100%);stop-opacity:1;"
id="stop26" />
<stop
offset="1"
style="stop-color:rgb(34.117647%,41.568627%,96.470588%);stop-opacity:1;"
id="stop28" />
</linearGradient>
<clipPath
id="clip2">
<rect
x="0"
y="0"
width="20"
height="21"
id="rect31" />
</clipPath>
<g
id="surface8"
clip-path="url(#clip2)">
<path
style="fill:url(#linear1);fill-rule:nonzero;stroke:#000000;stroke-width:0.6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
d="m 211.2207,357.57069 201.81446,-120.5599 -1.25977,119.68564 -183.67383,109.36942 -4.70312,1.31138 -12.51367,-0.3497 z m 0,0"
transform="scale(0.0465116,0.0446809)"
id="path34" />
</g>
<mask
id="mask2">
<g
filter="url(#alpha)"
id="g39">
<rect
x="0"
y="0"
width="20"
height="21"
style="fill:#000000;fill-opacity:0.701961;stroke:none"
id="rect37" />
</g>
</mask>
<linearGradient
id="linear2"
gradientUnits="userSpaceOnUse"
x1="22.700001"
y1="269.70001"
x2="211.8"
y2="269.70001">
<stop
offset="1"
style="stop-color:rgb(100%,100%,100%);stop-opacity:1;"
id="stop42" />
<stop
offset="1"
style="stop-color:rgb(3.137255%,27.058824%,67.058824%);stop-opacity:1;"
id="stop44" />
</linearGradient>
<clipPath
id="clip3">
<rect
x="0"
y="0"
width="20"
height="21"
id="rect47" />
</clipPath>
<g
id="surface11"
clip-path="url(#clip3)">
<path
style="fill:url(#linear2);fill-rule:nonzero;stroke:#000000;stroke-width:0.6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
d="m 23.011719,241.20722 99.101561,-59.18713 88.18359,52.01823 1.17579,123.44494 z m 0,0"
transform="scale(0.0465116,0.0446809)"
id="path50" />
</g>
<mask
id="mask3">
<g
filter="url(#alpha)"
id="g55">
<rect
x="0"
y="0"
width="20"
height="21"
style="fill:#000000;fill-opacity:0.701961;stroke:none"
id="rect53" />
</g>
</mask>
<linearGradient
id="linear3"
gradientUnits="userSpaceOnUse"
x1="222.7"
y1="210.3"
x2="413.20001"
y2="210.3">
<stop
offset="1"
style="stop-color:rgb(100%,100%,100%);stop-opacity:1;"
id="stop58" />
<stop
offset="1"
style="stop-color:rgb(3.137255%,27.058824%,67.058824%);stop-opacity:1;"
id="stop60" />
</linearGradient>
<clipPath
id="clip4">
<rect
x="0"
y="0"
width="20"
height="21"
id="rect63" />
</clipPath>
<g
id="surface14"
clip-path="url(#clip4)">
<path
style="fill:url(#linear3);fill-rule:nonzero;stroke:#000000;stroke-width:0.6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
d="m 223.0625,249.77493 -0.084,-128.77791 189.88867,115.83892 -104.05664,62.68415 z m 0,0"
transform="scale(0.0465116,0.0446809)"
id="path66" />
</g>
<mask
id="mask4">
<g
filter="url(#alpha)"
id="g71">
<rect
x="0"
y="0"
width="20"
height="21"
style="fill:#000000;fill-opacity:0.8;stroke:none"
id="rect69" />
</g>
</mask>
<linearGradient
id="linear4"
gradientUnits="userSpaceOnUse"
x1="22.5"
y1="124"
x2="224.60001"
y2="124">
<stop
offset="1"
style="stop-color:rgb(100%,100%,100%);stop-opacity:1;"
id="stop74" />
<stop
offset="1"
style="stop-color:rgb(34.117647%,41.568627%,96.470588%);stop-opacity:1;"
id="stop76" />
</linearGradient>
<clipPath
id="clip5">
<rect
x="0"
y="0"
width="20"
height="21"
id="rect79" />
</clipPath>
<g
id="surface17"
clip-path="url(#clip5)">
<path
style="fill:url(#linear4);fill-rule:nonzero;stroke:#000000;stroke-width:0.6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
d="M 22.759766,118.89881 209.03711,8.917411 l 4.70312,-1.223959 10.2461,0.087426 0.33594,112.604172 -199.798832,119.94791 z m 0,0"
transform="scale(0.0465116,0.0446809)"
id="path82" />
</g>
<mask
id="mask5">
<g
filter="url(#alpha)"
id="g87">
<rect
x="0"
y="0"
width="20"
height="21"
style="fill:#000000;fill-opacity:0.901961;stroke:none"
id="rect85" />
</g>
</mask>
<linearGradient
id="linear5"
gradientUnits="userSpaceOnUse"
x1="222.7"
y1="94.599998"
x2="423.39999"
y2="94.599998">
<stop
offset="1"
style="stop-color:rgb(100%,100%,100%);stop-opacity:1;"
id="stop90" />
<stop
offset="1"
style="stop-color:rgb(26.27451%,66.27451%,96.862745%);stop-opacity:1;"
id="stop92" />
</linearGradient>
<clipPath
id="clip6">
<rect
x="0"
y="0"
width="20"
height="21"
id="rect95" />
</clipPath>
<g
id="surface20"
clip-path="url(#clip6)">
<path
style="fill:url(#linear5);fill-rule:nonzero;stroke:#000000;stroke-width:0.6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
d="m 222.97852,7.780878 11.58984,0.524554 13.26953,5.595238 175.27539,106.39695 -99.60547,61.11049 -100.19336,-61.02306 z m 0,0"
transform="scale(0.0465116,0.0446809)"
id="path98" />
</g>
</defs>
<g
id="surface1"
inkscape:export-filename="E:\Program Files\EasyPHP 3.0\www\vardi_site\wp-content\plugins\speedycache\images\icon.png"
inkscape:export-xdpi="93.125061"
inkscape:export-ydpi="93.125061"
transform="matrix(0.98929243,0,0,0.92151482,-0.94570914,-0.30441882)">
<use
xlink:href="#surface5"
mask="url(#mask0)"
id="use103"
x="0"
y="0"
width="100%"
height="100%" />
<use
xlink:href="#surface8"
mask="url(#mask1)"
id="use105"
x="0"
y="0"
width="100%"
height="100%" />
<use
xlink:href="#surface11"
mask="url(#mask2)"
id="use107"
x="0"
y="0"
width="100%"
height="100%" />
<use
xlink:href="#surface14"
mask="url(#mask3)"
id="use109"
x="0"
y="0"
width="100%"
height="100%" />
<use
xlink:href="#surface17"
mask="url(#mask4)"
id="use111"
x="0"
y="0"
width="100%"
height="100%" />
<use
xlink:href="#surface20"
mask="url(#mask5)"
id="use113"
x="0"
y="0"
width="100%"
height="100%" />
</g>
</svg>
PK Z+l\�yV�� �� assets/images/speedycache.pngnu �[��� �PNG
IHDR ^ �jn sRGB��, pHYs �� �AIDATx�� xU��3�$̐y$��&! B �$��yq��֡��C�Pu�c�Z�_��l��\�v�*T�<��"�̓Z8�>p.���{o���s���Y�ׯ�]k����� p&���3S2�wk'<j�O��Q7����IOX�#�;�ȝr��eg?`<�N�����{�`����;�ݴ��/�+�;O��L�` 8(K��X��>��x�q��{;��ѷ��˾�'�Y��1��\�~ߒ�ʿ=�;8 �$��X>t���\�q��K�*�V�g�3�%`5�c8��O�G�S1�d�{�� PN�9��-yi��/Fp9r��V����Fx X���Ɛ��6����W�,� @u�i���O���P����E+�:�Ҟ
��F��i/��� \��&��7�wy�v�,��j�~�1p�O�^L��.���v'WL���+��` ��w�~�<1x鿧-x7�k��^~l-�QHW�ud���a�Ϻ�^����.$ �N���>;��ؿ�;�Ž]\6�~�2�%`W��`����N��s2w� �eDrZ�ʑ~�Q��B)����^�dٽ�SGL�CB�T�]� ��R��Q^}�[soQ*�P/u��F� �|�8t�
2�X� @���9���xk�IkI�#o�4�n���]T�K�*���䊉�'dx's. "����i9M�6�^�5��rDx!>�����~pkߢ���Pq� �(ML�du�[t.�/?�*��6�����Y}�8��&ww� �=���{���k��\�^��r��r�V�%`ï{��{��J�p' '�[���0�__�\6��v6���c�>�?e�����. 8�������Myj+������W���^]?vχ�w�U�����.˧;w� `��&��WY�⣹Kw�
.GN���0�z뉗�6↿���Wڰ�;Y �'��������i�=�-��Yx ����*�r��i��� �m�����۱s���-��{�ؘ��Rx1���
�o�R�M�[d�L ��꾉�OՎd=��rL�e�-{�E�ά���
��O��� @/�{����z�ş�+Dz��{���o�剗o]?v��2�_�5`D=w� @K\B��3^����~�-���nc���m}⥵5<�I�{Ӯ��s�e�ĝt (&!!qjZV�?g�i���U5�k8�F�/����FVӢ
I�ǝ �aPjV�o��>�9���U;Tx ؐ�~u }Լ���/�� )Ii�oR���g.��]<���t�Qx�5;�����ύ��[w���yR�&��� @���]pZ�k'��An�D��r�Qx�Վ^V}�F��3>K>���� :���>*5���)O��KTZ���o��-�������`��k{zG��n p4"9���ƻ7�]��](Q~�e��9���|?�j/Z�3eؔ���sD @�ӻw�K����ִS�aHH��y-;��*�Y�#����.� ���{��Y��_7�/��/j��?|�X>��n�^\? h�:9���u���[�e#ǭ��Ŵ1��0�߾#�rʯ������ ��?)m��Cj�~��-�b�n��;�ʈ^V{��F���nN}�u� �&�=W�-~}�I�eAx��������C8��)ç~�w`�� p4 )�2r�^m���ҙՎ���{ED
/+Yv߾Ԫ��F%�-�. �1$%c�o��>�9��a9�aSx����ڳQw�m�`S��)��o$��# �NZRڰ
��r��E�����'^"^x X嵫&WLx�G���, `K�&�,+ؼf�Wrv�C��q�Cxic%��ۙ8��i���~ [��ַ)5�����8�j^:�Qw�g�����A
���)��{ �)�?�l�c�ܥ���
;[�G!�Æ��)��_�3��� �I�~IC�,���i�a5�`�&>n�nq� Vv�C�S�f<�3�h�� �ҳgމY�S^;���'١/sp�%X}χ�w�U�2}�6?;�� PMeJ֨�����NnÉV;�1�;�2/!ڈ��Hu��}�N� �!�U�����F(&�7O���� ��z����Zٟ����@���߿w .9}��V�b��ś���y����m�~�2l��q=��1 �����O�:T�����M�L�X ��~�+}��o��r� �ۣG����^�r���
��^�g|;���d���Q0��OK�o��g_�
�PXX���/�%_� :G����-{�; �����13���[�p�^�_ �E�U��O#mԼ�z�Y�]Q @� �z����� :G��ϩ��8��O�p� �1�w����M���-T��FO��Q0��ܢ��l�O�O*�B\ߔJ� �G�Ws�e%w<