=== Siren Affiliates - Affiliate & Partner Program Manager for WooCommerce ===
Contributors: alexstandiford
Tags: affiliate, referral, affiliate marketing, commission, partner program
Requires at least: 6.4
Tested up to: 7.0
Stable tag: 3.4.2
Requires PHP: 8.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WooCommerce affiliate plugin for affiliate, referral, partner & creator programs — commissions, royalties, and payouts. No code, no SaaS fees.

== Description ==

https://youtu.be/-o61dgt6DSk

**Siren lets you design multiple, specialized incentive programs from one WordPress site** — affiliate programs, revenue shares, royalties, performance bonuses, and more, all from your WordPress dashboard. Learn more at [sirenaffiliates.com](https://www.sirenaffiliates.com).

= Why Siren? =

* **Reward what matters.** Build programs around the metrics that drive your business, not just sales.
* **Automate performance and payouts.** Siren handles commission calculations and payments.
* **Reach new partner types.** Specialized programs fit creators, agencies, influencers, and educators.

= Flexible Program Types =

Siren gives you direct control over how programs are structured, so the software fits the partnership arrangement rather than the other way around. Start from one of 44 ready-made recipes, or build your own.

* **Affiliate Programs.** Track referrals through custom links, coupon codes, or landing pages, with flat-rate, percentage, tiered, or override commissions.
* **Referral Programs.** Turn existing customers into a growth channel with refer-a-friend rewards, store credit, and flat-bounty B2B referrals.
* **Partner & Reseller Programs.** Run invite-only partner programs, channel and reseller commissions, and marketplace vendor revenue shares — for example, a 70/30 vendor split.
* **Creator & Royalty Programs.** Pay creators and instructors a royalty on every sale of their product or course — the Udemy and Skillshare revenue model, rebuilt for WordPress.
* **Sales Commissions.** Pay a sales team with per-rep commissions, manager overrides, new-business vs. renewal rates, and monthly bonus pools.
* **Lead-Generation Bounties.** Pay a flat bounty for every qualified form submission with Gravity Forms or Ninja Forms — no sale required.
* **Loyalty & Rewards.** Reward repeat customers with store credit and milestone rewards that keep them coming back.

Every program can also credit the content that influenced a sale. Siren's **Blog Content Program** awards a commission when a customer *reads* a post, not only when they click a link — so you still capture buyers who arrive from AI assistants like ChatGPT and skip the affiliate link entirely.

= Start From a Recipe =

Not sure where to begin? Apply a complete, pre-configured program in a few clicks from the built-in recipe browser, then customize it. Popular starting points include the Basic Affiliate Program, Coupon-Based Influencer Program, Refer-a-Friend Program, Invite-Only Partner Program, and Customer Rewards Program — and 12 of the recipes run on the free Siren Lite tier.

= Partnerships That Collaborate, Not Compete =

Traditional affiliate tools credit a single partner per sale. Siren can split credit across every partner who contributed, using the attribution model you choose per program.

* **Shared Engagement Pool.** Rewards are divided evenly among all contributing partners.
* **Performance Weighted Pool.** Rewards are distributed based on relative engagement scores.
* **Top Score Wins.** The partner with the highest engagement score receives the entire reward.

= 10 Core Capabilities =

1. **Custom Program Builder.** Design incentive programs without writing code.
2. **Recipe Import.** Apply a complete program setup from a template in one click.
3. **Partner Dashboard.** Partners get their own login to track earnings and payments.
4. **Automatic Calculations.** Rewards are calculated from your program rules.
5. **Multi-Level Programs.** Tiered reward structures for long-term partner growth.
6. **Payout Manager.** Send rewards through PayPal or bank transfer.
7. **Reward Stacking.** Combine programs for layered reward arrangements.
8. **Performance Bonuses.** Pay bonuses based on last period's results.
9. **Product-Specific Programs.** Different reward rates per product or category.
10. **Coupon Attribution.** Credit partners through coupon codes, without link clicks.

= Deep Integrations =

Siren works seamlessly with the WordPress plugins you already use.

* **WooCommerce.** Automatic order tracking, product-based commissions, coupon attribution, and subscription support. See the [WooCommerce affiliate plugin guide](https://www.sirenaffiliates.com/integrations/woocommerce-affiliate-plugin).
* **Easy Digital Downloads.** Affiliate and partner programs built for digital products, licenses, and recurring revenue.
* **LifterLMS.** Share course revenue with instructors, experts, and partners from inside your LMS.
* **LearnDash.** Reward instructors and partners for course sales and enrollments.
* **Gravity Forms.** Turn any form into a collaborator signup, lead capture, or lightweight checkout flow.
* **NorthCommerce.** Support modern, high-AOV offers and creator-driven launches.

== Third-Party Services ==

This plugin connects to external services operated by Novatorius, LLC in the following situations:

= Contextual Help Documentation =

When you open the help panel inside the Siren admin screens, the plugin fetches documentation articles from [sirenaffiliates.com](https://www.sirenaffiliates.com/documentation). Only the requested article slug is sent. No personal data, site data, or tracking information is transmitted. Responses are cached locally for 24 hours.

= Recipe Import (Program Templates) =

When you import a program recipe from the Siren website, the plugin fetches the recipe configuration from the Siren Beacon service at `beacon.sirenaffiliates.com`. This sends only the recipe ID. After the recipe is applied, the plugin notifies Beacon that the recipe was consumed so it cannot be reused. No personal data or site data is transmitted.

These services are governed by the [Novatorius Terms of Service](https://www.sirenaffiliates.com/terms-and-conditions) and [Privacy Policy](https://www.sirenaffiliates.com/privacy-policy).

== Bundled Libraries ==

This plugin bundles the following third-party libraries, each shipped with its license text:

* [Opis JSON Schema](https://github.com/opis/json-schema), [Opis String](https://github.com/opis/string), and [Opis URI](https://github.com/opis/uri) — Apache-2.0
* [Select2](https://github.com/select2/select2) — MIT
* [Action Scheduler](https://github.com/woocommerce/action-scheduler) — GPLv3
* PHPNomad framework packages and Novatorius libraries — first-party code by the plugin author, distributed under this plugin's GPL license

== Build and Source Code ==

The compiled React admin bundles shipped with this plugin (everything under `frontend/`) are built from the human-readable TypeScript/React source code included in this plugin package under `frontend-source/`. Every shipped bundle's source is present — entry points live in `frontend-source/src/platform/wordpress/entries/`, one per compiled bundle.

To rebuild the compiled assets from the included source:

1. `cd frontend-source`
2. `npm install`
3. `npm run build:wordpress:lite`

The compiled output is written to `frontend-source/dist/wordpress-lite/`, mirroring the bundles shipped under `frontend/`. Build configuration is included in `frontend-source/vite.config.ts`, `frontend-source/package.json`, `frontend-source/tailwind.config.ts`, and `frontend-source/postcss.config.js`.

This plugin also bundles Select2 for specific extension admin screens. The upstream Select2 source is publicly available at https://github.com/select2/select2

== Installation ==

1. Go to Plugins > Add New in your WordPress admin and search for "Siren Affiliates", or download the plugin and upload the zip file.
2. Activate the plugin through the Plugins screen.
3. Navigate to **Siren** in the admin menu to create your first program.

= Minimum Requirements =

* PHP 8.2 or higher
* WordPress 6.4 or higher

== Frequently Asked Questions ==

= How do I create an affiliate program with Siren? =

Navigate to Siren in your WordPress admin menu and click "Add Program." Choose your commission structure, set the rules for how partners earn rewards, and publish. Partners can sign up through a registration form or be added manually.

= Can I run multiple affiliate programs at the same time? =

Yes. Create as many programs as you need, each with its own commission rates, attribution rules, and eligible partners.

= Does Siren work with WooCommerce? =

Yes. Siren integrates deeply with WooCommerce, including automatic order tracking, product-based commissions, coupon attribution, and full WooCommerce Subscriptions support for recurring commissions.

= Does Siren support recurring commissions for subscriptions? =

Yes. When a WooCommerce subscription renews, Siren can trigger a new conversion and award commissions to the attributed partner. Initial payments, renewals, plan changes, and refund adjustments are all tracked.

= What is a "collaborator" in Siren? =

Siren's term for any partner who earns rewards through your programs: affiliates, content creators, agency partners, resellers, and more.

= What attribution models does Siren support? =

Siren supports shared engagement pools that split rewards evenly, performance-weighted pools that distribute proportionally to contribution, and top-score-wins where a single partner takes the full reward.

= How does Siren handle tracking performance? =

Visitor tracking records a lightweight engagement event; commission calculation and attribution run in background jobs via Action Scheduler rather than during page loads.

= Can partners track their own earnings? =

Yes. Siren includes a partner dashboard where collaborators can log in to view their earnings, track referrals, and see payment status. They do not need WordPress admin access.

= How are payouts handled? =

Siren's Payout Manager lets you send rewards directly to partners. Approved commissions are compiled into payout records that you can fulfill through PayPal, bank transfer, or other methods.

= Is there a free WooCommerce affiliate plugin? =

Yes. Siren Lite is free and runs a complete WooCommerce affiliate program — unlimited affiliates, link and coupon tracking, automatic commission calculation, and a partner dashboard. Twelve of the built-in starter recipes work on the free tier. Paid tiers add scheduled distributions, overrides, and additional program types.

= What is a good affiliate plugin for beginners? =

Siren is built for non-developers. Pick a starter recipe such as the Basic Affiliate Program, apply it in a few clicks, and you have a working program with sensible defaults. No code, no separate SaaS account, and no per-affiliate fees.

= What is the best AffiliateWP alternative? =

Where a traditional affiliate plugin credits a single affiliate per sale, Siren can run multiple programs at once and split credit across every partner who contributed, using the attribution model you choose per program. It also covers referral, partner, creator, sales-commission, lead-generation, and loyalty programs from the same plugin.

= Does Siren support multi-level, tiered, or override commissions? =

Yes. Siren supports tiered programs where senior partners earn an override on the sales their recruits refer, VIP and standard rate tiers, and manager overrides for sales teams. You define the reporting lines and the rates.

= Can I run an affiliate program for digital products or Easy Digital Downloads? =

Yes. Siren integrates with Easy Digital Downloads for affiliate and partner programs built around digital products, licenses, and recurring revenue, including coupon attribution and per-product commission rates.

= Does Siren work with LearnDash and LifterLMS courses? =

Yes. Siren works with LearnDash and LifterLMS, so you can pay affiliates for course sales, share course revenue with instructors, and run instructor royalty or revenue-share programs from inside your LMS.

= Can affiliates be tracked with coupon codes instead of links? =

Yes. Each collaborator can be assigned a unique coupon code, and Siren credits the sale whenever that code is used at checkout — no link click required. This is ideal for influencers who share codes on Instagram, TikTok, or YouTube.

= Can I run a refer-a-friend program for my customers? =

Yes. Siren's referral programs give each customer a unique link or code and reward them, often in store credit, when a friend they refer makes a purchase. You can also run flat-bounty B2B referral programs.

= Does Siren require WooCommerce? =

No. WooCommerce is the deepest integration, but Siren also works with Easy Digital Downloads, North Commerce, LearnDash, LifterLMS, and form plugins like Gravity Forms and Ninja Forms — so you can track sales, course enrollments, or lead submissions.

== Screenshots ==

1. Programs list
2. Program editor: rates, attribution rules, engagement types
3. Collaborators list
4. Collaborator detail with earnings breakdown
5. Conversions with engagement history
6. Transactions across all programs
7. Obligations review queue
8. Fulfillments (payout batches)
9. Fulfillment detail
10. Recipe import
11. Partner dashboard
12. Partner rewards
13. Partner performance charts
14. Partner coupons
15. Partner profile
16. Add-program chooser: build from scratch or start from a recipe
17. Recipe browser: ready-made program setups filtered to your store
18. Recipe detail: goals, rewards, and compatibility at a glance
19. Recipe setup wizard with optional add-ons

== Changelog ==

= 3.4.2 =

* Customer filters: only reward genuinely new customers in programs & distributors (Plus)
* fix(events): replace BasicTypes::Numeric with IsNumeric — unblocks sale event ingestion
* fix(wporg): caption the recipe screenshots + gate caption drift in CI
* fix(phpstan): annotate IsNumeric::getContext() iterable value type
* fix: restore headless event ingestion in WordPress builds, gated to Pro (charter 652)
* feat(essentials): add collaborator-owned customers (lifetime commissions)
* SaaS list pagination total leaks global row count across tenants

= 3.4.1 =

* fix(frontend): affiliate dashboard clipped behind portal sidebar — scope Tailwind disclosure trimming to Lite (bounty 645)
* fix(lite): bind TermProvider in the free-tier loader

= 3.4.0 =

* New: Starter recipes — browse a catalog of ready-made program setups, filtered to what works with your store, and launch a fully-configured program in a few clicks.
* Fixed: Easy Digital Downloads 3.x — assigning a collaborator to a coupon works again.
* Fixed: Ninja Forms integration labels now load from the plugin's own translations.

= 3.3.0 =

* fix(wp): register engagements admin page so conversion → engagement link resolves
* fix(reporting): aggregate by type, apply date range, support comparison metrics
* fix(reporting): update balance & earnings on internally-issued obligations
* test(distributions): cover MarkAllocationObligationAsPending; chore(wp): remove dead /payouts mapping
* fix(notes): record status transitions from internal flows, not just REST
* fix(reporting): apply aggregation/date-range/comparison fixes to queryStandings
* chore(screenshots): commit publish-to-auth pipeline + fix dashboard
* fix(woocommerce): introduce TermProvider to eliminate get_the_terms crash
* Add Plus and Pro tier packaging scaffolding
* Add CollaboratorGroup primitive (slice A of cascade work)
* Add CollaboratorGroup and calculation-type recipe support
* fix(wporg): remediate round-4 review findings and harden the submission gate
* Siren WordPress REST Update Method Compatibility
* Radix Checkbox controlled/uncontrolled dev warning on forms with hydrated state
* Integration-owned transaction source registration
* WooCommerce: Collaborator dropdown empty on new product creation
* Eliminate silent attribution failures: catch \Error at REST/event boundary + fix transactionDetails NULL contract
* Replace SafeMySQL with maintained PDO backend (mysql-integration 1.2.1)
* feat(ninja-forms): add Ninja Forms integration
* Run engagement/metric calc migration on 3.x upgrades (#555)

= 3.2.6 =

* Maintenance and stability release.

= 3.2.5 =

* fix(lite): unship over-stripped runtime files (WSOD + missing menu)

= 3.2.4 =

* fix(collaborators): repair WC/EDD/LLMS/NC dropdown and consolidate JS
* fix(lite): defer collaborator-program junction install

= 3.2.3 =

* fix(ci): build blocks before packaging in compile-test-zip workflow
* fix(recipes): make export schema-compliant
* Harden demo routing against soft 404s
* chore(deps): bump phpnomad/db to 2.2.0
* ci(release): make release step idempotent + auto-bump version to tag

= 3.2.2 =

* Maintenance and stability release.

= 3.2.1 =

* fix: auto-run installer on version bump + ship compiled portal block

= 3.2.0 =

* `RecipeImportJobExecutor` replaces `RecipeImportTaskHandler`
* `RepairJobExecutor` — generic executor that looks up any registered `RepairAction` by subtype
* `RunDebugRepair` switches from sync-inline to async-dispatch (returns 202 + jobId, 409 when a matching repair is already in flight)
* `DebugTab` RepairDialog dispatches async, swaps to a polling view with queued/running/complete states
* Old `RecipeImportJob` model/datastore/table/task/service/installer all deleted
* **programs** — typed `incentiveArgs`, `autoApprove`, `expirationDays`, `activeConversionTypes`, `lineItemFilters`
* **distributors** — `distributionArgs`/`poolResolverArgs` per-distributor (fixes parallel-importer clobbering), concrete `schedule` shape, `engagementTypes`, `transactionCompilers`, `lineItemFilters`
* **collaborators** — new stanza with nested `aliases` (typed, with `issuedDate` for migration link continuity) and `bindings` (collaborator→program, collaborator→distributor)
* **mappings** — generic four-field cross-system bridge
* **tracking** / **commerce** — site-wide settings stanzas
* Stripped license/update-checker residue from the lite zip; readme documents the frontend source/build path
* Removed live superglobal usage from WordPress request handlers
* Added nonce/capability checks to extension save flows
* Stopped rewriting `active_plugins`
* Fixed weak JS globals; cleaned up plugin path/url resolution
* Switched docs fetching to a WordPress HTTP-backed transport
* Added missing lite templates used by live listeners
* `SetupCollaboratorPortal` enqueued the Vite-built portal bundle without `type="module"`. 37 shared chunks + main entry all threw `Cannot use import statement outside a module`; the SPA stalled at "Loading…" forever. Filter added on `script_loader_tag` that marks every portal handle as a module at tag-render time. `RegisterCollaboratorPortalBlock` already did this for the editor-preview path; this brings the frontend portal enqueue path in line.
* `bin/seed-screenshot-data.php` was writing to a non-existent `totalCount` column (actual column is `count`), silently dropping all activity data. Also fixes activity-type enum to match `STRATEGY_TO_ACTIVITY_TYPE` (`site_visit`, `content_view`, `product_sale`, `form_submission`, `coupon_use`) and seeds per-day periods so the last-6-months activity chart has a real time series.
* Inline `:root { --background/--foreground/--primary/--accent: ...; }` overrides generated from block attrs were attached to `siren-collaborator-portal-inline` and enqueued *before* the Vite-built Tailwind bundles. The bundles carry their own `:root` defaults, so they printed last and won the cascade — the editor preview updated but the public portal rendered stock colors. Moved override emission to after the bundle loop, attached via `wp_add_inline_style()` to the last bundle handle so our rule is last in source order.
* Portal Branding inspector panel's logo field was a `TextControl` asking for a pasted URL. Replaced with `MediaUpload` + `MediaUploadCheck` — WordPress's native media modal, URL-based storage preserved for backward compat, thumbnail preview + Replace / Remove controls.
* Block editor still shows "Your site doesn't include support for the siren/collaborator-portal block" because the wp-scripts `build/blocks/` output isn't wired into `bin/build.php` or `.github/workflows/release.yml`. Release workflow runs `frontend:build:all` but never `wp-scripts build`, and the build script doesn't relocate `./build/` into `lib/LiteApplication/build/` where the path resolver expects it. Every essentials install will hit this in the block editor until it's fixed. Not blocking 3.2.0 — block works at runtime, only the editor is affected.
* `job_schedules` table + cron dispatcher for recurring jobs (telemetry, nightly prunes) — framework designed for it, not built.
* Retention/cleanup of old job rows.
* Unified "recent jobs" history pane on the Utilities tab (backend endpoint exists; no UI yet).

= 3.1.2 =

* fix(transactions): stop double-subtracting coupon discounts on WC and EDD orders

= 3.1.1 =

* fix(lite): unblock beacon recipe handoff for non-admin Siren users
* fix(recipes): align plugin with website handoff contract + e2e coverage

= 3.1.0 =

* fix: Prevent crash when selecting obligation checkboxes
* refactor(api): normalize JSON responses at the chokepoint
* refactor(rest): attach global interceptors per controller
* Activate Notes system with event listeners, REST API, and activity timeline
* chore(uat): commit UAT environment tree to source control
* fix(notes): decouple extended resolvers from OrgDatastore; 500s on Essentials Activity
* fix(notes): add Note to WordPress permission model list
* Restore Woo ItemLogged logging and bump phpnomad minima
* feat(notes): add automatic notes for collaborator program changes
* fix: permanent delete fails due to FK constraints on junction tables
* chore: sync plugin version headers to 3.0.1
* fix(programs): stop legacy listener from overwriting engagementTypes format
* fix(fulfillments): restore cents-to-dollars conversion
* feat(notes): add activity notes for status changes
* fix(notes): attach missing source linkages to activity notes
* ci: gate workflows on ready-for-review + release tag push
* feat(fields): declarative shape system for REST JSON output contracts
* chore(wp-org): prepare plugin for wp.org resubmission
* chore(wp-org): fix Plugin Check failures, wire Plugin Check into build
* fix(updater): derive plugin basename via plugin_basename() so Essentials receives updates
* fix(saas): guard Request::hasParam against scalar intermediate segments

= 3.0.1 =

* Fix fulfillment screen displaying amounts in cents instead of dollars (#36)
* Fix CREATE TABLE running before ALTER in InstallReportingService upgrade (#37)
* License key activation now correctly reflects active status in UI (#33)
* Fix broken "Get Your License Key" link in WordPress admin (#31)
* Add Zod response adapters at API boundary, remove ghost engagement type (#32)
* Refactor collaborator action event listeners to own junction binding (#38)
* Set up PHPStan level 8 with CI integration (#34)

== Upgrade Notice ==

= 3.4.2 =
Adds a starter-recipe browser for launching pre-configured programs in a few clicks, and fixes collaborator-on-coupon assignment for Easy Digital Downloads 3.x.
