AddToAny link appearning on any post.
-
Greetings,
Thanks for writing this amazing plugin.
In recent privacy audits I noticed there was a request to AddToAny, and after tracking down it appears to be added by Nightingale Companion for social sharing buttons, however this function has been disabled for quite some time on my websites due to concerns over privacy and performance optimisation.
When the social sharing buttons are disabled, naturally the expected behaviour would be to remove the loading of the AddToAny script. Yet, Nightingale Companion would continue to add following code:
<script async src="https://static.addtoany.com/menu/page.js"></script>
After viewing the code of the plugin, I noticed that there is an attempt to remove this line being added, at line 44 of
social-sharing.php
:if ( ! empty( $output ) ) { $content = $content . '<script async src="https://static.addtoany.com/menu/page.js"></script>'; }
However, this condition is essentially always true, as the
empty()
function is, according to PHP manual, ‘essentially the concise equivalent to!isset($var) || $var == false
‘, and the $output variable is initialised to be an empty string.One potential solution would be to replace the
empty()
function withstrlen()
function, which would serve its intended purpose.Hope this could be addressed in future releases of this amazing plugin!
- The topic ‘AddToAny link appearning on any post.’ is closed to new replies.