I think we have to give site admins the power to shoot themselves in the foot if they want to. The uninstall *should* delete all the content from the database (maybe you're removing it to try to reduce the size of your database), dataroot, everything.
The easiest thing to do, is to go through install.xml and delete all the tables generated for the plugin. We would also need to go through all the tables for that plugin type (such as {plugin}_cron, etc) and delete content from those.
On top of that, each plugin will need to have a "post_uninstall()" optional method (and maybe a "pre_uninstall()" as well) for custom de-installation code.
The trickiest part of this, would be dealing with serialized block data, which occasionally contains references to other plugin types. That's the kind of thing the post_uninstall() method would have to deal with.
I also think, for the sake of our sanity, it might be best to prevent the core plugins from being uninstalled. They have been written with the assumption of permanence since day 1 and there are many hacky references to their existence scattered throughout the codebase (like the code that adds unique message thread ids to interaction/forum emails). So there's probably a lot of potential for crashes if you delete core plugins.
I think we have to give site admins the power to shoot themselves in the foot if they want to. The uninstall *should* delete all the content from the database (maybe you're removing it to try to reduce the size of your database), dataroot, everything.
The easiest thing to do, is to go through install.xml and delete all the tables generated for the plugin. We would also need to go through all the tables for that plugin type (such as {plugin}_cron, etc) and delete content from those.
On top of that, each plugin will need to have a "post_uninstall()" optional method (and maybe a "pre_uninstall()" as well) for custom de-installation code.
The trickiest part of this, would be dealing with serialized block data, which occasionally contains references to other plugin types. That's the kind of thing the post_uninstall() method would have to deal with.
I also think, for the sake of our sanity, it might be best to prevent the core plugins from being uninstalled. They have been written with the assumption of permanence since day 1 and there are many hacky references to their existence scattered throughout the codebase (like the code that adds unique message thread ids to interaction/forum emails). So there's probably a lot of potential for crashes if you delete core plugins.