Fix Plugin Check issues across the codebase#2912
Draft
Conversation
Address ~40 actionable items from the WordPress Plugin Check report: - Add ABSPATH guards to 15 files missing them - Fix readme.txt header mismatches (PHP 7.4, GPL-2.0-or-later, WP 6.9) - Remove deprecated wp_no_robots() fallback and fix wp_count_terms() signature - Convert unordered sprintf placeholders to ordered (%1$s, %2$s) in templates - Add missing translators comments for i18n strings with placeholders - Replace _e() with esc_html_e() in template files - Convert heredoc syntax to string concatenation (4 files) - Add proper escaping (wp_kses_post, esc_html) to template outputs - Remove load_plugin_textdomain() (WP auto-loads for .org plugins since 4.6) - Bundle jQuery UI CSS locally instead of loading from CDN - Rename chosen-sprite@2x.png to chosen-sprite-2x.png
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.
Summary
Addresses ~40 actionable items from the WordPress Plugin Check report across 43 files.
Naming convention warnings and other false positives were intentionally skipped — see below.
Changes
Requires PHP(7.4),License(GPL-2.0-or-later),Tested up to(6.9) to match plugin headerwp_no_robots()fallback (WP 5.7+), fixedwp_count_terms()to use array-only signature (WP 5.6+)%sto%1$s/%2$sin 4 email/submission templates// translators:comments for strings with placeholders_e()withesc_html_e()in 4 templates; wrapped UI helper outputs withwp_kses_post(); addedesc_html()aroundsize_format()and$search_input<<<HTML/<<<CSSblocks to string concatenation in 4 filesload_plugin_textdomain()— WordPress auto-loads translations for .org-hosted plugins since WP 4.6code.jquery.com) with local copychosen-sprite@2x.png→chosen-sprite-2x.pngand updated CSS referenceIntentionally skipped
NonPrefixedHookname/NonPrefixedVariable/NonPrefixedFunctionwarnings — established public API, would be a breaking changetrademarked_term— can't rename the pluginplugin_updater_detectedin helper class — intentional for add-on license managementExceptionNotEscaped— exception messages aren't output to HTMLpaginate_links()output — WordPress core returns safe HTML$job_submitted_content— already sanitized withwp_kses_post()Test plan
find . -name '*.php' -exec php -l {} \;