3

Does anyone know if the TechCrunch WP Asynchronous Tasks plugin still works on Wordpress v4.7.5? Plugin: https://github.com/techcrunch/wp-async-task

I'm trying to get the action hook working asynchronously with this hook https://www.gravityhelp.com/documentation/article/gform_after_submission/

I tried to incorporate that hook using similar steps described in the plugin's Github readme.

To just test the gform_after_submission_19 (where form id=19) action this is what I have added in my theme's function.php after activating the TechCrunch's plugin

class GF_Async_Task extends WP_Async_Task {
    /**
     * Action to use to trigger this task
     *
     * @var string
     */
    protected $action = 'gform_after_submission_19';

    /**
     * Prepare POST data to send to session that processes the task
     *
     * @param array $data Params from hook
     *
     * @return array
     */
    protected function prepare_data($data) {
        return array(
            'entry' => $data[0],
            'form' => $data[1]
        );
    }

    /**
     * Run the asynchronous task
     *
     */
    protected function run_action() {
        if (isset($_POST['entry'])) {
            do_action("wp_async_$this->action", $_POST['entry'], $_POST['form']);
        }
    }

}

function send_custom_notification($entry, $form) {
    error_log("test", 3, $_SERVER['DOCUMENT_ROOT'] . "/GFTEST.log");
}

add_action('gform_after_submission_19', 'send_custom_notification', 10, 2);

function my_init_gf_task() {
    new GF_Async_Task();
}

add_action('plugins_loaded', 'my_init_gf_task');

But the log is just not working in my send_custom_notification action, what is wrong? I also tried to set the sslverify option to false in the the launch_on_shutdown method of WP_Async_Task class by the editing original plugin file wp-async-task.php. I may needed to do this as i'm working on localhost for now.

But still no luck, any help/tips will be much appreciated, thanks!

closed as off-topic by Krzysiek Dróżdż, Rick Hellewell, shanebp, Nathan Johnson, Jacob Peattie Feb 2 at 3:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.