From d1d447217787a8c6d465d0146fb4f86d136ce16c Mon Sep 17 00:00:00 2001
From: mattab <matthieu.aubry@gmail.com>
Date: Tue, 8 Oct 2013 17:35:56 +1300
Subject: [PATCH] Refs #4123 Applying phpstorm "Organize imports" on core/* and
 plugins/* directories

---
 core/API/DataTableManipulator.php                  |  2 +-
 core/API/DataTableManipulator/Flattener.php        |  2 +-
 core/API/DataTableManipulator/LabelFilter.php      |  2 +-
 core/API/DocumentationGenerator.php                |  4 ++--
 core/API/ResponseBuilder.php                       |  8 ++++----
 core/Archive.php                                   |  4 ++--
 core/Archive/DataCollection.php                    |  1 -
 core/Archive/DataTableFactory.php                  |  2 +-
 core/ArchiveProcessor.php                          |  8 ++++----
 core/ArchiveProcessor/Day.php                      |  2 +-
 core/ArchiveProcessor/Rules.php                    |  2 +-
 core/Console.php                                   |  2 +-
 core/Controller.php                                |  1 -
 core/Controller/Admin.php                          |  6 +++---
 core/DataAccess/ArchiveSelector.php                | 12 ++++++------
 core/DataAccess/ArchiveTableCreator.php            |  2 +-
 core/DataAccess/ArchiveWriter.php                  |  4 ++--
 core/DataAccess/LogAggregator.php                  |  6 +++---
 core/DataArray.php                                 |  1 -
 core/DataTable.php                                 |  4 ++--
 core/DataTable/Filter.php                          |  2 +-
 .../Filter/AddColumnsProcessedMetrics.php          |  2 +-
 .../Filter/AddColumnsProcessedMetricsGoal.php      |  2 +-
 core/DataTable/Filter/AddSummaryRow.php            |  2 +-
 .../Filter/ColumnCallbackAddColumnQuotient.php     |  2 +-
 core/DataTable/Filter/ColumnCallbackReplace.php    |  2 +-
 core/DataTable/Filter/MetadataCallbackReplace.php  |  1 -
 core/DataTable/Filter/PatternRecursive.php         |  4 ++--
 core/DataTable/Filter/ReplaceColumnNames.php       |  2 +-
 core/DataTable/Filter/ReplaceSummaryRowLabel.php   |  2 +-
 core/DataTable/Filter/Sort.php                     |  4 ++--
 core/DataTable/Filter/Truncate.php                 |  2 +-
 core/DataTable/Renderer.php                        |  2 +-
 core/DataTable/Renderer/Console.php                |  2 +-
 core/DataTable/Renderer/Php.php                    |  4 ++--
 core/DataTable/Renderer/Rss.php                    |  2 +-
 core/DataTable/Renderer/Xml.php                    |  6 +++---
 core/DataTable/Row.php                             |  3 +--
 core/DataTable/Row/DataTableSummaryRow.php         |  2 +-
 core/Db/BatchInsert.php                            |  2 +-
 core/Log.php                                       |  1 -
 core/Menu/Admin.php                                |  1 -
 core/Option.php                                    |  1 -
 core/Period.php                                    |  2 +-
 core/Period/Range.php                              |  2 +-
 core/Period/Year.php                               |  2 +-
 core/Piwik.php                                     |  2 +-
 core/Plugin/MetadataLoader.php                     |  2 +-
 core/Session.php                                   |  1 -
 core/Site.php                                      |  2 +-
 core/Tracker/Cache.php                             |  2 +-
 core/Tracker/GoalManager.php                       |  2 +-
 core/Tracker/Request.php                           |  2 +-
 core/Tracker/Visit.php                             |  7 +++----
 core/Unzip.php                                     |  1 -
 core/UpdateCheck.php                               |  1 -
 core/Updates.php                                   |  2 --
 core/Updates/0.5.4.php                             |  2 +-
 core/Updates/0.6.3.php                             |  2 +-
 core/Updates/1.2.3.php                             |  2 +-
 core/Updates/1.7.2-rc7.php                         |  2 +-
 core/Updates/1.8.3-b1.php                          |  2 +-
 core/Updates/2.0-a12.php                           |  2 +-
 core/Updates/2.0-a13.php                           |  2 +-
 core/View.php                                      |  1 -
 core/View/ReportsByDimension.php                   |  2 +-
 core/ViewDataTable.php                             |  2 +-
 core/ViewDataTable/Properties.php                  |  4 ++--
 core/ViewDataTable/Visualization.php               |  2 +-
 core/functions.php                                 |  2 +-
 plugins/API/Controller.php                         |  4 ++--
 plugins/API/RowEvolution.php                       |  6 +++---
 plugins/Actions/API.php                            | 10 +++++-----
 plugins/Actions/Archiver.php                       |  4 ++--
 plugins/Actions/ArchivingHelper.php                |  2 +-
 plugins/Actions/Controller.php                     |  2 +-
 plugins/Annotations/API.php                        |  6 +++---
 plugins/Annotations/AnnotationList.php             |  2 +-
 plugins/Annotations/Controller.php                 |  2 +-
 plugins/AnonymizeIP/AnonymizeIP.php                |  2 +-
 plugins/CoreAdminHome/API.php                      | 10 +++++-----
 plugins/CoreAdminHome/CoreAdminHome.php            |  4 ++--
 plugins/CoreConsole/RunTests.php                   |  2 +-
 plugins/CoreConsole/WatchLog.php                   |  1 -
 plugins/CoreHome/Controller.php                    | 14 ++++++--------
 .../CoreHome/DataTableRowAction/RowEvolution.php   |  8 ++++----
 plugins/CorePluginsAdmin/Controller.php            |  3 +--
 plugins/CorePluginsAdmin/Marketplace.php           |  1 -
 plugins/CorePluginsAdmin/MarketplaceApiClient.php  |  2 +-
 plugins/CorePluginsAdmin/PluginInstaller.php       |  2 +-
 plugins/CoreVisualizations/JqplotDataGenerator.php |  2 +-
 .../JqplotDataGenerator/Evolution.php              |  4 ++--
 .../CoreVisualizations/Visualizations/Cloud.php    |  2 +-
 .../Visualizations/HtmlTable.php                   |  2 +-
 .../Visualizations/JqplotGraph.php                 |  4 ++--
 .../Visualizations/JqplotGraph/Bar.php             |  2 +-
 .../Visualizations/JqplotGraph/Evolution.php       |  4 ++--
 .../Visualizations/JqplotGraph/Pie.php             |  2 +-
 plugins/CustomVariables/API.php                    |  4 ++--
 plugins/CustomVariables/Archiver.php               |  5 ++---
 plugins/CustomVariables/Controller.php             |  2 +-
 plugins/CustomVariables/CustomVariables.php        |  1 -
 plugins/DBStats/API.php                            |  2 +-
 plugins/DBStats/DBStats.php                        |  4 ++--
 plugins/Dashboard/Controller.php                   |  5 ++---
 plugins/Dashboard/Dashboard.php                    |  4 ++--
 plugins/DevicesDetection/API.php                   |  2 +-
 plugins/DevicesDetection/Controller.php            |  6 +++---
 plugins/DevicesDetection/DevicesDetection.php      |  4 ++--
 plugins/ExamplePlugin/Controller.php               |  5 ++---
 plugins/ExampleUI/API.php                          |  2 +-
 plugins/ExampleUI/Controller.php                   |  3 +--
 plugins/Feedback/Controller.php                    |  8 ++++----
 plugins/Goals/API.php                              |  6 +++---
 plugins/Goals/Archiver.php                         |  4 ++--
 plugins/Goals/Controller.php                       |  9 ++++-----
 plugins/Goals/Goals.php                            |  6 +++---
 plugins/ImageGraph/ImageGraph.php                  |  4 ++--
 plugins/ImageGraph/StaticGraph.php                 |  4 ++--
 plugins/ImageGraph/StaticGraph/Exception.php       |  2 +-
 plugins/Installation/Controller.php                |  1 -
 plugins/Installation/FormDatabaseSetup.php         |  2 +-
 plugins/Installation/FormFirstWebsiteSetup.php     |  4 ++--
 plugins/Installation/FormGeneralSetup.php          |  4 ++--
 plugins/Installation/Installation.php              |  2 +-
 plugins/LanguagesManager/LanguagesManager.php      |  8 ++++----
 plugins/Live/API.php                               |  2 +-
 plugins/Login/Auth.php                             |  4 ++--
 plugins/MobileMessaging/API.php                    |  2 +-
 plugins/MobileMessaging/Controller.php             |  6 ++----
 plugins/MobileMessaging/MobileMessaging.php        |  4 ++--
 plugins/MobileMessaging/ReportRenderer/Sms.php     |  2 +-
 plugins/MultiSites/API.php                         |  8 ++++----
 plugins/Overlay/API.php                            |  9 ++++-----
 plugins/PrivacyManager/LogDataPurger.php           |  2 +-
 plugins/PrivacyManager/PrivacyManager.php          |  8 ++++----
 plugins/Provider/Provider.php                      |  6 +++---
 plugins/Referrers/API.php                          |  6 +++---
 plugins/Referrers/Archiver.php                     |  2 +-
 plugins/Referrers/Controller.php                   |  6 +++---
 plugins/SEO/API.php                                |  2 +-
 plugins/SEO/RankChecker.php                        |  4 ++--
 plugins/ScheduledReports/API.php                   |  6 +++---
 plugins/ScheduledReports/Controller.php            |  6 ++----
 plugins/SegmentEditor/API.php                      |  4 ++--
 plugins/SegmentEditor/Controller.php               |  5 ++---
 plugins/SegmentEditor/SegmentEditor.php            |  4 ++--
 plugins/Transitions/API.php                        |  6 +++---
 plugins/UserCountry/API.php                        |  4 ++--
 plugins/UserCountry/Archiver.php                   |  4 ++--
 plugins/UserCountry/Controller.php                 | 12 +++++-------
 plugins/UserCountry/GeoIPAutoUpdater.php           |  9 ++++-----
 plugins/UserCountry/LocationProvider.php           |  2 +-
 plugins/UserCountry/LocationProvider/Default.php   |  2 +-
 plugins/UserCountry/UserCountry.php                |  8 ++++----
 plugins/UserCountry/functions.php                  |  1 -
 plugins/UserCountryMap/Controller.php              |  8 ++++----
 plugins/UserSettings/API.php                       |  2 +-
 plugins/UserSettings/Archiver.php                  |  4 ++--
 plugins/UserSettings/Controller.php                |  2 +-
 plugins/UserSettings/UserSettings.php              |  1 -
 plugins/UserSettings/functions.php                 |  1 -
 plugins/UsersManager/API.php                       |  8 ++++----
 plugins/UsersManager/Controller.php                | 12 ++++++------
 plugins/VisitFrequency/API.php                     |  2 +-
 plugins/VisitFrequency/Controller.php              |  2 +-
 plugins/VisitTime/API.php                          |  4 ++--
 plugins/VisitTime/Archiver.php                     |  2 +-
 plugins/VisitTime/Controller.php                   |  2 +-
 plugins/VisitTime/VisitTime.php                    |  2 +-
 plugins/VisitorInterest/API.php                    |  2 +-
 plugins/VisitorInterest/Archiver.php               |  2 +-
 plugins/VisitorInterest/Controller.php             |  3 +--
 plugins/VisitorInterest/VisitorInterest.php        |  2 +-
 plugins/VisitsSummary/Controller.php               |  8 ++++----
 175 files changed, 291 insertions(+), 331 deletions(-)

diff --git a/core/API/DataTableManipulator.php b/core/API/DataTableManipulator.php
index 45bebbf4ac..1c5d81768d 100644
--- a/core/API/DataTableManipulator.php
+++ b/core/API/DataTableManipulator.php
@@ -12,8 +12,8 @@ namespace Piwik\API;
 
 use Exception;
 use Piwik\DataTable\Row;
-use Piwik\Period\Range;
 use Piwik\DataTable;
+use Piwik\Period\Range;
 use Piwik\Plugins\API\API;
 
 /**
diff --git a/core/API/DataTableManipulator/Flattener.php b/core/API/DataTableManipulator/Flattener.php
index 7eb1c51d89..7ca244a91a 100644
--- a/core/API/DataTableManipulator/Flattener.php
+++ b/core/API/DataTableManipulator/Flattener.php
@@ -10,9 +10,9 @@
  */
 namespace Piwik\API\DataTableManipulator;
 
+use Piwik\API\DataTableManipulator;
 use Piwik\DataTable;
 use Piwik\DataTable\Row;
-use Piwik\API\DataTableManipulator;
 
 /**
  * This class is responsible for flattening data tables.
diff --git a/core/API/DataTableManipulator/LabelFilter.php b/core/API/DataTableManipulator/LabelFilter.php
index 90065e3175..9faa82e7a9 100644
--- a/core/API/DataTableManipulator/LabelFilter.php
+++ b/core/API/DataTableManipulator/LabelFilter.php
@@ -10,10 +10,10 @@
  */
 namespace Piwik\API\DataTableManipulator;
 
+use Piwik\API\DataTableManipulator;
 use Piwik\Common;
 use Piwik\DataTable;
 use Piwik\DataTable\Row;
-use Piwik\API\DataTableManipulator;
 
 /**
  * This class is responsible for handling the label parameter that can be
diff --git a/core/API/DocumentationGenerator.php b/core/API/DocumentationGenerator.php
index a7e2559aca..84f976451d 100644
--- a/core/API/DocumentationGenerator.php
+++ b/core/API/DocumentationGenerator.php
@@ -11,11 +11,11 @@
 namespace Piwik\API;
 
 use Exception;
-use Piwik\Piwik;
 use Piwik\Common;
 
-use Piwik\Url;
+use Piwik\Piwik;
 use Piwik\PluginsManager;
+use Piwik\Url;
 
 /**
  * @package Piwik
diff --git a/core/API/ResponseBuilder.php b/core/API/ResponseBuilder.php
index 7aeb474e02..bf8f9f16fc 100644
--- a/core/API/ResponseBuilder.php
+++ b/core/API/ResponseBuilder.php
@@ -12,14 +12,14 @@ namespace Piwik\API;
 
 use Exception;
 use Piwik\API\DataTableManipulator\Flattener;
-use Piwik\API\DataTableManipulator\LabelFilter;
 
+use Piwik\API\DataTableManipulator\LabelFilter;
+use Piwik\Common;
 use Piwik\DataTable\Renderer\Json;
-use Piwik\DataTable\Simple;
 use Piwik\DataTable\Renderer;
-use Piwik\Piwik;
-use Piwik\Common;
+use Piwik\DataTable\Simple;
 use Piwik\DataTable;
+use Piwik\Piwik;
 
 /**
  * @package Piwik
diff --git a/core/Archive.php b/core/Archive.php
index 05c6dc2ab3..b29aef2731 100644
--- a/core/Archive.php
+++ b/core/Archive.php
@@ -10,11 +10,11 @@
  */
 namespace Piwik;
 use Piwik\Archive\Parameters;
