WordPress Trac ([syndicated profile] wordpresstrac_feed) wrote2025-06-08 09:20 pm

Ticket #63115 (wp_insert_post missing do_action for pre_post_insert) closed

Posted by audrasjb

fixed:

In 60293:

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.

WordPress Trac ([syndicated profile] wordpresstrac_feed) wrote2025-06-08 09:20 pm

Changeset [60293]: Posts, Post Types: Add `pre_post_insert` action hook before inserting ...

Posted by audrasjb

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.

WordPress Trac ([syndicated profile] wordpresstrac_feed) wrote2025-06-08 09:06 pm

Ticket #63547 (wp_remote_post not respecting timeout & blocking params) reopened

Posted by westonruter

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.
The Guardian ([syndicated profile] guardianworldnews_feed) wrote2025-06-08 09:09 pm

Newsom says Trump is ‘hoping for chaos’ as national guard arrives in LA after protests – US politics

Posted by Lucy Campbell (now); Maya Yang and Harry Taylor (earlier)

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...
The Guardian ([syndicated profile] guardianworldnews_feed) wrote2025-06-08 09:08 pm

Portugal v Spain: Nations League final – football live

Posted by Dominic Booth

  • 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...
The Guardian ([syndicated profile] guardianworldnews_feed) wrote2025-06-08 09:00 pm

The Gold season two review – this thrilling tale of stolen millions is top quality British drama

Posted by Rebecca Nicholson

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...
FreshPorts news ([syndicated profile] freshport_news_feed) wrote2025-06-08 08:52 pm

mail/claws-mail - 3.21.0_1

mail/claws-mail: add gdk-pixbuf-extra run-dependency

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)