Repository navigation
Add WP-CLI command to migrate legacy beapi/key-figure content. - #25
Merged
Merged
Conversation
Content saved by the old plugin stays invalid until block names, BEM classes, and markup are rewritten; this command does that as a manual dry-run by default. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 76775d7. Configure here.
Iterating over every site with switch_to_blog() duplicated what --url already does, so --blog_id is dropped in favour of running the command once per site. Co-authored-by: Cursor <cursoragent@cursor.com>
The previous --live flag inverted the usual WP-CLI convention; matching blockparty-icons keeps a no-op opt-in instead of an opt-in write. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Rahe
reviewed
Sep 18, 2026
Rahe
left a comment
Member
There was a problem hiding this comment.
Rien de bloquant, en soit tu peux y aller.
| $this->migrate_posts(); | ||
| $this->migrate_widgets(); | ||
|
|
||
| WP_CLI::success( |
Member
There was a problem hiding this comment.
Success + https://make.wordpress.org/cli/handbook/references/internal-api/wp-cli-utils-format-items/ pour afficher en mode tableau.
Replace the long success sprintf with a CLI table as suggested in review. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Content saved by the old plugin stays invalid until block names, BEM classes, and markup are rewritten; this command does that as a manual dry-run by default.
Note
Medium Risk
With
--live, the command writes topost_contentand widget options (including direct DB updates for revisions); incorrect migration logic could corrupt stored block markup, though dry-run is the default and execution is manual.Overview
Adds a WP-CLI migration path from legacy
beapi/key-figuretoblockparty/key-figure. When WP-CLI is available, the plugin registerswp blockparty key-figure migrate, which scans post content (batched) and block widgets, renames block delimiters and BEM classes, and optionally modernizes saved HTML (pkey wrapper, numberdata-*attributes, raw increment text).--livepersists changes; without it the command is a dry-run. Flags cover multisite (--blog_id), post types, revisions, batch size, and--no-modernize.New PHP under
includes/(KeyFigureBlockMigrator,MigrateFromKeyFigureBlockCommand) is wired via Composer PSR-4 autoload. Quality tooling now coversincludes/**(workflow paths,phpcs.xml, GrumPHPphpcs.xml). readme.txt documents migration usage.Reviewed by Cursor Bugbot for commit 76775d7. Bugbot is set up for automated code reviews on this repo. Configure here.