| 开发者 | javdgraaf |
|---|---|
| 更新时间 | 2026年9月11日 23:18 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
utm_source, utm_medium, utm_campaign) if you use them in your own
marketing links.data-milkstats-event
attribute. See "Custom events" below.sessionStorage and disappears as soon as the tab is closed. The only
cookie this plugin can ever set is the optional opt-out cookie described
below, and only if you or a visitor chooses to set it.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:
wp_milkstats_pageviews — daily totals per page. Kept indefinitely: just
counts, no session information.wp_milkstats_session_events — individual page views per session, with
time on page. Automatically deleted after the configured retention
period.wp_milkstats_sessions — one row per session with the traffic source
(first-touch attribution). Also cleaned up after the retention period.wp_milkstats_events — custom events (outbound link clicks, downloads,
manual events). Cleaned up after the retention period, same as session
data.wp_milkstats_device_stats — daily aggregated device/browser/OS counts.
Kept indefinitely, like page totals — never traceable to an individual.wp_milkstats_ai_crawler_hits — daily aggregated hits from known AI
crawlers. Kept indefinitely, like page totals.data-milkstats-event="label" attribute to a
link, button or <form> to track that click or submission as a custom
event, for example:
<a href="#" data-milkstats-event="Quote requested">Request a quote</a>
or <form data-milkstats-event="Contact form submitted">…</form>.?milkstats_optout=1 to exclude yourself, or
?milkstats_optout=0 to be counted again. Also works while logged out,
handy to share with external testers.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:
assets/fonts/OFL.txt). It is served from your own site — never from an
external font CDN.
milkstats folder to /wp-content/plugins/.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.
Not by default — administrator, editor, author and contributor are excluded. This can be changed under Settings.
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.
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.
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.
Yes, the plugin is deliberately kept generic: every site-specific choice (roles, segment, retention period) is configurable, not hardcoded.
assets/icon-128x128.png — it was mistakenly
treated as a directory-listing-only asset even though the plugin's own
admin screens use it. No settings or data are affected; updating to 1.8.1
is enough to restore the icon.?milkstats_optout=1 URL parameter — works even
while logged out, alongside the existing role exclusion.data-milkstats-event attribute for custom
events (e.g. form submissions).