-use Piwik\Period\Range;
-
 use Piwik\ArchiveProcessor\Rules;
 use Piwik\DataAccess\ArchiveSelector;
 
+use Piwik\Period\Range;
+
 /**
  * The archive object is used to query specific data for a day or a period of statistics for a given website.
  *
diff --git a/core/Archive/DataCollection.php b/core/Archive/DataCollection.php
index 0bc89d5bbd..c514702488 100644
--- a/core/Archive/DataCollection.php
+++ b/core/Archive/DataCollection.php
@@ -12,7 +12,6 @@
 namespace Piwik\Archive;
 
 use Exception;
-
 use Piwik\DataTable;
 
 /**
diff --git a/core/Archive/DataTableFactory.php b/core/Archive/DataTableFactory.php
index a21a4ed463..c849c29168 100644
--- a/core/Archive/DataTableFactory.php
+++ b/core/Archive/DataTableFactory.php
@@ -11,9 +11,9 @@
 
 namespace Piwik\Archive;
 
-use Piwik\Site;
 use Piwik\DataTable;
 use Piwik\DataTable\Row;
+use Piwik\Site;
 
 /**
  * Creates a DataTable or Set instance based on an array
diff --git a/core/ArchiveProcessor.php b/core/ArchiveProcessor.php
index 09576d8c65..4ac17c04a3 100644
--- a/core/ArchiveProcessor.php
+++ b/core/ArchiveProcessor.php
@@ -10,14 +10,14 @@
  */
 namespace Piwik;
 use Exception;
-use Piwik\ArchiveProcessor\Rules;
-
-use Piwik\Period;
 
-use Piwik\Db;
+use Piwik\ArchiveProcessor\Rules;
 use Piwik\DataAccess\ArchiveSelector;
 use Piwik\DataAccess\ArchiveWriter;
 use Piwik\DataAccess\LogAggregator;
+use Piwik\Db;
+
+use Piwik\Period;
 
 /**
  * The ArchiveProcessor class is used by the Archive object to make sure the given Archive is processed and available in the DB.
diff --git a/core/ArchiveProcessor/Day.php b/core/ArchiveProcessor/Day.php
index c0732d9885..691ea7c54d 100644
--- a/core/ArchiveProcessor/Day.php
+++ b/core/ArchiveProcessor/Day.php
@@ -9,10 +9,10 @@
  * @package Piwik
  */
 namespace Piwik\ArchiveProcessor;
-use Piwik\Metrics;
 use Piwik\ArchiveProcessor;
 use Piwik\DataArray;
 use Piwik\DataTable;
+use Piwik\Metrics;
 
 /**
  * This class
diff --git a/core/ArchiveProcessor/Rules.php b/core/ArchiveProcessor/Rules.php
index 39191c4794..58ff2425df 100644
--- a/core/ArchiveProcessor/Rules.php
+++ b/core/ArchiveProcessor/Rules.php
@@ -14,12 +14,12 @@ use Exception;
 use Piwik\Common;
 use Piwik\Config;
 use Piwik\Date;
+use Piwik\Log;
 use Piwik\Piwik;
 use Piwik\Segment;
 use Piwik\SettingsPiwik;
 use Piwik\SettingsServer;
 use Piwik\Site;
-use Piwik\Log;
 use Piwik\Tracker\Cache;
 
 /**
diff --git a/core/Console.php b/core/Console.php
index 9d154bfe00..7b3e319c61 100644
--- a/core/Console.php
+++ b/core/Console.php
@@ -10,9 +10,9 @@
  */
 namespace Piwik;
 
+use Piwik\Plugins\CoreConsole\GenerateApi;
 use Piwik\Plugins\CoreConsole\GenerateController;
 use Piwik\Plugins\CoreConsole\GeneratePlugin;
-use Piwik\Plugins\CoreConsole\GenerateApi;
 use Piwik\Plugins\CoreConsole\RunTests;
 use Piwik\Plugins\CoreConsole\WatchLog;
 use Symfony\Component\Console\Application;
diff --git a/core/Controller.php b/core/Controller.php
index bcd4516594..72302d557f 100644
--- a/core/Controller.php
+++ b/core/Controller.php
@@ -20,7 +20,6 @@ use Piwik\Plugins\API\API;
 use Piwik\Plugins\LanguagesManager\LanguagesManager;
 use Piwik\Plugins\SitesManager\API as APISitesManager;
 use Piwik\Plugins\UsersManager\API as APIUsersManager;
-
 use Piwik\View;
 use Piwik\ViewDataTable;
 
diff --git a/core/Controller/Admin.php b/core/Controller/Admin.php
index 33f08d0b93..004160d453 100644
--- a/core/Controller/Admin.php
+++ b/core/Controller/Admin.php
@@ -11,12 +11,12 @@
 namespace Piwik\Controller;
 
 use Piwik\Config;
-use Piwik\Piwik;
 use Piwik\Controller;
+use Piwik\Piwik;
+use Piwik\PluginsManager;
+use Piwik\Url;
 use Piwik\Version;
 use Piwik\View;
-use Piwik\Url;
-use Piwik\PluginsManager;
 
 /**
  * Parent class of all plugins Controllers with admin functions
diff --git a/core/DataAccess/ArchiveSelector.php b/core/DataAccess/ArchiveSelector.php
index c072ac751e..e9a1d6efb5 100644
--- a/core/DataAccess/ArchiveSelector.php
+++ b/core/DataAccess/ArchiveSelector.php
@@ -12,17 +12,17 @@ namespace Piwik\DataAccess;
 
 use Exception;
 use Piwik\ArchiveProcessor\Rules;
+use Piwik\ArchiveProcessor;
+use Piwik\Common;
+use Piwik\Date;
+use Piwik\Db;
+use Piwik\Log;
 use Piwik\Period;
 use Piwik\Period\Range;
 use Piwik\Piwik;
-use Piwik\Common;
-use Piwik\Date;
-use Piwik\ArchiveProcessor;
 use Piwik\Segment;
-use Piwik\Site;
 
-use Piwik\Db;
-use Piwik\Log;
+use Piwik\Site;
 
 /**
  * Data Access object used to query archives
diff --git a/core/DataAccess/ArchiveTableCreator.php b/core/DataAccess/ArchiveTableCreator.php
index d6681fa5ae..0db27240ec 100644
--- a/core/DataAccess/ArchiveTableCreator.php
+++ b/core/DataAccess/ArchiveTableCreator.php
@@ -14,8 +14,8 @@ namespace Piwik\DataAccess;
 use Exception;
 use Piwik\Common;
 use Piwik\Date;
-use Piwik\DbHelper;
 use Piwik\Db;
+use Piwik\DbHelper;
 
 class ArchiveTableCreator
 {
diff --git a/core/DataAccess/ArchiveWriter.php b/core/DataAccess/ArchiveWriter.php
index b3538b5b79..3d21ba4a5d 100644
--- a/core/DataAccess/ArchiveWriter.php
+++ b/core/DataAccess/ArchiveWriter.php
@@ -17,11 +17,11 @@ use Piwik\Common;
 use Piwik\Config;
 use Piwik\Db;
 use Piwik\Db\BatchInsert;
-use Piwik\Period;
+use Piwik\Log;
 
+use Piwik\Period;
 use Piwik\Segment;
 use Piwik\SettingsPiwik;
-use Piwik\Log;
 
 /**
  * This class is used to create a new Archive.
diff --git a/core/DataAccess/LogAggregator.php b/core/DataAccess/LogAggregator.php
index 080a71d846..fcde08cdf5 100644
--- a/core/DataAccess/LogAggregator.php
+++ b/core/DataAccess/LogAggregator.php
@@ -12,12 +12,12 @@ namespace Piwik\DataAccess;
 
 use PDOStatement;
 use Piwik\Common;
-use Piwik\Metrics;
 use Piwik\Date;
+use Piwik\Db;
+use Piwik\Metrics;
 use Piwik\Segment;
-use Piwik\Site;
 
-use Piwik\Db;
+use Piwik\Site;
 use Piwik\Tracker\GoalManager;
 
 /**
diff --git a/core/DataArray.php b/core/DataArray.php
index 8c22414821..47c7d5a8cd 100644
--- a/core/DataArray.php
+++ b/core/DataArray.php
@@ -11,7 +11,6 @@
 namespace Piwik;
 
 use Exception;
-
 use Piwik\Tracker\GoalManager;
 
 /**
diff --git a/core/DataTable.php b/core/DataTable.php
index 08eb02ea79..50569d6069 100644
--- a/core/DataTable.php
+++ b/core/DataTable.php
@@ -12,12 +12,12 @@
 namespace Piwik;
 
 use Closure;
-use Exception;
 
+use Exception;
+use Piwik\DataTable\Filter;
 use Piwik\DataTable\Manager;
 use Piwik\DataTable\Renderer\Html;
 use Piwik\DataTable\Row;
-use Piwik\DataTable\Filter;
 use Piwik\DataTable\Row\DataTableSummaryRow;
 use ReflectionClass;
 
diff --git a/core/DataTable/Filter.php b/core/DataTable/Filter.php
index 5b79a0c8bc..73cfb13ee5 100644
--- a/core/DataTable/Filter.php
+++ b/core/DataTable/Filter.php
@@ -11,8 +11,8 @@
 namespace Piwik\DataTable;
 
 use Exception;
-use Piwik\DataTable;
 
+use Piwik\DataTable;
 use Piwik\DataTable\Row;
 
 /**
diff --git a/core/DataTable/Filter/AddColumnsProcessedMetrics.php b/core/DataTable/Filter/AddColumnsProcessedMetrics.php
index 1a4dfbf8bc..ad5b5d194d 100644
--- a/core/DataTable/Filter/AddColumnsProcessedMetrics.php
+++ b/core/DataTable/Filter/AddColumnsProcessedMetrics.php
@@ -12,8 +12,8 @@ namespace Piwik\DataTable\Filter;
 
 use Piwik\DataTable\Filter;
 use Piwik\DataTable\Row;
-use Piwik\Metrics;
 use Piwik\DataTable;
+use Piwik\Metrics;
 
 /**
  * @package Piwik
diff --git a/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php b/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php
index 8fa4af3f34..8a0e335681 100644
--- a/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php
+++ b/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php
@@ -11,8 +11,8 @@
 namespace Piwik\DataTable\Filter;
 
 use Exception;
-use Piwik\DataTable;
 
+use Piwik\DataTable;
 use Piwik\Metrics;
 use Piwik\Piwik;
 use Piwik\Tracker\GoalManager;
diff --git a/core/DataTable/Filter/AddSummaryRow.php b/core/DataTable/Filter/AddSummaryRow.php
index 12504fa033..1aa0325799 100644
--- a/core/DataTable/Filter/AddSummaryRow.php
+++ b/core/DataTable/Filter/AddSummaryRow.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\DataTable\Filter;
 
-use Piwik\DataTable;
 use Piwik\DataTable\Filter;
+use Piwik\DataTable;
 use Piwik\DataTable\Row;
 
 /**
diff --git a/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php b/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php
index 4e95a8a9a2..69862cfc44 100644
--- a/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php
+++ b/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\DataTable\Filter;
 
-use Piwik\DataTable;
 use Piwik\DataTable\Filter;
+use Piwik\DataTable;
 use Piwik\DataTable\Row;
 
 /**
diff --git a/core/DataTable/Filter/ColumnCallbackReplace.php b/core/DataTable/Filter/ColumnCallbackReplace.php
index 26f1b12433..e50bd29aa4 100644
--- a/core/DataTable/Filter/ColumnCallbackReplace.php
+++ b/core/DataTable/Filter/ColumnCallbackReplace.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\DataTable\Filter;
 
-use Piwik\DataTable;
 use Piwik\DataTable\Filter;
+use Piwik\DataTable;
 use Piwik\DataTable\Row;
 
 /**
diff --git a/core/DataTable/Filter/MetadataCallbackReplace.php b/core/DataTable/Filter/MetadataCallbackReplace.php
index 56f9b6b056..2f5b6f5548 100644
--- a/core/DataTable/Filter/MetadataCallbackReplace.php
+++ b/core/DataTable/Filter/MetadataCallbackReplace.php
@@ -11,7 +11,6 @@
 namespace Piwik\DataTable\Filter;
 
 use Piwik\DataTable;
-
 use Piwik\DataTable\Row;
 
 /**
diff --git a/core/DataTable/Filter/PatternRecursive.php b/core/DataTable/Filter/PatternRecursive.php
index 9f98af0209..ceaab23d22 100644
--- a/core/DataTable/Filter/PatternRecursive.php
+++ b/core/DataTable/Filter/PatternRecursive.php
@@ -11,9 +11,9 @@
 namespace Piwik\DataTable\Filter;
 
 use Exception;
-use Piwik\DataTable;
-use Piwik\DataTable\Filter;
 
+use Piwik\DataTable\Filter;
+use Piwik\DataTable;
 use Piwik\DataTable\Manager;
 
 /**
diff --git a/core/DataTable/Filter/ReplaceColumnNames.php b/core/DataTable/Filter/ReplaceColumnNames.php
index a11d5e3c9f..932c42e599 100644
--- a/core/DataTable/Filter/ReplaceColumnNames.php
+++ b/core/DataTable/Filter/ReplaceColumnNames.php
@@ -12,9 +12,9 @@ namespace Piwik\DataTable\Filter;
 
 use Piwik\DataTable\Filter;
 use Piwik\DataTable\Simple;
+use Piwik\DataTable;
 use Piwik\Metrics;
 use Piwik\Piwik;
-use Piwik\DataTable;
 use Piwik\Tracker\GoalManager;
 
 /**
diff --git a/core/DataTable/Filter/ReplaceSummaryRowLabel.php b/core/DataTable/Filter/ReplaceSummaryRowLabel.php
index 2e65716922..ef20db28bf 100644
--- a/core/DataTable/Filter/ReplaceSummaryRowLabel.php
+++ b/core/DataTable/Filter/ReplaceSummaryRowLabel.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\DataTable\Filter;
 
-use Piwik\DataTable;
 use Piwik\DataTable\Filter;
+use Piwik\DataTable;
 use Piwik\DataTable\Manager;
 
 /**
diff --git a/core/DataTable/Filter/Sort.php b/core/DataTable/Filter/Sort.php
index 72bc433bef..1b58a27269 100644
--- a/core/DataTable/Filter/Sort.php
+++ b/core/DataTable/Filter/Sort.php
@@ -11,10 +11,10 @@
 namespace Piwik\DataTable\Filter;
 
 use Piwik\DataTable\Filter;
-use Piwik\DataTable\Simple;
 use Piwik\DataTable\Row;
-use Piwik\Metrics;
+use Piwik\DataTable\Simple;
 use Piwik\DataTable;
+use Piwik\Metrics;
 
 /**
  * Sort the DataTable based on the value of column $columnToSort ordered by $order.
diff --git a/core/DataTable/Filter/Truncate.php b/core/DataTable/Filter/Truncate.php
index 1cd6f98bf0..bea38ad178 100644
--- a/core/DataTable/Filter/Truncate.php
+++ b/core/DataTable/Filter/Truncate.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\DataTable\Filter;
 
-use Piwik\DataTable;
 use Piwik\DataTable\Filter;
+use Piwik\DataTable;
 use Piwik\DataTable\Manager;
 
 /**
diff --git a/core/DataTable/Renderer.php b/core/DataTable/Renderer.php
index 1d82e1c52f..6a82af8f44 100644
--- a/core/DataTable/Renderer.php
+++ b/core/DataTable/Renderer.php
@@ -11,10 +11,10 @@
 namespace Piwik\DataTable;
 
 use Exception;
+use Piwik\DataTable;
 use Piwik\Loader;
 use Piwik\Metrics;
 use Piwik\Piwik;
-use Piwik\DataTable;
 
 /**
  * A DataTable Renderer can produce an output given a DataTable object.
diff --git a/core/DataTable/Renderer/Console.php b/core/DataTable/Renderer/Console.php
index 20cef78d85..d0b509de3d 100644
--- a/core/DataTable/Renderer/Console.php
+++ b/core/DataTable/Renderer/Console.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\DataTable\Renderer;
 
-use Piwik\DataTable;
 use Piwik\DataTable\Manager;
+use Piwik\DataTable;
 use Piwik\DataTable\Renderer;
 
 /**
diff --git a/core/DataTable/Renderer/Php.php b/core/DataTable/Renderer/Php.php
index 59f3b45a01..7bf2d2713c 100644
--- a/core/DataTable/Renderer/Php.php
+++ b/core/DataTable/Renderer/Php.php
@@ -12,10 +12,10 @@ namespace Piwik\DataTable\Renderer;
 
 use Exception;
 use Piwik\DataTable\Manager;
-use Piwik\DataTable\Simple;
 use Piwik\DataTable\Renderer;
-use Piwik\Piwik;
+use Piwik\DataTable\Simple;
 use Piwik\DataTable;
+use Piwik\Piwik;
 
 /**
  * Returns the equivalent PHP array for a given DataTable.
diff --git a/core/DataTable/Renderer/Rss.php b/core/DataTable/Renderer/Rss.php
index 2e3e3265bc..dee117a90f 100644
--- a/core/DataTable/Renderer/Rss.php
+++ b/core/DataTable/Renderer/Rss.php
@@ -13,8 +13,8 @@ namespace Piwik\DataTable\Renderer;
 use Exception;
 use Piwik\Common;
 use Piwik\DataTable\Renderer;
-use Piwik\Date;
 use Piwik\DataTable;
+use Piwik\Date;
 use Piwik\Url;
 
 /**
diff --git a/core/DataTable/Renderer/Xml.php b/core/DataTable/Renderer/Xml.php
index 4e2d251cd6..ec4a6585cf 100644
--- a/core/DataTable/Renderer/Xml.php
+++ b/core/DataTable/Renderer/Xml.php
@@ -11,11 +11,11 @@
 namespace Piwik\DataTable\Renderer;
 
 use Exception;
-use Piwik\DataTable;
-use Piwik\DataTable\Map;
 
-use Piwik\DataTable\Simple;
+use Piwik\DataTable\Map;
 use Piwik\DataTable\Renderer;
+use Piwik\DataTable;
+use Piwik\DataTable\Simple;
 use Piwik\Piwik;
 
 /**
diff --git a/core/DataTable/Row.php b/core/DataTable/Row.php
index f0e1303a64..8ac6f29617 100644
--- a/core/DataTable/Row.php
+++ b/core/DataTable/Row.php
@@ -11,9 +11,8 @@
 namespace Piwik\DataTable;
 
 use Exception;
-
-use Piwik\Metrics;
 use Piwik\DataTable;
+use Piwik\Metrics;
 
 /**
  * A DataTable is composed of rows.
diff --git a/core/DataTable/Row/DataTableSummaryRow.php b/core/DataTable/Row/DataTableSummaryRow.php
index b98343f91f..7e1d939da2 100644
--- a/core/DataTable/Row/DataTableSummaryRow.php
+++ b/core/DataTable/Row/DataTableSummaryRow.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\DataTable\Row;
 
-use Piwik\DataTable;
 use Piwik\DataTable\Manager;
+use Piwik\DataTable;
 use Piwik\DataTable\Row;
 
 /**
diff --git a/core/Db/BatchInsert.php b/core/Db/BatchInsert.php
index 464ec94fc9..2f2bd97948 100644
--- a/core/Db/BatchInsert.php
+++ b/core/Db/BatchInsert.php
@@ -14,10 +14,10 @@ use Exception;
 use Piwik\AssetManager;
 use Piwik\Common;
 use Piwik\Config;
-use Piwik\Log;
 use Piwik\Db;
 use Piwik\DbHelper;
 
+use Piwik\Log;
 use Piwik\SettingsPiwik;
 use Piwik\SettingsServer;
 
diff --git a/core/Log.php b/core/Log.php
index 8a2548b915..7063d21759 100644
--- a/core/Log.php
+++ b/core/Log.php
@@ -10,7 +10,6 @@
  */
 namespace Piwik;
 
-
 use Piwik\Db;
 
 /**
diff --git a/core/Menu/Admin.php b/core/Menu/Admin.php
index 8d67d2d61a..7e74b20468 100644
--- a/core/Menu/Admin.php
+++ b/core/Menu/Admin.php
@@ -10,7 +10,6 @@
  */
 namespace Piwik\Menu;
 
-
 use Piwik\Piwik;
 
 /**
diff --git a/core/Option.php b/core/Option.php
index e4a33480dd..d986b87522 100644
--- a/core/Option.php
+++ b/core/Option.php
@@ -10,7 +10,6 @@
  */
 namespace Piwik;
 
-
 /**
  * Option provides a very simple mechanism to save/retrieve key-values pair
  * from the database (persistent key-value datastore).
diff --git a/core/Period.php b/core/Period.php
index f875e89311..6e143dcf78 100644
--- a/core/Period.php
+++ b/core/Period.php
@@ -9,8 +9,8 @@
  * @package Piwik
  */
 namespace Piwik;
-use Exception;
 
+use Exception;
 use Piwik\Period\Day;
 use Piwik\Period\Month;
 use Piwik\Period\Range;
diff --git a/core/Period/Range.php b/core/Period/Range.php
index 48406fb83c..7579701cfc 100644
--- a/core/Period/Range.php
+++ b/core/Period/Range.php
@@ -12,8 +12,8 @@ namespace Piwik\Period;
 
 use Exception;
 use Piwik\Common;
-use Piwik\Period;
 use Piwik\Date;
+use Piwik\Period;
 
 /**
  * from a starting date to an ending date
diff --git a/core/Period/Year.php b/core/Period/Year.php
index d6fa964916..4bad292180 100644
--- a/core/Period/Year.php
+++ b/core/Period/Year.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Period;
 
-use Piwik\Period;
 use Piwik\Date;
+use Piwik\Period;
 
 /**
  * @package Piwik
diff --git a/core/Piwik.php b/core/Piwik.php
index 4299f2673c..b70892de3b 100644
--- a/core/Piwik.php
+++ b/core/Piwik.php
@@ -15,8 +15,8 @@ use Piwik\Db\Adapter;
 use Piwik\Db\Schema;
 use Piwik\Db;
 use Piwik\Plugin;
-use Piwik\Plugins\UsersManager\API;
 
+use Piwik\Plugins\UsersManager\API;
 use Piwik\Session;
 use Piwik\Tracker;
 use Piwik\View;
diff --git a/core/Plugin/MetadataLoader.php b/core/Plugin/MetadataLoader.php
index 94d5a65cc1..22cd2ed55a 100644
--- a/core/Plugin/MetadataLoader.php
+++ b/core/Plugin/MetadataLoader.php
@@ -12,8 +12,8 @@ namespace Piwik\Plugin;
 
 use Exception;
 use Piwik\Common;
-use Piwik\Version;
 use Piwik\PluginsManager;
+use Piwik\Version;
 
 /**
  * @see core/Version.php
diff --git a/core/Session.php b/core/Session.php
index df511d1464..c51de9b91e 100644
--- a/core/Session.php
+++ b/core/Session.php
@@ -11,7 +11,6 @@
 namespace Piwik;
 
 use Exception;
-
 use Piwik\Session\SaveHandler\DbTable;
 use Zend_Session;
 
diff --git a/core/Site.php b/core/Site.php
index a97fc31621..262795076f 100644
--- a/core/Site.php
+++ b/core/Site.php
@@ -10,8 +10,8 @@
  */
 
 namespace Piwik;
-use Exception;
 
+use Exception;
 use Piwik\Plugins\SitesManager\API;
 
 /**
diff --git a/core/Tracker/Cache.php b/core/Tracker/Cache.php
index 837b7e8673..8ae471f54f 100644
--- a/core/Tracker/Cache.php
+++ b/core/Tracker/Cache.php
@@ -11,9 +11,9 @@
 namespace Piwik\Tracker;
 
 use Piwik\ArchiveProcessor\Rules;
+use Piwik\CacheFile;
 use Piwik\Config;
 use Piwik\Piwik;
-use Piwik\CacheFile;
 use Piwik\Tracker;
 
 /**
diff --git a/core/Tracker/GoalManager.php b/core/Tracker/GoalManager.php
index f77a7d7c92..16b0cba03c 100644
--- a/core/Tracker/GoalManager.php
+++ b/core/Tracker/GoalManager.php
@@ -11,8 +11,8 @@
 namespace Piwik\Tracker;
 
 use Exception;
-use Piwik\Config;
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\Tracker;
 
 /**
diff --git a/core/Tracker/Request.php b/core/Tracker/Request.php
index 8f16bb1650..844254e593 100644
--- a/core/Tracker/Request.php
+++ b/core/Tracker/Request.php
@@ -2,8 +2,8 @@
 namespace Piwik\Tracker;
 
 use Exception;
-use Piwik\Config;
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\Cookie;
 use Piwik\IP;
 use Piwik\Tracker;
diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php
index 08411b3942..99f2c81764 100644
--- a/core/Tracker/Visit.php
+++ b/core/Tracker/Visit.php
@@ -11,13 +11,12 @@
 
 namespace Piwik\Tracker;
 
-use Piwik\Config;
+use Exception;
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\IP;
-use Piwik\Tracker;
-
-use Exception;
 
+use Piwik\Tracker;
 use UserAgentParser;
 
 /**
diff --git a/core/Unzip.php b/core/Unzip.php
index 4eb7d93e29..d3bb716caf 100644
--- a/core/Unzip.php
+++ b/core/Unzip.php
@@ -12,7 +12,6 @@
 namespace Piwik;
 
 use Piwik\Unzip\Gzip;
-
 use Piwik\Unzip\PclZip;
 use Piwik\Unzip\Tar;
 use Piwik\Unzip\ZipArchive;
diff --git a/core/UpdateCheck.php b/core/UpdateCheck.php
index f381ec6c65..45e0c02370 100644
--- a/core/UpdateCheck.php
+++ b/core/UpdateCheck.php
@@ -11,7 +11,6 @@
 namespace Piwik;
 
 use Exception;
-
 use Piwik\Plugins\SitesManager\API;
 
 /**
diff --git a/core/Updates.php b/core/Updates.php
index afecf07680..a0b1204a0c 100644
--- a/core/Updates.php
+++ b/core/Updates.php
@@ -10,8 +10,6 @@
  */
 namespace Piwik;
 
