wpsharks / comet-cache

An advanced WordPress® caching plugin inspired by simplicity.
https://cometcache.com
GNU General Public License v3.0
77 stars 18 forks source link

API does not consider auto-clear routines disabled via filter #920

Open raamdev opened 6 years ago

raamdev commented 6 years ago

If you disable the auto-clear routines like this:

add_filter('comet_cache_disable_auto_clear_cache_routines', '__return_true', 10, 0);

and then call the API like this:

comet_cache::clear();

the API does not clear the cache because this line assumes if the auto-clear routines are disabled then the cache should not be cleared.

The easiest way to fix this would be to update the calls in the API so that they pass true to signify that the routine was being called manually, which overrides the check if the auto-clear routines are disabled.