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 for comment actions #185

Closed coreykn closed 3 years ago

coreykn commented 3 years ago

Update cache clearing behavior for comment actions. Allow site cache clearing setting to clear the site cache if a comment (e.g. default comments or product reviews) is posted, updated, spammed, or trashed instead of only when a new comment is posted. This fixes the issue of where if a new comment was posted but had to be approved first it would only clear the page cache and not the site cache if the setting was enabled. There is no way to know if the comment is new after the status transitions, which is why this new behavior was chosen to be introduced instead of only updating Cache_Enabler::on_transition_comment_status() as that could occur on old comments. This builds upon the improved behavior brought in PR #169.