• 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 with strlen() function, which would serve its intended purpose.

    Hope this could be addressed in future releases of this amazing plugin!

Viewing 1 replies (of 1 total)
  • Thread Starter Chise Hachiroku

    (@chise86)

    Correction – the issue is not just about the use of empty(), the condition seems to have has no relation in regard to the chosen option for social sharing.

    I have created pull request #61 on GitHub to fix this issue.

Viewing 1 replies (of 1 total)
  • The topic ‘AddToAny link appearning on any post.’ is closed to new replies.