WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[Plugin: Yet Another Related Posts Plugin] referenceId not used when geting posts from cache (2 posts)

  1. mediascreen
    Member
    Posted 2 years ago #

    Hi,
    YARPP seems to show the same related posts for all posts. When I look at the database it looks like the correct cache is generated but that the query to fetch the cache isn't restricted to the current post id. Because of that the list just shows a list of all posts sorted by yarpp.score and this post usually includes both duplicates and the current post and it's the same for all posts.

    This problem only seems to show up for posts translated with WPML - the original language doesn't seem to be affected.

    I think this is the query being run:
    SELECT SQL_CALC_FOUND_ROWS posts.*, yarpp.score FROM posts JOIN icl_translations t ON posts.ID = t.element_id AND t.element_type IN ('post_post') JOIN icl_languages l ON t.language_code=l.code AND l.active=1 join yarpp_related_cache as yarpp on posts.ID = yarpp.ID WHERE 1=1 AND posts.post_type IN ('post') AND t.language_code='pl' ORDER BY yarpp.score DESC limit 5

    The version of YARPP is 3.5.1

    Example pages here:
    http://blog.duego.com/es-ar/tu-perfil/
    http://blog.duego.com/pl/projekt-modelka/
    (Related posts are under the orange sidebar heading)

    If there is no quick fix, maybe there is a way to temporary disable or bypass the cache since we are using a page cache anyway.

    http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/

  2. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    I don't think bypassing the cache will help in this case... a loop kind of like this is always used by YARPP.

    It looks like this is a bad interaction between YARPP and WPML: WPML is removing the YARPP code which specifies the post ID in the query. I don't have much experience with WPML, so I'd appreciate it if you reach out to the WPML authors.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic