Skip to content

Overview: one truthful connection state, no other plugins' notices, numbers that fit, video button - #31

Merged
mostafasoufi merged 9 commits into
mainfrom
overview-review
Nov 3, 2026
Merged

mostafasoufi merged 9 commits into
mainfrom
overview-review

Conversation

@mostafasoufi

@mostafasoufi mostafasoufi commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

No release in this PR: version and changelogs are untouched. Merging does push readme.txt to WordPress.org right away (assets.yml, Stable tag 0.2.0 is released), so the two videos on the listing, the new screenshots and the YouTube disclosure go live at merge, before the new code ships in a release. The screenshots will show the new Video button until then.

The "Reconnect" card next to full data

Cause, from the code. Two separate faults made one picture:

  1. The screen drew both. Overview.tsx showed the Connect card when the key was marked revoked, and the data whenever a cached overview existed. Nothing tied the two together, so old data sat next to "Key revoked" with no word that it was old.
  2. The mark was wrong or stuck. key_state was set by any single 401 and only a successful POST cleared it. A read that worked (GET /overview 200) never did.

The 401 itself is not proof of a dead key. These answer 401 with a live key:

  • MonoRanks' connector routes say 401 when a key lacks that route's scope (apps/web/lib/connector-auth.ts:16 and :36). A key with sites:read but not content:write reads data fine and fails every send.
  • A request still running with the old key when the site is connected again. Worse, that request held the old connection in memory and could write it back over the new key.

Reproduced locally, with MonoRanks answers faked and nothing written:

Now (origin/main)
  POST /api/connector/content -> 401 (route needs content:write)
key_state after POST 401: revoked
  GET /api/connector/overview -> 200
key_state after GET 200: revoked

After fix
  POST /api/connector/content -> 401 (route needs content:write)
  GET /api/v1/sites/site_demo/scores -> 403 (live key, missing scope)
key_state after POST 401: ok
  GET /api/connector/overview -> 200
key_state after GET 200: ok

Not known: which path hit the live site. It was not touched, and a truly revoked key with cached scores gives the same picture. After this update the screen settles it by itself: the key is asked about again within 5 minutes. If "Key revoked" is still there, the key really is revoked.

The fix

  • A working read clears the mark. A 401 only counts after API v1 confirms it (401 there means unknown or revoked, 403 means alive). Where that API is off the 401 stands. An unreachable MonoRanks proves nothing.
  • A 401 for a key that is no longer the stored one is ignored, and Connection::update reads the database first, so a late request cannot bring back an old or removed key.
  • A key that really is revoked shows Connect, a warn chip "Old data · Updated 3 days ago", the last scores and Recent changes. No Send content, no fixes, no "What to do next". Actions::apply refuses on the server too.
Before After (key really revoked)

Other plugins' notices

src/Notices.php, on the two MonoRanks screens only: right before WordPress prints notices, every callback whose code is not in wp-admin/, wp-includes/ or this plugin is taken off the hooks for that request. Notices printed outside those hooks or added by a script stay hidden.

Checked with fake plugin notices (class method, closure at the highest priority, all_admin_notices, printed in in_admin_header, injected by script):

  • Overview and Settings: none of them visible. Core's "WordPress 99.0 is available" nag visible.
  • Dashboard: all still visible, untouched.

Numbers that fit

From 10,000 a tile number is compact (+10.6K, 30.9K, ۳۰٫۹ هزار) with the whole number in a tooltip. Tiles and card rows now wrap by the room they really have, not by window width, so an open admin menu no longer breaks them.

Before (1100 px) After (1100 px, same numbers)

Same data: 10,556 won, 6,583 lost, 30,896 linking sites. Hover shows the whole number.

Checked by script with Playwright (Chrome window never resized): Overview and Settings, en and fa, 1280, 1024, 961, 782 and 390 px, with 30,896 / 10,556 / 6,583 backlinks and 1,248,003 clicks: no clipped or spilling text, no sideways page scroll. Also the revoked state in fa, and dark at 1024.

The same pass found and fixed: the top bar overflowing at 390 px, hidden tooltips making the page scroll sideways in RTL, and the Pages to fix table squeezing titles at 390 px (the severity pill and column names step aside there).

Video button

"Video" with a small play icon in the top bar, just before Help, on Overview and Settings. Shown only while MONORANKS_VIDEO_ID is valid. The card from earlier commits is gone, with its poster, dismiss route and user setting.

  • Click: a centered dialog over everything, the admin bar included. 16:9, up to 960px, fits small and landscape screens. Close with X, Esc or a backdrop click. Focus stays inside and returns to the button.
  • Zero requests to YouTube before the click (checked in the browser). Modifier-click or no JavaScript: a plain link to YouTube.
  • At 480px and under the button shows only its icon, so the top bar fits. The label stays for screen readers.
  • Esc works while focus is on the dialog. Once someone clicks inside the player, the keyboard belongs to YouTube, so X or the backdrop close it.
  • readme.txt: "External services" covers YouTube with terms and privacy links, the overview video sits under the opening line of the description, and the setup video at the top of Installation. No "Unreleased" text.

Checked at 1280, 782, 390 and 844x390, en and fa. Playback itself was not watched: from the test browser YouTube answered 200 and then asked for a sign-in as a bot check.

Listing screenshots

New design, same four screens and order as the readme captions, in .wordpress-org/: screenshot-N.png, screenshot-N-de.png, screenshot-N-es.png, screenshot-N-fa_IR.png. Names follow the plugin assets handbook. Taken with Playwright on a throwaway clean WordPress with example data, so the local site's language was never changed. Post titles and other example content stay English in every language.

Merging also pushes all of these to WordPress.org right away (assets.yml).

German and Spanish translations

No person has read these. They are machine-drafted and should be reviewed by a native speaker.

  • 289 strings each, all but the plugin's two URLs and author name. Bundled the same way as Persian: languages/monoranks-de_DE.* and monoranks-es_ES.*.
  • Terms follow apps/web/messages/de.json and es.json, including their forms of address: German "Sie", Spanish "tú". Placeholders are checked by script against the English.
  • readme.txt is not translated: the plugin has no such convention, and that happens on translate.wordpress.org.
  • Only de_DE and es_ES are covered. Other variants (de_AT, es_MX and so on) stay English. A language pack from translate.wordpress.org wins over these files when one exists.
  • "Review" uses Prüfen / Revisar here, not the app's Vergleich / Comparativa, which means a comparison in the app. Fixes are "Korrekturen" / "Correcciones".

Checked by script, de, es, en and fa, 1280, 782 and 390 px, with data, not connected and revoked, details open: no spill, no sideways scroll, no button over three words in de or es. Posts hover card and editor box checked in de and es.

Long words showed real gaps, now fixed in every language:

  • the top bar wraps at 390 px; the page and change tables give their buttons room, and Undo is icon-only at 480 px and under;
  • change lines ("+8% vs last 28 days") wrap instead of spilling; the Posts hover card is wider and its links wrap;
  • German has no short form for thousands (10.556 stays whole), so a longer tile number takes a smaller size and never breaks inside the digits.

Not changed in Persian: "Delete all data" is four words, and the AI rules label is cut with a tooltip in the change list at narrow widths.

Fixed in the review

  • "Content sent" showed even when the send failed or the key was refused.
  • Recent changes showed term:category:12 for category pages, and an empty row for a deleted post.
  • Undo was refused after a value that had been cleaned on save (image text, redirects, AI rules, llms.txt): the log kept the raw value.
  • MonoRanks unpairing left the results behind, and Settings kept showing "Next check" after it.
  • Settings had no Connect button on a revoked key.
  • The key hint told people to tick only content:write, which makes every read fail. It now names all three scopes.
  • Settings showed raw error text such as http_500 on a badge. Now "Last try failed", with the raw text on hover.
  • "1 published items sent". "Check the address" on sites that have no address field. Five two-sentence lines on empty cards, now one short line. Posts list count in Latin digits on fa.
  • All new and changed text is in the Persian catalogue. The only untranslated strings are the plugin's URLs and author name.

Not changed

Bugs and behaviour

  • apps/web/lib/connector-auth.ts:16,36 (app repo): missing scope should answer 403, not 401. This is the other half of the cause; the plugin now copes either way.
  • src/Api.php:36: any successful POST moves "Last sent" (status, change alerts, fix reports), not only content.
  • src/Column.php:66, src/PostPanel.php:85: with a revoked key the Posts list and the editor box still show old scores without saying so.
  • resources/admin/src/screens/Overview.tsx:303: a key that works but cannot read scores shows "MonoRanks not reached" while waiting for its first check.
  • src/Writer.php:65: a redirect to its own source is not refused and would loop. Only approved values reach it.
  • src/AiAccess.php:77: /llms.txt is not served on a site installed in a subfolder.
  • src/Actions.php:41: a new key for a different website keeps the old results until the next pull.
  • src/Insights.php:118: opening a MonoRanks screen can wait up to about 14 seconds on a slow MonoRanks when the cache is stale.
  • resources/admin/src/components/ui/tip.tsx:25: an open tooltip near the screen edge can be cut at 390 px. The whole number on a big tile opens from its start edge, so it is safe.