-
-
 /**
  * Abstract class for update scripts
  *
diff --git a/core/Updates/0.5.4.php b/core/Updates/0.5.4.php
index a386e4b306..9e79fba2a1 100644
--- a/core/Updates/0.5.4.php
+++ b/core/Updates/0.5.4.php
@@ -11,8 +11,8 @@
 
 namespace Piwik\Updates;
 
-use Piwik\Config;
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\Updater;
 use Piwik\Updates;
 
diff --git a/core/Updates/0.6.3.php b/core/Updates/0.6.3.php
index 3737c96bce..12e4451b6a 100644
--- a/core/Updates/0.6.3.php
+++ b/core/Updates/0.6.3.php
@@ -11,8 +11,8 @@
 
 namespace Piwik\Updates;
 
-use Piwik\Config;
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\Updater;
 use Piwik\Updates;
 
diff --git a/core/Updates/1.2.3.php b/core/Updates/1.2.3.php
index 7f786e2d09..6bc0b8116e 100644
--- a/core/Updates/1.2.3.php
+++ b/core/Updates/1.2.3.php
@@ -11,8 +11,8 @@
 
 namespace Piwik\Updates;
 
-use Piwik\Config;
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\Updater;
 use Piwik\Updates;
 
diff --git a/core/Updates/1.7.2-rc7.php b/core/Updates/1.7.2-rc7.php
index 454d14599e..55f1ff3d68 100755
--- a/core/Updates/1.7.2-rc7.php
+++ b/core/Updates/1.7.2-rc7.php
@@ -12,9 +12,9 @@
 namespace Piwik\Updates;
 
 use Piwik\Common;
+use Piwik\Db;
 use Piwik\Updater;
 use Piwik\Updates;
-use Piwik\Db;
 
 /**
  * @package Updates
diff --git a/core/Updates/1.8.3-b1.php b/core/Updates/1.8.3-b1.php
index d931ef8082..92d5062879 100644
--- a/core/Updates/1.8.3-b1.php
+++ b/core/Updates/1.8.3-b1.php
@@ -12,10 +12,10 @@
 namespace Piwik\Updates;
 
 use Piwik\Common;
+use Piwik\Db;
 use Piwik\Plugins\ScheduledReports\ScheduledReports;
 use Piwik\Updater;
 use Piwik\Updates;
-use Piwik\Db;
 
 /**
  * @package Updates
diff --git a/core/Updates/2.0-a12.php b/core/Updates/2.0-a12.php
index 4f8aac1272..de9815cfec 100644
--- a/core/Updates/2.0-a12.php
+++ b/core/Updates/2.0-a12.php
@@ -11,9 +11,9 @@
 namespace Piwik\Updates;
 
 use Piwik\Common;
+use Piwik\Db;
 use Piwik\Updater;
 use Piwik\Updates;
-use Piwik\Db;
 
 /**
  * @package Updates
diff --git a/core/Updates/2.0-a13.php b/core/Updates/2.0-a13.php
index 5a572d8073..b2168967ee 100644
--- a/core/Updates/2.0-a13.php
+++ b/core/Updates/2.0-a13.php
@@ -11,10 +11,10 @@
 namespace Piwik\Updates;
 
 use Piwik\Common;
+use Piwik\Db;
 use Piwik\Filesystem;
 use Piwik\Updater;
 use Piwik\Updates;
-use Piwik\Db;
 
 /**
  * @package Updates
diff --git a/core/View.php b/core/View.php
index c0b6c9bcc2..4b593103f9 100644
--- a/core/View.php
+++ b/core/View.php
@@ -11,7 +11,6 @@
 namespace Piwik;
 
 use Exception;
-
 use Piwik\Plugins\SitesManager\API as APISitesManager;
 use Piwik\Plugins\UsersManager\API as APIUsersManager;
 use Piwik\View\ViewInterface;
diff --git a/core/View/ReportsByDimension.php b/core/View/ReportsByDimension.php
index b394736271..2662f814d9 100644
--- a/core/View/ReportsByDimension.php
+++ b/core/View/ReportsByDimension.php
@@ -11,8 +11,8 @@
 namespace Piwik\View;
 
 use Piwik\FrontController;
-use Piwik\View;
 use Piwik\Url;
+use Piwik\View;
 
 /**
  * A facade that makes it easier to use the '_reportsByDimension.twig' template.
diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php
index 8317c94e22..4edacabea4 100644
--- a/core/ViewDataTable.php
+++ b/core/ViewDataTable.php
@@ -16,8 +16,8 @@ use Piwik\Period;
 use Piwik\Period\Range;
 use Piwik\Plugins\API\API;
 use Piwik\ViewDataTable\Properties;
-use Piwik\ViewDataTable\VisualizationPropertiesProxy;
 use Piwik\ViewDataTable\Visualization;
+use Piwik\ViewDataTable\VisualizationPropertiesProxy;
 
 /**
  * This class is used to load (from the API) and customize the output of a given DataTable.
diff --git a/core/ViewDataTable/Properties.php b/core/ViewDataTable/Properties.php
index 9929b663cc..4f5886a327 100644
--- a/core/ViewDataTable/Properties.php
+++ b/core/ViewDataTable/Properties.php
@@ -12,11 +12,11 @@
 namespace Piwik\ViewDataTable;
 
 use Exception;
-use ReflectionClass;
-
 use Piwik\Config;
 use Piwik\Metrics;
 
+use ReflectionClass;
+
 /**
  * Contains the list of all core DataTable display properties for use with ViewDataTable.
  *
diff --git a/core/ViewDataTable/Visualization.php b/core/ViewDataTable/Visualization.php
index 45e3c61e32..c2b7cbe096 100644
--- a/core/ViewDataTable/Visualization.php
+++ b/core/ViewDataTable/Visualization.php
@@ -11,8 +11,8 @@
 
 namespace Piwik\ViewDataTable;
 
-use Piwik\View;
 use Piwik\DataTable;
+use Piwik\View;
 
 /**
  * Base class for all DataTable visualizations. Different visualizations are used to
diff --git a/core/functions.php b/core/functions.php
index b1cf05abc7..ca8a34d7c0 100644
--- a/core/functions.php
+++ b/core/functions.php
@@ -12,8 +12,8 @@
 // All classes and functions below are defined in the global namespace
 namespace {
 
-    use Piwik\EventDispatcher;
     use Piwik\DataTable;
+    use Piwik\EventDispatcher;
     use Piwik\Menu\Admin;
     use Piwik\Menu\Main;
     use Piwik\Menu\Top;
diff --git a/plugins/API/Controller.php b/plugins/API/Controller.php
index c5793174ac..0dcf07bba7 100644
--- a/plugins/API/Controller.php
+++ b/plugins/API/Controller.php
@@ -11,10 +11,10 @@
 namespace Piwik\Plugins\API;
 
 use Piwik\API\DocumentationGenerator;
-use Piwik\API\Request;
 use Piwik\API\Proxy;
-use Piwik\Config;
+use Piwik\API\Request;
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\View;
 
 /**
diff --git a/plugins/API/RowEvolution.php b/plugins/API/RowEvolution.php
index db1ec57fb1..acd1254acc 100644
--- a/plugins/API/RowEvolution.php
+++ b/plugins/API/RowEvolution.php
@@ -12,15 +12,15 @@ namespace Piwik\Plugins\API;
 
 use Exception;
 use Piwik\API\DataTableManipulator\LabelFilter;
-use Piwik\API\ResponseBuilder;
 use Piwik\API\Request;
+use Piwik\API\ResponseBuilder;
+use Piwik\Common;
 use Piwik\DataTable\Filter\CalculateEvolutionFilter;
 use Piwik\DataTable\Filter\SafeDecodeLabel;
 use Piwik\DataTable\Row;
+use Piwik\DataTable;
 use Piwik\Period;
 use Piwik\Piwik;
-use Piwik\Common;
-use Piwik\DataTable;
 use Piwik\Url;
 
 /**
diff --git a/plugins/Actions/API.php b/plugins/Actions/API.php
index a88dc1c230..14cbfaeb74 100644
--- a/plugins/Actions/API.php
+++ b/plugins/Actions/API.php
@@ -12,16 +12,16 @@ namespace Piwik\Plugins\Actions;
 
 use Exception;
 use Piwik\Archive;
-use Piwik\Metrics;
-use Piwik\Piwik;
 use Piwik\Common;
-use Piwik\Date;
 use Piwik\DataTable;
+use Piwik\Date;
+use Piwik\Metrics;
 
-use Piwik\Tracker\Action;
-
+use Piwik\Piwik;
 use Piwik\Plugins\CustomVariables\API as APICustomVariables;
 
+use Piwik\Tracker\Action;
+
 /**
  * The Actions API lets you request reports for all your Visitor Actions: Page URLs, Page titles (Piwik Events),
  * File Downloads and Clicks on external websites.
diff --git a/plugins/Actions/Archiver.php b/plugins/Actions/Archiver.php
index a45545574e..7b69d07a51 100644
--- a/plugins/Actions/Archiver.php
+++ b/plugins/Actions/Archiver.php
@@ -13,10 +13,10 @@ namespace Piwik\Plugins\Actions;
 use Piwik\Config;
 use Piwik\DataTable\Manager;
 use Piwik\DataTable\Row\DataTableSummaryRow;
-use Piwik\Metrics;
 use Piwik\DataTable;
-use Piwik\RankingQuery;
+use Piwik\Metrics;
 use Piwik\PluginsArchiver;
+use Piwik\RankingQuery;
 use Piwik\Tracker\Action;
 
 /**
diff --git a/plugins/Actions/ArchivingHelper.php b/plugins/Actions/ArchivingHelper.php
index e66cf73a97..8c08171f31 100644
--- a/plugins/Actions/ArchivingHelper.php
+++ b/plugins/Actions/ArchivingHelper.php
@@ -13,8 +13,8 @@ namespace Piwik\Plugins\Actions;
 use PDOStatement;
 use Piwik\Config;
 use Piwik\DataTable\Row;
-use Piwik\Metrics;
 use Piwik\DataTable;
+use Piwik\Metrics;
 use Piwik\Tracker\Action;
 use Zend_Db_Statement;
 
diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php
index e5367df741..f3035e1318 100644
--- a/plugins/Actions/Controller.php
+++ b/plugins/Actions/Controller.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\Actions;
 
-use Piwik\ViewDataTable;
 use Piwik\View;
+use Piwik\ViewDataTable;
 
 /**
  * Actions controller
diff --git a/plugins/Annotations/API.php b/plugins/Annotations/API.php
index 21ea6f8a53..d574ebd76d 100755
--- a/plugins/Annotations/API.php
+++ b/plugins/Annotations/API.php
@@ -11,13 +11,13 @@
 namespace Piwik\Plugins\Annotations;
 
 use Exception;
+use Piwik\Date;
 use Piwik\Period;
 use Piwik\Period\Range;
-use Piwik\Piwik;
-use Piwik\Date;
 
-use Piwik\ViewDataTable;
+use Piwik\Piwik;
 use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Evolution as EvolutionViz;
+use Piwik\ViewDataTable;
 
 /**
  * @see plugins/Annotations/AnnotationList.php
diff --git a/plugins/Annotations/AnnotationList.php b/plugins/Annotations/AnnotationList.php
index 75b4d95df1..93b38f0b6b 100755
--- a/plugins/Annotations/AnnotationList.php
+++ b/plugins/Annotations/AnnotationList.php
@@ -11,8 +11,8 @@
 namespace Piwik\Plugins\Annotations;
 
 use Exception;
-use Piwik\Piwik;
 use Piwik\Date;
+use Piwik\Piwik;
 use Piwik\Site;
 
 /**
diff --git a/plugins/Annotations/Controller.php b/plugins/Annotations/Controller.php
index 968baef392..e31c0b7044 100755
--- a/plugins/Annotations/Controller.php
+++ b/plugins/Annotations/Controller.php
@@ -11,8 +11,8 @@
 namespace Piwik\Plugins\Annotations;
 
 use Piwik\API\Request;
-use Piwik\Common;
 
+use Piwik\Common;
 use Piwik\View;
 
 /**
diff --git a/plugins/AnonymizeIP/AnonymizeIP.php b/plugins/AnonymizeIP/AnonymizeIP.php
index 62829bb691..1339b76e49 100644
--- a/plugins/AnonymizeIP/AnonymizeIP.php
+++ b/plugins/AnonymizeIP/AnonymizeIP.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\AnonymizeIP;
 
-use Piwik\Config;
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\IP;
 use Piwik\Version;
 
diff --git a/plugins/CoreAdminHome/API.php b/plugins/CoreAdminHome/API.php
index 13aff44da3..8c52b97b09 100644
--- a/plugins/CoreAdminHome/API.php
+++ b/plugins/CoreAdminHome/API.php
@@ -11,17 +11,17 @@
 namespace Piwik\Plugins\CoreAdminHome;
 
 use Exception;
+use Piwik\Common;
+use Piwik\Config;
 use Piwik\DataAccess\ArchiveTableCreator;
+use Piwik\Date;
+use Piwik\Db;
 use Piwik\Period;
 use Piwik\Period\Week;
 use Piwik\Piwik;
-use Piwik\Config;
-use Piwik\Common;
-use Piwik\Date;
 use Piwik\SettingsPiwik;
-use Piwik\TaskScheduler;
 use Piwik\Site;
-use Piwik\Db;
+use Piwik\TaskScheduler;
 
 /**
  * @package CoreAdminHome
diff --git a/plugins/CoreAdminHome/CoreAdminHome.php b/plugins/CoreAdminHome/CoreAdminHome.php
index 01b80aa85b..24fb7e52b2 100644
--- a/plugins/CoreAdminHome/CoreAdminHome.php
+++ b/plugins/CoreAdminHome/CoreAdminHome.php
@@ -12,10 +12,10 @@ namespace Piwik\Plugins\CoreAdminHome;
 
 use Piwik\DataAccess\ArchiveSelector;
 use Piwik\DataAccess\ArchiveTableCreator;
-use Piwik\Piwik;
 use Piwik\Date;
-use Piwik\ScheduledTask;
 use Piwik\Db;
+use Piwik\Piwik;
+use Piwik\ScheduledTask;
 use Piwik\ScheduledTime\Daily;
 
 /**
diff --git a/plugins/CoreConsole/RunTests.php b/plugins/CoreConsole/RunTests.php
index fb48f8745f..052af2ac9d 100644
--- a/plugins/CoreConsole/RunTests.php
+++ b/plugins/CoreConsole/RunTests.php
@@ -14,8 +14,8 @@ namespace Piwik\Plugins\CoreConsole;
 use Piwik\Console\Command;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\OutputInterface;
 use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
 
 /**
  * @package CoreConsole
diff --git a/plugins/CoreConsole/WatchLog.php b/plugins/CoreConsole/WatchLog.php
index 16adfc56db..7c864d68f9 100644
--- a/plugins/CoreConsole/WatchLog.php
+++ b/plugins/CoreConsole/WatchLog.php
@@ -12,7 +12,6 @@
 namespace Piwik\Plugins\CoreConsole;
 
 use Piwik\Console\Command;
-
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 
diff --git a/plugins/CoreHome/Controller.php b/plugins/CoreHome/Controller.php
index 024975bc29..98eec48feb 100644
--- a/plugins/CoreHome/Controller.php
+++ b/plugins/CoreHome/Controller.php
@@ -12,20 +12,18 @@ namespace Piwik\Plugins\CoreHome;
 
 use Exception;
 use Piwik\API\Request;
-
-use Piwik\Piwik;
 use Piwik\Common;
 use Piwik\Date;
-
 use Piwik\FrontController;
-use Piwik\Plugins\CorePluginsAdmin\MarketplaceApiClient;
-use Piwik\View;
-use Piwik\Url;
-use Piwik\UpdateCheck;
-use Piwik\Site;
+use Piwik\Piwik;
 use Piwik\Plugins\CoreHome\DataTableRowAction\MultiRowEvolution;
 use Piwik\Plugins\CoreHome\DataTableRowAction\RowEvolution;
+use Piwik\Plugins\CorePluginsAdmin\MarketplaceApiClient;
 use Piwik\Plugins\UsersManager\API;
+use Piwik\Site;
+use Piwik\UpdateCheck;
+use Piwik\Url;
+use Piwik\View;
 
 /**
  *
diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php
index 971993e19a..4190db95e7 100644
--- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php
+++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php
@@ -11,14 +11,14 @@
 namespace Piwik\Plugins\CoreHome\DataTableRowAction;
 
 use Exception;
-use Piwik\API\ResponseBuilder;
 use Piwik\API\Request;
+use Piwik\API\ResponseBuilder;
 use Piwik\Common;
-use Piwik\Metrics;
 use Piwik\Date;
-use Piwik\ViewDataTable;
-use Piwik\Url;
+use Piwik\Metrics;
 use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Evolution as EvolutionViz;
+use Piwik\Url;
+use Piwik\ViewDataTable;
 
 /**
  * ROW EVOLUTION
diff --git a/plugins/CorePluginsAdmin/Controller.php b/plugins/CorePluginsAdmin/Controller.php
index 2bb20770b6..7e32b924ad 100644
--- a/plugins/CorePluginsAdmin/Controller.php
+++ b/plugins/CorePluginsAdmin/Controller.php
@@ -11,15 +11,14 @@
 namespace Piwik\Plugins\CorePluginsAdmin;
 
 use Piwik\Common;
-
 use Piwik\Filechecks;
 use Piwik\Filesystem;
 use Piwik\Nonce;
 use Piwik\Piwik;
 use Piwik\Plugin;
+use Piwik\PluginsManager;
 use Piwik\Url;
 use Piwik\View;
-use Piwik\PluginsManager;
 
 /**
  * @package CorePluginsAdmin
diff --git a/plugins/CorePluginsAdmin/Marketplace.php b/plugins/CorePluginsAdmin/Marketplace.php
index f8529c74da..7540a3df19 100644
--- a/plugins/CorePluginsAdmin/Marketplace.php
+++ b/plugins/CorePluginsAdmin/Marketplace.php
@@ -11,7 +11,6 @@
 namespace Piwik\Plugins\CorePluginsAdmin;
 
 use Piwik\Date;
-
 use Piwik\PluginsManager;
 
 /**
diff --git a/plugins/CorePluginsAdmin/MarketplaceApiClient.php b/plugins/CorePluginsAdmin/MarketplaceApiClient.php
index a5b6d7b53e..76499675f6 100644
--- a/plugins/CorePluginsAdmin/MarketplaceApiClient.php
+++ b/plugins/CorePluginsAdmin/MarketplaceApiClient.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\CorePluginsAdmin;
 use Piwik\CacheFile;
-use Piwik\Http;
 
+use Piwik\Http;
 use Piwik\PluginsManager;
 use Piwik\Version;
 
diff --git a/plugins/CorePluginsAdmin/PluginInstaller.php b/plugins/CorePluginsAdmin/PluginInstaller.php
index 4bc1ca8229..10d7b454bd 100644
--- a/plugins/CorePluginsAdmin/PluginInstaller.php
+++ b/plugins/CorePluginsAdmin/PluginInstaller.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\CorePluginsAdmin;
 use Piwik\Filechecks;
-use Piwik\Filesystem;
 
+use Piwik\Filesystem;
 use Piwik\SettingsPiwik;
 use Piwik\Unzip;
 
diff --git a/plugins/CoreVisualizations/JqplotDataGenerator.php b/plugins/CoreVisualizations/JqplotDataGenerator.php
index 602f3ca383..73eba01367 100644
--- a/plugins/CoreVisualizations/JqplotDataGenerator.php
+++ b/plugins/CoreVisualizations/JqplotDataGenerator.php
@@ -13,9 +13,9 @@ namespace Piwik\Plugins\CoreVisualizations;
 
 use Exception;
 use Piwik\Common;
-use Piwik\Metrics;
 use Piwik\DataTable;
 
+use Piwik\Metrics;
 use Piwik\Plugins\CoreVisualizations\JqplotDataGenerator\Chart;
 
 require_once PIWIK_INCLUDE_PATH . '/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php';
diff --git a/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php b/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php
index 18e75f2cc1..3b1eeccab8 100644
--- a/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php
+++ b/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php
@@ -14,9 +14,9 @@ namespace Piwik\Plugins\CoreVisualizations\JqplotDataGenerator;
 use Piwik\Common;
 use Piwik\DataTable;
 use Piwik\DataTable\Row;
-use Piwik\ViewDataTable;
-use Piwik\Url;
 use Piwik\Plugins\CoreVisualizations\JqplotDataGenerator;
+use Piwik\Url;
+use Piwik\ViewDataTable;
 
 /**
  * Generates JQPlot JSON data/config for evolution graphs.
diff --git a/plugins/CoreVisualizations/Visualizations/Cloud.php b/plugins/CoreVisualizations/Visualizations/Cloud.php
index 125c82805a..36b98c3816 100644
--- a/plugins/CoreVisualizations/Visualizations/Cloud.php
+++ b/plugins/CoreVisualizations/Visualizations/Cloud.php
@@ -11,8 +11,8 @@
 namespace Piwik\Plugins\CoreVisualizations\Visualizations;
 
 use Piwik\Common;
-use Piwik\View;
 use Piwik\DataTable;
+use Piwik\View;
 use Piwik\ViewDataTable\Visualization;
 
 /**
diff --git a/plugins/CoreVisualizations/Visualizations/HtmlTable.php b/plugins/CoreVisualizations/Visualizations/HtmlTable.php
index aaec9caa28..a15274e40f 100644
--- a/plugins/CoreVisualizations/Visualizations/HtmlTable.php
+++ b/plugins/CoreVisualizations/Visualizations/HtmlTable.php
@@ -14,12 +14,12 @@ use Piwik\Common;
 use Piwik\Config;
 use Piwik\DataTable;
 use Piwik\DataTable\Filter\AddColumnsProcessedMetricsGoal;
-use Piwik\ViewDataTable\Visualization;
 use Piwik\MetricsFormatter;
 use Piwik\Piwik;
 use Piwik\Plugins\Goals\API as APIGoals;
 use Piwik\Site;
 use Piwik\View;
+use Piwik\ViewDataTable\Visualization;
 
 require_once PIWIK_INCLUDE_PATH . '/plugins/CoreVisualizations/Visualizations/HtmlTable/AllColumns.php';
 require_once PIWIK_INCLUDE_PATH . '/plugins/CoreVisualizations/Visualizations/HtmlTable/Goals.php';
diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph.php
index d7e1fc8808..42a2fcf1f6 100644
--- a/plugins/CoreVisualizations/Visualizations/JqplotGraph.php
+++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph.php
@@ -11,10 +11,10 @@
 namespace Piwik\Plugins\CoreVisualizations\Visualizations;
 
 
-use Piwik\View;
 use Piwik\DataTable;
-use Piwik\ViewDataTable\Graph;
 use Piwik\Plugins\CoreVisualizations\JqplotDataGenerator;
+use Piwik\View;
+use Piwik\ViewDataTable\Graph;
 
 /**
  * DataTable visualization that displays DataTable data in a JQPlot graph.
diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Bar.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Bar.php
index 27e46abf87..9efa563e91 100644
--- a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Bar.php
+++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Bar.php
@@ -11,8 +11,8 @@
 
 namespace Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph;
 
-use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph;
 use Piwik\Plugins\CoreVisualizations\JqplotDataGenerator;
+use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph;
 
 /**
  * Visualization that renders HTML for a Bar graph using jqPlot.
diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php
index 7e8237a6a3..7520025143 100644
--- a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php
+++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php
@@ -12,11 +12,11 @@
 namespace Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph;
 
 use Piwik\Common;
-use Piwik\Site;
 use Piwik\Controller;
 use Piwik\Period\Range;
-use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph;
 use Piwik\Plugins\CoreVisualizations\JqplotDataGenerator;
+use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph;
+use Piwik\Site;
 
 /**
  * Visualization that renders HTML for a line graph using jqPlot.
diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Pie.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Pie.php
index 0f2bf2737f..b051439d3d 100644
--- a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Pie.php
+++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Pie.php
@@ -11,8 +11,8 @@
 
 namespace Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph;
 
-use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph;
 use Piwik\Plugins\CoreVisualizations\JqplotDataGenerator;
+use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph;
 
 /**
  * Visualization that renders HTML for a Pie graph using jqPlot.
diff --git a/plugins/CustomVariables/API.php b/plugins/CustomVariables/API.php
index 4a147427e7..1420d43802 100644
--- a/plugins/CustomVariables/API.php
+++ b/plugins/CustomVariables/API.php
@@ -11,9 +11,9 @@
 namespace Piwik\Plugins\CustomVariables;
 
 use Piwik\Archive;
-use Piwik\Metrics;
-use Piwik\Date;
 use Piwik\DataTable;
+use Piwik\Date;
+use Piwik\Metrics;
 use Piwik\Tracker\Action;
 
 /**
diff --git a/plugins/CustomVariables/Archiver.php b/plugins/CustomVariables/Archiver.php
index 2980a43310..0c5cfea0a6 100644
--- a/plugins/CustomVariables/Archiver.php
+++ b/plugins/CustomVariables/Archiver.php
@@ -13,14 +13,13 @@ namespace Piwik\Plugins\CustomVariables;
 use Piwik\Common;
 use Piwik\Config;
 use Piwik\DataAccess\LogAggregator;
-use Piwik\Metrics;
 use Piwik\DataArray;
 
-use Piwik\Tracker;
+use Piwik\Metrics;
 use Piwik\PluginsArchiver;
+use Piwik\Tracker;
 use Piwik\Tracker\GoalManager;
 
-
 class Archiver extends PluginsArchiver
 {
     const LABEL_CUSTOM_VALUE_NOT_DEFINED = "Value not defined";
diff --git a/plugins/CustomVariables/Controller.php b/plugins/CustomVariables/Controller.php
index da88d4e66e..449349dd2c 100644
--- a/plugins/CustomVariables/Controller.php
+++ b/plugins/CustomVariables/Controller.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\CustomVariables;
 
-use Piwik\ViewDataTable;
 use Piwik\View;
+use Piwik\ViewDataTable;
 
 /**
  * @package CustomVariables
diff --git a/plugins/CustomVariables/CustomVariables.php b/plugins/CustomVariables/CustomVariables.php
index 06f26a2aa2..c641c792a5 100644
--- a/plugins/CustomVariables/CustomVariables.php
+++ b/plugins/CustomVariables/CustomVariables.php
@@ -11,7 +11,6 @@
 namespace Piwik\Plugins\CustomVariables;
 
 use Piwik\ArchiveProcessor;
-
 use Piwik\Tracker;
 use Piwik\WidgetsList;
 
diff --git a/plugins/DBStats/API.php b/plugins/DBStats/API.php
index 2f63fcea9a..1e3224cf2f 100644
--- a/plugins/DBStats/API.php
+++ b/plugins/DBStats/API.php
@@ -10,9 +10,9 @@
  */
 namespace Piwik\Plugins\DBStats;
 
