Plugin Directory

Changeset 3460794


Ignore:
Timestamp:
02/13/2026 01:50:40 PM (7 days ago)
Author:
hostspa
Message:

1.5.16
Fix to restore the original htaccess when the plugin is deactivated
Page cache and htaccess cache enabled by default for 1 day to allow the plugin to work immediately after activation

Location:
fastcache-by-host-it
Files:
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • fastcache-by-host-it/tags/1.5.16/README.txt

    r3458784 r3460794  
    55Tested up to: 6.9.1
    66Requires PHP: 8.0
    7 Stable Tag: 1.5.15
     7Stable Tag: 1.5.16
    88License: GPL-2.0+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    132132
    133133== Changelog ==
     1341.5.16
     135Fix to restore the original htaccess when the plugin is deactivated
     136Page cache and htaccess cache enabled by default for 1 day to allow the plugin to work immediately after activation
     137
    1341381.5.15
    135139New feature for Import and Export configuration
  • fastcache-by-host-it/tags/1.5.16/fastcache.php

    r3458784 r3460794  
    1717 * Plugin URI:        https://fastcache.host.it/wordpress/
    1818 * Description:       Abilita il tuo sito Wordpress alla prima vera CDN realizzata PER Wordpress e configurata AD-HOC per il tuo sito. Il massimo della velocità senza difficoltà di setup.
    19  * Version:           1.5.15
     19 * Version:           1.5.16
    2020 * Author:            Host.it
    2121 * Author URI:        https://fastcache.host.it/
     
    4545define ( '_WP_EXEC', '1' );
    4646define ( '_FASTCACHE_EXEC', 1 );
    47 define ( 'FASTCACHE_VERSION', '1.5.15' );
     47define ( 'FASTCACHE_VERSION', '1.5.16' );
    4848define ( 'FASTCACHE_FILE_PATH', __FILE__ );
    4949
  • fastcache-by-host-it/tags/1.5.16/media/js/tabs-state.js

    r3458155 r3460794  
    1212    var loadTabs = function() {
    1313        var storageKey = 'active-tabs-fc';
    14         var $tabs = $('a[data-tab-toggle="tab"]');
     14        var $tabs = $('a[data-tab-toggle="tab"],a[data-bs-toggle="tab"]');
    1515        var $panes = $('.tab-pane');
    1616
     
    2323
    2424            // Activate target tab
    25             var $targetTab = $('a[data-tab-toggle="tab"][href="' + href + '"]');
     25            var $targetTab = $('a[data-tab-toggle="tab"][href="' + href + '"],a[data-bs-toggle="tab"][href="' + href + '"]');
    2626            if ($targetTab.length) {
    2727                $targetTab.addClass('active');
  • fastcache-by-host-it/tags/1.5.16/src/Admin.php

    r3458280 r3460794  
    270270        $admin_bar->add_node( $aArgs );
    271271       
    272         if ($params->get('htaccess_cache_enable', 0) == 1)
     272        if ($params->get('htaccess_cache_enable', 1) == 1)
    273273        {
    274274            $aArgs = [
  • fastcache-by-host-it/tags/1.5.16/src/Admin/Settings/Renderer/Setting.php

    r3458155 r3460794  
    216216    }
    217217    public static function cache_enable() {
    218         echo Html::_ ( 'radio', 'cache_enable', '0' );
     218        echo Html::_ ( 'radio', 'cache_enable', '1' );
    219219    }
    220220    public static function htaccess_cache_enable() {
    221         echo Html::_ ( 'radio', 'htaccess_cache_enable', '0' );
     221        echo Html::_ ( 'radio', 'htaccess_cache_enable', '1' );
    222222    }
    223223    public static function pro_cache_platform() {
     
    240240        ];
    241241       
    242         echo Html::_ ( 'select', 'page_cache_lifetime', '600', $aOptions );
     242        echo Html::_ ( 'select', 'page_cache_lifetime', '86400', $aOptions );
    243243    }
    244244    public static function cache_exclude() {
  • fastcache-by-host-it/tags/1.5.16/src/Admin/templates

    • Property svn:ignore set to
      compiled
  • fastcache-by-host-it/tags/1.5.16/src/Admin/templates/compiled/46326b4df04382cb68b5bc29da6400fa1b43533f.php

    r3458155 r3460794  
    5252    </div>
    5353   
    54     <div class="clearfix-both grid mt-3">
    55         <div class="g-col-12 g-col-lg-2">
    56             <ul class="nav flex-wrap flex-md-column nav-pills p-4">
    57                 <li class="nav-item">
    58                     <a class="nav-link page-cache-tab" href="#page-cache-tab" data-bs-toggle="tab">
     54    <div class="grid grid-cols-[16_84] gap-6 py-2" style="gap:1.5rem!important; ">
     55        <div class="rounded-lg shadow-sm border ">
     56            <ul class="grid grid-cols-[1fr] overflow-x-auto md:flex-col gap-1 bg-slate-50 rounded-lg">
     57                <li class="w-full px-4 pt-4">
     58                    <a class=" page-cache-tab block px-4 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#page-cache-tab" data-tab-toggle="tab">
    5959                        <div>
    6060                            <div class="tab-item"><?php echo __('Page Cache', 'fastcache'); ?></div>
     
    6262                    </a>
    6363                </li>
    64                 <li class="nav-item">
    65                     <a class="nav-link fastcache-cdn-tab" href="#fastcache-cdn-tab" data-bs-toggle="tab">
     64                <li class="w-full px-4">
     65                    <a class=" fastcache-cdn-tab block px-4 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#fastcache-cdn-tab" data-tab-toggle="tab">
    6666                        <div>
    6767                            <div class="tab-item"><?php echo __('FastCache CDN', 'fastcache'); ?></div>
     
    6969                    </a>
    7070                </li>
    71                 <li class="nav-item">
    72                     <a class="nav-link autoconfiguration-tab" href="#autoconfiguration-tab" data-bs-toggle="tab">
     71                <li class="w-full px-4">
     72                    <a class=" autoconfiguration-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#autoconfiguration-tab" data-tab-toggle="tab">
    7373                        <div>
    7474                            <div class="tab-item"><?php echo __('Auto configuration', 'fastcache'); ?></div>
     
    7676                    </a>
    7777                </li>
    78                 <li class="nav-item">
    79                     <a class="nav-link general-tab" href="#general-tab" data-bs-toggle="tab">
     78                <li class="w-full px-4">
     79                    <a class=" general-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#general-tab" data-tab-toggle="tab">
    8080                        <div>
    8181                            <div class="tab-item"><?php echo __('Optimizations', 'fastcache'); ?></div>
     
    8383                    </a>
    8484                </li>
    85                 <li class="nav-item">
    86                     <a class="nav-link assets-inclusions" href="#assets-inclusions" data-bs-toggle="tab">
     85                <li class="w-full px-4">
     86                    <a class=" assets-inclusions block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#assets-inclusions" data-tab-toggle="tab">
    8787                        <div>
    8888                            <div class="tab-item"><?php echo __('Assets Inclusions', 'fastcache'); ?></div>
     
    9090                    </a>
    9191                </li>
    92                 <li class="nav-item">
    93                     <a class="nav-link assets-exclusions" href="#assets-exclusions" data-bs-toggle="tab">
     92                <li class="w-full px-4">
     93                    <a class=" assets-exclusions block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#assets-exclusions" data-tab-toggle="tab">
    9494                        <div>
    9595                            <div class="tab-item"><?php echo __('Assets Exclusions', 'fastcache'); ?></div>
     
    9797                    </a>
    9898                </li>
    99                 <li class="nav-item">
    100                     <a class="nav-link lazy-load-tab" href="#lazy-load-tab" data-bs-toggle="tab">
     99                <li class="w-full px-4">
     100                    <a class=" lazy-load-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#lazy-load-tab" data-tab-toggle="tab">
    101101                        <div>
    102102                            <div class="tab-item"><?php echo __('Lazy Load', 'fastcache'); ?></div>
     
    104104                    </a>
    105105                </li>
    106                 <li class="nav-item">
    107                     <a class="nav-link optimize-image-tab" href="#optimize-image-tab" data-bs-toggle="tab">
     106                <li class="w-full px-4">
     107                    <a class=" optimize-image-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#optimize-image-tab" data-tab-toggle="tab">
    108108                        <div>
    109109                            <div class="tab-item"><?php echo __('Optimize Images', 'fastcache'); ?></div>
     
    111111                    </a>
    112112                </li>
    113                 <li class="nav-item">
    114                     <a class="nav-link remove-tab" href="#remove-tab" data-bs-toggle="tab">
     113                <li class="w-full px-4">
     114                    <a class=" remove-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#remove-tab" data-tab-toggle="tab">
    115115                        <div>
    116116                            <div class="tab-item"><?php echo __('Assets Management', 'fastcache'); ?></div>
     
    118118                    </a>
    119119                </li>
    120                 <li class="nav-item">
    121                     <a class="nav-link http2-tab" href="#http2-tab" data-bs-toggle="tab">
     120                <li class="w-full px-4">
     121                    <a class=" http2-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#http2-tab" data-tab-toggle="tab">
    122122                        <div>
    123123                            <div class="tab-item"><?php echo __('Http/2', 'fastcache'); ?></div>
     
    125125                    </a>
    126126                </li>
    127                 <li class="nav-item">
    128                     <a class="nav-link media-tab" href="#media-tab" data-bs-toggle="tab">
     127                <li class="w-full px-4">
     128                    <a class=" media-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#media-tab" data-tab-toggle="tab">
    129129                        <div>
    130130                            <div class="tab-item"><?php echo __('Combine Images', 'fastcache'); ?></div>
     
    132132                    </a>
    133133                </li>
    134                 <li class="nav-item">
    135                     <a class="nav-link miscellaneous-tab" href="#miscellaneous-tab" data-bs-toggle="tab">
     134                <li class="w-full px-4">
     135                    <a class=" miscellaneous-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#miscellaneous-tab" data-tab-toggle="tab">
    136136                        <div>
    137137                            <div class="tab-item"><?php echo __('Advanced','fastcache'); ?></div>
     
    139139                    </a>
    140140                </li>
    141                 <li class="nav-item">
    142                     <a class="nav-link speedtest-tab" href="#speedtest-tab" data-bs-toggle="tab">
     141                <li class="w-full px-4">
     142                    <a class=" speedtest-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#speedtest-tab" data-tab-toggle="tab">
    143143                        <div>
    144144                            <div class="tab-item"><?php echo __('Speed Test','fastcache'); ?></div>
     
    146146                    </a>
    147147                </li>
    148                 <li class="nav-item">
    149                     <a class="nav-link diagnostic-tab" href="#diagnostic-tab" data-bs-toggle="tab">
     148                <li class="w-full px-4">
     149                    <a class=" diagnostic-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#diagnostic-tab" data-tab-toggle="tab">
    150150                        <div>
    151151                            <div class="tab-item"><?php echo __('Diagnostic','fastcache'); ?></div>
     
    153153                    </a>
    154154                </li>
     155                <li class="w-full px-4">
     156                    <a class=" transfer-config-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#transfer-config-tab" data-tab-toggle="tab">
     157                        <div>
     158                            <div class="tab-item"><?php echo __('Transfer Configuration','fastcache'); ?></div>
     159                        </div>
     160                    </a>
     161                </li>
    155162            </ul>
    156163        </div>
    157         <div class="g-col-12 g-col-lg-10 ms-2">
     164        <div class="flex-1 w-full min-w-0">
    158165            <?php echo \FastCache\Admin\Settings\TabContent::start(); ?>
    159166
  • fastcache-by-host-it/tags/1.5.16/src/Core/PageCache.php

    r3458155 r3460794  
    4848        if (! $sCacheId) {
    4949            $params = Plugin::getPluginParams ();
    50             if ($params->get ( 'htaccess_cache_enable', '0' )) {
     50            if ($params->get ( 'htaccess_cache_enable', '1' )) {
    5151                $siteUrl = site_url ();
    5252
     
    118118
    119119        // Se il caching via htaccess è attivo, aggiungi i controlli metodo e XHR
    120         if ($params->get('htaccess_cache_enable', '0')) {
     120        if ($params->get('htaccess_cache_enable', '1')) {
    121121           
    122122            // Escludi richieste con metodo diverso da GET o HEAD
     
    142142        }
    143143
    144         if ($params->get ( 'cache_enable', '0' ) && Utility::isGuest () && ! self::isExcluded ( $params )) {
     144        if ($params->get ( 'cache_enable', '1' ) && Utility::isGuest () && ! self::isExcluded ( $params )) {
    145145            return true;
    146146        }
  • fastcache-by-host-it/tags/1.5.16/src/Core/Platform/Cache.php

    r3458155 r3460794  
    118118        $content = apply_filters ( 'fastcache_save_content', $content );
    119119
    120         if ($page_cache && $params->get ( 'htaccess_cache_enable', '0' )) {
     120        if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) {
    121121            $file_contents = $content;
    122122        } else {
     
    398398            if (! $page_cache_lifetime) {
    399399                $params = Plugin::getPluginParams ();
    400                 $page_cache_lifetime = $params->get ( 'page_cache_lifetime', '43200' );
     400                $page_cache_lifetime = $params->get ( 'page_cache_lifetime', '86400' );
    401401            }
    402402
     
    422422    private static function _getFileName($id, $page_cache = false) {
    423423        $params = Plugin::getPluginParams ();
    424         if ($page_cache && $params->get ( 'htaccess_cache_enable', '0' )) {
     424        if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) {
    425425            return FASTCACHE_CACHE_DIR . 'page/' . $id . '.html';
    426         } elseif ($page_cache && ! $params->get ( 'htaccess_cache_enable', '0' )) {
     426        } elseif ($page_cache && ! $params->get ( 'htaccess_cache_enable', '1' )) {
    427427            return FASTCACHE_CACHE_DIR . 'page/' . md5 ( NONCE_SALT . $id ) . '.wpc';
    428428        } else {
     
    443443        $content = $wp_filesystem->get_contents ( $file );
    444444
    445         if ($page_cache && $params->get ( 'htaccess_cache_enable', '0' )) {
     445        if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) {
    446446            return $content;
    447447        }
  • fastcache-by-host-it/tags/1.5.16/src/Core/Platform/Plugin.php

    r3458784 r3460794  
    1515
    1616use FastCache\Core\Interfaces\Plugin as PluginInterface;
     17use FastCache\Core\Admin\Tasks;
    1718use FastCache\Dispatcher;
    1819
     
    7273    public static function activate()
    7374    {
    74         self::setHtaccessCacheEnableSwitch();
     75        $currentSettings = Plugin::getPluginParams()->toArray();
     76        if(!isset($currentSettings['htaccess_cache_enable']) || (isset($currentSettings['htaccess_cache_enable']) && (int)$currentSettings['htaccess_cache_enable'] == 1)) {
     77            self::setHtaccessCacheEnableSwitch(true);
     78        }
    7579        $settings = get_option(FASTCACHEHOST_HOST_PLUGINNAME_SETTINGS);
    7680        if (!$settings) {
     
    8185    }
    8286    public static function update(): void {
    83         self::setHtaccessCacheEnableSwitch();
    8487        self::hookToLicense('update');
    8588    }
    8689    public static function deactivate()
    8790    {
    88         self::setHtaccessCacheEnableSwitch();
     91        self::setHtaccessCacheEnableSwitch(false);
    8992        self::hookToLicense('deactivate');
     93        // Clean the htaccess file to remove the old rules, the new ones will be added by the activation hook of the plugin
     94        Tasks::cleanHtaccess();
    9095    }
    9196
    9297    public static function uninstall()
    9398    {
    94         self::hookToLicense('uninstall');       
     99        self::hookToLicense('uninstall');
     100        // Clean the htaccess file to remove the old rules, the new ones will be added by the activation hook of the plugin
     101        Tasks::cleanHtaccess();
    95102    }
    96     public static function setHtaccessCacheEnableSwitch(){
     103    public static function setHtaccessCacheEnableSwitch($enable){
    97104        $currentSettings = Plugin::getPluginParams()->toArray();
    98105        // Reactivate simulate the enable of htaccess_cache_enable
    99         if(isset($currentSettings['htaccess_cache_enable']) && (int)$currentSettings['htaccess_cache_enable'] == 1) {
    100             $postedSettings = [];
    101             $postedSettings ['htaccess_cache_enable'] = -1;
    102             Utility::htaccessCacheManagement($postedSettings);
    103         }
     106        $postedSettings = [];
     107        $postedSettings ['htaccess_cache_enable'] = 'auto';
     108        Utility::htaccessCacheManagement($postedSettings, $enable);
    104109    }
    105110    public static function hookToLicense($action){
     
    137142        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    138143        $response = curl_exec($ch);
    139         // fwrite($h,date('Y-m-d H:i:s').' 2 ' .$response. "\n");
    140         // fclose($h);
     144
    141145    }
    142146}
  • fastcache-by-host-it/tags/1.5.16/src/Core/Platform/Utility.php

    r3458784 r3460794  
    370370    }
    371371   
    372     public static function htaccessCacheManagement($postedSettings) {
     372    public static function htaccessCacheManagement($postedSettings, $enable = null) {
    373373        $currentSettings = Plugin::getPluginParams()->toArray();
    374374        $currentHtaccessCacheEnable = isset($currentSettings['htaccess_cache_enable']) ? (int)$currentSettings['htaccess_cache_enable'] : 0;
    375         $postedHtaccessCacheEnable = (int)$postedSettings['htaccess_cache_enable'];
     375        $postedHtaccessCacheEnable = $postedSettings['htaccess_cache_enable'];
    376376       
    377         if($currentHtaccessCacheEnable != $postedHtaccessCacheEnable) {
     377        if((int)$currentHtaccessCacheEnable != (int)$postedHtaccessCacheEnable || $postedHtaccessCacheEnable === 'auto') {
    378378            $htaccess = Paths::rootPath() . '/.htaccess';
    379379           
     
    518518                $regex = '~^[ \t]*## BEGIN HTACCESS PAGE CACHING - FASTCACHE[^\r\n]*\R.*?^[ \t]*## END HTACCESS PAGE CACHING - FASTCACHE[^\r\n]*\R?~sm';
    519519
    520                 if ($postedHtaccessCacheEnable == 1 || $postedHtaccessCacheEnable == -1) {
     520                if ($postedHtaccessCacheEnable == 1 || $postedHtaccessCacheEnable == -1 || $enable === true) {
    521521
    522522                    // 1) Rimuovi TUTTE le occorrenze (anche duplicate, anche legacy)
     
    532532                    return file_put_contents($htaccess, $htaccessPageCache . $contents);
    533533
    534                 } elseif ($postedHtaccessCacheEnable == 0 || $postedHtaccessCacheEnable == -1) {
     534                } elseif ($postedHtaccessCacheEnable == 0 || $postedHtaccessCacheEnable == -1 || $enable === false) {
    535535
    536536                    // Disable: rimuovi TUTTI i blocchi
     
    554554    }
    555555    public static function isPageCacheEnabled(Settings $oParams) {
    556         return ( bool ) $oParams->get ( 'cache_enable', '0' );
     556        return ( bool ) $oParams->get ( 'cache_enable', '1' );
    557557    }
    558558    public static function isPluginEnabled() {
  • fastcache-by-host-it/trunk/README.txt

    r3458784 r3460794  
    55Tested up to: 6.9.1
    66Requires PHP: 8.0
    7 Stable Tag: 1.5.15
     7Stable Tag: 1.5.16
    88License: GPL-2.0+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    132132
    133133== Changelog ==
     1341.5.16
     135Fix to restore the original htaccess when the plugin is deactivated
     136Page cache and htaccess cache enabled by default for 1 day to allow the plugin to work immediately after activation
     137
    1341381.5.15
    135139New feature for Import and Export configuration
  • fastcache-by-host-it/trunk/fastcache.php

    r3458784 r3460794  
    1717 * Plugin URI:        https://fastcache.host.it/wordpress/
    1818 * Description:       Abilita il tuo sito Wordpress alla prima vera CDN realizzata PER Wordpress e configurata AD-HOC per il tuo sito. Il massimo della velocità senza difficoltà di setup.
    19  * Version:           1.5.15
     19 * Version:           1.5.16
    2020 * Author:            Host.it
    2121 * Author URI:        https://fastcache.host.it/
     
    4545define ( '_WP_EXEC', '1' );
    4646define ( '_FASTCACHE_EXEC', 1 );
    47 define ( 'FASTCACHE_VERSION', '1.5.15' );
     47define ( 'FASTCACHE_VERSION', '1.5.16' );
    4848define ( 'FASTCACHE_FILE_PATH', __FILE__ );
    4949
  • fastcache-by-host-it/trunk/media/js/tabs-state.js

    r3458155 r3460794  
    1212    var loadTabs = function() {
    1313        var storageKey = 'active-tabs-fc';
    14         var $tabs = $('a[data-tab-toggle="tab"]');
     14        var $tabs = $('a[data-tab-toggle="tab"],a[data-bs-toggle="tab"]');
    1515        var $panes = $('.tab-pane');
    1616
     
    2323
    2424            // Activate target tab
    25             var $targetTab = $('a[data-tab-toggle="tab"][href="' + href + '"]');
     25            var $targetTab = $('a[data-tab-toggle="tab"][href="' + href + '"],a[data-bs-toggle="tab"][href="' + href + '"]');
    2626            if ($targetTab.length) {
    2727                $targetTab.addClass('active');
  • fastcache-by-host-it/trunk/src/Admin.php

    r3458280 r3460794  
    270270        $admin_bar->add_node( $aArgs );
    271271       
    272         if ($params->get('htaccess_cache_enable', 0) == 1)
     272        if ($params->get('htaccess_cache_enable', 1) == 1)
    273273        {
    274274            $aArgs = [
  • fastcache-by-host-it/trunk/src/Admin/Settings/Renderer/Setting.php

    r3458155 r3460794  
    216216    }
    217217    public static function cache_enable() {
    218         echo Html::_ ( 'radio', 'cache_enable', '0' );
     218        echo Html::_ ( 'radio', 'cache_enable', '1' );
    219219    }
    220220    public static function htaccess_cache_enable() {
    221         echo Html::_ ( 'radio', 'htaccess_cache_enable', '0' );
     221        echo Html::_ ( 'radio', 'htaccess_cache_enable', '1' );
    222222    }
    223223    public static function pro_cache_platform() {
     
    240240        ];
    241241       
    242         echo Html::_ ( 'select', 'page_cache_lifetime', '600', $aOptions );
     242        echo Html::_ ( 'select', 'page_cache_lifetime', '86400', $aOptions );
    243243    }
    244244    public static function cache_exclude() {
  • fastcache-by-host-it/trunk/src/Admin/templates

    • Property svn:ignore set to
      compiled
  • fastcache-by-host-it/trunk/src/Admin/templates/compiled/46326b4df04382cb68b5bc29da6400fa1b43533f.php

    r3458155 r3460794  
    5252    </div>
    5353   
    54     <div class="clearfix-both grid mt-3">
    55         <div class="g-col-12 g-col-lg-2">
    56             <ul class="nav flex-wrap flex-md-column nav-pills p-4">
    57                 <li class="nav-item">
    58                     <a class="nav-link page-cache-tab" href="#page-cache-tab" data-bs-toggle="tab">
     54    <div class="grid grid-cols-[16_84] gap-6 py-2" style="gap:1.5rem!important; ">
     55        <div class="rounded-lg shadow-sm border ">
     56            <ul class="grid grid-cols-[1fr] overflow-x-auto md:flex-col gap-1 bg-slate-50 rounded-lg">
     57                <li class="w-full px-4 pt-4">
     58                    <a class=" page-cache-tab block px-4 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#page-cache-tab" data-tab-toggle="tab">
    5959                        <div>
    6060                            <div class="tab-item"><?php echo __('Page Cache', 'fastcache'); ?></div>
     
    6262                    </a>
    6363                </li>
    64                 <li class="nav-item">
    65                     <a class="nav-link fastcache-cdn-tab" href="#fastcache-cdn-tab" data-bs-toggle="tab">
     64                <li class="w-full px-4">
     65                    <a class=" fastcache-cdn-tab block px-4 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#fastcache-cdn-tab" data-tab-toggle="tab">
    6666                        <div>
    6767                            <div class="tab-item"><?php echo __('FastCache CDN', 'fastcache'); ?></div>
     
    6969                    </a>
    7070                </li>
    71                 <li class="nav-item">
    72                     <a class="nav-link autoconfiguration-tab" href="#autoconfiguration-tab" data-bs-toggle="tab">
     71                <li class="w-full px-4">
     72                    <a class=" autoconfiguration-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#autoconfiguration-tab" data-tab-toggle="tab">
    7373                        <div>
    7474                            <div class="tab-item"><?php echo __('Auto configuration', 'fastcache'); ?></div>
     
    7676                    </a>
    7777                </li>
    78                 <li class="nav-item">
    79                     <a class="nav-link general-tab" href="#general-tab" data-bs-toggle="tab">
     78                <li class="w-full px-4">
     79                    <a class=" general-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#general-tab" data-tab-toggle="tab">
    8080                        <div>
    8181                            <div class="tab-item"><?php echo __('Optimizations', 'fastcache'); ?></div>
     
    8383                    </a>
    8484                </li>
    85                 <li class="nav-item">
    86                     <a class="nav-link assets-inclusions" href="#assets-inclusions" data-bs-toggle="tab">
     85                <li class="w-full px-4">
     86                    <a class=" assets-inclusions block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#assets-inclusions" data-tab-toggle="tab">
    8787                        <div>
    8888                            <div class="tab-item"><?php echo __('Assets Inclusions', 'fastcache'); ?></div>
     
    9090                    </a>
    9191                </li>
    92                 <li class="nav-item">
    93                     <a class="nav-link assets-exclusions" href="#assets-exclusions" data-bs-toggle="tab">
     92                <li class="w-full px-4">
     93                    <a class=" assets-exclusions block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#assets-exclusions" data-tab-toggle="tab">
    9494                        <div>
    9595                            <div class="tab-item"><?php echo __('Assets Exclusions', 'fastcache'); ?></div>
     
    9797                    </a>
    9898                </li>
    99                 <li class="nav-item">
    100                     <a class="nav-link lazy-load-tab" href="#lazy-load-tab" data-bs-toggle="tab">
     99                <li class="w-full px-4">
     100                    <a class=" lazy-load-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#lazy-load-tab" data-tab-toggle="tab">
    101101                        <div>
    102102                            <div class="tab-item"><?php echo __('Lazy Load', 'fastcache'); ?></div>
     
    104104                    </a>
    105105                </li>
    106                 <li class="nav-item">
    107                     <a class="nav-link optimize-image-tab" href="#optimize-image-tab" data-bs-toggle="tab">
     106                <li class="w-full px-4">
     107                    <a class=" optimize-image-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#optimize-image-tab" data-tab-toggle="tab">
    108108                        <div>
    109109                            <div class="tab-item"><?php echo __('Optimize Images', 'fastcache'); ?></div>
     
    111111                    </a>
    112112                </li>
    113                 <li class="nav-item">
    114                     <a class="nav-link remove-tab" href="#remove-tab" data-bs-toggle="tab">
     113                <li class="w-full px-4">
     114                    <a class=" remove-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#remove-tab" data-tab-toggle="tab">
    115115                        <div>
    116116                            <div class="tab-item"><?php echo __('Assets Management', 'fastcache'); ?></div>
     
    118118                    </a>
    119119                </li>
    120                 <li class="nav-item">
    121                     <a class="nav-link http2-tab" href="#http2-tab" data-bs-toggle="tab">
     120                <li class="w-full px-4">
     121                    <a class=" http2-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#http2-tab" data-tab-toggle="tab">
    122122                        <div>
    123123                            <div class="tab-item"><?php echo __('Http/2', 'fastcache'); ?></div>
     
    125125                    </a>
    126126                </li>
    127                 <li class="nav-item">
    128                     <a class="nav-link media-tab" href="#media-tab" data-bs-toggle="tab">
     127                <li class="w-full px-4">
     128                    <a class=" media-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#media-tab" data-tab-toggle="tab">
    129129                        <div>
    130130                            <div class="tab-item"><?php echo __('Combine Images', 'fastcache'); ?></div>
     
    132132                    </a>
    133133                </li>
    134                 <li class="nav-item">
    135                     <a class="nav-link miscellaneous-tab" href="#miscellaneous-tab" data-bs-toggle="tab">
     134                <li class="w-full px-4">
     135                    <a class=" miscellaneous-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#miscellaneous-tab" data-tab-toggle="tab">
    136136                        <div>
    137137                            <div class="tab-item"><?php echo __('Advanced','fastcache'); ?></div>
     
    139139                    </a>
    140140                </li>
    141                 <li class="nav-item">
    142                     <a class="nav-link speedtest-tab" href="#speedtest-tab" data-bs-toggle="tab">
     141                <li class="w-full px-4">
     142                    <a class=" speedtest-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#speedtest-tab" data-tab-toggle="tab">
    143143                        <div>
    144144                            <div class="tab-item"><?php echo __('Speed Test','fastcache'); ?></div>
     
    146146                    </a>
    147147                </li>
    148                 <li class="nav-item">
    149                     <a class="nav-link diagnostic-tab" href="#diagnostic-tab" data-bs-toggle="tab">
     148                <li class="w-full px-4">
     149                    <a class=" diagnostic-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#diagnostic-tab" data-tab-toggle="tab">
    150150                        <div>
    151151                            <div class="tab-item"><?php echo __('Diagnostic','fastcache'); ?></div>
     
    153153                    </a>
    154154                </li>
     155                <li class="w-full px-4">
     156                    <a class=" transfer-config-tab block px-3 py-2 rounded-md text-sm font-medium text-slate-600 hover:bg-white hover:text-blue-400! transition-colors [&.active]:bg-blue-400/30 [&.active]:text-blue-400! [&.active]:shadow-sm text-decoration-none" href="#transfer-config-tab" data-tab-toggle="tab">
     157                        <div>
     158                            <div class="tab-item"><?php echo __('Transfer Configuration','fastcache'); ?></div>
     159                        </div>
     160                    </a>
     161                </li>
    155162            </ul>
    156163        </div>
    157         <div class="g-col-12 g-col-lg-10 ms-2">
     164        <div class="flex-1 w-full min-w-0">
    158165            <?php echo \FastCache\Admin\Settings\TabContent::start(); ?>
    159166
  • fastcache-by-host-it/trunk/src/Core/PageCache.php

    r3458155 r3460794  
    4848        if (! $sCacheId) {
    4949            $params = Plugin::getPluginParams ();
    50             if ($params->get ( 'htaccess_cache_enable', '0' )) {
     50            if ($params->get ( 'htaccess_cache_enable', '1' )) {
    5151                $siteUrl = site_url ();
    5252
     
    118118
    119119        // Se il caching via htaccess è attivo, aggiungi i controlli metodo e XHR
    120         if ($params->get('htaccess_cache_enable', '0')) {
     120        if ($params->get('htaccess_cache_enable', '1')) {
    121121           
    122122            // Escludi richieste con metodo diverso da GET o HEAD
     
    142142        }
    143143
    144         if ($params->get ( 'cache_enable', '0' ) && Utility::isGuest () && ! self::isExcluded ( $params )) {
     144        if ($params->get ( 'cache_enable', '1' ) && Utility::isGuest () && ! self::isExcluded ( $params )) {
    145145            return true;
    146146        }
  • fastcache-by-host-it/trunk/src/Core/Platform/Cache.php

    r3458155 r3460794  
    118118        $content = apply_filters ( 'fastcache_save_content', $content );
    119119
    120         if ($page_cache && $params->get ( 'htaccess_cache_enable', '0' )) {
     120        if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) {
    121121            $file_contents = $content;
    122122        } else {
     
    398398            if (! $page_cache_lifetime) {
    399399                $params = Plugin::getPluginParams ();
    400                 $page_cache_lifetime = $params->get ( 'page_cache_lifetime', '43200' );
     400                $page_cache_lifetime = $params->get ( 'page_cache_lifetime', '86400' );
    401401            }
    402402
     
    422422    private static function _getFileName($id, $page_cache = false) {
    423423        $params = Plugin::getPluginParams ();
    424         if ($page_cache && $params->get ( 'htaccess_cache_enable', '0' )) {
     424        if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) {
    425425            return FASTCACHE_CACHE_DIR . 'page/' . $id . '.html';
    426         } elseif ($page_cache && ! $params->get ( 'htaccess_cache_enable', '0' )) {
     426        } elseif ($page_cache && ! $params->get ( 'htaccess_cache_enable', '1' )) {
    427427            return FASTCACHE_CACHE_DIR . 'page/' . md5 ( NONCE_SALT . $id ) . '.wpc';
    428428        } else {
     
    443443        $content = $wp_filesystem->get_contents ( $file );
    444444
    445         if ($page_cache && $params->get ( 'htaccess_cache_enable', '0' )) {
     445        if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) {
    446446            return $content;
    447447        }
  • fastcache-by-host-it/trunk/src/Core/Platform/Plugin.php

    r3458784 r3460794  
    1515
    1616use FastCache\Core\Interfaces\Plugin as PluginInterface;
     17use FastCache\Core\Admin\Tasks;
    1718use FastCache\Dispatcher;
    1819
     
    7273    public static function activate()
    7374    {
    74         self::setHtaccessCacheEnableSwitch();
     75        $currentSettings = Plugin::getPluginParams()->toArray();
     76        if(!isset($currentSettings['htaccess_cache_enable']) || (isset($currentSettings['htaccess_cache_enable']) && (int)$currentSettings['htaccess_cache_enable'] == 1)) {
     77            self::setHtaccessCacheEnableSwitch(true);
     78        }
    7579        $settings = get_option(FASTCACHEHOST_HOST_PLUGINNAME_SETTINGS);
    7680        if (!$settings) {
     
    8185    }
    8286    public static function update(): void {
    83         self::setHtaccessCacheEnableSwitch();
    8487        self::hookToLicense('update');
    8588    }
    8689    public static function deactivate()
    8790    {
    88         self::setHtaccessCacheEnableSwitch();
     91        self::setHtaccessCacheEnableSwitch(false);
    8992        self::hookToLicense('deactivate');
     93        // Clean the htaccess file to remove the old rules, the new ones will be added by the activation hook of the plugin
     94        Tasks::cleanHtaccess();
    9095    }
    9196
    9297    public static function uninstall()
    9398    {
    94         self::hookToLicense('uninstall');       
     99        self::hookToLicense('uninstall');
     100        // Clean the htaccess file to remove the old rules, the new ones will be added by the activation hook of the plugin
     101        Tasks::cleanHtaccess();
    95102    }
    96     public static function setHtaccessCacheEnableSwitch(){
     103    public static function setHtaccessCacheEnableSwitch($enable){
    97104        $currentSettings = Plugin::getPluginParams()->toArray();
    98105        // Reactivate simulate the enable of htaccess_cache_enable
    99         if(isset($currentSettings['htaccess_cache_enable']) && (int)$currentSettings['htaccess_cache_enable'] == 1) {
    100             $postedSettings = [];
    101             $postedSettings ['htaccess_cache_enable'] = -1;
    102             Utility::htaccessCacheManagement($postedSettings);
    103         }
     106        $postedSettings = [];
     107        $postedSettings ['htaccess_cache_enable'] = 'auto';
     108        Utility::htaccessCacheManagement($postedSettings, $enable);
    104109    }
    105110    public static function hookToLicense($action){
     
    137142        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    138143        $response = curl_exec($ch);
    139         // fwrite($h,date('Y-m-d H:i:s').' 2 ' .$response. "\n");
    140         // fclose($h);
     144
    141145    }
    142146}
  • fastcache-by-host-it/trunk/src/Core/Platform/Utility.php

    r3458784 r3460794  
    370370    }
    371371   
    372     public static function htaccessCacheManagement($postedSettings) {
     372    public static function htaccessCacheManagement($postedSettings, $enable = null) {
    373373        $currentSettings = Plugin::getPluginParams()->toArray();
    374374        $currentHtaccessCacheEnable = isset($currentSettings['htaccess_cache_enable']) ? (int)$currentSettings['htaccess_cache_enable'] : 0;
    375         $postedHtaccessCacheEnable = (int)$postedSettings['htaccess_cache_enable'];
     375        $postedHtaccessCacheEnable = $postedSettings['htaccess_cache_enable'];
    376376       
    377         if($currentHtaccessCacheEnable != $postedHtaccessCacheEnable) {
     377        if((int)$currentHtaccessCacheEnable != (int)$postedHtaccessCacheEnable || $postedHtaccessCacheEnable === 'auto') {
    378378            $htaccess = Paths::rootPath() . '/.htaccess';
    379379           
     
    518518                $regex = '~^[ \t]*## BEGIN HTACCESS PAGE CACHING - FASTCACHE[^\r\n]*\R.*?^[ \t]*## END HTACCESS PAGE CACHING - FASTCACHE[^\r\n]*\R?~sm';
    519519
    520                 if ($postedHtaccessCacheEnable == 1 || $postedHtaccessCacheEnable == -1) {
     520                if ($postedHtaccessCacheEnable == 1 || $postedHtaccessCacheEnable == -1 || $enable === true) {
    521521
    522522                    // 1) Rimuovi TUTTE le occorrenze (anche duplicate, anche legacy)
     
    532532                    return file_put_contents($htaccess, $htaccessPageCache . $contents);
    533533
    534                 } elseif ($postedHtaccessCacheEnable == 0 || $postedHtaccessCacheEnable == -1) {
     534                } elseif ($postedHtaccessCacheEnable == 0 || $postedHtaccessCacheEnable == -1 || $enable === false) {
    535535
    536536                    // Disable: rimuovi TUTTI i blocchi
     
    554554    }
    555555    public static function isPageCacheEnabled(Settings $oParams) {
    556         return ( bool ) $oParams->get ( 'cache_enable', '0' );
     556        return ( bool ) $oParams->get ( 'cache_enable', '1' );
    557557    }
    558558    public static function isPluginEnabled() {
Note: See TracChangeset for help on using the changeset viewer.