WordPress.org

Ready to get started?Download WordPress

Forums

Create database table from plugin file (1 post)

  1. Hi,

    I would like to create a database entry, or an option entry, to check the install date of my plugin. Then, I would like to run a check after 1 week, 1 month, etc., to check if the plugin is still installed and active.

    Lastly, I would like to display a notice to the user that they have been using the plugin for "x" number of days. (This is for a donation nag notice)

    So, does anyone have any suggestions for this one? I know about the $wpdb global variable, and I know the basic CREATE function for databases.

    I suppose what I need to do is run an activation hook, inserting the current date into an option or database table (if it doesn't already exist). Then, write another function to check the date (from that option) and only display an admin notice if the date is more than 7 or 30 days.

    So, I know about...

    $wbdb
    add_action (admin_notices)
    add_option and update_option

    Am I on the right track here? Or am I overlooking something which would make this much simpler?

    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by Josh (WP Edit)
  • This topic is not resolved
  • WordPress version: 3.3.1

Tags

No tags yet.