Text and translation

  • resources/admin/src/screens/Settings.tsx:93: "Next check" removes the date by looking for (, so a translation using other brackets would show it in full.
  • src/Overview.php:76: "Image Purge page caches after every write; report it in the result (0.1.18) #12" keeps Latin digits on fa.
  • resources/admin/src/screens/Settings.tsx:89: the hover text on "Last try failed" is still raw English.
  • resources/admin/src/screens/Grow.tsx:155 and others: strings with placeholders in the app have no translator comments (the extractor warns).
  • On wordpress.test some labels stay English in fa (Description, Image text) because an older language pack in wp-content/languages/plugins wins over the bundled file, which does have them. On real sites this depends on translate.wordpress.org.

WordPress.org risks (none blocking; 0.2.0 passed)

  • src/AuthorizeScreen.php:38: prints a <style> tag instead of enqueuing it. Reviewers often flag this.
  • src/Admin.php:55: one redirect after activation. Allowed and limited, but a common review comment.
  • uninstall.php:9: cleans the current site only, not every site of a network.
  • src/Rest.php:18: the public ping route shows the plugin version and whether the site is connected. Explained in the code, not in the readme.

Tests

  • Unit: 141 pass, with new NoticesTest and VideoTest plus new cases in ApiTest and ConnectionTest.
  • Integration on a throwaway WordPress 7.1.4: 24 run, 5 skipped (The SEO Framework not installed), with new OverviewLogTest.
  • npm run typecheck and npm run build pass; build/ is committed.
  • Browser checks ran against http://wordpress.test through a temporary cookie-only helper with faked options, removed afterwards. No data changed there.
  • tests/e2e was not run locally (needs Docker). CI runs it.

Suggested changelog for the release

* **New:** German and Spanish translations.
* **New:** A "Video" button in the top bar. YouTube loads only when you press it.
* **Enhancement:** Other plugins' notices no longer show on the MonoRanks screens.
* **Enhancement:** Big numbers stay readable at every screen size, also in right-to-left languages.
* **Fix:** The Overview no longer says "Key revoked" next to live data. A revoked key now shows clearly old data.
* **Fix:** "Content sent" shows only when it was sent.
* **Fix:** Undo works for values that were cleaned when saved.

…umbers that fit, video card

- Other plugins' admin notices no longer show on the MonoRanks screens. WordPress's own stay.
- "Key revoked" next to live data is gone: a working read clears the mark, a 401 is checked before it counts,
  and a really revoked key shows Reconnect plus clearly old scores, nothing else.
- Backlinks and other big numbers never clip: compact from 10,000 with the whole number in a tooltip, tiles wrap
  by the room they have, with the admin menu open and in RTL.
- "Watch how it works" card, off until MONORANKS_VIDEO_ID is set. YouTube loads only on click, disclosed in readme.txt.
- Review fixes: false "Content sent", raw category ids in Recent changes, Undo refused after a cleaned value,
  unpair leaving results behind, Settings without Connect on a revoked key, raw errors, long empty-card lines.
…tead of the card

The card, its poster, the dismiss route and the user setting are gone. readme.txt: the YouTube paragraph matches, and the video sits under the description's opening line.
@mostafasoufi mostafasoufi changed the title Overview: one truthful connection state, no other plugins' notices, numbers that fit, video card Overview: one truthful connection state, no other plugins' notices, numbers that fit, video button Nov 3, 2026
…der docs; PR before and after shots

WordPress.org takes screenshot-N-de.png and -es.png, but the plugin has no German or Spanish translation yet, so those stay out of .wordpress-org.
Machine-drafted with the app's terms; no person has read them yet. Bundled like Persian: languages/monoranks-de_DE and -es_ES.
Long words showed real layout gaps, so the top bar wraps on phones, the change log and page tables give their buttons room,
changes and tile numbers no longer spill (German keeps 10.556, so a longer number takes a smaller size), and the Posts hover card is wider.
@mostafasoufi
mostafasoufi merged commit 6319db4 into main Nov 3, 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