WordPress “The plugin generated xxxx characters of unexpected output during activation”

Problem

I was developing a plugin for wordpress and receive a messsage:

The plugin generated 496 characters of unexpected output during activation

Solution

I placed the following code at the end of my plugin file,

update_option(‘plugin_error’,  ob_get_contents());

then looked in the wordpress options table using the query

“SELECT *
FROM `wp_options`
WHERE option_name = ‘plugin_error'”

Then I could see what the unexpected output was.

Or I could’ve installed the WH Debug plugin and just added this to the end of the plugin file:

wh_debug( ‘plugin_error’, ob_get_contents());

And then viewed it in the WordPress admin pages under Tools->WH Debug.

 

source: http://hungrycoder.xenexbd.com/wordpress-2/how-i-have-solved-the-the-plugin-generated-xxxx-characters-of-unexpected-output-during-activation-problem.html

keywords: wordpress characters of unexpected output during activation

 

Tagged with: , , ,

Leave a Reply