WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Greg Ross
    Member
    Plugin Author

    Posted 9 months 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."

    http://wordpress.org/plugins/wp-statistics/

  2. Mostafa Soufi
    Member
    Plugin Author

    Posted 9 months ago #

    Was transferred to the email.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.