[wp-trac] [WordPress Trac] #63547: wp_remote_post not respecting timeout & blocking params

WordPress Trac noreply at wordpress.org
Fri Aug 22 06:41:45 UTC 2025


#63547: wp_remote_post not respecting timeout & blocking params
--------------------------+--------------------------
 Reporter:  mihai200      |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  6.9
Component:  HTTP API      |     Version:  4.6
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  performance
--------------------------+--------------------------

Comment (by pmbaldha):

 I have created a ticket for it:
 https://core.trac.wordpress.org/ticket/63858.

 Replying to [comment:7 westonruter]:
 > Another workaround could be to spawn WP Cron at `shutdown` instead of at
 `wp_loaded`. I'm not sure why `wp_loaded` was chosen to begin with:
 >
 > {{{#!php
 > <?php
 > /**
 >  * Plugin Name: WP Cron Perf Fix
 >  */
 >
 > namespace WPCronPerfFix;
 >
 > use CurlHandle;
 >
 > // Facilitate testing the performance impact by disabling with a query
 parameter.
 > if ( isset( $_GET['disable_wp_cron_perf_fix'] ) || defined( 'WP_CLI' ) )
 {
 >       return;
 > }
 >
 > /**
 >  * Spawns WP Cron at shutdown.
 >  */
 > function spawn_wp_cron_at_shutdown() {
 >       // Make sure response is flushed so the TTFB hopefully will get
 marked here even if the following finish requests aren't available.
 >       flush();
 >
 >       // End the response, as is done in wp-cron.php.
 >       if ( function_exists( 'fastcgi_finish_request' ) ) {
 >               fastcgi_finish_request();
 >       } elseif ( function_exists( 'litespeed_finish_request' ) ) {
 >               litespeed_finish_request();
 >       }
 >
 >       _wp_cron();
 > }
 >
 > // Move WP Cron from being spawned at wp_loaded to happen at shutdown
 instead.
 > if ( has_action( 'init', 'wp_cron' ) ) {
 >       remove_action( 'init', 'wp_cron' );
 >       add_action( 'shutdown', __NAMESPACE__ .
 '\spawn_wp_cron_at_shutdown' );
 > }
 > }}}
 >
 >

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63547#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list