We have been experiencing the EXACT same issue, and it’s leading us to move to different methods for implementing headers. In our case, it is using this plugin with the Beaver Builder Theme/Child. Sometimes the trigger is just a menu update.
One clue you should investigate: I’ve seen PHP errors that make me think that a server-side cache used by many shared hosting providers (Endurance Page Cache) that is added as a must-use plugin is trying to send the header twice. I don’t know if this is a cause or an effect – but I’m fairly sure it’s related.
Here’s the error log item (i’ve removed the account name for privacy) that was the only PHP error recorded yesterday when I had this issue on one of our sites. This one is on GoDaddy, but the same has happened on Bluehost:
[27-Jan-2020 16:06:11 UTC] PHP Fatal error: Uncaught Error: Call to undefined function is_user_logged_in() in /home/accountnamehere/public_html/wp-content/mu-plugins/endurance-page-cache.php:721
Stack trace:
#0 /home/accountnamehere/public_html/wp-content/mu-plugins/endurance-page-cache.php(760): Endurance_Page_Cache->is_cachable()
#1 /home/accountnamehere/public_html/wp-includes/class-wp-hook.php(288): Endurance_Page_Cache->finish(”)
#2 /home/accountnamehere/public_html/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array)
#3 /home/accountnamehere/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#4 /home/accountnamehere/public_html/wp-includes/load.php(947): do_action(‘shutdown’)
#5 [internal function]: shutdown_action_hook()
#6 {main}
thrown in /home/accountnamehere/public_html/wp-content/mu-plugins/endurance-page-cache.php on line 721
-
This reply was modified 4 years, 10 months ago by AUMW-Jay.