<?php
// UNINSTALL //
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
    die;
}
global $wpdb;
flush_rewrite_rules();
$tabla = $wpdb->prefix.'niche_tabla';
$tablacache = $wpdb->prefix . 'nichecreator_cache';
$tablacachefichas = $wpdb->prefix . 'nichecreator_cachefichas';
$tablaregions = $wpdb->prefix.'regions';
$tablasubregions = $wpdb->prefix.'subregions';
$tablacountries = $wpdb->prefix.'countries';
$tablastates = $wpdb->prefix.'states';
$tablacities = $wpdb->prefix.'cities';
//$wpdb->query("DROP TABLE IF EXISTS $tabla");
//$wpdb->query("DROP TABLE IF EXISTS $tablacache");
//$wpdb->query("DROP TABLE IF EXISTS $tablacachefichas");
$wpdb->query("DROP TABLE IF EXISTS $tablaregions");
$wpdb->query("DROP TABLE IF EXISTS $tablasubregions");
$wpdb->query("DROP TABLE IF EXISTS $tablacountries");
$wpdb->query("DROP TABLE IF EXISTS $tablastates");
$wpdb->query("DROP TABLE IF EXISTS $tablacities");
$wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'nichecreator_%'");
