Skip to content

fix: pass WordPress Plugin Check (69 errors → 0)#35

Merged
cport1 merged 2 commits into
mainfrom
chore/plugin-check-fixes
Jul 20, 2026
Merged

fix: pass WordPress Plugin Check (69 errors → 0)#35
cport1 merged 2 commits into
mainfrom
chore/plugin-check-fixes

Conversation

@cport1

@cport1 cport1 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Ran the official Plugin Check tool (the one WordPress.org reviewers use) against the built .org ZIP in a real WordPress 7.0-data environment. It found 69 errors — my earlier manual guideline review missed them. This fixes all 69; the plugin now reports 0 errors (378 advisory warnings remain, all the standard accepted kind).

Errors fixed (69 → 0)

Category Count Fix
date()gmdate() 25 timezone-safe; rate-limiter's internal column also made GMT, user-rendered timestamps left local (WP pins PHP tz to UTC, so behavior-preserving)
Unescaped exception output 13 esc_html() (WooCommerce) / justified phpcs:ignore (internal SDK exceptions)
Raw cURL in bundled SDK 12 removed the dead cURL fallback in Client.php; WP HTTP API path only
str_ends_with() on PHP 7.4 1 real latent fatal — replaced with a 7.4-safe substr check
wp_cache_flush_group() (WP 6.1+) 1 bumped Requires at least: 6.1 (realistic in 2026; WP is at 7.0)
parse_urlwp_parse_url 3 + guarded SDK fallback
Missing i18n translator comments 4 added
strip_tagswp_strip_all_tags 1 guarded
Unescaped output / fclose 3 justified phpcs:ignore (template-generated decoy content; php://output CSV stream)
Missing direct-access guard 1 ABSPATH guard in GoodBotList.php
Outdated "Tested up to" 1 7.0 (current release)

Verified

  • wp plugin check webdecoy0 ERRORS (was 69), rebuilt .org ZIP re-checked.
  • php tests/run.php → 41 passed.
  • php -l clean on all 16 changed PHP files; PHP 7.4 compatible throughout.
  • Spot-checked the 2 remaining "missing nonce" warnings — both false positives (honeypot reader intentionally trusts no input; the admin handler does verify nonce+capability).

The 378 warnings are non-prefixed template variables, direct queries against the plugin's own custom tables, and input notices on request-inspection code — the normal, accepted set for a security plugin; none block approval.

cport1 added 2 commits July 20, 2026 14:37
Resolve every Plugin Check ERROR reported against the plugin:

- DateTime.RestrictedFunctions (25): date() -> gmdate(). The rate limiter
  also switches its window_start writes to current_time('mysql', true) so
  both sides of the window comparison are GMT (fixes a latent offset;
  window_start is never displayed). Blocker/detector/stats/templates keep
  local storage because those values are rendered via
  date_i18n(strtotime(...)); only the threshold formatting is switched
  (WP pins PHP's default tz to UTC, so date()==gmdate() there).
- EscapeOutput.ExceptionNotEscaped (13): wrap WooCommerce RouteException
  messages in esc_html(); annotate internal, never-echoed SDK exceptions
  (Client/Parser/Tokenizer) with phpcs:ignore to keep the SDK
  framework-agnostic.
- AlternativeFunctions.curl_* (12): remove the dead raw-cURL fallback in
  the SDK Client; the WP HTTP API is always available in WordPress, and we
  now throw WebDecoyException if it ever is not.
- wp_function_not_compatible_with_requires_wp (2): str_ends_with() ->
  7.4-safe substr() check; guard wp_cache_flush_group() (WP 6.1+).
- AlternativeFunctions.parse_url (3): wp_parse_url() in webdecoy.php;
  guarded wp_parse_url() fallback in the standalone SDK BotDetector.
- AlternativeFunctions.strip_tags (1): guarded wp_strip_all_tags() fallback
  in the SDK SignalCollector.
- AlternativeFunctions.fclose (1): phpcs:ignore for CSV streaming to
  php://output (not filesystem access).
- I18n.MissingTranslatorsComment (4): add translators comments.
- EscapeOutput.OutputNotEscaped (2): phpcs:ignore for template-generated
  decoy content (no user input).
- missing_direct_file_access_protection (1): ABSPATH guard in GoodBotList.
- outdated_tested_upto_header (1): Tested up to 6.8 -> 6.7.

Keeps PHP 7.4 compatibility; tests still pass (41 passed, 0 failed).
…eck errors)

- 'Tested up to: 7.0' (current WordPress release; the check requires the
  latest).
- 'Requires at least: 6.1' — covers wp_cache_flush_group (WP 6.1+), which the
  static Plugin Check flags regardless of the function_exists guard.
@cport1
cport1 merged commit 5f55c58 into main Jul 20, 2026
3 checks passed
@cport1
cport1 deleted the chore/plugin-check-fixes branch July 20, 2026 19:42
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