-
Notifications
You must be signed in to change notification settings - Fork 211
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 Used CSS after a Theme update #6217
Comments
Extra feature question: |
Would be nice to clear the Used CSS after a plugin update also |
I'd personally prefer it to be manually triggered, but maybe we can show a notice to suggest it if needed (like we do with cache clearing after plugin updates). Regenerating the CSS is too time-consuming of a process and should only be done when absolutely necessary, IMO. |
I'm running one theme with updates on multiple websites 40+ and I would like to clear the Used CSS after I push a necessary theme update. Now I have to login to every client and press the clear button... If there is a hook to trigger it from within my theme its also a solution :) |
@DahmaniAdame What do you think about this? Automatically clearing Used CSS after each theme/plugin update seems to be a huge waste of resources. |
@piotrbak CSS is one of the most important parts of a theme. Theme updates should trigger a regenerate of cache & used CSS. Tor example: The theme developer fixed html of a button and needed to alter the CSS to maintain the styling. Theme update rolls out, Cache is deleted but Used CSS is not. Then you have a button with new html but broken styling. Don't think that's what you want. |
@piotrbak the risk is that if the update has a front-end change. That would result in a broken element. A notification about the change to the customer with them taking action if necessary will do. Just like with do when adding/removing a plugin. We prompt a message to ask the customer clear cache if they know there is a change on the frontend. That will reduce the risk of something breaking.
It's not always the case. But I agree that we need to provide a clearer way to communicate the risk and help the customer take action. |
@DahmaniAdame So, when the currently used theme is updated, we should display a notice similar to this one? |
We did not have enough feedback from customers related to this issue. We might reopen this in the future. For now the solution is to use the helper plugin. Theme's updates should not cause the changes in the UI. |
Is your feature request related to a problem? Please describe.
When a theme is updated by the user we don't clear the used CSS
Describe the solution you'd like
Since a theme update might contain modified/new CSS, we should clear the used css
Describe alternatives you've considered
Hook a usedcss cleanup here
wp-rocket/inc/common/purge.php
Lines 577 to 603 in 89fcfb1
Can be achieved with a helper plugin:
https://github.com/wp-media/wp-rocket-snippets/blob/main/wp-rocket/wp-rocket-clear-usedcss-after-theme-update.php
Additional context
ticket: https://secure.helpscout.net/conversation/2387301118/447830?folderId=2683093
slack: https://wp-media.slack.com/archives/C43T1AYMQ/p1697054621682859
The text was updated successfully, but these errors were encountered: