Skip to content

Fix admin crash on fresh installs by normalizing risk details and bump to 1.7.3#88

Merged
happyloa merged 1 commit intomainfrom
codex/fix-severe-error-on-plugin-installation-and-upgrade
Dec 22, 2025
Merged

Fix admin crash on fresh installs by normalizing risk details and bump to 1.7.3#88
happyloa merged 1 commit intomainfrom
codex/fix-severe-error-on-plugin-installation-and-upgrade

Conversation

@happyloa
Copy link
Owner

Motivation

  • Fresh installs could show a critical error in the admin "Potential Risks" area and hide "Ignored Plugins" and "Notifications" because stored risk payloads contained non-array details.vulnerabilities values.
  • Iterating or calling count() on null/unexpected types caused a fatal error that prevented the admin page from rendering fully.
  • Make risk loading and admin rendering resilient to legacy or malformed stored data so the admin UI always displays safely.
  • Prepare a patch release by bumping the plugin version to 1.7.3.

Description

  • Add normalizeDetails() to src/Repository/RiskRepository.php to coerce and sanitize details.vulnerabilities into an array and filter out invalid entries.
  • Harden admin logic by introducing getRiskVulnerabilities() in src/AdminPage.php and updating uses so counts and iterations only run on validated arrays.
  • Update the admin template templates/admin-page.php to reference the normalized vulnerabilities array and avoid direct access to possibly-null keys.
  • Bump plugin metadata and constants: update site-add-on-watchdog.php, src/Version.php, and readme.txt to 1.7.3 and add a changelog entry.

Testing

  • No automated tests were executed as part of this change.

Codex Task

@happyloa happyloa merged commit 83010c7 into main Dec 22, 2025
2 checks passed
@happyloa happyloa deleted the codex/fix-severe-error-on-plugin-installation-and-upgrade branch December 22, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant