How can I see the error generated by plugin activation?

I’m developing a plugin and upon activation, I get the following error:

The plugin generated xxx characters of unexpected output during activation

How can I see what unexpected output is generated?

I have turned on debugging, but it doesn’t help:

define('WP_DEBUG', true);
if (WP_DEBUG) {
  define('WP_DEBUG_LOG', true);
  define('WP_DEBUG_DISPLAY', true);
  @ini_set('display_errors', 1);
}

Update
FYI – I have checked that there are no spaces before and after <?php ?>. I’ve done some digging around and tested various solutions, but I’m still stuck.

1 Answer
1

If a plugin has the error output

The plugin generated xxx characters of unexpected output during activation

then that only means that there is some error output.

Sadly WP can’t output anything more than this. Every error output sends a header (as var_dump/var_export/print_r/print/error/printf would output.

In short:

You won’t get any more info unless you’re diggin´ deeper into the plugins code. Your best bet are above ↑ mentioned functions that you could throw into the plugins code to get a real error output.

Short: Sorry to say that, but it is what it is… :/

Leave a Comment