FlexPlat logoFlx Modernize

Step 7: Safety checks

Looking right is half the job. The other half is proving that Flx never shows the wrong page to the wrong person, and never sends visitor data out.

The rules (as implemented in the plugin)

Rule Where
Only anonymous visitors get Flx; logged-in users always get WordPress Renderer::is_eligible_visitor()
Only GET/HEAD HTML requests; never feeds, embeds, robots, favicon, trackbacks Renderer::is_page_request()
Never previews, drafts, private or scheduled content page/post guards in build_render_request()
Never a post with a password, even after the visitor entered it Renderer::is_password_protected()
Page data built as user 0 Route\AnonymousContext
No visitor query string in URLs sent to the renderer ArchivePayloadBuilder::without_visitor_query_args()
Cache-Control: private, no-store on Flx pages; no-store on fallbacks; DONOTCACHEPAGE Renderer::send_cache_control()
The filter can only turn Flx off Renderer::should_render()

Prove them end to end

tests/eligibility/check-eligibility.sh runs in CI after the fidelity check. It points the plugin at a capture server (capture-server.mjs) that records every request WordPress sends and answers with a marker page. It then checks 45 things, including:

  • an anonymous visit gets the marker page with private, no-store and no Set-Cookie;
  • probe cookies, a tracking query string and a probe user agent never reach the capture log;
  • a logged-in visit, a password post (with and without the password cookie), a logged-in draft preview and a feed all get native WordPress, with the renderer never called;
  • an anonymous draft becomes a rendered 404 without the draft's content;
  • with the renderer down, the page is native with no-store.

Write every check so it can fail. Assert the status code and real native content, not just "the marker is absent". A redirect has no marker either, and on Twenty Twenty-Five an early version of the preview check passed without exercising a preview at all. The stricter version also caught a real leak: archive URLs carried the visitor's query string.

Check: the eligibility step prints eligibility check: all passed; break a rule on purpose (comment out the logged-in check) and it must fail.

Published from rickey29/twenty-twenty-five at commit 2541c1d · Flx Modernize 1.0.0 · Flx Render 1.0.0