WonderCMS / wondercms

Fast and small flat file CMS (5 files). Built with PHP, JSON database.
https://wondercms.com
MIT License
652 stars 165 forks source link

[PHP 8.0, 8.1 & 8.2] Error with Simple Statistics plugin #324

Closed Galixte closed 1 hour ago

Galixte commented 2 hours ago

Hi @robiso,

With WonderCMS 3.4.3 I encounter an error with this plugin: https://github.com/robiso/simple-statistics/tree/master

Fatal error
: Uncaught Error: Attempt to assign property "accueil" on null in /home/clients/xxx/domain.tld/plugins/simple-statistics/class.SimpleStatistics.php:72 Stack trace:
#0 /home/clients/xxx/domain.tld/plugins/simple-statistics/class.SimpleStatistics.php(122): SimpleStatistics->set('pageviews', '18-10-2024', 'accueil', 1)
#1 /home/clients/xxx/domain.tld/index.php(1206): SimpleStatistics->collectData(Array)
#2 /home/clients/xxx/domain.tld/index.php(1677): Wcms->hook('js', '')
#3 /home/clients/xxx/domain.tld/themes/universeGradient/theme.php(91): Wcms->js()
#4 /home/clients/xxx/domain.tld/index.php(1717): require_once('/home/clients/e...')
#5 /home/clients/xxx/domain.tld/index.php(210): Wcms->loadThemeAndFunctions()
#6 /home/clients/xxx/domain.tld/index.php(16): Wcms->render()
#7 {main} thrown in /home/clients/xxx/domain.tld/plugins/simple-statistics/class.SimpleStatistics.php
on line 72

Do you have an idea to fix this issue?

This error message disappears on PHP 7.4.

Galixte commented 1 hour ago

After deleting this plugin, then re-activated it this issue disappeared.

I close this issue.