#wordpress 2018-01-11
2018-01-11 UTC
j12t, tantek, wagle, Kyle-K, [mlopatka], [kevinmarks], [mail], jeremycherfas, [pfefferle], [miklb], [colinwalker], chrisaldrich, [keithjgrant] and [dariusdunlap] joined the channel; Kyle-K left the channel
# [dariusdunlap] Getting an error message on my indieweb-enabled wordpress site, squarepegfoundation.org:
# [dariusdunlap] Cannot modify header information
# [dariusdunlap] Specifically:
# [dariusdunlap] Warning: Cannot modify header information - headers already sent by (output started at /home/squarepegdarius/squarepegfoundation.org/index.php:1) in /home/squarepegdarius/squarepegfoundation.org/wp-content/plugins/webmention/includes/class-webmention-receiver.php on line 633
# [dariusdunlap] Anyone seen this? I’ve run updates to all plugins and themes, hoping that might resolve it.
# [dariusdunlap] This site is WordPress 4.9.1 running Twenty Seventeen theme.
# [dariusdunlap] Nope
# [dariusdunlap] Haven’t done anything except let it run the auto updates
# gRegorLove Hm, since it's line 1, I wonder if that's a BOM on the file.
# gRegorLove Can you re-save that index.php with UTF8 encoding, no BOM?
# gRegorLove I've run into issues like that before.
# [dariusdunlap] Dunno. As far as I know, the only thing that’s happened was my wife made a new post this morning. I’ll check that for funny chars.
# gRegorLove Though not with a theme out of the box, just oddball text editor settings when updating a file.
# gRegorLove Oh, I don't think that's the theme index.php, it's the web root index.php
# gRegorLove Mis-read the file paths
# gRegorLove If that doesn't do it, and you don't mind showing more error messages on the site for a brief time, you could set WP_DEBUG in your wp-config.php, which should display more PHP errors.
# [dariusdunlap] Yes, I think it’s the web root index. But is the problem there, or in webmention-receiver at line 633?
# gRegorLove root index, I think. That line in the webmention receiver looks ok, at a glance, but I don't know that plugin well.
# [dariusdunlap] Since all this stuff has been working for many months, (a couple years?) I was hopeful that it was something simple in the plugin
# [dariusdunlap] Yeah, me either.
# gRegorLove Just going off general PHP and WordPress experience. :)
# [dariusdunlap] I was wondering if webmention-receiver was just stepping in a pile of poop left by something else. Ha ha
# [dariusdunlap] Hmmm. Full multi-part error message:
# [dariusdunlap] Warning: Cannot modify header information - headers already sent by (output started at /home/squarepegdarius/squarepegfoundation.org/index.php:1) in /home/squarepegdarius/squarepegfoundation.org/wp-content/plugins/webmention/includes/class-webmention-receiver.php on line 633
# [dariusdunlap] Warning: Cannot modify header information - headers already sent by (output started at /home/squarepegdarius/squarepegfoundation.org/index.php:1) in /home/squarepegdarius/squarepegfoundation.org/wp-content/plugins/webmention/includes/class-webmention-receiver.php on line 635
# [dariusdunlap] Warning: Cannot modify header information - headers already sent by (output started at /home/squarepegdarius/squarepegfoundation.org/index.php:1) in /home/squarepegdarius/squarepegfoundation.org/wp-includes/pluggable.php on line 1216
# [dariusdunlap] So this “Pluggable” is also suspect.
# gRegorLove That's core WP, so I don't think so. Some plugin is sending headers before webmention-receiver tries to
# gRegorLove The index.php:1 isn't too helpful in that case
# gRegorLove will leave it to the WP pros in here
# [dariusdunlap] Thanks for the help. You both have helped me eliminate some possible dead ends I could have wasted a bunch o time chasing!
# [dariusdunlap] Yeah.
# Zegnat See https://stackoverflow.com/a/8028987 for a good rundown of the headers issue.
# [dariusdunlap] Disabling webmention plugin gets rid of the error. Not sure that really fixes the problem. But I notice the the webmention plugin hasn’t been updated in 7 months. Is there something new I should be using instead?
[eddie] joined the channel
# Zegnat It is definitely a different plugin (or some accidental whitespace) messing it up, [dariusdunlap]. The webmention plugin tries to sends its headers through WP’s own “send_headers” action hook. The fact that is failing means something is outputting text either inside there or even earlier in the execution.
# [dariusdunlap] Also, looking at the stackoverflow link provided (Thanks!) it looks like it really some some stray gunk in index.php, line 1... So I’ll have to go look at the theme config and other stuff.
# [dariusdunlap] Thanks, @Zegnat - great!
# Zegnat Also start by checking /home/squarepegdarius/squarepegfoundation.org/index.php (the mentioned file). There might be some whitespace or a BOM marker before <?php and removing that should then fix it.
# [dariusdunlap] Yeah, that’s kind of a black hole. Line 1:
# [dariusdunlap] <script type='text/javascript'>
# [dariusdunlap] And then a big ‘var’ on the next line containing all the encoded JS.
# [dariusdunlap] But I’m still hopeful I’ll find a simple typo or stray character in a theme config setting or something.
[colinwalker] joined the channel
# [colinwalker] I really don’t like the look of that, there shouldn’t be script there. - Saw it looking at the source of the error page and it sends Safari CPU through the roof.
# [colinwalker] Looks more like a code injection
# [dariusdunlap] Ah, that makes more sense, actually.
[kevinmarks] joined the channel
# [colinwalker] Would normally expect index.php to begin <?php
# Zegnat For the latest WordPress, this is the entire index file: https://core.trac.wordpress.org/browser/trunk/src/index.php
# [dariusdunlap] Yep. That’s the assumption I’m going on @aaronpk. Luckily DB and such as all backed up, but it still takes some time and effort to unravel. Thanks for the help and advice everyone. You saved me many dead ends. Got to run to a meeting now, but I’ll get on this again in a few hours. *sigh*
# [colinwalker] Hmmm - JS:Applictaion.BitCoinMiner.YB
# [colinwalker] Application that should have been
# [dariusdunlap] Ha ha! Probably. Jackasses.
# [colinwalker] My browser started running like a dog so did a BitDefender scan
# [dariusdunlap] Which likely means I’ll have to also clean up this crap from my wife’s laptop and some of the staffs’, too.
# Zegnat You may also consider running something like https://wpscan.org/ to check if there are any known vulnerabilities in the WP plugins you are currently using.
# gRegorLove Ooh, thanks for wpscan. I'll check that out for some of our work clients.
tantek joined the channel
[mail] and [eddie] joined the channel
# petermolnar along with slowloris, if I recall correctly
# petermolnar it could be one of those rare things movies were not lieing about: use the airport wifi for hacking :D
sebsel, [kevinmarks] and chrisaldrich joined the channel
# chrisaldrich GWG++ for some awesome forthcoming support of weather in the Simple Location plugin #cantwait