WordPress.org

Forums

[resolved] Plugin uninstallation does not work! (4 posts)

  1. lelkoun
    Member
    Posted 2 years ago #

    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');

    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!

  2. lelkoun
    Member
    Posted 2 years ago #

    Solved.

  3. zamb0n
    Member
    Posted 1 year ago #

    hello, can you please state how you solved your problem?

    i want to make an uninstall.php file to uninstall some tables i have created in the database when i delete the plugin. cant get it to work...

    thank you

  4. lelkoun
    Member
    Posted 1 year ago #

    Currently I use only uninstall.php. This is an example how it can look like: http://pastebin.com/usLWQCq2

Topic Closed

This topic has been closed to new replies.

About this Topic