Skip to content

Harden cache clear request sanitization#98

Closed
Zodiac1978 wants to merge 7 commits into
developfrom
codex/optimize-via-agents-md
Closed

Harden cache clear request sanitization#98
Zodiac1978 wants to merge 7 commits into
developfrom
codex/optimize-via-agents-md

Conversation

@Zodiac1978

Copy link
Copy Markdown
Owner

Harden cache clear request sanitization

apermo and others added 7 commits April 14, 2026 15:42
plugins_api() can return a valid object (not WP_Error)
that lacks expected properties like `version`. This
happens with plugins like Search & Filter Pro whose
slug collides with a wp.org entry returning invalid
data.

Guard against this in two places:
- assemble_plugin_report(): reject API responses
  missing `version` before caching as repo_info
- render_table_row(): add isset() check on version,
  consistent with tested/rating/last_updated guards

Fixes #56
Move the isset(version) check inside the non-error
branch so the else is only reached for WP_Error,
letting PHPStan narrow the type correctly.
@Zodiac1978 Zodiac1978 closed this Jul 7, 2026
@Zodiac1978
Zodiac1978 deleted the codex/optimize-via-agents-md branch July 7, 2026 08:22
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.

2 participants