From ca4dd7e5a95eb98b6d5042f3d76fef8ef5e8ee6a Mon Sep 17 00:00:00 2001 From: Peter Molnar Date: Thu, 28 Apr 2016 09:08:15 +0000 Subject: [PATCH] bugfixes --- receiver.php | 6 +++--- sender.php | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/receiver.php b/receiver.php index d7bf936..0de7de2 100644 --- a/receiver.php +++ b/receiver.php @@ -319,6 +319,9 @@ class WP_Webmention_Again_Receiver extends WP_Webmention_Again { $post = get_post ( $post_id ); + // increment retries + static::queue_inc ( $received->id ); + if ( ! static::is_post( $post ) ) { static::debug( " no post found for this mention, try again later, who knows?", 6); //static::queue_del ( $received->id ); @@ -332,9 +335,6 @@ class WP_Webmention_Again_Receiver extends WP_Webmention_Again { continue; } - // increment retries - static::queue_inc ( $received->id ); - // validate target $remote = static::try_receive_remote( $post_id, $received->source, $received->target ); diff --git a/sender.php b/sender.php index ecf5cdb..ee7ebd5 100644 --- a/sender.php +++ b/sender.php @@ -143,7 +143,7 @@ class WP_Webmention_Again_Sender extends WP_Webmention_Again { $urls[ $k ] = strtolower( $url ); // remove all already pinged urls - $pung = get_post_meta( $post->ID, static::pung, false ); + //$pung = get_post_meta( $post->ID, static::pung, false ); /* // retrofill pung from pingback field, temporary @@ -158,7 +158,7 @@ class WP_Webmention_Again_Sender extends WP_Webmention_Again { } */ - $urls = array_diff ( $urls, $pung ); + //$urls = array_diff ( $urls, $pung ); foreach ( $urls as $target ) { @@ -223,11 +223,11 @@ class WP_Webmention_Again_Sender extends WP_Webmention_Again { else { static::debug( " sending succeeded!", 5); - $post_types = get_post_types( '', 'names' ); - if ( in_array( $send->object_type, $post_types ) && 0 != $send->object_id ) { - add_post_meta ( $send->object_id, static::pung, $send->target, false ); + //$post_types = get_post_types( '', 'names' ); + //if ( in_array( $send->object_type, $post_types ) && 0 != $send->object_id ) { + //add_post_meta ( $send->object_id, static::pung, $send->target, false ); //add_ping( $send->object_id, $send->target ); - } + //} static::queue_done ( $send->id, $s ); } @@ -285,7 +285,7 @@ class WP_Webmention_Again_Sender extends WP_Webmention_Again { } if ( 200 <= $response['response']['code'] && 300 > $response['response']['code'] ) { - static::debug( "sending succeeded: ${$response['response']['code']}, message: {$response['response']['message']}", 5); + static::debug( "sending succeeded: {$response['response']['code']}, message: {$response['response']['message']}", 5); return true; } else {