Why does deactivating a plugin cause error: “You do not have sufficient permissions to access this page”?

For the specific case of bbPress, it adds new user roles and capabilities, like the “Keymaster” role. Those users who had a role that was bbPress specific won’t have access to anything anymore, because after you removed the plugin, the role no longer exists. Some users have reported that using the “User Role Editor” plugin … Read more

Programmatically disable W3 Total Cache in development environment [closed]

Caching plugins are very challenging to disable because on top of normal plugin functionality they tend to: created extra drop-in files set caching constants bypass PHP completely with .htaccess While it’s not impossible to mangle specific plugin into submission, it’s flaky. More reliable to explicitly disable it in dev and keep. Note that implicitly stopping … Read more

admin_notices after register_uninstall / deactivate_hook

The short answer is no, it is not possible. When you deactivate your plugin, it’s deactivated so doesn’t run your admin_notices action when the admin screen is refreshed. You can confirm it for yourself by using the action in a slightly different way. In your deactivation function include the following line: set_transient(‘my_deactivation_transient’, ‘My plugin is … Read more

deactivated_plugin hook: get the name of the plugin

You can hook into the action ‘deactivate_plugin’ to get the plugin’s base name and (as second parameter) if it was deactivated network wide. See wp-admin/includes/plugin.php function deactivate_plugins(). There seems to be no hook for plugin deletion. Sample logging code: add_action( ‘activated_plugin’, ‘t5_plugin_logger’, 10, 2 ); add_action( ‘deactivated_plugin’, ‘t5_plugin_logger’, 10, 2 ); /** * Log plugin … Read more

Show a confirm message before plug-in activation

You can read more about the details of activation on this answer. Basically you need to hook a function to register_activation_hook() – assuming, that this is from within your main plugin folder and not a subfolder: register_activation_hook( __FILE__, ‘on_activation’ ); function wpse65190_on_activation() { // Add an admin notice: add_action( ‘admin_notices’, ‘wpse65190_on_activation_note’ ); // Then you … Read more