Clear the Plugin Check findings worth clearing (1.0.2) - #8
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Plugin Check run surfaced four findings. Two are real, two are not.
Fixed
load_plugin_textdomain()removed. Discouraged since WordPress 4.6: aplugin 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_URIis now sanitized, inCitecue_Proxy::current_url()andCitecue_Llms_Txt::is_llms_txt_request().The obvious fix here is a trap.
sanitize_text_field()loops deleting every%xxsequence 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 thesanitizer for a URL and preserves the encoding.
test_a_percent_encoded_url_is_not_mangled_on_the_way_outpins this. It wasconfirmed to fail against
sanitize_text_field()before being kept:Not fixed, deliberately
DONOTCACHEPAGEis not prefixed. That is the point of it — page-cacheplugins look for that exact constant name, so prefixing it would defeat the
convention.
.phpcs.xml.disthas documented this since before this change.The readme
Tested up toerror is stale. It was fixed in 1.0.1. Thatreport was generated against an older install — the header it quotes says
6.8, and the report filename shows the basename
citecue/citecue.php, thepre-rename directory. Worth re-running Plugin Check against the 1.0.2 zip.
Verification
🤖 Generated with Claude Code