Linux 软件免费装
Banner图

Hopcount Click Tracking

开发者 aph5
更新时间 2026年9月15日 01:26
PHP版本: 8.0 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

affiliate privacy analytics outbound links click tracking

下载

1.1.1 1.2.0

详情介绍:

Hopcount Click Tracking records how often visitors click the outbound and affiliate links in your posts and pages, and shows the totals in wp-admin. It does this without redirecting or cloaking anything: your links keep their real href. If you already use cloaked links on your own site (Redirection, Pretty Links, ThirstyAffiliates, a server rule), those are followed and counted under their real destination too, best-effort. What it stores There is nothing to anonymise and nothing to disclose in a privacy policy beyond "aggregate click counts are kept". How it works
  1. When a post renders, eligible outbound links get a short server-generated token attribute. Ordinary links to your own site (and any hosts you list as internal) are skipped. A same-site link that your site answers with an off-site redirect (a cloaked affiliate link) is treated as outbound and tracked under the redirect's destination.
  2. A small deferred script (about 700 bytes compressed) sends a beacon to a REST endpoint when a link is activated, including middle-click and keyboard activation.
  3. The endpoint resolves the token and increments the hourly counter.
Because the token lives in the rendered HTML, the plugin keeps working behind WP Rocket, WP Super Cache, Cloudflare APO and similar full-page caches. Cached page views cost zero database queries; only the click itself reaches PHP. Reporting Operations Compared with redirect-based link plugins Redirect or "cloaking" plugins route every click through your server and typically store one row per click. This plugin keeps links as real hrefs, records aggregates only, and adds no PHP work to cached page views.

安装:

  1. Upload the hopcount-click-tracking folder to /wp-content/plugins/, or install it from the Plugins screen.
  2. Activate the plugin. The tables and the daily retention task are created on activation.
  3. Review Click Tracking > Settings (master switch, excluded roles, internal hosts, retention, rate limiting).
  4. If you run a page cache, purge it once so existing posts are annotated on their next render.
Upgrading from the pre-1.0 release Upload this plugin next to the old one, deactivate the old plugin first, then activate this one. Existing tables, settings and the widget preference are renamed in place automatically. Check Click Tracking > Status afterwards, purge your page cache, then delete the old plugin folder. Update any site code using the old filter names and any CDN or WAF rule on the old endpoint path.

屏幕截图:

  • Labels: manual names for destination URLs.
  • Settings: master switch, excluded roles, internal hosts, retention, rate limiting and uninstall behaviour.
  • Status: schema, cron and limiter health.
  • Dashboard widget with the top links for the selected period.

升级注意事项:

1.2.0 Cloaked same-site links are now tracked under their real destination. Adds two tables and a WP-Cron job; purge your page cache after updating so the new tokens appear. 1.1.0 Plugin folder renamed to hopcount-click-tracking. Deactivate the old folder, upload the new one, activate. Data and settings are preserved. 1.0.1 Hardening of the pre-1.0 data migration. No functional changes for fresh installs. 1.0.0 Renamed plugin. Deactivate the pre-1.0 plugin before activating this one; data migrates automatically. Site code using the old filter names and any rate-limit rule on the old endpoint path must be updated.

常见问题:

Does it work with caching plugins and CDNs?

Yes, by design. The tracking token is part of the cached HTML and the click beacon goes to a REST endpoint that bypasses page caches. WP Rocket, WP Super Cache, W3 Total Cache, Cloudflare APO and similar all work without special configuration.

Does it store IP addresses or any personal data?

No. Only hourly aggregate counts per link are stored. The optional rate limiter keeps a short-lived per-IP counter in your object cache (a few seconds to a minute) and never writes it to the database.

Is it GDPR friendly?

There are no cookies, no personal data and no per-visitor records, so no consent banner is needed for this plugin. Always check with your own adviser for your specific situation.

Does it change my links or redirect visitors?

No. Links keep their original href. The plugin only adds a data attribute at render time.

What counts as an outbound link?

Any link in post or page content whose host is not your site (including its www and non-www forms) and not in your internal-hosts list. Links elsewhere in the theme (menus, widgets, footers) are not tracked.

I use cloaked links like /go/product or /recommends/product. Are they counted?

Yes, since 1.2.0. The plugin sends a small signed request for each same-site link to your own server, with redirects disabled, and reads the answer. If the answer is a redirect to another host, the link is tracked under that destination, exactly like a link written out in full, so the host filter, labels and grouping all work. If the answer is a normal page, a 404 or an on-site redirect, the link stays untracked. Redirects made by Redirection, Pretty Links, ThirstyAffiliates, your web server or your host all look the same to this check. Answers are kept in a small table and re-checked about once a week by WP-Cron. It is best-effort: redirects that depend on cookies, geography or the request method are not seen, and redirect rules applied at a CDN in front of your origin are not visible to it.

Will the redirect check slow my site down or overload the server?

No. Work is bounded by content, not by traffic: one row per distinct same-site link, checked about once a week. An uncached page view checks at most three never-seen links with a three-second budget; everything else is done by cron in small batches. Any transport error pauses all checks for an hour, there is a daily cap of 10,000 requests, and the Status screen shows the state. Fully cached page views never touch it. To turn the feature off entirely, define the constant OCTK_DISABLE_RESOLVE as true or return false from the octk_resolve_enabled filter; behaviour then matches 1.1.x.

Which users are tracked?

Visitors and logged-in users whose role is not in the excluded-roles list (administrators and editors by default).

Can editors or authors see the report?

Yes, by adding two filters in a small site plugin or your theme's functions.php: add_filter( 'octk_report_capability', fn() => 'edit_published_posts' ); add_filter( 'octk_label_capability', fn() => 'edit_published_posts' );

Does it support multisite?

Not yet. Activation on a multisite network is refused.

What happens on uninstall?

Data is kept by default. Tick the option on the Settings screen if you want the tables and settings removed when the plugin is deleted.

更新日志:

1.2.0 1.1.1 1.1.0 1.0.1 1.0.0 0.6.0 0.5.x 0.3.x to 0.4.x 0.1.0 to 0.3.1