Git Product home page Git Product logo

kirby3-simplestats's Issues

Clarify TimeFrame switching and notify on user mistakes

I started collecting data with the default monthly view and everything looked fine:
Site_Visits (1)
Then I wanted to switch weekly view instead to have a more detailed timeline but this messes up the visualization of the data:
Site_Visits
After switching back to monthly everything is back to normal so it seems that the data is stored correctly in the database but the logic to visualize it for the weekly option has an issue with it.

Correct database limit in queries

As a dummy protection, db queries are limited to 1000. (could cause issues on ancient databases, or websites with a lot of traffic.)
Figure something out to set/handle this correctly.

[K4] Kirby 4 issues list

This issue lists all reported K4 issues, hoping to bring support for it.
(Please create a new issue to add one)

Add support for composer

Can you please add support for composer?
It is offered by nearly all plugins and makes updating them very easy.

GDPR notice in README

Hey there,
I noticed that in your README you wrote that the fingerprint created with md5( trunc(IP) + trunc(UserAgent) + Salt ),(...) according to GDPR, seems to be considered as personal data. This could lead to people rather not using it when really your solution is actually privacy-friendly, if I understand your implementation correctly:

Since strings created with md5 cannot be restored, they are unable to identify the person they were created from. A properly truncated IP by itself would make sure that a person could not be identified by this means, and this is even more true for your hashing solution!

jm2c

Cheers,
S1SYPHOS

JavaScript tracking script to bust CDN cache

Right now my site sits behind Cloudflare CDN that do page caching which means if you hit the cache you aren't hitting Kirby thus SimpleStats won't register the visit.

It would be very useful have a companion JavaScript file that can talk to SimpleStats and punch through CDN caching.

Pimping the panel interface

The data presentation is very "functional" but it could look better.
Specially when data accumulates (over time, many pages, etc.), I guess the presentation gets worse.

Any suggestions / contributions / screenshots are welcome.

  • Allow viewing custom timespans. (Something like there used to be in Retour-for-kirby v2 ?)
  • Group page visits from child pages to better visualise traffic trough the site arborescence. (fold/unfold childs in table ? a graph?)
  • Add a blueprint field to display on panel pages for detailed page stats. (Also add a one-page detailed stats tab to the panel?)
  • Add "Editor" vs "Admin" permissions for the different panel views.
  • Download database from panel to make backups. (auto backups too?)
  • Generate fake stats (for testing) 42135f1
  • Compute average, total and unique visits/hits per language per period.
  • Show latest log messages in info section
  • Add a "current visitors" panel visualising entry pages, exit pages and navigation paths of currently tracked users ? (needs tracker logic change too)
  • #22 (still needs timespan name in database file ?)
  • #21
  • #16
  • #8
  • Better (more pleasant) chart colors and the possibility to change them via the plugin options.

authorizedRoles not working properly

Description

The option authorizedRoles seems not to work properly. With the option set to admin for example, SimpleStats is still fully accessible for editor users. Only the option dismissDisclaimer => true set in site/config/config.php is ignored, meaning that the disclaimer dows show for editors.

Expected behavior
For unauthorized roles, SimpleStats should not be visible in the Panel menu.

My setup

Plainkit Kirby 3.6.1.1

Console output

code: 403
details: Array []
exception: "Kirby\\Exception\\PermissionException"
file: "api.php"
key: "error.permission"
line: 331
message: "You are not authorised to upgrade the db file."
route: "simplestats/mainview"
status: "error"
<prototype>: Object { … }
index.js:1:6814
code: 403
details: Array []
exception: "Kirby\\Exception\\PermissionException"
file: "api.php"
key: "error.permission"
line: 58
message: "You are not authorised to view statistics."
route: "simplestats/pagestats"
status: "error"
<prototype>: Object { … }
index.js:1:6814

My system

  • Device: MacBook Pro 2019
  • OS: MacOS Monterey 12.0.1
  • Browser: Opera 82, Firefox 95

UI Conflict with Pagetable plugin

