Getting Unexpected Errors when Activating a wordpress Plugin
-
I am developing a plugin that I would like to have a table created when it is activated. When I activate the plugin, I am seeing that the table is being created successfully, however, I am getting the following message.
The plugin generated 20 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.
Here is my code, any help is appreciated…
<?php function pfw_activate_plugin(){ if(version_compare(get_bloginfo('version'), '4.8', '<')){ wp_die(__('You must update wordpress to use this plugin','pfw-members')); } global $wpdb; $createSQL = " CREATE TABLE <code>" . $wpdb->prefix. "pfw_person</code> ( <code>id</code> INT(11) NOT NULL AUTO_INCREMENT, <code>update_date</code> TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, <code>first_name</code> VARCHAR(50) NOT NULL COLLATE utf8_bin, <code>last_name</code> VARCHAR(75) NOT NULL COLLATE utf8_bin, <code>user_id</code> INT(11) NOT NULL, <code>person_type</code> VARCHAR(50) NOT NULL COLLATE utf8_bin, <code>create_date</code> DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (<code>id</code>) ) ENGINE=InnoDB " . $wpdb->get_charset_collate() . " AUTO_INCREMENT=1;"; require_once(ABSPATH . '/wp-admin/includes/upgrade.php'); dbDelta($createSQL); } ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Getting Unexpected Errors when Activating a wordpress Plugin’ is closed to new replies.