Opened 14 years ago
Closed 14 years ago
#14410 closed defect (bug) (invalid)
Unexpected output incorrectly reported during plugin activation
Reported by: | chmac | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | General | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
When I activate the WP Mail SMTP plugin, I get the following error:
The plugin generated 194 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.
Other users have reported the same error with different numbers of characters. I've checked, double checked and checked again the plugin code, and I can't see anything outside of the PHP tags or any output functions called during activation. I think the issue has to lie somewhere else, unfortunately I've no idea where.
Plugin code is available here:
Change History (7)
#2
@
14 years ago
It looks like it is the only function that isn't already wrapped in a function_exists(). Not sure why it would get included twice -- perhaps you have another plugin that also uses that function?
Also, a suggestion (as a faithful user of this plugin on a multisite install). For your WPMS_ON constant, it would be better to simply rely on is_multisite() where appropriate, and also is_plguin_active_for_network() where appropriate, as we now have both in 3.0 and it is much easier to identify when a plugin is activated network-wide now.
#3
follow-up:
↓ 4
@
14 years ago
@westi: Thanks for sharing that, I really appreciate it.
@nacin: I'm also puzzled as to why the function is being created twice. Could there be something whereby WordPress is including the file twice maybe? I'm guessing wrapping that function in an if(!function_exists()) would resolve the issue, but it seems like a hack rather than a solution.
I'll look into the is_multisite() and is_plugin_active_for_network() functions you mentioned. My guess is that WPMS_ON does something slightly different, disabling the admin page and pulling the settings from constants, but maybe I've misunderstood what you've suggested. Would you like to post something so we can continue the discussion here:
http://www.callum-macdonald.com/2008/12/12/wp-mail-smtp-v08/
#4
in reply to:
↑ 3
@
14 years ago
Replying to chmac:
I'll look into the is_multisite() and is_plugin_active_for_network() functions you mentioned. My guess is that WPMS_ON does something slightly different, disabling the admin page and pulling the settings from constants,
Nope, I forgot how it worked. Thanks.
This is the error I see if I capture and output the error message: