=== AdvocateLoop ===
Contributors: advocateloop
Tags: referral, rewards, advocacy, affiliate, marketing
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect WordPress to your AdvocateLoop account to capture referrals and show share & claim widgets anywhere with shortcodes.

== Description ==

AdvocateLoop turns your happy customers into a chain of new ones. This plugin connects your WordPress site to your AdvocateLoop account and handles the WordPress side of that: capturing referrals from incoming links, and rendering share and claim widgets wherever you place them.

The plugin is intentionally lightweight. It attributes incoming referrals, renders widget containers via shortcodes, and reports the events your AdvocateLoop account needs. The referral rules, reward calculation, eligibility, and notification emails all live in your AdvocateLoop account — so there's nothing to configure on your server beyond connecting the two.

= What the base plugin does =

* **Referral attribution** — identifies referred traffic, so visits are credited to the right advocate.
* **Share & claim widgets** — drop widgets anywhere with shortcodes: `[advocate_loop_widget]`, `[advocate_loop_share]`, `[advocate_loop_claim]`, and `[advocate_loop_share_buttons]`.
* **Works on any WordPress site** — no store or ecommerce platform required.
* **Your branding** — widgets follow the brand colors, logo, and domain set in your AdvocateLoop account.
* **Built to extend** — checkout add-ons like AdvocateLoop for WooCommerce slot in automatically, with no setup.

= Optional add-on: track store orders =

The base plugin covers WordPress-level tracking (widgets, shortcodes, and visit attribution). If you run a store and want to track orders, install the matching free add-on alongside this plugin:

* **AdvocateLoop for WooCommerce** — a separate free add-on that adds order tracking for WooCommerce stores. Its features are documented with that add-on.

Add-ons require this base plugin to be installed and active. When an add-on is active it adds its own tab under the AdvocateLoop menu; deactivate it and the tab is removed automatically. The base plugin works fully on its own without any add-on.

= Requirements =

* WordPress 5.8 or higher
* PHP 7.4 or higher
* An [AdvocateLoop](https://advocateloop.com) account (a free tier is available). The plugin shows a setup notice until you enter your API Key and Brand ID.

Full setup and usage documentation: https://docs.advocateloop.com/plugins/wordpress/setup/

== Installation ==

1. Install through the Plugins screen in WordPress, or upload the plugin folder to `/wp-content/plugins/`.
2. Activate the plugin through the Plugins screen.
3. Open the AdvocateLoop menu and enter the API Key and Brand ID from your AdvocateLoop account.
4. (Optional) Install a checkout add-on, such as AdvocateLoop for WooCommerce, to track store orders.

== Frequently Asked Questions ==

= Do I need an AdvocateLoop account? =

Yes. The plugin connects your site to the AdvocateLoop service, which handles all referral logic. A free tier is available.

= Does this work without WooCommerce? =

Yes. The base plugin provides widgets, shortcodes, and visit attribution on any WordPress site on its own. Order tracking for stores is added separately by the AdvocateLoop for WooCommerce add-on.

= Where do I place the widgets? =

Use the shortcodes in any post, page, or widget area. See the documentation for examples and options.

= How do add-ons appear? =

When an add-on is active, it adds its own tab under the AdvocateLoop settings page. Deactivate the add-on and the tab is removed automatically.

== External Services ==

This plugin connects to AdvocateLoop, a third-party referral service, and cannot function without it — all referral logic, attribution, and reward calculation happen in the AdvocateLoop service rather than on your site.

To render widgets and attribute referrals, the plugin loads AdvocateLoop's widget script in the visitor's browser. Data is sent to AdvocateLoop in two situations:

* **From your WordPress admin:** your API Key and Brand ID, to verify the connection and load your account data.
* **From a visitor's browser:** when a page loads, a visitor identifier is requested; if the visit includes a referral, the referral code and landing page are sent so the visit can be attributed. When a visitor uses a share widget, the contact details they enter (such as name and email) are sent to create their advocate record and return a share link.

By using this plugin you agree to AdvocateLoop's Terms of Service (https://advocateloop.com/terms) and Privacy Policy (https://advocateloop.com/privacy).

== Screenshots ==

1. The referral loop: one customer refers the next, and rewards trigger when referrals actually buy.
2. Connect your site by entering your API Key and Brand ID — setup takes under a minute.
3. Add-ons such as AdvocateLoop for WooCommerce appear automatically as their own settings tab when active.
4. Share and claim widgets render on your own site via shortcode, styled to match your brand.

== Changelog ==

= 1.0.0 =
* Initial public release.
* WordPress-level referral tracking with share/claim widgets and shortcodes.
* Frontend referral capture and visitor handling via the AdvocateLoop widget script.
* Extension API with a dynamic settings-tab registry so add-ons appear automatically when installed.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
