Deletion of shared options using uninstall.php

I don’t think that you should touch these options. WordPress core already handles this, whether by removing the references to your plugin when it is deleted (as in delete_plugins()), or by being coded in such a way that it can ignore the reference to the removed plugin. Actually, none of these three options will last very long, since they are all regenerated regularly. The one is a transient, which naturally expires anyway. The plugins are removed from the recently activated list after a week. And the plugin is removed from the uninstall_plugins option by uninstall_plugin().

Also, WooCommerce doesn’t touch these. It probably just looked like it removed itself because it was never added to these values in the first place, or was removed that quickly by WordPress. (It wouldn’t have been added to uninstall_plugins at all, because it uses an uninstall.php file instead of a function).

So, TL;DR: You don’t need to worry about this, WordPress will take care of it.

Leave a Comment