Skip to content

Add change-only notification option and change summaries#91

Closed
happyloa wants to merge 2 commits intomainfrom
codex/add-comparison-function-for-risk-list
Closed

Add change-only notification option and change summaries#91
happyloa wants to merge 2 commits intomainfrom
codex/add-comparison-function-for-risk-list

Conversation

@happyloa
Copy link
Owner

Motivation

  • Reduce noisy alerts by sending notifications only when risks are newly added or changed compared to the previous scan.
  • Provide a concise change summary in notification payloads so recipients can quickly see what changed.
  • Reuse existing history storage to compute diffs rather than sending full risk lists when not needed.
  • Ship the feature as a user-configurable setting and bump the plugin version to reflect the change.

Description

  • Add RiskRepository::diffWithLatest and supporting helpers (normalizeRiskArray, buildRiskSignature, signature map builders, and comparison normalization) to compute added/changed risks from stored history.
  • Inject RiskRepository into Notifier and optionally replace the full risk list with added + changed when notify_changes_only is enabled, and add a human-readable change summary to email, Slack, Teams, Discord, and webhook outputs.
  • Add notify_changes_only to SettingsRepository with sanitization and persistence, and add a checkbox to the admin settings UI in templates/admin-page.php (using existing form/nonce flows and checked/esc_attr/esc_html).
  • Wire up the constructor call in site-add-on-watchdog.php, bump Version::NUMBER and top-level plugin Version to 1.8.0, and add a short changelog entry in readme.txt.

Testing

  • No automated tests were executed as part of this change.
  • The change set is limited to repository, notifier, settings, admin template, and version metadata updates and should be covered by existing unit/integration tests if run.
  • Manual verification recommended: toggle the new setting, run scans, and confirm notifications contain the change summary and only include added/changed risks when enabled.

Codex Task

@happyloa happyloa closed this Dec 23, 2025
@happyloa happyloa deleted the codex/add-comparison-function-for-risk-list branch December 23, 2025 13:41
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