# MammothWP Share Checkout for WooCommerce

Share a WooCommerce checkout with one link. It restores the cart, coupons, shipping method and checkout fields, on classic and block checkout.

- Status: Available
- Version: 2.0.2
- Last updated: 26 November 2026
- Requires WordPress: 6.5 or later
- Requires PHP: 8.1 or later
- Tested up to: 7.1.5
- Download: https://downloads.wordpress.org/plugin/mammoth-share-checkout.2.0.2.zip
- Composer: composer require wpackagist-plugin/mammoth-share-checkout

## Pro
Free is everything a shopper needs to share their own cart, complete on its own. Pro is what store staff use to sell with it.

- Customer prefill. Search a customer and share a checkout filled with their saved billing and shipping details.
- Send the link by email. In the same dialog, "Send email" mails the link to one address with the "Shared checkout link" WooCommerce email (button, cart summary, expiry). The links list shows who it was sent to and when.

Pro is billed annually: $49 – $249 per year (Single Site or Unlimited Sites). Renewals 20% off. 14-day free trial, no card required.

| Feature | Free | Pro |
| --- | --- | --- |
| Share button (cart and checkout, classic and blocks) | Yes | Yes |
| Restore: variations, coupons, shipping, checkout fields, replace prompt, expiry, privacy, rate limits | Yes | Yes |
| Admin list of links with views, restores, conversions (counts) | Yes | Yes |
| WP-CLI / REST / Abilities: list, get, stats (counts), create (cart or products), delete, cleanup | Yes | Yes |
| Revenue per link and in total (list, stats, REST, CLI, Abilities, admin column, sort order) | Yes | Yes |
| Attribution: Creator and "Prepared for" columns, created_by / customer_id in reports | Yes | Yes |
| "Prefill customer details" picker (radio: None / Search a customer), GET /shares/customers, wp mmwp-sc create --customer | No | Yes |
| Send the link by email: "Send email" in the dialog, POST /shares/{token}/send, wp mmwp-sc send, Ability send-share, the mmwp_sc_share_link WooCommerce email (classic + block editor), "Emailed to" column | No | Yes |

## Overview
Share a WooCommerce checkout with one link. It restores the cart, coupons, shipping method and checkout fields, on classic and block checkout.
- Restores the whole checkout, not just the products Products, variations and quantities; Coupons; The selected shipping method; Checkout field values (names, addresses, phone, custom fields); Works with the classic shortcode checkout and the Cart and Checkout blocks; Asks before replacing a visitor's existing cart with the shared one; Compatible with HPOS, WPML, Germanized, FunnelKit and Fluid Checkout
- Built with privacy in mind No-referrer: share links are served with Referrer-Policy: no-referrer and redirect to a clean URL, so the token does not leak to other sites; Bot and prefetch guard: link previews, prefetchers and HEAD requests never restore a cart or count as a view; Rate limits for guests and logged-in users, with a configurable client IP source for sites behind a proxy; Links expire (1 to 90 days, or never; 7 days by default); expired links and their data are deleted automatically; WordPress privacy tools: suggested policy text, personal data exporter and eraser
- Also included Choose who can create links: admins only, admins and logged-in users, or everyone; Views, restores and conversions per link in WooCommerce > Share Checkout; "Share this checkout" in the admin bar on cart and checkout pages; WP-CLI (wp mmwp-sc), REST API and WordPress Abilities for staff and automation; A Support screen with a diagnostic report you can send us; Hooks and an adapter API for custom integrations; Old 1.2.0 links keep working

## Install
1. Make sure WooCommerce is installed and active.
2. Upload the plugin folder to /wp-content/plugins/, or install it from the Plugins screen.
3. Activate the plugin through the Plugins screen.
4. Configure it under WooCommerce > Share Checkout > Settings.
5. Open the cart or checkout page: the Share Checkout button is there. (By default only administrators can create links; change this under Settings.)

## Usage
1. By default only administrators can create links. To let shoppers do it, set Access Mode to "Admins and logged-in users" or "Everyone".
2. Add something to the cart and open the cart page. A Share Checkout button sits under the checkout button. (On the checkout page it sits next to Place Order.)
3. Click it. A dialog shows the link and when it expires. Click Copy Link.
4. Open the link in a private window. The cart, coupons, shipping method and any checkout details are restored and you land on the checkout.

## Common cases
- I see "This shared checkout has expired" or "Share not found". The link is past its lifetime (HTTP 410), or the token does not exist or was deleted (HTTP 404). Create a new link.
- Do links I sent with version 1.2.0 still work? Yes, including links that never expire.
- Does it work with the block checkout? Yes, with both the classic shortcode checkout and the Cart and Checkout blocks, and with WPML, Germanized, FunnelKit and Fluid Checkout. It is compatible with HPOS.
- Where do I get help? WooCommerce > Mammoth WP opens the Support screen, which can produce a diagnostic report to send to info@mammothwp.com.

## Troubleshooting & FAQ
### Do shared links contain the shopper's personal details?
They can. A shared link restores the checkout field values captured when the link was created, which may include the shopper's name, address, email and phone number. Anyone who has the link can open it, so treat links as sensitive and only share them with people you trust.

### I installed Pro, what happens to the free plugin?
Activating Pro deactivates the free plugin, and your links and settings are kept. If both are ever active, only one runs and a notice on the Plugins screen says you can delete the free version. Deleting it does not remove your data while Pro is installed.

### How long are links and their data kept?
For the "Default link lifetime" set under WooCommerce > Share Checkout > Settings: 1, 3, 7, 14, 30 or 90 days, or never. New installs use 7 days. Expired links, together with the cart and checkout details stored with them, are deleted automatically every day. Administrators can delete a link at any time from the Shared Checkouts tab. Existing sites keep the lifetime they had already chosen.

### Does the plugin help with GDPR and privacy requests?
Yes. It adds suggested text to the WordPress privacy policy guide (Settings > Privacy) and integrates with Tools > Export Personal Data and Tools > Erase Personal Data. Links are matched by the billing email stored in the link and by the account that created them. The export contains a shortened token, the creation and expiry dates and the stored checkout details; erasure deletes the matching links.

### The link opened in my chat app or email preview but nothing happened.
That is intended. Prefetch, link-preview and bot requests (including HEAD requests) never restore a cart or count as a view. Only a real visit restores the shared checkout. The share token is also hidden from other sites through a Referrer-Policy: no-referrer header, and the visitor is redirected to a clean URL.

### What happens if the visitor already has items in their cart?
Nothing is changed until they confirm. If the cart is empty the shared checkout is restored straight away. Otherwise the visitor is taken to the cart and asked "Replace them with the shared cart?" with the choices Replace and Keep my cart. This works with both the classic and the block cart and checkout.

### Guest rate limiting blocks everybody, or can be bypassed. What is the "Client IP source" setting?
Guest limits are counted per visitor IP address. By default (Direct) the plugin only uses the address the server sees (REMOTE_ADDR), and ignores headers such as X-Forwarded-For that a visitor could fake. If your site sits behind a proxy, set the source under Settings: Direct: use this on normal hosting. Servers that already rewrite REMOTE_ADDR (Apache mod_remoteip, nginx real_ip) need Direct too. Cloudflare: reads CF-Connecting-IP, but only for requests that really come from Cloudflare's published IP ranges. Trusted proxies: list your load balancer or reverse proxy IPs/CIDR ranges (one per line, IPv4 or IPv6). When the request comes from one of them, the right-most X-Forwarded-For address that is not itself a trusted proxy is used. Each guest gets a fixed one-hour window that starts at their first link and is never extended by later requests.

### Who can create links?
By default only administrators. Change this under WooCommerce > Share Checkout > Settings.

### What happens to my data if I delete the plugin?
Nothing, unless you enable "Delete all data on uninstall" in the settings. When enabled, links, analytics, settings and order tracking data are removed on deletion.

### Is there a Pro version?
Yes, optionally. This plugin is complete for sharing a cart: everything a shopper needs works without a licence or an account. A separate Pro version adds tools for store staff: prefilling a link with a customer's saved details and sending the link by email. You can read about it at https://mammothwp.com/plugins/mammoth-share-checkout/. The Pro version is optional and nothing in this plugin depends on it. This free plugin does not include the licensing library of the Pro version and makes no requests to any licensing or tracking service.

### Does it require WooCommerce?
Yes. Without WooCommerce the plugin shows a notice and does nothing.

### Where is the JavaScript source?
The scripts in build/ are compiled from the readable ES modules in src/js/ (shipped in this plugin) with @wordpress/scripts. To rebuild: npm ci && npm run build (see package.json and webpack.config.js).

## Hooks & filters
- `mmwp_sc_share_created` (action; string $token, array $snapshot, int $user_id): A share link was created.
- `mmwp_sc_share_viewed` (action; string $token, array $share): A share link was opened and is about to be restored.
- `mmwp_sc_share_restored` (action; string $token, array $snapshot): The cart was restored from a share.
- `mmwp_sc_share_converted` (action; string $token, WC_Order $order): An order from a shared link reached processing/completed.
- `mmwp_sc_share_deleted` (action; string $token): A share was deleted (admin/REST/CLI/Ability or privacy eraser).
- `mmwp_sc_share_sent` (action, Pro; string $token, string $to, int $user_id): A share link was emailed (REST, WP-CLI or Ability). Pro only: absent from the free zip. Since 2.0.0.
- `mmwp_sc_checkout_fields` (filter; array $fields, array $snapshot): Checkout field values stored with a share.
- `mmwp_sc_snapshot` (filter; array $snapshot): The full snapshot before it is saved.
- `mmwp_sc_bot_user_agents` (filter; string[] $patterns): User-agent substrings treated as bots (never restore).
- `mmwp_sc_is_bot_request` (filter; bool $is_bot, string $user_agent): Final bot decision for a request.
- `mmwp_sc_client_ip` (filter; string $ip, string $source, string $remote_addr): Client IP used for guest rate limiting.
- `mmwp_sc_cloudflare_ip_ranges` (filter; string[] $ranges): Cloudflare edge ranges trusted for CF-Connecting-IP.
- `mmwp_sc_customer_picker_capability` (filter, Pro; string $capability (default manage_woocommerce)): Capability required to prefill a share with a customer's saved details (since 1.2.0). Pro only: absent from the free zip.
- `mmwp_sc_send_capability` (filter, Pro; string $capability (default manage_woocommerce)): Capability a logged-in user needs to email a link (on top of the permission to create links). Drives the dialog's Send email button, the REST route, the Ability and WP-CLI. Pro only. Since 2.0.0.
- `mmwp_sc_send_rate_limit` (filter, Pro; int $limit (default 20)): Link emails one user may send per hour. Pro only. Since 2.0.0.
- `mmwp_sc_pro_enabled` (filter; bool $enabled (default: Freemius SDK started and the site can use premium code)): Whether the Pro features are on. For tests and dev sites; Licensing/Pro.php is premium-only, so the free zip (either build) neither contains the file nor the filter. Since 2.0.0.
- `mmwp_sc_order_columns` (filter; string[] $columns): Columns a shares list may be ordered by (whitelist; anything else falls back to created_at). Default: id, token, created_by, created_at, expires_at, the counters, revenue, customer_id. Since 2.0.0.

## Renamed hooks
- `mtv_shared_checkout_created` is now `mmwp_sc_share_created` (action)
- `mtv_shared_checkout_viewed` is now `mmwp_sc_share_viewed` (action)
- `mtv_shared_checkout_restored` is now `mmwp_sc_share_restored` (action)
- `mtv_shared_checkout_converted` is now `mmwp_sc_share_converted` (action)
- `mtv_shared_checkout_deleted` is now `mmwp_sc_share_deleted` (action)
- `mtv_shared_checkout_fields` is now `mmwp_sc_checkout_fields` (filter)
- `mtv_shared_checkout_snapshot` is now `mmwp_sc_snapshot` (filter)
- `mtv_sc_bot_user_agents` is now `mmwp_sc_bot_user_agents` (filter)
- `mtv_sc_is_bot_request` is now `mmwp_sc_is_bot_request` (filter)
- `mtv_sc_client_ip` is now `mmwp_sc_client_ip` (filter)
- `mtv_sc_cloudflare_ip_ranges` is now `mmwp_sc_cloudflare_ip_ranges` (filter)
- `mtv_sc_customer_picker_capability` is now `mmwp_sc_customer_picker_capability` (filter)

## WP-CLI
Details per surface: rest.md (REST) and abilities.md (Abilities). Pro-only commands and flags are marked "(Pro)".
Staff operations on shares are declared once in `Surface\ShareResource` (wp-kit) and exposed on three surfaces. Run `wp` as an administrator; without `--user` WP-CLI is trusted as one. With `--user=<id>` the user needs `manage_woocommerce` (creating a link *for a customer* also needs the customer picker capability, filter `mmwp_sc_customer_picker_capability`). The access-mode setting only governs the front-end share button: the CLI is always staff-only.

### `wp mmwp-sc list`

```
wp mmwp-sc list [--status=<active|expired>] [--per-page=<n>] [--page=<n>] [--format=<table|json|csv|yaml>]
```

```
$ wp mmwp-sc list --status=active --per-page=2 --format=csv
token,status,created_at,expires_at,items,views,restores,conversions
dd0c62a8…,active,"2026-10-26 12:58:43","2026-10-29 12:58:43",2,0,0,0
```

`--per-page` is 1–100 (default 20). Times are UTC.

### `wp mmwp-sc get`

`wp mmwp-sc get <token> [--format=json]` prints the share (status, expiry, counters, URL) and its decoded snapshot.

### `wp mmwp-sc create`

```
wp mmwp-sc create (--cart-from-user=<id> | --products=<id:qty,...>) [--customer=<id> (Pro)] [--expires=<1d|3d|7d|14d|30d|90d|never>] [--dry-run]
```

There is no live cart in WP-CLI, so the snapshot is built from lines instead (same shape as a captured one: cart lines only, no coupons, no chosen shipping method; checkout-field values only with `--customer`):
- `--cart-from-user=<id>`: the user's saved WooCommerce cart (persistent cart user meta).
- `--products=10:2,12:1`: product id and quantity (default 1). Variable products are given by variation id; the parent and attributes are resolved. Unknown, unpurchasable or zero-quantity products are refused.
- `--customer=<id>` (Pro): prefill billing/shipping fields from that user's saved details.
- `--expires`: defaults to the "default link lifetime" setting.

Exactly one of `--cart-from-user` and `--products` is required. `--dry-run` validates and reports (`token` and `url` empty) and stores nothing. Third-party adapters (WPML, Germanized, …) read the live session, so they do not run here.

```
$ wp mmwp-sc create --products=10:2,12:1 --customer=2 --expires=3d
Field        Value
token        dd0c62a8…
url          https://shop.test/checkout/?mmwp_sc_token=dd0c62a8…
expires_at   2026-10-29 12:58:43
items        2
customer_id  2
dry_run      no
```

### `wp mmwp-sc delete`

`wp mmwp-sc delete <token>... [--dry-run]` deletes the given shares. Unknown tokens are listed under `missing`; it fails only when none of the tokens exists. `--dry-run` lists what would be deleted.

### `wp mmwp-sc cleanup`

`wp mmwp-sc cleanup [--dry-run]` purges expired shares like the daily job (up to 10,000 per run). `--dry-run` only reports `expired`.

### `wp mmwp-sc stats`

`wp mmwp-sc stats` prints totals (shares, views, unique views, restores, conversions, active, expired, conversion rate in % of restores, revenue). `wp mmwp-sc stats <token>` prints one share's counters, revenue and creator.

### `wp mmwp-sc send` (Pro)

`wp mmwp-sc send <token> --email=<address> [--dry-run]` emails an existing link with the "Shared checkout link" WooCommerce email and records `sent_to` / `sent_at` / `sent_by`. `--dry-run` validates the address, the link and the email settings and sends nothing. Exists only while Pro is on. Ability: `mmwp-share-checkout/send-share`. REST: `POST /mmwp-sc/v1/shares/{token}/send` (nonce, capability and a per-user limit).

### `wp mmwp-sc migrate`

`wp mmwp-sc migrate [--dry-run]`: the one-off 1.2.0 → 2.0 data migration (see `CLAUDE.md`).

## REST API
Routes live under `/wp-json/mmwp-sc/v1`. Routes marked Pro exist only in the Pro build.
The new REST routes and all Abilities need `manage_woocommerce` (401 for guests, 403 for other users).

- `GET /shares`: list
- `GET /shares/{token}`: get. Get Share. existing route, its own access rules
- `GET /shares/stats`: stats
- `POST /shares`: create. Create Share. existing: captures the live cart. Body: `{ fields?: {…}, customer_id?: int }` (`customer_id` is honoured only for users with the customer picker capability). Returns: `{ token, url, expires_at, expires_at_display, customer }`
- `DELETE /shares/{token}`: delete. Delete Share. existing
- `POST /shares/{token}/send` (Pro): send. nonce, capability and a per-user limit
- `GET /shares/customers?search={name or email}`: Search Customers. Access: Pro, customer picker capability only. At least 3 characters; returns up to 20 `{ id, text }` pairs (`text` is "Name (email)").

