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.
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
@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.
-
This reply was modified 3 years, 6 months ago by
themefour wp.
I have sent a copy of the files.
Cheers Roger
@masouddarvishi1992 This fixed my problem too. Thank you very much.
@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”;
}
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.
@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
@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
@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.