Skip to content

Commit

Permalink
Finally implement async processing
Browse files Browse the repository at this point in the history
This should help with #474
  • Loading branch information
pfefferle committed Dec 8, 2024
1 parent 4ab4c9d commit 98cbad5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions includes/class-receiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public static function init() {
// Support Webmention delete
add_action( 'webmention_data_error', array( static::class, 'delete' ) );

// Add scheduler for async processing
add_action( 'webmention_process_schedule', array( static::class, 'process' ) );

self::register_meta();
}

Expand Down Expand Up @@ -317,6 +320,17 @@ public static function post( $request ) {
return new WP_REST_Response( $return, 202 );
}

return self::process( $commentdata );
}

/**
* Process the Webmention.
*
* @param array $commentdata The comment data.
*
* @return WP_REST_Response|WP_Error The response or an error.
*/
public static function process( $commentdata ) {
/**
* Filter Comment Data for Webmentions.
*
Expand Down

0 comments on commit 98cbad5

Please sign in to comment.