Skip to content

Code review feedback: issues found on development branch #24

@mrtwebdesign

Description

@mrtwebdesign

Code Review Feedback — 2026-03-23

Reviewed branch: development (e2019e0)
Reviewer: @mrtwebdesign

Overall code quality is very good. Security model is solid, error handling is consistent, MCP server is well-architected. Issues below are organized by severity.


High

  • Committed node_modules in repotools/mcp-server/node_modules/ is tracked in git. Should be in .gitignore and installed via npm ci. Bloats repo size and risks dependency drift.

  • Symlinks to local system binaries committednpx and playwright in the repo root are symlinks to /opt/homebrew/bin/. These are machine-specific and will break for any other developer cloning the repo.

  • temp/auth.json may be tracked in git — Auth state file exists in the repo. The temp/ directory is gitignored but this file may have been committed before the ignore rule was added. Could be leaking session tokens.

  • No request size limits on MCP HTTP transporttools/mcp-server/src/index.ts. The HTTP handler has no Content-Length validation or request body size limits. A large payload could exhaust server memory.


Medium

  • Stack trace loss in withResourceError()tools/mcp-server/src/index.ts (~line 89). Re-throwing errors drops the original stack trace and error context. Should use new Error(message, { cause: error }) to preserve the chain.

  • Unstructured error for missing binaries in WPCC handlertools/mcp-server/src/handlers/wpcc.ts (~line 172). Non-ExecFileTextError exceptions (e.g. binary not found, permission denied) bubble up as unstructured crashes instead of returning a structured error result.

  • No timeout on WP-CLI call in theme-crash-loopexperimental/theme-crash-loop.sh (line 181). $LOCAL_WP ... option get home has no timeout protection. If the site is unresponsive, the script hangs indefinitely. Wrap with timeout 10.

  • sed -i.bak not POSIX-portableinstall.sh (line 394). This syntax works on macOS and GNU/Linux but is not POSIX-compliant. Could break on other systems or in Docker containers with minimal base images.

  • Scattered timeout configuration across MCP handlers — Timeout values are hardcoded in each handler with no central config or env var overrides: local-wp 60s, pw-auth 120s, wpcc 300s, tmux 10s, qm 30s. Should be centralized in a config module.

  • pw-auth is 1000+ lines of bash — bin/pw-auth (Phase 1) #27

  • Stale/deprecated files still in repoBACKLOG-DEPRECATED.md and ROADMAP-DEPRECATED.md are still tracked. If they're deprecated, they should be removed to reduce confusion.


Low

  • Unquoted $log_file in pipe-pane commandbin/aiddtk-tmux (line 101). Variable should be quoted to prevent word splitting if the path contains spaces.

  • Unquoted glob pattern in test expressionbin/wpcc (line 128). Pattern _* in a conditional test should be properly quoted to prevent unexpected glob expansion.

  • &> /dev/null not POSIX-complianttools/wp-ajax-test/install.sh (line 17). Should be >/dev/null 2>&1 for portability.

  • Brittle Node.js version extractiontools/wp-ajax-test/install.sh (line 22). cut -d'v' -f2 assumes node --version always outputs a v prefix. Could fail with non-standard Node distributions.

  • README version behind package.jsontools/mcp-server/README.md says 0.6.2 but package.json says 0.6.3.

  • Complex regex patterns lack documentationtools/mcp-server/src/security/allowlist.ts (line 16), handlers/tmux.ts (line 95), handlers/wpcc.ts (line 62). Shell operator blocking, field extraction, and ANSI stripping patterns have no inline comments explaining intent.

  • Missing site parameter gives unclear errortools/mcp-server/src/index.ts (~line 188). When no site is passed and no active site is set, the error message is "Could not resolve Local run configuration for site: undefined" instead of telling the user to run local_wp_select_site first.

  • Curl timeout handling gap in theme-crash-loopexperimental/theme-crash-loop.sh (line 413). If curl times out, the headers file may not be written but subsequent code still tries to read it.

  • Documentation bloat — 84 markdown files totaling 24,358 lines. Only ~30% are written for human developers. The rest are AI agent context, internal project management, or boilerplate. Consider consolidating or archiving non-essential docs.


Informational (Not Bugs)

  • tools/wp-code-check/ is a git subtree — Maintained as a separate upstream project. Changes in this directory should flow through the upstream repo, not be made directly here.

  • No rate limiting on MCP HTTP transport — Not an issue for local development (localhost-only binding), but would need to be addressed if HTTP mode is ever exposed beyond localhost.

  • WPCC is regex-based, not AST-based — By design. Heuristic patterns have ~5-10% false positive rate. Mitigated by baselines and comment suppression. Not a bug, just a known trade-off.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions