humanmade / woocommerce-demo-generator
WP-CLI tool for generating demo products and orders in WooCommerce using Faker.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:wordpress-plugin
pkg:composer/humanmade/woocommerce-demo-generator
Requires
- php: >=8.0
- fakerphp/faker: ^1.23 || ^2.0
Requires (Dev)
README
Lightweight WP-CLI tool for generating demo products and orders in WooCommerce using Faker.
Maintained by Human Made, created by Claude Code.
Requirements
- PHP 8.0+
- WordPress 6.0+
- WooCommerce 8.0+
Installation
Install via Composer:
composer require humanmade/woocommerce-demo-generator
Then activate the plugin:
wp plugin activate woocommerce-demo-generator
Generating Products
Generate demo products with realistic names, descriptions, prices, and stock levels:
wp demo-products generate --count=100
Products are distributed across 8 categories: Electronics, Clothing, Home & Garden, Sports & Outdoors, Beauty & Health, Books & Media, Toys & Games, and Food & Beverages.
Options
| Option | Description | Default |
|---|---|---|
--count=<n> |
Number of products to generate | 100 |
--category=<slug> |
Limit to specific category | All |
--no-images |
Skip placeholder image downloads | false |
--batch-size=<n> |
Products per batch before cache clear | 100 |
Examples
# Generate 1000 products without images (faster) wp demo-products generate --count=1000 --no-images # Generate 500 electronics products wp demo-products generate --count=500 --category=electronics # Generate 10,000 products for load testing wp demo-products generate --count=10000 --no-images --batch-size=200
Available Categories
View available categories with their configuration:
wp demo-products categories
| Slug | Name | Price Range |
|---|---|---|
electronics |
Electronics | $20 - $2,000 |
clothing |
Clothing | $15 - $300 |
home-garden |
Home & Garden | $10 - $500 |
sports |
Sports & Outdoors | $13 - $600 |
beauty |
Beauty & Health | $8 - $150 |
books |
Books & Media | $5 - $80 |
toys |
Toys & Games | $10 - $150 |
food |
Food & Beverages | $6 - $90 |
Each category has 10 brands, 10 style prefixes, and 15 product types for varied product name generation.
Generating Orders
Generate demo orders with realistic customer data, addresses, and order history:
wp demo-products generate-orders --count=100
Orders include Faker-generated billing/shipping addresses, random product selections, varied order statuses, and dates spread over a configurable time range.
Options
| Option | Description | Default |
|---|---|---|
--count=<n> |
Number of orders to generate | 100 |
--products=<ids> |
Comma-separated product IDs to use | All products |
--demo-products-only |
Only use demo-generated products | false |
--days=<n> |
Spread orders over this many days | 365 |
--min-items=<n> |
Minimum items per order | 1 |
--max-items=<n> |
Maximum items per order | 5 |
--batch-size=<n> |
Orders per batch before cache clear | 50 |
Examples
# Generate 500 orders for specific products wp demo-products generate-orders --count=500 --products=123,456,789 # Generate 1000 orders using only demo products wp demo-products generate-orders --count=1000 --demo-products-only # Generate recent orders (last 30 days) wp demo-products generate-orders --count=200 --days=30 # Generate larger orders wp demo-products generate-orders --count=100 --min-items=3 --max-items=10
Order Status Distribution
Orders are created with realistic status distribution:
| Status | Percentage |
|---|---|
| Completed | 50% |
| Processing | 20% |
| On Hold | 10% |
| Cancelled | 8% |
| Pending | 5% |
| Refunded | 5% |
| Failed | 2% |
Listing Demo Data
View summaries of generated demo data:
# List demo products by category wp demo-products list # List demo orders by status wp demo-products list-orders # Output as JSON wp demo-products list --format=json wp demo-products list-orders --format=json
Cleanup
Remove all demo data when no longer needed:
# Remove all demo products (and their images) wp demo-products purge --yes # Remove all demo orders wp demo-products purge-orders --yes
Demo products and orders are tracked with post meta (_demo_product_generated and _demo_order_generated) so they can be cleanly removed without affecting real data.
Performance
For large imports (10,000+ items), the plugin automatically clears object caches periodically to prevent memory exhaustion. Adjust batch sizes based on your server's available memory:
# Lower batch size for limited memory wp demo-products generate --count=10000 --no-images --batch-size=50 # Higher batch size for better performance wp demo-products generate-orders --count=5000 --batch-size=100
Skipping images with --no-images significantly improves product generation speed.
Credits
Created by the team at Human Made.
Interested in joining? We're hiring!