keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

update cache clearing #96

Closed coreykn closed 4 years ago

coreykn commented 4 years ago

Update wpmu_new_blog action hook with wp_initialize_site because it has been deprecated since WordPress version 5.1.0. Update delete_blog action hook with wp_uninitialize_site because it has been deprecated since WordPress version 5.1.0. This makes the new minimum WordPress version 5.1. Update the CE_MIN_WP constant to 5.1.

Update Cache_Enabler::on_ce_activation_deactivation() to only clear the complete cache once.

Update Cache_Enabler::on_uninstall() to clear the complete cache instead of Cache_Enabler::_uninstall_backend(). This avoids unnecessarily clearing the complete cache multiple times when Cache Enabler in uninstalled on a network installation.

Update Cache_Enabler::uninstall_later():

Update clear request processing:

Update type validations to use is_int() and is_string() to improve code readability (e.g. instead of ! $var = (string) $var).

Update Cache_Enabler_Disk::_file_path() to use get_site_url(). This is required to properly clear the cache by URL when installed on a network installation. Previously when network activated and a new site was created the hostname of the network admin was used instead of the current blog.

Add CE_SETTINGS_PATH constant for advanced cache settings file path.

Add Cache_Enabler::clear_blog_id_cache() to clear the complete cache of a blog in a network installation by the blog ID (for both subdomain and subdirectory configurations).

Add Cache_Enabler::get_blog_domain() so both Cache_Enabler_Disk::_get_settings() and Cache_Enabler::clear_blog_id_cache() use the same method to get the blog domain.