• Resolved dansart

    (@dansart)


    Hei Abhay

    First of all, thanks a lot for the plugin.
    I wanted to use the save_post hook, but noticed an fatal error when using said hook. After creating a webhook for save_post, it was not possible to save or create a post / page. It will throw a 500 error after a while. It generates an infinite loop in dispatch_webhook.
    This happens because the save_post hook gets called with wp_insert() , and probably happens also for all actions, that are within the log_request() function.

    My temporary solution is, to remove the action, and add it later:

    public function dispatch_webhook()
    {
    // Prevent re-entry from wp_insert_post in log_request()
    remove_action('save_post', [$this, 'dispatch_webhook'], 99);

    // ... rest of the functioin code ...

    add_action('save_post', [$this, 'dispatch_webhook'], 99, 99);
    }

    Best, Daniel

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Abhay Kulkarni

    (@hiabhaykulkarni)

    Hi Daniel,

    Thank you so much for testing the plugin and taking the time to report this issue! Your detailed explanation about the save_post loop was incredibly helpful.

    I have just released version 1.0.1 which completely resolves this bug.

    What was fixed: Instead of removing and re-adding individual hooks (which could interfere with other active webhooks), I implemented a strict “Re-entrancy Guard” across the entire webhook dispatch process. Now, when the plugin is in the middle of executing a webhook or writing the log to the database using wp_insert_post(), it temporarily locks itself from firing again. This ensures that no internal actions (whether it be save_post or underlying HTTP API hooks) can trigger an infinite loop.

    Kindly update the plugin to version 1.0.1 and test it out. Please let me know if everything is running smoothly on your end, or if you run into any other snags!

    Thanks again,
    Abhay Kulkarni

    Thread Starter dansart

    (@dansart)

    Hi Abhay

    Great, thanks a lot!
    I will update and let you know.

    Best, Daniel

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.