MainWp + Asana integration

Hi

I would like to integrate MainWP with Asana to create tasks for every bug and every update, and basically for everything that requires my involvement on the sites.

The problem is that I can’t find an event handler that is responsible for this, can you help me with this?

Thanks

Hey @marffa.software

Welcome to the MainWP community.

MainWP does not have a direct event handler for integrating task management systems like Asana.

However, you can work around this by using MainWP’s available hooks and integrating them with tools like Zapier or custom scripts to automate task creation based on site updates, plugin/theme updates, or issues detected on your child sites.

Our dev resources are available here: https://mainwp.dev/

Our latest videos on REST API v2 and integration with Make, Zapier, and CustomGPT may also be of interest to you.

Hi @bojan

I know you don’t have a direct integration with Asana, and I want to write one myself.

But I can’t figure out what kind of hooks I need to use to immediately catch any problems on sites or plugins, themes, core that need to be updated.

Can you help me with this?

These requirements are somewhat vague and broad, and we have a large number of hooks available.

To provide the best help, we’d recommend reviewing the hooks available on our MainWP dev site and identifying the ones that might fit your needs.

Once you have a more specific list of hooks you’re considering, feel free to reach out, and we’ll be happy to assist further.

Hi.

Yes, of course

For example mainwp_cronupdatecheck_action
When I call it, I get an error that no agrments were returned from the hook

[09-Sep-2024 17:24:01 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function your_custom_function_name(), 0 passed in /public_html/wp-includes/class-wp-hook.php on line 324 and exactly 9 expected in public_html/wp-content/themes/astra-child/functions.php:208
Stack trace:
#0 /public_html/wp-includes/class-wp-hook.php(324): your_custom_function_name()
#1 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#2 /public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#3 /public_html/wp-cron.php(191): do_action_ref_array(‘mainwp_cronupda…’, Array)
#4 {main}
in /public_html/wp-content/themes/astra-child/functions.php on line 208

Hi @marffa.software

I will check with the development team and update you as soon as I can.

1 Like

This is the example code that should work without issues:

add_action( 'mainwp_cronupdatescheck_action', 'mycustom_cron_updates_check );
function mycustom_cron_updates_check(){
    // do something.
}

And these are some of the hooks that the team thinks may be useful to you as well:

mainwp_client_updated
mainwp_client_deleted
mainwp_client_suspend
mainwp_install_update_actions
mainwp_install_plugin_action
mainwp_install_theme_action  
mainwp_post_created
mainwp_post_action
mainwp_site_added
mainwp_site_updated
mainwp_site_sync
mainwp_site_deleted
mainwp_site_reconnected
mainwp_site_suspended
mainwp_user_action

Hi.

Thank you.
But will I have information in mycustom_cron_updates_check about which plugins need to be updated?

A different hook needs to be used for that information.

add_action( 'mainwp_site_synced', 'mycustom_mainwp_site_synced', 10, 2 );
function mycustom_mainwp_site_synced( $pWebsite, $information ){
    // do something.
}

The information about available updates is stored in the $information array.

1 Like

Hi

Thank you, this is exactly what I needed.
Can you also tell me which hooks to use to track all errors in the site, for example, when the site stops pinging, gives a 500 error, Google PSI has deteriorated, or anything else that could affect the site.

Thank you very much for your help.

1 Like