Source Code

/shortcode-plugin-template/

uninstall.php

<?php
 
//The following code will be run if the plugin is deleted 
function uninstallPlugin(){
 
    if( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) exit();
 
    //Load variables needed to database access
    global $wpdb;
	$tablename = $wpdb->prefix . 'shortcode_plugin_template';
 
    //Delete the plugin data from the database
    $wpdb->query( "DROP TABLE IF EXISTS $tablename" );
}
uninstallPlugin();