-use Piwik\Piwik;
 use Piwik\Common;
 use Piwik\DataTable;
+use Piwik\Piwik;
 
 /**
  * @see plugins/DBStats/MySQLMetadataProvider.php
diff --git a/plugins/DBStats/DBStats.php b/plugins/DBStats/DBStats.php
index 047d599eea..34427e8e0e 100644
--- a/plugins/DBStats/DBStats.php
+++ b/plugins/DBStats/DBStats.php
@@ -10,10 +10,10 @@
  */
 namespace Piwik\Plugins\DBStats;
 
-use Piwik\Piwik;
-use Piwik\Date;
 use Piwik\Common;
+use Piwik\Date;
 
+use Piwik\Piwik;
 use Piwik\ScheduledTask;
 use Piwik\ScheduledTime\Weekly;
 
diff --git a/plugins/Dashboard/Controller.php b/plugins/Dashboard/Controller.php
index c919230db7..963e7dcf43 100644
--- a/plugins/Dashboard/Controller.php
+++ b/plugins/Dashboard/Controller.php
@@ -9,13 +9,12 @@
  */
 namespace Piwik\Plugins\Dashboard;
 
+use Piwik\Common;
 use Piwik\DataTable\Renderer\Json;
+use Piwik\Db;
 use Piwik\Piwik;
-use Piwik\Common;
-
 use Piwik\Session\SessionNamespace;
 use Piwik\View;
-use Piwik\Db;
 use Piwik\WidgetsList;
 
 /**
diff --git a/plugins/Dashboard/Dashboard.php b/plugins/Dashboard/Dashboard.php
index 23fe896491..12318cfcd3 100644
--- a/plugins/Dashboard/Dashboard.php
+++ b/plugins/Dashboard/Dashboard.php
@@ -11,10 +11,10 @@
 namespace Piwik\Plugins\Dashboard;
 
 use Exception;
-use Piwik\Piwik;
 use Piwik\Common;
-use Piwik\Site;
 use Piwik\Db;
+use Piwik\Piwik;
+use Piwik\Site;
 use Piwik\WidgetsList;
 
 /**
diff --git a/plugins/DevicesDetection/API.php b/plugins/DevicesDetection/API.php
index 250919c565..f899b0ce78 100644
--- a/plugins/DevicesDetection/API.php
+++ b/plugins/DevicesDetection/API.php
@@ -12,9 +12,9 @@
 namespace Piwik\Plugins\DevicesDetection;
 
 use Piwik\Archive;
+use Piwik\DataTable;
 use Piwik\Metrics;
 use Piwik\Piwik;
-use Piwik\DataTable;
 
 /**
  * The DevicesDetection API lets you access reports on your visitors devices, brands, models, Operating system, Browsers.
diff --git a/plugins/DevicesDetection/Controller.php b/plugins/DevicesDetection/Controller.php
index ac0beb50d4..2dec8ab910 100644
--- a/plugins/DevicesDetection/Controller.php
+++ b/plugins/DevicesDetection/Controller.php
@@ -10,11 +10,11 @@
  */
 namespace Piwik\Plugins\DevicesDetection;
 
-use Piwik\Piwik;
 use Piwik\Common;
-use Piwik\ViewDataTable;
-use Piwik\View;
 use Piwik\Db;
+use Piwik\Piwik;
+use Piwik\View;
+use Piwik\ViewDataTable;
 use UserAgentParserEnhanced;
 
 class Controller extends \Piwik\Controller
diff --git a/plugins/DevicesDetection/DevicesDetection.php b/plugins/DevicesDetection/DevicesDetection.php
index ae9ba66cae..9fe65c7951 100644
--- a/plugins/DevicesDetection/DevicesDetection.php
+++ b/plugins/DevicesDetection/DevicesDetection.php
@@ -13,11 +13,11 @@ namespace Piwik\Plugins\DevicesDetection;
 
 use Exception;
 use Piwik\ArchiveProcessor;
-use Piwik\Config;
 use Piwik\Common;
 
-use Piwik\WidgetsList;
+use Piwik\Config;
 use Piwik\Db;
+use Piwik\WidgetsList;
 use UserAgentParserEnhanced;
 
 require_once PIWIK_INCLUDE_PATH . "/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php";
diff --git a/plugins/ExamplePlugin/Controller.php b/plugins/ExamplePlugin/Controller.php
index 6a2001453c..38104a177f 100644
--- a/plugins/ExamplePlugin/Controller.php
+++ b/plugins/ExamplePlugin/Controller.php
@@ -10,12 +10,11 @@
  */
 namespace Piwik\Plugins\ExamplePlugin;
 
-use Piwik\Piwik;
 use Piwik\Common;
