Uninstalling a plugin after deleting it for some unknown reason does not work. This is my code: function sb_uninstall_plugin(){ global $wpdb, $sb_ip_log; delete_option("sb_detection_of_spammers_cookies"); delete_option("sb_detection_of_spammers_time"); delete_option("sb_banned_message"); $wpdb->query("DROP TABLE $sb_ip_log"); } register_uninstall_hook(__FILE__, 'sb_uninstall_plugin'); PHP: The value of the option uninstall_plugins in the table wp_options: a:2:{i:0;b:0;s:22:"sb/spammer-blocker.php";s:19:"sb_uninstall_plugin";} I also tried using uninstall.php without any success. Thank you for your help!
'Uninstalling after deleting does not work' - because it is already gone? I'm not sure I understand your question here. Worst case just FTP in and delete the files from the plug-in folder.
I do not want to uninstall any plugin. I am a plugin developer - and I want to make my plugin to be able to uninstall itself after deletion (cleaning all its data from the database). There is a function for this in WP API: http://codex.wordpress.org/Function_Reference/register_uninstall_hook But it does not work for me and I do not know why.
You are right. I tried it first, but something went wrong (I did not know what and why). Now it works perfectly. Thanks for the hint.