Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty SimpleStats page #31

Closed
ersoma opened this issue Feb 13, 2023 · 8 comments · Fixed by #33
Closed

Empty SimpleStats page #31

ersoma opened this issue Feb 13, 2023 · 8 comments · Fixed by #33

Comments

@ersoma
Copy link
Contributor

ersoma commented Feb 13, 2023

Hey!

I just installed the plugin to a site I'm currently developing. The SimpleStats page shows up in the Panel, but it is completely empty:

panel_simplestats_1

An error appeared for the first time I opened the page, but not any more:

panel_simplestats_4

This may be normal as the site is not yet receiving traffic, but even the current sessions section is empty after I visited a few pages:

panel_simplestats_2

It's interesting to note how the date range selector defaults to 1999 and if I open the datepicker and press "Today" it doesn't change the date.

I tried to use the Tracking Tester feature to populate the DB with some data, but got the following error:

panel_simplestats_3

The .sqlite file is created successfully.
I'm running PHP 8.2.2 (tried 8.1 as well) and Kirby 3.9.1 on a Ubuntu 20.04.5 LTS server above Dokku 0.29.4.

Do you have any idea what can be the problem?
Thanks!

@ersoma
Copy link
Contributor Author

ersoma commented Feb 14, 2023

Update: it's probably PHP, I tried running Kirby on PHP 8.0 and the errors are gone, sessions are picked up and the stats generator works as well.

@ersoma
Copy link
Contributor Author

ersoma commented Feb 14, 2023

Update: I think I found the root cause, PHP version incompatibility.

When I tried to generate test data under PHP 8.2, I got the following error:
panel_simplestats_5
This is because Dynamic Properties are deprecated under PHP 8.2 (https://php.watch/versions/8.2/dynamic-properties-deprecated).

Once I switched to PHP 8.1, the error changed:
panel_simplestats_6
This is because passing null to non-nullable internal function parameters is deprecated under PHP 8.1 (https://php.watch/versions/8.1/internal-func-non-nullable-null-deprecation).

In PHP 8.0 the plugin appears to run perfectly, but not above. Unfortunately PHP 8.0 is already past it's active support phase and will only receive security updates for another 9 month (https://www.php.net/supported-versions.php). Kirby fully supports PHP 8.2 since 3.9 (https://getkirby.com/releases/3.9) and it would be amazing to use this plugin with it, under the most up-to-date environment. Would you consider supporting more recent PHP versions soon?
Thanks!

@nilsmielke
Copy link

This is exactly what happens in my installation (Kirby 3.9.1, PHP 8.1.16). Thank you for leaving this here, @ersoma.

@Daandelange
Copy link
Owner

Hello, thanks for the reports, I'm using PHP 8.0 so it makes sense.
I'll have a look when I dive back in PHP, or feel free to submit a PR meanwhile.

therephil added a commit to therephil/kirby3-simplestats that referenced this issue Mar 9, 2023
empty localstorage means it is still null and so calling null.length
throws an error

mentioned in Daandelange#31
@therephil
Copy link
Contributor

hey @Daandelange and @ersoma there is a pull request there for you to test.
the way the snowplow/parser issue is fixed is not really a "clean" solution but it should fix the issues for the moment until snowplow-referer-parser/referer-parser/issues/223 is fixed.

@Daandelange
Copy link
Owner

Awesome, thanks for your investigations, looks good at a first glance, I'll soon take some time to test and merge this.

@Daandelange
Copy link
Owner

Php 8.2 should now be supported, Php 8.0 still works too.

@nilsmielke
Copy link

nilsmielke commented Mar 16, 2023

Thanks for the update. I still cannot change the date range and can only see one date (March 1, 2023). Tested on PHP 8.1 and 8.2 (0.6.2-beta).
Tried deleting the database, too. Still not able to adjust dates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants