Linux 软件免费装
Banner图

MilkStats

开发者 javdgraaf
更新时间 2026年9月11日 23:18
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

privacy statistics analytics gdpr cookieless

下载

1.8.0 1.8.1

详情介绍:

MilkStats keeps visitor statistics without collecting personal data. All data stays local in your own WordPress database — nothing is shared with external analytics services (no Google Analytics, no external scripts or fonts). A product by 5Names. What is measured? What is NEVER stored? How does it work technically? On every page view, a small, first-party JavaScript file (assets/tracker.js) sends an AJAX request to your own admin-ajax.php. That request contains the page URL, page title, a random session ID, and — only on the first page view of a session — the hostname of the referring site and any UTM parameters. When the page is left, the time on page is sent afterwards via navigator.sendBeacon. This data ends up in the following tables in your WordPress database:
  1. wp_milkstats_pageviews — daily totals per page. Kept indefinitely: just counts, no session information.
  2. wp_milkstats_session_events — individual page views per session, with time on page. Automatically deleted after the configured retention period.
  3. wp_milkstats_sessions — one row per session with the traffic source (first-touch attribution). Also cleaned up after the retention period.
  4. wp_milkstats_events — custom events (outbound link clicks, downloads, manual events). Cleaned up after the retention period, same as session data.
  5. wp_milkstats_device_stats — daily aggregated device/browser/OS counts. Kept indefinitely, like page totals — never traceable to an individual.
  6. wp_milkstats_ai_crawler_hits — daily aggregated hits from known AI crawlers. Kept indefinitely, like page totals.
A daily WP-Cron job cleans up session data older than the configured retention period. Page totals are never deleted. Bots are recognized and ignored based on the User-Agent. Custom events Besides page views, MilkStats also measures events, without any configuration needed: Events count if the visitor is not excluded (see Settings) and are shown on the statistics page under "Events", with the top labels per type. Excluding yourself (opt-out) Besides the role exclusion (only works while logged in), you can also exclude yourself — or an external tester — without logging in: This sets a first-party cookie (milkstats_optout) in that one browser. The cookie itself has no tracking purpose — purely a toggle — and works alongside the role exclusion, not instead of it. Settings Under Site Analytics → Settings you can configure: Where do I see the statistics? Credits The admin screens use the Inter typeface by Rasmus Andersson, bundled with the plugin under the SIL Open Font License 1.1 (assets/fonts/OFL.txt). It is served from your own site — never from an external font CDN.

安装:

  1. Upload the milkstats folder to /wp-content/plugins/.
  2. Activate the plugin via Plugins in WordPress.
  3. Go to Site Analytics → Settings to set roles, segment and retention period as needed — the default settings also work fine without changes.
  4. View your statistics under Site Analytics in the main menu.

屏幕截图:

  • The Site Analytics page: rolling and calendar period filters, the privacy
  • Device, browser and operating-system breakdown — classified server-side,
  • The most common navigation paths: which page most often leads to which
  • The AI-crawler visibility report: how often GPTBot, ClaudeBot,
  • The Settings page: excluded roles, the logged-in member segment with a

常见问题:

Is this plugin GDPR-compliant without a cookie banner?

Yes. No tracking cookies are placed, no IP addresses are stored, and no data is shared with third parties. The session ID is generated in the browser itself, lives only in sessionStorage (not persistent), and cannot be traced back to an individual. The only cookie the plugin ever sets is the optional opt-out cookie, and only if you or a visitor chooses to set it — that cookie serves no tracking purpose.

Are administrators/editors counted?

Not by default — administrator, editor, author and contributor are excluded. This can be changed under Settings.

Can I exclude myself, even while logged out?

Yes. Besides the role exclusion (logged in only), you can exclude yourself via the admin bar, the settings page, or the ?milkstats_optout=1 link in the browser you're currently using — handy for testing while logged out or to share with an external tester. See "Excluding yourself (opt-out)" above.

Does this work with caching plugins?

For regular visitor statistics, yes: that tracking runs via a separate AJAX request after the page loads, so a cached page is still counted correctly. The AI crawler report is an exception: that runs server-side (WordPress must actually run to see a visit), so visits from AI crawlers to fully cached pages (e.g. a "supercached" page with WP Super Cache) are missed in that report.

What happens to my data if I deactivate or delete MilkStats?

Deactivating the plugin (from the Plugins screen) leaves all data untouched — your tables and settings are still there if you reactivate later. Deleting the plugin (via "Delete" on the Plugins screen, which runs its uninstall.php) permanently removes every MilkStats database table (page views, sessions, session events, device stats, custom events, AI crawler hits) and every MilkStats setting. This cannot be undone, so export any data you want to keep (see the Export dashboard (.html)/CSV buttons on the statistics page) before deleting the plugin.

Can I use this on multiple sites?

Yes, the plugin is deliberately kept generic: every site-specific choice (roles, segment, retention period) is configurable, not hardcoded.

更新日志:

1.8.1 1.8.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0