Repository navigation
feat(cms): connect a brand's WordPress site from Settings › Integrations (#1331) - #1571
Merged
Merged
Conversation
…ord and send pages to it as draft posts (ansvisor#1331) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… read when the Library opens and daily (ansvisor#1331) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ons (ansvisor#1331) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ss-server # Conflicts: # server/src/lib/content-delivery.test.js # supabase/schema.sql
This was referenced Oct 27, 2026
7 of 12 tasks
7 of 12 tasks
7 of 12 tasks
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… has ended Since ansvisor#1589 a workspace whose plan has ended can't write, but taking back an outside account's access stays open (COST_STOPPING), as Webflow's disconnect does. WordPress's disconnect revokes the Application Password where the site allows, so it joins the list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s-published Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ress-web Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
Merged #1570's new head in (acc9086). |
…space is read-only Connect and Change sign-in open it before anything is sent, and a connect or disconnect the API refuses for the plan opens it instead of saying WordPress couldn't be reached. Disconnect stays open, as Webflow's.
4 of 12 tasks
gkhngyk
approved these changes
Oct 28, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good with 3f79126: I opened the plan dialog from the WordPress card in a read-only workspace
Reviewed this PR's own change (#1570's head da8e326 → acc9086). It merges clean on main cfd8a35, but was written before main's read-only workspace (#1599, #1609).
What I changed (main merged in, then one commit)
- In a workspace whose plan has ended, the card said "Couldn't reach WordPress. Try again later." for a connect: the client mapped the API's
subscription_inactivetofailed. Now it works the way the Webflow card does. Connect and Change sign-in open the plan dialog before anything is sent. A connect or disconnect the API refuses for the plan opens the dialog instead of a toast. Disconnect stays open, since it only ends an access. - Tests:
wordpress-client.test.tsmaps a 402subscription_inactivetosubscription. Two new card tests cover a refused connect and disconnect, and the read-only gate (Connect and Change sign-in blocked, Disconnect still works). Without the fix, all three fail.
What I checked
- The password field is
type="password"withautoComplete="new-password". It's cleared after a connect and never shown again. The API answer has no password to show. - Connect, Change sign-in and Disconnect show for admins and managers only (
canManage). The server enforces this too (#1569). Members see where pages go. - A connection read for one brand never shows under another (
read.brandId === activeBrandId). - English copy: the error texts cover every code the client names. A missing one fails typecheck through
ERROR_TEXTS. - Tests on this tree:
wordpress-cardandwordpress-client(16 passed). Webtsc, eslint and prettier are clean.
Follow-ups
SignInFormisn't keyed by brand. Switching brands while both show the form keeps what was typed for the first brand, and Connect would then send it for the second.key={activeBrandId}on the form fixes it.
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.
Summary
Send to CMS, phase 2 (#1331): WordPress, part 3: the Settings › Integrations card. It sits below Webflow's and follows its layout.
Stacked on #1570, which is stacked on #1569. This PR's own change is its last commit, web only.
Admins and managers connect the active brand's site with three fields:
/wp-adminand/wp-jsontaken off.autocomplete="new-password", so the browser's password manager doesn't offer the person's saved Ansvisor password here, which would then go to the WordPress site.The hint says where to make the password (Users › Profile › Application Passwords). It also suggests a separate Author user, since Ansvisor writes drafts only.
The API checks the site before anything is kept (#1569). Each reason has its own message (
settings.wordpress.errors):What's typed stays in the form on a failure, the password included. Cancel is off while the site is checked.
The API's
invalid(an address it can't take, or a field the form didn't fill right) says to check both the https address and that the Application Password is WordPress's.The redirect message covers both cases. If the address is WordPress, use the address
/wp-json/goes to; if it isn't, there's no WordPress there. Found in the browser: Webflow, likewww.ansvisor.com, redirects/wp-json/to drop the slash.Connected, the card shows:
A refused sign-in shows Sign-in refused, with a note. The form is filled in with the site and user as they were, to paste a new password.
Members see where pages go, or that it isn't connected, with no form or buttons. A server without
CONNECTOR_CREDENTIALS_KEYsays WordPress isn't set up. A failed read says it couldn't be read.lib/wordpress-client.tscalls the API through the same-origin proxy, aswebflow-client.tsdoes. The password goes from the browser to the API once, never through a server action. Strings are inen.json(settings.wordpress).Next: part 4, the Send dialog's WordPress target (editor, Library row, bulk), the Library reading
/wordpress-status, and the "went as a new draft" note for a live post. Then the docs.Related issue
Part of #1331 (phase 2, WordPress). Stacked on #1570 → #1569.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd web && yarn vitest run src/components/settings/wordpress-card.test.tsx src/lib/wordpress-client.test.tsCONNECTOR_CREDENTIALS_KEYset), open Settings › Integrations as an admin. Below Webflow, the WordPress card asks for the site, a user and an Application Password.Checked in the browser (this branch's API and web, against the dev DB with 00294) at 1024 px, light and dark:
www.ansvisor.comandansvisor.com(our own Webflow site): the redirect message, with no password sent;Screenshots follow in a comment.
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run:
yarn format,yarn lint(0 errors),yarn typecheck,yarn test(4,108 tests) andyarn buildinweb/. After the pre-push review's fixes (the password field, the short-password hint, Cancel while checking, a disconnect while changing the sign-in, theinvalidwording, and tests for a brand switch and a revoked password), I ran the card's tests, eslint, typecheck and the format check again.ERROR_TEXTS: Record<WordPressError, string>in the test makes a missing error string a typecheck error.🤖 Generated with Claude Code