Do you clean up your self-written plugins’ at deactivation?

After developing some plugins for myself, some of them is ready to be published. For all, I’ve written deactivation functions, which deletes the set options, the database, etc. after themselves. But I’m having doubts about the reason for these, for example, what if it’s only a temporary inactivation? What do you think, does a process … Read more

Displaying a message when plug-in is deactivated

I’m using the following code to deactivate my WordPress Plugin if the requirements are not met public function activate() { if (!$this->check_requirements()) { deactivate_plugins(plugin_basename(__FILE__)); wp_redirect(admin_url(‘plugins.php’)); exit; } } The function activate() is called when the plug-in is activated. I want to add a message to the user explaining what happened. Is there a way to … Read more

Disable WooCommerce action

I’m customizing a WooCommerce theme and am going to be moving the title. There is an action in content-single-product.php called: do_action( ‘woocommerce_single_product_summary’ ); in the woocommerce_hooks.php file the title action is: add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_title’, 5 ); I can easily comment this out and place the title function where I need to. I’d prefer to disable … Read more

How to Modify/Change a Buddypress/WordPress Account Activation Process

I’m developing a custom BuddyPress/WordPress Plugin. Here’s how a user would normally register. A user registers as usual on registration page His/Her account is deactivated till he/she clicks on activation link in his/her email He/She is sent an activation link through the email he/she registered with He/She activates his account by clicking on the link … Read more

Must activation/deactivation functions in a class be static?

The description for register_uninstall_hook‘s $callback parameter states: Must be a static method or function.1 There is no such comment for register_activation_hook or register_deactivation_hook. However, in the Codex entry for register_activation_hook there is an example that reads: Or, because the activation hook requires a static function, if you’re inside of a __construct():2 In a GitHub issue, … Read more

Uninstall, Activate, Deactivate a plugin: typical features & how-to

I’m making a WordPress plugin. What are typical things I should include in the uninstall feature? For example, should I delete any tables I created in the install function? Do I clean up my option entries? Anything else? There are three different hooks. They trigger in the following cases: Uninstall Deactivation Activation How-to trigger functions … Read more