Plugin Directory

Changeset 2901928


Ignore:
Timestamp:
04/20/2023 05:48:52 PM (3 years ago)
Author:
astralinternet
Message:

1.1.2

  • Removed deprecated code
  • Fix : Change the way the hook was made to listen to other cache extensions.
Location:
wsa-cachepurge/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wsa-cachepurge/trunk/README.txt

    r2891571 r2901928  
    55Tested up to: 6.2
    66Requires PHP: 5.6
    7 Stable tag: 1.1.1
     7Stable tag: 1.1.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3030
    3131== 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.
    3236
    3337= 1.1.1 =
  • wsa-cachepurge/trunk/lib/wsa-cachepurge_wp-module.class.php

    r2891571 r2901928  
    145145     *
    146146     * @since    1.0.0
    147      * @version  1.1.0
     147     * @version  1.1.2
    148148     * @return void
    149149     */
     
    154154        $autoPurge = get_option('wsa-cachepurge_auto-purge');
    155155
    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();
    179159        }
    180160    }
     
    241221     *
    242222     * @since    1.0.1
    243      * @version  1.1.0
     223     * @version  1.1.2
    244224     * @return void
    245225     */
     
    250230        do_action('wsa-cachepurge_before_cache_purge');
    251231
    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 version
    254         $autoPurge = get_option('wsa-cachepurge_auto-purge');
    255 
    256         // Add switch to update the previous string setting to the new integer format
    257         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 
    270232        // Call the purge cache function from the WSA class
    271233        WSAHandler\WSA::purge_cache();
     
    312274
    313275        // 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' ));
    318277
    319278        // 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' ));
    324280
    325281        // 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' ));
    330283
    331284        // 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' ));
    336286
    337287        // 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' ));
    342289    }
    343290
     
    352299
    353300        // 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' ));
    355302    }
    356303
     
    365312
    366313        // 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' ));
    371318    }
    372319
     
    381328
    382329        // 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' ));
    390334    }
    391335
     
    400344
    401345        // 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' ));
    403347    }
    404348}
  • wsa-cachepurge/trunk/wsa-cachepurge.php

    r2891571 r2901928  
    1212 * Plugin URI:          https://github.com/AstralInternet/WSA-WordPress-Plugin
    1313 * 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.1
     14 * Version:             1.1.2
    1515 * Author:              Astral Internet inc.
    1616 * Author URI:          https://www.astralinternet.com/fr
Note: See TracChangeset for help on using the changeset viewer.