Repository navigation
Conversation
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.
What
Fixes four defects in cross-site user management: delete requests never reaching brand sites, a fatal error on every brand-site request, an incorrect way of saving passwords and names on user creation, and toast positioning.
Why
Each failed silently or broke a flow outright:
wp_safe_remote_request()refused to send it.Call to undefined function wp_get_current_user().Related Issue(s):
AI Disclosure
Self + Opus 5.5 for fix testing & validation
Issues Fixed
',",<broke login); single-word names warned.Behaviour changes
\(as in core).X-OneAccess-Site-URL; update governing and brand sites together.Testing Instructions
Setup: a governing site and a brand site on different URLs (or the wp-env pair:
npm run wp-env start→ 8888,npm run wp-env:child start→ 8890).Pairing & auth
/wp-admin/→ no fatal error.401, and the brand's governing URL is unchanged:curl -H "X-OneAccess-Token: <brand key>" -H "Origin: https://evil.example" https://<brand>/wp-json/oneaccess/v1/health-checkCreate user
4. Manage Users → Create User with password
it's a "test" <pw>and a single-word full name → created on the brand. Log in on the brand'swp-login.phpwith the password exactly as typed.5. Try a password containing
\→ the notice shows "Passwords cannot contain the "" character." (not a generic error). A password under 8 characters is rejected too.Add to sites / role update (broken on
mainby #124)6. Users → User actions → Add to Sites → the user is created on the selected brand site.
7. Users → User actions → Manage Roles → change the role → it changes on the brand site.
Delete
8. Users → User actions → Delete from the brand site → the user is removed there and the row disappears.
9. Partial failure: stop or disconnect one brand site (e.g. change its API key in Settings), then delete a user from two sites → the notice lists the failing site, the other site is deleted, and the list refreshes. In DevTools → Network, the
delete-user-from-sitesresponse has no raw HTTP response inerror_log.10. On the brand, create a different user with the same username but another email → deleting the shared user from the governing site leaves that user untouched.
Toasts
11. Trigger one notice, then several at once (e.g. create a user on two sites) → they stack bottom-right without overlapping, and dismissing one doesn't clear the others.
Screenshots
Checklist