For about 4 weeks now, I’ve been having intermittent issues with my site. Every 24 hours or so, there are are timeout issues. Here are the recurring lines in the error log:
Whilst on version 2.2.x:
[24-Mar-2018 14:50:29 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/evangood/public_html/wp-content/themes/newjavelin/inc/helpers.php on line 496
[24-Mar-2018 14:22:08 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/evangood/public_html/wp-includes/post-template.php on line 284
After updating to the latest 2.5.x:
[24-Mar-2018 16:07:36 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/evangood/public_html/wp-content/themes/evennewerjavelin/single.php on line 158
the relevant line in the file is: if( count($related_posts) > 0 ) :
[24-Mar-2018 18:54:39 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/evangood/public_html/wp-includes/post-template.php on line 284
the relevant line in the file is: if ( $page > count( $pages ) ) // if the requested page doesn’t exist
These issues are read to the error_log every 50 mins or so, I assume this is anytime someone tries to load the site. However, the timeout issues only happen every 12-24 hours. When it happens at my house for example, no devices on my network can access the site, until about 10 mins later when it just starts working again. FTP is not accessible either.
I have a couple of website monitors running, the image attached are the uptime/downtime logs from the main monitor for the past week or so.
Any help at all would be greatly appreciated – happy to post more information if anyone needs!
Sorry to hear of the problem you are having.
You can fix your site timeout issue by using the solutions shared in the following pages.
Thanks for your reply!
I have already increased the execution time of my php.ini and I have also tried deactivating all my plugins. Those solutions do not work.
When I switch to the basic theme however, I do not have the issue! This is why I assumed it was an issue with the Javelin theme. If you could please take another review of my post, specifically the error messages I’m getting and the relevant lines in their files, I would greatly appreciate it. Really struggling here!
These are simple PHP warnings and most of the time it doesn’t affect functionality of site so it is nothing to worry about!
Do you have WP_DEBUG set to true in your wp-config.php file?
If you do then please set it to false. This will hide the warning messages.