{"id":15150640,"url":"https://github.com/mandrasch/pet-project-analytics","last_synced_at":"2026-02-24T15:34:11.995Z","repository":{"id":251480552,"uuid":"837523537","full_name":"mandrasch/pet-project-analytics","owner":"mandrasch","description":"Pet Project Analytics allows you to track pageviews for multiple webpages within WordPress - in a private, cookie-less way. Fork of Koko Analytics.","archived":false,"fork":false,"pushed_at":"2024-08-04T19:19:13.000Z","size":1328,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T18:48:40.878Z","etag":null,"topics":["analytics","php","privacy","selfhosted","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mandrasch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-03T08:22:39.000Z","updated_at":"2024-08-04T19:19:17.000Z","dependencies_parsed_at":"2024-09-26T14:24:21.320Z","dependency_job_id":null,"html_url":"https://github.com/mandrasch/pet-project-analytics","commit_stats":{"total_commits":51,"total_committers":1,"mean_commits":51.0,"dds":0.0,"last_synced_commit":"e10298101b0bd43631b48c6eb43c4a23193ee5fd"},"previous_names":["mandrasch/pet-project-analytics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mandrasch/pet-project-analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandrasch%2Fpet-project-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandrasch%2Fpet-project-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandrasch%2Fpet-project-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandrasch%2Fpet-project-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mandrasch","download_url":"https://codeload.github.com/mandrasch/pet-project-analytics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mandrasch%2Fpet-project-analytics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29788056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T10:45:18.109Z","status":"ssl_error","status_checked_at":"2026-02-24T10:45:09.911Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","php","privacy","selfhosted","wordpress"],"created_at":"2024-09-26T14:23:24.813Z","updated_at":"2026-02-24T15:34:11.978Z","avatar_url":"https://github.com/mandrasch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pet Project Analytics (WIP)\n\nPet Project Analytics allows you to track pageviews for multiple external websites - in a privacy-friendly, cookieless way = no cookie banner needed.\n\nThis is a fork of [Koko Analytics](https://www.kokoanalytics.com/), an awesome WordPress plugin created by [Danny van Kooten](https://github.com/dannyvankooten). \n\nStatus: 🚧 Work in progress / not intended for live usage yet. 🚧\n\n## Features\n\n- fork of [Koko Analytics](https://www.kokoanalytics.com/) with the ability to track multiple external websites\n\n![](.readme/screenshot_add_new_site.png?raw=true)\n![](.readme/screenshot_view_site.png?raw=true)\n![](.readme/screenshot_analytics_by_site.png?raw=true)\n\n## Why?\n\nI believe that it would be great to have privacy-friendly analytics available on every (cheap) PHP webhost - so that people can easily track pageviews and referrers for their hobby projects. This could possibly also increase motivation. \n\nWhy forking a Wordpress plugin? Almost every PHP webhost offers 1-click-WordPress installs nowadays -  not all offer composer  or SSH access. Otherwise this would be a nice Laravel Filament project. ;) \n\n## Local Development\n\nIt's easy to get started with WordPress plugin development in [DDEV](https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/).\n\n```bash\ngit clone git@github.com:mandrasch/pet-project-analytics.git\ncd pet-project-analytics/\n\n# Start the DDEV project\nddev start\n\n# Setup and install WordPress, will prompt for an admin password (like password123!)\nddev wp core download\nddev wp core install --url='$DDEV_PRIMARY_URL' --title='NewWordPress' --admin_user=admin --admin_email=admin@example.com --prompt=admin_password\n\nddev launch /wp-admin\n\n# Install composer for plugin (see composer_root in .ddev/config.yaml)\nddev composer install\n\n# Install npm deps, build assets\ncd wp-content/plugins/pet-project-analytics\nddev npm install\nddev npm run build\n\n# Needed one time, activate plugin:\nddev wp plugin activate pet-project-analytics\n```\n\nIf you change CSS/JS, you need to run `ddev npm run build` within `wp-content/plugins/pet-project-analytics` again. Beware: If linting fails, file will be empty. Run `ddev npm run lint` before to check.\n\nDemo site for tracking: [https://pet-project-analytics.ddev.site/demo/](https://pet-project-analytics.ddev.site/demo/)\n\nTo check the WP crons, you can use https://de.wordpress.org/plugins/wp-crontrol/. There is `pp_analytics_aggregate_stats` which will read the buffer file and insert visits in the database. By default the buffer file is located at `/wp-content/uploads/pageviews.php`. See `wp-content/debug.log` for debugging / enable WP_DEBUG logging.\n\nExample of buffer file:\n\n```bash\n\u003c?php exit; ?\u003e\np,1,https://pet-project-analytics.ddev.site/demo-site.html,1,,\n```\n\nLinting:\n\n```bash\nddev composer run lint\n\ncd wp-content/plugins/pet-project-analytics\nddev npm run lint\n\n### How to update plugin version (locally)\n\n- change version in pet-project-analytics.php in php code comments as well in `\\define('PP_ANALYTICS_VERSION', '1.3.10');` (current version is stored in wp_options)\n\nThis will run SQL migrations automatically (see `maybe_run_migration`)\n\n## TODOs\n\n- [x] remove automatic tracking for wordpress site (PHP)\n- [ ] remove adding tracking JS to WP Site\n- [ ] strip domain from posts/pages (or just don't show it in interface?)\n- [ ] reorganize admin menu structure\n- [ ] Re-route settings, screen --\u003e move to new parent menu\n- [ ] Add cookie detection of unique visitors, allow opt-out as well? Or use plausibles way (cookieless)? https://plausible.io/data-policy#how-we-count-unique-users-without-cookies - but this would mean this needs to be stored in db\n    - [ ] https://www.kokoanalytics.com/kb/does-koko-analytics-use-cookies/ - just disable the defaults? problem for GDPR is that \"list of viewed pages\" could be considered personal data (and therefore acceptance would be needed). because on a shared computer, you could check what the other person visited on a webpage ...\n- [ ] remove cookie feature completely + remove visitor counts from dashboard? (more like statify / server logs?)\n- [ ] remove dashboard widgets (for now)\n- [ ] remove optimized endpoint, we need to use POST/xhr from outside (maybe re-add it later if needed)\n- [ ] add Sites screen to add sites (title, domain) - WIP\n- [ ] Add sites: proper validation for domains/subdomains\n- [ ] View site: update title, domain\n- [ ] add siteId to all screens showing stats\n- [ ] provide JS tracking script for external sites -\u003e with siteId (or domain detection?)\n- [ ] change page tracking (wordpress post/pages) to URL path tracking\n- [ ] adapt optimized endpoint with buffer file\n- [ ] block request from other domains --\u003e $_REQUEST\n- [ ] give proper credit in PHP code comments (how to do it for GNU?)\n- [ ] check compatibility with koko-analytics installed next to it\n- [ ] fix cronjob\n- [ ] check wp-options --\u003e still references to kokoanalytics\n- [ ] fix/adapt uninstall\n- [ ] rework admin-site-management to use `manage_pp_analytics` cap\n- [ ] generally rename to PP Analytics to make it shorter?\n- [ ] re-test fresh install, remove wp db ... \n- [ ] test uninstall, is everything removed?\n- [ ] release 1.0.0, just for fun\n\n## License\n\nThis is licensed as GNU GENERAL PUBLIC LICENSE Version 3. Fork of [ibericode/koko-analytics](https://github.com/ibericode/koko-analytics/) by [Danny van Kooten](https://github.com/dannyvankooten), v1.3.10. Massive kudos to Danny for such a well coded plugin!\n\nFurther inspiration were services like Plausible, Fathom Analytics, umami, matomo, Koko Analytics, Statify \u0026 co.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandrasch%2Fpet-project-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmandrasch%2Fpet-project-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmandrasch%2Fpet-project-analytics/lists"}