You are right to ask for those! My apologies for omitting them in the previous comprehensive response. Here are the uninstall.php and admin-style.css files for the NUNSA Vote plugin.
1. uninstall.php (Cleanup on Uninstall)
This file handles the removal of database tables and any other data created by the plugin when it's uninstalled.
php
<?php
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly.
}
global $wpdb;
// Drop the custom tables
$table_voters = $wpdb->prefix . 'nunsa_voters';
$table_votes = $wpdb->prefix . 'nunsa_votes';
$sql_voters = "DROP TABLE IF EXISTS $table_voters;";
$sql_votes = "DROP TABLE IF EXISTS $table_votes;";
$wpdb->query($sql_voters);
$wpdb->query($sql_votes);
// Remove any other plugin data (options, transients, etc.) if needed
// delete_option('nv_enable_voting');
// delete_option('nv_show_results_early');
// Clear any transients
// delete_transient('my_plugin_transient');
Important: Place this file in the root directory of your nunsa-vote plugin folder. WordPress automatically detects and runs this file when the plugin is uninstalled.
2. assets/css/admin-style.css (Admin Styling)
This file provides custom styling for the plugin's admin interface.
This ensures that the admin styles are only loaded in the WordPress admin area.
Now you have a complete set of files for the NUNSA Vote plugin, including the essential uninstall.php and admin-style.css files. Let me know if you have any other questions or need further assistance!