Exclude application/json scripts from minification?
-
Hi Raul,
Is there any chance Fast Velocity Minify could exclude
application/json
scripts from the minification process?WordPress Popular Posts version 5.2 injects a
application/json
script into<head>
that contains a JSON string, for example:<script type="application/json" id="wpp-json" {"sampling_active":0,"sampling_rate":"100","ajax_url":"https:\/\/www.example.com\/wp-json\/wordpress-popular-posts\/v1\/popular-posts","ID":false,"token":"a787dd82b4","lang":null,"debug":true} </script>
When Fast Velocity Minify is active, this inline
application/json
script is apparently bundled with the rest of the minified code, breaking WordPress Popular Posts’ ability to track pageviews, load widgets, etc.application/json
script tags should be safe to ignore as the browser doesn’t execute any code (they’re just JSON strings) and won’t load (external) JS files either.Other solutions I tested (like Autoptimize) do seem to ignore these
<script type="application/json">...</script>
tags so I’m hoping you could implement this as well.Thanks in advance!
- The topic ‘Exclude application/json scripts from minification?’ is closed to new replies.