Support » Plugin: WP Statistics » DB Update Issues

  • Resolved klanon



    I help with a site which uses the WP Statistics plugin. It stopped recording individual page hits sometime around 2019-02-22. The plugin has been kept up to date since that time.

    I see errors similar to “WordPress database error Unknown column ‘type’ in ‘field list’ for query INSERT IGNORE INTO wp_statistics_pages (uri, date, count, id, type)” all over the error_log file provided by the host. I backed up the wp_statistics database tables and tried the reinstall options available from the plugin admin options under Optimizaions -> Database. This didn’t work.

    I then tried the “Remove data and settings” option to uninstall the plugin. This didn’t remove the tables or settings from wp_options as expected. I tried to reinstall the plugin anyways; the issue persisted

    I then: removed the plugin; manually deleted the tables and settings; and installed the plugin again. The tables weren’t created. I restored the tables from the earlier backup, but had no luck getting them updated to the newest schema.

    At this point, I’m using the 12.5.7 version of the plugin. It seems to work the best with the database schema that currently exists. I’d appreciate it if someone could point me in the right direction to getting the plugin updated and working.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mostafa Soufi



    Please run below query in your WordPress database for update WP-Statistics table

    ALTER TABLE wp_statistics_pages ADD page_id BIGINT(20) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (page_id);
    ALTER TABLE wp_statistics_pages ADD type VARCHAR(255) NOT NULL AFTER id;
    • This reply was modified 1 month, 3 weeks ago by  Mostafa Soufi.
    • This reply was modified 1 month, 3 weeks ago by  Mostafa Soufi.


    Those queries worked for me. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.