0

I made a custom plugin for my wordpress admin for view user detail. This plugin is working fine after showing this error but the main issue is by this plugin , when i try to open some link the page went blank. I dont know why and what is this error..Searched on internet but unable to resolve this issue. Your help would be appreciated...here is the fulll error comes when i activate this plugin...I

The plugin generated 751 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

2 Answers 2

2

Your plugin is causing some errors, but not fatal ones, so plugin works, but as the error messages says, it can cause some problems, i.e. the feed that can output the plugin error so not valid xml content, or when somewhere in the code there is a redirect once "headers already sent" it fail.

If you are asking yourself why the plugin works despite that error, it's because not all errors are fatal (make script die), just as example see following code

if ( ! $number ) {
  $number = 1;
}
echo "My number is " . $number;

If you have a code like this in your plugin it will works, but it causes an error because in first line there is a variable that is not defined anywhere.

This is just an example, but there are a lot of situations like this where code works but causes errors.

When you develop a plugin, activate debug and error log and also I suggest to use some debug tools: some are really useful.

1
  • Thanks for help, actually it was a charecter tag problem, some charecter of my plugin page was outside of php tag, i fixed it....now everything fine. Nov 12, 2013 at 10:24
0

The error of header already sent comes when your syntax is not correct.

Just for info I am listing some situations where the message of unexpected output and headers already sent errors come!

  • White spaces before beginning or end of PHP tags <php? and ?>
  • undefined variables.
  • writing HTML code outside the functions.
  • commenting syntax errors.

Any PHP code syntax error can put headers sent warning when plug-in is activated. To avoid this it is better suggested to develop your plug-in and test in debug status set WP_DEBUG to true in wp-config.php file of your WordPress installation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.