Skip to content

Clear the Plugin Check findings worth clearing (1.0.2) - #8

Merged
henry-mosh merged 1 commit into
mainfrom
chore/plugin-check-1-0-2
Aug 6, 2026
Merged

Clear the Plugin Check findings worth clearing (1.0.2)#8
henry-mosh merged 1 commit into
mainfrom
chore/plugin-check-1-0-2

Conversation

@henry-mosh

Copy link
Copy Markdown
Collaborator

A Plugin Check run surfaced four findings. Two are real, two are not.

Fixed

load_plugin_textdomain() removed. Discouraged since WordPress 4.6: a
plugin hosted on WordPress.org has its translations loaded automatically,
keyed by the slug — which is exactly what the text domain became in #6. The
call was also pointing at a languages/ directory this plugin does not ship.

REQUEST_URI is now sanitized, in Citecue_Proxy::current_url() and
Citecue_Llms_Txt::is_llms_txt_request().

The obvious fix here is a trap. sanitize_text_field() loops deleting every
%xx sequence it finds (formatting.php, _sanitize_text_fields()), so
/caf%C3%A9/ would have reached CiteCue as /caf/ — a different page,
cached under a key CiteCue never answers for. esc_url_raw() is the
sanitizer for a URL and preserves the encoding.

test_a_percent_encoded_url_is_not_mangled_on_the_way_out pins this. It was
confirmed to fail against sanitize_text_field() before being kept:

Failed asserting that '...&u=http://example.org/caf/&b=GPTBot' contains "%C3%A9".

Not fixed, deliberately

DONOTCACHEPAGE is not prefixed. That is the point of it — page-cache
plugins look for that exact constant name, so prefixing it would defeat the
convention. .phpcs.xml.dist has documented this since before this change.

The readme Tested up to error is stale. It was fixed in 1.0.1. That
report was generated against an older install — the header it quotes says
6.8, and the report filename shows the basename citecue/citecue.php, the
pre-rename directory. Worth re-running Plugin Check against the 1.0.2 zip.

Verification

  • 264 tests pass in all three modes CI runs, against a local MySQL
  • phpcs clean, zip builds at version 1.0.2

🤖 Generated with Claude Code

Two of the four are real.

load_plugin_textdomain() has been unnecessary since WordPress 4.6 for a
plugin hosted on WordPress.org — translations arrive keyed by the slug,
which is what the text domain is now. The call was also pointing at a
languages/ directory this plugin does not ship. Removed.

REQUEST_URI was read without a sanitizer in two places. The reflex fix is
sanitize_text_field(), and it would have been a bug: it loops deleting
every %xx sequence, so /caf%C3%A9/ reaches CiteCue as /caf/ — a different
page, cached under a key CiteCue never answers for. esc_url_raw() is the
sanitizer for a URL and leaves the encoding intact. A test pins this down;
it was confirmed to fail against sanitize_text_field() before being kept.

The other two findings stay as they are. DONOTCACHEPAGE is deliberately
unprefixed — page-cache plugins look for that exact name, so prefixing it
would defeat the point, and .phpcs.xml.dist has said so since before this
change. The readme's "Tested up to" error was already fixed in 1.0.1; the
report was generated against an older install, still in a citecue/ folder.
@henry-mosh
henry-mosh merged commit 42c1d59 into main Aug 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant