From 1db2efb11bb5d4d1bf59bb727a78e40b831d1835 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 1 Nov 2025 20:13:00 +0000 Subject: [PATCH 1/7] Initial plan From ac29aff31fc3dd59199e8ececdc914c2c78fc40b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 1 Nov 2025 20:26:53 +0000 Subject: [PATCH 2/7] Fix router to support pretty permalinks and multiple entry points Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/server.feature | 33 +++++++++++++++++++++++++++++++++ router.php | 13 ++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/features/server.feature b/features/server.feature index 6317757..b48602a 100644 --- a/features/server.feature +++ b/features/server.feature @@ -15,3 +15,36 @@ Feature: Serve WordPress locally When I run `curl -sS localhost:8181/license.txt > /tmp/license.txt` And I run `cmp /tmp/license.txt license.txt` Then STDOUT should be empty + + Scenario: Access wp-login.php + Given a WP install + And I launch in the background `wp server --host=localhost --port=8182` + + When I run `curl -sS localhost:8182/wp-login.php` + Then STDOUT should contain: + """ +
Date: Sat, 1 Nov 2025 21:04:02 +0000 Subject: [PATCH 3/7] Fix failing tests: simplify scenarios and use explicit http protocol Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/server.feature | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/features/server.feature b/features/server.feature index b48602a..4918f2d 100644 --- a/features/server.feature +++ b/features/server.feature @@ -20,31 +20,19 @@ Feature: Serve WordPress locally Given a WP install And I launch in the background `wp server --host=localhost --port=8182` - When I run `curl -sS localhost:8182/wp-login.php` + When I run `curl -sS http://localhost:8182/wp-login.php` Then STDOUT should contain: """ - Date: Sat, 1 Nov 2025 21:21:14 +0000 Subject: [PATCH 4/7] Use wp option update instead of wp rewrite structure in test Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/server.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/server.feature b/features/server.feature index 4918f2d..29b0787 100644 --- a/features/server.feature +++ b/features/server.feature @@ -29,7 +29,7 @@ Feature: Serve WordPress locally Scenario: Pretty permalinks Given a WP install And I launch in the background `wp server --host=localhost --port=8183` - And I run `wp rewrite structure '/%postname%/'` + And I run `wp option update permalink_structure '/%postname%/'` When I run `curl -sS http://localhost:8183/?p=1` Then STDOUT should contain: From 9bd595cfb0639a660ff13fbc4d692c0de91c9db4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 19:40:25 +0000 Subject: [PATCH 5/7] Test actual pretty permalink URL instead of plain permalink Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/server.feature | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/features/server.feature b/features/server.feature index 29b0787..65f6e9c 100644 --- a/features/server.feature +++ b/features/server.feature @@ -30,8 +30,9 @@ Feature: Serve WordPress locally Given a WP install And I launch in the background `wp server --host=localhost --port=8183` And I run `wp option update permalink_structure '/%postname%/'` + And I run `wp rewrite flush` - When I run `curl -sS http://localhost:8183/?p=1` + When I run `curl -sSL http://localhost:8183/hello-world/` Then STDOUT should contain: """ Hello world! From 1800a84f6b689de4d6da6b0cbb898fcf70069240 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 5 Feb 2026 22:19:26 +0100 Subject: [PATCH 6/7] Install rewrite-command --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 1d86846..25cf7ae 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ }, "require-dev": { "wp-cli/entity-command": "^2", + "wp-cli/rewrite-command": "^2", "wp-cli/wp-cli-tests": "^5" }, "config": { From e184c57b1da4cfc953c17870b389388cb44756af Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 5 Feb 2026 22:25:32 +0100 Subject: [PATCH 7/7] Enforce HTTP --- router.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/router.php b/router.php index fdccc98..201aa28 100644 --- a/router.php +++ b/router.php @@ -107,6 +107,8 @@ function ( $url ) { $url = str_replace( $site_url_host, $_SERVER['HTTP_HOST'], $url ); } + $url = str_replace( 'https://', 'http://', $url ); + return $url; }, 20