When updating a plugin, we update the plugin, and then render the page "plugin was updated" or similar.
Instead of rendering the plugin page we should ideally perform a redirect to this "plugin was updated" page, otherwise it may result in a blank page.
Imagine we update the code of a plugin, say
AnonymousPiwikUsageMeasurement. During the request we bootstrap Piwik, perform a couple of tasks, many instances are created and stored in the DI container.
Problem: Some of the instances stored in DI might change because of the plugin update. For example there might be suddenly a new setting in a
Settings class. When then some code is trying to access this property a fatal error occurs, because we still have the old instance in DI and the old instance might be also used in other objects.
As we cannot easily just reset the DI container we should ideally just perform a redirect immediately after a plugin was updated. It may be even smart to not load the plugin immediately, but may be necessary in order to perform the plugin updates. Needs to be checked.
We had this case recently with
AnonymousPiwikUsageMeasurement plugin where a new setting
$anonymizeSelfPiwik was added. It should be possible to reproduce it by updating this plugin say from 0.1.X to 0.2.1