[Plugin errors] Cannot modify header information – headers already sent
-
I’ve modified a plugin that I used to use that just didn’t do exactly what I wanted it to do, but now I’m having a problem with it when users are posting on my website who are not registered or signed in.
The errors are the following:
Warning: Cannot modify header information - headers already sent by (output started at /home/.hantu/site.com/wp-content/plugins/wp-useragent/wp-useragent.php:378) in /home/.hantu/site.com/wp-comments-post.php on line 79Warning: Cannot modify header information - headers already sent by (output started at /home/.hantu/site.com/wp-content/plugins/wp-useragent/wp-useragent.php:378) in /home/.hantu/site.com/wp-comments-post.php on line 80
Warning: Cannot modify header information - headers already sent by (output started at /home/.hantu/site.com/wp-content/plugins/wp-useragent/wp-useragent.php:378) in /home/.hantu/site.com/wp-comments-post.php on line 81
Warning: Cannot modify header information - headers already sent by (output started at /home/.hantu/site.com/wp-content/plugins/wp-useragent/wp-useragent.php:378) in /home/.hantu/site.com/wp-includes/pluggable.php on line 850
As you can see, there are 3 files involved. The wp-useragent.php file is one file from the plugin that I modified and the modified version v0.5.3.4 can be found here https://kyleabaker.com/goodies/coding/wp-useragent/ if you want to inspect the plugin.
Otherwise, the errors from the line numbers are as follows:
wp-useragent.php:378
else{echo $surfing.” “;}wp-comments-post.php:79-81
setcookie(‘comment_author_’ . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
setcookie(‘comment_author_email_’ . COOKIEHASH, $comment->comment_author_email, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
setcookie(‘comment_author_url_’ . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);wp-includes/pluggable.php:850
header(“Location: $location”);
- The topic ‘[Plugin errors] Cannot modify header information – headers already sent’ is closed to new replies.