=== Dreamax Affiliates ===
Contributors: dreamaxsoft
Tags: affiliate, referral tracking, woocommerce, commission, payouts
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 2.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Run a self-hosted WooCommerce affiliate program with referral tracking, coupons, commissions, reports, creatives, and manual payouts.

== Description ==

Dreamax Affiliates helps WooCommerce stores manage an affiliate program inside WordPress. Program data remains in the site's database; there is no required external account, telemetry service, or automatic payout provider.

Affiliates can apply, create referral links, use assigned coupons and creatives, view performance, maintain payout details, request eligible payouts, and review payout history. Administrators can manage affiliates, global or affiliate commission rates, basic reports, refunds, diagnostics, and manual payout batches.

= Key features =

* Guided setup, beginner-friendly Overview, and launch checklist
* Affiliate applications, approval states, configurable fields, throttling, and anti-spam extension points
* Opaque referral tokens with first-click or last-click attribution
* Classic checkout and Cart/Checkout Blocks attribution
* WooCommerce coupon attribution with configurable priority
* Referral links, campaign labels, user-triggered sharing, and locally generated QR downloads
* Premium standalone affiliate portal with sticky desktop navigation, responsive results tables, profile/settings, optional WooCommerce My Account shortcut, creatives, and payout history
* Basic click, unique-visitor, conversion, referral, and commission summaries with detailed logs
* Global percentage or flat-per-order commission, with optional per-affiliate overrides
* Full and partial refund recalculation with duplicate-event protection
* Manual referral creation, qualifying order statuses, refund synchronization, and payout eligibility
* Affiliate payout requests and locked manual payout batches by affiliate and currency
* Self-referral prevention and extension-ready fraud policy hooks
* Bounded CSV export for affiliate, click, and referral records
* Optional IP anonymization, retention cleanup, and WordPress privacy export/erase integration
* WooCommerce HPOS and Cart/Checkout Blocks compatibility declarations
* Translation-ready strings, RTL styles, keyboard support, and accessible feedback states
* Local System Status diagnostics and a removable real-path attribution test
* Restrained opt-in Pro information page with no dashboard nags or feature locks

Dreamax Affiliates records payout activity but does not send money automatically. It does not connect to PayPal Payouts, Stripe Connect, or banking APIs. Administrators pay affiliates outside the plugin and then record the payment reference and status.

= Requirements =

* WordPress 6.4 or later
* PHP 8.0 or later
* WooCommerce 8.2 or later for order attribution, commissions, coupons, and refunds

= Privacy and external services =

Dreamax Affiliates does not automatically send affiliate, referral, payout, analytics, or diagnostic data to a Dreamax Soft-owned service.

User-triggered social sharing runs only after the affiliate chooses a destination; a share request occurs only after that action. The generated referral URL and optional share text are passed to Facebook, LinkedIn, X, WhatsApp, the browser's native share interface, or the configured email application. Each destination applies its own terms and privacy policy. Dreamax Affiliates does not receive the share result.

A store manager may configure a creative with an external image URL. The affiliate's browser then requests that image from the remote host, which may receive ordinary connection data. Using the WordPress Media Library avoids that external request.

QR codes are generated locally in the browser with a bundled GPL-compatible dependency. Email notifications use the site's configured WordPress email system. Dreamax Affiliates does not download or execute remote plugin code.

== Installation ==

1. Install the ZIP through **Plugins → Add New → Upload Plugin**, or upload the `dreamax-affiliates` folder to `/wp-content/plugins/`.
2. Activate Dreamax Affiliates.
3. Complete **Dreamax Affiliates → Setup**.
4. Review attribution, commission, privacy, payout, and uninstall settings.
5. Test checkout attribution, refunds, reports, and manual payouts on a staging site.

== Frequently Asked Questions ==

= Does Dreamax Affiliates work without WooCommerce? =

Registration, standalone dashboards, payout profiles, creatives, and some reporting remain available. Order attribution, coupon integration, commissions, and refunds require WooCommerce.

