WordPress.org

Plugin Directory

wp-contact-form

Opened 12 years ago

Closed 4 years ago

Last modified 12 months ago

#128 closed enhancement (fixed)

Add unistall option for wp-contactform

Reported by: soteke Owned by: ryanduff
Priority: normal Severity: normal
Plugin: wp-contact-form Keywords:
Cc:

Description

Perhaps it would be a goog thing if people could uninstall the plugin by deleting the options inserted into the database. If you think this is a goof idea, hope the following code will help:

<div class="wrap" id="uninstall">
<h2>Uninstall Plugin</h2>
<p> To uninstall this plugin (erase the options this plugin ads to your database) please write 'Uninstall' in the following form and press the 'Go' button.<p>
<form name="uninstall_wpcf" method="POST">
<INPUT TYPE="text" NAME="confirmation" size="40" value="">
<input type="submit" name="erase" value="Go">
</div>

<?
global $wpdb, $table_prefix;
if(isset($_REQUESTerase?) && $_POSTconfirmation?=='Uninstall'){

$wpdb->query("DELETE FROM {$table_prefix}options WHERE option_name = 'wpcf_email'");
$wpdb->query("DELETE FROM {$table_prefix}options WHERE option_name = 'wpcf_show_quicktag'");
$wpdb->query("DELETE FROM {$table_prefix}options WHERE option_name = 'wpcf_error_msg'");
$wpdb->query("DELETE FROM {$table_prefix}options WHERE option_name = 'wpcf_success_msg'");
$wpdb->query("DELETE FROM {$table_prefix}options WHERE option_name = 'wpcf_subject'");
echo "<div class='wrap'>Options were deleted successfully please deactivate the plugin to complete uninstall.</div>";
die();

}
?>

Change History (3)

comment:1 @ryanduff11 years ago

Wordpress 1.6 has just added plugin hooks for things to run on the loading/unloading of plugins. WPCF 2.0 is possibly being targeted at the Wordpress 1.6 release and will include a removal function.

Besides, there's no need for a complex SQL query, its built into wordpress already...
add_option(), update_option(), and delete_option()

comment:2 @qurl4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In 639724:


fixed #128: Move version one up to trigger release package


comment:3 @githubsync12 months ago

In 1256024:

Coding standards adjustments in the template

commit f848dd6bfc052f27a7c039e7b8d183bab70dd18e
Author: Pascal Birchler <hello@…>
Date: Tue Sep 29 20:35:22 2015 +0200

Coding standards adjustments in the template

commit d16e55ecf553bd98e7858fa58b57afa3be4c1b23
Author: Pascal Birchler <hello@…>
Date: Tue Sep 29 19:30:11 2015 +0200

Some small padding adjustments

commit 0206fb93fc0afb04f3ee2f209901301f0553fc04
Author: Pascal Birchler <hello@…>
Date: Tue Sep 29 19:27:15 2015 +0200

Make sharing inputs read-only

commit addd50d1aa5059d96c9d5f63caec6b113769eda4
Author: Pascal Birchler <hello@…>
Date: Tue Sep 29 19:23:55 2015 +0200

Small RTL adjustments for the sharing dialog

commit 05ef75d485ba422ad49de7695a85ee8c4c119ee2
Author: Pascal Birchler <hello@…>
Date: Tue Sep 29 19:10:28 2015 +0200

Hide border for featured image in IE

commit b8b623810216152680e8b584cce07af605365277
Author: Pascal Birchler <hello@…>
Date: Tue Sep 29 19:08:45 2015 +0200

Use a higher priority to hide the admin bar


Especially fixes a bug on dotorg where it was overridden by a higher priority

commit e8ac40c3d71b13470f91a7f19c6d0e9beddd295e
Author: Pascal Birchler <hello@…>
Date: Tue Sep 29 19:07:41 2015 +0200

Use proper quotation marks when querying by data-secret


This is needed in case the secret begins with a number

commit 8c82603af2f963b73fa13a690a40f26667dd6a72
Author: Pascal Birchler <hello@…>
Date: Tue Sep 29 19:05:37 2015 +0200

Use tabs to show/hide the two different options in the sharing dialog.


See #128

commit c9fb1ec3b46957d51d72c4545251ca292e4d91b9
Author: Pascal Birchler <hello@…>
Date: Tue Sep 29 16:48:43 2015 +0200

Make close button a bit bigger

Synced from git://github.com/swissspidy/oEmbed-API.git

Note: See TracTickets for help on using tickets.