Add migration status tracking, PHPCS, CI, and replace AJAX with REST#1
Add migration status tracking, PHPCS, CI, and replace AJAX with REST#1
Conversation
Adds phpcs.xml.dist configuration, GitHub Actions workflow for PHP linting, and PHPCS dev dependencies in composer.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add MigrationStatus class for querying per-migration execution history
- Log migration start/complete/failed in MigrationManager::do_upgrade()
- Add get_progress() to BackgroundProcess for completion ratio tracking
- Add REST endpoint GET {prefix}/v1/migration/status
- Update developer guide with status API and progress documentation
- Add comprehensive tests for all new functionality
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove DismissalHandler (AJAX dismissal) and merge dismiss endpoint into NoticeRESTController as POST /notices/dismiss - Extract migration REST endpoints from MigrationHooks into dedicated MigrationRESTController with GET /migration/status and POST /migration/upgrade - Rename NotificationHelper::ajax_action() to rest_action() with REST-oriented signature (endpoint, method, nonce) - Add WP REST class stubs to test bootstrap for Brain\Monkey compat - Update tests and developer guide to reflect all changes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughReplaced AJAX admin flows with REST endpoints for migrations and notices; added MigrationRESTController, MigrationStatus, migration logging and progress tracking; removed DismissalHandler and AJAX upgrade hook; updated NotificationHelper to rest_action; added PHPCS and PHPUnit CI workflows, PHPCS config, and corresponding tests/bootstrap updates. Changes
Sequence Diagram(s)sequenceDiagram
rect rgba(220,240,255,0.5)
participant Client as "Client (Admin UI)"
participant REST as "WP REST API"
participant MigrationCtrl as "MigrationRESTController"
participant Manager as "MigrationManager"
participant Status as "MigrationStatus"
end
Client->>REST: GET /migration/status
REST->>MigrationCtrl: get_status(request)
MigrationCtrl->>Manager: get_status()
Manager->>Status: build summary & log
Status-->>Manager: summary + log
Manager-->>MigrationCtrl: status data
MigrationCtrl-->>REST: 200 {status}
REST-->>Client: 200 {status}
sequenceDiagram
rect rgba(230,255,230,0.5)
participant AdminUI as "Admin UI"
participant REST as "WP REST API"
participant NoticeCtrl as "NoticeRESTController"
participant Options as "Options Store"
end
AdminUI->>REST: POST /notices/dismiss {key, nonce}
REST->>NoticeCtrl: dismiss_notice(request)
NoticeCtrl->>Options: get_option({prefix}_dismissed_notices)
Options-->>NoticeCtrl: [keys]
NoticeCtrl->>Options: update_option({prefix}_dismissed_notices)
Options-->>NoticeCtrl: OK
NoticeCtrl-->>REST: 200 {success:true}
REST-->>AdminUI: 200 {success:true}
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
…er config Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The `static` return type requires PHP 8.0+ but the package supports PHP 7.4+. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
str_starts_with() requires PHP 8.0+ but the package supports PHP 7.4+. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add file-level doc comments with @Package tags to all source files - Add missing short descriptions to constructor doc blocks - Add missing @param and @throws tags to method doc blocks - Fix Yoda conditions and replace short ternaries - Fix multi-line function call formatting in QueryResult - Suppress DirectDatabaseQuery/PreparedSQL rules for query builder files in phpcs.xml.dist (false positives for internal $wpdb->prepare usage) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix equals sign alignment in SqlQuery, BaseDataStore, and BaseModel - Suppress reserved keyword parameter name warnings (namespace, object, class are valid names in this context) - Suppress unused function parameter warnings (required by WP filter callbacks and REST handler signatures) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
phpcs.xml.dist) and CI lint workflowMigrationStatusclass for tracking per-migration execution state (pending, running, completed, failed) with summary, log, and timingget_progress()) toBackgroundProcesswith total/processed/percentageMigrationRESTControllerwithGET /migration/statusandPOST /migration/upgradeendpointswp_ajax_hooks with REST API endpoints across the packageDismissalHandler— dismiss endpoint merged intoNoticeRESTController(POST /notices/dismiss)MigrationHooksintoMigrationRESTControllerNotificationHelper::ajax_action()→rest_action()Test plan
grep -r 'wp_ajax\|check_ajax_referer\|ajax_action\|ajax_data\|wp_send_json' src/returns no matches🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests
Chores
Breaking Changes