public static function uninstall() { //loading data lib require_once self::get_base_path() . "/data.php"; if (!GFFreshBooks::has_access("gravityforms_freshbooks_uninstall")) { die(__("You don't have adequate permission to uninstall the FreshBooks Add-On.", "gravityformsfreshbooks")); } //droping all tables GFFreshBooksData::drop_tables(); //removing options delete_option("gf_freshbooks_site_name"); delete_option("gf_freshbooks_auth_token"); delete_option("gf_freshbooks_version"); //Deactivating plugin $plugin = "gravityformsfreshbooks/freshbooks.php"; deactivate_plugins($plugin); update_option('recently_activated', array($plugin => time()) + (array) get_option('recently_activated')); }