Skip to content

fix(cloud): connected is not covered (#994) - #87

Open
cport1 wants to merge 1 commit into
mainfrom
fix/994-connected-is-not-covered
Open

fix(cloud): connected is not covered (#994)#87
cport1 wants to merge 1 commit into
mainfrom
fix/994-connected-is-not-covered

Conversation

@cport1

@cport1 cport1 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Companion to WebDecoy/app#994, whose requirement this closes on the plugin side:

A plugin activation or successful OAuth redirect alone is not proof of coverage.

What it said

On a successful exchange:

WebDecoy Cloud: Connected to WebDecoy Cloud (Acme Ltd). Cloud features are now active.

What had happened is that credentials were stored. Whether the site is covered is a different fact, and at that moment an unknown one — nothing from the site has been received yet. The journey then ended there, in wp-admin, with a claim nobody had checked.

What it says now

WebDecoy Cloud: Connected to WebDecoy Cloud (Acme Ltd). Your next page view sends the first report; until one arrives the cloud has nothing from this site. [Watch for the first report]

The link goes to /onboarding/setup, where the app already polls install state and distinguishes waiting, reporting and silent. So the journey now ends where the claim can actually be confirmed.

The disconnect notice already got this right — "Disconnected from WebDecoy Cloud. Local protection remains active." — and is unchanged. It is the model for the tone.

Implementation notes

  • Notices gained an optional link. The message is still escaped as text; the link is built from esc_url + esc_html rather than carried as markup, because a notice that accepted HTML would be a place for some to arrive.
  • connected_notice_message() is public and static so the claim can be asserted without a WordPress runtime. The regression worth guarding is the wording, not the plumbing.
  • tests/bootstrap.php gains a guarded pass-through for __(), so the WordPress-free suite can read the English source strings. It is inert inside WordPress, where the real function is defined and is the one used.

Tests

The notice says a report is still to come, and claims neither "now active" nor "protected", with and without an organization name. Verified by putting the old wording back and watching it fail.

php tests/run.php — 96 passed, 0 failed. phpcs clean. phpstan clean (needs -d memory_limit=1G locally; the default limit dies parsing an unrelated generated file).

Release

Not released. This changes user-visible copy, so it wants a version bump and the usual bin/release-all.sh run — your call on when.

On a successful exchange the plugin said "Cloud features are now active."
What had happened was that credentials were stored. Whether this site is
covered is a different fact and, at that moment, an unknown one: nothing
from the site has been received. It is the same mistake as treating an
OAuth redirect as proof of an install, which is what WebDecoy/app#994
exists to stop.

The notice now says what happened and what has not happened yet, and
carries a link to the screen in the app that watches for the first
report. The journey used to end here, in wp-admin, with a claim nobody
had checked; it now ends where the claim can be confirmed.

Notices gained an optional link. The message is still escaped as text and
the link is built from esc_url + esc_html rather than carried as markup,
because a notice that accepted HTML would be a place for some to arrive.

connected_notice_message is public and static so the claim can be
asserted on without a WordPress runtime, which is the whole point: the
regression to guard is the wording, not the plumbing. tests/bootstrap.php
gains a guarded pass-through for __() so the WordPress-free suite can
read the English source strings; it is inert inside WordPress, where the
real function is defined and is the one used.

The disconnect notice already got this right -- "Disconnected from
WebDecoy Cloud. Local protection remains active." -- and is unchanged.

Tests: the notice says a report is still to come and claims neither "now
active" nor "protected", with and without an organization name. Verified
by putting the old wording back and watching it fail.

Claude-Session: https://claude.ai/code/session_017jwQyaJfkKsp2CgLbi9g7x
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