Categories
General

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.

Avatar photo

By isaac

I like cats. he/him