From d2f2dc19f53d452046096582acbf7549b1844ff8 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 23 Oct 2026 10:03:51 +0000 Subject: [PATCH] Use GET request to download theme from underscores.me underscores.me now responds with 403 to all POST requests, but still serves the generated theme zip when the same form fields are passed as query arguments. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013rF1yyKWPmtBrXEVSrPJUW --- src/Scaffold_Command.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Scaffold_Command.php b/src/Scaffold_Command.php index dc3441b1..e9e6d4df 100644 --- a/src/Scaffold_Command.php +++ b/src/Scaffold_Command.php @@ -412,15 +412,15 @@ public function underscores( $args, $assoc_args ) { $body['underscoresme_woocommerce'] = 1; } - $tmpfname = wp_tempnam( $url ); - $post_args = [ + $tmpfname = wp_tempnam( $url ); + $request_args = [ 'timeout' => $timeout, - 'body' => $body, 'stream' => true, 'filename' => $tmpfname, ]; - $response = wp_remote_post( $url, $post_args ); + // underscores.me rejects POST requests, but accepts the same form fields as query args. + $response = wp_remote_get( add_query_arg( urlencode_deep( $body ), $url ), $request_args ); if ( is_wp_error( $response ) ) { WP_CLI::error( $response );