From 2a39960c98c0cee128c85affcbf37b2fedb5284c Mon Sep 17 00:00:00 2001 From: henry-idingo Date: Thu, 6 Aug 2026 15:47:09 +0200 Subject: [PATCH] Annotate DONOTCACHEPAGE where the annotation actually reaches the tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plugin Check reports both define() calls as unprefixed constants. The constant cannot be prefixed — page caches look for that exact name, so a CITECUE_DONOTCACHEPAGE would be seen by nothing and bot-only responses would start being cached for humans, which is the bug it exists to stop. The exemption was already expressed, but in .phpcs.xml.dist, which only governs this repository's own PHPCS run. Plugin Check brings its own ruleset, so the reviewer saw the warning regardless. Moving it to phpcs:ignore annotations on the two lines makes it travel with the code, which is the route Plugin Check documents for a false positive. The ruleset exclusion is dropped rather than kept alongside: leaving both would mean the local run passes for a reason that has nothing to do with whether the annotations are correct. With it gone, phpcs here fails if an annotation is ever lost — verified by deleting one and watching the sniff fire. --- .phpcs.xml.dist | 11 +++++------ citecue.php | 4 ++-- includes/class-citecue-llms-txt.php | 1 + includes/class-citecue-proxy.php | 1 + readme.txt | 5 ++++- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index e59049a..8206064 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -44,13 +44,12 @@ - - /includes/class-citecue-proxy\.php - /includes/class-citecue-llms-txt\.php - diff --git a/citecue.php b/citecue.php index b78e1f8..e3c7353 100644 --- a/citecue.php +++ b/citecue.php @@ -3,7 +3,7 @@ * Plugin Name: CiteCue AI Auto-Fix * Plugin URI: https://github.com/citecue/wordpress-plugin * Description: Serves CiteCue-optimized versions of your pages to AI bots and crawlers, publishes your llms.txt, and lets CiteCue push brand-building draft content into WordPress. - * Version: 1.0.2 + * Version: 1.0.3 * Requires at least: 5.8 * Requires PHP: 7.4 * Author: CiteCue @@ -56,7 +56,7 @@ static function () { return; } -define( 'CITECUE_VERSION', '1.0.2' ); +define( 'CITECUE_VERSION', '1.0.3' ); define( 'CITECUE_PLUGIN_FILE', __FILE__ ); define( 'CITECUE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); diff --git a/includes/class-citecue-llms-txt.php b/includes/class-citecue-llms-txt.php index 89af704..0997d76 100644 --- a/includes/class-citecue-llms-txt.php +++ b/includes/class-citecue-llms-txt.php @@ -197,6 +197,7 @@ private function is_llms_txt_request() { */ private function serve( $body ) { if ( ! defined( 'DONOTCACHEPAGE' ) ) { + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound -- the cross-plugin constant page caches look for; prefixing it would mean no cache ever sees it. define( 'DONOTCACHEPAGE', true ); } diff --git a/includes/class-citecue-proxy.php b/includes/class-citecue-proxy.php index c77ec3b..6179608 100644 --- a/includes/class-citecue-proxy.php +++ b/includes/class-citecue-proxy.php @@ -327,6 +327,7 @@ private function current_url() { */ private function serve( $body, $mode, $stale ) { if ( ! defined( 'DONOTCACHEPAGE' ) ) { + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound -- the cross-plugin constant page caches look for; prefixing it would mean no cache ever sees it. define( 'DONOTCACHEPAGE', true ); } diff --git a/readme.txt b/readme.txt index 609cde8..7c63b15 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: ai, llms.txt, gptbot, ai-seo, woocommerce Requires at least: 5.8 Tested up to: 7.0 Requires PHP: 7.4 -Stable tag: 1.0.2 +Stable tag: 1.0.3 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -100,6 +100,9 @@ The plugin folder is now citecue-ai-auto-fix. If you installed 1.0.0 by uploadin == Changelog == += 1.0.3 = +* No functional change. Annotates the DONOTCACHEPAGE definitions so code-quality tooling stops reporting a naming-convention violation the constant cannot avoid — page caches look for that exact name. + = 1.0.2 = * Translations no longer depend on the plugin loading them by hand; WordPress.org supplies them for the plugin slug. * The requested URL is sanitized on the way to CiteCue in a way that preserves percent-encoding, so pages with accented or non-Latin characters in the address are served and cached under the address they actually have.