## Abilities (AI agents)
AI agents and MCP clients can call these operations through the WordPress Abilities API.
Abilities register only where the Abilities API exists (WordPress 6.9+).
`wp_get_ability( 'mmwp-share-checkout/list-shares' )->execute( [ 'status' => 'expired' ] )`. `delete-shares` and `cleanup-shares` are annotated destructive and need `confirm: true`; both accept `dry_run`. The kit flags the abilities `meta.mcp.public`, so an MCP server built on `wordpress/mcp-adapter` lists them as tools.

- `mmwp-share-checkout/list-shares`: list
- `mmwp-share-checkout/get-share`: get
- `mmwp-share-checkout/share-stats`: stats
- `mmwp-share-checkout/delete-shares`: delete (`confirm: true`)
- `mmwp-share-checkout/cleanup-shares`: cleanup (`confirm: true`)
- `mmwp-share-checkout/send-share`: send (Pro)
- `mmwp-share-checkout/send-share` (Pro): send

## Privacy & data
- What is stored: When a link is created the plugin stores a random token, the cart contents, the coupons and shipping method, and the checkout field values entered so far (which can include name, email, phone and addresses), together with the creation and expiry dates, the creating user (0 for guests), and counters for views, restores and conversions. Orders placed from a link get the link token as order meta so conversions can be counted. Guest rate limiting keeps a hashed IP address in a short-lived transient (one hour); the IP address is never stored in the links table.
- Who can see it: Anyone who has a link can open it and see the stored details on the checkout page. Treat links as sensitive.
- Retention: Each link has a lifetime (default 7 days). Expired links and their data are deleted automatically once a day. An administrator can delete any link at any time.
- Exporter and eraser: The plugin adds suggested text to the privacy policy guide, and plugs into Tools > Export Personal Data and Tools > Erase Personal Data. Links are matched by the billing email stored in the link and by the creating account.
- No remote calls: The plugin loads no scripts, fonts or other assets from a content delivery network and contacts no external service. It includes no licensing or tracking library.
- Support requests: The Mammoth WP Support screen sends nothing on its own. Only when an administrator fills in the form and clicks Send, the site sends one email with wp_mail() to info@mammothwp.com with their message, name and reply-to address. A site report (WordPress, PHP, WooCommerce and theme versions, active plugins) is added only if they tick that box, and the last 50 lines of debug.log only if they tick a second box (emails, IP addresses and tokens redacted). Both boxes are unticked by default and the form shows exactly what will be sent.

## Changelog
### 2.0.2

- Smaller download: build and development files are no longer in the plugin zip.

- The links list, statistics, REST API and WP-CLI show the revenue each link brought in and who created it.

### 2.0.1

- This free version no longer includes a licensing library and does not contact any external service.

- Security hardening: checkout field data placed in the page’s script data is now escaped so it can never end the script early.

### 2.0.0

- New name: MammothWP Share Checkout for WooCommerce. Your settings, links, statistics and scheduled cleanup are moved over automatically the first time the new version loads; nothing to do. Deactivate the old “Share Checkout” plugin when asked.

- Links you have already sent keep working, including links that never expire. New links use a new address format; the old one is accepted for good.

- Existing hooks keep working and show a deprecation notice for developers.

- Faster, lighter front end: the scripts are now plain JavaScript with no jQuery.

- New: WP-CLI commands (`wp mmwp-sc`), REST routes and WordPress Abilities to list, create and clean up links and read statistics.

- New: a Mammoth WP Support screen with a diagnostic report.

- New: optional Pro version for store staff (customer prefill, send the link by email), delivered through Freemius. The free plugin is unchanged in what it does, has no locked features and contacts no one unless you opt in.

- Changed: an expired link now answers “410 Gone” and an unknown link “404 Not Found”, with the same friendly messages, instead of a server error. Search engines and monitors can tell them apart.

- Requires PHP 8.1 and WordPress 6.5 or newer.

### 1.2.0 – 2026-10-14

- Add – “Share this checkout” admin bar button on cart and checkout pages.

- Add – “Prefill customer details” picker for staff.

### 1.1.0 – 2026-10-12

See changelog.txt for the full list of changes.

### 1.0.0 – 2026-06-19

- Initial release.

## Support
Email info@mammothwp.com, or use the WooCommerce > Mammoth WP Support screen in wp-admin. Nothing is sent unless an administrator presses Send, and a site report is attached only if they tick the box after previewing it.
