From 4c3f0c61bbcebcdc38e53ef05416fd3918f78485 Mon Sep 17 00:00:00 2001 From: "Dave (translate via Sonnet 4.6)" Date: Thu, 5 Nov 2026 22:38:57 -0700 Subject: [PATCH] fix: harden frontend account returns and empty-card rendering --- DESIGN.md | 4 ++++ .../frontend-account-example-source.md | 20 ++++++++++++------ static/downloads/frontend-account-example.zip | Bin 7072 -> 7239 bytes static/downloads/frontend-account/canvas.php | 5 +++-- static/downloads/frontend-account/portal.css | 2 -- .../frontend-account/ums-account-example.php | 13 ++++++++++-- 6 files changed, 32 insertions(+), 12 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index c98aa03ac..a4b8f9535 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -31,6 +31,10 @@ page markup and scoped CSS together in the downloadable package. - Guests see sign-in/recovery guidance, not empty private widgets. Exclude all account/checkout routes from upstream caching as well as sending no-cache headers. Presentation gating never replaces model ownership checks. +- Guest sign-in and recovery preserve the validated local request path and query, + including selected-site and membership context; do not accept external returns. +- Remove only completely empty example-owned card wrappers after native content + renders. Never hide populated cards based on internal widget class names. Screenshot assets show synthetic data and actual rendered product states, not reconstructed UI. Use viewport captures (at most 1568px on the longest diff --git a/docs/user-guide/client-management/frontend-account-example-source.md b/docs/user-guide/client-management/frontend-account-example-source.md index 66f34ebd4..c32eed2c5 100644 --- a/docs/user-guide/client-management/frontend-account-example-source.md +++ b/docs/user-guide/client-management/frontend-account-example-source.md @@ -20,7 +20,7 @@ build step is required. Do not put PHP in page content or edit Ultimate Multisit /** * Plugin Name: Ultimate Multisite Account Page Example * Description: An optional presentation layer for native Ultimate Multisite shortcodes. - * Version: 1.0.0 + * Version: 1.0.1 * License: GPL-2.0-or-later * Text Domain: ums-account-example */ @@ -47,9 +47,18 @@ add_action('template_redirect', function () { add_action('wp_enqueue_scripts', function () { if (ums_account_example_is_page()) { - wp_enqueue_style('ums-account-example', plugins_url('portal.css', __FILE__), [], '1.0.0'); + wp_enqueue_style('ums-account-example', plugins_url('portal.css', __FILE__), [], '1.0.1'); } }); + +add_filter('the_content', function ($content) { + if (!ums_account_example_is_page()) { + return $content; + } + + // After blocks/shortcodes render, omit only our own completely empty cards. + return preg_replace('/]*\sclass="[^"]*\bums-card\b[^"]*"[^>]*>\s*<\/div>/', '', $content); +}, 20); ``` ### `canvas.php` @@ -79,12 +88,13 @@ defined('ABSPATH') || exit;
+

- - + +
@@ -132,10 +142,8 @@ body.ums-account-canvas { margin: 0; background: #f7f8f5; } .ums-section-heading > span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .13em; } .ums-section-copy { color: var(--muted); margin: -4px 0 20px; font-size: 14px; max-width: 640px; } .ums-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; min-width: 0; } -.ums-card:empty { display: none; } .ums-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } .ums-site-detail { display: grid; gap: 20px; margin-top: 20px; } -.ums-site-detail > .ums-card:not(:has(.wu-current-site)), .ums-detail-grid > .ums-card:not(:has(.wu-styling)), .ums-invoices:not(:has(.wu-invoices)) { display: none; } .ums-invoices { margin-top: 20px; } .ums-portal .wu-styling { font-family: inherit; font-size: 14px; line-height: 1.6; } .ums-portal .wu-styling h3 { font-size: 16px; color: var(--ink); } diff --git a/static/downloads/frontend-account-example.zip b/static/downloads/frontend-account-example.zip index 5e69cb8f5106b069382d166dbf72f34bed91a2b4..065735697fc966519ce0283ea8fd283fbbe60b58 100644 GIT binary patch delta 3938 zcmV-o51sI!H^(@z7YGRubv6xV0{{TzlOPBte^%db+cpq>j{l0QRzPwP$H?m<*=UCh z+taqBT~QQ+KuKqbFhz1CWhX%Y_#G+BP}Fn^&?l4B-FM&pcDmJ#UaT)K;ScS&l1zYR zHA2bcf!SMNLI5jE)ky~xb8O8@FJ{4D%eVx|96umv(baTQoztDWhRgM$!X1}bCGorW ze-D4Y`|w-5gs)!#AGy0-Y&YqfN|o+OBQ&lRn?>q>AoXNGFj;rR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account/canvas.php index 15214858e..cea7e0534 100644 --- a/static/downloads/frontend-account/canvas.php +++ b/static/downloads/frontend-account/canvas.php @@ -22,12 +22,13 @@
+

-
- + +
diff --git a/static/downloads/frontend-account/portal.css b/static/downloads/frontend-account/portal.css index 93d041f7f..730aa36c6 100644 --- a/static/downloads/frontend-account/portal.css +++ b/static/downloads/frontend-account/portal.css @@ -33,10 +33,8 @@ body.ums-account-canvas { margin: 0; background: #f7f8f5; } .ums-section-heading > span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .13em; } .ums-section-copy { color: var(--muted); margin: -4px 0 20px; font-size: 14px; max-width: 640px; } .ums-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; min-width: 0; } -.ums-card:empty { display: none; } .ums-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } .ums-site-detail { display: grid; gap: 20px; margin-top: 20px; } -.ums-site-detail > .ums-card:not(:has(.wu-current-site)), .ums-detail-grid > .ums-card:not(:has(.wu-styling)), .ums-invoices:not(:has(.wu-invoices)) { display: none; } .ums-invoices { margin-top: 20px; } .ums-portal .wu-styling { font-family: inherit; font-size: 14px; line-height: 1.6; } .ums-portal .wu-styling h3 { font-size: 16px; color: var(--ink); } diff --git a/static/downloads/frontend-account/ums-account-example.php b/static/downloads/frontend-account/ums-account-example.php index 17e51de14..a87b25571 100644 --- a/static/downloads/frontend-account/ums-account-example.php +++ b/static/downloads/frontend-account/ums-account-example.php @@ -2,7 +2,7 @@ /** * Plugin Name: Ultimate Multisite Account Page Example * Description: An optional presentation layer for native Ultimate Multisite shortcodes. - * Version: 1.0.0 + * Version: 1.0.1 * License: GPL-2.0-or-later * Text Domain: ums-account-example */ @@ -29,6 +29,15 @@ function ums_account_example_is_page() { add_action('wp_enqueue_scripts', function () { if (ums_account_example_is_page()) { - wp_enqueue_style('ums-account-example', plugins_url('portal.css', __FILE__), [], '1.0.0'); + wp_enqueue_style('ums-account-example', plugins_url('portal.css', __FILE__), [], '1.0.1'); } }); + +add_filter('the_content', function ($content) { + if (!ums_account_example_is_page()) { + return $content; + } + + // After blocks/shortcodes render, omit only our own completely empty cards. + return preg_replace('/]*\sclass="[^"]*\bums-card\b[^"]*"[^>]*>\s*<\/div>/', '', $content); +}, 20);