WP Statistics
[resolved] Corner Case: Table plugin does not exist! (2 posts)

  1. Greg Ross
    Plugin Author

    Posted 2 years ago #

    I installed the plugin and got the "Table plugin does not exist!" error on the stats page.

    Disabling and enabling didn't fix the problem.

    Turns out it was a corner case in the logic. I installed it on a test site I have on my local network and after I installed the plugin didn't visit the site before going to the stats page.

    The code that generates the error:

    $result[] = $wpdb->query("SELECT * FROM {$table_prefix}statistics_useronline");
    		$result[] = $wpdb->query("SELECT * FROM {$table_prefix}statistics_visit");
    		$result[] = $wpdb->query("SELECT * FROM {$table_prefix}statistics_visitor");
    		if( !$result[0] || !$result[1] || !$result[2] ) {
    			wp_die(__('Table plugin does not exist! Please disable and re-enable the plugin.', 'wp_statistics'));

    Assumes that no results means the table doesn't exist.

    In my case the tables were there, just didn't have any data. Simply visiting the site added some data and cleared the error.

    The best fix is probably to update the message to be a little more clear, something like:

    "Plugin tables do not exist or are empty! Please disable and re-enable the plugin and or visit your site as a user."


  2. Mostafa Soufi
    Plugin Author

    Posted 2 years ago #

    Was transferred to the email.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Statistics
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.