• Hi there,

    We want to use WP Webhooks to update a search engine index for a site.

    I’ve tried to configure webhooks to send data on create_post with an endpoint like
    https://localhost:3001/webhooks/wordpress/create

    However, when I send a test or create a post the webhook is not triggered. Is WP Webhooks available in a development environment like this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Ironikus

    (@ironikus)

    Hey @mathewsnook – thank you a lot for your message, as well as for using our plugin.

    Our plugin works as well with local hosted endpoints. In case there is something that doesn’t work, there’s a couple of things you can test/consider.

    The one that I think is causing your issue: You don’t use https for your request and the SSL certificate can’t be verified.
    Since we use wp_safe_remote_request(), the plugin expects the endpoints to be secured.
    If you want to bypass this check, simply click on the settings link next to the URL you added – there you will find a setting item that allows you to turn the SSL notification off.

    If this doesn’t solve your problem, please also make sure that you have checked if you use any security measurements that might block the request.

    I hope this helps you so far. If you have any further questions, feel free to let me know at any time. ??

    Thread Starter mathewsnook

    (@mathewsnook)

    Hi Ironikus,

    Firstly thanks for creating this plugin and your quick response. I’ve turned off SSL verification and tried playing with the CORS settings on WordPress. Although I don’t think this is the issue here.

    The endpoint I have is https://localhost:3001/wordpress/news/create as an Express.js server.

    I can send a post via Postman directly to this and it triggers, however not from WordPress. I have tested it with the Send Demo and also by creating Posts directly and it appears to log an admin-ajax POST request but this is not received by our webhooks server.

    Everything is currently running locally so there are minimal security measures right now.

    Any thoughts on what security settings might be blocking the request or why it isn’t being received?

    I’m happy to share more details if that would be helpful.

    • This reply was modified 4 years, 6 months ago by mathewsnook.
    Plugin Contributor Ironikus

    (@ironikus)

    Hey @mathewsnook – Thank you for your answer.
    You activated the Allow unverified SSL setting within the webhook URL, correct?
    Have you also tried to activate the Allow unsafe URLs setting?

    We are using the following function for sending the data over: wp_safe_remote_request()

    We also do fire a trigger after we call that function which also contains the response, so you might want to use it for debugging:
    do_action( 'wpwhpro/admin/webhooks/webhook_trigger_sent', $response, $url, $http_args, $webhook );

    By default, we send a POST request containing JSON as the content type.

    If you still can’t make it work, it’ll be great if you can share some further details. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP Webhooks on localhost’ is closed to new replies.