Rhia42: You have to install phpMyAdmin, so you can view your database.
Anyway, I think I am slowly starting to see the root of the problem on my system. Here is my hypothesis:
The issue seems to be in the cache generation, more precisely: The queries that generate the yarpp_related_cache are sometimes timing out.
I sometimes see the "Constructing the related posts timed out" message (I haven't seen that before this week), but it seems to me, that this is only shown for the first query. If the subsequent queries fail, the user won't know that (!) and the yarpp_related_cache table contains a lot of zeroes.
In my case, this difference lies in the WPG2 plug-in, which significantly slows down certain operations. With this plug-in disable the cache generation of related posts takes about 30 seconds and yarpp_related_cache table contains those zeroes and a few valid numbers - these numbers are different every time I rebuild the cache, so I can see that it's not a simple software error (it would probably be the same every time).
With the WPG2 deactivated, the generation takes about 4 seconds and all is ok. Of course, for different blogs, there might be different plug-ins that cause this slowdown.
The solution might be to increase the waiting time, but I don't know exactly how to do it. I will try to guess it, but I am no PHP/Java/Ajax programmer, so it is a bit difficult for me (I am only experienced in C++/Pascal). Mitchoyoshitaka, could you help me, please?
Aside from that, when I was examining the code, I found one possible inefficiency in yarpp_get_cached_keywords() function:
$out = $wpdb->get_var("select $type from {$wpdb->prefix}yarpp_keyword_cache where ID = $ID");
if ($out === false or $out == '')
yarpp_cache_keywords($ID);
$out = $wpdb->get_var("select $type from {$wpdb->prefix}yarpp_keyword_cache where ID = $ID");
}
should probably be:
$out = $wpdb->get_var("select $type from {$wpdb->prefix}yarpp_keyword_cache where ID = $ID");
if ($out === false or $out == '') {
yarpp_cache_keywords($ID);
$out = $wpdb->get_var("select $type from {$wpdb->prefix}yarpp_keyword_cache where ID = $ID");
}