• fabrizim

    (@fabrizim)


    Currently, there is an issue where the javascript is not being output for posts when:

    • Yoast SEO is enabled and the Facebook OpenGraph setting is enabled and,
    • A post does not have an explicit excerpt

    The problem is that when the OpenGraph meta tags are output, “get_the_excerpt” is called, which in turn calls “get_the_content” to generate the description. In the process the “the_content” filter is run. The AddThis plugin hooks into that filter to add the JS and only outputs once. When the “the_content” filter is called later in the page, it thinks it has already been output, so the JS is not added to the content.

    This is a note to the developers of the develop to fix this – in the addthis_addjs_new.php file, the function output_script_filter contains a conditional:

    if ($this->_js_added != true && ! is_admin() && ! is_feed() )
    which should be changed to:
    if ($this->_js_added != true && ! is_admin() && ! is_feed() && in_the_loop() )

    That will only run the output when during the main execution of the page, instead of in the head.

    Hope this helps and you can include the fix as I’d imagine it affects a large set of users.

    https://wordpress.org/plugins/addthis/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Julka Grodel

    (@jgrodel)

    Hi Fabrizim.

    Thanks for all the details!

    We’re testing this change to try to ensure it doesn’t break anything else (and using all those wonderful details you provided to try to replicate this issue, yet again). If the tests go well, this should go our with the next release.

    Thanks again,
    Julka

Viewing 1 replies (of 1 total)
  • The topic ‘WordPress SEO by Yoast issue (and fix)’ is closed to new replies.