Skip to content

Connect from the plugin with one link - #21

Merged
mostafasoufi merged 5 commits into
mainfrom
connect-link
Oct 16, 2026
Merged

mostafasoufi merged 5 commits into
mainfrom
connect-link

Conversation

@mostafasoufi

@mostafasoufi mostafasoufi commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

When the site is not connected, step 1 on Settings (and on the Overview connect card) now sends people straight to the MonoRanks connect page instead of the bare app.

  • Link: {api_base}/connect/wordpress?site=<home URL, no trailing slash>&return=<this plugin's settings page>, built in PHP (Settings::connect_url(), exposed as connect_url in the settings data and urls.connect in the admin bootstrap). Opens in a new tab. No UTM tags, since it points into the app.
  • Text: step 1 is now "Connect to MonoRanks" / "Sign in and approve. Takes a minute." / button "Connect". Step 2 (paste a key) keeps one short line for hosts that block Application Passwords.
  • Auto refresh: after Connect is clicked, Settings checks its own status every 4 seconds while the tab is visible (and right away when the tab comes back into view), for up to 10 minutes. Once MonoRanks approves, the page shows Connected without a reload.
  • Translations: catalogue regenerated (it was behind main) and Persian added for the new strings.

Example links:

  • https://example.com/ → https://app.monoranks.com/connect/wordpress?site=https%3A%2F%2Fexample.com&return=https%3A%2F%2Fexample.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dmonoranks-settings
  • https://example.com/blog/ → https://app.monoranks.com/connect/wordpress?site=https%3A%2F%2Fexample.com%2Fblog&return=https%3A%2F%2Fexample.com%2Fblog%2Fwp-admin%2Fadmin.php%3Fpage%3Dmonoranks-settings

Checks: PHP unit tests (90, two new for the link), tsc --noEmit, vite build. Checked in a WordPress Playground site with headless Playwright: the link is right, and the page switched to Connected about 4 seconds after a mocked approval. The wp-env e2e suite was not run because Docker is paused on this machine.

No version bump or changelog entry; the release step adds those.

Approve screen branding: on WordPress's own Authorize Application screen, when the request's app_id is MonoRanks' (6f1c1b5e-3f7a-4d8e-9a51-7a2b0c4e8d10), the wp_authorize_application_password_form hook prints the MonoRanks logo, the line "Reads your content and applies only fixes you approve.", and a little CSS for that page only (the approve button in our dark colour). WordPress's text and its Yes and No buttons are not changed, and no core file is edited. Other apps get nothing (unit tested; the matching is on the app id only, not the name).

@mostafasoufi
mostafasoufi merged commit dfb0844 into main Oct 16, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant