4

My WordPress debug.log file is filling up with these PHP notices, alternately with a gap of about 15 minutes and then of several hours…

[23-Mar-2018 05:33:00 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3736
[23-Mar-2018 05:33:00 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3738
[23-Mar-2018 05:33:00 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3740
[23-Mar-2018 05:33:00 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3736
[23-Mar-2018 05:33:00 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3738
[23-Mar-2018 05:33:00 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3740

There was no stack trace that allowed me to understand more about the source of the notice. So I installed Xdebug on the server, and set it to “5”. Now debug.log is filling up with a more detailed log. Here is the trace equivalent of the above…

[27-Mar-2018 04:30:26 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3736
[27-Mar-2018 04:30:26 UTC] PHP Stack trace:
[27-Mar-2018 04:30:26 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:26 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:26 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:26 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:26 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:26 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:26 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:26 UTC] PHP   8. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:26 UTC] PHP   9. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:26 UTC] PHP  10. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:26 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3738
[27-Mar-2018 04:30:26 UTC] PHP Stack trace:
[27-Mar-2018 04:30:26 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:26 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:26 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:26 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:26 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:26 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:26 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:26 UTC] PHP   8. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:26 UTC] PHP   9. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:26 UTC] PHP  10. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:26 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3740
[27-Mar-2018 04:30:26 UTC] PHP Stack trace:
[27-Mar-2018 04:30:26 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:26 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:26 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:26 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:26 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:26 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:26 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:26 UTC] PHP   8. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:26 UTC] PHP   9. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:26 UTC] PHP  10. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:26 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3736
[27-Mar-2018 04:30:26 UTC] PHP Stack trace:
[27-Mar-2018 04:30:26 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:26 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:26 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:26 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:26 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:26 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:26 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:26 UTC] PHP   8. redirect_canonical() /home/mysite/public_html/wp-includes/canonical.php:532
[27-Mar-2018 04:30:26 UTC] PHP   9. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:26 UTC] PHP  10. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:26 UTC] PHP  11. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:26 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3738
[27-Mar-2018 04:30:26 UTC] PHP Stack trace:
[27-Mar-2018 04:30:26 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:26 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:26 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:26 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:26 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:26 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:26 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:26 UTC] PHP   8. redirect_canonical() /home/mysite/public_html/wp-includes/canonical.php:532
[27-Mar-2018 04:30:26 UTC] PHP   9. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:26 UTC] PHP  10. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:26 UTC] PHP  11. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:26 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3740
[27-Mar-2018 04:30:26 UTC] PHP Stack trace:
[27-Mar-2018 04:30:26 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:26 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:26 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:26 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:26 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:26 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:26 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:26 UTC] PHP   8. redirect_canonical() /home/mysite/public_html/wp-includes/canonical.php:532
[27-Mar-2018 04:30:26 UTC] PHP   9. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:26 UTC] PHP  10. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:26 UTC] PHP  11. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:26 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
[27-Mar-2018 04:30:26 UTC] PHP Stack trace:
[27-Mar-2018 04:30:26 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:26 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:26 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:26 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:26 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:26 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:26 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:26 UTC] PHP   8. wp_redirect() /home/mysite/public_html/wp-includes/canonical.php:533
[27-Mar-2018 04:30:26 UTC] PHP   9. header() /home/mysite/public_html/wp-includes/pluggable.php:1216
[27-Mar-2018 04:30:28 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3736
[27-Mar-2018 04:30:28 UTC] PHP Stack trace:
[27-Mar-2018 04:30:28 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:28 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:28 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:28 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:28 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:28 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:28 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:28 UTC] PHP   8. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:28 UTC] PHP   9. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:28 UTC] PHP  10. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:28 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3738
[27-Mar-2018 04:30:28 UTC] PHP Stack trace:
[27-Mar-2018 04:30:28 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:28 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:28 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:28 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:28 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:28 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:28 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:28 UTC] PHP   8. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:28 UTC] PHP   9. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:28 UTC] PHP  10. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:28 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3740
[27-Mar-2018 04:30:28 UTC] PHP Stack trace:
[27-Mar-2018 04:30:28 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:28 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:28 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:28 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:28 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:28 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:28 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:28 UTC] PHP   8. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:28 UTC] PHP   9. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:28 UTC] PHP  10. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:28 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3736
[27-Mar-2018 04:30:28 UTC] PHP Stack trace:
[27-Mar-2018 04:30:28 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:28 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:28 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:28 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:28 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:28 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:28 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:28 UTC] PHP   8. redirect_canonical() /home/mysite/public_html/wp-includes/canonical.php:532
[27-Mar-2018 04:30:28 UTC] PHP   9. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:28 UTC] PHP  10. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:28 UTC] PHP  11. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:28 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3738
[27-Mar-2018 04:30:28 UTC] PHP Stack trace:
[27-Mar-2018 04:30:28 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:28 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:28 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:28 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:28 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:28 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:28 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:28 UTC] PHP   8. redirect_canonical() /home/mysite/public_html/wp-includes/canonical.php:532
[27-Mar-2018 04:30:28 UTC] PHP   9. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:28 UTC] PHP  10. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:28 UTC] PHP  11. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:28 UTC] PHP Notice:  Trying to get property of non-object in /home/mysite/public_html/wp-includes/class-wp-query.php on line 3740
[27-Mar-2018 04:30:28 UTC] PHP Stack trace:
[27-Mar-2018 04:30:28 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:28 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:28 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:28 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:28 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:28 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:28 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:28 UTC] PHP   8. redirect_canonical() /home/mysite/public_html/wp-includes/canonical.php:532
[27-Mar-2018 04:30:28 UTC] PHP   9. is_front_page() /home/mysite/public_html/wp-includes/canonical.php:433
[27-Mar-2018 04:30:28 UTC] PHP  10. WP_Query->is_front_page() /home/mysite/public_html/wp-includes/query.php:410
[27-Mar-2018 04:30:28 UTC] PHP  11. WP_Query->is_page() /home/mysite/public_html/wp-includes/class-wp-query.php:3674
[27-Mar-2018 04:30:28 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
[27-Mar-2018 04:30:28 UTC] PHP Stack trace:
[27-Mar-2018 04:30:28 UTC] PHP   1. {main}() /home/mysite/public_html/index.php:0
[27-Mar-2018 04:30:28 UTC] PHP   2. require() /home/mysite/public_html/index.php:17
[27-Mar-2018 04:30:28 UTC] PHP   3. require_once() /home/mysite/public_html/wp-blog-header.php:19
[27-Mar-2018 04:30:28 UTC] PHP   4. do_action() /home/mysite/public_html/wp-includes/template-loader.php:12
[27-Mar-2018 04:30:28 UTC] PHP   5. WP_Hook->do_action() /home/mysite/public_html/wp-includes/plugin.php:453
[27-Mar-2018 04:30:28 UTC] PHP   6. WP_Hook->apply_filters() /home/mysite/public_html/wp-includes/class-wp-hook.php:310
[27-Mar-2018 04:30:28 UTC] PHP   7. redirect_canonical() /home/mysite/public_html/wp-includes/class-wp-hook.php:286
[27-Mar-2018 04:30:28 UTC] PHP   8. wp_redirect() /home/mysite/public_html/wp-includes/canonical.php:533
[27-Mar-2018 04:30:28 UTC] PHP   9. header() /home/mysite/public_html/wp-includes/pluggable.php:1216

I can’t quite understand what the problem is. I mean, there’s reference to canonical, to plugin.php, to blog header. I also see is_page in there.

One thing I am wondering if this relates to Advanced Custom Fields. I have an ACF field group set to display on Page edit screens. And I have written my page.php theme file to output content based on the content saved in the backend.

The site is also a child site running off WordPress Multisite, so does canonical have a role here?

I'm also aware "Cannot modify header information - headers already sent" can sometimes indicate a stray space at the end of a plugin file.

But, still, I don't quite know where to go next with the evidence gathered.

Thanks.

  • 5
    I used to get these a lot. I tracked them back to hooks I had in plugins or themes such as pre_get_posts and wp_enqueue_scripts - Trac suggested that conditional functions shouldn't be called in such early hooks - since then I double up on my conditional checks. Either way, these errors are difficult to track down ( I used debug_backtrace() in core files to trigger them locally ) and even more difficult to work around. – Howdy_McGee Mar 27 '18 at 21:47
  • I would recommend to use Query monitor to get more info about these bugs – Radek Mezuláník Jun 20 at 6:23
0

I've been trying to tackle this problem myself for weeks now and I finally found what caused it for me. It was the woocommerce plugin, so you might want to try and disable it to see if this also is the case for you.

I've already opened a support ticket with woocommerce: https://wordpress.org/support/topic/major-database-issues-server-chrash/

Edit: I must give woocommerce a little more credit, as (in my case) it's the combination of woocommerce with a server setup (apache & mysql) that's totally outdated.

Furthermore, the notice seems to be a know issue that hasn't been resolved yet, see: https://github.com/woocommerce/woocommerce/issues/21756

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.