All about Magento E-commerce Store.......MagentoForum: Big Addthis script problems – security warning and slow down website loading

Thursday, July 28, 2011

Big Addthis script problems – security warning and slow down website loading


Addthis is not something new to all webmasters and this bookmarking widget service seems to be one of most famous/best provider in comparison with other bookmarking toolbars services. Almost US government websites use addthis. But they have a problem? Surprising?
But yes, their service is great and no complaint but they have two big problems with their include scripts which they give Webmasters to include websites

First, you should easy to get this script at their site and they almost like this
 <script type="text/javascript">  var addthis_config = {"data_track_clickback":true};  </script> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e2bca0270543b68"></script> <!-- AddThis Button END --> 
Now most important thing is this line
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e2bca0270543b68">
Problem 1: If you have an commerce website (Magento) or a secured website which use HTTPS. I believe that you will get problem on pages using HTTPS. For example, on some browsers (IE) visitors will get a warning that "Do you want to view only the webpage content that was delivered securely?
This webpage contains content that will not be delivered using a secure HTTPS connection, which could compromise the security of the entire webpage". People will scare and leave your websites.
Problem 2 : Have you ever noticed that your website is loading slowly? Or even loading forever since installing addthis? The problem happen very offen because you are loading script from addthis and depend on them, when their site is slow, your website is slow then.
Resolving this is very simple. Many famous services do it right, for example Google Analytic. Your script need to be corrected in order to loading script from correct protocol, also make your script is loaded in asynchronous mode.
Here is the correct script
<script type="text/javascript"> (function() { var at = document.createElement('script');   at.type = 'text/javascript';   at.async = true; at.src = ('https:' == document.location.protocol ? 'https://' : 'http://')   + 's7.addthis.com/js/250/addthis_widget.js#pubid=xa-4d8eb8dd3c58ddf8'; var sat = document.getElementsByTagName('script')[0];   sat.parentNode.insertBefore(at, sat); })(); </script> 
Please remember to make pubid with your one.
Note : If you found this post useful, please leave a comment and also click on Recommend button in order to spread to to everyone. I hope addthis will publish new integration script on their website soon

No comments:

Post a Comment