When using SimpleStats together with Pagetable plugin by sylvainjule (https://github.com/sylvainjule/kirby-pagetable), the UI of pagetable gets compromised in the panel.

Kirby 3.6.1.1 Plainkit with SimpleStats and Pagetable:

simplestat-active

Without SimpleStats:

simplestats-deactivated

My system

  • Device: MacBook Pro 2019
  • OS: MacOS Monterey 12.0.1
  • Browser: Opera 82, Firefox 95
  • Kirby 3.6.1.1
  • Pagetable Plugin 1.0.1

Feature request: ignore localhost

For development, it would be very helpful if the localhost environment was ignored.

For example, via a setting in plugins/simplestats/src/config/options.php:
tracking => ignore => localhost => true (default).

In this context, it would also be useful if certain data could be deleted manually (for example, localhost).

Use page unique IDs

Now, slugs are used in SimpleStats, Kirby has a new page UID system.

  • Page UIDs seem not to be enabled by default in Kirby, how to keep compatibility with both ?
  • Provide a migration tool, probably move to a new DB file version ?
  • Currently nums are mistakenly stored in the slug : Do we need to remove them too ? (tracking probably breaks when page-sorting changes).

Panel Interface Translations

Hello
I would like to help you for the French translation. Can you provide all entries that must be translated plz ?
Bye

Column "medium" is not created in table "referrers"

First of all, thanks for this great plugin. I think it fits really nicely into the Kirby mindset 👍

I noticed my website did not track any referrers so I had a look at simplestats_errors.txt and saw hundreds of messages like General error: 1 table referrers has no column named medium. After editing the SQLite database and adding a medium column to the database it started working.

You'll probably have to add this to this line.

Feature request: Export function

An export function would be very useful to pass on (selected) statistics to clients or to archive them. For this purpose, it would be practical to define specific time periods for the export.

Processed and visually prepared data as in the panel would be excellent, for example in PDF format. In addition, CSV or Excel output of the raw data.

Broken timeline

Hi, I've added the simplestats plugin 5 day's ago on (18-09-2023) and for some reason the page visits timeline is stuck at (01-09-2023)

image
image

Running Kirby 3.9.6.1 and plugin version 0.6.3-beta

Make simpestats Exception safe

  • Kirby\Database\Database::query() can throw errors : catch them for better error reporting.
  • Check for other throwable calls.

How to "enable" tracking^^

Hey,

I am not sure if my installation is the problem or I didn't understand the Documentation...

I want to track my blog sites and added the Page method "$page->simpleStatsImage()" to the header of my template so every time the page is called this code will be executed... But my tracking charts are all empty just the list on the information page is filled with 2 entries "Visitors (current session)"

The Setup checker doesn't give any warnings (see SC) - did I need to use the singeltons to? and what is the "OnImage" tracking method? - is there another documentation site for this plugin and I overread it?^^

This is my current Information Page:

information

And all other pages looks like this (from the avail. data perspektive ^^)
allother

This is my header code (snippet):

<body data-bs-theme="light">
    <header>
      <?php $page->simpleStatsImage() ?>
      <nav class="navbar navbar-expand-md">
        <div class="container-fluid">

I've tried to use the Singletons too but I only get an error (I don't know what Libary I need to import ^^)

Hope that somebody can help me :)

Data consistency protection

Currently, the config's tracking period must match the database's one.
Database files aren't exchangeable with different tracking period configurations.
Corruption cases: when the configuration suddenly changes or when databases are manually interchanged with a period config mismatch.

To protect the database data :

  • Prevent writing to it when the configuration's tracking period doesn't match the one from the db.
    Make it backup the old one and create a new one ? And enforce period name in db filename + db contents ?
    Also discussed in #22
  • Prevent overwriting existing incompatible db files by renaming them ?
  • Add an option to explicitly disable generating stats. ( see: daandelange.simplestats.tracking.method)
  • Protect the database when adding/removing Kirby languages and write an upgrade script so data can be kept.

Tracking pixel : error 500 in mono language setups

Tried with starterkit v3.9.8 and v4.0.3

First I tried to set options like indicated in the docs:

// site/config/config.php

return [
   'debug' => true,
  'daandelange.simplestats.tracking.method' => \daandelange\SimpleStats\SimpleStatsTrackingMode::OnImage,
];

PHP promptly crashed...

I ended up changing the setting directly in src/config/options.php

Then I put <?= $page->simpleStatsImage() ?> right before the </body> tag, which generates the following:

<img alt="simplestats counter pixel" class="simplestats-image" height="1" loading="lazy" src="http://localhost:81/starterkit-4.0.3/notes/counter.png" style="position: absolute; right: 0; pointer-events: none; height: 1px; width: 1px; opacity: 0;" width="1">

The src URL is the page URL + /counter.png

However it fails to load and returns 500 error in the dev console, I'm assuming this is not the intended behavior and that tracking failed.

How to use/acess?

Hi Daandelange, I’m quite interested by your plugin, but I’m a real n00b!

I followed the Installation method (copy to /site/plugins/simplestats), but now I’m stuck. How do I access the plugin? Do I need to go to my Kirby panel?

