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: 'center bottom',
                    offset: '-1 0'
                },
                close: function() {
                    //
                }
            }).pointer('open');
return false;
        });
    </script><?php
}
add_action( 'admin_footer', 'wpse65611_script' );

Which results in this:

enter image description here

Replace url1 with the url that would delete just the data.

Note that this will not run if you put it in the plugin and the plugin is deactivated, putting it in another plugin or in a theme would work but it would be bad practice

Also replace the ID of the embed github gist plugin with your own

Leave a Comment