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

Remove UserSettings Plugin #7846

Merged
merged 2 commits into from May 10, 2015
Merged

Remove UserSettings Plugin #7846

merged 2 commits into from May 10, 2015

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented May 6, 2015

The UserSettings API was deprecated in 2.9.0, 2.10.0 and 2.11.0

After removing all the deprecated methods, the plugin did nothing anymore so I removed it.

@tsteur tsteur added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label May 6, 2015
@tsteur tsteur force-pushed the usersettingsapi_removed branch 2 times, most recently from c8cbb17 to 688bfb7 Compare May 6, 2015 03:20
@tsteur tsteur added this to the Piwik 2.14.0 milestone May 6, 2015
@tsteur tsteur added Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels May 6, 2015
{
public function doUpdate(Updater $updater)
{
$this->uninstallPlugin('UserSettings');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: I added a test in DeprecatedMethodsTest and a comment:

// please be aware if re-adding a plugin called UserSettings, and someone updates eg from Piwik 2.13 to that version,
// the plugin will be possibly removed in an Update during 2.14.0

@sgiehl
Copy link
Member

sgiehl commented May 6, 2015

Looks good to me :shipit:
Maybe we should also remove https://github.com/piwik/piwik/blob/usersettingsapi_removed/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortAsc__Live.getLastVisitsDetails_month.xml
It still contains old UserSettings icons. As no test is failing, guess we can remove the file

@tsteur
Copy link
Member Author

tsteur commented May 6, 2015

Will remove it and see what happens. I saw this one as well and was confused

@@ -1191,6 +1191,8 @@ private function executePluginDeactivate($pluginName)
*/
private function unloadPluginFromMemory($pluginName)
{
$this->unloadPlugin($pluginName);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why there is unloadPluginFromMemory() and unloadPlugin() and why one calls the other?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I don't understand the question. UnloadPluginFromMemory did before only remove the activated plugin, now it does actually remove the loaded and the activated plugin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> why are there 2 methods that look like they do the same thing? Is there a difference between them? From the name it's hard to tell.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plugin::uninstall is more or less meant as a hook where plugins can remove eg created files, DB tables/data etc in case the plugin gets uninstalled.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering about Plugin\Manager::unloadPluginFromMemory() and Plugin\Manager::unloadPlugin() (both in the plugin manager)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realize it was re unloadPluginFromMemory... well, I can have a look if there's maybe a better name that makes it clearer. The name was already there...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep no worries this small change just made me see there were those 2 methods so I was curious

@mnapoli
Copy link
Contributor

mnapoli commented May 8, 2015

👍 for merge (need a rebase)

As the plugin does now nothing anymore, I removed it.
tsteur added a commit that referenced this pull request May 10, 2015
@tsteur tsteur merged commit 7a91458 into master May 10, 2015
@tsteur tsteur deleted the usersettingsapi_removed branch May 10, 2015 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Needs Review PRs that need a code review Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants