Throttle generic pings to no more than once per hour. Props Denis-de-Bernardy. fixes #6698

git-svn-id: https://develop.svn.wordpress.org/trunk@11410 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-05-20 17:03:19 +00:00
parent cff6ae81fc
commit bc3941424e
3 changed files with 4 additions and 3 deletions

View File

@ -1324,9 +1324,6 @@ function do_all_pings() {
if ( is_array($trackbacks) ) if ( is_array($trackbacks) )
foreach ( $trackbacks as $trackback ) foreach ( $trackbacks as $trackback )
do_trackbacks($trackback); do_trackbacks($trackback);
//Do Update Services/Generic Pings
generic_ping();
} }
/** /**

View File

@ -186,6 +186,7 @@ add_action('do_feed_rss', 'do_feed_rss', 10, 1);
add_action('do_feed_rss2', 'do_feed_rss2', 10, 1); add_action('do_feed_rss2', 'do_feed_rss2', 10, 1);
add_action('do_feed_atom', 'do_feed_atom', 10, 1); add_action('do_feed_atom', 'do_feed_atom', 10, 1);
add_action('do_pings', 'do_all_pings', 10, 1); add_action('do_pings', 'do_all_pings', 10, 1);
add_action('do_generic_ping', 'generic_ping', 10, 1);
add_action('do_robots', 'do_robots'); add_action('do_robots', 'do_robots');
add_action('sanitize_comment_cookies', 'sanitize_comment_cookies'); add_action('sanitize_comment_cookies', 'sanitize_comment_cookies');
add_action('admin_print_scripts', 'print_head_scripts', 20); add_action('admin_print_scripts', 'print_head_scripts', 20);

View File

@ -3244,6 +3244,9 @@ function _transition_post_status($new_status, $old_status, $post) {
if ( '' == get_the_guid($post->ID) ) if ( '' == get_the_guid($post->ID) )
$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) ); $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) );
do_action('private_to_published', $post->ID); // Deprecated, use private_to_publish do_action('private_to_published', $post->ID); // Deprecated, use private_to_publish
// do generic pings once per hour at most
if ( !wp_next_scheduled('do_generic_ping') )
wp_schedule_single_event(time() + 3600, 'do_generic_ping');
} }
// Always clears the hook in case the post status bounced from future to draft. // Always clears the hook in case the post status bounced from future to draft.