-use Piwik\View;
 use Piwik\Db;
-
+use Piwik\Piwik;
 use Piwik\Plugins\SitesManager\API;
+use Piwik\View;
 
 /**
  *
diff --git a/plugins/ExampleUI/API.php b/plugins/ExampleUI/API.php
index 7e60434c8e..3555a76776 100644
--- a/plugins/ExampleUI/API.php
+++ b/plugins/ExampleUI/API.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\ExampleUI;
 
-use Piwik\Period\Range;
 use Piwik\DataTable;
+use Piwik\Period\Range;
 
 /**
  * ExampleUI API is also an example API useful if you are developing a Piwik plugin.
diff --git a/plugins/ExampleUI/Controller.php b/plugins/ExampleUI/Controller.php
index 65fb1c7d82..d6cbdf316a 100644
--- a/plugins/ExampleUI/Controller.php
+++ b/plugins/ExampleUI/Controller.php
@@ -12,9 +12,8 @@ namespace Piwik\Plugins\ExampleUI;
 
 use Piwik\Common;
 use Piwik\Piwik;
-
-use Piwik\ViewDataTable;
 use Piwik\View;
+use Piwik\ViewDataTable;
 
 /**
  * @package ExampleUI
diff --git a/plugins/Feedback/Controller.php b/plugins/Feedback/Controller.php
index c905a5d683..b7ce4e8b49 100644
--- a/plugins/Feedback/Controller.php
+++ b/plugins/Feedback/Controller.php
@@ -11,15 +11,15 @@
 namespace Piwik\Plugins\Feedback;
 
 use Exception;
-use Piwik\Config;
-use Piwik\Piwik;
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\IP;
 use Piwik\Mail;
 use Piwik\Nonce;
-use Piwik\View;
-use Piwik\Version;
+use Piwik\Piwik;
 use Piwik\Url;
+use Piwik\Version;
+use Piwik\View;
 
 /**
  *
diff --git a/plugins/Goals/API.php b/plugins/Goals/API.php
index 66db3c2cbd..3522b087e0 100644
--- a/plugins/Goals/API.php
+++ b/plugins/Goals/API.php
@@ -12,12 +12,12 @@ namespace Piwik\Plugins\Goals;
 
 use Exception;
 use Piwik\Archive;
-use Piwik\Metrics;
-use Piwik\Piwik;
 use Piwik\Common;
 use Piwik\DataTable;
-use Piwik\Site;
 use Piwik\Db;
+use Piwik\Metrics;
+use Piwik\Piwik;
+use Piwik\Site;
 use Piwik\Tracker\Cache;
 use Piwik\Tracker\GoalManager;
 
diff --git a/plugins/Goals/Archiver.php b/plugins/Goals/Archiver.php
index 35be905257..612ce28a4d 100644
--- a/plugins/Goals/Archiver.php
+++ b/plugins/Goals/Archiver.php
@@ -12,9 +12,9 @@
 namespace Piwik\Plugins\Goals;
 
 use Piwik\DataAccess\LogAggregator;
-use Piwik\Metrics;
-use Piwik\DataTable;
 use Piwik\DataArray;
+use Piwik\DataTable;
+use Piwik\Metrics;
 use Piwik\PluginsArchiver;
 use Piwik\PluginsManager;
 use Piwik\Tracker\GoalManager;
diff --git a/plugins/Goals/Controller.php b/plugins/Goals/Controller.php
index 297dd3d29c..522d97b28f 100644
--- a/plugins/Goals/Controller.php
+++ b/plugins/Goals/Controller.php
@@ -12,16 +12,15 @@ namespace Piwik\Plugins\Goals;
 
 use Exception;
 use Piwik\API\Request;
-use Piwik\DataTable\Filter\AddColumnsProcessedMetricsGoal;
-use Piwik\Piwik;
 use Piwik\Common;
+use Piwik\DataTable\Filter\AddColumnsProcessedMetricsGoal;
 use Piwik\DataTable;
 use Piwik\FrontController;
+use Piwik\Piwik;
+use Piwik\Plugins\Referrers\API as APIReferrers;
 use Piwik\View\ReportsByDimension;
-use Piwik\ViewDataTable;
 use Piwik\View;
-
-use Piwik\Plugins\Referrers\API as APIReferrers;
+use Piwik\ViewDataTable;
 
 /**
  *
diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php
index 775dad2b5b..1cff5d8396 100644
--- a/plugins/Goals/Goals.php
+++ b/plugins/Goals/Goals.php
@@ -11,14 +11,14 @@
 namespace Piwik\Plugins\Goals;
 
 use Piwik\ArchiveProcessor;
-use Piwik\Piwik;
 use Piwik\Common;
+use Piwik\Db;
 
+use Piwik\Piwik;
+use Piwik\Site;
 use Piwik\Tracker\GoalManager;
 use Piwik\Translate;
-use Piwik\Site;
 use Piwik\WidgetsList;
-use Piwik\Db;
 
 /**
  *
diff --git a/plugins/ImageGraph/ImageGraph.php b/plugins/ImageGraph/ImageGraph.php
index 7b3d68d745..7240159a74 100644
--- a/plugins/ImageGraph/ImageGraph.php
+++ b/plugins/ImageGraph/ImageGraph.php
@@ -11,10 +11,10 @@
 namespace Piwik\Plugins\ImageGraph;
 
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\Period;
-use Piwik\Url;
 use Piwik\Site;
-use Piwik\Config;
+use Piwik\Url;
 
 class ImageGraph extends \Piwik\Plugin
 {
diff --git a/plugins/ImageGraph/StaticGraph.php b/plugins/ImageGraph/StaticGraph.php
index d0f7041401..1b908794fd 100644
--- a/plugins/ImageGraph/StaticGraph.php
+++ b/plugins/ImageGraph/StaticGraph.php
@@ -12,10 +12,10 @@
 namespace Piwik\Plugins\ImageGraph;
 
 use Exception;
-use Piwik\Loader;
-
 use pData;
 use pImage;
+
+use Piwik\Loader;
 use Piwik\SettingsPiwik;
 
 require_once PIWIK_INCLUDE_PATH . "/libs/pChart2.1.3/class/pDraw.class.php";
diff --git a/plugins/ImageGraph/StaticGraph/Exception.php b/plugins/ImageGraph/StaticGraph/Exception.php
index fdea924c72..fb39203a79 100644
--- a/plugins/ImageGraph/StaticGraph/Exception.php
+++ b/plugins/ImageGraph/StaticGraph/Exception.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\ImageGraph\StaticGraph;
 
-use Piwik\Plugins\ImageGraph\StaticGraph;
 use pData;
+use Piwik\Plugins\ImageGraph\StaticGraph;
 
 /**
  *
diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php
index 9911ae5eef..298cb0d791 100644
--- a/plugins/Installation/Controller.php
+++ b/plugins/Installation/Controller.php
@@ -23,7 +23,6 @@ use Piwik\DbHelper;
 use Piwik\Filechecks;
 use Piwik\Filesystem;
 use Piwik\Http;
-
 use Piwik\Piwik;
 use Piwik\Plugins\LanguagesManager\LanguagesManager;
 use Piwik\Plugins\SitesManager\API as APISitesManager;
diff --git a/plugins/Installation/FormDatabaseSetup.php b/plugins/Installation/FormDatabaseSetup.php
index 9e4a128719..a2551f1e6e 100644
--- a/plugins/Installation/FormDatabaseSetup.php
+++ b/plugins/Installation/FormDatabaseSetup.php
@@ -15,8 +15,8 @@ use HTML_QuickForm2_DataSource_Array;
 use HTML_QuickForm2_Factory;
 use HTML_QuickForm2_Rule;
 use Piwik\Db\Adapter;
-use Piwik\DbHelper;
 use Piwik\Db;
+use Piwik\DbHelper;
 use Piwik\Filesystem;
 use Piwik\QuickForm2;
 use Zend_Db_Adapter_Exception;
diff --git a/plugins/Installation/FormFirstWebsiteSetup.php b/plugins/Installation/FormFirstWebsiteSetup.php
index 7dd5b1c1e0..39b7c0ad70 100644
--- a/plugins/Installation/FormFirstWebsiteSetup.php
+++ b/plugins/Installation/FormFirstWebsiteSetup.php
@@ -10,11 +10,11 @@
  */
 
 namespace Piwik\Plugins\Installation;
-use HTML_QuickForm2_Rule;
 use HTML_QuickForm2_DataSource_Array;
 use HTML_QuickForm2_Factory;
-use Piwik\QuickForm2;
+use HTML_QuickForm2_Rule;
 use Piwik\Plugins\SitesManager\API;
+use Piwik\QuickForm2;
 
 /**
  *
diff --git a/plugins/Installation/FormGeneralSetup.php b/plugins/Installation/FormGeneralSetup.php
index 42d9bede2a..4691f2289e 100644
--- a/plugins/Installation/FormGeneralSetup.php
+++ b/plugins/Installation/FormGeneralSetup.php
@@ -10,11 +10,11 @@
  */
 namespace Piwik\Plugins\Installation;
 
-use HTML_QuickForm2_Rule;
 use HTML_QuickForm2_DataSource_Array;
 use HTML_QuickForm2_Factory;
-use Piwik\QuickForm2;
+use HTML_QuickForm2_Rule;
 use Piwik\Piwik;
+use Piwik\QuickForm2;
 
 /**
  *
diff --git a/plugins/Installation/Installation.php b/plugins/Installation/Installation.php
index 0c37aa5170..114352f232 100644
--- a/plugins/Installation/Installation.php
+++ b/plugins/Installation/Installation.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\Installation;
 
-use Piwik\Piwik;
 use Piwik\Common;
+use Piwik\Piwik;
 use Piwik\Translate;
 
 /**
diff --git a/plugins/LanguagesManager/LanguagesManager.php b/plugins/LanguagesManager/LanguagesManager.php
index e286ef8e98..2a4690016c 100644
--- a/plugins/LanguagesManager/LanguagesManager.php
+++ b/plugins/LanguagesManager/LanguagesManager.php
@@ -12,14 +12,14 @@
 namespace Piwik\Plugins\LanguagesManager;
 
 use Exception;
-use Piwik\Config;
-use Piwik\Piwik;
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\Cookie;
-
-use Piwik\View;
 use Piwik\Db;
+
+use Piwik\Piwik;
 use Piwik\Translate;
+use Piwik\View;
 
 /**
  *
diff --git a/plugins/Live/API.php b/plugins/Live/API.php
index 7d1938df69..cc9e055b4e 100644
--- a/plugins/Live/API.php
+++ b/plugins/Live/API.php
@@ -23,8 +23,8 @@ use Piwik\MetricsFormatter;
 use Piwik\Period;
 use Piwik\Period\Range;
 use Piwik\Piwik;
-use Piwik\Plugins\SitesManager\API as APISitesManager;
 use Piwik\Plugins\Referrers\API as APIReferrers;
+use Piwik\Plugins\SitesManager\API as APISitesManager;
 use Piwik\Segment;
 use Piwik\Site;
 use Piwik\Tracker\Action;
diff --git a/plugins/Login/Auth.php b/plugins/Login/Auth.php
index c60ea2d635..bab6404a8d 100644
--- a/plugins/Login/Auth.php
+++ b/plugins/Login/Auth.php
@@ -10,9 +10,9 @@
  */
 namespace Piwik\Plugins\Login;
 
-use Piwik\Config;
-use Piwik\Common;
 use Piwik\AuthResult;
+use Piwik\Common;
+use Piwik\Config;
 use Piwik\Db;
 use Piwik\Plugins\UsersManager\API;
 
diff --git a/plugins/MobileMessaging/API.php b/plugins/MobileMessaging/API.php
index 003c9f1436..38bd6265cc 100644
--- a/plugins/MobileMessaging/API.php
+++ b/plugins/MobileMessaging/API.php
@@ -10,9 +10,9 @@
  */
 namespace Piwik\Plugins\MobileMessaging;
 
-use Piwik\Piwik;
 use Piwik\Common;
 
+use Piwik\Piwik;
 use Piwik\Plugins\MobileMessaging\SMSProvider;
 use Piwik\Plugins\ScheduledReports\API as APIScheduledReports;
 
diff --git a/plugins/MobileMessaging/Controller.php b/plugins/MobileMessaging/Controller.php
index 32c0e1ac21..135452833a 100644
--- a/plugins/MobileMessaging/Controller.php
+++ b/plugins/MobileMessaging/Controller.php
@@ -11,14 +11,12 @@
 
 namespace Piwik\Plugins\MobileMessaging;
 
-use Piwik\Piwik;
 use Piwik\Common;
 use Piwik\IP;
+use Piwik\Piwik;
 use Piwik\Plugins\LanguagesManager\LanguagesManager;
-
-use Piwik\View;
-
 use Piwik\Plugins\MobileMessaging\SMSProvider;
+use Piwik\View;
 
 require_once PIWIK_INCLUDE_PATH . '/plugins/UserCountry/functions.php';
 
diff --git a/plugins/MobileMessaging/MobileMessaging.php b/plugins/MobileMessaging/MobileMessaging.php
index fd4627432d..5139235b8c 100644
--- a/plugins/MobileMessaging/MobileMessaging.php
+++ b/plugins/MobileMessaging/MobileMessaging.php
@@ -11,12 +11,12 @@
 namespace Piwik\Plugins\MobileMessaging;
 
 use Piwik\Piwik;
-use Piwik\Plugins\MobileMessaging\API as APIMobileMessaging;
-use Piwik\View;
 use Piwik\Plugins\API\API as APIPlugins;
+use Piwik\Plugins\MobileMessaging\API as APIMobileMessaging;
 use Piwik\Plugins\MobileMessaging\ReportRenderer\ReportRendererException;
 use Piwik\Plugins\MobileMessaging\ReportRenderer\Sms;
 use Piwik\Plugins\ScheduledReports\API as APIScheduledReports;
