ThemeForest

Do you delete data on uninstall ( WP plugins )

657 posts
  • Sold between 5 000 and 10 000 dollars
  • Exclusive Author
  • Croatia
  • Bought between 10 and 49 items
  • Has been a member for 1-2 years
OriginalEXE says

Hey WP developers, I am wondering:

Should I delete data like options and custom posts ( using custom post types ) on plugin uninstall?

I know it’s good practice to do so, but the issue is that I don’t have automatic update with my plugins, and some users don’t know how to use FTP, so the only way for them to update the plugin is to uninstall and delete the current one, and then install new version.

How should I approach this?

227 posts
  • Sold between 5 000 and 10 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 100 and 199 users
  • Bought between 10 and 49 items
  • Microlancer Beta Tester
  • Has been a member for 2-3 years
  • Exclusive Author
  • Portugal
vtimbuc says

I’m not a WP Developer, but I think that the best solution is to add a check-box, that is unchecked by default and if the user checks it then delete the data on uninstall. (not sure if this is possible)

657 posts
  • Sold between 5 000 and 10 000 dollars
  • Exclusive Author
  • Croatia
  • Bought between 10 and 49 items
  • Has been a member for 1-2 years
OriginalEXE says

I’m not a WP Developer, but I think that the best solution is to add a check-box, that is unchecked by default and if the user checks it then delete the data on uninstall. (not sure if this is possible)

That is actually good idea, and yes, it is possible :) I believe I’ll go that way, thanks!

40 posts
  • Microlancer Beta Tester
  • Exclusive Author
  • Has been a member for 0-1 years
  • Sold between 1 000 and 5 000 dollars
  • Referred between 1 and 9 users
  • Bought between 1 and 9 items
  • New Zealand
wickedbroccoli says

I’m not a WP Developer, but I think that the best solution is to add a check-box, that is unchecked by default and if the user checks it then delete the data on uninstall. (not sure if this is possible)

This is the way to do it, definitely do not delete the data without warning though.

28 posts
  • Exclusive Author
  • Sold between 5 000 and 10 000 dollars
  • Bought between 10 and 49 items
  • Has been a member for 2-3 years
  • United Kingdom
2DMonkey says

I’m not a WP Developer, but I think that the best solution is to add a check-box, that is unchecked by default and if the user checks it then delete the data on uninstall. (not sure if this is possible)

Agree – you should definitely not delete data on plugin deactivation/uninstall. It’s best to leave data as it is so that when you release an update it’s easy for your customers to replace the plugin files and re-activate. We have a separate function that wipes the plugin data – this has to be clicked and then confirmed by the user.

657 posts
  • Sold between 5 000 and 10 000 dollars
  • Exclusive Author
  • Croatia
  • Bought between 10 and 49 items
  • Has been a member for 1-2 years
OriginalEXE says

Thanks guys! I went with that solution – checkbox in plugin options and implemented check in uninstall.php

5 posts
  • Has been a member for 0-1 years
chamath says

adding a check box is a good idea! saved me a lot of troubles. you know sometimes you forget the simplest things

by
by
by
by
by