• Resolved Matt

    (@mattjd)


    Hi, I’ve been working on a client’s website for a year or so now. I’ve never had the need to check the error log until recently when I started having problems with a different plugin. However, when I checked the error log today, it was absolutely crammed with the following PHP warning from this plugin:

    [16-Feb-2024 00:00:08 UTC] PHP Warning: Cannot modify header information - headers already sent in /wp-content/plugins/cookies-and-content-security-policy/inc/set-cacsp.php on line 150

    Edit: It also refers to line 148:

    [16-Feb-2024 02:20:52 UTC] PHP Warning: Cannot modify header information - headers already sent in /wp-content/plugins/cookies-and-content-security-policy/inc/set-cacsp.php on line 148

    This one error seems to be repeated 10’s of thousands of times. There are probably something like 5,000+ records of it in February alone. The error log is about 250MB, and if I do a Ctrl+F for this in Visual Code, I just get 19999+.

    Is this something specific to this client’s site, or something you’re able to replicate?

    Thanks, Matt.

    • This topic was modified 1 year ago by Matt.
    • This topic was modified 1 year ago by Matt.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Johan Jonk Stenstr?m

    (@jonkastonka)

    Are you using the latest version of the plugin?

    Do you have Debug enabled?
    Debug is found under WP Admin > Settings > Cookies and Content Security Policy > Settings > Advanced settings

    What theme are you using?

    I just tested the latest version of the plugin and I get no warnings (or errors) at all. Have you tried disabling other plugins to see if there’s a compatibility issue?

    Plugin Author Johan Jonk Stenstr?m

    (@jonkastonka)

    I can see that you’re actually right, sometimes, not always, I get that too. I will see what I can do.

    You should probably not have WP_DEBUG_LOG active in production, since there is a risk that everyone is able to view the /wp-content/debug.log file.

    Thread Starter Matt

    (@mattjd)

    Yes, I’m on the latest version of the plugin and Debug is not enabled.

    It’s a custom theme, but it’s a relatively basic one really. So I’m not sure anything would be interfering there.

    I’m unable to disable any plugins. There’s currently no dev environment setup for this particular site, I’m working on it on a part-time basis. When I have time, I’ll get a copy running locally so I can test further.

    Glad to see you’ve managed to replicate it in some capacity. Let me know your findings. I’ll double-check the WP_DEBUG_LOG setting, thanks for the heads up.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP Warning: Cannot modify header information’ is closed to new replies.