Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins: add link to uninstall a plugin #546

Closed
mattab opened this issue Feb 9, 2009 · 16 comments
Closed

Plugins: add link to uninstall a plugin #546

mattab opened this issue Feb 9, 2009 · 16 comments
Assignees
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Feb 9, 2009

Currently we can enable and disable plugin. When a plugin is disabled, we should also show a link to “uninstall” the plugin:
- ask for confirmation: “Do you want to uninstall X?”
- call uninstall() method on the plugin class
- delete the files plugin/X/*

@robocoder
Copy link
Contributor

If the plugin is distributed with Piwik, the auto-update process would ideally avoid reinstalling it.

@mattab
Copy link
Member Author

mattab commented Jul 21, 2010

I think the files should not be deleted automatically. The plugin should be in uninstalled state, with a message inviting user to delete the files?

@mattab
Copy link
Member Author

mattab commented Jul 22, 2010

This task sounds like the only critically missing piece of the plugin framework - am I missing something else?

@robocoder
Copy link
Contributor

The uninstall should warn that plugin-specific data may be deleted as part of calling the plugin's uninstall method, and may not be recoverable.

@anonymous-matomo-user
Copy link

the uninstall method should also delete db colums if applicable.

@robocoder
Copy link
Contributor

I'm going to defer to post-1.0 since I have to make UI changes when I resume work on the plugin repository.

@halfdan
Copy link
Member

halfdan commented Jan 6, 2011

This is related to #60. We can't just uninstall a plugin (call uninstall to execute DROP TABLE *) as plugins might depend on that specific plugin. First we need to resolve dependencies.

Proposal: We add some way to specify a plugin as "Core" which is reserved to core plugins. Other plugins installed via the plugin repository can safely be uninstalled (including files), for core plugins we preserve the files as the auto-update mechanism would add them again.

@mattab
Copy link
Member Author

mattab commented Jan 6, 2011

So this requires #60

@anonymous-matomo-user
Copy link

Hi,

I added the functionality in the plugin-installer plugin.
http://plugin.suenkel.org
(settings->pluginstore->advanced ->enable expertmode)

at the moment it does:

  • goto maintainance-mode
  • call uninstall
  • move plugin/NAME/* to a tmp/pluginbackup/NAME
  • remove tracker-cache/config.ini file-entries
  • disable maintainence mode

this is done by "force" (aka ignore errors)
without #60 it is not possible to check dependendies and warnings to be ignored while deinstallation

@mattab
Copy link
Member Author

mattab commented Dec 18, 2012

@csuenkel2 I don't understand, it should be super simple

  • Deactivate plugin is already implemented
  • Add: Uninstall (that will call the SQL uninstall)
  • Once uninstalled, user can "Enable" again which will enable+install
  • Once uninstalled, user can "Delete" the plugin which will delete all files

This should cover 100% of the needs and no need to move files around. OK to set maintenance though (btw enableMaintenance etc. is implemented in: Piwik_Updates::enableMaintenanceMode()

@anonymous-matomo-user
Copy link

of course you are right, but the "removePlugin" code in PluginManager seams to be unfinished.

  • the functions are not consitent while using (loading and storing changes of) the config file (sometimes they rely on their own cached config-data - like unloadPlugin)
  • some of the functions are declared as private
  • e.g. the event dispatcher was unable to remove a "addMenu"-event
  • for deinstallation the process "majorupdate" is missing
    ...

so at the end, I decided, without patching the PluginManager (which implies a lot of effort in testing and re-integration) to reuse as much as possible from the core and wrap the rest to an "expert-mode" (assuming "you know what you're doing"-people ;-)

@mattab
Copy link
Member Author

mattab commented Dec 19, 2012

of course you are right, but the "removePlugin" code in PluginManager seams to be unfinished.

absolutely, it's unfininshed and far from perfection :) so the best would be to improve this class (possibly split it into 2 smaller classes) and just make this code the one that is used in all plugin related things.

because this project is a "core" project, modifying & improving & refactoring & redesigning to KISS, all the related core files, is necessary!

@mattab
Copy link
Member Author

mattab commented Jul 17, 2013

In 2cfe210: Refs #546 Adding core "Uninstall" feature for Plugins and Themes + Cleanups + fix build by moving constant to PluginsManager
Todo

  • ask for confirmation: "Do you want to uninstall X?" // warn that plugin-specific data may be deleted as part of calling the plugin's uninstall method, and may not be recoverable.
  • call uninstall() method on the plugin class
  • verify core plugins cant be uninstalled

@tsteur
Copy link
Member

tsteur commented Sep 30, 2013

In cc2d24c: refs #546 ask for confirmation before uninstalling a plugin

@tsteur
Copy link
Member

tsteur commented Sep 30, 2013

In b16d8cf: refs #546 call the plugins uninstall method before uninstalling it

@tsteur
Copy link
Member

tsteur commented Sep 30, 2013

In b79c18f: refs #546 display the name of the plugin in the confirm message

@mattab mattab added this to the 2.0 - Piwik 2.0 milestone Jul 8, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…hemes + Cleanups + fix build by moving constant to PluginsManager

Todo
 * ask for confirmation: "Do you want to uninstall X?" // warn that plugin-specific data may be deleted as part of calling the plugin's uninstall method, and may not be recoverable.
 * call uninstall() method on the plugin class
 * verify core plugins cant be uninstalled
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

5 participants