1476 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
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?

332 posts
  • Has referred 100+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+5 more
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)

1476 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
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
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
orbitalplugins 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.

35 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United Kingdom
+2 more
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.

1476 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
OriginalEXE says

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

5 posts
  • Has been part of the Envato Community for over 1 year
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
by