=== Pswish Creator Commissions for WooCommerce ===
Contributors: pswish_themes
Tags: woocommerce, affiliates, coupons, creators, referral
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Credit WooCommerce orders to creators by coupon code, even when no referral cookie exists.

== Description ==

Pswish Creator Commissions for WooCommerce gives a WooCommerce store a creator programme built around coupon attribution. A shopper can type a creator's code at checkout without ever opening a referral link, and the order can still be credited to that creator. If a matching creator coupon and a different referral link are both present, the coupon wins.

The free plugin includes unlimited creator records and direct commissions, creator applications and approval, unique WooCommerce coupons, referral links, a creator dashboard, a manual commission ledger, basic reporting, CSV exports, and a first-run setup flow. A creator's coupon is generated with a zero customer discount by default. The store owner can adjust the WooCommerce coupon's discount separately from the commission rate.

The plugin records pending commissions; it does not transfer money to creators. A manager reviews and approves the commission, makes the payment using their chosen method, then marks the record paid with a payout reference. There is no automatic payout or licence requirement in this free plugin.

Pswish Creator Commissions is an independent extension by Elizabeth Sramek, compatible with WooCommerce.

See the [Pswish Creator Commissions for WooCommerce plugin homepage](https://affiliatesoftwareonline.com/wordpress-affiliate-plugin/) for the current feature guide, release status, and support contact.

= Who it is for =

Pswish Creator Commissions for WooCommerce is for WooCommerce merchants who collaborate with creators, ambassadors, or referral partners and want to credit an order when a shopper enters that partner's coupon code. It is especially useful when customers learn a code from a video, podcast, printed card, or conversation, then visit the shop directly. In that situation there may be no referral cookie, but the saved order coupon can still identify the creator.

The Free edition keeps the core programme inside the merchant's own WordPress and WooCommerce installation. Store managers decide which creators are approved, which orders are eligible, and when a commission is actually paid.

= How order attribution works =

An approved creator receives a unique WooCommerce coupon and a shareable referral link. When an eligible order reaches the configured processing point, the plugin first checks the order's saved coupon items for an active creator coupon. A qualifying coupon takes priority over a different creator's referral link. If the order has several active creator coupons, the first one in the order's saved coupon-item order receives the direct commission. If no qualifying coupon exists, a valid referral link within the configured attribution window can receive credit.

The plugin keeps one direct commission per order and does not create another commission when the same order is processed again. A creator's commission rate is separate from the shopper discount: generated coupons start with a zero customer discount, and a store manager can change that discount in WooCommerce.

= Creator applications and access =

Place the Creator Area block or `[pswish_creator_commissions_area]` shortcode on a public page. Visitors must sign in to a WordPress account before applying; managers can then review and approve applications. Approved creators with linked WordPress accounts can view their coupon, referral link, and commission information in the Creator Area. If account registration is disabled, a manager can create the creator's WordPress account first and link it to the creator record.

The WooCommerce > Creator program screen provides creator search, filtering, status actions, commission review, basic reporting, settings, and CSV exports. The first-run setup flow guides a manager through default commission and referral-window choices and creating a test creator.

= Commission review, refunds, and payouts =

An eligible order creates a pending commission record. A manager reviews it, approves or rejects it, and can record a payout reference when marking an externally completed payment as paid. Marking a record paid does not initiate a bank, PayPal, Stripe, or store-credit transfer.

For unpaid commissions, a partial refund reduces the amount proportionally and a full refund rejects it. If a commission was already marked paid, the paid record is retained for audit history and the order receives a note asking the manager to reconcile any recovery manually.

= Reporting and data ownership =

The Reports tab provides basic programme totals. Managers can export creators and commissions as CSV for reconciliation and accounting. Creator applications, attribution records, order references, commission amounts, and payout notes remain on the merchant's WordPress site. The Privacy section below explains the referral signals stored in the plugin's tables and the optional Freemius consent.

= Free and paid editions =

The Free plugin includes the coupon-first WooCommerce workflow, creator records and applications, referral links, creator dashboard, manual payout ledger, basic reports, and exports without a paid licence. A separate Pro and Agency add-on is in development for advanced rules, integrations, and payment workflows. Those paid capabilities are not part of this Free package. The [plugin homepage](https://affiliatesoftwareonline.com/wordpress-affiliate-plugin/) identifies their current availability.

== Installation ==

If you installed version 1.0.1 under the previous Affiliate Software Online name, deactivate the old plugin before activating this ZIP. You do not need to uninstall the old plugin. Deactivation preserves creators, commissions and settings, which this release reads automatically. Existing Creator Area blocks and shortcodes continue to work.

1. Install and activate WooCommerce.
2. Upload the Pswish Creator Commissions for WooCommerce ZIP through Plugins > Add Plugin > Upload Plugin, or install it from the WordPress.org directory once published.
3. Activate Pswish Creator Commissions for WooCommerce.
4. Open WooCommerce > Creator program and follow the three setup steps. Set the default commission rate and attribution window, then create a test creator.
5. Add a page containing the `[pswish_creator_commissions_area]` shortcode or the Creator Area block. Publish this page so creators can apply and see their dashboard.
6. Approve a creator in WooCommerce > Creator program. Their coupon appears in WooCommerce > Marketing > Coupons.
7. Place a test order with that coupon, then check the Commissions tab. Refund the test order when finished.

If WordPress account registration is disabled, create creator user accounts in WordPress before asking them to apply. A manager can also add a creator and link an existing WordPress user ID.

== Screenshots ==

1. The setup wizard sets the default commission rate and referral attribution window.
2. The Creators screen shows an active demo creator, their coupon code, commission rate, search, status controls, and CSV export.
3. The Commission ledger shows a pending $5 coupon commission on a $100 WooCommerce test order, with review and export controls.
4. The Reports screen shows programme conversions and the demo creator's earnings for the selected dates.
5. The Settings screen controls the commission basis, tax and shipping inclusion, attribution window, and data removal on uninstall.
6. The creator-facing dashboard shows an approved creator's referral link, coupon code, and basic performance totals.

== Frequently Asked Questions ==

= Does a creator need a referral link for their coupon to work? =

No. The active creator coupon on the WooCommerce order is checked first, even when no cookie or session exists.

= What if an order contains multiple creator coupons? =

The first active creator coupon in the order's stored coupon-item order gets the direct commission.

= Does the creator coupon discount the customer? =

The generated coupon starts at zero discount. Store managers may edit the WooCommerce coupon to offer a discount. The creator's commission rate is set separately in the creator record.

= When are commissions paid? =

The plugin does not send money. A manager approves a pending commission, pays the creator outside the plugin, and records the payout reference when marking it paid.

= What happens after a refund? =

Unpaid commissions are reduced proportionally after partial refunds and rejected after full refunds. If a commission was already marked paid, the historical paid amount stays in place and an order note asks the manager to review recovery manually.

= Is data removed on uninstall? =

No, data is retained by default. In the plugin Settings tab, enable "Remove all data on uninstall" before uninstalling if you want its three custom tables and settings removed. Deactivation alone retains data.

== Privacy ==

Creator applications store the supplied name, email, website or social handle, and audience description. Referral click rows store HMAC-hashed IP and user-agent values, the creator code, and a landing URL path. Commissions store order IDs, creator IDs, amounts, currency, source, and payout notes. No raw IP or user-agent is stored in these tables. Store managers are responsible for their site's privacy notice and retention choices.

The creator-attribution and commission features run on your WordPress site and do not need an external account. This version includes the Freemius SDK for optional usage opt-in and paid add-on licensing. On activation, a site administrator can skip the Freemius opt-in and use the free creator features. If the administrator opts in, Freemius receives the information shown on its consent screen, which can include administrator profile, site, product, and installed plugin/theme information. The administrator can decline sharing the plugin/theme list and can later opt out in WordPress. See [Freemius](https://freemius.com/), its [privacy policy](https://freemius.com/privacy/), and its [terms](https://freemius.com/terms/).

The plugin's two basic transactional messages, approval and commission marked paid, use WordPress `wp_mail()` and the site's configured mail delivery. The plugin does not claim that acceptance by `wp_mail()` proves delivery.

== Changelog ==

= 1.0.2 =
* Rename the plugin to Pswish Creator Commissions for WooCommerce. Preserve existing creator and commission data, referral links, and the Creator Area.
* Enforce the expected HTTP method, permissions, and a request-specific nonce on protected form submissions.

= 1.0.1 =
* Add exact-decimal commission, refund handoff, and creator-area heading/asset extension hooks for compatible add-ons. Free calculations and standalone behavior remain available.

= 1.0.0 =
* Initial release candidate with coupon-first attribution, referral links, creator applications, a commission ledger, reporting, and CSV exports.
