• Resolved masouddarvishi1992

    (@masouddarvishi1992)


    Hello. This error fills up my entire WordPress error_log file. The error is from your plugin.

    [14-Nov-2022 11:32:21 UTC] PHP Warning: Cannot modify header information – headers already sent in /home/public_html/wp-content/advanced-headers.php on line 31

    line 29 to 31 advanced-headers.php
    header(“X-XSS-Protection: 0”);
    header(“Cross-Origin-Opener-Policy: same-origin-allow-popups”);
    header(“Cross-Origin-Resource-Policy: cross-origin”);

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    Hi @masouddarvishi1992,

    This doesn’t necessarily mean the error is in the plugin. The error occurs because some other code has sent headers already, even though we’ve only just arrived at the wp-config.php.

    Possibly there’s an include from another plugin before the advanced-headers.

    In your wp-config.php, please check if the advanced-headers.php file is included before anything else. If there’s a caching plugin active, ensure that any includes are after the advanced-headers.php file.

    I am having the same errors on multiple sites since the new updates.

    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    Hi @lemjack7 @masouddarvishi1992,

    I now realise these includes are beloning to our add-on. We’re not allowed to discuss these features on the forum, as these are not part of the free plugin, so can you contact us directly at support(at)really-simple-ssl.com about this?

    Thanks,

    Rogier

    Thread Starter masouddarvishi1992

    (@masouddarvishi1992)

    @rogierlankhorst

    I found the problem. In the wp-config.php file, a code was added to call the advanced-headers.php file again! I don’t know what plugin added this!

    I removed it and the problem was fixed.

    I have sent a copy of the files.
    Cheers Roger

    @masouddarvishi1992 This fixed my problem too. Thank you very much.

    Thread Starter masouddarvishi1992

    (@masouddarvishi1992)

    @rogierlankhorst

    I updated your plugin on my site today. added this piece in the wp-config.php file!! This part causes various errors!

    if ( file_exists(ABSPATH . “wp-content/advanced-headers.php”) ) {
    require_once ABSPATH . “wp-content/advanced-headers.php”;
    }

    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    Is this the ‘headers already sent’ warning?

    This warning can occur on some configurations, we have a fix ready for this. If you want you can email us for the beta release of this version. support(at)really-simple-ssl.com

    It will be released early next week.

    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    @masouddarvishi1992 @lemjack7 @jarvia

    The issue seems to be that on some systems, the server throws an error, or sends a header, before the it reaches the ‘advanced-headers.php’ file. As a result, our code throws an error ‘headers already sent’. This is because the unknown error causes headers to get sent.

    To catch this, the coming update will include a headers_sent() check.

    Of course, this can’t fix the issue that seems to exist on these configurations: we have no control over that. But it is possible to find out which code is causing this, by adding the following line of code to the advanced-headers.php file:

    if ( headers_sent($filename, $linenum) ) {
    	error_log("headers already sent in $filename, on line $linenum");
    } else {
     //original headers code here
    }

    The above log will add a log to the server log file, which could tell us where the issue originates. You can also send this info directly to support(at)really-simple-ssl.com

    Thread Starter masouddarvishi1992

    (@masouddarvishi1992)

    @rogierlankhorst
    I updated the plugin. I saw again that this piece of code has been added to the wp-config file by your plugin! Why do you do this????
    https://ibb.co/y59tP96

    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    @masouddarvishi1992 This code sends the security headers you have enabled in Really Simple SSL. If you disable these the include will disappear. By including it here, it will work with all known caching plugins, on both NGINX and Apache, also on hosts who don’t support .htaccess headers.

    The issue is not the code itself, but a piece of code which comes before this code. Because that code results in a header send action, our code results in a “headers already sent” warning.

    If you send us a message at support(at)really-simple-ssl.com we can help you debug this.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘error_log file’ is closed to new replies.