• Resolved audioscavenger

    (@audioscavenger)


    hello and first, thank you for this plugin.
    second, thank you for adding a debug mode. It helped!

    So, I experienced a bug for which I spend 2 hours and I found out it’s because of your plugin. How? I just created a new post and the output was broken when I previewed or published it. It happened for every new empty post I created, and I was totally confused and scared my WP database was broken.

    By carefully analyzing the HTML generated, I found out that’s because the DIV that closes relpost-thumb-wrapper is missing. This is because my new posts didn’t have any related taxonomy/tag with other posts (new category I created).

    Reason why it breaks pages: When your plugin doesn’t find related terms, it calls the return $this->finish_process in the file related-posts-thumbnails.php.

    The problem is that your finish_process function outputs what’s in $output string and this contains an opening DIV at line 341. Since no /DIV is appended to this string when you return with the finish_process, it breaks everything in the page after your filter is applied!
    You have this problem at 5 different places:

    345: Posts number is 0
    377: No taxonomy terms to get posts
    395: No categories were selected
    443: No posts matching relationships criteria
    454: No posts found

    every time you return exit function with no related posts generated, it breaks the page.

    I suggest that you just reset $output before calling it when you have to call the function at the lines mentioned above. that’s what I did and it solved the problem.
    It makes sense that you should not output anything at all whenever your plugin can’t find related posts.

    also, I am very surprised to be the first to stumble upon this BLATANT bug.
    no harm done, just update your plugin and I’ll give you 5 stars 🙂

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Same here, solved moving the closing </div> inside the finishing method before the return.

    Hope this will be solved with next release.

    Hi, @audioscavenger and @lucabrj
    Sorry for the trouble,
    this issue is fixed and hopefully you will find everything working like charm in our next release.

    Thank you for using Related Posts Thumbnails.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘no related posts breaks website’ is closed to new replies.