How to find cause of PHP notices with no stack trace?

My WordPress debug.log is filling up with this group of seven PHP warnings/notices, recurring at least every half an hour…

[08-Mar-2018 09:05:03 UTC] PHP Notice: Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3736
[08-Mar-2018 09:05:03 UTC] PHP Notice: Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3738
[08-Mar-2018 09:05:03 UTC] PHP Notice: Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3740
[08-Mar-2018 09:05:03 UTC] PHP Notice: Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3736
[08-Mar-2018 09:05:03 UTC] PHP Notice: Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3738
[08-Mar-2018 09:05:03 UTC] PHP Notice: Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3740
[08-Mar-2018 09:05:03 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /home/mysite/public_html/wp-includes/class-wp-query.php:3736) in /home/mysite/public_html/wp-includes/pluggable.php on line 1216

The trouble is, as far as I can see, there is no reference to which plugin or culprit is causing this (I think the term for this is, there is no back trace / stack trace), so I’m finding it hard to debug.

The question is: How can I find out more detail in order to trace the cause?

I already have WP_DEBUG, WP_DEBUG and WP_DEBUG_DISPLAY all set to true.

I have looked in to setting PHP display_errors and error_reporting but, since I am already getting notices and warnings output, I am not sure whether these settings would add any more detail.

Is it possible these warnings are being generated by a non-WordPress plugin? I do have a PHP script operating on cron which invokes the wpdb environment but which is not strictly a plugin.

Read more here:: How to find cause of PHP notices with no stack trace?

Leave a Reply

Your email address will not be published. Required fields are marked *