From 8143d146e4e262510551d7e66e0e625b2553c1c5 Mon Sep 17 00:00:00 2001 From: kristianwind Date: Wed, 23 Sep 2026 17:21:44 +0200 Subject: [PATCH] 1.6.1: shared-menu 1.2.3, and render the dashboard to check the pill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The status pill on the shared dashboard is white 11px text over a light overlay. SEO measured it two ways, arithmetic and a canvas read-back in headless Chromium: this plugin's #1a7a52 gave 3.50:1 against a 4.5 minimum, and six of eight family colours failed along with the no-colour fallback. Not fixable by choosing a different card colour. The header is a direct pair and passes at 5.32:1; the pill is a COMPOSITE, and 22% white is a floor — a card has to reach about 7.7:1 before the pill clears 4.5, which is above the whole family band. So it is the shared file or seven plugins giving up the colour the cards exist to carry. 1.2.3 makes the overlay rgba(0,0,0,.18) and this plugin's pill goes to 7.15:1. Verified before copying: the hash, and php -w over both files to confirm the executable code really changed — the diff is the version constant and that one CSS value, nothing else. The new assertion renders the dashboard and reads the pill out of what came back, and it is built around the trap SEO warned about: their first harness printed "no problem" over a code path it never entered, because it stubbed wpmgr_cards instead of wpmgr_dashboard_cards and the renderer took its early return. So the card's own title is asserted first — if the renderer bailed, nothing after it means anything — and the OLD rgba is asserted ABSENT, because a check that cannot tell the two versions apart cannot testify about either. Both proven: against 471b0a2a it fails naming "the old 22% white", and with the card filter removed it fails at 81 bytes rendered. That 81 is the same number SEO reported from their own broken harness, which is independent confirmation it is the same code path. Co-Authored-By: Claude Opus 5 (1M context) --- README.txt | 6 +++++- ci/plugin.conf | 10 +++++++-- includes/shared-menu.php | 15 +++++++++++-- tests/smoke.php | 30 ++++++++++++++++++++++++++ woocommerce-email-discount-manager.php | 4 ++-- 5 files changed, 58 insertions(+), 7 deletions(-) diff --git a/README.txt b/README.txt index f7e2864..81ee78e 100644 --- a/README.txt +++ b/README.txt @@ -4,7 +4,7 @@ Tags: woocommerce, discount, email, shipping, coupon Requires at least: 5.8 Tested up to: 7.1 Requires PHP: 7.4 -Stable tag: 1.6.0 +Stable tag: 1.6.1 WC requires at least: 6.0 WC tested up to: 11.1.0 License: GPLv2 or later @@ -96,6 +96,10 @@ The most specific match wins: exact email, then domain, then partial match. == Changelog == += 1.6.1 = +* The status label on the Nolimit dashboard card is now readable. It was white text on a light overlay, which on this plugin's green gave 3.5:1 where 4.5:1 is the accessibility minimum. + + = 1.6.0 = * A shipping method a group is shown is now reserved for that group: customers who match no group no longer see it. Previously a method set up for approved addresses stayed on the checkout for everyone, so free delivery meant for one company could be chosen by anybody. Customers are never left with no shipping method at all. diff --git a/ci/plugin.conf b/ci/plugin.conf index d4d14fa..e1a95b5 100644 --- a/ci/plugin.conf +++ b/ci/plugin.conf @@ -75,7 +75,13 @@ RELEASE_REPO=kw/nolimit-discounts-dist # The frozen hash is therefore a family-wide fact, not a local one, and taking # a new one is something all six do in the same window. # -# 471b0a2a = contract 1.2.2: the icon box is sized 100%/100% instead of a +# 75b04eb4 = contract 1.2.3: the dashboard status pill is rgba(0,0,0,.18) +# instead of 22% white. The pill is white 11px text composited over the card +# colour, and 22% white is a floor: a card has to reach about 7.7:1 before the +# pill clears 4.5:1. This plugin's #1a7a52 gave 3.50 and now gives 7.15. It +# could not be fixed by choosing a different card colour — the whole family +# band fails, including the no-colour fallback. +# Earlier: 471b0a2a = 1.2.2: the icon box is sized 100%/100% instead of a # hardcoded 36x34. WordPress declares that parent three times and they # disagree (36x34 open, 35x30 folded, 34x30 under 960px), so a fixed number is # right in one state and wrong in the two a laptop is usually in. @@ -91,7 +97,7 @@ RELEASE_REPO=kw/nolimit-discounts-dist # backslashes, hex digits and spaces, so there is nothing left to leave the # string with. Verified here against seven hostile inputs. # Earlier frozen hashes: 184cebdc = 1.1.0, f4862d5c = 1.0.0. -WPMGR_MENU_SHA=471b0a2aab47b6b7f8d839ac8b12d60637bbe2c07df86f7e40089c677fbab3cc +WPMGR_MENU_SHA=75b04eb4fe9eda0119312075accf2fc77de244e5c6b759d624a8b1d254c0fc99 # The name this plugin used before the Nolimit rename. Kept so ci/static.sh # can fail when it reappears in text a user reads — a sentence that goes stale diff --git a/includes/shared-menu.php b/includes/shared-menu.php index b62c271..c3c6a9c 100644 --- a/includes/shared-menu.php +++ b/includes/shared-menu.php @@ -69,7 +69,7 @@ if ( ! defined( 'ABSPATH' ) ) { } if ( ! defined( 'WPMGR_MENU_VERSION' ) ) { - define( 'WPMGR_MENU_VERSION', '1.2.2' ); + define( 'WPMGR_MENU_VERSION', '1.2.3' ); } if ( ! defined( 'WPMGR_MENU_SLUG' ) ) { @@ -337,8 +337,19 @@ if ( ! function_exists( 'wpmgr_ensure_menu' ) ) { . '.wpmgr-headline{font-size:22px;font-weight:600;margin:0 0 10px}' . '.wpmgr-card dl{display:grid;grid-template-columns:1fr auto;gap:4px 12px;margin:0;font-size:13px}' . '.wpmgr-card dt{color:#646970;margin:0}.wpmgr-card dd{margin:0;text-align:right}' + // 🔴 A DARK overlay, not a light one. White 11px text on + // rgba(255,255,255,.22) over a card colour is 3.45:1 on this + // plugin's green and 3.42:1 on a blue — under the 4.5:1 that small + // text needs, on every family colour dark enough to need white + // text in the first place. rgba(0,0,0,.18) takes the same four + // colours to 6.94–9.37:1, because darkening a background that + // already carries white text can only help. + // + // Measured rather than reasoned: the composite was read back out + // of a canvas in headless Chromium, not computed — #50977f for the + // old rule, #19644b for this one. . '.wpmgr-state{font-size:11px;text-transform:uppercase;letter-spacing:.04em;' - . 'background:rgba(255,255,255,.22);padding:2px 8px;border-radius:10px}' + . 'background:rgba(0,0,0,.18);padding:2px 8px;border-radius:10px}' . '.wpmgr-card footer{padding:12px 18px;border-top:1px solid #f0f0f1}' . ''; diff --git a/tests/smoke.php b/tests/smoke.php index 9f68787..2944faa 100644 --- a/tests/smoke.php +++ b/tests/smoke.php @@ -418,6 +418,36 @@ if ( function_exists( 'wpmgr_menu_glyph_style' ) ) { echo "::warning::wpmgr_menu_glyph_style() is not defined, so the glyph style was not exercised.\n"; } +// 🔴 The dashboard is RENDERED and the pill colour read out of what it +// emitted. Asserting the colour alone is not enough: the renderer returns +// early when no card is registered, and a harness that stubs the wrong filter +// name then reports "no problem" over a code path it never entered. Three +// sessions hit exactly that. So the card's own title is asserted first — if +// that is absent the renderer bailed, and nothing after it means anything. +if ( function_exists( 'wpmgr_render_dashboard' ) ) { + ob_start(); + wpmgr_render_dashboard(); + $wc_edm_dash = ob_get_clean(); + + wc_edm_ok( + 'the shared dashboard renders this plugin card', + false !== strpos( $wc_edm_dash, 'Discounts' ) + && false !== strpos( $wc_edm_dash, 'wpmgr-card' ), + 'rendered ' . strlen( $wc_edm_dash ) . ' bytes' + ); + + // The status pill is white text composited over the card colour, so 22% + // white put this plugin's green at 3.50:1. Named as the literal the file + // must contain, and the OLD value is asserted absent — a check that cannot + // tell the two versions apart cannot testify about either. + wc_edm_ok( + 'and the status pill is the contrast-safe background', + false !== strpos( $wc_edm_dash, 'rgba(0,0,0,.18)' ) + && false === strpos( $wc_edm_dash, 'rgba(255,255,255,.22)' ), + 'pill rule in output: ' . ( false !== strpos( $wc_edm_dash, 'rgba(255,255,255,.22)' ) ? 'the old 22% white' : 'not found at all' ) + ); +} + // The frozen hash of includes/shared-menu.php is asserted in ci/static.sh // against WPMGR_MENU_SHA in ci/plugin.conf, and deliberately NOT repeated // here: two copies of the same constant drift, and the one that drifts is the diff --git a/woocommerce-email-discount-manager.php b/woocommerce-email-discount-manager.php index 6366174..b9e7e78 100644 --- a/woocommerce-email-discount-manager.php +++ b/woocommerce-email-discount-manager.php @@ -4,7 +4,7 @@ * Plugin URI: https://gitea.nolimit.dk/kw/woo-discount-manager * Update URI: https://gitea.nolimit.dk/kw/nolimit-discounts-dist * Description: Apply discounts and show/hide shipping methods based on the customer's email address (full address, domain or partial match). - * Version: 1.6.0 + * Version: 1.6.1 * Author: Kristian Wind * Author URI: https://gitea.nolimit.dk/kw * License: GPL-2.0-or-later @@ -28,7 +28,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } -define( 'WC_EDM_VERSION', '1.6.0' ); +define( 'WC_EDM_VERSION', '1.6.1' ); define( 'WC_EDM_PLUGIN_FILE', __FILE__ ); define( 'WC_EDM_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'WC_EDM_PLUGIN_URL', plugin_dir_url( __FILE__ ) );