performwp / performwp/perform

Add debug log guard and oversized log cleanup workflow

Open
#184 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: admin-ui area: performance enhancement priority: medium status: needs-spec
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_LOG is 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.