Simple Statistics PHP error

Post Reply
jbwonderadmin
Posts: 12
Joined: Sun Jul 12, 2020 4:59 pm

Simple Statistics PHP error

Post by jbwonderadmin »

I installed the Simple Statistics plugin on my 3.1.1 install. On loading a page, I received the following error:

Code: Select all

Fatal error: Uncaught TypeError: Return value of SimpleStatistics::getDb() must be an instance of stdClass, null returned in [directory]/plugins/simple-statistics/class.SimpleStatistics.php:47 Stack trace: #0 [directory]/plugins/simple-statistics/class.SimpleStatistics.php(30): SimpleStatistics->getDb() #1 [directory]/plugins/simple-statistics/simple-statistics.php(6): SimpleStatistics->init() #2 [directory]/index.php(1137): include('[directory]...') #3 [directory]/index.php(127): Wcms->loadPlugins() #4 [directory]/index.php(15): Wcms->init() #5 {main} thrown in [directory]/plugins/simple-statistics/class.SimpleStatistics.php on line 47
This error then appeared on all pages of the site.

Upon deleting the Simple Statistics plugin directory, the error was eliminated.

No other plugins were installed. There is one line of JS in one of my content blocks.

User avatar
wiz
Admin
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Simple Statistics PHP error

Post by wiz »

Hey JB.

Mind posting some more details / your server + PHP version.
It might be also a good idea to post this on Stephans summernote repository: https://github.com/StephanStanisic/summernote-editor as I can't seem to reproduce this.

privatne
Posts: 2
Joined: Wed Feb 24, 2021 4:56 pm

Re: Simple Statistics PHP error

Post by privatne »

I have Simple Statistics installed since months. About since a week, my site shows the same error. The site is hosted by go daddy. Can you help please?

User avatar
wiz
Admin
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Simple Statistics PHP error

Post by wiz »

privatne, what's your server + PHP version? Additionally, what version of WonderCMS and Statistics are you using?

I would first suggest checking your data folder if the statistics database is corrupted or not. If it's not, then you can create a backup of the statistics database file and delete the actual plugin, then reinstall the plugin and the reupload the database.

privatne
Posts: 2
Joined: Wed Feb 24, 2021 4:56 pm

Re: Simple Statistics PHP error

Post by privatne »

Apache version is 2.4.33
PHP version 7.1
WonderCMS version 3.1.4
Statistics version 3.0.2
Thanks.

User avatar
wiz
Admin
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Simple Statistics PHP error

Post by wiz »

Did you possibly check your /data folder and see is there is any error log? (Through ssh or cpanel)

Post Reply