Cannot modify header information
-
I’m seeing a lot of this warning lately on my sites. Any ideas?
PHP Vers 8.2.18, 8.2.17 and some sites using 7.4.33PHP Warning: Cannot modify header information - headers already sent in /wp-content/plugins/wp-optimize/cache/file-based-page-cache-functions.php on line 688
-
So I figured out this error is generated whenever wpcron runs via the server with wget
In my wp-config.php I have Disabled WP Cron.
I have a Cron job on the server set to run every hour and that is generating the error warning.wget -q -O - https://www.mydomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1Any way to fix this? It has only recently become an issue.
Hi there!
Thank you for bringing this issue to our attention. I’ve tried replicating the problem on our end, but everything seems to be functioning normally here.
Could you please try deactivating the WP-Optimize plugin and then reactivating it?
After doing this, please check if the warning message still appears. Let me know how it goes, and we can explore further steps if needed!
ThanksOK I will do that and report back. Every site I own (about 35) that I am using the wget to run wp-cron is seeing that.
They all run once an hour so it won’t take long to test it that way.
FYI I saw in my research that another optimize plugin had this same issue awhile back.
ThanksI’ve verified that all sites using wget to run cron from the server have this error. Even on different servers.
I’ve also verified that the error started after updating the plugin to the latest version 3.3.2
I rolled back to version 3.3.1 and the error is no longer there so it is definitely something with the latest version.
Thanks
Hi,
Can you post your php error logs for a couple of your logs using a tool such as pastebin.com.
They are basically all the same.
They all point to the same file. They are timestamped once an hour which is when wp-cron runs via wget on server cron job.
https://pastebin.com/5tDsnXpDCan you list your plugins and theme?
Let me test it on a site with minimum plugins and default WordPress theme and I’ll get right back to you.
Hi,
I’m using a staging site to test this.
So I’ve eliminate everything else.
The theme is Twenty Twenty-Four
The only plugins are:
WP-Optimize
WPS Hide LoginI’m still seeing the error when wp-cron runs via the server:
wget -q -O - https://www.mydomain.biz/wp-cron.php?doing_wp_cron >/dev/null 2>&1The error is:
[23-Apr-2024 18:50:02 UTC] PHP Warning: Cannot modify header information - headers already sent in /wp-content/plugins/wp-optimize/cache/file-based-page-cache-functions.php on line 688If you can just rollback the changes from the latest update something in that update is causing the issue. Possibly a whitespace in the wrong place or a typo in a statement in that file?
Thank you for your patience and for providing such detailed information about the issue you’ve encountered with the WP-Optimize plugin.
We have successfully replicated the error on our end, and I’ve forwarded all the relevant details to our development team for further investigation. They’re now working on identifying the root cause and will aim to deliver a fix as soon as possible.
We appreciate your effort in helping us improve our plugin and apologize for any inconvenience this may have caused. We’ll keep you updated on the progress and notify you once a resolution is implemented.
We truly appreciate your patience and cooperation.
Good news @wpmansour
Thank you for all your hard work investigating this issue. It is much appreciated.
You’re welcome! I’m glad to help π
Agreed. This has not been resolved yet.
Hey @wpmansour
I’ve reposted this issue in a new post since it is still unresolved:
https://ww.wp.xz.cn/support/topic/error-when-running-cron-from-server-cron-job/#new-topic-0
Thanks,
The topic ‘Cannot modify header information’ is closed to new replies.