WordPress.org

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] [Plugin: Yet Another Related Posts Plugin] YARPP shows "no related" on some posts - but if (15 posts)

  1. Dan & Jennifer
    Member
    Posted 3 years ago #

    Hi guys! running latest YARPP on latest WordPress MultiSite.

    Been using YARPP for years on half a dozen sites, including WordPress MultiSite without issues, the threshhold is set fine, and most posts show related posts fine. :-)

    However - there seems to be some glitch, wondering if the YARPP cache may be corrupted?

    I'm seeing random posts that show no related posts, even though there are plenty of related posts to be found. i.e. this post on starting a blog. Again, most other posts show related posts fine.

    But what's strange is that if I update such a post, then it shows related posts fine.

    Any idea what causes that? could the YARPP related cache be corrupted somehow?

    Is there a way to flush whole YARPP cache, and would that even help? :-) Thx!!

    Have an awesome day!
    Dan

    P.S. Another bizarre thing that's likely related - there are some posts that WERE showing related posts yesterday, that no longer show related posts - even though they were not directly edited.

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

  2. azn137
    Member
    Posted 3 years ago #

    Yeah, I've been having this issue for a few months now. If you search on the forum, there are a lot of posts regarding this issue that are not resolved. Mitcho hasn't exactly been around, so we're SOOL.

  3. Dan & Jennifer
    Member
    Posted 3 years ago #

    @azn137 thanks for chiming in.

    Hey guys, does anyone else have any insights on this?

    Thanks!
    Dan

    [ Please do not bump, that's not permitted here. ]

  4. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 2 years ago #

    Are you guys by chance using some sort of object caching? Perhaps the W3 Total Cache object caching, or some other memcache solution? I'm trying to diagnose this, and this seems to be part of the issue.

  5. Dan & Jennifer
    Member
    Posted 2 years ago #

    Hey Michael!

    Yep, running W3 Total Cache with all 3 caches enabled: object cache, page cache, AND db cache. though that's how we've been running for 2+ years...

    Thanks!
    Dan

  6. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 2 years ago #

    It's possible that YARPP introduced an issue which interacts poorly with object cache. Looking into it.

  7. 762mm
    Member
    Posted 2 years ago #

    I've been having this issue (random posts with no related) on multiple sites since a yarpp update back around 9 months ago. Looking through the forums it looks like many other people are having the same issues.

    While investigating this I noticed rows in wp_yarpp_related_cache that had an ID of 0, which would be invalid if the ID was supposed to be the ID of a post. (These rows also had a score of 0.) Even though there were other valid related items in the cache for the same reference_ID, apparently yarpp returns nothing as related when it encounters this bad data.

    Deleting these rows fixed things, so as a workaround I made a script that periodically removes this bad data and everything has been working fine.

    mitcho - Perhaps the above might lead to a solution. If this is indeed bad data, you can find out where it is coming from. Since it seems to occur randomly (deleting all data related to a reference_ID and regenerating it doesn't cause the bad data to come back), it may take a little while to track it down. In the meantime you can easily block invalid data like this (any with ID==0) from being written to the cache and/or ignore it when you get bad data when creating the related posts to do the best job possible at creating the related list even with corrupt data.

  8. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 2 years ago #

    @762mm thanks for the detailed info. The ID=0 values you're seeing are special values that I set in the cache with the meaning of "no related posts".

    The logic is as follows: if there's a row in the cache with ID=0, then it's cached and there are no related posts. If there's no associated rows in the cache, it was never computed and needs to be computed.

    So the ID=0 you're seeing is not an error or corrupt data, but it *is* an indication that some posts are getting "no related posts".

    Separately from this issue, though, as you know, YARPP currently seems to be having some issues where, in some environments, for some people, you get "no related posts" even when you shouldn't. This is not something that is a problem with the cache (I believe) but is some issue with the algorithm choking at some times. In other words, the ID=0 storing "no related posts" as cached is not by itself a problem. Normally, if everything's working right, if you delete a row with ID=0 and then recompute that entry, it should just cache ID=0 again.

    If you notice any patterns or have any ideas as to *what kinds of posts* or *when* these "no related posts" get computed incorrectly (that is, if you remove the row and recompute, it does compute real results) then I'd love to get that kind of information. I've been struggling with this for some time now (as you know), particularly as I'm not able to adequately reproduce the issue.

  9. 762mm
    Member
    Posted 2 years ago #

    Mitcho - Thanks for the response. The strange thing is that there is other related data in the cache even when there is the ID=0 item.

    i.e. I limit it to 8 related posts in my settings, and in the cache there will be a total of 9 related for a post with one of them having the ID=0.
    Deleting just that one post allows the 8 related ones in the cache to be displayed without it having to regenerate the data. If I delete all 9 it does regenerate the same 8 valid related items in the cache. (When I have regenerated the data, I have never seen it generate one of these ID=0 values.)

    I have not seen any pattern to it. As mentioned, if I flush the cache data for a particular post that is affected, I don't see it regenerate the ID=0 data, so it doesn't seem related to the particular post. It really seems quite random, but I didn't notice this happening at all until a yarpp update around January.

    I'll try to track things better and let you know if I spot any patterns. The two sites where I am experiencing this issue are on different servers and both of them have very fast cpu and IO subsystems, plenty of RAM, and always have a low load, so I don't think it is a lack of hardware resources.

  10. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 2 years ago #

    The strange thing is that there is other related data in the cache even when there is the ID=0 item.

    i.e. I limit it to 8 related posts in my settings, and in the cache there will be a total of 9 related for a post with one of them having the ID=0.
    Deleting just that one post allows the 8 related ones in the cache to be displayed without it having to regenerate the data. If I delete all 9 it does regenerate the same 8 valid related items in the cache. (When I have regenerated the data, I have never seen it generate one of these ID=0 values.)

    BOOM. This must be the issue! (I don't know *how* you would ever get such structure of data, but...) I just created a beta which will result in printing the results in these cases, instead of acting like there are no related posts. Please let me know if this fixes the issues! (Of course, please check your database first to see if you currently have such cases, then upgrade YARPP, and then revisit that post and see if it displays now.) I would be so happy if this fixes the common source for the "no related posts" for many people...

    Here's the new beta:
    http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.3.5.3b4.zip

  11. 762mm
    Member
    Posted 2 years ago #

    Thanks! I will test out the beta and report back.

    I don't know *how* you would ever get such structure of data, but...

    Previously I always found the date for all the data for one reference_ID in the cache to be the same, so the ID=0 is being created at the same time as the other data. However, I just located some where it is a second or two later than the other data. Perhaps it is always being generated just after the other related data, but it isn't usually noticeable since it happens within the same second.

    It is NOT a situation where there are related posts but no related pages, because I see the ID=0 situation even when there are both related posts and related pages listed in the cache.

    In this example, ID 7155 and 9732 are pages, where the rest are posts.

    28720 0 0 2012-09-14 22:25:04
    28720 4149 23.4 2012-09-14 22:25:04
    28720 4266 27.1 2012-09-14 22:25:04
    28720 7155 3.2 2012-09-14 22:25:04
    28720 9732 3.9 2012-09-14 22:25:04
    28720 12611 23.7 2012-09-14 22:25:04
    28720 14788 23.3 2012-09-14 22:25:04
    28720 23162 23.5 2012-09-14 22:25:04
    28720 25085 33.8 2012-09-14 22:25:04
    28720 27918 23.9 2012-09-14 22:25:04
    28720 28210 26.5 2012-09-14 22:25:04

  12. 762mm
    Member
    Posted 2 years ago #

    Yes! This beta fixes it!

    I tested a post with ID=0 in the cache where "no related posts" was displayed, and it now displays the related posts.

  13. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 2 years ago #

    Fantastic! I'll spread the good news.

    Barring any other immediate issues, I'll push this build out as a new update.

  14. Dan & Jennifer
    Member
    Posted 2 years ago #

    That is really awesome news guys!

    @762mm we too dug a lot into the data and found the id=0 entries, and tried deleting them, but they were always being recreated for other posts. Awesome that you were able to debug this effectively!!

    @Mitcho that's great news!!! look forward to testing the standard table cache again and moving back to it. We've been using the PostMeta Cache for some time now because of the "no related posts" issue in this thread, in spite of all the dup rows in PostMeta Cache. :-)

    Have an awesome day!
    Dan

  15. Dan & Jennifer
    Member
    Posted 2 years ago #

    @Mitcho fyi per your question above, wanted to add that we've even stopped using object caching - were using W3 Total Cache but it's not had a release in well over a year, so concerned about reliability with it.

    Instead we're using CloudFlare now, which is like a cache in front of your site... so there's no object cache interaction with YARPP anymore.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yet Another Related Posts Plugin (YARPP)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic