![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Changeset [60293]: Posts, Post Types: Add `pre_post_insert` action hook before inserting ...
Posts, Post Types: Add pre_post_insert
action hook before inserting a new post.
This changeset adds a pre_post_insert
action hook before inserting a new post via wp_insert_post()
, allowing developers to modify or inspect post data before insertion. It brings consistency with the pre_post_update
action hook triggered when a post is updated.
Props Hrohh, peterwilsoncc, audrasjb. Fixes #63115.
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Ticket #63547 (wp_remote_post not respecting timeout & blocking params) reopened
I'm re-opening this for us to track on the Performance team.
Performance could be negatively impacted because WP Cron is spawned with these args:
'timeout' => 0.01, 'blocking' => false,
Since wp_cron()
runs at the init
action, which then schedules _wp_cron()
to run at the wp_loaded
action, meaning that if the loopback request takes longer than expected, every page load that spawns crawn will have a bad TTFB.
What follows is what I had drafted before @TimothyBlynJacobs replied noting the existing issue in Requests.
I created a Sleepy Responses plugin to help test this, where a response can be slowed down by 5 seconds by adding ?sleep=5
to the URL.
I adapted your WP-CLI test script as follows (e.g. try-http-api.php
):
<?php $args = array( 'timeout' => 0.01, 'blocking' => false, 'sslverify' => false, ); $url = site_url( '/wp-cron.php?doing_wp_cron' ); global $argv; if ( isset( $argv[3] ) ) { if ( str_starts_with( $argv[3], 'http://' ) || str_starts_with( $argv[3], 'https://' ) ) { $url = $argv[3]; } elseif ( str_starts_with( $argv[3], '/' ) ) { $url = site_url( $argv[3] ); } else { WP_CLI::error( sprintf( 'Bad URL: %s', $argv[3] ) ); } } $start = microtime( true ); $response = wp_remote_post( $url, $args ); $end = microtime( true ); $exec_time = $end - $start; WP_CLI::log( sprintf( 'Requested URL: %s', $url ) ); WP_CLI::log( sprintf( 'Execution time: %s seconds', round( $exec_time, 4 ) ) ); if ( is_wp_error( $response ) ) { WP_CLI::error( sprintf( '%s (%s)', $response->get_error_message(), $response->get_error_code() ) ); } elseif ( wp_remote_retrieve_response_code( $response ) ) { WP_CLI::error( sprintf( 'Expected non-blocking request to return empty response code but got %s', wp_remote_retrieve_response_code( $response ) ) ); } elseif ( $end - $start > 0.1 ) { WP_CLI::error( 'Response took unexpected amount of time for non-blocking request.' ); } else { WP_CLI::log( 'OK ✅' ); }
Here's what I'm seeing:
$ wp eval-file try-http-api.php '/?sleep=3' Requested URL: http://localhost:8000/?sleep=3 Execution time: 1.0174 seconds Error: Response took unexpected amount of time for non-blocking request.
$ wp eval-file try-http-api.php 'https://wordpress.org/' Requested URL: https://wordpress.org/ Execution time: 0.5602 seconds Error: Response took unexpected amount of time for non-blocking request.
Note that plugins aren't loaded in requests to wp-cron.php
so if I manually edit the file to add a sleep(3)
at the top, then I also get an error:
$ wp eval-file try-http-api.php '/wp-cron.php?doing_wp_cron' Requested URL: http://localhost:8000/wp-cron.php?doing_wp_cron Execution time: 1.0125 seconds Error: Response took unexpected amount of time for non-blocking request.
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Kenyan dies in custody after arrest for online post
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
'Have my house' - Usyk invites Trump to witness Ukraine war
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
BBC on the ground as National Guard set up in Los Angeles
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Trump's intervention in LA is a political fight he is eager to have
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Schwarzenegger: Hey, stop whining, do something on climate change
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Proud Boys sue US government for $100m over Jan 6 prosecutions
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Home secretary yet to agree deal three days before spending review
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Newsom says Trump is ‘hoping for chaos’ as national guard arrives in LA after protests – US politics
Gavin Newsom says president is looking to ‘justify more crackdowns’ after deploying 2,000 troops to LA county
Here are a selection of photographs from protests in the early hours of Sunday morning.
Immigration officers could be in California for a month, a Democrat congresswoman has been told.
Continue reading...![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Portugal v Spain: Nations League final – football live
Updates from the 8pm BST kick-off in Munich
Have any thoughts? Send them to Dominic via email
We’re under way.
OK, OK, so there’s another biggish sporting event going on elsewhere in Europe today … catch the final moments with Daniel Harris here:
Continue reading...![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
The Gold season two review – this thrilling tale of stolen millions is top quality British drama
Thunderingly good performances, including Hugh Bonneville at his best, drive this story of the Brink’s-Mat heist. This time round, it’s the 1990s, the locations are sunnier and the action has gone international
At the end of the first series of The Gold, it dawned on the officers of the Met’s Flying Squad that for all of their multiple investigations into the infamous Brink’s-Mat robbery of 1983, they had only ever been chasing half of the stolen bullion. Arriving two years after its highly entertaining predecessor, series two sets off with an irresistible premise: what exactly happened to the rest of it?
The trouble is that the show doesn’t know the answer, though it freely admits this. None of the gold has ever been recovered, but a note at the beginning explains that the series is based on both real events and theories as to where the loot went. As before, some of the characters are real and some invented. The focus, this time, is on bringing down the ones who got away. The police are hot on the heels of the charming rogue John Palmer (Tom Cullen), AKA “Goldfinger”, who talked his way out of a conviction so convincingly in series one. They’re also trying to track down Charlie Miller (Sam Spruell), a fictional amalgam of various south London villains, who has come away from the robbery with a lot of gold to hide and only loose ideas of what to do with it.
Continue reading...![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
mail/claws-mail - 3.21.0_1
Fixes errors like:
(claws-mail:51313): GdkPixbuf-WARNING **: 12:43:20.914: Error loading XPM image loader: Image type “xpm” is not supported
stock_pixmap.c:836 Condition pix_d->pixbuf != NULL failed
that prevent icons from being displayed after e129c081e39271eda.
PR: 285900
Reported by: Fabian Keil <fk@fabiankeil.de>
Reviewed by: polarian@polarian.dev
Tested by: Chris Hutchinson <portmaster@bsdforge.com>
Approved by: Chris Hutchinson <portmaster@bsdforge.com> (maintainer)
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
x11/lightdm-kde-greeter - 6.0.3
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Alcaraz stuns Sinner in extraordinary French Open final
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Liechtenstein friendly has 'no bearing' on World Cup quest
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)
Israel warns it will stop aid yacht heading for Gaza
![[syndicated profile]](https://www.dreamwidth.org/img/silk/identity/feed.png)