1.5.4: the text follows the rename, and a check keeps it that way

Kristian read the readme and found it still telling people to configure the
plugin under WooCommerce, for a page that moved to the Nolimit menu three
releases ago. Sweeping for it found seven stale places, and three of them are
notices THE PLUGIN SHOWS THE USER — the missing-WooCommerce notice, the
activation error and the incomplete-install warning all still called it
WooCommerce Email Discount Manager.

That is the mimir.guide failure exactly: the code moved, the text stood still,
and nothing failed. It was found by somebody reading, which is the only way it
could be found, and that is the argument for the check rather than for being
more careful next time.

ci/static.sh now asserts two things. The name in readme.txt's title matches the
Plugin Name header, because the header is what WordPress shows and everything
else has to agree with it. And no shipped PHP file contains OLD_PLUGIN_NAME,
which is now a value in ci/plugin.conf rather than a habit.

The changelog is deliberately exempt: an entry describes what was true for that
release, and rewriting it would be a different lie. Only text describing the
CURRENT state is checked.

Both halves proven red — a readme title that disagrees, and the old name put
back into one notice.

Not changed: the page stays under Nolimit rather than gaining a second entry
under WooCommerce. One menu is the family's shape, and a duplicate entry is
clutter rather than a fix for a readme that was simply wrong.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kristianwind
2026-09-20 22:39:19 +02:00
co-authored by Claude Opus 5
parent 7ece3f1ee4
commit cb58ffe26e
5 changed files with 47 additions and 12 deletions
+4 -4
View File
@@ -1,10 +1,10 @@
=== WooCommerce Email Discount Manager === === Nolimit Discounts ===
Contributors: kristianwind Contributors: kristianwind
Tags: woocommerce, discount, email, shipping, coupon Tags: woocommerce, discount, email, shipping, coupon
Requires at least: 5.8 Requires at least: 5.8
Tested up to: 7.1 Tested up to: 7.1
Requires PHP: 7.4 Requires PHP: 7.4
Stable tag: 1.5.3 Stable tag: 1.5.4
WC requires at least: 6.0 WC requires at least: 6.0
WC tested up to: 11.1.0 WC tested up to: 11.1.0
License: GPLv2 or later License: GPLv2 or later
@@ -14,7 +14,7 @@ Apply discounts and show/hide shipping methods based on the customer's email add
== Description == == Description ==
WooCommerce Email Discount Manager lets you give discounts and filter available Nolimit Discounts lets you give discounts and filter available
shipping methods based on the email address a customer logs in or checks out with. shipping methods based on the email address a customer logs in or checks out with.
= Discount Groups = = Discount Groups =
@@ -63,7 +63,7 @@ coupons in a dropdown.
1. Upload the `woocommerce-email-discount-manager` folder to `/wp-content/plugins/`. 1. Upload the `woocommerce-email-discount-manager` folder to `/wp-content/plugins/`.
2. Make sure WooCommerce is installed and active. 2. Make sure WooCommerce is installed and active.
3. Activate the plugin through the Plugins screen in WordPress. 3. Activate the plugin through the Plugins screen in WordPress.
4. Go to WooCommerce → Email Discounts to configure groups, assignments and shipping rules. 4. Go to Nolimit → Discounts to configure groups, assignments and shipping rules.
= REST API = = REST API =
+1 -1
View File
@@ -22,7 +22,7 @@ ci_load_conf() {
# leaves the floors empty, every comparison becomes a no-op, and the hollow # leaves the floors empty, every comparison becomes a no-op, and the hollow
# checks these were added to fix come back silently — the same shape of bug. # checks these were added to fix come back silently — the same shape of bug.
local missing= local missing=
for var in PLUGIN_SLUG PLUGIN_MAIN TEXT_DOMAIN NEEDS_WOOCOMMERCE MIN_SHIPPED_PHP_FILES MIN_TRANSLATION_CALLS RELEASE_REPO WPMGR_MENU_SHA; do for var in PLUGIN_SLUG PLUGIN_MAIN TEXT_DOMAIN NEEDS_WOOCOMMERCE MIN_SHIPPED_PHP_FILES MIN_TRANSLATION_CALLS RELEASE_REPO WPMGR_MENU_SHA OLD_PLUGIN_NAME; do
[ -n "${!var:-}" ] || missing="$missing $var" [ -n "${!var:-}" ] || missing="$missing $var"
done done
if [ -n "$missing" ]; then if [ -n "$missing" ]; then
+5
View File
@@ -92,3 +92,8 @@ RELEASE_REPO=kw/nolimit-discounts-dist
# string with. Verified here against seven hostile inputs. # string with. Verified here against seven hostile inputs.
# Earlier frozen hashes: 184cebdc = 1.1.0, f4862d5c = 1.0.0. # Earlier frozen hashes: 184cebdc = 1.1.0, f4862d5c = 1.0.0.
WPMGR_MENU_SHA=471b0a2aab47b6b7f8d839ac8b12d60637bbe2c07df86f7e40089c677fbab3cc WPMGR_MENU_SHA=471b0a2aab47b6b7f8d839ac8b12d60637bbe2c07df86f7e40089c677fbab3cc
# 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
# breaks nothing by itself, which is why it survives.
OLD_PLUGIN_NAME="WooCommerce Email Discount Manager"
+32 -2
View File
@@ -141,6 +141,37 @@ else
echo " $checked plugin-relative include(s) checked" echo " $checked plugin-relative include(s) checked"
fi fi
readme=
for f in readme.txt README.txt; do [ -f "$f" ] && readme=$f && break; done
ci_step "the plugin is called the same thing everywhere"
# 🔴 The rename moved the code and left the text behind: the readme still told
# people to look under WooCommerce for a page that had moved to the Nolimit
# menu, and three notices the PLUGIN SHOWS THE USER still used the old name.
# Kristian found it by reading the readme, which is the only reason it was
# found at all — nothing fails when a sentence goes stale.
#
# Same failure as a privacy page standing still while the code moves. The name
# in the header is the one WordPress shows, so it is the one everything else
# has to agree with.
header_name=$(ci_plugin_header 'Plugin Name')
echo " header: $header_name"
readme_name=$(sed -n -E 's/^=== (.+) ===$/\1/p' "$readme" 2>/dev/null | head -1)
echo " $readme: $readme_name"
[ "$header_name" = "$readme_name" ] \
|| note_fail "The plugin header says '$header_name' but $readme says '$readme_name'."
# Old names in text a user reads. The changelog is exempt: an entry describes
# what was true for that release, and rewriting it would be a different lie.
stale=$(./ci/dist-files.sh | grep -E '\.php$' \
| xargs grep -nF "$OLD_PLUGIN_NAME" 2>/dev/null || true)
if [ -n "$stale" ]; then
printf '%s\n' "$stale" | sed 's/^/ /'
note_fail "The old plugin name '$OLD_PLUGIN_NAME' is still in shipped code."
else
echo " no shipped file still says '$OLD_PLUGIN_NAME'"
fi
ci_step "one version, stated once" ci_step "one version, stated once"
# WordPress compares the update feed against the header and nothing else, so a # WordPress compares the update feed against the header and nothing else, so a
# constant or a readme that disagrees with it is how a release ends up either # constant or a readme that disagrees with it is how a release ends up either
@@ -323,8 +354,7 @@ behind() { # claimed current -> true when claimed is the older of the two
# plugin header, so checking the header for it reports "missing" on a plugin # plugin header, so checking the header for it reports "missing" on a plugin
# that states it correctly. "WC tested up to" is the opposite: WooCommerce # that states it correctly. "WC tested up to" is the opposite: WooCommerce
# reads that one from the plugin header and nowhere else. # reads that one from the plugin header and nowhere else.
readme=
for f in readme.txt README.txt; do [ -f "$f" ] && readme=$f && break; done
tested_wp= tested_wp=
[ -n "$readme" ] && tested_wp=$(sed -n -E 's/^Tested up to:[[:space:]]*([^[:space:]]+).*/\1/p' "$readme" | head -1) [ -n "$readme" ] && tested_wp=$(sed -n -E 's/^Tested up to:[[:space:]]*([^[:space:]]+).*/\1/p' "$readme" | head -1)
+5 -5
View File
@@ -4,7 +4,7 @@
* Plugin URI: https://gitea.nolimit.dk/kw/woo-discount-manager * Plugin URI: https://gitea.nolimit.dk/kw/woo-discount-manager
* Update URI: https://gitea.nolimit.dk/kw/nolimit-discounts-dist * 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). * Description: Apply discounts and show/hide shipping methods based on the customer's email address (full address, domain or partial match).
* Version: 1.5.3 * Version: 1.5.4
* Author: Kristian Wind * Author: Kristian Wind
* Author URI: https://gitea.nolimit.dk/kw * Author URI: https://gitea.nolimit.dk/kw
* License: GPL-2.0-or-later * License: GPL-2.0-or-later
@@ -28,7 +28,7 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; exit;
} }
define( 'WC_EDM_VERSION', '1.5.3' ); define( 'WC_EDM_VERSION', '1.5.4' );
define( 'WC_EDM_PLUGIN_FILE', __FILE__ ); define( 'WC_EDM_PLUGIN_FILE', __FILE__ );
define( 'WC_EDM_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'WC_EDM_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'WC_EDM_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'WC_EDM_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
@@ -211,7 +211,7 @@ final class WC_Email_Discount_Manager {
} }
echo '<div class="notice notice-error"><p>'; echo '<div class="notice notice-error"><p>';
echo esc_html__( 'WooCommerce Email Discount Manager could not load all of its files, so some features are unavailable. If you just updated the plugin, reload this page — the upload may still have been in progress. If the warning persists, upload the plugin again.', 'wc-email-discount' ); echo esc_html__( 'Nolimit Discounts could not load all of its files, so some features are unavailable. If you just updated the plugin, reload this page — the upload may still have been in progress. If the warning persists, upload the plugin again.', 'wc-email-discount' );
echo '</p><p><code>'; echo '</p><p><code>';
echo implode( '</code>, <code>', array_map( 'esc_html', $this->missing_files ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo implode( '</code>, <code>', array_map( 'esc_html', $this->missing_files ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '</code></p></div>'; echo '</code></p></div>';
@@ -283,7 +283,7 @@ final class WC_Email_Discount_Manager {
*/ */
public function woocommerce_missing_notice() { public function woocommerce_missing_notice() {
echo '<div class="notice notice-error"><p>'; echo '<div class="notice notice-error"><p>';
esc_html_e( 'WooCommerce Email Discount Manager requires WooCommerce to be installed and active.', 'wc-email-discount' ); esc_html_e( 'Nolimit Discounts requires WooCommerce to be installed and active.', 'wc-email-discount' );
echo '</p></div>'; echo '</p></div>';
} }
@@ -296,7 +296,7 @@ final class WC_Email_Discount_Manager {
if ( ! class_exists( 'WooCommerce' ) && ! in_array( 'woocommerce/woocommerce.php', $active_plugins, true ) ) { if ( ! class_exists( 'WooCommerce' ) && ! in_array( 'woocommerce/woocommerce.php', $active_plugins, true ) ) {
deactivate_plugins( plugin_basename( WC_EDM_PLUGIN_FILE ) ); deactivate_plugins( plugin_basename( WC_EDM_PLUGIN_FILE ) );
wp_die( wp_die(
esc_html__( 'WooCommerce Email Discount Manager requires WooCommerce to be installed and active. Please activate WooCommerce first.', 'wc-email-discount' ), esc_html__( 'Nolimit Discounts requires WooCommerce to be installed and active. Please activate WooCommerce first.', 'wc-email-discount' ),
esc_html__( 'Plugin activation error', 'wc-email-discount' ), esc_html__( 'Plugin activation error', 'wc-email-discount' ),
array( 'back_link' => true ) array( 'back_link' => true )
); );