+use Piwik\View;
 
 /**
  *
diff --git a/plugins/MobileMessaging/ReportRenderer/Sms.php b/plugins/MobileMessaging/ReportRenderer/Sms.php
index a2064d5898..6e2ede2c94 100644
--- a/plugins/MobileMessaging/ReportRenderer/Sms.php
+++ b/plugins/MobileMessaging/ReportRenderer/Sms.php
@@ -12,9 +12,9 @@ namespace Piwik\Plugins\MobileMessaging\ReportRenderer;
 
 use Piwik\Common;
 use Piwik\Plugins\MultiSites\API;
-use Piwik\View;
 use Piwik\ReportRenderer;
 use Piwik\Site;
+use Piwik\View;
 
 /**
  *
diff --git a/plugins/MultiSites/API.php b/plugins/MultiSites/API.php
index ca4f559056..4fb01d3fbf 100755
--- a/plugins/MultiSites/API.php
+++ b/plugins/MultiSites/API.php
@@ -13,15 +13,15 @@ namespace Piwik\Plugins\MultiSites;
 use Exception;
 use Piwik\API\Request;
 use Piwik\Archive;
+use Piwik\Common;
 use Piwik\DataTable\Filter\CalculateEvolutionFilter;
+use Piwik\DataTable;
 use Piwik\Period\Range;
 use Piwik\Piwik;
-use Piwik\Common;
-use Piwik\DataTable;
 use Piwik\Plugins\Goals\Archiver;
-use Piwik\TaskScheduler;
-use Piwik\Site;
 use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\Site;
+use Piwik\TaskScheduler;
 
 /**
  * The MultiSites API lets you request the key metrics (visits, page views, revenue) for all Websites in Piwik.
diff --git a/plugins/Overlay/API.php b/plugins/Overlay/API.php
index 2810c39f76..4b6887238d 100644
--- a/plugins/Overlay/API.php
+++ b/plugins/Overlay/API.php
@@ -11,15 +11,14 @@
 namespace Piwik\Plugins\Overlay;
 
 use Exception;
-use Piwik\Config;
-use Piwik\Piwik;
 use Piwik\Access;
+use Piwik\Config;
 use Piwik\DataTable;
-use Piwik\Tracker\Action;
-use Piwik\Plugins\SitesManager\SitesManager;
+use Piwik\Piwik;
 use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\Plugins\SitesManager\SitesManager;
 use Piwik\Plugins\Transitions\API as APITransitions;
-
+use Piwik\Tracker\Action;
 
 class API
 {
diff --git a/plugins/PrivacyManager/LogDataPurger.php b/plugins/PrivacyManager/LogDataPurger.php
index 7fefd0c260..5c3247e7e4 100755
--- a/plugins/PrivacyManager/LogDataPurger.php
+++ b/plugins/PrivacyManager/LogDataPurger.php
@@ -12,8 +12,8 @@ namespace Piwik\Plugins\PrivacyManager;
 
 use Piwik\Common;
 use Piwik\Date;
-use Piwik\Db;
 
+use Piwik\Db;
 use Piwik\Log;
 
 /**
diff --git a/plugins/PrivacyManager/PrivacyManager.php b/plugins/PrivacyManager/PrivacyManager.php
index 9d397d6f33..baf451c7a5 100644
--- a/plugins/PrivacyManager/PrivacyManager.php
+++ b/plugins/PrivacyManager/PrivacyManager.php
@@ -11,15 +11,15 @@
 namespace Piwik\Plugins\PrivacyManager;
 
 use Exception;
+use Piwik\Common;
 use Piwik\Config;
+use Piwik\Date;
+use Piwik\Db;
 use Piwik\Metrics;
 use Piwik\Piwik;
-use Piwik\Common;
-use Piwik\Date;
-use Piwik\Plugins\Goals\Archiver;
 
+use Piwik\Plugins\Goals\Archiver;
 use Piwik\ScheduledTask;
-use Piwik\Db;
 use Piwik\ScheduledTime\Daily;
 use Piwik\Tracker\GoalManager;
 
diff --git a/plugins/Provider/Provider.php b/plugins/Provider/Provider.php
index 18c11f1e48..61e65faa93 100644
--- a/plugins/Provider/Provider.php
+++ b/plugins/Provider/Provider.php
@@ -11,12 +11,12 @@
 namespace Piwik\Plugins\Provider;
 
 use Exception;
-use Piwik\Common;
-use Piwik\FrontController;
-use Piwik\IP;
 use Piwik\ArchiveProcessor;
+use Piwik\Common;
 use Piwik\Db;
+use Piwik\FrontController;
 
+use Piwik\IP;
 use Piwik\WidgetsList;
 
 /**
diff --git a/plugins/Referrers/API.php b/plugins/Referrers/API.php
index 055205ffbe..32d5c03db9 100644
--- a/plugins/Referrers/API.php
+++ b/plugins/Referrers/API.php
@@ -13,12 +13,12 @@ namespace Piwik\Plugins\Referrers;
 use Exception;
 use Piwik\API\ResponseBuilder;
 use Piwik\Archive;
+use Piwik\Common;
 use Piwik\DataTable\Row;
+use Piwik\DataTable;
+use Piwik\Date;
 use Piwik\Metrics;
 use Piwik\Piwik;
-use Piwik\Common;
-use Piwik\Date;
-use Piwik\DataTable;
 
 /**
  * The Referrers API lets you access reports about Websites, Search engines, Keywords, Campaigns used to access your website.
diff --git a/plugins/Referrers/Archiver.php b/plugins/Referrers/Archiver.php
index bb0b24169d..8601ff18c8 100644
--- a/plugins/Referrers/Archiver.php
+++ b/plugins/Referrers/Archiver.php
@@ -13,8 +13,8 @@ namespace Piwik\Plugins\Referrers;
 use Exception;
 use Piwik\Common;
 use Piwik\Config;
-use Piwik\Metrics;
 use Piwik\DataArray;
+use Piwik\Metrics;
 use Piwik\PluginsArchiver;
 
 class Archiver extends PluginsArchiver
diff --git a/plugins/Referrers/Controller.php b/plugins/Referrers/Controller.php
index 714d0e835c..240dafb55e 100644
--- a/plugins/Referrers/Controller.php
+++ b/plugins/Referrers/Controller.php
@@ -11,14 +11,14 @@
 namespace Piwik\Plugins\Referrers;
 
 use Piwik\API\Request;
+use Piwik\Common;
 use Piwik\DataTable\Map;
 use Piwik\Metrics;
 use Piwik\Period\Range;
 use Piwik\Piwik;
-use Piwik\Common;
-use Piwik\ViewDataTable;
-use Piwik\View;
 use Piwik\Url;
+use Piwik\View;
+use Piwik\ViewDataTable;
 
 /**
  *
diff --git a/plugins/SEO/API.php b/plugins/SEO/API.php
index e1c380dda1..fafc3dc977 100644
--- a/plugins/SEO/API.php
+++ b/plugins/SEO/API.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\SEO;
 
-use Piwik\Piwik;
 use Piwik\DataTable;
+use Piwik\Piwik;
 
 /**
  * @see plugins/Referrers/functions.php
diff --git a/plugins/SEO/RankChecker.php b/plugins/SEO/RankChecker.php
index 70caeb6dc5..a99978de96 100644
--- a/plugins/SEO/RankChecker.php
+++ b/plugins/SEO/RankChecker.php
@@ -12,10 +12,10 @@ namespace Piwik\Plugins\SEO;
 
 use Exception;
 use Piwik\Http;
-use Piwik\MetricsFormatter;
-
 use Piwik\Log;
 
+use Piwik\MetricsFormatter;
+
 /**
  * The functions below are derived/adapted from GetRank.org's
  * Free PageRank Script v2.0, released under GPL.
diff --git a/plugins/ScheduledReports/API.php b/plugins/ScheduledReports/API.php
index 74aaf1b369..aaad7a4399 100644
--- a/plugins/ScheduledReports/API.php
+++ b/plugins/ScheduledReports/API.php
@@ -11,16 +11,16 @@
 namespace Piwik\Plugins\ScheduledReports;
 
 use Exception;
-use Piwik\Piwik;
 use Piwik\Common;
 use Piwik\Date;
+use Piwik\Db;
+use Piwik\Piwik;
 use Piwik\Plugins\LanguagesManager\LanguagesManager;
+use Piwik\Plugins\SegmentEditor\API as APISegmentEditor;
 use Piwik\ReportRenderer;
 use Piwik\ReportRenderer\Html;
 use Piwik\Site;
 use Piwik\Translate;
-use Piwik\Db;
-use Piwik\Plugins\SegmentEditor\API as APISegmentEditor;
 use Zend_Mime;
 
 /**
diff --git a/plugins/ScheduledReports/Controller.php b/plugins/ScheduledReports/Controller.php
index 3d3cd019e1..e0bd9e7c0e 100644
--- a/plugins/ScheduledReports/Controller.php
+++ b/plugins/ScheduledReports/Controller.php
@@ -10,14 +10,12 @@
  */
 namespace Piwik\Plugins\ScheduledReports;
 
-use Piwik\Piwik;
 use Piwik\Common;
+use Piwik\Piwik;
 use Piwik\Plugins\LanguagesManager\LanguagesManager;
-
-use Piwik\View;
-
 use Piwik\Plugins\SegmentEditor\API as APISegmentEditor;
 use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\View;
 
 /**
  *
diff --git a/plugins/SegmentEditor/API.php b/plugins/SegmentEditor/API.php
index 4f68bfd6f4..1f9dea9d7a 100644
--- a/plugins/SegmentEditor/API.php
+++ b/plugins/SegmentEditor/API.php
@@ -11,11 +11,11 @@
 namespace Piwik\Plugins\SegmentEditor;
 
 use Exception;
-use Piwik\Piwik;
 use Piwik\Common;
 use Piwik\Date;
-use Piwik\Segment;
 use Piwik\Db;
+use Piwik\Piwik;
+use Piwik\Segment;
 
 /**
  * The SegmentEditor API lets you add, update, delete custom Segments, and list saved segments.a
diff --git a/plugins/SegmentEditor/Controller.php b/plugins/SegmentEditor/Controller.php
index 8cee3bc124..888f0a9701 100644
--- a/plugins/SegmentEditor/Controller.php
+++ b/plugins/SegmentEditor/Controller.php
@@ -10,11 +10,10 @@
  */
 namespace Piwik\Plugins\SegmentEditor;
 
-use Piwik\Piwik;
 use Piwik\Common;
-
-use Piwik\View;
+use Piwik\Piwik;
 use Piwik\Plugins\API\API as APIMetadata;
+use Piwik\View;
 
 /**
  * @package SegmentEditor
diff --git a/plugins/SegmentEditor/SegmentEditor.php b/plugins/SegmentEditor/SegmentEditor.php
index f0cea48e26..b8fa836105 100644
--- a/plugins/SegmentEditor/SegmentEditor.php
+++ b/plugins/SegmentEditor/SegmentEditor.php
@@ -11,10 +11,10 @@
 namespace Piwik\Plugins\SegmentEditor;
 
 use Exception;
-use Piwik\Common;
 
-use Piwik\Version;
+use Piwik\Common;
 use Piwik\Db;
+use Piwik\Version;
 
 /**
  * @package SegmentEditor
diff --git a/plugins/Transitions/API.php b/plugins/Transitions/API.php
index a3311bf100..482719d486 100644
--- a/plugins/Transitions/API.php
+++ b/plugins/Transitions/API.php
@@ -13,16 +13,16 @@ namespace Piwik\Plugins\Transitions;
 
 use Exception;
 use Piwik\ArchiveProcessor;
+use Piwik\Common;
 use Piwik\DataAccess\LogAggregator;
+use Piwik\DataArray;
 use Piwik\DataTable\Manager;
 use Piwik\DataTable\Row;
+use Piwik\DataTable;
 use Piwik\Metrics;
 use Piwik\Period;
 use Piwik\Period\Day;
 use Piwik\Piwik;
-use Piwik\Common;
-use Piwik\DataTable;
-use Piwik\DataArray;
 use Piwik\Plugins\Actions\Actions;
 use Piwik\Plugins\Actions\ArchivingHelper;
 use Piwik\RankingQuery;
diff --git a/plugins/UserCountry/API.php b/plugins/UserCountry/API.php
index c74d6eb915..094e893f40 100644
--- a/plugins/UserCountry/API.php
+++ b/plugins/UserCountry/API.php
@@ -12,11 +12,11 @@ namespace Piwik\Plugins\UserCountry;
 
 use Exception;
 use Piwik\Archive;
+use Piwik\DataTable;
 use Piwik\Metrics;
 use Piwik\Piwik;
-use Piwik\DataTable;
-use Piwik\Plugins\UserCountry\LocationProvider;
 
+use Piwik\Plugins\UserCountry\LocationProvider;
 use Piwik\Tracker\Visit;
 
 /**
diff --git a/plugins/UserCountry/Archiver.php b/plugins/UserCountry/Archiver.php
index 5485d2fe98..a72f643e14 100644
--- a/plugins/UserCountry/Archiver.php
+++ b/plugins/UserCountry/Archiver.php
@@ -12,9 +12,9 @@
 namespace Piwik\Plugins\UserCountry;
 
 use Piwik\ArchiveProcessor;
-use Piwik\Metrics;
-use Piwik\DataTable;
 use Piwik\DataArray;
+use Piwik\DataTable;
+use Piwik\Metrics;
 use Piwik\Plugins\UserCountry\LocationProvider;
 use Piwik\PluginsArchiver;
 
diff --git a/plugins/UserCountry/Controller.php b/plugins/UserCountry/Controller.php
index dcbf43a8a4..cfe3eb72e1 100644
--- a/plugins/UserCountry/Controller.php
+++ b/plugins/UserCountry/Controller.php
@@ -11,21 +11,19 @@
 namespace Piwik\Plugins\UserCountry;
 
 use Exception;
-use Piwik\DataTable\Renderer\Json;
-use Piwik\Controller\Admin;
-use Piwik\Piwik;
 use Piwik\Common;
+use Piwik\Controller\Admin;
+use Piwik\DataTable\Renderer\Json;
 use Piwik\Http;
 use Piwik\IP;
+use Piwik\Piwik;
 use Piwik\Plugins\UserCountry\LocationProvider;
-
-use Piwik\ViewDataTable;
-use Piwik\View;
-
 use Piwik\Plugins\UserCountry\LocationProvider\DefaultProvider;
 use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
 use Piwik\Plugins\UserCountry\LocationProvider\GeoIp\Pecl;
 use Piwik\Plugins\UserCountry\LocationProvider\GeoIp\ServerBased;
+use Piwik\View;
+use Piwik\ViewDataTable;
 
 /**
  *
diff --git a/plugins/UserCountry/GeoIPAutoUpdater.php b/plugins/UserCountry/GeoIPAutoUpdater.php
index 52645a34cf..99c91f6f17 100755
--- a/plugins/UserCountry/GeoIPAutoUpdater.php
+++ b/plugins/UserCountry/GeoIPAutoUpdater.php
@@ -11,18 +11,17 @@
 namespace Piwik\Plugins\UserCountry;
 
 use Exception;
-
-use Piwik\Log;
 use Piwik\Common;
 use Piwik\Date;
 use Piwik\Http;
+use Piwik\Log;
 use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
+use Piwik\Plugins\UserCountry\LocationProvider\GeoIp\Php;
+use Piwik\ScheduledTask;
 use Piwik\ScheduledTime\Monthly;
 use Piwik\ScheduledTime\Weekly;
 use Piwik\Unzip;
-use Piwik\ScheduledTask;
-use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
-use Piwik\Plugins\UserCountry\LocationProvider\GeoIp\Php;
 
 /**
  * Used to automatically update installed GeoIP databases, and manages the updater's
diff --git a/plugins/UserCountry/LocationProvider.php b/plugins/UserCountry/LocationProvider.php
index 0091e76b91..554ee735d3 100755
--- a/plugins/UserCountry/LocationProvider.php
+++ b/plugins/UserCountry/LocationProvider.php
@@ -13,8 +13,8 @@ namespace Piwik\Plugins\UserCountry;
 use Exception;
 use Piwik\Common;
 use Piwik\IP;
-use Piwik\Tracker\Cache;
 use Piwik\Plugins\UserCountry\LocationProvider\DefaultProvider;
+use Piwik\Tracker\Cache;
 use ReflectionClass;
 
 /**
diff --git a/plugins/UserCountry/LocationProvider/Default.php b/plugins/UserCountry/LocationProvider/Default.php
index a8eeb1688d..797f207c2e 100755
--- a/plugins/UserCountry/LocationProvider/Default.php
+++ b/plugins/UserCountry/LocationProvider/Default.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\UserCountry\LocationProvider;
 
-use Piwik\Config;
 use Piwik\Common;
+use Piwik\Config;
 use Piwik\Plugins\UserCountry\LocationProvider;
 
 /**
diff --git a/plugins/UserCountry/UserCountry.php b/plugins/UserCountry/UserCountry.php
index 8e81703975..cb07290e99 100644
--- a/plugins/UserCountry/UserCountry.php
+++ b/plugins/UserCountry/UserCountry.php
@@ -12,14 +12,14 @@ namespace Piwik\Plugins\UserCountry;
 
 use Piwik\ArchiveProcessor;
 use Piwik\Common;
-use Piwik\Piwik;
-use Piwik\WidgetsList;
-use Piwik\Url;
 use Piwik\IP;
-
+use Piwik\Piwik;
 use Piwik\Plugins\UserCountry\LocationProvider;
 use Piwik\Plugins\UserCountry\LocationProvider\DefaultProvider;
 use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
+use Piwik\Url;
+
+use Piwik\WidgetsList;
 
 /**
  * @see plugins/UserCountry/GeoIPAutoUpdater.php
diff --git a/plugins/UserCountry/functions.php b/plugins/UserCountry/functions.php
index 25193da144..dba271091b 100644
--- a/plugins/UserCountry/functions.php
+++ b/plugins/UserCountry/functions.php
@@ -12,7 +12,6 @@
 namespace Piwik\Plugins\UserCountry;
 
 use Piwik\DataTable;
-
 use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
 use Piwik\Tracker\Visit;
 
diff --git a/plugins/UserCountryMap/Controller.php b/plugins/UserCountryMap/Controller.php
index 4ca56ec1e2..670131069c 100644
--- a/plugins/UserCountryMap/Controller.php
+++ b/plugins/UserCountryMap/Controller.php
@@ -12,13 +12,13 @@ namespace Piwik\Plugins\UserCountryMap;
 
 use Exception;
 use Piwik\API\Request;
-use Piwik\Piwik;
 use Piwik\Common;
+use Piwik\Config;
+use Piwik\Piwik;
 use Piwik\Plugins\Goals\API as APIGoals;
-use Piwik\ViewDataTable;
-use Piwik\View;
 use Piwik\Site;
-use Piwik\Config;
+use Piwik\View;
+use Piwik\ViewDataTable;
 
 /**
  *
diff --git a/plugins/UserSettings/API.php b/plugins/UserSettings/API.php
index bd69aa929c..0e15dd5938 100644
--- a/plugins/UserSettings/API.php
+++ b/plugins/UserSettings/API.php
@@ -11,9 +11,9 @@
 namespace Piwik\Plugins\UserSettings;
 
 use Piwik\Archive;
+use Piwik\DataTable;
 use Piwik\Metrics;
 use Piwik\Piwik;
-use Piwik\DataTable;
 
 /**
  * @see plugins/UserSettings/functions.php
diff --git a/plugins/UserSettings/Archiver.php b/plugins/UserSettings/Archiver.php
index d25420ec20..783779ce3c 100644
--- a/plugins/UserSettings/Archiver.php
+++ b/plugins/UserSettings/Archiver.php
@@ -13,9 +13,9 @@ namespace Piwik\Plugins\UserSettings;
 
 use Piwik\Common;
 use Piwik\DataAccess\LogAggregator;
-use Piwik\Metrics;
-use Piwik\DataTable;
 use Piwik\DataArray;
+use Piwik\DataTable;
+use Piwik\Metrics;
 use Piwik\PluginsArchiver;
 
 require_once PIWIK_INCLUDE_PATH . '/plugins/UserSettings/functions.php';
diff --git a/plugins/UserSettings/Controller.php b/plugins/UserSettings/Controller.php
index 3bdd3e8f5d..aa8c2dc871 100644
--- a/plugins/UserSettings/Controller.php
+++ b/plugins/UserSettings/Controller.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\UserSettings;
 
-use Piwik\ViewDataTable;
 use Piwik\View;
+use Piwik\ViewDataTable;
 
 /**
  *
diff --git a/plugins/UserSettings/UserSettings.php b/plugins/UserSettings/UserSettings.php
index dd1ba2e4a3..cc9a683181 100644
--- a/plugins/UserSettings/UserSettings.php
+++ b/plugins/UserSettings/UserSettings.php
@@ -11,7 +11,6 @@
 namespace Piwik\Plugins\UserSettings;
 
 use Piwik\ArchiveProcessor;
-
 use Piwik\WidgetsList;
 
 /**
diff --git a/plugins/UserSettings/functions.php b/plugins/UserSettings/functions.php
index b1868c01c8..0075f634fb 100644
--- a/plugins/UserSettings/functions.php
+++ b/plugins/UserSettings/functions.php
@@ -12,7 +12,6 @@
 namespace Piwik\Plugins\UserSettings;
 
 use Piwik\Piwik;
-
 use Piwik\Tracker\Request;
 use UserAgentParser;
 
diff --git a/plugins/UsersManager/API.php b/plugins/UsersManager/API.php
index 3199ec5c44..37e249a8e2 100644
--- a/plugins/UsersManager/API.php
+++ b/plugins/UsersManager/API.php
@@ -11,13 +11,13 @@
 namespace Piwik\Plugins\UsersManager;
 
 use Exception;
-use Piwik\Config;
-use Piwik\Piwik;
-use Piwik\Common;
 use Piwik\Access;
+use Piwik\Common;
+use Piwik\Config;
 use Piwik\Date;
-use Piwik\Site;
 use Piwik\Db;
+use Piwik\Piwik;
+use Piwik\Site;
 use Piwik\Tracker\Cache;
 
 /**
diff --git a/plugins/UsersManager/Controller.php b/plugins/UsersManager/Controller.php
index e5a31fbb04..1ad2051d7d 100644
--- a/plugins/UsersManager/Controller.php
+++ b/plugins/UsersManager/Controller.php
@@ -12,16 +12,16 @@ namespace Piwik\Plugins\UsersManager;
 
 use Exception;
 use Piwik\API\ResponseBuilder;
-use Piwik\Controller\Admin;
-use Piwik\Piwik;
 use Piwik\Common;
 use Piwik\Config;
-use Piwik\Tracker\IgnoreCookie;
-use Piwik\View;
-use Piwik\Url;
-use Piwik\Site;
+use Piwik\Controller\Admin;
+use Piwik\Piwik;
 use Piwik\Plugins\SitesManager\API as APISitesManager;
 use Piwik\Plugins\UsersManager\API as APIUsersManager;
+use Piwik\Site;
+use Piwik\Tracker\IgnoreCookie;
+use Piwik\Url;
+use Piwik\View;
 
 /**
  *
diff --git a/plugins/VisitFrequency/API.php b/plugins/VisitFrequency/API.php
index 45c2a7580c..dfebebad12 100644
--- a/plugins/VisitFrequency/API.php
+++ b/plugins/VisitFrequency/API.php
@@ -12,8 +12,8 @@ namespace Piwik\Plugins\VisitFrequency;
 
 use Piwik\API\Request;
 use Piwik\Piwik;
-use Piwik\SegmentExpression;
 use Piwik\Plugins\VisitsSummary\API as APIVisitsSummary;
+use Piwik\SegmentExpression;
 
 /**
  * VisitFrequency API lets you access a list of metrics related to Returning Visitors.
diff --git a/plugins/VisitFrequency/Controller.php b/plugins/VisitFrequency/Controller.php
index b83a117840..273c1c9642 100644
--- a/plugins/VisitFrequency/Controller.php
+++ b/plugins/VisitFrequency/Controller.php
@@ -11,8 +11,8 @@
 namespace Piwik\Plugins\VisitFrequency;
 
 use Piwik\API\Request;
-use Piwik\Piwik;
 use Piwik\Common;
+use Piwik\Piwik;
 use Piwik\View;
 
 /**
diff --git a/plugins/VisitTime/API.php b/plugins/VisitTime/API.php
index 921412d0c8..3fb9c056b7 100644
--- a/plugins/VisitTime/API.php
+++ b/plugins/VisitTime/API.php
@@ -12,11 +12,11 @@ namespace Piwik\Plugins\VisitTime;
 
 use Exception;
 use Piwik\Archive;
+use Piwik\DataTable;
+use Piwik\Date;
 use Piwik\Metrics;
 use Piwik\Period;
 use Piwik\Piwik;
-use Piwik\Date;
-use Piwik\DataTable;
 use Piwik\Site;
 
 require_once PIWIK_INCLUDE_PATH . '/plugins/VisitTime/functions.php';
diff --git a/plugins/VisitTime/Archiver.php b/plugins/VisitTime/Archiver.php
index c51c082967..40c53f29ae 100644
--- a/plugins/VisitTime/Archiver.php
+++ b/plugins/VisitTime/Archiver.php
@@ -11,8 +11,8 @@
 
 namespace Piwik\Plugins\VisitTime;
 
-use Piwik\Date;
 use Piwik\DataArray;
+use Piwik\Date;
 use Piwik\PluginsArchiver;
 
 class Archiver extends PluginsArchiver
diff --git a/plugins/VisitTime/Controller.php b/plugins/VisitTime/Controller.php
index dcc89ac9fb..7387a6e481 100644
--- a/plugins/VisitTime/Controller.php
+++ b/plugins/VisitTime/Controller.php
@@ -10,8 +10,8 @@
  */
 namespace Piwik\Plugins\VisitTime;
 
-use Piwik\ViewDataTable;
 use Piwik\View;
+use Piwik\ViewDataTable;
 
 /**
  *
diff --git a/plugins/VisitTime/VisitTime.php b/plugins/VisitTime/VisitTime.php
index 186b27bb4c..f0f19f8685 100644
--- a/plugins/VisitTime/VisitTime.php
+++ b/plugins/VisitTime/VisitTime.php
@@ -13,8 +13,8 @@ namespace Piwik\Plugins\VisitTime;
 use Exception;
 use Piwik\ArchiveProcessor;
 use Piwik\Common;
-use Piwik\Period;
 
+use Piwik\Period;
 use Piwik\Site;
 use Piwik\WidgetsList;
 
diff --git a/plugins/VisitorInterest/API.php b/plugins/VisitorInterest/API.php
index 583c09387f..5553b543cb 100644
--- a/plugins/VisitorInterest/API.php
+++ b/plugins/VisitorInterest/API.php
@@ -11,9 +11,9 @@
 namespace Piwik\Plugins\VisitorInterest;
 
 use Piwik\Archive;
+use Piwik\DataTable;
 use Piwik\Metrics;
 use Piwik\Piwik;
-use Piwik\DataTable;
 
 /**
  * VisitorInterest API lets you access two Visitor Engagement reports: number of visits per number of pages,
diff --git a/plugins/VisitorInterest/Archiver.php b/plugins/VisitorInterest/Archiver.php
index d6aa1a29ba..5022dabc0d 100644
--- a/plugins/VisitorInterest/Archiver.php
+++ b/plugins/VisitorInterest/Archiver.php
@@ -12,8 +12,8 @@
 namespace Piwik\Plugins\VisitorInterest;
 
 use Piwik\DataAccess\LogAggregator;
-use Piwik\Metrics;
 use Piwik\DataTable;
+use Piwik\Metrics;
 use Piwik\PluginsArchiver;
 
 class Archiver extends PluginsArchiver
diff --git a/plugins/VisitorInterest/Controller.php b/plugins/VisitorInterest/Controller.php
index 634b8e17df..03b1b5599f 100644
--- a/plugins/VisitorInterest/Controller.php
+++ b/plugins/VisitorInterest/Controller.php
@@ -10,9 +10,8 @@
  */
 namespace Piwik\Plugins\VisitorInterest;
 
-
-use Piwik\ViewDataTable;
 use Piwik\View;
+use Piwik\ViewDataTable;
 
 /**
  * @package VisitorInterest
diff --git a/plugins/VisitorInterest/VisitorInterest.php b/plugins/VisitorInterest/VisitorInterest.php
index 74dbb85798..5806d150dc 100644
--- a/plugins/VisitorInterest/VisitorInterest.php
+++ b/plugins/VisitorInterest/VisitorInterest.php
@@ -12,8 +12,8 @@ namespace Piwik\Plugins\VisitorInterest;
 
 use Piwik\ArchiveProcessor;
 use Piwik\FrontController;
-use Piwik\Metrics;
 
+use Piwik\Metrics;
 use Piwik\WidgetsList;
 
 /**
diff --git a/plugins/VisitsSummary/Controller.php b/plugins/VisitsSummary/Controller.php
index 1f25907113..8ef3ce40bd 100644
--- a/plugins/VisitsSummary/Controller.php
+++ b/plugins/VisitsSummary/Controller.php
@@ -11,14 +11,14 @@
 namespace Piwik\Plugins\VisitsSummary;
 
 use Piwik\API\Request;
-use Piwik\DataTable\Row;
-use Piwik\Piwik;
 use Piwik\Common;
+use Piwik\DataTable\Row;
 use Piwik\DataTable;
+use Piwik\Piwik;
 use Piwik\Plugins\Actions\API as APIActions;
-use Piwik\ViewDataTable;
-use Piwik\View;
 use Piwik\Site;
+use Piwik\View;
+use Piwik\ViewDataTable;
 
 /**
  *
-- 
GitLab