Skip to content

Add wp-config-list ability to list and categorize wp-config.php constants - #160

Merged
pluginslab merged 1 commit into
devfrom
feature/wp-config-list
Mar 21, 2026
Merged

pluginslab merged 1 commit into
devfrom
feature/wp-config-list

Conversation

@moritzbappert

Copy link
Copy Markdown
Collaborator

Summary

  • Adds wp-agentic-admin/wp-config-list ability that lists all PHP define() constants from wp-config.php, grouped by category (Database, Debug, Security, Performance, URLs & Paths, Auth Keys & Salts, Multisite, Custom)
  • JS-only implementation — delegates file reading to the existing read-file ability, reusing its PHP backend for path resolution, ABSPATH security checks, and wp_agentic_admin_redact_sensitive_data() redaction (no new PHP file needed)
  • Closes list all of the wp-config.php constants #51

Changes

  • src/extensions/abilities/wp-config-list.js — new ability
  • src/extensions/abilities/index.js — import and registration
  • tests/abilities/core-abilities.test.js — 3 new test cases

Testing

  • Unit tests pass (npm test)
  • Ability tests pass (npm run test:abilities -- --file tests/abilities/core-abilities.test.js)
  • JS lint clean (npm run lint:js)
  • PHP lint clean (composer lint)
  • Manually tested in browser (if UI changes)

Notes

  • No new PHP file — execute() calls executeAbility('wp-agentic-admin/read-file', { file_path: 'wp-config.php', lines: 500 }) directly, so all security and redaction logic is inherited from the existing backend
  • Uses preferSummarize: true to bypass LLM and render the grouped constant list directly
  • "is WP_DEBUG enabled?" style queries may still route to site-health or error-log-read with the 1.7B model — both are valid answers; the reliable trigger phrases are those containing "constants" or "defined"

…stants

JS-only ability that delegates to read-file for path resolution, ABSPATH
security checks, and sensitive-value redaction, then parses define() calls
and groups constants by category (database, debug, security, performance,
URLs, keys/salts, multisite, custom).

Closes #51

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@moritzbappert moritzbappert added the enhancement New feature or request label Mar 21, 2026

@pluginslab pluginslab left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart approach — delegates to read-file for redaction, parses define() calls client-side, categorizes into 8 groups. preferSummarize bypasses LLM truncation. Fixes #51 from Day 1. LGTM!

@pluginslab
pluginslab merged commit fd952f1 into dev Mar 21, 2026
1 of 4 checks passed
@pluginslab
pluginslab deleted the feature/wp-config-list branch May 27, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants