0

I develop a custom plugin for my needs, and I stuck on one task.

I need some kind of solution, to show on my website how many times is that plugin activated or deactivated on every site where will be installed.

So, to be clear. I need to show on my site some counter which should count activations and deactivations on every other site where is plugin installed.

Any kind of help is welcomed.

Thanks in advance.

0

Although you might have already managed to solve the problem you faced, here's few thoughts.

You could use register_activation_hook(), register_deactivation_hook() and register_uninstall_hook() functions to trigger a wp_remote_post() call to your (custom) API endpoint to count the times when your plugin is activated, deactivated or deleted.

If the recieving site, where you keep track of the different counts, happens also to be a WordPress site, then you can find information about adding custom end point from the developers handbook, https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/

As a note on privacy, you might also inform the plugin users that your plugin is doing something like this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.