Plugin Directory

Changeset 3490058


Ignore:
Timestamp:
03/24/2026 01:31:29 PM (5 days ago)
Author:
softaculous
Message:

New version 1.3.8

Location:
speedycache/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • speedycache/trunk/main/admin.php

    r3367258 r3490058  
    4848        $url = SPEEDYCACHE_URL.'/assets/images/'. (defined('SITEPAD') ? 'grey-icon.svg' : 'icon.svg');
    4949       
    50         $hooknames[] = add_menu_page('SpeedyCache Settings', 'SpeedyCache', $capability, 'speedycache', '\SpeedyCache\Settings::base', $url);
     50        if(defined('SITEPAD')){
     51            $hooknames[] = add_submenu_page('smtp-mail.php', 'SpeedyCache Settings', 'Site Cache', $capability, 'speedycache', '\SpeedyCache\Settings::base', $url);
     52        }else{
     53            $hooknames[] = add_menu_page('SpeedyCache Settings', 'SpeedyCache', $capability, 'speedycache', '\SpeedyCache\Settings::base', $url);
     54        }
    5155   
    5256        foreach($hooknames as $hookname){
     
    101105        $post_id = Util::sanitize_get('post_id');
    102106        \SpeedyCache\Delete::cache($post_id);
     107       
     108        do_action('speedycache_update_stats', '');
    103109
    104110        $redirect_to = esc_url_raw(wp_unslash($_REQUEST['referer']));
     
    117123        $url = esc_url_raw(wp_unslash($_REQUEST['referer']));
    118124        \SpeedyCache\Delete::url($url);
     125       
     126        do_action('speedycache_update_stats', '');
    119127
    120128        wp_safe_redirect($url);
  • speedycache/trunk/main/cache.php

    r3367258 r3490058  
    7373
    7474        $cache_path = self::cache_path();
     75        $cache_path = wp_normalize_path($cache_path);
    7576
    7677        if(!file_exists($cache_path)){
     
    8687       
    8788        $cache_path = wp_normalize_path($cache_path);
    88 
    89         file_put_contents($cache_path, self::$content . "\n<!-- ".esc_html($mobile)."Cache by SpeedyCache https://speedycache.com -->");
     89        $comment = 'Cache by SpeedyCache https://speedycache.com at '.time().' -->';
     90
     91        file_put_contents($cache_path, self::$content . "\n<!-- ".esc_html($mobile).$comment);
    9092
    9193        if(function_exists('gzencode') && !empty($speedycache->options['gzip'])){
    92             $gzidded_content = gzencode(self::$content . "\n<!-- ".esc_html($mobile)."Cache by SpeedyCache https://speedycache.com -->");
     94            $gzidded_content = gzencode(self::$content . "\n<!-- ".esc_html($mobile).$comment);
    9395            file_put_contents($cache_path . '.gz', $gzidded_content);
    9496        }
    9597
    96         delete_option('speedycache_html_size');
    97         delete_option('speedycache_assets_size');
     98        do_action('speedycache_update_stats', $cache_path);
    9899    }
    99100   
     
    178179
    179180        if(is_admin()) return false;
     181       
     182        // Since: 1.3.8
     183        if(defined('DONOTCACHEPAGE') && DONOTCACHEPAGE) return false;
    180184
    181185        // Since: 1.2.8 we will only cache the page if user is not logged-in.
     
    184188        if(!preg_match( '/<\s*\/\s*html\s*>/i', self::$content)) return false;
    185189
    186         if(is_singular() && post_password_required()) return false;
     190        if(is_singular() && self::is_password_protected()) return false;
    187191       
    188192        if(function_exists('is_404') && is_404()) return false;
     
    497501        return \has_shortcode($post->post_content, $shortcode);
    498502    }
     503   
     504    /*
     505     * Earlier we were using post_password_required which returns false if the user has placed correct password
     506     * making the password protected page, visible to all if once correct user opened the page.
     507     *
     508     * Since 1.3.8
     509     *
     510     * @return bool
     511     */
     512    static function is_password_protected(){
     513        global $post;
     514       
     515        if(empty($post)){
     516            return false;
     517        }
     518       
     519        if(!empty($post->post_password)){
     520            return true;
     521        }
     522       
     523        return false;
     524    }
    499525}
     526
     527
  • speedycache/trunk/main/css.php

    r3367258 r3490058  
    7474                $minified = self::fix_relative_path($minified, $url);
    7575                file_put_contents($minified_path, $minified);
     76               
     77                // Updating the stat data
     78                if(defined('SPEEDYCACHE_PRO')){
     79                    $speedycache->asset_stats += strlen($minified);
     80                }
    7681            }
    7782
     
    9297   
    9398    static function combine(&$content){
     99        global $speedycache;
     100
    94101        if(empty($content)){
    95102            return;
     
    166173
    167174        $combined_path = $asset_path.$file_name;
     175       
     176        // Updating the stats
     177        if(!file_exists($combined_path) && defined('SPEEDYCACHE_PRO')){
     178            $speedycache->asset_stats += strlen($combined_css);
     179        }
    168180
    169181        file_put_contents($combined_path, $combined_css);
     182
    170183        $final_url = Util::path_to_url($combined_path);
    171184
  • speedycache/trunk/main/delete.php

    r3329748 r3490058  
    2020        self::purge_varnish();
    2121        \SpeedyCache\CDN::purge();
    22         delete_option('speedycache_html_size');
    23         delete_option('speedycache_assets_size');
    2422
    2523        if(empty($actions)){
     
    8280            \SpeedyCache\Preload::url($link);
    8381        }
    84 
    85         delete_option('speedycache_html_size');
    86         delete_option('speedycache_assets_size');
    8782    }
    8883
     
    138133            }
    139134
     135            do_action('speedycache_cache_pre_unlink', $cache_path);
     136
    140137            unlink($cache_path);
    141138        }
     
    158155            \SpeedyCache\Logs::action();
    159156        }
     157       
     158        delete_option('speedycache_html_size');
    160159    }
    161160
     
    174173            \SpeedyCache\Logs::action();
    175174        }
     175       
     176        delete_option('speedycache_assets_size');
    176177    }
    177178
     
    221222
    222223        foreach($files as $file){
    223             if(is_dir($dir.'/'.$file)){
    224                 self::rmdir($dir.'/'.$file);
    225                 continue;
    226             }
    227 
    228             unlink($dir.'/'.$file);
     224            $file_path = $dir.'/'.$file;
     225            if(is_dir($file_path)){
     226                self::rmdir($file_path);
     227                continue;
     228            }
     229
     230            do_action('speedycache_cache_pre_unlink', $file_path);
     231
     232            unlink($file_path);
    229233        }
    230234
     
    330334        }
    331335       
    332         // We will delete it even if the cache does not gets deleted
    333         delete_option('speedycache_html_size');
    334         delete_option('speedycache_assets_size');
    335        
    336336        if(class_exists('\SpeedyCache\Logs')){
    337337            \SpeedyCache\Logs::log('delete');
     
    352352            return;
    353353        }
     354       
     355        // Need to make sure the folder has been emptied
     356        $cache_deleted = false;
    354357
    355358        foreach($files as $file){
     
    365368            // everything colud be a overhead.
    366369            if((self::$cache_lifespan >= 10 * HOUR_IN_SECONDS) || ((filemtime($file_path) + self::$cache_lifespan) < time())){
    367                 unlink($file_path);
    368             }
     370                do_action('speedycache_cache_pre_unlink', $file_path);
     371
     372                if(unlink($file_path)){
     373                    $cache_deleted = true;
     374                } else {
     375                    $cache_deleted = false;
     376                }
     377            }
     378        }
     379       
     380        // Delete the folder as well, else it will continue to consume inode for cache not even there.
     381        if($cache_deleted && file_exists($path) && is_dir($path)){
     382            @rmdir($path);
    369383        }
    370384    }
     
    423437        // This is used to delete post which may have the current post as the related post / product in them
    424438        self::adjacent_posts_urls();
     439
     440        do_action('speedycache_update_stats', '');
    425441    }
    426442
     
    440456
    441457        self::cache($comment->comment_parent);
     458
     459        do_action('speedycache_update_stats', '');
    442460       
    443461    }
     
    576594        $shop_page_id = wc_get_page_id('shop');
    577595        self::cache($shop_page_id);
     596
     597        do_action('speedycache_update_stats', '');
    578598    }
    579599}
  • speedycache/trunk/main/js.php

    r3140690 r3490058  
    7878
    7979            $minified_path = $asset_path.$file_name;
     80           
     81            if(!file_exists($minified_path) && defined('SPEEDYCACHE_PRO')){
     82                $speedycache->asset_stats += strlen($js); // Updating the stats
     83            }
    8084
    8185            file_put_contents($minified_path, $js);
     86           
    8287
    8388            $minified_url = Util::path_to_url($minified_path);
     
    123128                    continue;
    124129                }
    125                
     130
    126131                // We wont combine modules.
    127132                if(!empty($tag[1]) && strpos($tag[1], 'module')){
     
    132137
    133138                if(self::is_excluded($url)) continue;
    134                
     139
    135140                // We wont process any js that is not present on this WordPress install
    136141                if(strpos($url, $site_host) === FALSE){
    137142                    continue;
    138143                }
    139                
     144
    140145                $file_path = Util::url_to_path($url);
    141146
     
    145150
    146151                $combined_js = file_get_contents($file_path) . "\n" . $combined_js;
    147                
     152
    148153                // Removing the JS which has already been combined, as we will add the combined file at the top after title.
    149154                if(!empty($prev_tag)){
    150155                    $content = str_replace($prev_tag, '', $content);
    151156                }
    152                
     157
    153158                // We remove the previous tag, in current iteration, so at last we have a tag to replace wirh the combined script.
    154159                $prev_tag = $tag[0];
     
    178183
    179184            $combined_path = $asset_path.$file_name;
     185           
     186            if(!file_exists($combined_path) && defined('SPEEDYCACHE_PRO')){
     187                $speedycache->asset_stats += strlen($combined_js); // Updating the stats
     188            }
    180189
    181190            file_put_contents($combined_path, $combined_js);
     
    184193            // Injecting the Combined JS
    185194            if(!empty($prev_tag)){
    186                 $content = str_replace($prev_tag, '<script src="'.esc_url($final_url).'" />', $content);
    187                 return;
    188             }
    189 
    190             $content = str_replace('</title>', "</title>\n".'<script src="'.esc_url($final_url).'"/>', $content);
     195                $content = str_replace($prev_tag, '<script src="'.esc_url($final_url).'" ></script>', $content);
     196                return;
     197            }           
     198
     199            $content = str_replace('</title>', "</title>\n".'<script src="'.esc_url($final_url).'"></script>', $content);
    191200       
    192201        }
  • speedycache/trunk/readme.txt

    r3422926 r3490058  
    55Tested up to: 6.9
    66Requires PHP: 7.0
    7 Stable tag: 1.3.7
     7Stable tag: 1.3.8
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    148148== Changelog ==
    149149
     150= 1.3.8 (24rd March 2026) =
     151* [Improvement] SpeedyCache now honors DONOTCACHEPAGE constant.
     152* [Bug-Fix Pro] wp_cache_flush_runtime was flushing Redis cache as well, this has been fixed to flush only the PHP object cache.
     153* [Bug-Fix Pro] Images converted to webp using "Modern Image Formats" plugin were shown in the list of images to be optimized in SpeedyCache Image optimization, this has been fixed.
     154* [Bug-Fix Pro] When doing Optimize all in image optimization, for some errors the response was being returned as null this has been fixed.
     155* [Bug-Fix] Cache lifespan was not deleting the directories, this has been fixed.
     156* [Bug-Fix] Password protected pages were getting cached once a correct password was entered, this has been fixed.
     157* [Bug-Fix] Combine JS was adding self closing script tag, this has been fixed.
     158* [Task] Calculation of memory used by File based cache was calculated on every settings page load. This has been changed to caching the file size in options table, for faster retrieval.
     159
    150160= 1.3.7 (18th December 2025) =
    151161* [Feature Pro] Auto optimization for database added.
  • speedycache/trunk/speedycache.php

    r3422926 r3490058  
    44Plugin URI: https://speedycache.com
    55Description: SpeedyCache is a plugin that helps you reduce the load time of your website by means of caching, minification, and compression of your website.
    6 Version: 1.3.7
     6Version: 1.3.8
    77Author: Softaculous Team
    88Author URI: https://speedycache.com/
     
    5252}
    5353
    54 define('SPEEDYCACHE_VERSION', '1.3.7');
     54define('SPEEDYCACHE_VERSION', '1.3.8');
    5555define('SPEEDYCACHE_DIR', dirname(__FILE__));
    5656define('SPEEDYCACHE_FILE', __FILE__);
     
    133133    $speedycache->object = get_option('speedycache_object_cache', ['admin' => true, 'persistent' => true]);
    134134    $speedycache->bloat = get_option('speedycache_bloat', []);
     135    $speedycache->asset_stats = 0;
     136    $speedycache->html_size = (int) get_option('speedycache_html_size', 0);
    135137   
    136138    if(!is_dir(SPEEDYCACHE_CACHE_DIR) && is_writable(WP_CONTENT_DIR)){
Note: See TracChangeset for help on using the changeset viewer.