This is obviously good for you and your website, but adding social media buttons can also increase the loading time of your website, adding frustration to your visitors. This can also be a negative factor for your SEO efforts, as page speed is an important factor for your rankings on Google and other search engines.
Using asynchronous loading buttons you can reduce the load time significantly, at least the feeling of load time.
The normal implementation of these buttons (the currently most predominant are Facebook, Twitter, Google+ and LinkedIn) would mean extra code and loading scripts from other domains while loading your website.
Socialite.js for the rescue!
Socialite.js currently has support for the following social media: Twitter, Google+, Facebook, LinkedIn, Pinterest and Spotify.
David Bushell has made it very easy to embed these like and share buttons and it is also cross-browser compatible.
How to use
Not that difficult, is it? The single line enqueues the script, which is placed in the /js/ folder. Since we are looking for speed, I use the minified version of the script, “socialite.min.js”.
The library itself has examples on how to embed, but here is an example that works with internal WordPress functions:
<a class="socialite facebook-like" href="http://www.facebook.com/sharer.php?u=<?php echo get_permalink(); ?>&t=<?php echo urlencode(get_the_title()); ?>" target="_blank" rel="nofollow" data-href="<?php echo get_permalink(); ?>" data-send="false" data-layout="button_count" data-width="60" data-show-faces="false"> <span class="vhidden">Facebook</span> </a>
Note: Loading social media buttons asynchronously can be beneficial to any website, not just WordPress websites.
Note: Although I prefer to embed Socialite.js manually, Tom Morton is developing a WordPress Plugin if you prefer.