Skip to content

Latest commit

 

History

History
241 lines (180 loc) · 6.1 KB

File metadata and controls

241 lines (180 loc) · 6.1 KB

PHP 8.5 Upgrade Analysis

Current Environment:

  • PHP Version: 7.4.30
  • WordPress: 6.8.3 (can update to 6.9.4)
  • Target: PHP 8.5 (Note: PHP 8.5 doesn't exist yet - latest is 8.3/8.4)
  • Issue: #37

WordPress Core Compatibility

WordPress 6.9.x supports PHP 8.3+ (and has beta support for 8.4)

  • Recommended: Update to WordPress 6.9.4 first
  • WP minimum requirement: PHP 7.4 (but 8.0+ recommended)

Critical Risk Plugins (Likely to Break)

🚨 HIGH RISK - Abandoned/Outdated

  1. Caldera Forms (v1.9.4) ⚠️ CRITICAL

    • Status: ABANDONED (last update 2019)
    • PHP 8.x compatibility: Unknown/Unlikely
    • Active on site: YES
    • Recommendation: Migrate to WPForms or Gravity Forms ASAP
    • Why: Uses old PHP patterns, no active development
  2. Ninja Forms (v3.2.16) ⚠️ HIGH RISK

    • Current version: 3.2.16 (2018)
    • Latest available: 3.14.2
    • Status: Very outdated
    • Recommendation: Update to 3.14.2 or migrate
  3. Google Analytics for WordPress (v8.15) ⚠️

    • Current: 8.15 (MonsterInsights)
    • Latest: 10.1.2
    • Recommendation: Update to latest version
  4. Theme My Login (v7.1.5) ⚠️

    • Outdated by several versions
    • Latest: 7.1.14
    • Recommendation: Update and test

Medium Risk Plugins (Needs Testing)

🟡 MEDIUM RISK - Major Version Behind

  1. Elementor (v3.13.4) 🟡

    • Current: 3.13.4
    • Latest: 4.0.3
    • Impact: Major version behind
    • Recommendation: Update to 4.x (test on staging first)
  2. Jetpack (v12.1.1) 🟡

    • Current: 12.1.1
    • Latest: 15.7.1
    • Impact: Very outdated (3+ major versions)
    • Recommendation: Update to latest
  3. WP Optimize (v3.2.15) 🟡

    • Current: 3.2.15
    • Latest: 4.5.1
    • Recommendation: Update to 4.x
  4. The Events Calendar (v6.0.13.1) 🟡

    • Current: 6.0.13.1
    • Latest: 6.15.20
    • Recommendation: Update to latest
  5. Redirection (v5.3.10) 🟡

    • Current: 5.3.10
    • Latest: 5.7.5
    • Recommendation: Update
  6. Imagify (v2.1.1) 🟡

    • Current: 2.1.1
    • Latest: 2.2.7
    • Recommendation: Update

Low Risk Plugins (Should Be OK)

✅ LOW RISK - Recently Updated

  1. Advanced Access Manager (v7.1.0)

    • Relatively recent
    • Active development
  2. Astra Theme (v4.1.5)

    • Latest: 4.13.0
    • Active development, should support PHP 8.x
  3. Wordfence (v7.9.2)

    • Latest: 8.1.4
    • Needs update but actively maintained
  4. Autoptimize (v3.1.15.1)

    • Recent version, PHP 8.x compatible

Custom/Unknown Plugins

  1. Cactus Companion (v1.0.6)

    • Custom plugin?
    • Recommendation: Manual code review required
  2. Re-Welcome (v1.0)

    • Custom plugin?
    • Recommendation: Manual code review required
  3. PHCommunity.tech Theme (v1.0.0)

    • Custom theme (inactive)
    • Recommendation: Code review for PHP 8.x compatibility

PHP 7.4 → 8.x Breaking Changes to Watch For

Common issues in plugins:

  1. Removed Functions/Features:

    • create_function() - removed in PHP 8.0
    • each() - removed in PHP 8.0
    • Unparenthesized ternaries - deprecated
    • Curly brace syntax for array access
  2. Type System Changes:

    • Stricter type checking
    • Return type declarations
    • Union types enforcement
  3. Error Handling:

    • Many warnings became errors
    • Null handling changes

Recommended Upgrade Path

Phase 1: Preparation (Do This First)

# 1. Backup everything
wp db export backup-pre-php8-$(date +%Y%m%d).sql --allow-root

# 2. Update WordPress core
wp core update --version=6.9.4 --allow-root
wp core update-db --allow-root

# 3. Update all safe plugins
wp plugin update akismet advanced-access-manager wordfence imagify --allow-root

Phase 2: Critical Plugin Migration

  1. Replace Caldera Forms:

    # Export Caldera form data
    # Install WPForms or Gravity Forms
    # Recreate forms
    # Deactivate Caldera
  2. Update Major Plugins:

    wp plugin update elementor jetpack astra-sites the-events-calendar --allow-root

Phase 3: PHP Version Upgrade

  1. Install PHP Compatibility Checker:

    wp plugin install php-compatibility-checker --activate --allow-root
    wp eval 'do_action("wpephpcompat_start_test_scan");' --allow-root
  2. Test with PHP 8.1 first (safer than jumping to 8.3+)

    • Change PHP version in Local by Flywheel
    • Test all functionality
    • Check error logs: tail -f /path/to/error.log
  3. Then test PHP 8.3

    • Repeat testing
    • Fix any issues

Phase 4: Testing Checklist

  • Homepage loads
  • Admin dashboard works
  • Forms submit properly (critical - Caldera replacement)
  • Events calendar functions
  • User login/registration
  • Elementor editor loads
  • Image optimization works
  • Jetpack features work
  • Security plugins active
  • No PHP errors in logs

Immediate Actions Required

  1. Install PHP Compatibility Checker plugin
  2. ⚠️ Address Caldera Forms IMMEDIATELY - this is abandoned and will likely break
  3. 🔄 Update all plugins to latest versions
  4. 📊 Run compatibility scan
  5. 🧪 Test on staging with PHP 8.1 → 8.3 progression

Command to Check PHP Compatibility

# Install compatibility checker
wp plugin install php-compatibility-checker --activate --allow-root

# Or use WP-CLI to scan files directly
cd wp-content/plugins
for plugin in */; do
    echo "=== Scanning $plugin ==="
    find "$plugin" -name "*.php" | xargs grep -l "create_function\|each(\|extract(" 2>/dev/null
done

Estimated Risk Level

Component Risk Action Required
WordPress Core ✅ Low Update to 6.9.4
Caldera Forms 🚨 Critical Replace immediately
Elementor 🟡 Medium Update to 4.x
Jetpack 🟡 Medium Update to 15.x
Custom Plugins ❓ Unknown Code review
Astra Theme ✅ Low Update to latest

Overall Risk: 🟡 MEDIUM-HIGH (due to Caldera Forms)