/rolepod-wplab:wp-execute-phpfrom rolepod-wplab
Run a PHP payload inside the live WordPress request lifecycle via the companion endpoint. Phase = Power. Requires companion + ROLEPOD_WPLAB_PROFILE=power + non-production target + AST-clean payload + confirm:true.
Ships in rolepod-wplab. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Last-resort power tool. Bypasses every safer layer (REST, wp-cli, introspect) to run arbitrary PHP in the WP request lifecycle. Five-layer safety chain. Audit-logged. Production-blocked unconditionally.
do_action('save_post', 42) and observe what happens" — runtime hook trigger.wp_schedule_event to register a cron" — internal scheduler call.Skip when:
wp-content.wp-edit-plugin.wp-introspect.wp_cli_run (companion's wp-cli endpoint via the same bridge, no need for execute-php).Owns:
rolepod_wp_execute_php with the full safety chain.Does not own:
wp_cli_run not execute_php.Return / hand off:
ROLEPOD_WPLAB_PROFILE=power env and reconnect."FULL_ACCESS_REQUIRED / execute_php capability absent) → STOP and run the "Requesting Full Access" protocol below. The toggle is the owner's decision — never pressure, never proceed without it.When a task genuinely needs the power surface and the site is guarded, hand the user a decision, not an instruction. One message, four parts:
rolepod_wp_backup_create BEFORE they flip the
toggle; it works in guarded mode. Wait for it to finish (action=status)
and confirm the backup id before proceeding.If the user declines: stop. Suggest the nearest guarded-mode alternative or manual steps they can run themselves. Declining is a valid outcome, not an obstacle to argue with.
payload (the PHP snippet).confirm: true (mandatory).timeout_ms (default 5000).State why no safer skill solves this. If you cannot answer in one sentence → STOP, use the safer skill.
Check the payload against references/ast-rules.md. If any forbidden token appears → STOP, rewrite without it.
ROLEPOD_WPLAB_PROFILE=power env present.execute_php). Guarded → run the "Requesting Full Access" protocol first.confirm: true.rolepod_wp_execute_php { target_id, payload, confirm: true, timeout_ms? }. The call returns return_value, stdout, php_warnings, duration_ms, audit_id.
State the return_value, php_warnings count, duration, audit_id. The audit_id is the user's reference if anything went wrong server-side.
rolepod:debug-issue for the broader debug context this fits into.rolepod:rolepod-builder for PHP-level investigation.confirm: true.No durable artifact in the MCP. The companion writes an audit entry under wp-content/uploads/rolepod-wp-audit/<audit_id>.log (mode 0600) AND a row in wp_options.rolepod_wp_audit_log. The user owns the audit trail.
Read EVERY time before composing a new payload — the good/bad contrast catches the most common attack-surface mistakes:
examples/php-examples.md — good vs bad payloads for a transient set + for a runtime hook dispatch.Load when composing the FIRST payload of a session, or when the AST screen rejects something:
references/ast-rules.md — the full forbidden-token list, the reason for each, the alternative if one exists.AST_REJECTED with the forbidden token; do not retry with obfuscation.POWER_PROFILE_REQUIRED → STOP, user must set env + reconnect.PRODUCTION_BLOCKED → STOP, no override.confirm: true missing → STOP, ask user.wp_cli_run for file-level ops.Full Rolepod adds session-token-aware persistent eval (php_session endpoint) for multi-call scripts that share variables. Standalone, each execute-php call is independent.
wp-content to update).wp-health-check to confirm the system stayed healthy.wp-diagnose for the broader picture.What SKILL.md sets; muted values are Claude Code's defaults
a problem CANNOT be solved by core REST + adapter REST + wp-cli + introspect — needs direct PHP runtime access (object instantiation, hook dispatch test, transient set, internal API call)
Other plugins' skills for the same job
npx claudepluginhub nuttaruj/rolepod-wplab --plugin rolepod-wplab15 skills in this plugin
/wp-changesQuery the AI Change Ledger on a connected target — the writes the MCP recorded through the companion (RestTarget only), categorized; toggle on/off; panic-revert recent changes. Phase = Recovery./wp-connectOpen a WordPress Target on any kind (local / REST + App Password / SSH / Docker) using credentials already in the vault. Phase = Define./wp-contentCreate, read, update, search posts/pages/users/options/taxonomies via the core WP REST API on a connected target. Phase = Build./wp-diagnoseMulti-probe diagnostic + security audit of a connected target — plugin conflicts, slow queries, large autoload options, broken images, PHP errors, outdated core/plugins/themes, weak admins. Phase = Debug./wp-edit-designRead or modify page-builder layouts on a connected target — Elementor, Divi, Oxygen, Bricks widget trees. Phase = Build./wp-edit-pluginRead or write configuration owned by SEO / i18n / e-commerce / custom-field / forms plugins — Yoast, RankMath, WPML, WooCommerce, ACF, Gravity / CF7 / WPForms — on a connected target. Phase = Build.