From wp-skills
Debug WordPress Studio local sites — inspect SQLite database, check logs, troubleshoot plugins/themes, and diagnose common issues in the Studio local environment.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wp-skills:studio-debugThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are helping the user debug a WordPress site running in the **WordPress Studio** local environment.
You are helping the user debug a WordPress site running in the WordPress Studio local environment.
sqlite-database-integration mu-pluginwp-content/database/.ht.sqliteIdentify the site directory
wp-config.php and wp-content/database/.ht.sqlite to confirm it's a Studio siteUnderstand the problem
Gather diagnostics (run relevant checks in parallel where possible)
wp-content/debug.log if it existsdefine('WP_DEBUG', true) and define('WP_DEBUG_LOG', true) in wp-config.phpsqlite3 CLI to query the SQLite database directly:
sqlite3 wp-content/database/.ht.sqlite
.tables — list all tablesSELECT option_name, option_value FROM wp_options WHERE option_name IN ('siteurl', 'home', 'active_plugins', 'stylesheet', 'template'); — core site settingsSELECT option_name, option_value FROM wp_options WHERE option_name = 'active_plugins'; — check active plugins (PHP serialized)PRAGMA integrity_check; — check database healthPRAGMA table_info(wp_options); — inspect table schema-readonly flag when just readingwp-content/database/.ht.sqlite active_plugins option to see what's activewp-content/plugins/ for installed pluginswp-content/themes/ for installed themeswp-config.php for misconfigurationsDB_DIR and DB_FILE constants if presentwp-content/mu-plugins/ for the SQLite integration plugin fileswp-content/db.php drop-in — this is critical for SQLite to workwp-content/database/ directory exists and is writable.ht.sqlite file size (0 bytes = likely corrupted/empty).ht.sqlite-journal or .ht.sqlite-wal files (WAL mode indicators)Diagnose and report
Fix (if requested)
UPDATE wp_options SET option_value = 'a:0:{}' WHERE option_name = 'active_plugins';
UPDATE wp_options SET option_value = 'twentytwentyfive' WHERE option_name = 'stylesheet';
UPDATE wp_options SET option_value = 'twentytwentyfive' WHERE option_name = 'template';
.ht.sqlite-journal filesPRAGMA integrity_check;wp_options for permalink_structure.htaccess or rewrite rules (Studio handles this internally)active_plugins from wp_optionsWhen a site won't start and you suspect a plugin conflict, run the plugin bisect script to automatically find the offending plugin(s). This deactivates each active plugin one at a time, attempts to start the site, and reports which plugin(s) are preventing the site from starting.
bash /tmp/studio-bisect.shBisect script:
#!/bin/bash
# This script deactivates all active plugins one by one and checks if the site starts successfully after each deactivation.
set -euo pipefail
echo "Fetching active plugins..."
raw_output=$(studio wp plugin list --status=active --fields=name --format=json 2>/dev/null || true)
# Extract the JSON array from the noisy output (find the first [...] block)
json=$(echo "$raw_output" | grep -oE '\[.*\]' | head -1)
if [[ -z "$json" ]]; then
echo "❌ Failed to parse plugin list. Raw output:"
echo "$raw_output"
exit 1
fi
# Parse plugin names from JSON
plugins=()
while IFS= read -r line; do
plugins+=("$line")
done < <(echo "$json" | python3 -c "
import sys, json
data = json.load(sys.stdin)
for p in data:
print(p['name'])
")
if [[ ${#plugins[@]} -eq 0 ]]; then
echo "❌ No active plugins found."
exit 1
fi
echo "Found ${#plugins[@]} active plugins:"
printf " - %s\n" "${plugins[@]}"
echo ""
conflicting=()
for plugin in "${plugins[@]}"; do
echo "=========================================="
echo "Testing: $plugin"
echo "=========================================="
echo "⏸ Deactivating $plugin..."
if ! studio wp plugin deactivate "$plugin" 2>/dev/null; then
echo "⚠️ Failed to deactivate $plugin, skipping."
continue
fi
echo "🚀 Starting site..."
if studio site start 2>/dev/null; then
echo ""
echo "🎯 Conflicting plugin found: $plugin"
conflicting+=("$plugin")
echo "🛑 Stopping site..."
studio site stop 2>/dev/null || true
else
echo "❌ Site still fails without $plugin."
fi
echo "🔄 Reactivating $plugin..."
studio wp plugin activate "$plugin" 2>/dev/null || true
echo ""
done
echo "=========================================="
echo "RESULTS"
echo "=========================================="
if [[ ${#conflicting[@]} -gt 0 ]]; then
echo "🎯 Conflicting plugins found (${#conflicting[@]}):"
for p in "${conflicting[@]}"; do
echo " ❌ $p"
done
else
echo "✅ No single conflicting plugin found."
echo " The issue may involve multiple plugins interacting."
fi
To run: save to a temp file and execute with bash /tmp/studio-bisect.sh
siteurl and home from wp_optionsThe SQLite translation layer can cause issues that wouldn't appear with MySQL:
To check for translation errors:
SELECT * FROM _mysql_data_types_cache LIMIT 20;
-readonly flag with sqlite3 when only reading datanpx claudepluginhub sejas/wp-skillsAudits WordPress core, PHP, MySQL/MariaDB, plugins, and themes for outdated versions, compatibility issues, and updates via WP-CLI over SSH.
Automates WordPress operations via WP-CLI: search-replace, DB export/import, plugin/theme/user management, cron, multisite, and scripting with wp-cli.yml.
Performs archaeological analysis of WordPress sites: detects page builders, analyzes plugins, maps content structure, identifies orphaned shortcodes, and assesses security posture.