-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear CPT custom cache files correctly #7277
base: develop
Are you sure you want to change the base?
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more Footnotes
|
@wordpressfan Thanks for the PR. please note that we have the following regression |
If you do it that way, you're going to delete cache of any child item in the permalink structure, that's why the deletion is not using the base but the filenames. You need a different approach to handle the different cache files variations. Possibly with RegEx if it's usable (I don't remember right now), you could do something like index(.*).html. |
Description
Fixes #4508
This PR makes sure that we remove all custom cache files for custom post types are deleted properly.
Type of change
Detailed scenario
When we clear custom post type post (with any clearance action like editing the post), we should clear the archive page (shop page for woocommerce product CPT as an example), but when we have webp enabled (or any feature that creates custom cache file other than index.html or index.html_gzip) those custom cache files are kept there without being removed.
Steps to reproduce:
Technical description
Documentation
Here we added the support of regex inside filenames to target all html files from the selected directory, this will make sure that we will remove the files from the directory without affecting any other directories inside this one.
New dependencies
N/A
Risks
we should be good but as we remove with regex we need to test that to make sure that we only remove what is needed to be removed.
Mandatory Checklist
Code validation
Code style
Unticked items justification
All good.
Additional Checks