File tree Expand file tree Collapse file tree 1 file changed +5
-33
lines changed Expand file tree Collapse file tree 1 file changed +5
-33
lines changed Original file line number Diff line number Diff line change @@ -226,16 +226,13 @@ public static function send_webmentions( $post_id ) {
226
226
continue ;
227
227
}
228
228
229
+ $ code = wp_remote_retrieve_response_code ( $ response );
230
+
229
231
// 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 ) {
234
233
$ 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
239
236
self ::reschedule ( $ post_id );
240
237
}
241
238
}
@@ -258,31 +255,6 @@ public static function send_webmentions( $post_id ) {
258
255
return $ mentions ;
259
256
}
260
257
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
-
286
258
/**
287
259
* Reschedule Webmentions on HTTP code 500
288
260
*
You can’t perform that action at this time.
0 commit comments