Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5327 closed defect (bug) (invalid)

Possible stupid bug of the plugin system

Reported by: gnot Owned by:
Milestone: Priority: high
Severity: blocker Version: 2.3.1
Component: General Keywords:
Focuses: Cc:


I have just wasted 4+ hours because WP breaks horribly without any warning or error message when there is more than one empty line under the last ?> tag in the source code of a plugin. I found out about this accidentally while trying desperately to fix a problem with a plugin of mine.

Can anybody confirm this?

The only thing I do not want to read is that it is a feature or a necessary evil or anything similar... Thanks

Change History (6)

#1 @gnot
11 years ago

  • Milestone 2.5 deleted

#2 @santosj
11 years ago

  • Resolution set to invalid
  • Status changed from new to closed

This isn't a WordPress issue. It is a PHP issue. It is a common problem with a known solution. All WordPress files must not have more than one empty line (none would be better).

If you remove the ?> from PHP only files, it would prevent this from happening again.

#3 @gnot
11 years ago

Damn, I do not want to write anything in PHP again...

#4 @santosj
11 years ago


Most likely what happened was that you have display_errors set to '0', which is why no errors or warnings came up. If you had turned it on, you most likely would have received an error about trying to send headers after they were already sent (Most common cause of this happening).

All languages are going to have little "gotchas" that you have to figure out. It technically isn't a PHP issue either, since it is the expected behavior and documented.

#5 @santosj
11 years ago

Well, at least now you know and knowing is half the battle. The other half is fixing or preventing it from happening again. That and turning on Display Errors on your development server (if not already on).

#6 @gnot
11 years ago

Problem is that I was trying to fix the plugin on my live blog :) Anyway, despite my anger about the wasted time, I'd like to thank you for the information. I am not a professional.

Note: See TracTickets for help on using tickets.