Background-image lazy-loading not compatible with WPML #6178
Labels
3rd party compatibility
Issues related to 3rd party compatibility like theme, plugin or hosting
effort: [S]
1-2 days of estimated development time
module: lazyload background css images
priority: high
Issues which should be resolved as quickly as possible
severity: major
Feature is not working as expected and no work around available
type: bug
Indicates an unexpected problem or unintended behavior
Milestone
When using the new CSS background images lazy-loading feature (tested using WP Rocket 3.15.0.1), the background-images do not appear anymore, because the path to them generated by WP-Rocket is incorrect when using WPML on the website.
Here's the original CSS coming from the style.css file present inside the WordPress theme folder:
background: url('/wp-content/themes/themename/img/arrow-right.svg');
Here's the CSS variable generated by WP Rocket, which contains an URL with the wrong path:
--wpr-bg-b1edba74-111c-42a4-8e0e-8b5ff1c99ef1: url('https://www.example.com/fr//wp-content/themes/themename/img/arrow-right.svg');
Wrong URL:
https://www.example.com/fr//wp-content/themes/themename/img/arrow-right.svg
What the URL should be:
https://www.example.com/wp-content/themes/themename/img/arrow-right.svg'
I guess this problem is coming from WPML adding a virtual directory at the end of the domain name.
But nevertheless, couldn't this easily be detected by WP Rocket?
Steps to reproduce
background: url('/your-path/.../image.jpg);
example.com/[LANG ISO CODE]/your-path/
The text was updated successfully, but these errors were encountered: