• Resolved UmbrellaWeb

    (@umbrellaweb)


    Hello.

    Currently using wpsso core and jsonld plugin. Fantastic plugins.

    Great work.

    Now we are trying to get the page size as low as possible and yslow from gtmetrix is complaining about the inline js script which is the json ld output from your plugin.

    Using wprocket as the cache plugin. It minifies all other inline code apart from your outputted code.

    Is there any reason why thats not getting minified? Wprocket aupport suggests its due to the plugin code and or a filter plugin filter preventing it.

    Tried it on a stock wp site with no plugins apart from qpsso core and json ld and wp rocket with default twenty twenty theme. Same result.

    Can you help identify the issue please and a fix?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author JS Morisset

    (@jsmoriss)

    Typically minification happens when WordPress has finished constructing the webpage and it is sent to stdout, which is also the version caching plugins cache. There’s no reason WP Rocket should not be able to minimize the JSON at this point. If you’d prefer WPSSO to minimize the JSON instead of an optimization or caching plugin, you can add the following constant to your wp-config.php file:

    define( ‘WPSSO_JSON_PRETTY_PRINT’, false );

    js.

    Thread Starter UmbrellaWeb

    (@umbrellaweb)

    @jsmoriss Thank you. Thats done thr trick.

    FYI support from wprocket states:

    If you want, you can combine them (JavaScript) using this function: https://prntscr.com/u31qpg, but please take in account that not every inline JavaScript is compatible with this feature, this can cause issues depending on how is programmed the JavaScript code, and some of them ere excluded automatically to avoid known issues.

    About JSON Scripts, WP Rocket doesn’t Minify o Combine them, only JavaScript and CSS.

    Seems like they dont support json minification at all and javascript only for some after a lto of testing depending on the site in question.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Minify inline json ld code’ is closed to new replies.