Add debug log guard and oversized log cleanup workflow
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 5
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Summary
Add a debug log guard that detects oversized WordPress debug logs and provides safe admin actions.
Why this matters
Large debug logs can waste disk space and sometimes contribute to slow troubleshooting workflows. Site owners often discover the problem only after storage pressure or repeated errors.
Proposed scope
- Detect whether
WP_DEBUG_LOGis enabled where safely possible. - Show debug log file size and last modified time when readable.
- Warn when the file exceeds configurable thresholds.
- Provide safe actions:
- view tail excerpt
- download log
- clear/truncate with confirmation
- Add guidance for disabling debug logging in production.
- Log clear/truncate actions in optimization history.
Safety requirements
- Do not expose full logs by default.
- Redact common sensitive patterns where feasible.
- Require capability checks, nonce checks, and confirmation before clearing.
- Handle unreadable or custom log paths gracefully.
Acceptance criteria
- Admin users can see log status without exposing full log content.
- Oversized logs trigger a clear warning.
- Clear/truncate action is confirmed and logged.
- Tests or runtime validation cover missing log, unreadable log, oversized log, custom path, and permission checks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation files or tests are named. Start by locating the plugin's admin settings and optimization-history entry points, then inspect how WordPress debug-log paths and permission or nonce checks are handled; done means the listed log states, safe actions, redaction, confirmations, and validation cases work without exposing full logs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, performance, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100