File manager - Edit - /home/kdmucyyv/deep-diagnostic-paltutors.sh
Back
#!/bin/bash cd /home/kdmucyyv/paltutors.co.uk echo "==========================================" echo "DEEP DIAGNOSTIC - paltutors.co.uk" echo "==========================================" # 1. Check what's actually in mu-plugins now echo "" echo "1. CURRENT MU-PLUGINS STATUS:" if [ -d "wp-content/mu-plugins" ]; then echo "mu-plugins directory exists with:" ls -la wp-content/mu-plugins/ else echo "mu-plugins directory missing" fi # 2. Check active theme echo "" echo "2. ACTIVE THEME:" ACTIVE_THEME=$(wp db query "SELECT option_value FROM wp_options WHERE option_name='template'" 2>/dev/null | tail -1) if [ -z "$ACTIVE_THEME" ]; then # Try PHP method ACTIVE_THEME=$(php -r " require_once('wp-config.php'); \$conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); \$result = \$conn->query(\"SELECT option_value FROM wp_options WHERE option_name='template'\"); if (\$row = \$result->fetch_assoc()) echo \$row['option_value']; " 2>/dev/null) fi echo "Active theme: $ACTIVE_THEME" # 3. Check if theme directory exists if [ -n "$ACTIVE_THEME" ]; then if [ -d "wp-content/themes/$ACTIVE_THEME" ]; then echo "✓ Theme directory exists" # Check functions.php for any code that might run early if [ -f "wp-content/themes/$ACTIVE_THEME/functions.php" ]; then echo "" echo "3. ANALYZING functions.php:" # Look for actions/hooks that run early grep -n "add_action.*plugins_loaded\|add_action.*init\|add_action.*after_setup_theme" "wp-content/themes/$ACTIVE_THEME/functions.php" | head -10 # Look for direct wp_is_block_theme calls echo "" echo "Looking for wp_is_block_theme in theme:" grep -n "wp_is_block_theme" "wp-content/themes/$ACTIVE_THEME/functions.php" 2>/dev/null || echo "Not found in functions.php" # Search all theme files echo "" echo "Searching ALL theme files for wp_is_block_theme:" find "wp-content/themes/$ACTIVE_THEME" -name "*.php" -exec grep -l "wp_is_block_theme" {} \; 2>/dev/null | head -5 fi else echo "✗ Theme directory MISSING!" fi fi # 4. Check for any remaining plugin traces echo "" echo "4. CHECKING FOR ACTIVE PLUGINS:" if [ -d "wp-content/plugins" ]; then ACTIVE_PLUGINS=$(find wp-content/plugins -maxdepth 1 -type d | grep -v "^wp-content/plugins$" | wc -l) echo "Found $ACTIVE_PLUGINS plugin folders" # Check if any plugin might be loading via different method echo "Checking for plugins that auto-load:" find wp-content/plugins -name "*.php" -exec grep -l "add_action.*plugins_loaded\|add_action.*init" {} \; 2>/dev/null | head -5 fi # 5. Check WordPress core version echo "" echo "5. WORDPRESS VERSION:" if [ -f "wp-includes/version.php" ]; then WP_VERSION=$(grep "wp_version =" wp-includes/version.php | cut -d"'" -f2) echo "WordPress: $WP_VERSION" fi # 6. Check PHP version echo "" echo "6. PHP VERSION:" php -v | head -1 # 7. Look for the error in real-time echo "" echo "7. CAPTURING ERROR (loading site once):" curl -s https://paltutors.co.uk/ | grep -i "wp_is_block_theme" | head -3 # 8. Check error log echo "" echo "8. RECENT ERROR LOG ENTRIES:" if [ -f "wp-content/debug.log" ]; then tail -30 wp-content/debug.log | grep -B2 -A2 "wp_is_block_theme" | tail -20 else echo "No debug.log found. Enabling debug logging..." # Enable debug logging temporarily cp wp-config.php wp-config.php.temp sed -i "/require_once/a\define('WP_DEBUG', true);\ndefine('WP_DEBUG_LOG', true);\ndefine('WP_DEBUG_DISPLAY', false);" wp-config.php # Load site to generate log curl -s https://paltutors.co.uk/ > /dev/null sleep 2 if [ -f "wp-content/debug.log" ]; then echo "Debug log created. Contents:" tail -30 wp-content/debug.log else echo "Still no debug log" fi # Restore original wp-config mv wp-config.php.temp wp-config.php fi # 9. Create a test to isolate the issue echo "" echo "9. ISOLATION TEST - Switch to default theme:" echo "Switching to Twenty Twenty-Four..." # Force switch to default theme php -r " require_once('wp-config.php'); \$conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); \$conn->query(\"UPDATE wp_options SET option_value='twentytwentyfour' WHERE option_name='template'\"); \$conn->query(\"UPDATE wp_options SET option_value='twentytwentyfour' WHERE option_name='stylesheet'\"); echo \"Theme switched to twentytwentyfour\n\"; " # Test after theme switch echo "Testing site with default theme..." if curl -s https://paltutors.co.uk/ | grep -q "wp_is_block_theme"; then echo "✗ Error STILL present with default theme" else echo "✓ No error with default theme - YOUR THEME IS THE ISSUE" fi # 10. Check for .htaccess or server config issues echo "" echo "10. CHECKING .htaccess:" if [ -f ".htaccess" ]; then echo ".htaccess exists with:" head -10 .htaccess fi echo "" echo "==========================================" echo "DIAGNOSTIC COMPLETE" echo "=========================================="
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings