wp-plugins/addthis — pull request #1 by larruda (2014-08-08 13:44:41+00:00)
Title: Add option to include Javascript on footer

Hello "addthis" maintainers!

I've been using this WordPress plug-in for quite some time on some projects and it has presented us with a conflict with another plug-in called "WordPress SEO by Yoast". The problem is related to the Javascript file added by "addthis" which is prevented of being added by the other plug-in mentioned. The issue is described in details on this post: http://wordpress.org/support/topic/addthis-widget-buttons-inactive-with-wp36

While trying to figure out why this was happening on "addthis" source-code I have found out a quite complex logic to search for a footer on the site theme and also force a HTML comment on it. It's error prone because we also use another plugin intended to compress the HTML output which also removes any comments, thus this flow does not work on our setup.

My proposal, as you can check on this pull request diff, is to add an Option on the Advanced settings tab so the user can choose whether or not to add the javascript on their site's footer instead of the header. This is a recommended approach specially for elements that are not indeed necessary for the page to be loaded or functional, such as the Add This feature. Besides that the page load from a user perspective is improved. For this I also removed the logic mentioned above as it's fallible and not necessary.

It's important to note this change does not fix the conflict with the other plug-in, but instead it gives us the option to mitigate it and with a better approach than the current one to use the "footer feature".

Could you please review the code and approve it if it's alright?

Thanks in advance!