How does uninstalling WordPress plugins work?

As explained in my comment in the Question, the error is certainly in how the DROP TABLE is being performed. But answering to How does uninstalling WordPress plugins work?: If we do a register_uninstall_hook in our plugin, the callback is stored in the option uninstall_plugins in /wp-includes/plugin.php. $uninstallable_plugins[plugin_basename($file)] = $callback; update_option(‘uninstall_plugins’, $uninstallable_plugins); In the PHPDoc … Read more

Popup asking whether data should be removed on plugin uninstall

How about something similar to this: function wpse65611_script() { wp_enqueue_style( ‘wp-pointer’ ); wp_enqueue_script( ‘wp-pointer’ ); wp_enqueue_script( ‘utils’ ); // for user settings ?> <script type=”text/javascript”> jQuery(‘#embed-github-gist .delete a’).click(function(){ jQuery(‘#embed-github-gist .delete a’).pointer({ content: ‘<h3>Delete this or delete everything?</h3><p><a id=”this” class=”primary button” href=”https://wordpress.stackexchange.com/questions/65611/url1″>Delete data</a> <a id=”everything” class=”button” href=”‘+jQuery(‘#embed-github-gist .delete a’).attr(‘href’)+'”>Delete plugin</a></p>’, position: { my: ‘left top’, at: … Read more

How can I delete options with register_uninstall_hook?

You could always use an uninstall.php file for the plugin instead. http://codex.wordpress.org/Function_Reference/register_uninstall_hook If the plugin can not be written without running code within the plugin, then the plugin should create a file named ‘uninstall.php’ in the base plugin folder. This file will be called, if it exists, during the uninstall process bypassing the uninstall hook. … Read more

wpdb::prepare was called incorrectly

It’s always advised to use $wpdb->prepare when you are taking input from user. This will help in protecting queries against SQL Injection. For more details, check the Codex When you use $wpdb->prepare, you must pass the variables to the query. In your case, you can skip using $wpdb->prepare as you are using a hard coded … Read more

Does plugin uninstall always put WordPress back into original state?

Short answer: Plugins do not modify existing files, they hook into WordPress via an exposed API. Plugins can modify database schema. Plugins don’t have to uninstall cleanly. Plugin Hooks Plugins hook into WordPress at specific point exposed by the WordPress core. http://codex.wordpress.org/Plugin_API As an example, the function get_option() reads a site option from the database. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)