[wp-hackers] When a ping is sent ?

Andy Skelton skeltoac at gmail.com
Sat Dec 17 16:19:34 GMT 2005


The function that pings services like ping-o-matic, generic_ping(), is
run at the 'publish_post' hook, so any time you save a post with
status 'publish'. This includes future posts but I don't think that
matters. Generic pings do not reveal the URL of the published post.

I am finishing up a patch that handles future pings in a sane way.
This is how it should work:

Anything not future-dated will have trackbacks, pingbacks and
attachments checked immediately. This is done by a pinger (script)
that runs asynchronously, so the user never sees the delay.

Anything future dated will have its trackbacks and pingbacks scheduled
for the minute of post_date_gmt. The first page load in or after that
minute will spawn the pinger. Again, the user never notices the delay.
The check for these pings is done using cached data, so this doesn't
add to the query count.

Attachment checks are done immediately, rather than scheduled for
post_date_gmt. This is so that if the post is first viewed via a feed
by an aggregator such as Bloglines, the attachments are already in
place and can be included. These attachment checks aren't really
"pings" but are HEAD requests to discover the file's mime type. They
do no reveal the post URL so it's not a problem.

Also, if you decide to move a future-dated post from 'publish' to
'draft', its scheduled pings will be cancelled. So no ghost pings will
go out if you change your mind about blogging "I QUIT!" next Friday.

Anything else before I upload the patch?

Andy


More information about the wp-hackers mailing list