• Resolved Blair

    (@cbcbcb)


    HI, Great plugin.

    Google Pagespeed Insights recommends removing render-blocking JavaScript and
    graceful-pull-quotes/resources/jspullquotes.js
    comes up as one to resolve.

    How do I do this?

    I attempted to place the entire jspullquotes.js in the header but that didn’t work and Google recommend only small js scripts in that method, form what I figure.

    Thank you

    Chris

    https://www.ads-software.com/plugins/graceful-pull-quotes/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Stephen Rider

    (@strider72)

    Short of hacking the plugin, you would not be able to do it. In terms of code, it appears to simply be a matter of moving the script tags from the header to the footer of the page, which may work fine but may cause problems in certain themes.

    That being said, I believe Google is being overly cautious with this warning. Yes, you’re loading a script (from the same server as the rest of your site), but very little actually runs until after the DOM is fully loaded. In fact, all that runs before then is a JS script that tells it to run something after the DOM is loaded. ??

    Plugin Author Stephen Rider

    (@strider72)

    Hi Blair —

    I will add an option in the next release that lets you move it to the footer instead of the header. That will solve your problem.

    In the meantime, you can fix it by modifying the plugin file. Open graceful-pull-quotes.php and find the following line:

    add_action( 'wp_head', array( &$this, 'wp_head' ) );

    Change it to:
    add_action( 'wp_print_footer_scripts', array( &$this, 'wp_head' ) );

    Of course the next plugin update will undo this hack, but then you should be able to go into Settings and click a checkbox to do this.

    Thread Starter Blair

    (@cbcbcb)

    This is great Stephen. It works great. Thank you! And I look forward to the update.

    Plugin Author Stephen Rider

    (@strider72)

    Marking this “Resolved”.

    Plugin Author Stephen Rider

    (@strider72)

    See version 2.6

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Render-blocking JavaScript’ is closed to new replies.