Index: wp-includes/comment.php =================================================================== --- wp-includes/comment.php (revision 4081) +++ wp-includes/comment.php (working copy) @@ -635,15 +635,35 @@ } function generic_ping($post_id = 0) { + $errors = get_option('ping_errors'); + if ( !is_array($errors) ) + $errors = array(); $services = get_settings('ping_sites'); $services = preg_replace("|(\s)+|", '$1', $services); // Kill dupe lines $services = trim($services); if ( '' != $services ) { + $update_ping_sites = false; $services = explode("\n", $services); - foreach ($services as $service) { - weblog_ping($service); + foreach ($services as $i => $service) { + $error = weblog_ping($service); + if ( $error ) { + if ( !isset($errors[$service]) ) + $errors[$service] = array('count' => 0); + $errors[$service]['count']++; + $errors[$service]['last_message'] = $error; + if ( $errors[$service]['count'] > 25 || + $error == "DO NOT PING THIS SERVICE AGAIN!" ) { + unset($services[$i]); + $update_ping_sites = true; + } + } else { + unset($errors[$service]); + } } + if ($update_ping_sites) + update_option('ping_sites', implode("\n", $services)); } + update_option('ping_errors', $errors); return $post_id; } @@ -791,6 +811,18 @@ $home = trailingslashit( get_option('home') ); if ( !$client->query('weblogUpdates.extendedPing', get_settings('blogname'), $home, get_bloginfo('rss2_url') ) ) // then try a normal ping $client->query('weblogUpdates.ping', get_settings('blogname'), $home); + + $error = false; + if ( $client->isError() ) { + $error = $client->getErrorMessage(); + } else { + $response = $client->getResponse(); + if ( !isset($response['flerror']) || $response['flerror'] ) { + $error = isset($response['message']) && $response['message'] + ? $response['message'] : 'Invalid response'; + } + } + return $error; } ?> Index: wp-admin/options-writing.php =================================================================== --- wp-admin/options-writing.php (revision 4081) +++ wp-admin/options-writing.php (working copy) @@ -99,6 +99,28 @@
Update Services on the Codex. Separate multiple service URIs with line breaks.') ?>
+ + + +