• I’ve put about 4 hours into trying to solve this issue. Please Help!!! ?? ?? ??

    I’ve been working on developing my first custom plugin. Everything was going well until I started references files in subdirectories in my plugin. Here’s the complete error I’m seeing everytime I activate the plugin:

    “The plugin generated 1521 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.”

    My plugin file hierarchy is as follows:
    Main File: wp-content/plugins/myplugin/index.php
    Database Building File: wp-content/plugins/myplugins/DB/initialize.php

    In my index.php file, I’m calling the initialize.php file using the register_activation_hook function…here’s teh whole code:

    add_action('admin_menu', 'form_forge_options');
    include_once dirname(__FILE__) . '/DB/initialize_database.php';
    register_activation_hook(__FILE__ , 'bbp_g_init_database');
Viewing 1 replies (of 1 total)
  • Thread Starter jdlev

    (@jdlev)

    Well…since this forum has proven to be the equivalent of a ghost town in helping me with my last few posts, I’ll post the answer to my own question since my issue wasn’t resolved by the other threads on this topic telling you to simply ‘remove the white space from before/after the php tags..
    (remove whitespaces here) <?php #your code ?> (remove whitespaces here)

    My issue was in the debugging. I turned on all the error reporting I could find figuring it had to be an issue with my SQL statements or something like that. I turned on my php errors…turned on the debuggin in the wp-config file in the wp-content folder, and since I was using the wpdb object, I also tried to have it display errors using: $wpdb->print_error();

    Therein was my problem. Apparently, $wpdb->print_error(); was reporting errors, but they weren’t errors showing up anywhere. It simply gave me that warning of the plugin generating XXX characters of expected blah blah blah…

    Hopefully, this helps someone else, because the issue had me scratching my head for 5+ excruciatingly frustrating hours.

Viewing 1 replies (of 1 total)
  • The topic ‘Help! First Plugin Errors – The plugin generated 1521 characters of unexpected..’ is closed to new replies.