Changeset 3460794
- Timestamp:
- 02/13/2026 01:50:40 PM (7 days ago)
- Location:
- fastcache-by-host-it
- Files:
-
- 22 edited
- 1 copied
-
tags/1.5.16 (copied) (copied from fastcache-by-host-it/trunk)
-
tags/1.5.16/README.txt (modified) (2 diffs)
-
tags/1.5.16/fastcache.php (modified) (2 diffs)
-
tags/1.5.16/media/js/tabs-state.js (modified) (2 diffs)
-
tags/1.5.16/src/Admin.php (modified) (1 diff)
-
tags/1.5.16/src/Admin/Settings/Renderer/Setting.php (modified) (2 diffs)
-
tags/1.5.16/src/Admin/templates (modified) (1 prop)
-
tags/1.5.16/src/Admin/templates/compiled/46326b4df04382cb68b5bc29da6400fa1b43533f.php (modified) (15 diffs)
-
tags/1.5.16/src/Core/PageCache.php (modified) (3 diffs)
-
tags/1.5.16/src/Core/Platform/Cache.php (modified) (4 diffs)
-
tags/1.5.16/src/Core/Platform/Plugin.php (modified) (4 diffs)
-
tags/1.5.16/src/Core/Platform/Utility.php (modified) (4 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/fastcache.php (modified) (2 diffs)
-
trunk/media/js/tabs-state.js (modified) (2 diffs)
-
trunk/src/Admin.php (modified) (1 diff)
-
trunk/src/Admin/Settings/Renderer/Setting.php (modified) (2 diffs)
-
trunk/src/Admin/templates (modified) (1 prop)
-
trunk/src/Admin/templates/compiled/46326b4df04382cb68b5bc29da6400fa1b43533f.php (modified) (15 diffs)
-
trunk/src/Core/PageCache.php (modified) (3 diffs)
-
trunk/src/Core/Platform/Cache.php (modified) (4 diffs)
-
trunk/src/Core/Platform/Plugin.php (modified) (4 diffs)
-
trunk/src/Core/Platform/Utility.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fastcache-by-host-it/tags/1.5.16/README.txt
r3458784 r3460794 5 5 Tested up to: 6.9.1 6 6 Requires PHP: 8.0 7 Stable Tag: 1.5.1 57 Stable Tag: 1.5.16 8 8 License: GPL-2.0+ 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 132 132 133 133 == Changelog == 134 1.5.16 135 Fix to restore the original htaccess when the plugin is deactivated 136 Page cache and htaccess cache enabled by default for 1 day to allow the plugin to work immediately after activation 137 134 138 1.5.15 135 139 New feature for Import and Export configuration -
fastcache-by-host-it/tags/1.5.16/fastcache.php
r3458784 r3460794 17 17 * Plugin URI: https://fastcache.host.it/wordpress/ 18 18 * 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.1 519 * Version: 1.5.16 20 20 * Author: Host.it 21 21 * Author URI: https://fastcache.host.it/ … … 45 45 define ( '_WP_EXEC', '1' ); 46 46 define ( '_FASTCACHE_EXEC', 1 ); 47 define ( 'FASTCACHE_VERSION', '1.5.1 5' );47 define ( 'FASTCACHE_VERSION', '1.5.16' ); 48 48 define ( 'FASTCACHE_FILE_PATH', __FILE__ ); 49 49 -
fastcache-by-host-it/tags/1.5.16/media/js/tabs-state.js
r3458155 r3460794 12 12 var loadTabs = function() { 13 13 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"]'); 15 15 var $panes = $('.tab-pane'); 16 16 … … 23 23 24 24 // 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 + '"]'); 26 26 if ($targetTab.length) { 27 27 $targetTab.addClass('active'); -
fastcache-by-host-it/tags/1.5.16/src/Admin.php
r3458280 r3460794 270 270 $admin_bar->add_node( $aArgs ); 271 271 272 if ($params->get('htaccess_cache_enable', 0) == 1)272 if ($params->get('htaccess_cache_enable', 1) == 1) 273 273 { 274 274 $aArgs = [ -
fastcache-by-host-it/tags/1.5.16/src/Admin/Settings/Renderer/Setting.php
r3458155 r3460794 216 216 } 217 217 public static function cache_enable() { 218 echo Html::_ ( 'radio', 'cache_enable', ' 0' );218 echo Html::_ ( 'radio', 'cache_enable', '1' ); 219 219 } 220 220 public static function htaccess_cache_enable() { 221 echo Html::_ ( 'radio', 'htaccess_cache_enable', ' 0' );221 echo Html::_ ( 'radio', 'htaccess_cache_enable', '1' ); 222 222 } 223 223 public static function pro_cache_platform() { … … 240 240 ]; 241 241 242 echo Html::_ ( 'select', 'page_cache_lifetime', ' 600', $aOptions );242 echo Html::_ ( 'select', 'page_cache_lifetime', '86400', $aOptions ); 243 243 } 244 244 public static function cache_exclude() { -
fastcache-by-host-it/tags/1.5.16/src/Admin/templates
-
Property
svn:ignore
set to
compiled
-
Property
svn:ignore
set to
-
fastcache-by-host-it/tags/1.5.16/src/Admin/templates/compiled/46326b4df04382cb68b5bc29da6400fa1b43533f.php
r3458155 r3460794 52 52 </div> 53 53 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"> 59 59 <div> 60 60 <div class="tab-item"><?php echo __('Page Cache', 'fastcache'); ?></div> … … 62 62 </a> 63 63 </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"> 66 66 <div> 67 67 <div class="tab-item"><?php echo __('FastCache CDN', 'fastcache'); ?></div> … … 69 69 </a> 70 70 </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"> 73 73 <div> 74 74 <div class="tab-item"><?php echo __('Auto configuration', 'fastcache'); ?></div> … … 76 76 </a> 77 77 </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"> 80 80 <div> 81 81 <div class="tab-item"><?php echo __('Optimizations', 'fastcache'); ?></div> … … 83 83 </a> 84 84 </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"> 87 87 <div> 88 88 <div class="tab-item"><?php echo __('Assets Inclusions', 'fastcache'); ?></div> … … 90 90 </a> 91 91 </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"> 94 94 <div> 95 95 <div class="tab-item"><?php echo __('Assets Exclusions', 'fastcache'); ?></div> … … 97 97 </a> 98 98 </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"> 101 101 <div> 102 102 <div class="tab-item"><?php echo __('Lazy Load', 'fastcache'); ?></div> … … 104 104 </a> 105 105 </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"> 108 108 <div> 109 109 <div class="tab-item"><?php echo __('Optimize Images', 'fastcache'); ?></div> … … 111 111 </a> 112 112 </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"> 115 115 <div> 116 116 <div class="tab-item"><?php echo __('Assets Management', 'fastcache'); ?></div> … … 118 118 </a> 119 119 </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"> 122 122 <div> 123 123 <div class="tab-item"><?php echo __('Http/2', 'fastcache'); ?></div> … … 125 125 </a> 126 126 </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"> 129 129 <div> 130 130 <div class="tab-item"><?php echo __('Combine Images', 'fastcache'); ?></div> … … 132 132 </a> 133 133 </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"> 136 136 <div> 137 137 <div class="tab-item"><?php echo __('Advanced','fastcache'); ?></div> … … 139 139 </a> 140 140 </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"> 143 143 <div> 144 144 <div class="tab-item"><?php echo __('Speed Test','fastcache'); ?></div> … … 146 146 </a> 147 147 </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"> 150 150 <div> 151 151 <div class="tab-item"><?php echo __('Diagnostic','fastcache'); ?></div> … … 153 153 </a> 154 154 </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> 155 162 </ul> 156 163 </div> 157 <div class=" g-col-12 g-col-lg-10 ms-2">164 <div class="flex-1 w-full min-w-0"> 158 165 <?php echo \FastCache\Admin\Settings\TabContent::start(); ?> 159 166 -
fastcache-by-host-it/tags/1.5.16/src/Core/PageCache.php
r3458155 r3460794 48 48 if (! $sCacheId) { 49 49 $params = Plugin::getPluginParams (); 50 if ($params->get ( 'htaccess_cache_enable', ' 0' )) {50 if ($params->get ( 'htaccess_cache_enable', '1' )) { 51 51 $siteUrl = site_url (); 52 52 … … 118 118 119 119 // 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')) { 121 121 122 122 // Escludi richieste con metodo diverso da GET o HEAD … … 142 142 } 143 143 144 if ($params->get ( 'cache_enable', ' 0' ) && Utility::isGuest () && ! self::isExcluded ( $params )) {144 if ($params->get ( 'cache_enable', '1' ) && Utility::isGuest () && ! self::isExcluded ( $params )) { 145 145 return true; 146 146 } -
fastcache-by-host-it/tags/1.5.16/src/Core/Platform/Cache.php
r3458155 r3460794 118 118 $content = apply_filters ( 'fastcache_save_content', $content ); 119 119 120 if ($page_cache && $params->get ( 'htaccess_cache_enable', ' 0' )) {120 if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) { 121 121 $file_contents = $content; 122 122 } else { … … 398 398 if (! $page_cache_lifetime) { 399 399 $params = Plugin::getPluginParams (); 400 $page_cache_lifetime = $params->get ( 'page_cache_lifetime', ' 43200' );400 $page_cache_lifetime = $params->get ( 'page_cache_lifetime', '86400' ); 401 401 } 402 402 … … 422 422 private static function _getFileName($id, $page_cache = false) { 423 423 $params = Plugin::getPluginParams (); 424 if ($page_cache && $params->get ( 'htaccess_cache_enable', ' 0' )) {424 if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) { 425 425 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' )) { 427 427 return FASTCACHE_CACHE_DIR . 'page/' . md5 ( NONCE_SALT . $id ) . '.wpc'; 428 428 } else { … … 443 443 $content = $wp_filesystem->get_contents ( $file ); 444 444 445 if ($page_cache && $params->get ( 'htaccess_cache_enable', ' 0' )) {445 if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) { 446 446 return $content; 447 447 } -
fastcache-by-host-it/tags/1.5.16/src/Core/Platform/Plugin.php
r3458784 r3460794 15 15 16 16 use FastCache\Core\Interfaces\Plugin as PluginInterface; 17 use FastCache\Core\Admin\Tasks; 17 18 use FastCache\Dispatcher; 18 19 … … 72 73 public static function activate() 73 74 { 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 } 75 79 $settings = get_option(FASTCACHEHOST_HOST_PLUGINNAME_SETTINGS); 76 80 if (!$settings) { … … 81 85 } 82 86 public static function update(): void { 83 self::setHtaccessCacheEnableSwitch();84 87 self::hookToLicense('update'); 85 88 } 86 89 public static function deactivate() 87 90 { 88 self::setHtaccessCacheEnableSwitch( );91 self::setHtaccessCacheEnableSwitch(false); 89 92 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(); 90 95 } 91 96 92 97 public static function uninstall() 93 98 { 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(); 95 102 } 96 public static function setHtaccessCacheEnableSwitch( ){103 public static function setHtaccessCacheEnableSwitch($enable){ 97 104 $currentSettings = Plugin::getPluginParams()->toArray(); 98 105 // 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); 104 109 } 105 110 public static function hookToLicense($action){ … … 137 142 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 138 143 $response = curl_exec($ch); 139 // fwrite($h,date('Y-m-d H:i:s').' 2 ' .$response. "\n"); 140 // fclose($h); 144 141 145 } 142 146 } -
fastcache-by-host-it/tags/1.5.16/src/Core/Platform/Utility.php
r3458784 r3460794 370 370 } 371 371 372 public static function htaccessCacheManagement($postedSettings ) {372 public static function htaccessCacheManagement($postedSettings, $enable = null) { 373 373 $currentSettings = Plugin::getPluginParams()->toArray(); 374 374 $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']; 376 376 377 if( $currentHtaccessCacheEnable != $postedHtaccessCacheEnable) {377 if((int)$currentHtaccessCacheEnable != (int)$postedHtaccessCacheEnable || $postedHtaccessCacheEnable === 'auto') { 378 378 $htaccess = Paths::rootPath() . '/.htaccess'; 379 379 … … 518 518 $regex = '~^[ \t]*## BEGIN HTACCESS PAGE CACHING - FASTCACHE[^\r\n]*\R.*?^[ \t]*## END HTACCESS PAGE CACHING - FASTCACHE[^\r\n]*\R?~sm'; 519 519 520 if ($postedHtaccessCacheEnable == 1 || $postedHtaccessCacheEnable == -1 ) {520 if ($postedHtaccessCacheEnable == 1 || $postedHtaccessCacheEnable == -1 || $enable === true) { 521 521 522 522 // 1) Rimuovi TUTTE le occorrenze (anche duplicate, anche legacy) … … 532 532 return file_put_contents($htaccess, $htaccessPageCache . $contents); 533 533 534 } elseif ($postedHtaccessCacheEnable == 0 || $postedHtaccessCacheEnable == -1 ) {534 } elseif ($postedHtaccessCacheEnable == 0 || $postedHtaccessCacheEnable == -1 || $enable === false) { 535 535 536 536 // Disable: rimuovi TUTTI i blocchi … … 554 554 } 555 555 public static function isPageCacheEnabled(Settings $oParams) { 556 return ( bool ) $oParams->get ( 'cache_enable', ' 0' );556 return ( bool ) $oParams->get ( 'cache_enable', '1' ); 557 557 } 558 558 public static function isPluginEnabled() { -
fastcache-by-host-it/trunk/README.txt
r3458784 r3460794 5 5 Tested up to: 6.9.1 6 6 Requires PHP: 8.0 7 Stable Tag: 1.5.1 57 Stable Tag: 1.5.16 8 8 License: GPL-2.0+ 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 132 132 133 133 == Changelog == 134 1.5.16 135 Fix to restore the original htaccess when the plugin is deactivated 136 Page cache and htaccess cache enabled by default for 1 day to allow the plugin to work immediately after activation 137 134 138 1.5.15 135 139 New feature for Import and Export configuration -
fastcache-by-host-it/trunk/fastcache.php
r3458784 r3460794 17 17 * Plugin URI: https://fastcache.host.it/wordpress/ 18 18 * 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.1 519 * Version: 1.5.16 20 20 * Author: Host.it 21 21 * Author URI: https://fastcache.host.it/ … … 45 45 define ( '_WP_EXEC', '1' ); 46 46 define ( '_FASTCACHE_EXEC', 1 ); 47 define ( 'FASTCACHE_VERSION', '1.5.1 5' );47 define ( 'FASTCACHE_VERSION', '1.5.16' ); 48 48 define ( 'FASTCACHE_FILE_PATH', __FILE__ ); 49 49 -
fastcache-by-host-it/trunk/media/js/tabs-state.js
r3458155 r3460794 12 12 var loadTabs = function() { 13 13 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"]'); 15 15 var $panes = $('.tab-pane'); 16 16 … … 23 23 24 24 // 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 + '"]'); 26 26 if ($targetTab.length) { 27 27 $targetTab.addClass('active'); -
fastcache-by-host-it/trunk/src/Admin.php
r3458280 r3460794 270 270 $admin_bar->add_node( $aArgs ); 271 271 272 if ($params->get('htaccess_cache_enable', 0) == 1)272 if ($params->get('htaccess_cache_enable', 1) == 1) 273 273 { 274 274 $aArgs = [ -
fastcache-by-host-it/trunk/src/Admin/Settings/Renderer/Setting.php
r3458155 r3460794 216 216 } 217 217 public static function cache_enable() { 218 echo Html::_ ( 'radio', 'cache_enable', ' 0' );218 echo Html::_ ( 'radio', 'cache_enable', '1' ); 219 219 } 220 220 public static function htaccess_cache_enable() { 221 echo Html::_ ( 'radio', 'htaccess_cache_enable', ' 0' );221 echo Html::_ ( 'radio', 'htaccess_cache_enable', '1' ); 222 222 } 223 223 public static function pro_cache_platform() { … … 240 240 ]; 241 241 242 echo Html::_ ( 'select', 'page_cache_lifetime', ' 600', $aOptions );242 echo Html::_ ( 'select', 'page_cache_lifetime', '86400', $aOptions ); 243 243 } 244 244 public static function cache_exclude() { -
fastcache-by-host-it/trunk/src/Admin/templates
-
Property
svn:ignore
set to
compiled
-
Property
svn:ignore
set to
-
fastcache-by-host-it/trunk/src/Admin/templates/compiled/46326b4df04382cb68b5bc29da6400fa1b43533f.php
r3458155 r3460794 52 52 </div> 53 53 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"> 59 59 <div> 60 60 <div class="tab-item"><?php echo __('Page Cache', 'fastcache'); ?></div> … … 62 62 </a> 63 63 </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"> 66 66 <div> 67 67 <div class="tab-item"><?php echo __('FastCache CDN', 'fastcache'); ?></div> … … 69 69 </a> 70 70 </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"> 73 73 <div> 74 74 <div class="tab-item"><?php echo __('Auto configuration', 'fastcache'); ?></div> … … 76 76 </a> 77 77 </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"> 80 80 <div> 81 81 <div class="tab-item"><?php echo __('Optimizations', 'fastcache'); ?></div> … … 83 83 </a> 84 84 </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"> 87 87 <div> 88 88 <div class="tab-item"><?php echo __('Assets Inclusions', 'fastcache'); ?></div> … … 90 90 </a> 91 91 </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"> 94 94 <div> 95 95 <div class="tab-item"><?php echo __('Assets Exclusions', 'fastcache'); ?></div> … … 97 97 </a> 98 98 </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"> 101 101 <div> 102 102 <div class="tab-item"><?php echo __('Lazy Load', 'fastcache'); ?></div> … … 104 104 </a> 105 105 </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"> 108 108 <div> 109 109 <div class="tab-item"><?php echo __('Optimize Images', 'fastcache'); ?></div> … … 111 111 </a> 112 112 </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"> 115 115 <div> 116 116 <div class="tab-item"><?php echo __('Assets Management', 'fastcache'); ?></div> … … 118 118 </a> 119 119 </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"> 122 122 <div> 123 123 <div class="tab-item"><?php echo __('Http/2', 'fastcache'); ?></div> … … 125 125 </a> 126 126 </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"> 129 129 <div> 130 130 <div class="tab-item"><?php echo __('Combine Images', 'fastcache'); ?></div> … … 132 132 </a> 133 133 </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"> 136 136 <div> 137 137 <div class="tab-item"><?php echo __('Advanced','fastcache'); ?></div> … … 139 139 </a> 140 140 </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"> 143 143 <div> 144 144 <div class="tab-item"><?php echo __('Speed Test','fastcache'); ?></div> … … 146 146 </a> 147 147 </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"> 150 150 <div> 151 151 <div class="tab-item"><?php echo __('Diagnostic','fastcache'); ?></div> … … 153 153 </a> 154 154 </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> 155 162 </ul> 156 163 </div> 157 <div class=" g-col-12 g-col-lg-10 ms-2">164 <div class="flex-1 w-full min-w-0"> 158 165 <?php echo \FastCache\Admin\Settings\TabContent::start(); ?> 159 166 -
fastcache-by-host-it/trunk/src/Core/PageCache.php
r3458155 r3460794 48 48 if (! $sCacheId) { 49 49 $params = Plugin::getPluginParams (); 50 if ($params->get ( 'htaccess_cache_enable', ' 0' )) {50 if ($params->get ( 'htaccess_cache_enable', '1' )) { 51 51 $siteUrl = site_url (); 52 52 … … 118 118 119 119 // 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')) { 121 121 122 122 // Escludi richieste con metodo diverso da GET o HEAD … … 142 142 } 143 143 144 if ($params->get ( 'cache_enable', ' 0' ) && Utility::isGuest () && ! self::isExcluded ( $params )) {144 if ($params->get ( 'cache_enable', '1' ) && Utility::isGuest () && ! self::isExcluded ( $params )) { 145 145 return true; 146 146 } -
fastcache-by-host-it/trunk/src/Core/Platform/Cache.php
r3458155 r3460794 118 118 $content = apply_filters ( 'fastcache_save_content', $content ); 119 119 120 if ($page_cache && $params->get ( 'htaccess_cache_enable', ' 0' )) {120 if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) { 121 121 $file_contents = $content; 122 122 } else { … … 398 398 if (! $page_cache_lifetime) { 399 399 $params = Plugin::getPluginParams (); 400 $page_cache_lifetime = $params->get ( 'page_cache_lifetime', ' 43200' );400 $page_cache_lifetime = $params->get ( 'page_cache_lifetime', '86400' ); 401 401 } 402 402 … … 422 422 private static function _getFileName($id, $page_cache = false) { 423 423 $params = Plugin::getPluginParams (); 424 if ($page_cache && $params->get ( 'htaccess_cache_enable', ' 0' )) {424 if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) { 425 425 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' )) { 427 427 return FASTCACHE_CACHE_DIR . 'page/' . md5 ( NONCE_SALT . $id ) . '.wpc'; 428 428 } else { … … 443 443 $content = $wp_filesystem->get_contents ( $file ); 444 444 445 if ($page_cache && $params->get ( 'htaccess_cache_enable', ' 0' )) {445 if ($page_cache && $params->get ( 'htaccess_cache_enable', '1' )) { 446 446 return $content; 447 447 } -
fastcache-by-host-it/trunk/src/Core/Platform/Plugin.php
r3458784 r3460794 15 15 16 16 use FastCache\Core\Interfaces\Plugin as PluginInterface; 17 use FastCache\Core\Admin\Tasks; 17 18 use FastCache\Dispatcher; 18 19 … … 72 73 public static function activate() 73 74 { 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 } 75 79 $settings = get_option(FASTCACHEHOST_HOST_PLUGINNAME_SETTINGS); 76 80 if (!$settings) { … … 81 85 } 82 86 public static function update(): void { 83 self::setHtaccessCacheEnableSwitch();84 87 self::hookToLicense('update'); 85 88 } 86 89 public static function deactivate() 87 90 { 88 self::setHtaccessCacheEnableSwitch( );91 self::setHtaccessCacheEnableSwitch(false); 89 92 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(); 90 95 } 91 96 92 97 public static function uninstall() 93 98 { 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(); 95 102 } 96 public static function setHtaccessCacheEnableSwitch( ){103 public static function setHtaccessCacheEnableSwitch($enable){ 97 104 $currentSettings = Plugin::getPluginParams()->toArray(); 98 105 // 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); 104 109 } 105 110 public static function hookToLicense($action){ … … 137 142 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 138 143 $response = curl_exec($ch); 139 // fwrite($h,date('Y-m-d H:i:s').' 2 ' .$response. "\n"); 140 // fclose($h); 144 141 145 } 142 146 } -
fastcache-by-host-it/trunk/src/Core/Platform/Utility.php
r3458784 r3460794 370 370 } 371 371 372 public static function htaccessCacheManagement($postedSettings ) {372 public static function htaccessCacheManagement($postedSettings, $enable = null) { 373 373 $currentSettings = Plugin::getPluginParams()->toArray(); 374 374 $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']; 376 376 377 if( $currentHtaccessCacheEnable != $postedHtaccessCacheEnable) {377 if((int)$currentHtaccessCacheEnable != (int)$postedHtaccessCacheEnable || $postedHtaccessCacheEnable === 'auto') { 378 378 $htaccess = Paths::rootPath() . '/.htaccess'; 379 379 … … 518 518 $regex = '~^[ \t]*## BEGIN HTACCESS PAGE CACHING - FASTCACHE[^\r\n]*\R.*?^[ \t]*## END HTACCESS PAGE CACHING - FASTCACHE[^\r\n]*\R?~sm'; 519 519 520 if ($postedHtaccessCacheEnable == 1 || $postedHtaccessCacheEnable == -1 ) {520 if ($postedHtaccessCacheEnable == 1 || $postedHtaccessCacheEnable == -1 || $enable === true) { 521 521 522 522 // 1) Rimuovi TUTTE le occorrenze (anche duplicate, anche legacy) … … 532 532 return file_put_contents($htaccess, $htaccessPageCache . $contents); 533 533 534 } elseif ($postedHtaccessCacheEnable == 0 || $postedHtaccessCacheEnable == -1 ) {534 } elseif ($postedHtaccessCacheEnable == 0 || $postedHtaccessCacheEnable == -1 || $enable === false) { 535 535 536 536 // Disable: rimuovi TUTTI i blocchi … … 554 554 } 555 555 public static function isPageCacheEnabled(Settings $oParams) { 556 return ( bool ) $oParams->get ( 'cache_enable', ' 0' );556 return ( bool ) $oParams->get ( 'cache_enable', '1' ); 557 557 } 558 558 public static function isPluginEnabled() {
Note: See TracChangeset
for help on using the changeset viewer.