Title: Errors during WP Statistics import
Last modified: November 2, 2024

---

# Errors during WP Statistics import

 *  Resolved [koobm](https://wordpress.org/support/users/koobm/)
 * (@koobm)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/)
 * Hi,
 * I recently migrated a handful of sites from WP Statistics to Matomo. On all of
   them, the import scrips shows an error for each individual date during the step“
   ReferrersImporter”:
 *     ```wp-block-code
       [info] Importing data for the ReferrersImporter plugin.[debug] Import 1 referrers...WordPress database error Unknown column 'words' in 'field list' for query select engine, words, count(visitor) AS nb from wp_statistics_search where last_counter = '2024-10-31' group by engine, words order by engine, words; made by include('phar:///usr/bin/wp-cli/php/boot-phar.php'), include('phar:///usr/bin/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php'), WP_CLI\bootstrap, WP_CLI\Bootstrap\LaunchRunner->process, WP_CLI\Runner->start, WP_CLI\Runner->run_command_and_exit, WP_CLI\Runner->run_command, WP_CLI\Dispatcher\Subcommand->invoke, call_user_func, WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}, call_user_func, WpMatomo\Commands\MatomoCommands->importWpStatistics, WpMatomo\WpStatistics\Importer->import, WpMatomo\WpStatistics\Importer->import_day, WpMatomo\WpStatistics\Importers\Actions\ReferrersImporter->import_records, WpMatomo\WpStatistics\Importers\Actions\ReferrersImporter->import_search_engines, WpMatomo\WpStatistics\Importers\Actions\ReferrersImporter->get_keywords_and_search_engine_recordsWordPress database error Unknown column 'words' in 'field list' for query select engine, words, count(visitor) AS nb from wp_statistics_search where last_counter = '2024-10-31' group by words, engine order by words, engine; made by include('phar:///usr/bin/wp-cli/php/boot-phar.php'), include('phar:///usr/bin/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php'), WP_CLI\bootstrap, WP_CLI\Bootstrap\LaunchRunner->process, WP_CLI\Runner->start, WP_CLI\Runner->run_command_and_exit, WP_CLI\Runner->run_command, WP_CLI\Dispatcher\Subcommand->invoke, call_user_func, WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}, call_user_func, WpMatomo\Commands\MatomoCommands->importWpStatistics, WpMatomo\WpStatistics\Importer->import, WpMatomo\WpStatistics\Importer->import_day, WpMatomo\WpStatistics\Importers\Actions\ReferrersImporter->import_records, WpMatomo\WpStatistics\Importers\Actions\ReferrersImporter->import_search_engines, WpMatomo\WpStatistics\Importers\Actions\ReferrersImporter->get_keywords_and_search_engine_records[debug] Import 0 search keywords...[debug] Import 0 search engines...
       ```
   
 * AFAIK the column “words” was removed by WP Statistics around 1 year ago. Could
   you please check from your end?
 * Thanks, and keep up the good work!

Viewing 15 replies - 1 through 15 (of 15 total)

 *  Plugin Support [dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/)
 * (@dizzyatinnocraft)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18111787)
 * Hi [@koobm](https://wordpress.org/support/users/koobm/), thanks for the bug report!
   We’ll create a fix that should be released relatively soon (days at the latest).
 *  Plugin Support [dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/)
 * (@dizzyatinnocraft)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18130913)
 * It took a bit longer than expected, but the issues with the WP Statistics importer
   should be fixed in version 5.1.6.
 *  Thread Starter [koobm](https://wordpress.org/support/users/koobm/)
 * (@koobm)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18140353)
 * Hey there,
 * Thanks, highly appreciate the quick response and your efforts! But I’m afraid
   that it didn’t work out as expected.
   I reinstalled Matomo on my last site which
   hasn’t been migrated yet and ran the importer. This is the full log (DB name 
   replaced) – after the first day it tried to import, it’s frozen:
 *     ```wp-block-code
       [info] Starting wp-statistics import[notice] Importing data for date 2023-11-16...[info] Importing data for the PagesImporter plugin.[debug] Import 0 search keywords...[debug] Import 10 global pages...[debug] Import 20 page titles...[info] Importing data for the ReferrersImporter plugin.[debug] Import 2 referrers...WordPress database error Table '<DATABASE_NAME>.wp_statistics_search' doesn't exist for query select engine, count(visitor) AS nb from wp_statistics_search where last_counter = '2023-11-16' group by engine order by engine; made by include('phar:///usr/bin/wp-cli/php/boot-phar.php'), include('phar:///usr/bin/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php'), WP_CLI\bootstrap, WP_CLI\Bootstrap\LaunchRunner->process, WP_CLI\Runner->start, WP_CLI\Runner->run_command_and_exit, WP_CLI\Runner->run_command, WP_CLI\Dispatcher\Subcommand->invoke, call_user_func, WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}, call_user_func, WpMatomo\Commands\MatomoCommands->importWpStatistics, WpMatomo\WpStatistics\Importer->import, WpMatomo\WpStatistics\Importer->import_day, WpMatomo\WpStatistics\Importers\Actions\ReferrersImporter->import_records, WpMatomo\WpStatistics\Importers\Actions\ReferrersImporter->import_search_engines, WpMatomo\WpStatistics\Importers\Actions\ReferrersImporter->get_keywords_and_search_engine_records[debug] Import 0 search engines...[info] Importing data for the UserCountryImporter plugin.[debug] Import 2 countries...[debug] Import 6 regions...[debug] Import 9 cities...[info] Importing data for the DeviceDetectionImporter plugin.[debug] Import 5 browsers...[debug] Import 4 platforms...[info] Importing data for the VisitorsImporter plugin.[debug] Import 12 visits...[info] Importing data for the VisitsTimeImporter plugin.
       ```
   
 * I found [this commit](https://github.com/wp-statistics/wp-statistics/commit/e27d8c390fad1a993a469ad4b77312a602d8c5a3#diff-349ba5bde4d77e78380949d037c217f425a7a59d487b1e6f7177aaf9e968e98d)
   in WP Statistics where they removed the whole DB table. Seems like that change
   was delivered with version 14.11 (the one in which they also announced the “Pro”
   version of their product), which according to their Github was rolled out 2 weeks
   ago.
 * I actually don’t care much about the referrer history, but the importer being
   frozen after day 1 is a real problem.
 *  Plugin Support [dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/)
 * (@dizzyatinnocraft)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18141902)
 * [@koobm](https://wordpress.org/support/users/koobm/) apologies for the continued
   inconvenience, we’ll try to take care of this soon (today hopefully).
 *  Plugin Support [dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/)
 * (@dizzyatinnocraft)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18147712)
 * Hi [@koobm](https://wordpress.org/support/users/koobm/), would you be willing
   to test a pre-release version of the plugin to ensure the importer will work 
   for you?
 *  Thread Starter [koobm](https://wordpress.org/support/users/koobm/)
 * (@koobm)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18148054)
 * Yes, I could do that.
 *  Plugin Support [dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/)
 * (@dizzyatinnocraft)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18150241)
 * Hi [@koobm](https://wordpress.org/support/users/koobm/), here is a pre-release
   with the import fixes: [https://github.com/matomo-org/matomo-for-wordpress/releases/download/5.1.7-b1/matomo.zip](https://github.com/matomo-org/matomo-for-wordpress/releases/download/5.1.7-b1/matomo.zip).
   Does it solve the import problems for you?
 *  Thread Starter [koobm](https://wordpress.org/support/users/koobm/)
 * (@koobm)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18151356)
 * Hi [@dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/),
   I can confirm this version fixed the freezing issue after import of the first
   day. All relevant days (a full year) were imported within roughly 30-45 minutes,
   no error messages occurred anymore. The importer looks good now from my perspective.
   Thanks a lot!
 * Unfortunately my SSH connection was lost and the process cancelled during the
   report generation phase (somewhere around 60-90 minutes in). Not sure if this
   is an actual problem, the daily/weekly/monthly visitor info is all there. Only
   some special reports (e.g. time of day; devices) look incomplete. Not too much
   of an issue, I could live with that. Just out of curiosity, I found that in Matomo
   onPremise the [report generation can be re-initiated](https://matomo.org/faq/how-to/faq_59/).
   Is there also a way to do so in the WordPress version?
 * Thanks and all the best!
 *  Thread Starter [koobm](https://wordpress.org/support/users/koobm/)
 * (@koobm)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18152385)
 * Update: Now the log periodically shows errors from the cron run.
 *     ```wp-block-code
       archive_main	2024-11-21 15:52:40	1 total errors during this script execution, please investigate and try and fix these errors. => CronArchive.php:473; CronArchive.php:468; CronArchive.php:226; Access.php:567; CronArchive.php:221; ScheduledTasks.php:378; class-wp-hook.php:322; class-wp-hook.php:348; plugin.php:565; wp-cron.php:191;archive_errors	2024-11-21 15:52:40	'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=year&date=2024-01-01&format=json&trigger=archivephp. Response was \'{"result":"error","message":"Label column not found in the table to add in addDataTable(). Row: array ( \'label\' => NULL, \'nb_visits\' => 1, \'nb_uniq_visitors\' => 1, ) - in plugin Actions."}\'' '1 total errors during this script execution, please investigate and try and fix these errors.' => ScheduledTasks.php:392; class-wp-hook.php:322; class-wp-hook.php:348; plugin.php:565; wp-cron.php:191;
       ```
   
 *  Plugin Support [dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/)
 * (@dizzyatinnocraft)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18152868)
 * > Now the log periodically shows errors from the cron run.
 * Ah, those errors point to another bug in the import (again, apologies). You’ll
   have to re-run the import with another pre-release that fixes this issue (this
   should be the last problem I think).
 * > Unfortunately my SSH connection was lost and the process cancelled during the
   > report generation phase (somewhere around 60-90 minutes in).
 * If the process was cut off, it would just get re-started by wp-cron eventually
   so there’s no issue there. It might be a good idea to run the import command 
   through `nohup` next time if possible to make sure it keeps running even if your
   connection is lost.
 * > Only some special reports (e.g. time of day; devices) look incomplete.
 * Would you be able to explain how they look incomplete? We can try and fix this
   in a future version.
 * > Just out of curiosity, I found that in Matomo onPremise the [report generation can be re-initiated](https://matomo.org/faq/how-to/faq_59/).
   > Is there also a way to do so in the WordPress version?
 * Triggering archiving manually can be done via the Troubleshooting tab in Diagnostics.
   But if you want to completely re-process reports, you’d need to invalidate the
   periods you want to re-process first. To do this, you can use the “Invalidate
   Reports” plugin (available through the Matomo Marketplace).
 * We’ll try and get a new pre-release up soon, thanks for giving your time to test
   this version, it’s very much appreciated!
 *  Plugin Support [dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/)
 * (@dizzyatinnocraft)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18158103)
 * Hi [@koobm](https://wordpress.org/support/users/koobm/), one more version to 
   test if you are able to: [https://github.com/matomo-org/matomo-for-wordpress/releases/download/5.1.7-b2/matomo.zip](https://github.com/matomo-org/matomo-for-wordpress/releases/download/5.1.7-b2/matomo.zip).
   After running the import there shouldn’t be any archiving errors. Thanks again
   for your help.
 *  Thread Starter [koobm](https://wordpress.org/support/users/koobm/)
 * (@koobm)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18165660)
 * Hey [@dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/),
   just a quick info: Had a busy week and wasn’t able to test that version yet. 
   I’m going to check it on Friday latest. Will keep you updated.
 *  Plugin Support [dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/)
 * (@dizzyatinnocraft)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18166220)
 * [@koobm](https://wordpress.org/support/users/koobm/) no worries. Thanks for the
   update!
 *  Thread Starter [koobm](https://wordpress.org/support/users/koobm/)
 * (@koobm)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18171091)
 * Hi [@dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/),
 * I applied the new version and ran the import again. Looks great. No issues during
   import or report generation. No new “Got invalid response from API request” errors
   in the log so far (but I’ll keep looking out for the next 24h hours).
 * The “incomplete reports” I mentioned earlier are also gone. I guess these were
   just side effects from the aborted report generation run due to disconnection.
 * And all my users are very happy with “this new statistics tool”. Thanks for your
   great support, and to everyone involved!!!
 *  Plugin Support [dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/)
 * (@dizzyatinnocraft)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18172050)
 * That’s great to hear, thanks for testing and the kind words as well! And if you
   have any other issues/feedback, we’ll be happy to hear them.

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Errors during WP Statistics import’ is closed to new replies.

 * ![](https://ps.w.org/matomo/assets/icon-256x256.png?rev=3531741)
 * [Matomo Analytics - Powerful, Privacy-First Insights for WordPress](https://wordpress.org/plugins/matomo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/matomo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/matomo/)
 * [Active Topics](https://wordpress.org/support/plugin/matomo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/matomo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/matomo/reviews/)

 * 15 replies
 * 2 participants
 * Last reply from: [dizzyatinnocraft](https://wordpress.org/support/users/dizzyatinnocraft/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/errors-during-wp-statistics-import/#post-18172050)
 * Status: resolved