PluginStore might not always be preferred


#1

Continuing the discussion from Adding model and table with plugin:

Is the idea that when someone uninstalls the plugin the plugins saved data should also be deleted? If that is the idea this is not the wanted behaviour of my particular plugin. With that said, is there any other benefits of using PluginStore that I should take in consideration? I might add that the data that is going to be saved is migrated from another forum which has functionality that Discourse lacks and therefore I am building a plugin for it. This means that it is very important that the data is persisted permanently.

/David


(Sam Saffron) #2

PluginStore is never deleted on uninstall, we persist forever.


(Mittineague) #3

There should be a way to remove tables / rows if an Admin want to no?

My concern is due to experience with WordPress plugins.

They can be

  • installed
  • activated
  • deactivated
  • uninstalled

The problem comes from the fact that it is up to the plugin author to use the “uninstall hook” to do clean-up and many don’t do that.

Some create tables that become unused, and perhaps worse, many add rows to the “options” table.

No problem in small doses, but over time the table can become so full of orphans that there is a noticeable slowdown. WordPress being a heavy database app such as it is.

I’m not saying that the database should be automatically pruned, but I think it would be good if plugins offered a “pre-uninstall cleanup” type of thing.


(Sam Saffron) #4

Yeah, it is a known issue, we will eventually get there.