WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddThis
[resolved] Performance Issues with AddThis plugin how to implement this solution? (2 posts)

  1. pilot911
    Member
    Posted 1 year ago #

    The load performance of my blog is showing up AddThis as being the main culprit (I have made other changes to improve load time, but AddThis is now top of the slow list).

    From reading other posts here and on the AddThis forum it seems that adding there are two options or two stages contained in this post:

    http://www.addthis.com/forum/viewtopic.php?f=2&t=35161

    I am a little unclear as to the steps, maybe someone can enlighten me. After reading and rereading I assume these are the steps but I would just like to check as i am not a professional programmer.

    Step 1 Add &async=1 to the URLs in the plugin (there are three URLs to add it to in the plugin's addthis_social_widget.php);

    Step 2 At the bottom before the </body> tag, insert this JS code.

    <script type="text/javascript">
    
         function initAddThis() 
    
         {
    
              addthis.init()
    
         }
    
         // After the DOM has loaded...
    
         initAddThis();
    
    </script>

    Step 3 This can be implemented by running this in the body tag's onload attribute or using jQuery like so:

    $(window).load(function(){
      addthis.init();
    });

    Steps 1 and 2 seem clear to me, but where do I add Step 3 exactly. Or have I got the wrong end of the stick and mixing apples and pears.

    Any assistance is much appreciated as I have been banging my head with this issue all day.

    http://wordpress.org/extend/plugins/addthis/

  2. Srijith V
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    You can ignore step 2, and directly go for Step 1 and 3.

    For Step 3, add the code

    <script type="text/javascript">
    $(window).load(function(){
        addthis.init();
    });
    </script>

    any where in the page (If you are confused, add it just before </body>). What that code does is to tell Javascript to call addthis.init() when the web page is completely loaded.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic