I can't find anything about it in Plugin class. Maybe we could add an update() method which will be called when plugin just updated from remote or local?
Or maybe another solution exists?
Such a solution exists but it might be not documented on the website. You can generate an update via
./console generate:update. It will ask for your plugin name and then generate a file under
There are some explanations in the generated file but also see eg those examples:
An example is here: https://github.com/piwik/plugin-CustomAlerts/tree/master/Updates
It's not documented yet. Here is issue to track the new doc: https://github.com/piwik/developer-documentation/issues/84