Title: <abbr title="Not Safe For Work / Mature content">[NSFW]</abbr> PHP Fatal errors: undefined function and db issues
Last modified: December 8, 2020

---

# [NSFW] PHP Fatal errors: undefined function and db issues

 *  [ericplugge](https://wordpress.org/support/users/ericplugge/)
 * (@ericplugge)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-errors-undefined-function-and-db-issues/)
 * Hello,
 * I guess this is not okay 🙂 Could you please have a look? I having trouble with
   other plugins lately, maybe this is part of the problem.
 *     ```
       PHP Fatal error:  Uncaught Error: Call to undefined function WP_STATISTICS\\add_filter() in /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics/includes/class-wp-statistics-schedule.php:12\nStack trace:\n#0 /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics/includes/class-wp-statistics-schedule.php(238): WP_STATISTICS\\Schedule->__construct()\n#1 {main}\n  thrown in /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics/includes/class-wp-statistics-schedule.php on line 12
             1  PHP Fatal error:  Uncaught Error: Call to undefined function WP_Statistics\\RealTime\\wp_statistics_useronline() in /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics-realtime-stats/includes/WP_Statistics_RealTime_Ajax.php:61\nStack trace:\n#0 /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics-realtime-stats/wp-statistics-realtime-stats.php(104): WP_Statistics\\RealTime\\WP_Statistics_RealTime_Ajax->__construct()\n#1 /home/public/sites/www.happykitesurfschool.nl/wp-includes/class-wp-hook.php(287): WP_Statistics_RealTime_Stats_Plugin->plugin_setup('')\n#2 /home/public/sites/www.happykitesurfschool.nl/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)\n#3 /home/public/sites/www.happykitesurfschool.nl/wp-includes/plugin.php(478): WP_Hook->do_action(Array)\n#4 /home/public/sites/www.happykitesurfschool.nl/wp-settings.php(409): do_action('plugins_loaded')\n#5 /home/public/sites/www.happykitesurfschool.nl/wp-config.php(89): require_once('/home/public/si...')\n#6 /home/ in /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics-realtime-stats/includes/WP_Statistics_RealTime_Ajax.php on line 61
             1  PHP Fatal error:  Uncaught Error: Class 'WP_STATISTICS\\Purge' not found in /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics/includes/class-wp-statistics-schedule.php:189\nStack trace:\n#0 /home/public/sites/www.happykitesurfschool.nl/wp-includes/class-wp-hook.php(287): WP_STATISTICS\\Schedule->dbmaint_event()\n#1 /home/public/sites/www.happykitesurfschool.nl/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)\n#2 /home/public/sites/www.happykitesurfschool.nl/wp-includes/plugin.php(544): WP_Hook->do_action(Array)\n#3 /home/public/sites/www.happykitesurfschool.nl/wp-cron.php(138): do_action_ref_array('wp_statistics_d...', Array)\n#4 {main}\n  thrown in /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics/includes/class-wp-statistics-schedule.php on line 189
             1  WordPress databasefout Duplicate entry '0' for key 'page_id' bij query INSERT INTO <code>happy_statistics_historical</code> (<code>value</code>, <code>category</code>, <code>uri</code>, <code>page_id</code>) VALUES ('1', 'uri', '/shop/', '0') gemaakt door do_action_ref_array('wp_statistics_dbmaint_hook'), WP_Hook->do_action, WP_Hook->apply_filters, WP_Statistics_Schedule->dbmaint_event, wp_statistics_purge_data
             1  WordPress databasefout Duplicate entry '12937' for key 'page_id' bij query INSERT INTO <code>happy_statistics_historical</code> (<code>value</code>, <code>category</code>, <code>uri</code>, <code>page_id</code>) VALUES ('1', 'uri', '/uitverkoop-crazyfly-2019-kites-bars-boards-en-bindingen/?fbclid=IwAR1QMDA-RZCtlhrOh79x21UDpWZs9iqhkxme6ZEkYp8ABFEXihWMTMtvnJ8', '12937') gemaakt door do_action_ref_array('wp_statistics_dbmaint_hook'), WP_Hook->do_action, WP_Hook->apply_filters, WP_Statistics_Schedule->dbmaint_event, wp_statistics_purge_data
             1  WordPress databasefout Duplicate entry '39' for key 'page_id' bij query INSERT INTO <code>happy_statistics_historical</code> (<code>value</code>, <code>category</code>, <code>uri</code>, <code>page_id</code>) VALUES ('2', 'uri', '/?product_cat=kites', '39') gemaakt door do_action_ref_array('wp_statistics_dbmaint_hook'), WP_Hook->do_action, WP_Hook->apply_filters, WP_Statistics_Schedule->dbmaint_event, wp_statistics_purge_data
             1  WordPress databasefout Unknown column 'user_id' in 'field list' bij query INSERT IGNORE INTO <code>happy_statistics_visitor</code> (<code>last_counter</code>, <code>referred</code>, <code>agent</code>, <code>platform</code>, <code>version</code>, <code>ip</code>, <code>location</code>, <code>user_id</code>, <code>UAString</code>, <code>hits</code>, <code>honeypot</code>) VALUES ('2020-11-29', 'http://happykitesurfschool.nl', 'Chrome', 'OS X', '10.15.2', '54.221.27.173', 'US', 0, '', '1', '0') gemaakt door require('wp-blog-header.php'), wp, WP->main, do_action_ref_array('wp'), WP_Hook->do_action, WP_Hook->apply_filters, WP_STATISTICS\\Hits->record_wp_hits, WP_STATISTICS\\Hits::record, WP_STATISTICS\\Visitor::record, WP_STATISTICS\\Visitor::save_visitor
             1  WordPress databasefout Unknown column 'user_id' in 'field list' bij query INSERT IGNORE INTO <code>happy_statistics_visitor</code> (<code>last_counter</code>, <code>referred</code>, <code>agent</code>, <code>platform</code>, <code>version</code>, <code>ip</code>, <code>location</code>, <code>user_id</code>, <code>UAString</code>, <code>hits</code>, <code>honeypot</code>) VALUES ('2020-11-29', 'http://happykitesurfschool.nl', 'Firefox', 'OS X', '10.15', '54.217.144.11', 'IE', 0, '', '1', '0') gemaakt door require('wp-blog-header.php'), wp, WP->main, do_action_ref_array('wp'), WP_Hook->do_action, WP_Hook->apply_filters, WP_STATISTICS\\Hits->record_wp_hits, WP_STATISTICS\\Hits::record, WP_STATISTICS\\Visitor::record, WP_STATISTICS\\Visitor::save_visitor
             1  WordPress databasefout Unknown column 'user_id' in 'field list' bij query INSERT IGNORE INTO <code>happy_statistics_visitor</code> (<code>last_counter</code>, <code>referred</code>, <code>agent</code>, <code>platform</code>, <code>version</code>, <code>ip</code>, <code>location</code>, <code>user_id</code>, <code>UAString</code>, <code>hits</code>, <code>honeypot</code>) VALUES ('2020-11-29', 'https://www.google.nl/', 'Safari', 'iOS', '14.2', '2a02:a420:2:8fa7:4d9b:262a:21e6:39c', 'NL', 0, '', '1', '0') gemaakt door require('wp-blog-header.php'), wp, WP->main, do_action_ref_array('wp'), WP_Hook->do_action, WP_Hook->apply_filters, WP_STATISTICS\\Hits->record_wp_hits, WP_STATISTICS\\Hits::record, WP_STATISTICS\\Visitor::record, WP_STATISTICS\\Visitor::save_visitor
             1  WordPress databasefout Unknown column 'user_id' in 'field list' bij query INSERT IGNORE INTO <code>happy_statistics_visitor</code> (<code>last_counter</code>, <code>referred</code>, <code>agent</code>, <code>platform</code>, <code>version</code>, <code>ip</code>, <code>location</code>, <code>user_id</code>, <code>UAString</code>, <code>hits</code>, <code>honeypot</code>) VALUES ('2020-11-29', 'https://www.happykitesurfschool.nl', 'Chrome', 'OS X', '10.15.2', '54.221.27.173', 'US', 0, '', '1', '0') gemaakt door require('wp-blog-header.php'), wp, WP->main, do_action_ref_array('wp'), WP_Hook->do_action, WP_Hook->apply_filters, WP_STATISTICS\\Hits->record_wp_hits, WP_STATISTICS\\Hits::record, WP_STATISTICS\\Visitor::record, WP_STATISTICS\\Visitor::save_visitor
             1  WordPress databasefout Unknown column 'user_id' in 'field list' bij query INSERT IGNORE INTO <code>happy_statistics_visitor</code> (<code>last_counter</code>, <code>referred</code>, <code>agent</code>, <code>platform</code>, <code>version</code>, <code>ip</code>, <code>location</code>, <code>user_id</code>, <code>UAString</code>, <code>hits</code>, <code>honeypot</code>) VALUES ('2020-11-29', 'https://www.happykitesurfschool.nl', 'Chrome', 'Windows', '10.0', '193.8.56.104', '000', 0, '', '1', '0') gemaakt door require('wp-blog-header.php'), wp, WP->main, do_action_ref_array('wp'), WP_Hook->do_action, WP_Hook->apply_filters, WP_STATISTICS\\Hits->record_wp_hits, WP_STATISTICS\\Hits::record, WP_STATISTICS\\Visitor::record, WP_STATISTICS\\Visitor::save_visitor
             1  WordPress databasefout Unknown column 'user_id' in 'field list' bij query INSERT IGNORE INTO <code>happy_statistics_visitor</code> (<code>last_counter</code>, <code>referred</code>, <code>agent</code>, <code>platform</code>, <code>version</code>, <code>ip</code>, <code>location</code>, <code>user_id</code>, <code>UAString</code>, <code>hits</code>, <code>honeypot</code>) VALUES ('2020-11-29', 'https://www.happykitesurfschool.nl', 'Firefox', 'OS X', '10.15', '54.217.144.11', 'IE', 0, '', '1', '0') gemaakt door require('wp-blog-header.php'), wp, WP->main, do_action_ref_array('wp'), WP_Hook->do_action, WP_Hook->apply_filters, WP_STATISTICS\\Hits->record_wp_hits, WP_STATISTICS\\Hits::record, WP_STATISTICS\\Visitor::record, WP_STATISTICS\\Visitor::save_visitor
             1  WordPress databasefout Unknown column 'user_id' in 'field list' bij query INSERT IGNORE INTO <code>happy_statistics_visitor</code> (<code>last_counter</code>, <code>referred</code>, <code>agent</code>, <code>platform</code>, <code>version</code>, <code>ip</code>, <code>location</code>, <code>user_id</code>, <code>UAString</code>, <code>hits</code>, <code>honeypot</code>) VALUES ('2020-11-29', 'https://www.happykitesurfschool.nl', 'Firefox', 'Windows', '6.1', '78.110.194.100', 'BE', 0, '', '1', '0') gemaakt door require('wp-blog-header.php'), wp, WP->main, do_action_ref_array('wp'), WP_Hook->do_action, WP_Hook->apply_filters, WP_STATISTICS\\Hits->record_wp_hits, WP_STATISTICS\\Hits::record, WP_STATISTICS\\Visitor::record, WP_STATISTICS\\Visitor::save_visitor
             2  PHP Fatal error:  Uncaught Error: Class 'WP_STATISTICS\\Purge' not found in /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics/includes/class-wp-statistics-schedule.php:187\nStack trace:\n#0 /home/public/sites/www.happykitesurfschool.nl/wp-includes/class-wp-hook.php(287): WP_STATISTICS\\Schedule->dbmaint_event()\n#1 /home/public/sites/www.happykitesurfschool.nl/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)\n#2 /home/public/sites/www.happykitesurfschool.nl/wp-includes/plugin.php(544): WP_Hook->do_action(Array)\n#3 /home/public/sites/www.happykitesurfschool.nl/wp-cron.php(138): do_action_ref_array('wp_statistics_d...', Array)\n#4 {main}\n  thrown in /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics/includes/class-wp-statistics-schedule.php on line 187
             2  WordPress databasefout Unknown column 'user_id' in 'field list' bij query INSERT IGNORE INTO <code>happy_statistics_visitor</code> (<code>last_counter</code>, <code>referred</code>, <code>agent</code>, <code>platform</code>, <code>version</code>, <code>ip</code>, <code>location</code>, <code>user_id</code>, <code>UAString</code>, <code>hits</code>, <code>honeypot</code>) VALUES ('2020-11-29', 'https://www.happykitesurfschool.nl', 'Chrome', 'Windows', '10.0', '23.99.229.80', 'US', 0, '', '1', '0') gemaakt door require('wp-blog-header.php'), wp, WP->main, do_action_ref_array('wp'), WP_Hook->do_action, WP_Hook->apply_filters, WP_STATISTICS\\Hits->record_wp_hits, WP_STATISTICS\\Hits::record, WP_STATISTICS\\Visitor::record, WP_STATISTICS\\Visitor::save_visitor
             4  PHP Fatal error:  Uncaught Error: Class 'WP_STATISTICS\\Purge' not found in /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics/includes/class-wp-statistics-schedule.php:181\nStack trace:\n#0 /home/public/sites/www.happykitesurfschool.nl/wp-includes/class-wp-hook.php(287): WP_STATISTICS\\Schedule->dbmaint_event()\n#1 /home/public/sites/www.happykitesurfschool.nl/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)\n#2 /home/public/sites/www.happykitesurfschool.nl/wp-includes/plugin.php(544): WP_Hook->do_action(Array)\n#3 /home/public/sites/www.happykitesurfschool.nl/wp-cron.php(138): do_action_ref_array('wp_statistics_d...', Array)\n#4 {main}\n  thrown in /home/public/sites/www.happykitesurfschool.nl/wp-content/plugins/wp-statistics/includes/class-wp-statistics-schedule.php on line 181
             4  WordPress databasefout Unknown column 'user_id' in 'field list' bij query INSERT IGNORE INTO <code>happy_statistics_visitor</code> (<code>last_counter</code>, <code>referred</code>, <code>agent</code>, <code>platform</code>, <code>version</code>, <code>ip</code>, <code>location</code>, <code>user_id</code>, <code>UAString</code>, <code>hits</code>, <code>honeypot</code>) VALUES ('2020-11-29', 'http://www.google.com/', 'Chrome', 'Windows', '6.1', '23.228.109.146', 'US', 0, '', '1', '0') gemaakt door require('wp-blog-header.php'), wp, WP->main, do_action_ref_array('wp'), WP_Hook->do_action, WP_Hook->apply_filters, WP_STATISTICS\\Hits->record_wp_hits, WP_STATISTICS\\Hits::record, WP_STATISTICS\\Visitor::record, WP_STATISTICS\\Visitor::save_visitor
            22  WordPress databasefout Unknown column 'user_id' in 'field list' bij query INSERT IGNORE INTO <code>happy_statistics_visitor</code> (<code>last_counter</code>, <code>referred</code>, <code>agent</code>, <code>platform</code>, <code>version</code>, <code>ip</code>, <code>location</code>, <code>user_id</code>, <code>UAString</code>, <code>hits</code>, <code>honeypot</code>) VALUES ('2020-11-29', 'https://www.happykitesurfschool.nl', 'Chrome', 'Windows', '10.0', '87.251.67.205', 'MD', 0, '', '1', '0') gemaakt door require('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, WP_STATISTICS\\Hits->record_login_page_hits, WP_STATISTICS\\Hits::record, WP_STATISTICS\\Visitor::record, WP_STATISTICS\\Visitor::save_visitor
       ```
   
    -  This topic was modified 5 years, 5 months ago by [Yui](https://wordpress.org/support/users/fierevere/).
    -  This topic was modified 5 years, 5 months ago by [Yui](https://wordpress.org/support/users/fierevere/).
      Reason: please use CODE button for code formatting
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-fatal-errors-undefined-function-and-db-issues%2F%3Foutput_format%3Dmd%26view%3Dall&locale=en_US)
   to see the link]_

The topic ‘[NSFW] PHP Fatal errors: undefined function and db issues’ is closed 
to new replies.

 * ![](https://ps.w.org/wp-statistics/assets/icon.svg?rev=3081064)
 * [WP Statistics – Simple, privacy-friendly Google Analytics alternative](https://wordpress.org/plugins/wp-statistics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-statistics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-statistics/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-statistics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-statistics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-statistics/reviews/)

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 0 replies
 * 1 participant
 * Last reply from: [ericplugge](https://wordpress.org/support/users/ericplugge/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/php-fatal-errors-undefined-function-and-db-issues/)
 * Status: not resolved