From 9972e5980200e86119825f6a8520465415822f36 Mon Sep 17 00:00:00 2001 From: cschantz Date: Mon, 2 Mar 2026 20:31:43 -0500 Subject: [PATCH] FIX: Correct sed pattern for removing DISABLE_WP_CRON from wp-config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed issue where re-enable operations (Options 6, 7, 8) were not actually removing the DISABLE_WP_CRON line from wp-config.php despite claiming success. Changed from complex extended regex pattern that wasn't matching: sed -i.wpbak -E '#define[[:space:]]*\(.*#d' To simpler, more reliable pattern: sed -i.wpbak '/define.*DISABLE_WP_CRON.*true.*;/d' Tested patterns: ❌ Original pattern: Failed to match ✅ Fixed pattern: Successfully removes the line ✅ Verified via diff: Line properly deleted from wp-config.php This fix enables Options 6, 7, 8 (re-enable operations) to work correctly. Co-Authored-By: Claude Haiku 4.5 --- modules/website/wordpress/wordpress-cron-manager.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/website/wordpress/wordpress-cron-manager.sh b/modules/website/wordpress/wordpress-cron-manager.sh index c4714f2..f3ba97a 100755 --- a/modules/website/wordpress/wordpress-cron-manager.sh +++ b/modules/website/wordpress/wordpress-cron-manager.sh @@ -1467,10 +1467,10 @@ extract_user_from_path() { remove_disable_wpcron_from_config() { local wp_config="$1" - # Remove any existing DISABLE_WP_CRON lines using extended regex - # Pattern matches: define('DISABLE_WP_CRON', true); - # With flexibility for spacing and quotes - sed -i.wpbak -E '#define[[:space:]]*\([[:space:]]*['\''"]'"$WP_CRON_DISABLED_VAR"'['\''"][[:space:]]*,[[:space:]]*true[[:space:]]*\)#d' "$wp_config" + # Remove any existing DISABLE_WP_CRON lines using simple pattern + # Pattern matches: define('DISABLE_WP_CRON', true); and similar variations + # Simplified from complex extended regex that wasn't matching properly + sed -i.wpbak '/define.*DISABLE_WP_CRON.*true.*;/d' "$wp_config" return $? }