From 815f734b9c3a0b6718933986ba475a4104605314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Sat, 15 Nov 2025 00:28:27 +0100 Subject: [PATCH] [Boot] Verify permalink structure is actually set during WordPress installation The previous implementation of installWordPress() relied on `update_option`'s return value to determine if pretty permalinks were successfully enabled. However, `update_option` returns false when the value hasn't changed, e.g. when it already was set to what we need. This led to incorrect detection. This change explicitly verifies the permalink structure was set by reading it back with `get_option` and comparing it to the expected value. This ensures we accurately detect whether pretty permalinks are active, regardless of whether the option already existed or was newly created. --- packages/playground/wordpress/src/boot.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/playground/wordpress/src/boot.ts b/packages/playground/wordpress/src/boot.ts index 234c0df243..ecd23f8560 100644 --- a/packages/playground/wordpress/src/boot.ts +++ b/packages/playground/wordpress/src/boot.ts @@ -529,12 +529,17 @@ async function installWordPress(php: PHP) { exit; } require $wp_load; + $nice_permalinks = '/%year%/%monthnum%/%day%/%postname%/'; $option_result = update_option( 'permalink_structure', - '/%year%/%monthnum%/%day%/%postname%/' + $nice_permalinks ); ob_clean(); - echo $option_result ? '1' : '0'; + if ( get_option( 'permalink_structure' ) === $nice_permalinks ) { + echo '1'; + } else { + echo '0'; + } ob_end_flush(); `, env: {