From d1e4157e4cf721ca7b367c1e43e7de09c8045df3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 23:25:31 +0000 Subject: [PATCH 1/5] Initial plan From 50411e0dbe5c1c9993ef65dcedd615fddc8631dc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 23:28:47 +0000 Subject: [PATCH 2/5] Fix: Prevent HTML output during WordPress core update Add action hook to disable async translation updates that output HTML to the console when updating WordPress core. This prevents unwanted HTML tags and JavaScript from appearing in the command line output. The fix works by adding an early action hook (priority 1) on 'upgrader_process_complete' that removes the Language_Pack_Upgrader::async_upgrade action (priority 20) before it can execute and produce HTML output. Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- src/Core_Command.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Core_Command.php b/src/Core_Command.php index b9bbb2b4..5e99e3ea 100644 --- a/src/Core_Command.php +++ b/src/Core_Command.php @@ -1213,6 +1213,15 @@ public function update( $args, $assoc_args ) { require_once ABSPATH . 'wp-admin/includes/upgrade.php'; + // Prevent async translation updates which output HTML. + add_action( + 'upgrader_process_complete', + function () { + remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 ); + }, + 1 + ); + if ( $update->version ) { WP_CLI::log( "Updating to version {$update->version} ({$update->locale})..." ); } else { From abc3c8d07bec929a76c49789e8708ff7d3eb1afb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 6 Nov 2025 23:42:49 +0000 Subject: [PATCH 3/5] Add Behat test to verify no HTML output during core update Add test scenario that verifies async translation updates don't output HTML tags during WordPress core updates. The test checks that the output doesn't contain
,