prefix . 'feedmanager_country', $wpdb->prefix . 'feedmanager_feed_status', $wpdb->prefix . 'feedmanager_field_categories', $wpdb->prefix . 'feedmanager_channel', $wpdb->prefix . 'feedmanager_product_feed', $wpdb->prefix . 'feedmanager_product_feedmeta', $wpdb->prefix . 'feedmanager_product_performance', $wpdb->prefix . 'feedmanager_source', $wpdb->prefix . 'feedmanager_errors', ); // Remove the feedmanager tables. foreach ( $tables as $table ) { //phpcs:ignore $wpdb->query( "DROP TABLE IF EXISTS $table" ); } // Reset the keyed options @since 3.11.0. WPPFM_Db_Management::clean_options_table(); // Remove the custom capabilities. wppfm_remove_custom_capabilities(); // Unregister the plugin. wppfm_unregister_plugin(); /** * Removes the custom capabilities * * @since 3.9.0 */ function wppfm_remove_custom_capabilities() { $admin_role = get_role( 'administrator' ); $editor_role = get_role( 'editor' ); $admin_role->remove_cap( 'edit_feeds' ); $admin_role->remove_cap( 'delete_feeds' ); $editor_role->remove_cap( 'edit_feeds' ); $editor_role->remove_cap( 'delete_feeds' ); } /** * Removes the registration info from the database. */ function wppfm_unregister_plugin() { // Retrieve the license from the database. $license = get_option( 'wppfm_lic_key' ); foreach( wp_load_alloptions() as $option => $value ) { if( false !== strpos( $option, 'wppfm_' ) ) { delete_option( $option ); } } }