Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8402483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:04:51+00:00 2026-06-09T22:04:51+00:00

I am very new to WordPress, and writing a plugin to (ideally) allow our

  • 0

I am very new to WordPress, and writing a plugin to (ideally) allow our client to update their existing WP site and the dynamic info on our iphone app all in one place. This will require the creation of two tables. I have written what I believe should be creating these tables, but activating the plugin throws this error on my test WordPress site:

The plugin generated 1 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.

Looking into the database also reveals that the tables were not created. I have looked at a handful of other posts here and elsewhere, but can’t seem to isolate where I am going wrong. Any suggestions?:

<?php
// Plugin info omitted

register_activation_hook(_FILE_, 'event_manager_install');
register_deactivation_hook(_FILE_, 'event_manager_uninstall');

// Installer
function event_manager_install() {
global $wpdb;

// Builds queries for custom event and speakers tables
$event_table = $wpdb->prefix . 'events';
$eventSql = "CREATE TABLE $event_table (
  id mediumint(9) NOT NULL AUTO_INCREMENT,
  venueName VARCHAR(250) DEFAULT '' NOT NULL,
  date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  address text NOT NULL,
  registrationDeadlineDate datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
  UNIQUE KEY id (id)
);";

$speaker_table = $wpdb->prefix . 'speakers';
$speakerSql = "CREATE TABLE $speaker_table (
  id mediumint(9) NOT NULL AUTO_INCREMENT,
  eventID mediumint(9) NOT NULL,
  speaker text NOT NULL,
  UNIQUE KEY id (id)
);";

// Executes queries
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($eventSql);
dbDelta($speakerSql);
}

// Uninstaller
function event_manager_uninstall() {
global $wpdb;

// Creates queries to delete custom tables
$event_table = $wpdb->prefix . 'events';
$speaker_table  = $wpdb->prefix . 'speakers';
$eventSql = "DROP TABLE " . $event_table . ";";
$speakerSql = "DROP TABLE " . $speaker_table . ";";

// Executes deletion queries
$wpdb->query($eventSql);
$wpdb->query($speakerSql);
}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:04:52+00:00Added an answer on June 9, 2026 at 10:04 pm

    The problem is that you’ve misspelled the name of the __FILE__ constant. Just replace _FILE_ with __FILE__ (note: two underscores), and it should work just fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a wordpress theme that I update very often with new functionality. I've
Im very new to WordPress. I was going through Smooth Slider WP Plugin and
I am very new to WordPress. I have converted a HTML website I created
I am very new to wordpress and I am baffled. I am trying to
I'm having a very simple problem. I'm new to WordPress and I'm trying to
i am very new to wordpress. I have a div for links and I
I am very new to WordPress, so I would appreciate some help. I am
I'm very new to WordPress and have no PHP or CSS experience... I'm want
I'm very new to programming so bear with me... My site is based on
I have a client that has just moved a very larger, well established wordpress

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.