Page section blueprint : broken and js error thrown

Hi,

got simplestats up and running to some extend, but when I try to implement the statistics in one of my blueprints, it throws this error, when I enter that particular blueprint in the panel

Cannot read properties of undefined (reading 'length')

My Blueprint uses tabs and goes like this:

title: MySite


tabs:
  stats:
    label: Stats
    icon: globe
    sections:
      pagestats:
        type: pagestats
        label: TestHeadline
        size: small
        showTotals: true
        showTimeline: true
        showLanguages: true
        showFullInfo: true

  content:
    label: Content
    icon: text
    columns:
      - width: 1/3
        fields:
          titlebar:
            label: Website Title
            type: text
          line1:
            type: line

I also enabled the panel view in my config php like this:

require_once(__DIR__ . '/../plugins/simplestats/src/models/SimpleStatsTimeFrameUtility.php');
return [
  // [...] your options ...

  // Simplestats
  'daandelange.simplestats.panel.enable' => true, // Disable the panel view completely
  'daandelange.simplestats.tracking.enableReferers' => true, // Disable referer tracking
  'daandelange.simplestats.tracking.timeFrameUtility' => new \daandelange\SimpleStats\SimpleStatsTimeFrameUtilityWeekly(), // Here you can put your custom inherited class from SimpleStatsTimeFrameUtility
  'daandelange.simplestats.tracking.timeFrameUtility' => 'weekly', // Alternative
  'daandelange.simplestats.tracking.method' => \daandelange\SimpleStats\SimpleStatsTrackingMode::OnImage,
];

can somebody give me a hint on what's wrong there?

Roles and permission related features

Currently, only "authorised user roles" can view stats in the panel and there is still some polishing to do.
Plus introducing user-permissions would be useful.

  • Double-check if all restricted zones are fully restricted.
  • Permission suggestions :
    • Be tracked (to disable tracking)
    • View stats
    • View configuration
    • Generate stats (or only locally ? or when dev=true ?)
    • Export/backup database

.sqlite

Dear Daan,
i was very happy to read about your plugin in the last kirby kosmos issue and installed it right away.
Judging from the panel the plugin seems to work there, but there is no .sqlite file being created in the site folder (site/logs/simplestats.sqlite), in fact, no logs folder has been created and the panel view states: "Unable to open database: unable to open database file".
So there seems one part not working as expected.
Do i have to create the folder site/logs and the files there myself or is this automatically done by the plugin?
Is there a way to troubleshoot this?
I am running on kirby 3.4.0

Matthias

Previous chart color and style easier to read?

Just speaking for myself, but I much prefer the previous chart colors and style - bright, pastel colors with clear differentiation between different items, with the addition of highly visible black outline and clearly denoted data points.

I feel I need to work harder to read the chart in the new version.

Feature request: option to exclude bots

I really like this plugin but I am not so much interested in the bots data. Could you add an option in the panel or in the config to toggle bots data in the visualizations?

Software Tests

Writing tests could be very useful to have to ensure production readyness.
Specially on the timeframe utilities which can cause infinite loops if not working correctly.
Also the tracker code kirby integration could be tested.

I have no idea how, but Kirby itself and many plugins use tests, so it should be doable.

[Documentation] Composer installation according to docs fails

Right now, because SimpleStats does not have a 'stable' release tag, when we try to follow the simple installation instructions for composer, the installation fails - because the latest versions of composer assume by default that we always want to install the latest STABLE version of a package. If a package has NO stable version, then installation fails with a warning:

Screen Shot 2022-02-25 at 4 07 36 pm

In order to be able to install with composer, at the moment it's necessary to explicitly specify a 'beta' compatibility - e.g.:

composer require daandelange/simplestats:~0.4-beta

Feature request: customise breadcrumb label

It would be nice to have the possibility to edit or remove the breadcrump label via options.

The current output may not be suitable for every context:

SimpleStats - All your data are belong to us !

[K4] Error in stats.php with page IDs consisting only of numbers

I get the message "Kirby\Cms\App::page(): Argument #1 ($id) must be of type ?string, int given, called in /.../site/plugins/simplestats/src/models/Stats.php on line 938" in backend.

I have some page IDs with numbers only (e.g. "360"), so PHP seems to treat $uid as int in this case. I was able to work around by making sure that $uid is string ($uid = strval($uid); before line 938). The diagram creation process now works as expected.

I'm running Kirby 4.1.0 on PHP 8.2.15, so I don't know if it's a case for the Kirby 4 incompatibility list or just a PHP issue.

Anyway, thanks for this great plugin!

Empty SimpleStats page

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.