1565 posts
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 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?

342 posts
  • Affiliate Level 4
  • Author Level 5
  • Beta Tester
  • Collector Level 3
+6 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)

1565 posts
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 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
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 1
  • Exclusive Author
+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
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 2
  • Copyright Ninja
+3 more
JDTUK
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.

1565 posts
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

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

5 posts
  • 2 Years of Membership
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