You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Settings across global styles, colors, typography, editor preferences, and welcome tools now save through WordPress’s REST API. Existing settings and save behavior are preserved.
Guided-tour progress, tooltip preferences, and notice dismissals continue to be saved.
Settings are fetched without waiting for the legacy API to load.
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
📝 Walkthrough
The pull request replaces WordPress settings-model requests with apiFetch requests across editor, global settings, and welcome flows. It updates script dependencies, changes the settings-fetch path, and removes the Jest stub for the WordPress API.
Changes: Settings API migration
Layer / File(s)
Summary
API setup and migration popup src/deprecated/v2/init.php, src/init.php, src/welcome/index.php, jest.config.js, src/test/wp-api-stub.js, src/util/admin.js, src/plugins/v2-migration-popup/*
Script dependencies switch to wp-api-fetch where needed. fetchSettings calls its REST endpoint directly, and the migration popup uses fetchSettings and apiFetch.
Global settings persistence src/plugins/global-settings/*
Global block styles, color schemes, colors, typography, and block layout settings are persisted with POST requests through apiFetch. Existing debounce or throttle timing and described store updates remain in place.
Component and welcome settings src/components/base-control2/label-tooltip.js, src/components/guided-modal-tour/index.js, src/deprecated/v2/welcome/admin.js, src/lazy-components/cimo/index.js, src/welcome/admin.js, src/welcome/import-export/index.js
Tooltip, guided-tour, Cimo notice, optimization, welcome, and imported settings use apiFetch to persist settings.
The settings API migration has no identified issue that needs resolution before merge. Normal checks can proceed.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 20 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: migrating WordPress API usage from wp-api to wp-api-fetch.
Linked Issues check
Issue #3768 requires migration of WordPress settings requests to apiFetch. The reviewed changes replace models.Settings reads and saves with apiFetch requests to /wp/v2/settings across the set…
Out of Scope Changes check
The reviewed changes stay within the migration scope. Import changes, request-flow updates, dependency-handle updates, fetchSettings changes, and removal of the obsolete wp-api test mapper and stu…
Full details: Linked Issues check
Explanation
Issue #3768 requires migration of WordPress settings requests to apiFetch. The reviewed changes replace models.Settings reads and saves with apiFetch requests to /wp/v2/settings across the settings, welcome, migration, guided-tour, tooltip, Cimo, and global-settings modules. The changes also update script dependencies from wp-api to wp-api-fetch and remove the obsolete test stub. Issue #3768 provides no additional coding or automated-test requirement.
Full details: Out of Scope Changes check
Explanation
The reviewed changes stay within the migration scope. Import changes, request-flow updates, dependency-handle updates, fetchSettings changes, and removal of the obsolete wp-api test mapper and stub directly support replacing the WordPress settings API with apiFetch. No unrelated feature or behavior change is identified.
Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The v2 migration popup in src/plugins/v2-migration-popup/index.js now loads settings with fetchSettings() (edit_posts). Save in migration-popover.js still posts to /wp/v2/settings, which needs an administrator. An Editor can open the popup, get 403 on Save, and the spinner never stops because it is cleared only in .then().
Please keep the read and the save on the same permission, and turn the spinner off when the save fails.
Also add one saveSettings helper next to fetchSettings in src/util/admin.js. The /wp/v2/settings POST is copied in about twenty files.
This branch has not been deployed
No deployments
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
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.
fixes #3768
Summary by CodeRabbit