Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wp-media/wp-rocket-helpers

🚀 Helper plugins for specific use cases with WP Rocket. ☝️ TEST BEFORE USE! ☝️
https://github.com/wp-media/wp-rocket-helpers

Last synced: 3 days ago
JSON representation

🚀 Helper plugins for specific use cases with WP Rocket. ☝️ TEST BEFORE USE! ☝️

Awesome Lists containing this project

README

        

# WP Rocket | Fix encoded characters in the Used CSS

In some cases the Used CSS contains encoded characters, so for example a space " " will be replaced by a "%20" and this causes layout errors. This helper decodes the encoded characters in the Used CSS fixing the issue.

Current replacements:

$css = str_replace('%20', ' ', $css);
$css = str_replace('%7B', '{', $css);
$css = str_replace('%7D', '}', $css);
$css = str_replace('%3E', '>', $css);
$css = str_replace('%3c', '>', $css);
$css = str_replace(' ', ' ', $css);

How to use it:
* Check to see if there are more encoded elements, you can search for % in the wpr-usedcss inline style.
* Tweak and onstall the helper
* Clear WP Rocket's cache

Last tested with:
* WP Rocket 3.15.x
* WordPress 6.4.x