WP Manifestindependent plugin directory
manifest / utilities / affiliate-link-injector

Affiliate Link Injector WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

WordPress plugin that automatically appends affiliate tracking parameters to links targeting specific domains

★ 1stars
13release downloads
1.0.3latest · 10mo ago

Install

Download affiliate-link-injector-1.0.3.zip From the 1.0.3 release on GitHub, Dec 21, 2025

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/danieliser/affiliate-link-injector/releases/download/1.0.3/affiliate-link-injector-1.0.3.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Automatically appends affiliate tracking parameters to links targeting specific domains across all WordPress content contexts.

Features

  • Rule-based injection - Define rules by target domain with query params (?ref=123) or path format (/ref/123)
  • Universal content support - Works with Gutenberg blocks, Bricks Builder, Classic Editor, widgets, comments, excerpts, and REST API responses
  • Smart duplicate detection - Prevents double-appending of affiliate parameters
  • Subdomain matching - Optionally match subdomains (e.g., docs.example.com)
  • Path exclusions - Skip specific paths from injection
  • Modern admin UI - React-based rule management with inline editing

Requirements

  • WordPress 6.2+
  • PHP 8.0+

Installation

Via GitHub Release

  1. Download the latest release zip from Releases
  2. Upload to WordPress via Plugins → Add New → Upload Plugin
  3. Activate the plugin

Via Git Updater

This plugin supports Git Updater for automatic updates.

Configuration

Navigate to Settings → Affiliate Links to manage rules.

Rule Options

Field Description
Label Display name for the rule
Domain Target domain (e.g., example.com)
Format query for ?param=value or path for /path/segment
Query Params Key-value pairs for query format
Affiliate Path Path segment for path format
Include Subdomains Match subdomains of the target domain
Excluded Paths Paths to skip (e.g., /docs, /support)
Enabled Toggle rule on/off

Example Rules

Query format:

  • Domain: example.com
  • Format: query
  • Params: ref=123
  • Result: https://example.com/page → https://example.com/page?ref=123

Path format:

  • Domain: example.com
  • Format: path
  • Path: ref/456
  • Result: https://example.com/page → https://example.com/ref/456/page

REST API

The plugin exposes a REST API at /wp-json/affiliate-link-injector/v1/:

Endpoint Method Description
/rules GET List all rules
/rules POST Create a rule
/rules/{id} GET Get a rule
/rules/{id} PATCH Update a rule
/rules/{id} DELETE Delete a rule
/rules/{id}/toggle POST Toggle rule enabled
/settings GET/POST Manage settings
/health GET Health check
/export GET Export rules
/import POST Import rules

Hooks

Skip Processing

add_filter( 'affiliate_link_injector/skip_processing', function( $skip ) {
    // Skip on specific pages
    if ( is_page( 'no-affiliate' ) ) {
        return true;
    }
    return $skip;
});

Exclude Links by Class

Add the class no-affiliate to any link to exclude it from processing:

<a href="https://example.com" class="no-affiliate">Not tracked</a>

Development

Run Tests

# PHP Unit Tests
composer install
TEST_TYPE=unit ./vendor/bin/phpunit

# JavaScript Tests
npm install
npm test

# PHPCS
./vendor/bin/phpcs

Build Admin UI

npm install
npm run build

Changelog

See CHANGELOG.md for version history.

License

GPL-2.0-or-later

Releases

4 releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
1.0.3 latest
Dec 21, 2025 10mo ago
affiliate-link-injector-1.0.3.zip
4
Dec 21, 2025 10mo ago
affiliate-link-injector-1.0.2.zip
1
Dec 21, 2025 10mo ago
affiliate-link-injector-1.0.1.zip
2
Dec 20, 2025 10mo ago
affiliate-link-injector-1.0.0.zip
6
A grade

Security

Affiliate Link Injector 1.0.3 · audited by WP Registry

No security issues found.

Audited release
1.0.3
Findings
none
Worst severity
—
Content hash
076e0ea9d4972c8f5f13e691…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.