WordPress.org

Ready to get started?Download WordPress

Forums

when is do_all_pings called? (2 posts)

  1. Daniel Watrous
    Member
    Posted 3 years ago #

    Hello,

    I'm fighting with some slowdowns on a very high traffic blog and one of the admins where I host has blamed it on the Update Services settings (he suggests that there are too many ping URLs).

    My question is: when is do all pings actually executed. I see that in wp-includes\default-filters.php there is a line
    add_action( 'do_pings', 'do_all_pings', 10, 1 );

    Does that mean that do_all_pings is executed on every page load for my blog? It also seems that a function like this would be asynchronous, rather than forcing the page load to wait on all sites to be pinged.

    I appreciate any clarification you can offer

  2. Daniel Watrous
    Member
    Posted 3 years ago #

    I've done some testing by adding this code to wp-includes\comment.php in the do_all_pings() function

    $counter = get_option('do_all_pings_counter');
    	if ($counter) {
    		update_option('do_all_pings_counter', ++$counter);
    	} else {
    		update_option('do_all_pings_counter', 1);
    	}

    I've found that the counter only increments on publish and occasionally on update. It isn't triggered on general page loads and it isn't triggered when site visitors leave comments.

    I've also attempted to trap execution within the function by adding a call to
    exit;

    but execution didn't stop. It appears that this function is executed asynchronously and should have no affect on page load time even during a publish or update call for a post.

    Can anyone verify that this is accurate? Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic