Description
Market Basket Analysis turns your WooCommerce order history into ranked bundle and cross-sell opportunities, backed by real co-purchase patterns. Not “people also viewed” guesses. Not random product carousels. Proper association-rule mining (FP-Growth + SQL pairs), the same algorithms big retailers use, shipped as a WordPress plugin that runs entirely on your server.
Every rule is auditable: support, confidence, and lift are visible on the Opportunities grid, so you can see why the engine picked what it picked.
What’s included
- Four real mining engines, all local:
sql_pairs(fast pair-only miner, scales to large transaction stores),fp_growth(multi-item bundles, up to 4-item kits, the default),seasonal_cohort(weights recent and same-season baskets more heavily), andreturn_aware(down-weights pairs whose products are frequently returned). - AI catalog engine. Produces recommendations from catalog metadata alone using your own Anthropic or OpenAI API key (the provider bills you directly), so a brand-new store with no orders still gets bundle suggestions on day one.
- AI bundle copy and catalog enrichment. Generate merchant-ready bundle names, product descriptions, image alt text, category tags, and SEO meta from your own Anthropic or OpenAI key, then write the result back to the product. The only thing an AI feature needs is your provider key, and the provider bills you directly. MarketBasketAnalysis never sees the key or the catalog payload.
- Auto-mining cron, an order-velocity trigger plus a scheduled cadence (daily, weekly, or custom) via WP-Cron. Turn it on with the Auto-run mining toggle under Settings, Mining.
- Email + webhook notifications, alerts when a job completes with a high-value opportunity, or fails entirely. The webhook posts a signed JSON summary to a URL you choose.
- Cost-aware scoring and scoring modes, feed product cost via a meta key (compatible with WooCommerce Cost of Goods) and switch the Opportunities grid score between statistical, revenue, profit, or hybrid.
- Autonomous merchandising agent, an opt-in agent (off by default) that proposes weekly-plan actions and routes them through a human approval queue before anything ships.
- Opportunities admin, a sortable, filterable grid of ranked bundle candidates with confidence + lift visible per rule.
- Jobs admin, start a mining job manually with one click, or check scheduled-run status.
- Frequently Bought Together widget, shortcode
[mbawoo_fbt], Gutenberg block, and theme template tag. Sub-millisecond render because recommendations are precomputed, not computed at page load. - Bundle Builder widget, customer-customizable bundle on the product page. Shortcode
[mbawoo_bundle_builder]or the MBA Bundle Builder Gutenberg block. Source product locked in, recommendations togglable, running subtotal, optional “buy N+, save X%” discount preview, single Add to Cart. - Notion page sync, optional: connect your own Notion integration and the plugin keeps four summary pages (weekly plan, rationale analytics, forecasts, checkout experiments) up to date under a Notion page you pick.
- WP-CLI commands,
wp mbawoo run-job,wp mbawoo purge-old-jobsfor ops teams who live in the terminal. - HPOS + classic order tables, the miner detects which storage your site uses and queries accordingly.
- No SaaS dependency, all mining happens inside your WordPress install. The data-driven mining engines make no outbound API calls, and individual orders and customer records never leave your server under any configuration. The optional AI features call your own Anthropic or OpenAI account directly with a key you paste in, send only the catalog data and aggregate statistics listed under External services, and stay inert until you add a key.
MBA Plus (separate plugin)
Everything in this plugin works with no license and no account. A separate
build, MBA Plus, is distributed from marketbasketanalysis.com and adds the
revenue-weighted HUI mining engine and hosted-compute features (hosted
checkout assembly, the hosted MCP surface for AI agents, and high-quota API
access). It is a different plugin, not an unlock: nothing in this one is
withheld or limited while it is not installed.
AI features here (the ai_catalog cold-start engine, AI bundle copy, and
catalog enrichment) use your own Anthropic or OpenAI API key and the
provider bills you directly. We never sit between your store and the LLM.
How it’s different
Most WooCommerce recommendation plugins fall into two buckets: rule-based (“show 4 random products from the same category”) or “people also bought” lookups that ignore co-occurrence patterns. MBA implements proper association-rule mining, the same family of algorithms used by Amazon’s “Frequently Bought Together” feature and Adobe Sensei recommendations, just as a WordPress plugin that runs on your server with no SaaS sign-up.
Compatibility
- WordPress 6.4+ (tested up to 7.1)
- WooCommerce 8.0+ (tested up to 9.4)
- PHP 8.1+ (8.2 recommended)
- Both classic and High-Performance Order Storage (HPOS) order tables
- Multisite-compatible (per-site activation, per-site settings)
External services
This plugin works without any external service. By default, no data leaves your WordPress install: nothing below runs until you add an AI provider key, connect Notion, set an error-reporting DSN, enter a webhook URL, or submit the feature request form. Mining, recommendations, and the storefront widgets always run on your own server.
Every request below goes from your server straight to the service named, with credentials you supply. WordPress adds its standard user agent header to these requests, which includes your site address.
AI features: what they send and when
The AI features (the ai_catalog engine, catalog enrichment, bundle copy, the weekly plan, the AI chat, and shopper-facing rationales) send prompts to Anthropic or OpenAI, whichever you pick under Settings, AI Catalog Pairing, using your own API key. Catalog enrichment always uses Anthropic. With no key saved, every AI feature is inert and no request is made.
What is sent, per feature:
- Catalog enrichment: one product’s title, SKU, short description, full description, price, category names, and product type, plus the titles of up to three products it is frequently bought with.
- ai_catalog engine: up to 500 published products, each as product ID, SKU, name, first category, and price. Order history is not sent.
- Bundle copy: the titles (or SKUs) of up to eight products in the bundle.
- Shopper-facing rationales: two product titles and the first category of each, the pair’s co-purchase statistics (how many baskets contain both, confidence, support, lift), and the reply language.
- Weekly plan: your store’s hostname, the week date, up to 10 top opportunities (product SKUs, action, score, estimated profit), up to 5 approved bundles (SKU, status, lift, confidence), the number of mining jobs, up to 3 highest-margin products (SKU and title), and up to 5 substitution pairs (SKUs and score). Only when a B2B plugin (B2BKing, WooCommerce B2B, or Wholesale Suite) is active, it also sends up to 5 customer-group totals: the group ID or wholesale role, the number of customers in the group, total spend, and the top product IDs with units sold.
- AI chat: the messages you type, the earlier replies in the conversation, and the results of the chat’s built-in tools (opportunity scores with product IDs, the cached weekly plan, bundle demand forecasts). Another plugin can add chat tools through the mbawoo_chat_tools filter; results from a tool added that way are sent too.
Never sent: customer names, email addresses, postal addresses, phone numbers, IP addresses, or individual orders. Order history reaches the provider only as the aggregate counts and scores listed above.
When it is sent:
- Catalog enrichment: when you click Generate, Scan catalog for suggestions, or Generate marketing blurb on the Catalog enrichment page, and once a day if you turn on the daily catalog scan (off by default).
- ai_catalog engine: when a mining job runs with the ai_catalog engine, which happens only when you pick that engine on the Jobs page or in setup, or make it the default engine with Auto-run mining turned on (off by default).
- Bundle copy: when you click Draft AI copy on the Bundle proposals page.
- Weekly plan: when you open the Weekly plan page and the cached plan is more than 24 hours old, when you click Refresh or Run agent now, once a week if you turn on the weekly plan email (off by default), and on the agent’s schedule if you turn on the autonomous agent (off by default).
- AI chat: each time you send a chat message.
- Shopper-facing rationales: when an app using one of your plugin API keys requests a rationale for a product pair that has no cached rationale. Rationales stay cached for 30 days. The storefront widget only reads cached rationales and never calls the provider itself.
Anthropic API
Anthropic’s Claude API is a large language model service. The plugin uses it for the AI features above when Anthropic is your provider (the default) and always for catalog enrichment. Requests go to https://api.anthropic.com/v1/messages with the API key you enter under Settings, AI Catalog Pairing, and Anthropic bills you directly. The data and triggers are the ones listed under “AI features: what they send and when”.
This service is provided by Anthropic, PBC: Commercial Terms of Service, Privacy Policy.
OpenAI API
The OpenAI API is a large language model service. The plugin uses it for the AI features above (except catalog enrichment) when you choose OpenAI as your provider under Settings, AI Catalog Pairing. Requests go to https://api.openai.com/v1/chat/completions with the API key you enter, and OpenAI bills you directly. The data and triggers are the ones listed under “AI features: what they send and when”.
This service is provided by OpenAI: Business Terms, Privacy Policy.
Notion (optional page sync)
Notion is a workspace and documents service. The plugin uses the Notion API (https://api.notion.com/v1) to keep four summary pages (MBA – Weekly Plan, MBA – Rationale Analytics, MBA – Forecasts, MBA – Checkout Experiments) under a parent page you choose in your Notion workspace. To use it, you create your own Notion integration, enter its client ID and secret on the MBA: Notion page, and click Connect to Notion.
- What is sent when you connect: your browser opens Notion’s authorization page (https://api.notion.com/v1/oauth/authorize) with your integration’s client ID and your site’s callback URL. Your server then sends the returned authorization code, your client ID and secret, and the callback URL to https://api.notion.com/v1/oauth/token, and creates the four pages under your parent page.
- What is sent on each sync: the page content, which is the current weekly plan (week date, plus each action’s priority, headline, and rationale), your total rationale impressions and conversions, up to 20 bundle forecast entries (bundle ID and forecasting method), and your checkout experiment setting (on or off, traffic split). To replace a page’s content, the plugin reads that page’s blocks, deletes them, and appends the new ones through https://api.notion.com/v1/blocks. No customer data and no individual orders are sent.
- When it is sent: once when you connect, then every hour while the connection exists (a WP-Cron job rewrites the four pages), and whenever you click Sync now on the MBA: Notion page. Nothing is sent before you connect, and clicking Disconnect stops the sync.
This service is provided by Notion Labs, Inc.: Terms and Privacy, Privacy Policy.
Sentry (optional error reporting)
Sentry is an error-monitoring service. The plugin reports errors to it only if you set a Sentry DSN, either with the MBAWOO_SENTRY_DSN or MBAWOO_REPORTS_SENTRY_DSN constant in wp-config.php or by saving a DSN to the mbawoo_sentry_dsn option. There is no settings screen for it, and with no DSN set the plugin makes no Sentry request. Reports go to the host in your DSN (for Sentry’s hosted service, an ingest.sentry.io address).
- What is sent: the error type and message, the stack trace (file paths, line numbers, function names), your server’s hostname, the plugin and WordPress versions, and a tag naming the plugin task that failed. No order data, customer data, or product data is added.
- When it is sent: when a plugin cron job or REST handler catches an error, and when an uncaught exception or fatal PHP error ends a request. PHP reports uncaught errors site-wide, so an error from other code on the site can be reported too.
This service is provided by Functional Software, Inc. (Sentry): Terms of Service, Privacy Policy.
Job notification webhook (a URL you choose)
If you enter a URL in Settings, Notifications, Job completion webhook URL, the plugin sends a JSON POST to that URL after every mining job completes or fails. You choose the destination, so its terms and privacy practices are those of whoever runs that URL.
- What is sent: the event name (job completed or job failed), the job ID, your site URL, a result summary (job status, number of rules found, number of orders analyzed, run time, and the error message when the job failed), and a timestamp. If you set a webhook signing secret, the request carries an HMAC-SHA256 signature header.
- When it is sent: after each mining job, only while a webhook URL is saved. Leave the field blank to turn it off.
Feature request form
The MBA: Request a feature page sends what you submit to the MarketBasketAnalysis team by email, through your site’s own WordPress mailer (wp_mail). It is sent only when you submit the form.
- What is sent: the title, category, and message you type, your store’s home URL, the plugin version, the admin page name, and the time of submission.
The MarketBasketAnalysis privacy policy and terms cover what the team does with a request.
Emails from your own site
Setup tips, the weekly plan email, and job alert emails go through WordPress’s own wp_mail function and whatever mail service your site already uses. The plugin adds no mail provider of its own. Setup tips are off by default and turn on with a checkbox in the setup hub or in Settings, Notifications. The weekly plan email is off by default, and job alert emails go out only when you enter an alert address in Settings, Notifications.
Screenshots




Installation
- Upload the plugin folder to
/wp-content/plugins/. The in-admin install via Plugins, Add New, Search “MarketBasketAnalysis” applies once the plugin is live in the WordPress.org directory; until the listing is approved, the upload path is the way in. - Activate the plugin through the Plugins menu in WordPress.
- Make sure WooCommerce is installed and active.
- Navigate to WooCommerce, MBA: Dashboard to run your first mining job.
- (Optional) Add the FBT widget to a product page via the Gutenberg block or the
[mbawoo_fbt]shortcode. - (Optional) The separate MBA Plus plugin, with the revenue-weighted HUI engine and hosted compute, is available at marketbasketanalysis.com.
For a detailed quick-start, see the installation guide.
FAQ
-
Does this work with a fresh store with no orders yet?
-
The data-driven engines (sql_pairs, fp_growth) require order history. Around 200 completed orders in the analysis window is the sensible floor below which patterns are too sparse to mine. For brand-new stores with no order history, the free
ai_catalogengine produces recommendations from catalog metadata alone, using your own Anthropic or OpenAI API key (the provider bills you directly). -
Will mining slow down my site?
-
No. Jobs run in the background via WP-Cron or are kicked off manually from the admin. The storefront widget hits precomputed rules from a fast database table; lookups are sub-millisecond and never a real-time computation at page load.
-
Does this support High-Performance Order Storage (HPOS)?
-
Yes. The miner checks the site’s HPOS setting and queries the right tables automatically. No configuration needed.
-
Where does my data go?
-
Mining runs locally. The data-driven mining engines make no outbound API calls, and individual orders and customer records never leave your server.
AI features call your own Anthropic or OpenAI account directly using a key you paste into Settings. They send product catalog data and aggregate statistics (for example, how many baskets contain a product pair), never customer names, email addresses, or individual orders. The External services section below lists exactly what each optional service receives and when. We never see the catalog payload or the LLM response. Every AI feature (the
ai_catalogengine, AI bundle copy, and catalog enrichment) needs only your provider key, and the provider bills you directly. You set a monthly token budget for the AI assistant and the storefront rationales under Settings, AI Catalog Pairing, so a busy month cannot surprise you; 0 means no limit. -
How does the FBT widget choose recommendations?
-
For a given product, the widget looks up the top-scored opportunities where that product appears in the antecedent (the “if” side of an association rule). Ties are broken by lift, then confidence.
-
Can I customize the widget styling?
-
Yes. Every block exposes its CSS classes (
.mbawoo-fbt,.mbawoo-fbt__item, etc.). Override in your theme’s stylesheet or use the Gutenberg block’s color/layout controls. -
How is AI billed?
-
AI features that call an LLM use YOUR Anthropic or OpenAI API key, and the provider bills you directly. Nothing about them is metered by us. You can cap the monthly token spend for the AI assistant and the storefront rationales under Settings, AI Catalog Pairing.
-
Is the source code available?
-
Yes, this plugin is GPLv2+ licensed and you can read and modify any of its code.
-
Where do I get support?
-
Use the WordPress.org plugin support forum once the directory listing is approved; until then, marketbasketanalysis.com/contact.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“MarketBasketAnalysis for WooCommerce” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “MarketBasketAnalysis for WooCommerce” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
0.17.0
- Changed: activating the plugin creates its tables and settings and does nothing else. It sends no email, starts no analysis, and contacts no server.
- Changed: setup tips emails are off by default. Turn them on with the checkbox in the setup hub or under Settings, Notifications, and turn them off the same way or with the link in any of the emails.
- Changed: the first analysis starts when you first open the setup hub.
- Changed: every global name uses the mbawoo prefix, and PHP classes use the MarketBasketAnalysis\WooCommerce namespace. The shortcodes are [mbawoo_fbt] and [mbawoo_bundle_builder], and the WP-CLI command is wp mbawoo.
- Changed: the External services section lists every service the plugin contacts, what it sends, when, and links to each provider’s terms and privacy policy.
- Removed: the Slack, Linear, HubSpot, and Salesforce connectors, which connected but sent nothing. Notion remains.
- Security: storefront impression tracking is tied to the shopper’s own session cookie, so a copied nonce cannot record impressions for another session.
- Security: every REST route checks access in its permission callback: feed tokens, the unsubscribe token, OAuth state, webhook signatures, and manage_woocommerce for the health check.
- Security: all admin output is escaped at the point it is printed.
0.16.1
- Fixed: the direct-file-access guard now sits in the first lines of every file, where Plugin Check reads it.
- Removed: the Domain Path header, which pointed at a languages folder this plugin does not ship.
0.16.0
- Changed: plugin renamed to MarketBasketAnalysis for WooCommerce.
- Changed: every admin style and script now loads through the WordPress enqueue API; the plugin prints no inline style or script tags.
- Changed: the AI monthly token budgets (assistant chat, storefront rationales) are now yours to set under Settings, AI. They are spending guards on your own AI provider bill, and 0 means no monthly limit.
- Changed: the free AI clients moved out of the Pro namespace (MarketBasketAnalysis\WooCommerce\Ai); no behavior change.
- Security: every read of cookie, header, and request data is sanitized and unslashed at the point of use, and the public REST routes document why each one is public.
- Removed: the storefront “Powered by” credit link.
0.15.1
- Fixed: the Opportunities grid and its count now read only the most recent completed mining job, as the page states. Previously every historical run’s rows aggregated, so re-mining showed each surviving pair once per run.
- Changed: admin page titles use the MarketBasketAnalysis brand name consistently.
0.15.0
- Changed: every feature in this plugin works with no license and no account: job notifications, cost-aware scoring, scoring modes, the full diagnostics event log, catalog-enrichment scans, and the autonomous agent are all included.
- Changed: the seasonal_cohort and return_aware engines are now selectable from the Jobs quick-run form, matching the Settings default-engine picker.
0.14.0
- New: a Catalog Hygiene page flags dead SKUs, duplicate listings, missing reorder thresholds, and mis-categorized products, each with a one-click fix.
- New: a Returns Insights page ranks products by return rate and suggests an action for the worst offenders.
- New: a Drift Alerts page surfaces divergence between mining runs.
0.13.0
- New: enabling a bundle proposal now creates its discount for you. The plugin auto-generates a WooCommerce coupon from the bundle’s discount (percent or fixed), restricted to the bundle’s products, so you no longer hand-make a coupon after you approve a bundle.
- New: the bundle discount auto-applies at the cart. The moment a shopper has every item in the bundle in their cart, the price drops on its own with no code to type; drop one item and it lifts again.
- New: a Disable bundle action on the Bundle Proposals page un-enables a live bundle and removes its discount coupon.
0.12.0
- Improved: the guided setup is now a single resumable hub. Each step opens in place with its own focused content, and you can jump to any step or come back later right where you left off.
- New: bundle proposals carry an editable description alongside the name. Draft AI copy, edit both, and save them together.
0.11.0
- New: the catalog enrichment workspace is now a full review queue. A catalog scan ranks your thinnest listings by quality score and generates suggestions for the worst ones first (description, alt text, category tags, SEO meta).
- New: edit any proposal in place before you apply it, apply suggestions one at a time, or tick several and write them all back in one click with Apply selected.
- New: a per-product Generate marketing blurb action writes a short agent and bundle-context line to a product custom field.
- New: an optional daily catalog scan on WP-Cron, off by default, using your own AI provider key.
Older entries are at marketbasketanalysis.com/changelog.
