The Product Generator for WooCommerce is a sample product generator, for use on development and testing sites.
Its purpose is to provide an automated way of creating even very large sets of products, useful in providing a test environment for performance benchmarks and use case testing.
The plugin generates products taking into account the following characteristics:
- Product Categories
- Product Tags
- Product Attributes
- SKUs
- Simple and Variable products with variations based on given attributes
- Stock management and stock numbers (some products will have these set, others won’t)
- Featured products (a minor subset will be marked as featured)
- Product images can be obtained from Unsplash or abstract images generated
The generator provides two modes of operation:
- Single Run where up to a certain number of products are generated in a single request.
- Continuous AJAX Run which is used to produce large sets of sample products in a continuous fashion.
This tool produces demo products for testing purposes. It is not recommended to use this on a production site. The plugin will not clean up the data it has created. The plugin will create a product-generator user in the role of a Shop Manager.
The continuous generator can runs iteratively and tries to create up to a certain number of products per run. The continuous generator will try to create new products until stopped, or the total number of products reaches the indicated limit.
The generated products have an individual featured image and price, randomized titles based on the Titles pool and content selected from the pre-defined Contents set, related categories, tags and attributes.
Settings
The plugin provides an administrative section WooCommerce > Product Generator where several aspects can be adjusted.
- Limit : the upper limit on the total products in the store. The generator can create new products until this limit is reached.
- Per Run : The maximum number of products that the generator will create on each iteration.
- Images : Check to get images from Unsplash. Requires the access key.
- Unsplash Access Key : The access key must be provided to be able to use images from Unplash.
- Titles : A collection of words used to generate product titles.
- Contents : A collection of phrases used to generate product descriptions.
- Categories : The names of the categories that are used for generated products.
- Attributes : The attributes and their values that are used for generated products. The format is {attribute name} | {value}, {value}, {value} … i.e. the name of the attribute followed by the pipe character and a list of attribute values separated by comma.
- Reset : Allows to reset the values to their defaults.
- Single Run / Generate up to … : You can have the generator do a single iteration and create up to as many products as indicated.
- Continuous AJAX Run / Run / Stop : This allows to have the generator create products continuously until stopped.
During the Continuous AJAX Run, the cumulative product generation stats and performance are shown.
The product generation stats and performance are also logged to the site’s debug.log. To disable, add this to your site’s wp-config.php:
define( 'WPG_LOG', false );
With the stats provided, this plugin also provides an easy way to benchmark a site: providing an insight into the site’s performance measured by products generated per second. If you want to measure the performance of your site while generating products, make sure to disable the option Get images from Unsplash, as the impact of getting images via the network will be much higher than the product generation itself.
WP-CLI
The generator can be used to generate products from the terminal. Use the product-generator command to create one or more products. Examples:
- To generate one product:
wp product-generator - To generate ten products:
wp product-generator --count=10
Devs : Customization and Improvements
Fork the Repository to customize the products generated as desired. If you want to help improve this tool, feel free to create a new issue. Please label the issue accordingly (bug, enhancement, …) and provide as much detail as possible.
