A super-smooth generator for products, orders, coupons, customers, and terms. WP-CLI is the preferred interface for using the plugin. There is also a WP Admin UI at Dashboard > Tools > WooCommerce Smooth Generator with (for now) more limited functionality.
- Download the latest release as a zip file from https://github.com/woocommerce/wc-smooth-generator/releases/
- Install in your WordPress site as you would any other plugin zip file.
You can see a summary of all available commands by running wp help wc generate, and more detailed guidance for each individual command is available by running wp help wc generate <command name>.
Generate products based on the number of products parameter.
- wp wc generate products <nr of products>
Generate products of the specified type. simple or variable.
- wp wc generate products <nr of products> --type=simple
Generate orders from existing products based on the number of orders parameter, customers will also be generated to mimic guest checkout.
Generate orders for the current date
- wp wc generate orders <nr of orders>
Generate orders with random dates between --date-start and the current date.
- wp wc generate orders <nr of orders> --date-start=2018-04-01
Generate orders with random dates between --date-start and --date-end.
- wp wc generate orders <nr of orders> --date-start=2018-04-01 --date-end=2018-04-24
Generate orders with a specific status.
- wp wc generate orders <nr of orders> --status=completed
Apply coupons to a percentage of generated orders (0.0-1.0). If no coupons exist, 6 will be created automatically (3 fixed cart, 3 percentage). Note: --coupons flag is equivalent to --coupon-ratio=1.0.
Important: Decimal ratios are converted to percentages using integer rounding. For example, 0.505 becomes 50% (not 50.5%) because the random generation uses integer comparison. Use whole percentages like 0.50 for precise 50% ratios.
- wp wc generate orders <nr of orders> --coupon-ratio=0.5
Refund a percentage of completed orders (0.0-1.0). Refunds will be split evenly between partial and full, and 25% of partial refunds will receive a second partial refund.
Note: The same decimal ratio behavior applies to refund ratios as described above for coupon ratios.
- wp wc generate orders <nr of orders> --status=completed --refund-ratio=0.3
Order Attribution represents the origin of data for an order. By default, random values are generated and assigned to the order. Orders with a creation date before 2024-01-09 will not have attribution metadata added, as the feature was not available in WooCommerce at that time.
Skip order attribution meta data genereation.
- wp wc generate orders <nr of orders> --skip-order-attribution
Generate coupons based on the number of coupons parameter.
- wp wc generate coupons <nr of coupons>
Generate coupons with a minimum discount amount.
- wp wc generate coupons <nr of coupons> --min=5
Generate coupons with a maximum discount amount.
- wp wc generate coupons <nr of coupons> --max=50
Generate coupons with a specific discount type. Options are fixed_cart or percent. If not specified, defaults to WooCommerce default (fixed_cart).
- wp wc generate coupons <nr of coupons> --discount_type=percent --min=5 --max=25
Generate customers based on the number of customers parameter.
- wp wc generate customers <nr of customers>
Generate terms in the Product Categories taxonomy based on the number of terms parameter.
- wp wc generate terms product_cat <nr of terms>
Generate hierarchical product categories with a maximum number of sub-levels.
- wp wc generate terms product_cat <nr of terms> --max-depth=5
Generate product categories that are all child terms of an existing product category term.
- wp wc generate terms product_cat <nr of terms> --parent=123
Generate terms in the Product Tags taxonomy based on the number of terms parameter.
- wp wc generate terms product_tag <nr of terms>
Requirements
- Node.js v16
- Composer v2+
- If you use Node Version Manager (nvm) you can run nvm useto ensure your current Node version is compatible.
- Run npm run setupto get started. This will install a pre-commit Git hook that will lint changes to PHP files before they are committed. It uses the same phpcs ruleset that's used by WooCommerce Core.
- Create a new branch with a name like release-x.x.x.
- Add a new entry to the changelog.txt file with all the changes since the last release. Follow the conventions of previous changelog entries.
- If necessary, update the Tested up toandWC tested up tovalues in the plugin header in wc-smooth-generator.php.
- Update the plugin version with the new value in the wc-smooth-generator.php and package.json files.
- Run npm run buildto generate a production-ready zip file.
- Test the zip file by installing it in a WordPress instance and ensuring it has the expected version number and changes.
- Commit the changes to your release branch, and push to the repository. Create a pull request from the release branch.
- Merge the pull request.
- In GitHub, go to the Releases screen and click "Draft a new release".
- Set the release title as "Version x.x.x" (but with the actual version number). In the release description, add a brief summary of highlights, and then paste the new changelog entry below that. From the "Choose a tag" dropdown, type the new version number and then click "Create a new tag". Ensure the target is trunk.
- Upload the new zip file to the release where it says "Attach binaries".
- Publish the release!
After finishing the release, you may want to run npm run setup again, because the build script removes dev dependencies.