Skip to content

Commit cff074e

Browse files
committed
Remove ping usage from sender
1 parent 525549c commit cff074e

File tree

1 file changed

+5
-33
lines changed

1 file changed

+5
-33
lines changed

includes/class-sender.php

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,13 @@ public static function send_webmentions( $post_id ) {
226226
continue;
227227
}
228228

229+
$code = wp_remote_retrieve_response_code( $response );
230+
229231
// check response
230-
if (
231-
! is_wp_error( $response ) &&
232-
wp_remote_retrieve_response_code( $response ) < 400
233-
) {
232+
if ( ! is_wp_error( $response ) && $code < 400 ) {
234233
$mentions[] = $target;
235-
}
236-
237-
// reschedule if server responds with a http error 5xx
238-
if ( wp_remote_retrieve_response_code( $response ) >= 500 ) {
234+
} elseif ( $code >= 500 ) {
235+
// reschedule if server responds with a http error 5xx
239236
self::reschedule( $post_id );
240237
}
241238
}
@@ -258,31 +255,6 @@ public static function send_webmentions( $post_id ) {
258255
return $mentions;
259256
}
260257

261-
/*
262-
* Update the Pinged List as Opposed to Adding to It.
263-
*
264-
* @param int|WP_Post $post_id Post.
265-
* @param array $pinged Array of URLs
266-
*/
267-
public static function update_ping( $post_id, $pinged ) {
268-
global $wpdb;
269-
$post = get_post( $post_id );
270-
if ( ! $post ) {
271-
return false;
272-
}
273-
274-
if ( ! is_array( $pinged ) ) {
275-
return false;
276-
}
277-
278-
$new = implode( "\n", $pinged );
279-
280-
$wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post->ID ) );
281-
clean_post_cache( $post->ID );
282-
283-
return $new;
284-
}
285-
286258
/**
287259
* Reschedule Webmentions on HTTP code 500
288260
*

0 commit comments

Comments
 (0)