How can PHP developers optimize the performance of social media counters like Facebook, Twitter, Pinterest, and Google Plus?
One way PHP developers can optimize the performance of social media counters like Facebook, Twitter, Pinterest, and Google Plus is by using asynchronous loading techniques. By loading the social media scripts asynchronously, the page can continue to load without being blocked by the social media counters.
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>