Open sandyfigueroa opened 9 months ago
After doing some investigation on this, I noticed that the function is expecting a file url which will be formatted but url like this http://domain.com/?code-snippets-css=1&ver=7 aren't a file url per se.
Engine/Media/Lazyload/CSS/Subscriber.php
We can change the token from ?
maybe @
or something else.
A quick change of the token, fixed the error but still need to do more test.
Effort [S]
The proposed solution is not enough in my opinion. We would need product direction on this, what do we want to do with dynamic CSS like this in that case? @piotrbak
Related ticket: https://secure.helpscout.net/conversation/2711862354/513047/
Screenshot of the error.
This file is related to Jetpack Boost plugin.
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug When a stylesheed is included in the page with this format:
(
https://wp-rocket.esy.es/?code-snippets-css=1&ver=7
)LazyLoad for CSS background images fails, and the related images to this CSS are broken.
No file is created in
/wp-content/cache/background-css/domain.com
folderAnd this kind of URL is used for the stylesheet: http://wp-rocket.esy.es/wp-content/cache/background-css/wp-rocket.esy.es/?code-snippets-css=1&ver=7&wpr_t=1705500659, which is incorrect and doesn't load any stylesheet.
Also, the page might be broken (broken styles) if the stylesheet included more CSS than the background image
To Reproduce Steps to reproduce the behavior (These were the steps I did):
Add an element (a div for example) with a selector like ".my-test-background-1"
Throw a CSS from PHP from a URL like: http://domain.com/?code-snippets-css=1&ver=7 I did this in the WordPress' index.php file:
Enable the LazyLoad for CSS background images
Clear WP Rocket's cache
Check the page
Expected behavior These kinds of stylesheets should't break the lazyload option. Maybe the URL can be used to get a hash and use it as the name of the file.
Additional context This happened to this user: https://secure.helpscout.net/conversation/2482565836/469421/, and I could reproduce it on my test site following the steops above.
Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming