{"id":847,"date":"2012-09-11T09:42:02","date_gmt":"2012-09-11T19:42:02","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=847"},"modified":"2012-09-11T09:42:02","modified_gmt":"2012-09-11T19:42:02","slug":"wordpress-the-plugin-generated-xxxx-characters-of-unexpected-output-during-activation","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/wordpress-the-plugin-generated-xxxx-characters-of-unexpected-output-during-activation\/","title":{"rendered":"WordPress “The plugin generated xxxx characters of unexpected output during activation”"},"content":{"rendered":"
I was developing a plugin for wordpress and receive a messsage:<\/p>\n
The plugin generated 496 characters of unexpected output during activation<\/p><\/blockquote>\n
Solution<\/h2>\n
I placed the following code at the end of my plugin file,<\/p>\n
update_option(‘plugin_error’, \u00a0ob_get_contents());<\/p>\n
then looked in the wordpress options table using the query<\/p>\n
“SELECT\u00a0*
\nFROM\u00a0`wp_options`
\nWHERE\u00a0option_name\u00a0=\u00a0‘plugin_error'”<\/p>\nThen I could see what the unexpected output was.<\/p>\n
Or I could’ve installed the WH Debug<\/a> plugin and just added this to the end of the plugin file:<\/p>\n
wh_debug( ‘plugin_error’, ob_get_contents());<\/p>\n
And then viewed it in the WordPress\u00a0admin pages under Tools->WH Debug.<\/p>\n
<\/p>\n