WP Manifestindependent plugin directory
manifest / developer / wc-smooth-generator-dokan

WooCommerce Smooth Generator – Dokan releases

Companion WordPress plugin extending WooCommerce Smooth Generator to generate realistic Dokan multivendor marketplace demo data — vendors, products, coupons, split orders with commissions, withdrawals, and store reviews. WP-CLI + admin UI.

by weDevs · github.com/getdokan/wc-smooth-generator-dokan · website

0stars
8release downloads
0forks

Install

The author publishes release zips, so WP-CLI can install straight from GitHub:

wp plugin install https://github.com/getdokan/wc-smooth-generator-dokan/releases/download/v0.2.0/wc-smooth-generator-dokan.zip

Readme

WooCommerce Smooth Generator – Dokan

Generate realistic Dokan multivendor marketplace demo data — vendors, vendor-owned products, vendor & marketplace coupons, split orders with commissions, withdrawals, and store reviews — for development, testing, and demos.

This is a companion plugin that extends WooCommerce Smooth Generator. It adds new WP-CLI commands under the existing wp wc generate namespace and makes no changes to the parent plugin.

Requirements

  • PHP 7.4+
  • WooCommerce Smooth Generator 1.3.0+ (active)
  • Dokan Pro 5.0.2+ (active) — which requires Dokan (lite)
  • WooCommerce (transitively required)

If any dependency is missing, the plugin shows an admin notice naming it, and the CLI commands exit with an error. Store-review generation additionally requires the Dokan Pro store-reviews module to be enabled.

Installation

cd wp-content/plugins/wc-smooth-generator-dokan
composer install --no-dev   # optional; a fallback autoloader works without it

Then activate WooCommerce Smooth Generator – Dokan in WP Admin.

WP-CLI commands

# Vendors (seller-role users with store profiles)
wp wc generate vendors 20 [--enabled] [--featured] [--commission=10]

# Products owned by vendors
wp wc generate vendor-products 200 --vendors=auto      # distribute across all vendors
wp wc generate vendor-products 50  --vendors=12,15     # specific vendor IDs

# Vendor or marketplace coupons
wp wc generate vendor-coupons 50 --vendors=auto                  # vendor-authored
wp wc generate vendor-coupons 20 --vendors=auto --type=marketplace  # admin-authored

# Orders that split into per-vendor sub-orders with commissions
wp wc generate marketplace-orders 500

# Vendor withdrawal requests (balance-aware by default)
wp wc generate withdrawals 50 [--allow-overdraw]

# Store reviews against vendors
wp wc generate store-reviews 100 --vendors=auto

# Everything, in dependency order
wp wc generate marketplace --vendors=20 --products=200 --coupons=50 --orders=500 --withdrawals=50 --reviews=100

Removing generated data

# See what would be deleted, without deleting anything
wp wc wipe dokan --dry-run

# Delete everything this plugin generated (prompts first)
wp wc wipe dokan [--yes]

# Delete ALL Dokan marketplace data, generated by this plugin or not
wp wc wipe dokan --all [--yes]

# Restrict to one type
wp wc wipe dokan --type=vendors

# Mark marketplace data that predates the marker, so a wipe can see it
wp wc wipe adopt [--dry-run] [--yes]

Flags

Flag Commands Meaning
--enabled vendors Mark vendors as active sellers.
--featured vendors Mark vendors as featured.
--commission=<n> vendors Per-vendor admin commission percentage.
--vendors=<spec> vendor-products, vendor-coupons, store-reviews auto, an ID, or id,id,....
--type=<t> vendor-coupons vendor (default) or marketplace.
--allow-overdraw withdrawals Allow amounts exceeding the vendor balance.
--type=<t> wipe dokan Restrict the wipe to one type. Defaults to every type.
--all wipe dokan Adopt first, then wipe — removes all marketplace data, not just generated.
--dry-run wipe dokan, wipe adopt Report what would change without changing it.
--yes wipe dokan, wipe adopt Skip the confirmation prompt.

How it works

The plugin subclasses the parent generators (WC\SmoothGenerator\Generator\*) and adds Dokan behavior on top:

  • Vendorsdokan()->vendor->create(), with enabled/featured/commission applied in CLI via a scoped user_has_cap filter.
  • Vendor products / coupons — extend the parent Product/Coupon generators; assign post_author after the parent builds the entity. Marketplace coupons add Dokan Pro commission meta.
  • Split orders — extend the parent Order generator; after the order is built, call dokan()->order->maybe_split_orders() and Dokan's sync so its own commission engine populates wp_dokan_orders / wp_dokan_vendor_balance / wp_dokan_order_stats. We never write Dokan tables directly.
  • Withdrawals — balance-aware via dokan_get_seller_balance() + dokan()->withdraw->insert_withdraw().
  • Store reviews — Dokan Pro StoreReviews\Manager::save_store_review().
  • Wipe — every generated entity is stamped with a _wcsg_dokan_generated marker (a note on the row for withdrawals, an option for global attributes), and the wipe only ever deletes marked entities. Deletion goes through wp_delete_user(), WC_Order::delete() and wc_delete_attribute() so Dokan's own cleanup runs — a deleted vendor takes their posts with them and a deleted parent order takes its sub-orders. wipe adopt back-fills the marker onto data created before it existed, which is what makes that data deletable; it is a separate, separately confirmed step.

See docs/superpowers/specs/ for the full design.

Releasing

Releases are driven by pushing a vX.Y.Z git tag, which triggers .github/workflows/release.yml to build the plugin zip and publish a GitHub release with auto-generated notes.

The repo ships a Claude Code slash command that prepares a release for you:

/release 0.2.0

It bumps the version in both required spots (the Version: plugin header and the WCSG_DOKAN_VERSION constant), commits chore(release): v0.2.0, and creates the annotated v0.2.0 tag — then stops before pushing. Review the result, then push to fire the live release:

git push origin main && git push origin v0.2.0

To release manually instead, perform those same steps by hand: keep the two version strings in lockstep, tag vX.Y.Z, and push the tag.

Status

Generators implemented. Runtime verification against a live Dokan Pro install is pending — in particular the split-order commission path (which relies on Dokan's order status-change hooks firing on programmatic order creation).

Read the full README on GitHub →

Releases

TagPublishedAssetDownloads
v0.2.0 Jun 17, 2026 wc-smooth-generator-dokan.zip 5
v0.1.0 Jun 16, 2026 wc-smooth-generator-dokan.zip 3