| 开发者 | mralaminahamed |
|---|---|
| 更新时间 | 2026年8月2日 04:33 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
storeseeder/v1/<resource>/generate for programmatic use.wp storeseeder generate products --count=20 --locale=de_DE, plus preview, platform and locale commands. The same controllers as the REST API, so nothing can drift.languages directory is registered, so Loco Translate and WPML String Translation pick the admin up without configuration.wp storeseeder cleanup delete does the same from WP-CLI.
It deletes only rows the plugin recorded creating, in its own ledger table. Nothing is ever matched on for resembling test data, so a staging site restored from production keeps its real catalogue. Data generated before this version was released is not in the ledger and is not offered.
Model Context Protocol (MCP) Integration
The plugin can optionally expose each generator as two MCP tools so AI clients (e.g. Claude Desktop, IDE assistants) can work with test data in natural language: a read-only preview that shows the rows a run would create, and a generate tool that creates them. Settings has one switch per risk class — enable AI tools, allow preview tools, allow generating — and each is a registration gate, so a tool that is switched off is never offered to a client at all. Only administrators can change them.
The tools are served at /wp-json/storeseeder-mcp/mcp, and are also reachable through the mcp-adapter plugin's own default server for clients already configured against it. A desktop client connects through Automattic's mcp-wordpress-remote proxy (https://github.com/Automattic/mcp-wordpress-remote), using an application password for a user who has StoreSeeder access; that repository documents the setup and the current config format. This requires the WordPress Abilities API (bundled in WordPress 6.9+, or installable separately) and the mcp-adapter plugin. MCP is entirely optional and degrades gracefully — the plugin works normally when these dependencies are absent.
/wp-content/plugins/storeseeder/.git clone https://github.com/mralaminahamed/storeseeder.gitcomposer install && yarn installyarn buildmcp-adapter pluginInstall StoreSeeder, open the StoreSeeder menu, and choose Products. Set the price range, stock and product type, check the live preview, then press Generate. Products are created through WC_Product, so they behave exactly like products you added by hand. For a whole catalogue with categories, brands, variations and orders against it, use a recipe instead.
Use the Orders generator. Orders need products and customers to exist first — they draw from what is in the store rather than inventing it — so generate those two first, or run a recipe, which fills nine resources in dependency order for you. Order totals are the sum of the real catalogue prices of the products each order points at, so revenue reports agree with the store.
Yes, exactly. Every row StoreSeeder writes is recorded in its own ledger, and Settings → Danger zone → Delete generated data removes what it created and nothing else. No date ranges, no name matching — a staging site restored from production keeps its real catalogue.
Fluent Cart and WooCommerce today. Fluent Cart covers 20 of 21 resources — licences need Fluent Cart Pro, which owns the licensing tables, and StoreSeeder says so rather than hiding the generator. WooCommerce covers 18: subscriptions need WooCommerce Subscriptions, and transactions, labels and licences are reported unsupported with the reason, because WooCommerce has no equivalent for them and no plugin changes that. Support is provided by a platform driver rather than wired into the generators, so more can be added. With one platform active it is selected automatically; with several, StoreSeeder asks which store to write to before it runs anything.
Generators produce platform-neutral records; a writer for the chosen platform persists them through that platform's own models — Eloquent models for Fluent Cart, the CRUD objects (WC_Product, WC_Order, WC_Customer) for WooCommerce — preserving validation, relationships, and business logic. Raw database writes are avoided so generated data behaves like real data, and so it stays valid across that platform's updates.
Yes, from your own plugin and without patching this one. Register a driver on the storeseeder_platforms filter and the generators, REST API, and admin pick it up. A driver answers what it is called, whether it is active, which resources it supports, and which writer handles each one. See https://mralaminahamed.github.io/storeseeder/reference/extension-points/ for the full contract.
Twenty-one: products, product variations, product categories, product tags, brands, customers, orders, transactions, refunds, coupons, shipping plans, shipping classes, tax classes, order tax lines, attributes, cart sessions, labels, product downloads, subscriptions, licences, and activity logs.
Several generators build on others: orders need products and customers; refunds need charge transactions; order tax lines need orders and tax rates; product downloads and subscriptions need products and orders. Generate the prerequisites first, and each generator reports clearly when something is missing.
The subscriptions table ships in Fluent Cart core, so records are generated as fixtures without Pro. Active billing and management require Fluent Cart Pro and a subscription-capable gateway. On other platforms, subscription support depends on what that platform provides — StoreSeeder reports which plugin would enable it rather than hiding the generator.
Use only in development or staging. Always back up your database before generating, and start with small batches.
Yes. The plugin fires filters and actions across the generation lifecycle — modify parameters, transform generated items, and customize REST responses.
It exposes the generators as AI tools via the WordPress Abilities API, so an MCP-capable assistant can create test data conversationally. Each generator gets two tools — a read-only preview and one that writes rows — and Settings decides which kinds are offered, so an assistant can be allowed to look without being allowed to fill the store. It is optional and does nothing unless the Abilities API and mcp-adapter are present.
Seventy-five locales — every one FakerPHP ships a provider for. Names, addresses, phone numbers, company names, and postcodes follow the chosen locale. The picker offers exactly the set the REST API accepts, and is searchable by language name or locale code.
Yes. Settings has a Danger zone action that deletes what StoreSeeder created, and wp storeseeder cleanup delete does the same from the command line. It works from a ledger of rows the plugin recorded creating, so it never guesses which rows are test data — your own products and orders are not candidates. Anything generated before this feature existed is not in that ledger and has to be removed by hand.
Administrators, always. Other roles can be granted access from Settings — one switch per role, covering the admin screen, the REST routes, and the MCP tools alike. Only an administrator can change that setting, so a granted role cannot widen access further, and the Administrator role itself is not listed because it cannot be revoked. Developers can also set the required capability in code with the storeseeder_capability filter.
Yes, with WP-CLI: wp storeseeder generate products --count=20 --locale=de_DE --user=1. There are also preview, platforms, locales and sample-data commands. Every one dispatches through the same REST controller the admin uses, so the command line and the interface cannot disagree about what is valid. Commands that write require --user for someone with the plugin's capability, because generated rows land in a live store.
Yes. All strings — PHP and the React admin — go through gettext, a .pot template ships in languages/, and that directory is registered for both PHP and JavaScript translations. Loco Translate can therefore translate it in place, and WPML String Translation picks the strings up once a language is active. Translating the plugin does not change the language of generated data; that is what the locale setting is for, and it offers 75 locales.
wp storeseeder recipe list / run, and wp storeseeder cleanup --run_id= to undo.uploads/storeseeder/. Existing files are moved for you.storeseeder_platforms registers another from a separate plugin. The same generators feed every driver, so a fixed seed produces identical data wherever it is written.wp storeseeder cleanup delete remove only rows the plugin recorded creating. Nothing is matched on for resembling test data.languages/ directory is registered for both PHP and JavaScript.storeseeder/v1/<resource>/generate.mcp-adapter.