= How is a sale attributed? =

A valid referral visit creates a visit record and opaque browser token. During checkout, Dreamax Affiliates stores the matched attribution on the WooCommerce order. A referral is created when the order reaches a configured qualifying status.

= Can a coupon credit an affiliate without a referral cookie? =

Yes. Assign an existing WooCommerce coupon to an active affiliate. If coupons assigned to different affiliates appear on one order, the order remains unattributed to avoid ambiguous credit.

= How are commissions calculated? =

A site default percentage or flat-per-order rate can be overridden for an individual affiliate. Tax, shipping, discounts, and refunds follow the configured settings. Product, category, variation, and holding-period automation require a separately distributed add-on.

= What happens after a refund? =

Unpaid and processing referrals are recalculated from the remaining commissionable value. Paid referrals remain immutable and the order is flagged for manual reconciliation.

= How do payouts work? =

Affiliates may request an eligible unpaid balance after reaching the configured threshold. Administrators create or approve a manual batch, pay outside Dreamax Affiliates, record a reference, and mark the batch paid.

= Can data be removed when the plugin is deleted? =

Program data is preserved by default. Enable **Delete data on uninstall** before deleting the plugin to remove Dreamax Affiliates-owned tables, options, creatives, transients, and metadata. WordPress users and WooCommerce orders are never deleted.

= Where can I get support? =

After publication, use the WordPress.org support forum for non-sensitive questions. Include versions and reproducible steps, but never post credentials, payout details, customer data, or vulnerability details publicly.

== Screenshots ==

1. Guided setup wizard, readiness checks, and launch steps.
2. Affiliate registration form with accessible validation states.
3. Affiliate dashboard start guide, referral-link sharing, and QR generator.
4. WooCommerce My Account shortcut to the standalone affiliate portal.
5. Administrator affiliate list and status controls.
6. Basic click, visit, conversion, referral, and commission reports.
7. Global and per-affiliate commission settings.
8. Coupon assignment and attribution priority.
9. Creative library and personalized creative links.
10. Payout batch and payout-detail workflow.
11. Privacy-safe System Status and removable Test Attribution tool.
12. Privacy, essential notification, fraud-prevention, and data-removal settings.

== Changelog ==

= 2.1.0 =
* Finalized WordPress.org public metadata, refreshed Free-tier directory illustrations, clean submission ZIP, assets package, and dynamic SVN layout.
* Added exact package, manifest, checksum, screenshot-source, and Go/No-Go evidence for the final productization milestone.
* Preserved database schema 1.8, Core API 1.2.0, existing program data, and all validated Free workflows.

= 2.0.9 =
* Added automated security, metadata, package, CI, and Plugin Check compatibility preflight evidence.
* Hardened request sanitization and corrected release automation without changing stored data.

= 2.0.8 =
* Added privacy-safe System Status, removable Test Attribution, and a restrained Pro information page.

= 2.0.7 =
* Added a beginner-friendly Overview, ordered navigation, setup wizard, launch checklist, and affiliate start guide.

= 2.0.6 =
* Added Free workflow regression coverage and corrected stale integration-test metadata.

= 2.0.5 =
* Added privacy-safe Free-tier data-preservation status and cleanup without changing stored program data.

= 2.0.4 =
* Separated advanced fraud, import, and editable email-template implementation while preserving legacy data.

= 2.0.3 =
* Replaced advanced visual analytics with bounded Free summaries while preserving stored campaign and referral data.

= 2.0.2 =
* Separated advanced commission automation while retaining Free commission and payout workflows.

= 2.0.1 =
* Added the fixed Free/Shared feature gate and stopped bootstrapping Pro-only migration tools.

= 2.0.0 =
* Prepared the original stable packaging baseline and retained database schema 1.8.

For older changes, see `CHANGELOG.md` in the development source package.

== Upgrade Notice ==

= 2.1.0 =
Final WordPress.org packaging refresh; no database migration or stored-data rewrite is introduced.
