pfefferle / wordpress-webmention

A Webmention plugin for WordPress
https://wordpress.org/plugins/webmention/
MIT License
117 stars 31 forks source link

Uncaught TypeError: Webmention\Handler::parse_aggregated(): #480

Closed edent closed 2 months ago

edent commented 3 months ago
PHP Fatal error:  Uncaught TypeError: Webmention\Handler::parse_aggregated(): Argument #1 ($response) must be of type Webmention\Response, WP_Error given, called in /wp-content/plugins/webmention/includes/class-receiver.php on line 657 and defined in /wp-content/plugins/webmention/includes/class-handler.php:79
Stack trace:
#0 /wp-content/plugins/webmention/includes/class-receiver.php(657): Webmention\Handler->parse_aggregated()
#1 /wp-includes/class-wp-hook.php(324): Webmention\Receiver::default_commentdata()
#2 /wp-includes/plugin.php(205): WP_Hook->apply_filters()
#3 /wp-content/plugins/webmention/includes/class-receiver.php(329): apply_filters()
#4 /wp-includes/rest-api/class-wp-rest-server.php(1230): Webmention\Receiver::post()
#5 /wp-includes/rest-api/class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request()
#6 /wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch()
#7 /wp-includes/rest-api.php(428): WP_REST_Server->serve_request()
#8 /wp-includes/class-wp-hook.php(324): rest_api_loaded()
#9 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#10 /wp-includes/plugin.php(565): WP_Hook->do_action()
#11 /wp-includes/class-wp.php(418): do_action_ref_array()
#12 /wp-includes/class-wp.php(813): WP->parse_request()
#13 /wp-includes/functions.php(1336): WP->main()
#14 /wp-blog-header.php(16): wp()
#15 /index.php(17): require('/home/openbenc/...')
#16 {main}
  thrown in /wp-content/plugins/webmention/includes/class-handler.php on line 79

Could this be fixed in:

https://github.com/pfefferle/wordpress-webmention/blob/607cf28d555698610016bb37c988e2a6232ed3fc/includes/class-receiver.php#L649-L657

By using if ( ! is_wp_error( $response ) )?

pfefferle commented 3 months ago

Do you maybe also have the URL causes the crash?