Page 1 of 1

Simple Statistics PHP error

Posted: Sun Sep 13, 2020 8:53 pm
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.

Re: Simple Statistics PHP error

Posted: Mon Sep 14, 2020 9:41 am
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.

Re: Simple Statistics PHP error

Posted: Wed Feb 24, 2021 5:01 pm
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?

Re: Simple Statistics PHP error

Posted: Wed Feb 24, 2021 5:30 pm
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.

Re: Simple Statistics PHP error

Posted: Wed Mar 10, 2021 10:18 pm
by privatne
Apache version is 2.4.33
PHP version 7.1
WonderCMS version 3.1.4
Statistics version 3.0.2
Thanks.

Re: Simple Statistics PHP error

Posted: Sat Mar 20, 2021 6:21 pm
by wiz
Did you possibly check your /data folder and see is there is any error log? (Through ssh or cpanel)