Unexpected output during plugin activation

WordPress 3 has a neat new check during plugin activation that generates a scary notice if the plugin generates any “unexpected output.” Sadly, the current version of flickpress was generating the scary notice. WordPress doesn’t provide any of the unexpected output and Apache’s error log wasn’t very enlightening either. I started deactivating, commenting out code blocks, then reactivating. It turned out the issue was in the table installation function. I was using this deprecated code:

require_once(ABSPATH . 'wp-admin/upgrade-functions.php');

…which should be this instead:

require_once(ABSPATH . 'wp-admin/includes/upgrade.php');

So, if you’re having trouble tracking down the source of this notice in your own plugin, carefully check everything it’s doing during activation.

Bookmark the permalink. Share on Twitter or Facebook.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>