Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Shareaholic

    (@shareaholic)

    Like many other popular plugins, we also generally recommend not using Rocket Loader for Shareaholic, as it can have unpredictable results.

    Things that can make a difference, which the plugin already does, but you could go the manual installation route as well:

    1. dns-prefetch and preload:

    
    <link rel='dns-prefetch' href='//cdn.shareaholic.net' />
    <link rel='dns-prefetch' href='//www.shareaholic.net' />
    <link rel='dns-prefetch' href='//m9m6e2w5.stackpathcdn.com' />
    
    <link rel='preload' href='//cdn.shareaholic.net/assets/pub/shareaholic.js' as='script'/>
    

    2. “async” the main script:

    
    <script src='//cdn.shareaholic.net/assets/pub/shareaholic.js' data-shr-siteid='REPLACE WITH YOUR SITE ID' async ></script>
    

    You can try to use “defer” on the main script, instead of “async”.

    To exclude from Rocket Loader:

    
    <script data-cfasync='false' src='//cdn.shareaholic.net/assets/pub/shareaholic.js' data-shr-siteid='REPLACE WITH YOUR SITE ID' async ></script>
    

    Please do not try to load the individual app scripts yourself (ex. buttons.js) – they’re not designed for this.

    Bonus Tip – if you’re using Floated Share Buttons, you can also choose to render the buttons only on scroll. This is a setting under “Targeting Rules”:

    What are the odds of someone sharing the link before they scroll the page…

    Let us know how it goes!

    Where does the above code go? In the header? Please elaborate. I am using WordPress Plugin and Google Pagespeed shows several flags such as render-blocking and for buttons, link not crawlable.

    Thread Starter tobiasber

    (@tobiasber)

    we did not find time to finally solve the problem and test it.

    @arun: we did put the code in the header.php of our childtheme

    There are Plugins that should do the same. We ve tested Hummingbird, but in older versions that was uncomfortable to handle.Because it changed the name of the loaded scripts, so we could not find out which script will cause the renderblocking or which script will cause malfunctions of the website when deferred

    if links are allowed in this thread, this will help: https://onlinemediamasters.com/slow-wordpress-site/#php-version

    and search the internet for “critical redering path” and “delaying scripts”

    Thank you. The link provides a great deal of useful info. I tried the HTML code mentioned above but it too showed up as an issue in Google PageSpeed Insights. So, the plugin is better as it displays analytics, etc in the WordPress dashboard itself.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to defer/async the loading?’ is closed to new replies.