Skip to content

ericrisco/rsc-harness / skills/wordpress

wordpress

Verified

Use when building or hardening WordPress sites or WooCommerce stores and treating WordPress as the product rather than just writing PHP — block themes with theme.json, plugins with block.json and proper hooks, wp-config security hardening, performance (object cache, asset loading, autoloaded options), and WP-CLI operations. NOT a Laravel app (that is `laravel`).

FileKindSize
SKILL.mdskill md11.6 KB
evals/README.mdmarkdown852 B
evals/cases.yamlconfig3.1 KB
references/hardening.mdmarkdown3.8 KB
references/performance.mdmarkdown3.2 KB
references/woocommerce.mdmarkdown2.6 KB
scripts/verify.shexecutablescript3.3 KB

scripts/verify.sh

View on GitHub
#!/usr/bin/env bash
#
# verify.sh — static, read-only scan of a WordPress theme/plugin/config tree for
# the anti-patterns this skill warns about. Emits PASS/FAIL lines.
#
# Usage:   scripts/verify.sh [TARGET_DIR]   (default: current directory)
# Exit:    0 if clean OR target has no PHP to scan; 1 if any FAIL.
#
# Read-only: never writes, never modifies. Safe to run in CI.

set -u

TARGET="${1:-.}"

if [ ! -d "$TARGET" ]; then
  echo "verify.sh: target '$TARGET' is not a directory" >&2
  exit 2
fi

# Collect PHP files, ignoring dependency/build/VCS dirs.
PHP_FILES="$(find "$TARGET" -type f -name '*.php' \
  -not -path '*/vendor/*' \
  -not -path '*/node_modules/*' \
  -not -path '*/.git/*' \
  -not -path '*/build/*' 2>/dev/null)"

if [ -z "$PHP_FILES" ]; then
  echo "PASS  no PHP files found under '$TARGET' — nothing to scan"
  exit 0
fi

fails=0

# report CHECK_NAME PATTERN_DESC HITS  — runs in the parent shell (no pipe/subshell)
# so the failure counter survives.
report() {
  local name="$1" desc="$2" hits="$3"
  if [ -n "$hits" ]; then
    echo "FAIL  $name — $desc"
    echo "$hits" | sed 's/^/        /'
    fails=$((fails + 1))
  else
    echo "PASS  $name"
  fi
}

# grep helper across collected PHP files; prints file:line, never errors out.
scan() {
  echo "$PHP_FILES" | tr '\n' '\0' | xargs -0 grep -nE "$1" 2>/dev/null
}

# 1. Hardcoded DB credentials with a real (non-empty, non-placeholder) value.
report "no-hardcoded-db-creds" "DB_* defined with a literal value in committed PHP" \
  "$(scan "define\(\s*['\"]DB_(PASSWORD|USER|NAME|HOST)['\"]\s*,\s*['\"][^'\"]+['\"]" \
     | grep -viE "database_name_here|username_here|password_here|put your")"

# 2. Salt/auth keys committed with a literal (not the sample placeholder).
report "no-committed-salts" "AUTH/NONCE key or salt with a literal value" \
  "$(scan "define\(\s*['\"](AUTH|SECURE_AUTH|LOGGED_IN|NONCE)_(KEY|SALT)['\"]\s*,\s*['\"][^'\"]+['\"]" \
     | grep -viE "put your unique phrase here")"

# 3. Obfuscation / dynamic-exec smells.
report "no-eval-obfuscation" "eval()/base64_decode()/gzinflate()/str_rot13()" \
  "$(scan "\b(eval|base64_decode|gzinflate|str_rot13)\s*\(")"

# 4. query_posts() instead of WP_Query.
report "no-query-posts" "query_posts() — use WP_Query or pre_get_posts" \
  "$(scan "\bquery_posts\s*\(")"

# 5. Raw \$wpdb query/get_results with interpolated vars (no prepare on the line).
report "wpdb-prepared" "\$wpdb call with interpolated variable and no prepare()" \
  "$(scan "\\\$wpdb->(query|get_results|get_var|get_row|get_col)\s*\(\s*[\"'][^\"']*\\\$" \
     | grep -v "prepare")"

# 6. Hardcoded script/style tags in templates (must enqueue).
report "no-hardcoded-assets" "<script src>/<link stylesheet> in PHP — enqueue instead" \
  "$(scan "<(script[^>]*\bsrc=|link[^>]*\brel=[\"']?stylesheet)")"

# 7. DISALLOW_FILE_EDIT present when a wp-config.php is in scope.
WPCONFIG="$(echo "$PHP_FILES" | grep -E '/wp-config\.php$' || true)"
if [ -n "$WPCONFIG" ]; then
  if echo "$WPCONFIG" | tr '\n' '\0' | xargs -0 grep -qE "define\(\s*['\"]DISALLOW_FILE_EDIT['\"]\s*,\s*true" 2>/dev/null; then
    echo "PASS  disallow-file-edit"
  else
    echo "FAIL  disallow-file-edit — wp-config.php present without define('DISALLOW_FILE_EDIT', true)"
    fails=$((fails + 1))
  fi
fi

echo "---"
if [ "$fails" -gt 0 ]; then
  echo "$fails check(s) FAILED"
  exit 1
fi
echo "all checks PASSED"
exit 0
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall