Plugin Author
Ajay
(@ajay)
Could you please replace lines 66 to 68 with this:
$results = get_post_meta($post->ID, 'wheredidtheycomefrom', false);
if ( ! empty( $results ) ) {
$results = array_diff($results, array_map ('intval', explode(',', $wherego_settings['exclude_post_ids']) ) );
}
Thread Starter
jshare
(@jshare)
How I tested this-
I found a post with the error appearing, made the code change and refreshed the page. The error disappeared but the only result that appears was a link to that post itself, which doesn’t make any sense. In other words, the plugin was saying that ‘people also visited’ post X, and this was appearing *on post X*.
I visited some other posts and couldn’t see the error anywhere, but all the articles I visited only had one result and it was either self-referential or it was the first post ever in the archive (Hello World!)
Plugin Author
Ajay
(@ajay)
Can you tell me how you found the array_diff error. I mean how did you test / reproduce the existing error without the code changes.
I don’t see this error on my blogs, but obviously there is an issue I’d like to replicate and fix.
Thread Starter
jshare
(@jshare)
Before the patch you sent, the error wasn’t appearing on every post. The question is on which posts was it appearing i.e. what did those posts have in common? After taking another look, it looks like the error appears on articles that no one has left from i.e. the plugin has no results to display. In all the articles where the error displays, my choice for ‘When there are no posts, what should be shown?’ is displayed.
One thing worth mentioning is that I’m on multisite.
Plugin Author
Ajay
(@ajay)
Thanks for the explanation. I’ll try to see how I can replicate this.
Is this a PHP error that is displayed directly in the post? Or is this something in the error_log?
It could also be a problem for multisite because I haven’t tested the plugin on multisite.
Thread Starter
jshare
(@jshare)
This is a PHP error that is displayed directly in the post.