What is a good action to use to update the WP database from my plugin?

179 Views Asked by At

I need a good trigger to use in my plugin to kick off changes to the website.

I've got a custom plugin that goes on all WordPress sites that I build. I've got it set up to auto-update the plugin.

Occasionally, I need to push out an update across all websites. For instance, there was a plugin that started causing issues across all sites so I wrote code in my function to deactivate it across all sites.

Now I'm writing code to remove some old users that should no longer have access to the site. To deactivate the plugin, I used the action 'plugins_loaded'. Of course the problem there is that it runs EVERY time the plugins are loaded so it runs on EVERY page load. It's pretty fast but still not the right way to do it.

I tried to find some sort of way to kick that one off only when the plugin is updated. Really, I just need these functions to run once ever.

Is there a good action I could use to make sure that happens?

0

There are 0 best solutions below