Codeinwp / Codeinwp/woocommerce-product-addon
Add wp ppom export/import WP-CLI commands for site migration
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 15
- Forks
- 9
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 16
Description
Problem
PPOM stores field configurations in a custom nm_personalized table that standard WP migration tools may not export. Users deactivating during site migration lose their PPOM configurations. Two users in one batch left specifically during migration (candlemakers.co.za, kwaaiplanks.co.za).
Solution
New PPOM_CLI_Command class registered as wp ppom:
Export:
wp ppom export [--file=<path>]
- Exports all field groups from
nm_personalizedtable to JSON - Includes product assignments (
_product_meta_idpost meta) - Records plugin version, export date, and source site URL
Import:
wp ppom import <file> [--skip-assignments]
- Imports field groups from JSON with auto-increment ID remapping
- Re-assigns to products with remapped IDs
--skip-assignmentsflag for when product IDs differ between environments
Files Affected
- New:
classes/cli.class.php— WP-CLI command class woocommerce-product-addon.php— conditional require whenWP_CLIis defined
Acceptance Criteria
-
wp ppom exportcreates valid JSON with field groups + assignments -
wp ppom importrestores field groups with new auto-increment IDs - Product assignments remapped to new IDs
-
--skip-assignmentsflag skips product reassignment - Commands only load when
WP_CLIis defined - Migration guide documentation published
Priority: Low — affects small number of users during migration
Regression risk: Isolated — CLI-only, no web impact
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in woocommerce-product-addon.php to trace conditional loading when WP_CLI is defined, then inspect the nm_personalized table and _product_meta_id assignments described in the issue. Use classes/cli.class.php as the implementation entry point and verify export/import, ID remapping, skip behavior, conditional loading, and migration-guide documentation against the acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- cli, database, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100