PluginStore might not always be preferred

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

PluginStore is never deleted on uninstall, we persist forever.

1 Like

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.

1 Like

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

3 Likes