Linux 软件免费装
Banner图

Loyalty Links

开发者 giuse
更新时间 2026年2月14日 15:18
PHP版本: 7.4 及以上
WordPress版本: 6.9
版权: GPLv2 or later
版权网址: 版权信息

标签

links referrer external links link management

下载

1.0.0 1.0.1

详情介绍:

Loyalty Links is a WordPress plugin that implements a "give and take" approach to external linking. The plugin tracks which external domains have sent visitors to your site via referrers, and only allows links to those domains to remain functional. Links to domains that haven't recently referred visitors are "broken" (href changed to "#") while remaining visible on the page. Key Features How It Works
  1. Track Referrers: When a visitor arrives from an external domain (in your monitored list), JavaScript sends the referrer information to a REST API endpoint which records the domain, timestamp, and increments the visit count
  2. Approve Domains: Domains that have sent referrers within your retention period are considered "approved"
  3. Break Links: Links pointing to non-approved domains have their href changed to # and pointer-events: none applied
  4. Real-Time Updates: Approved domains are fetched dynamically via REST API, ensuring cache compatibility
Use Cases

安装:

Automatic Installation
  1. Go to Plugins → Add New in your WordPress admin
  2. Search for "Loyalty Links"
  3. Click "Install Now" and then "Activate"
Configuration
  1. Navigate to Settings → Loyality Links
  2. Add domains to monitor (one per line) in the "Domain List" field
  3. Set "Retention Days" (how long to remember referrers)
  4. Optionally add test domains to verify functionality
  5. Click "Save Settings"

常见问题:

How does the plugin track referrers?

The plugin uses JavaScript to read document.referrer on each page load and sends it to a REST API endpoint via AJAX. If the referrer is from an external domain in your monitored list, the endpoint records the domain, current timestamp, and increments the visit count. This cache-friendly approach allows your HTML to be fully cached while tracking happens client-side. The tracking request is sent asynchronously and doesn't block page rendering, so it won't slow down your page load times.

Will this work with caching plugins?

Yes! The plugin is designed to be cache-friendly. It uses REST API endpoints to fetch approved domains dynamically, so your HTML can be fully cached while link-breaking logic remains real-time.

What happens to links that are broken?

Broken links remain visible on the page but:

  • Their href attribute is changed to #
  • pointer-events: none is applied to prevent interaction
  • CSS classes is-broken-link and loyalty-links-broken are added for styling
  • The original href is stored in data-original-href attribute

Can I test the plugin without waiting for real referrers?

Yes! Use the "Test Domain" field in settings to add domains for testing. Test domains are never approved, so their links will always be broken regardless of retention settings.

Does the plugin affect internal links?

No. Internal links (same domain) are never modified. Only external links pointing to domains in your monitored list are processed.

What if I don't add any monitored domains?

If your monitored domains list is empty, the plugin won't track any referrers and won't modify any links. It's effectively disabled until you add domains to monitor.

How are domains normalized?

The plugin automatically removes the www. prefix and converts domains to lowercase for consistency. Both example.com and www.example.com are treated as the same domain.

Can I use this with other link management plugins?

The plugin only modifies links to domains in your monitored list. Other external links remain untouched, so it should be compatible with most other plugins. However, test thoroughly if using multiple link-related plugins.

What's the performance impact?

Minimal. The plugin:

  • Loads JavaScript asynchronously
  • Uses REST API for dynamic data (doesn't block page rendering)
  • Tracks referrers client-side via JavaScript (cache-friendly)
  • Runs cleanup on only 1% of requests to avoid performance impact

更新日志:

1.0.1 1.0.0