Changeset 2901928
- Timestamp:
- 04/20/2023 05:48:52 PM (3 years ago)
- Location:
- wsa-cachepurge/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (2 diffs)
-
lib/wsa-cachepurge_wp-module.class.php (modified) (9 diffs)
-
wsa-cachepurge.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wsa-cachepurge/trunk/README.txt
r2891571 r2901928 5 5 Tested up to: 6.2 6 6 Requires PHP: 5.6 7 Stable tag: 1.1. 17 Stable tag: 1.1.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 30 30 31 31 == Changelog == 32 33 = 1.1.2 = 34 * Removed deprecated code 35 * Fix : Change the way the hook was made to listen to other cache extensions. 32 36 33 37 = 1.1.1 = -
wsa-cachepurge/trunk/lib/wsa-cachepurge_wp-module.class.php
r2891571 r2901928 145 145 * 146 146 * @since 1.0.0 147 * @version 1.1. 0147 * @version 1.1.2 148 148 * @return void 149 149 */ … … 154 154 $autoPurge = get_option('wsa-cachepurge_auto-purge'); 155 155 156 // Add switch to update the previous string setting to the new integer format 157 // This will be deprecated and removed in futur version 158 switch ($autoPurge) { 159 160 case 'on': 161 // Update setting to int '1' 162 update_option('wsa-cachepurge_auto-purge', 1); 163 164 //purge the user cache 165 WSAHandler\WSA::purge_cache(); 166 break; 167 168 case 'off': 169 170 // Update setting to int '0' 171 update_option('wsa-cachepurge_auto-purge', 0); 172 break; 173 174 default: 175 176 // Purge the user cache 177 WSAHandler\WSA::purge_cache(); 178 break; 156 // Clear the WSA cache 157 if ($autoPurge) { 158 WSAHandler\WSA::purge_cache(); 179 159 } 180 160 } … … 241 221 * 242 222 * @since 1.0.1 243 * @version 1.1. 0223 * @version 1.1.2 244 224 * @return void 245 225 */ … … 250 230 do_action('wsa-cachepurge_before_cache_purge'); 251 231 252 // Fetch the auto purge setting to update the WP options to the new module version.253 // This will be deprecated and removed in futur version254 $autoPurge = get_option('wsa-cachepurge_auto-purge');255 256 // Add switch to update the previous string setting to the new integer format257 switch ($autoPurge) {258 259 case 'on':260 // Update setting to int '1'261 update_option('wsa-cachepurge_auto-purge', 1);262 break;263 264 case 'off':265 // Update setting to int '0'266 update_option('wsa-cachepurge_auto-purge', 0);267 break;268 }269 270 232 // Call the purge cache function from the WSA class 271 233 WSAHandler\WSA::purge_cache(); … … 312 274 313 275 // On clear all cache 314 add_action( 315 'w3tc_flush_all', 316 'WSA_Cachepurge_WP::purge_cache();' 317 ); 276 add_action('w3tc_flush_all', array( new WSA_Cachepurge_WP, 'purge_cache' )); 318 277 319 278 // On purge all post 320 add_action( 321 'w3tc_flush_posts', 322 'WSA_Cachepurge_WP::purge_cache();' 323 ); 279 add_action('w3tc_flush_posts', array( new WSA_Cachepurge_WP, 'purge_cache' )); 324 280 325 281 // On browser cache purge 326 add_action( 327 'w3tc_flush_after_browsercache', 328 'WSA_Cachepurge_WP::purge_cache();' 329 ); 282 add_action('w3tc_flush_after_browsercache', array( new WSA_Cachepurge_WP, 'purge_cache' )); 330 283 331 284 // On minify object cache purge 332 add_action( 333 'w3tc_flush_after_minify', 334 'WSA_Cachepurge_WP::purge_cache();' 335 ); 285 add_action('w3tc_flush_after_minify', array( new WSA_Cachepurge_WP, 'purge_cache' )); 336 286 337 287 // After Object cache flush 338 add_action( 339 'w3tc_flush_after_objectcache', 340 'WSA_Cachepurge_WP::purge_cache();' 341 ); 288 add_action('w3tc_flush_after_objectcache', array( new WSA_Cachepurge_WP, 'purge_cache' )); 342 289 } 343 290 … … 352 299 353 300 // On clear all cache 354 add_action('wp_cache_cleared', 'WSA_Cachepurge_WP::purge_cache();');301 add_action('wp_cache_cleared', array( new WSA_Cachepurge_WP, 'purge_cache' )); 355 302 } 356 303 … … 365 312 366 313 // On clear cache 367 add_action('wpfc_delete_cache', 'WSA_Cachepurge_WP::purge_cache();');368 369 // On clear all cache 370 add_action('wpfc_clear_all_cache', 'WSA_Cachepurge_WP::purge_cache();');314 add_action('wpfc_delete_cache', array( new WSA_Cachepurge_WP, 'purge_cache' )); 315 316 // On clear all cache 317 add_action('wpfc_clear_all_cache', array( new WSA_Cachepurge_WP, 'purge_cache' )); 371 318 } 372 319 … … 381 328 382 329 // Clear page cache 383 add_action( 384 'autoptimize_action_cachepurged', 385 'WSA_Cachepurge_WP::purge_cache();' 386 ); 387 388 // On clear all cache 389 add_action('cachify_flush_cache', 'WSA_Cachepurge_WP::purge_cache();'); 330 add_action('autoptimize_action_cachepurged', array( new WSA_Cachepurge_WP, 'purge_cache' )); 331 332 // On clear all cache 333 add_action('cachify_flush_cache', array( new WSA_Cachepurge_WP, 'purge_cache' )); 390 334 } 391 335 … … 400 344 401 345 // On clear all cache 402 add_action('litespeed_cache_api_purge', 'WSA_Cachepurge_WP::purge_cache();');346 add_action('litespeed_cache_api_purge', array( new WSA_Cachepurge_WP, 'purge_cache' )); 403 347 } 404 348 } -
wsa-cachepurge/trunk/wsa-cachepurge.php
r2891571 r2901928 12 12 * Plugin URI: https://github.com/AstralInternet/WSA-WordPress-Plugin 13 13 * Description: This extension is designed to be used on a server running the website acceleration module created by Astral Internet. The plugin will automatically purge the server cache when a page or article is updated. 14 * Version: 1.1. 114 * Version: 1.1.2 15 15 * Author: Astral Internet inc. 16 16 * Author URI: https://www.astralinternet.com/fr
Note: See TracChangeset
for help on using the changeset viewer.