Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Napoli <matthieu@mnapoli.fr>2014-11-27 07:22:02 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2014-11-27 07:22:02 +0300
commite00732e1ea29900860671a5b022d4450377776f2 (patch)
tree788c22f279ed6e337e36b5a0f99ff40e3f6b20d5
parent56752448068fb162602502dd4041ffa7d1b60d3c (diff)
parentabf6f8857e3c944446ff4137f1f5be78b8b0bbdc (diff)
Merge branch 'master' into tmp-path
Conflicts: plugins/Installation/SystemCheck.php
-rw-r--r--core/API/DataTableGenericFilter.php54
-rw-r--r--core/API/DataTableManipulator.php11
-rw-r--r--core/API/DataTableManipulator/ReportTotalsCalculator.php95
-rw-r--r--core/API/DataTablePostProcessor.php391
-rw-r--r--core/API/DocumentationGenerator.php16
-rw-r--r--core/API/Inconsistencies.php42
-rw-r--r--core/API/Request.php32
-rw-r--r--core/API/ResponseBuilder.php98
-rw-r--r--core/Archive.php5
-rw-r--r--core/Archive/DataTableFactory.php29
-rw-r--r--core/CronArchive.php20
-rw-r--r--core/DataTable.php9
-rw-r--r--core/DataTable/Filter/AddColumnsProcessedMetrics.php37
-rw-r--r--core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php119
-rwxr-xr-xcore/DataTable/Filter/CalculateEvolutionFilter.php1
-rw-r--r--core/DataTable/Filter/ColumnCallbackReplace.php1
-rw-r--r--core/DataTable/Filter/ExcludeLowPopulation.php2
-rw-r--r--core/DataTable/Filter/PivotByDimension.php2
-rw-r--r--core/DataTable/Filter/Sort.php2
-rw-r--r--core/Error.php2
-rw-r--r--core/Metrics.php22
-rw-r--r--core/Metrics/Base.php61
-rw-r--r--core/Metrics/Formatter.php305
-rw-r--r--core/Metrics/Formatter/Html.php43
-rw-r--r--core/Metrics/Processed.php68
-rw-r--r--core/Metrics/ProcessedGoals.php123
-rw-r--r--core/MetricsFormatter.php236
-rw-r--r--core/Piwik.php15
-rw-r--r--core/Plugin/AggregatedMetric.php22
-rw-r--r--core/Plugin/ComponentFactory.php2
-rw-r--r--core/Plugin/ControllerAdmin.php2
-rw-r--r--core/Plugin/Metric.php179
-rw-r--r--core/Plugin/ProcessedMetric.php70
-rw-r--r--core/Plugin/Report.php163
-rw-r--r--core/Plugin/Visualization.php62
-rw-r--r--core/Session.php2
-rw-r--r--core/Timer.php6
-rwxr-xr-xcore/Twig.php15
-rw-r--r--core/Updates/0.6-rc1.php4
-rw-r--r--core/Updates/1.2-rc1.php2
-rw-r--r--core/testMinimumPhpVersion.php14
-rw-r--r--plugins/API/API.php50
-rw-r--r--plugins/API/ProcessedReport.php138
-rw-r--r--plugins/API/Reports/Get.php106
-rw-r--r--plugins/API/RowEvolution.php3
-rw-r--r--plugins/API/templates/listAllAPI.twig2
-rw-r--r--plugins/Actions/API.php155
-rw-r--r--plugins/Actions/Columns/Metrics/AveragePageGenerationTime.php108
-rw-r--r--plugins/Actions/Columns/Metrics/AverageTimeOnPage.php51
-rw-r--r--plugins/Actions/Columns/Metrics/BounceRate.php51
-rw-r--r--plugins/Actions/Columns/Metrics/ExitRate.php51
-rw-r--r--plugins/Actions/Reports/Base.php27
-rw-r--r--plugins/Actions/Reports/Get.php7
-rw-r--r--plugins/Actions/Reports/GetEntryPageTitles.php28
-rw-r--r--plugins/Actions/Reports/GetEntryPageUrls.php27
-rw-r--r--plugins/Actions/Reports/GetExitPageTitles.php27
-rw-r--r--plugins/Actions/Reports/GetExitPageUrls.php27
-rw-r--r--plugins/Actions/Reports/GetPageTitles.php12
-rw-r--r--plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php15
-rw-r--r--plugins/Actions/Reports/GetPageUrls.php12
-rw-r--r--plugins/Actions/Reports/GetSiteSearchKeywords.php22
-rw-r--r--plugins/Actions/Reports/GetSiteSearchNoResultKeywords.php22
-rw-r--r--plugins/Contents/API.php3
-rw-r--r--plugins/Contents/Columns/Metrics/InteractionRate.php52
-rw-r--r--plugins/Contents/Reports/Base.php7
-rw-r--r--plugins/Contents/Reports/GetContentNames.php3
-rw-r--r--plugins/Contents/Reports/GetContentPieces.php3
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml4
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml4
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml4
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml4
-rw-r--r--plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml4
-rw-r--r--plugins/CoreAdminHome/Controller.php2
-rw-r--r--plugins/CoreAdminHome/templates/generalSettings.twig12
-rw-r--r--plugins/CoreAdminHome/templates/trackingCodeGenerator.twig10
-rw-r--r--plugins/CoreHome/Columns/Metrics/ActionsPerVisit.php46
-rw-r--r--plugins/CoreHome/Columns/Metrics/AverageTimeOnSite.php53
-rw-r--r--plugins/CoreHome/Columns/Metrics/BounceRate.php52
-rw-r--r--plugins/CoreHome/Columns/Metrics/ConversionRate.php51
-rw-r--r--plugins/CoreHome/Columns/Metrics/EvolutionMetric.php123
-rw-r--r--plugins/CoreHome/Columns/Metrics/VisitsPercent.php77
-rw-r--r--plugins/CoreHome/DataTableRowAction/RowEvolution.php3
-rw-r--r--plugins/CoreHome/Visitor.php6
-rw-r--r--plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.html2
-rw-r--r--plugins/CoreHome/javascripts/dataTable.js2
-rw-r--r--plugins/CoreHome/templates/ReportRenderer/_htmlReportHeader.twig2
-rw-r--r--plugins/CoreHome/templates/_dataTableCell.twig2
-rwxr-xr-xplugins/CoreHome/templates/_donate.twig2
-rw-r--r--plugins/CoreHome/templates/_headerMessage.twig4
-rw-r--r--plugins/CoreHome/templates/_warningInvalidHost.twig4
-rwxr-xr-xplugins/CoreHome/templates/getPromoVideo.twig6
-rw-r--r--plugins/CorePluginsAdmin/templates/browsePlugins.twig2
-rw-r--r--plugins/CorePluginsAdmin/templates/macros.twig4
-rw-r--r--plugins/CorePluginsAdmin/templates/pluginDetails.twig2
-rw-r--r--plugins/CorePluginsAdmin/templates/safemode.twig3
-rw-r--r--plugins/CoreUpdater/templates/oneClickResults.twig2
-rw-r--r--plugins/CoreUpdater/templates/runUpdaterAndExit_done.twig4
-rw-r--r--plugins/CoreUpdater/templates/runUpdaterAndExit_welcome.twig4
-rw-r--r--plugins/CoreVisualizations/Visualizations/HtmlTable.php1
-rw-r--r--plugins/CoreVisualizations/Visualizations/HtmlTable/AllColumns.php12
-rw-r--r--plugins/CoreVisualizations/templates/_dataTableViz_tagCloud.twig2
-rw-r--r--plugins/CustomVariables/API.php2
-rw-r--r--plugins/CustomVariables/Reports/GetCustomVariables.php2
-rw-r--r--plugins/CustomVariables/Reports/GetCustomVariablesValuesFromNameId.php2
-rw-r--r--plugins/DBStats/Controller.php9
-rw-r--r--plugins/DBStats/Reports/Base.php8
-rwxr-xr-xplugins/DBStats/templates/index.twig2
-rw-r--r--plugins/Dashboard/API.php2
-rw-r--r--plugins/Events/API.php9
-rw-r--r--plugins/Events/Columns/Metrics/AverageEventValue.php45
-rw-r--r--plugins/Events/Reports/Base.php5
-rw-r--r--plugins/Events/Reports/GetAction.php2
-rw-r--r--plugins/Events/Reports/GetCategory.php2
-rw-r--r--plugins/Events/Reports/GetName.php2
-rw-r--r--plugins/ExampleAPI/API.php2
-rw-r--r--plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml13
-rw-r--r--plugins/ExampleRssWidget/RssRenderer.php2
-rw-r--r--plugins/Feedback/templates/index.twig54
-rw-r--r--plugins/Goals/API.php147
-rw-r--r--plugins/Goals/Archiver.php20
-rw-r--r--plugins/Goals/Columns/Metrics/AverageOrderRevenue.php61
-rw-r--r--plugins/Goals/Columns/Metrics/AveragePrice.php64
-rw-r--r--plugins/Goals/Columns/Metrics/AverageQuantity.php47
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/AverageOrderRevenue.php68
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/ConversionRate.php63
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/Conversions.php43
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/ItemsCount.php48
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/Revenue.php61
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/RevenuePerVisit.php76
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecificProcessedMetric.php92
-rw-r--r--plugins/Goals/Columns/Metrics/ProductConversionRate.php54
-rw-r--r--plugins/Goals/Columns/Metrics/RevenuePerVisit.php84
-rw-r--r--plugins/Goals/Controller.php17
-rw-r--r--plugins/Goals/Goals.php3
-rw-r--r--plugins/Goals/Reports/BaseEcommerceItem.php27
-rw-r--r--plugins/Goals/Reports/Get.php5
-rw-r--r--plugins/Goals/Reports/GetEcommerceAbandonedCart.php2
-rw-r--r--plugins/Goals/Reports/GetEcommerceOrder.php9
-rw-r--r--plugins/Goals/Reports/GetVisitsUntilConversion.php2
-rw-r--r--plugins/Goals/Reports/GetVisitsUntilConversionEcommerceOrder.php2
-rw-r--r--plugins/Goals/Visualizations/Goals.php154
-rw-r--r--plugins/Goals/templates/_addEditGoal.twig8
-rw-r--r--plugins/Goals/templates/_formAddGoal.twig2
-rw-r--r--plugins/Goals/templates/addNewGoal.twig2
-rw-r--r--plugins/Insights/Model.php2
-rw-r--r--plugins/Insights/tests/Integration/ModelTest.php6
-rw-r--r--plugins/Installation/Controller.php65
-rw-r--r--plugins/Installation/FormSuperUser.php2
-rw-r--r--plugins/Installation/SystemCheck.php401
-rw-r--r--plugins/Installation/lang/en.json3
-rwxr-xr-xplugins/Installation/templates/_systemCheckSection.twig38
-rw-r--r--plugins/Installation/templates/finished.twig4
-rw-r--r--plugins/Installation/templates/reuseTables.twig2
-rw-r--r--plugins/Installation/templates/systemCheck.twig2
-rw-r--r--plugins/Installation/templates/trackingCode.twig4
-rw-r--r--plugins/LanguagesManager/API.php2
-rw-r--r--plugins/LanguagesManager/angularjs/translationsearch/translationsearch.directive.html2
-rw-r--r--plugins/Live/API.php9
-rw-r--r--plugins/Live/Reports/GetSimpleLastVisitCount.php13
-rw-r--r--plugins/Live/Visitor.php7
-rw-r--r--plugins/Live/templates/_actionsList.twig2
-rw-r--r--plugins/Live/templates/_dataTableViz_visitorLog.twig6
-rw-r--r--plugins/Live/templates/getLastVisitsStart.twig2
-rw-r--r--plugins/Live/templates/getVisitorProfilePopup.twig2
-rw-r--r--plugins/Login/Controller.php2
-rw-r--r--plugins/Login/templates/login.twig2
-rw-r--r--plugins/MobileMessaging/SMSProvider.php6
-rwxr-xr-xplugins/MultiSites/API.php55
-rw-r--r--plugins/MultiSites/Columns/Metrics/EcommerceOnlyEvolutionMetric.php50
-rw-r--r--plugins/MultiSites/Reports/Base.php10
-rw-r--r--plugins/MultiSites/Reports/GetAll.php1
-rw-r--r--plugins/MultiSites/Reports/GetOne.php1
-rw-r--r--plugins/MultiSites/angularjs/site/site.directive.html4
-rw-r--r--plugins/Overlay/Controller.php15
-rw-r--r--plugins/Overlay/templates/index.twig4
-rw-r--r--plugins/PrivacyManager/Controller.php13
-rw-r--r--plugins/PrivacyManager/templates/privacySettings.twig6
-rw-r--r--plugins/Provider/Reports/GetProvider.php2
-rw-r--r--plugins/Referrers/API.php4
-rw-r--r--plugins/Referrers/Controller.php4
-rw-r--r--plugins/Referrers/Reports/GetCampaigns.php2
-rw-r--r--plugins/Referrers/Reports/GetKeywordsFromCampaignId.php2
-rw-r--r--plugins/SEO/RankChecker.php6
-rw-r--r--plugins/SEO/templates/getRank.twig4
-rw-r--r--plugins/ScheduledReports/API.php2
-rw-r--r--plugins/ScheduledReports/templates/_addReport.twig2
-rw-r--r--plugins/ScheduledReports/templates/_listReports.twig2
m---------plugins/SecurityInfo0
-rw-r--r--plugins/SegmentEditor/templates/_segmentSelector.twig2
-rw-r--r--plugins/SitesManager/API.php9
-rw-r--r--plugins/SitesManager/templates/_displayJavascriptCode.twig4
-rwxr-xr-xplugins/UserCountry/LocationProvider/Default.php2
-rwxr-xr-xplugins/UserCountry/LocationProvider/GeoIp/Pecl.php2
-rwxr-xr-xplugins/UserCountry/LocationProvider/GeoIp/Php.php2
-rwxr-xr-xplugins/UserCountry/LocationProvider/GeoIp/ServerBased.php4
-rw-r--r--plugins/UserCountry/Reports/Base.php8
-rw-r--r--plugins/UserCountry/Reports/GetCountry.php2
-rwxr-xr-xplugins/UserCountry/templates/adminIndex.twig2
-rw-r--r--plugins/UserSettings/API.php46
-rw-r--r--plugins/UserSettings/Reports/GetPlugin.php4
-rw-r--r--plugins/UsersManager/API.php2
-rw-r--r--plugins/UsersManager/Controller.php6
-rw-r--r--plugins/UsersManager/Model.php2
-rw-r--r--plugins/VisitFrequency/API.php4
-rw-r--r--plugins/VisitFrequency/Columns/Metrics/ReturningMetric.php64
-rw-r--r--plugins/VisitFrequency/Controller.php3
-rw-r--r--plugins/VisitFrequency/Reports/Get.php16
-rw-r--r--plugins/VisitFrequency/templates/_sparklines.twig2
m---------plugins/VisitorGenerator0
-rw-r--r--plugins/VisitorInterest/API.php22
-rw-r--r--plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php7
-rw-r--r--plugins/VisitsSummary/API.php56
-rw-r--r--plugins/VisitsSummary/Controller.php16
-rw-r--r--plugins/VisitsSummary/Reports/Get.php24
-rw-r--r--plugins/VisitsSummary/templates/_sparklines.twig2
-rw-r--r--plugins/Widgetize/javascripts/widgetize.js2
-rw-r--r--plugins/Widgetize/templates/index.twig8
-rw-r--r--tests/PHPUnit/Framework/Fixture.php3
-rw-r--r--tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php5
-rwxr-xr-xtests/PHPUnit/Framework/TestCase/SystemTestCase.php3
-rw-r--r--tests/PHPUnit/Framework/TestRequest/Response.php3
-rw-r--r--tests/PHPUnit/Integration/LogTest.php2
-rw-r--r--tests/PHPUnit/Integration/PiwikTest.php83
-rw-r--r--tests/PHPUnit/Integration/ReportTest.php6
-rwxr-xr-xtests/PHPUnit/System/BlobReportLimitingTest.php1
-rwxr-xr-xtests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php27
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_archive_php_cron_output.txt11
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml86
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_day.xml72
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_month.xml72
-rw-r--r--tests/PHPUnit/System/expected/test_FlattenReports__Actions.getPageUrls_week.xml1
-rw-r--r--tests/PHPUnit/System/expected/test_FlattenReports_expandedWithDepth__Actions.getPageUrls_week.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_FlattenReports_withAggregate__Actions.getPageUrls_week.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml12
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml84
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml12
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml88
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml16
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml88
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml1
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Goals.get_month.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml14
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getPlugin_month.xml14
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getSumVisitsLengthPretty_month.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisitAsc__Live.getLastVisitsDetails_month.xml18
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisit__Live.getLastVisitsDetails_month.xml16
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByVisitCount__Live.getLastVisitsDetails_month.xml16
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortDesc__Live.getLastVisitsDetails_month.xml16
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__Live.getLastVisitsDetails_month.xml26
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml29
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageTitles_day.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageUrls_day.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageTitles_day.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageUrls_day.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitle_day.xml1
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml5
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrl_day.xml1
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrls_day.xml5
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getConversionRate_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.get_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLengthPretty_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml16
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csvbin2296 -> 1444 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml6
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___Actions.getPageTitles_day.xml5
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns__API.get_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.get_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml16
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLengthPretty_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__UserSettings.getPlugin_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml15
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml26
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml16
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageUrls__API.getRowEvolution_range.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml25
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml25
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml25
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml25
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml6
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml6
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_day.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_month.xml7
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_month.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml6
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_day.xml1
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_month.xml1
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml38
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml50
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml60
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_month.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_day.xml7
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_month.xml14
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml28
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml28
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv82
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html4
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html360
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId__Live.getLastVisitsDetails_month.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserId__Goals.get_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml367
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml13
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getMetadata_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getProcessedReport_day.xml6
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_csvExport__Live.getLastVisitsDetails_day.csvbin7680 -> 7680 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_week.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_day.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_week.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_week.xml2
-rwxr-xr-xtests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml2
-rwxr-xr-xtests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml2
-rwxr-xr-xtests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml2
-rwxr-xr-xtests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml2
-rwxr-xr-xtests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_AbandonedCart__API.getProcessedReport_day.xml7
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NormalGoal__API.getProcessedReport_day.xml8
-rwxr-xr-xtests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml6
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsCategory__API.getProcessedReport_day.xml22
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsSku__API.getProcessedReport_day.xml16
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.get_week.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.get_week.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.get_week.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.get_week.xml2
-rwxr-xr-xtests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml2
-rwxr-xr-xtests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml2
-rwxr-xr-xtests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml24
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv100
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html4
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html332
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.get_day.xml1
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Goals.get_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__MultiSites.getAll_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Goals.get_range.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml6
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml6
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml2
-rw-r--r--tests/PHPUnit/TestingEnvironment.php2
m---------tests/PHPUnit/UI0
-rw-r--r--tests/PHPUnit/Unit/Metrics/Formatter/HtmlTest.php91
-rw-r--r--tests/PHPUnit/Unit/Metrics/FormatterTest.php232
-rw-r--r--tests/PHPUnit/Unit/MetricsTest.php2
-rw-r--r--tmp/.gitkeep0
358 files changed, 6115 insertions, 3379 deletions
diff --git a/core/API/DataTableGenericFilter.php b/core/API/DataTableGenericFilter.php
index 681c1a12f8..46274b0c31 100644
--- a/core/API/DataTableGenericFilter.php
+++ b/core/API/DataTableGenericFilter.php
@@ -12,6 +12,8 @@ use Exception;
use Piwik\Common;
use Piwik\DataTable\Filter\AddColumnsProcessedMetricsGoal;
use Piwik\DataTable;
+use Piwik\Plugin\ProcessedMetric;
+use Piwik\Plugin\Report;
class DataTableGenericFilter
{
@@ -82,15 +84,6 @@ class DataTableGenericFilter
'filter_excludelowpop' => array('string'),
'filter_excludelowpop_value' => array('float', '0'),
)),
- array('AddColumnsProcessedMetrics',
- array(
- 'filter_add_columns_when_show_all_columns' => array('integer')
- )),
- array('AddColumnsProcessedMetricsGoal',
- array(
- 'filter_update_columns_when_show_all_goals' => array('integer'),
- 'idGoal' => array('string', AddColumnsProcessedMetricsGoal::GOALS_OVERVIEW),
- )),
array('Sort',
array(
'filter_sort_column' => array('string'),
@@ -105,7 +98,7 @@ class DataTableGenericFilter
'filter_offset' => array('integer', '0'),
'filter_limit' => array('integer'),
'keep_summary_row' => array('integer', '0'),
- )),
+ ))
);
}
@@ -164,6 +157,45 @@ class DataTableGenericFilter
$filterApplied = true;
}
}
+
return $filterApplied;
}
-}
+
+ public function areProcessedMetricsNeededFor($metrics)
+ {
+ $columnQueryParameters = array(
+ 'filter_column',
+ 'filter_column_recursive',
+ 'filter_excludelowpop',
+ 'filter_sort_column'
+ );
+
+ foreach ($columnQueryParameters as $queryParamName) {
+ $queryParamValue = Common::getRequestVar($queryParamName, false, $type = null, $this->request);
+ if (!empty($queryParamValue)
+ && $this->containsProcessedMetric($metrics, $queryParamValue)
+ ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * @param ProcessedMetric[] $metrics
+ * @param string $name
+ * @return bool
+ */
+ private function containsProcessedMetric($metrics, $name)
+ {
+ foreach ($metrics as $metric) {
+ if ($metric instanceof ProcessedMetric
+ && $metric->getName() == $name
+ ) {
+ return true;
+ }
+ }
+ return false;
+ }
+} \ No newline at end of file
diff --git a/core/API/DataTableManipulator.php b/core/API/DataTableManipulator.php
index 6d744e50df..a1acc6e5b5 100644
--- a/core/API/DataTableManipulator.php
+++ b/core/API/DataTableManipulator.php
@@ -172,6 +172,8 @@ abstract class DataTableManipulator
$request = $this->manipulateSubtableRequest($request);
$request['serialize'] = 0;
$request['expanded'] = 0;
+ $request['format'] = 'original';
+ $request['format_metrics'] = 0;
// don't want to run recursive filters on the subtables as they are loaded,
// otherwise the result will be empty in places (or everywhere). instead we
@@ -181,14 +183,7 @@ abstract class DataTableManipulator
$dataTable = Proxy::getInstance()->call($class, $method, $request);
$response = new ResponseBuilder($format = 'original', $request);
$response->disableSendHeader();
- $dataTable = $response->getResponse($dataTable);
-
- if (Common::getRequestVar('disable_queued_filters', 0, 'int', $request) == 0) {
- if (method_exists($dataTable, 'applyQueuedFilters')) {
- $dataTable->applyQueuedFilters();
- }
- }
-
+ $dataTable = $response->getResponse($dataTable, $apiModule, $method);
return $dataTable;
}
}
diff --git a/core/API/DataTableManipulator/ReportTotalsCalculator.php b/core/API/DataTableManipulator/ReportTotalsCalculator.php
index 1cbfeeb362..b6b82effad 100644
--- a/core/API/DataTableManipulator/ReportTotalsCalculator.php
+++ b/core/API/DataTableManipulator/ReportTotalsCalculator.php
@@ -13,7 +13,7 @@ use Piwik\DataTable;
use Piwik\DataTable\Row;
use Piwik\Metrics;
use Piwik\Period;
-use Piwik\Plugins\API\API;
+use Piwik\Plugin\Report;
/**
* This class is responsible for setting the metadata property 'totals' on each dataTable if the report
@@ -23,12 +23,6 @@ use Piwik\Plugins\API\API;
class ReportTotalsCalculator extends DataTableManipulator
{
/**
- * Cached report metadata array.
- * @var array
- */
- private static $reportMetadata = array();
-
- /**
* @param DataTable $table
* @return \Piwik\DataTable|\Piwik\DataTable\Map
*/
@@ -61,7 +55,7 @@ class ReportTotalsCalculator extends DataTableManipulator
{
$report = $this->findCurrentReport();
- if (!empty($report) && empty($report['dimension'])) {
+ if (!empty($report) && !$report->getDimension() && !$this->isReportAllMetricsReport($report)) {
// we currently do not calculate the total value for reports having no dimension
return $dataTable;
}
@@ -73,12 +67,13 @@ class ReportTotalsCalculator extends DataTableManipulator
$metricsToCalculate = Metrics::getMetricIdsToProcessReportTotal();
foreach ($metricsToCalculate as $metricId) {
- if (!$this->hasDataTableMetric($firstLevelTable, $metricId)) {
+ $realMetricName = $this->hasDataTableMetric($firstLevelTable, $metricId);
+ if (empty($realMetricName)) {
continue;
}
foreach ($firstLevelTable->getRows() as $row) {
- $totalValues = $this->sumColumnValueToTotal($row, $metricId, $totalValues);
+ $totalValues = $this->sumColumnValueToTotal($row, $metricId, $realMetricName, $totalValues);
}
}
@@ -95,34 +90,20 @@ class ReportTotalsCalculator extends DataTableManipulator
return false;
}
- if (false === $this->getColumn($firstRow, $metricId)) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Returns column from a given row.
- * Will work with 2 types of datatable
- * - raw datatables coming from the archive DB, which columns are int indexed
- * - datatables processed resulting of API calls, which columns have human readable english names
- *
- * @param Row|array $row
- * @param int $columnIdRaw see consts in Metrics::
- * @return mixed Value of column, false if not found
- */
- private function getColumn($row, $columnIdRaw)
- {
- $columnIdReadable = Metrics::getReadableColumnName($columnIdRaw);
+ $readableColumnName = Metrics::getReadableColumnName($metricId);
+ $columnAlternatives = array(
+ $metricId,
+ $readableColumnName,
+ // TODO: this and below is a hack to get report totals to work correctly w/ MultiSites.getAll. can be corrected
+ // when all metrics are described by Metadata classes & internal naming quirks are handled by core system.
+ 'Goal_' . $readableColumnName,
+ 'Actions_' . $readableColumnName
+ );
- if ($row instanceof Row) {
- $raw = $row->getColumn($columnIdRaw);
- if ($raw !== false) {
- return $raw;
+ foreach ($columnAlternatives as $column) {
+ if ($firstRow->getColumn($column) !== false) {
+ return $column;
}
-
- return $row->getColumn($columnIdReadable);
}
return false;
@@ -141,8 +122,8 @@ class ReportTotalsCalculator extends DataTableManipulator
$module = $this->apiModule;
$action = $this->apiMethod;
} else {
- $module = $firstLevelReport['module'];
- $action = $firstLevelReport['action'];
+ $module = $firstLevelReport->getModule();
+ $action = $firstLevelReport->getAction();
}
$request = $this->request;
@@ -170,9 +151,9 @@ class ReportTotalsCalculator extends DataTableManipulator
return $table;
}
- private function sumColumnValueToTotal(Row $row, $metricId, $totalValues)
+ private function sumColumnValueToTotal(Row $row, $metricId, $realMetricId, $totalValues)
{
- $value = $this->getColumn($row, $metricId);
+ $value = $row->getColumn($realMetricId);
if (false === $value) {
@@ -217,38 +198,26 @@ class ReportTotalsCalculator extends DataTableManipulator
return $request;
}
- private function getReportMetadata()
- {
- if (!empty(static::$reportMetadata)) {
- return static::$reportMetadata;
- }
-
- static::$reportMetadata = API::getInstance()->getReportMetadata();
-
- return static::$reportMetadata;
- }
-
private function findCurrentReport()
{
- foreach ($this->getReportMetadata() as $report) {
- if ($this->apiMethod == $report['action']
- && $this->apiModule == $report['module']) {
-
- return $report;
- }
- }
+ return Report::factory($this->apiModule, $this->apiMethod);
}
private function findFirstLevelReport()
{
- foreach ($this->getReportMetadata() as $report) {
- if (!empty($report['actionToLoadSubTables'])
- && $this->apiMethod == $report['actionToLoadSubTables']
- && $this->apiModule == $report['module']
+ foreach (Report::getAllReports() as $report) {
+ $actionToLoadSubtables = $report->getActionToLoadSubTables();
+ if ($actionToLoadSubtables == $this->apiMethod
+ && $this->apiModule == $report->getModule()
) {
-
return $report;
}
}
+ return null;
+ }
+
+ private function isReportAllMetricsReport(Report $report)
+ {
+ return $report->getModule() == 'API' && $report->getAction() == 'get';
}
}
diff --git a/core/API/DataTablePostProcessor.php b/core/API/DataTablePostProcessor.php
new file mode 100644
index 0000000000..72facbf41c
--- /dev/null
+++ b/core/API/DataTablePostProcessor.php
@@ -0,0 +1,391 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\API;
+
+use Exception;
+use Piwik\API\DataTableManipulator\Flattener;
+use Piwik\API\DataTableManipulator\LabelFilter;
+use Piwik\API\DataTableManipulator\ReportTotalsCalculator;
+use Piwik\Common;
+use Piwik\DataTable;
+use Piwik\DataTable\DataTableInterface;
+use Piwik\DataTable\Filter\PivotByDimension;
+use Piwik\Metrics\Formatter;
+use Piwik\Plugin\ProcessedMetric;
+use Piwik\Plugin\Report;
+
+/**
+ * Processes DataTables that should be served through Piwik's APIs. This processing handles
+ * special query parameters and computes processed metrics. It does not included rendering to
+ * output formats (eg, 'xml').
+ */
+class DataTablePostProcessor
+{
+ const PROCESSED_METRICS_COMPUTED_FLAG = 'processed_metrics_computed';
+
+ /**
+ * @var null|Report
+ */
+ private $report;
+
+ /**
+ * @var string[]
+ */
+ private $request;
+
+ /**
+ * @var string
+ */
+ private $apiModule;
+
+ /**
+ * @var string
+ */
+ private $apiMethod;
+
+ /**
+ * @var Inconsistencies
+ */
+ private $apiInconsistencies;
+
+ /**
+ * @var Formatter
+ */
+ private $formatter;
+
+ /**
+ * Constructor.
+ */
+ public function __construct($apiModule, $apiMethod, $request)
+ {
+ $this->apiModule = $apiModule;
+ $this->apiMethod = $apiMethod;
+ $this->request = $request;
+
+ $this->report = Report::factory($apiModule, $apiMethod);
+ $this->apiInconsistencies = new Inconsistencies();
+ $this->formatter = new Formatter();
+ }
+
+ /**
+ * Apply post-processing logic to a DataTable of a report for an API request.
+ *
+ * @param DataTableInterface $dataTable The data table to process.
+ * @return DataTableInterface A new data table.
+ */
+ public function process(DataTableInterface $dataTable)
+ {
+ // TODO: when calculating metrics before hand, only calculate for needed metrics, not all. NOTE:
+ // this is non-trivial since it will require, eg, to make sure processed metrics aren't added
+ // after pivotBy is handled.
+ $dataTable = $this->applyPivotByFilter($dataTable);
+ $dataTable = $this->applyFlattener($dataTable);
+ $dataTable = $this->applyTotalsCalculator($dataTable);
+
+ $dataTable = $this->applyGenericFilters($dataTable);
+
+ $this->applyComputeProcessedMetrics($dataTable);
+
+ // we automatically safe decode all datatable labels (against xss)
+ $dataTable->queueFilter('SafeDecodeLabel');
+
+ $dataTable = $this->applyQueuedFilters($dataTable);
+ $dataTable = $this->applyRequestedColumnDeletion($dataTable);
+ $dataTable = $this->applyLabelFilter($dataTable);
+
+ $dataTable = $this->applyMetricsFormatting($dataTable, null);
+
+ return $dataTable;
+ }
+
+ /**
+ * @param DataTableInterface $dataTable
+ * @return DataTableInterface
+ */
+ public function applyPivotByFilter(DataTableInterface $dataTable)
+ {
+ $pivotBy = Common::getRequestVar('pivotBy', false, 'string', $this->request);
+ if (!empty($pivotBy)) {
+ $this->applyComputeProcessedMetrics($dataTable);
+
+ $reportId = $this->apiModule . '.' . $this->apiMethod;
+ $pivotByColumn = Common::getRequestVar('pivotByColumn', false, 'string', $this->request);
+ $pivotByColumnLimit = Common::getRequestVar('pivotByColumnLimit', false, 'int', $this->request);
+
+ $dataTable->filter('PivotByDimension', array($reportId, $pivotBy, $pivotByColumn, $pivotByColumnLimit,
+ PivotByDimension::isSegmentFetchingEnabledInConfig()));
+ }
+ return $dataTable;
+ }
+
+ /**
+ * @param DataTableInterface $dataTable
+ * @return DataTable|DataTableInterface|DataTable\Map
+ */
+ public function applyFlattener($dataTable)
+ {
+ if (Common::getRequestVar('flat', '0', 'string', $this->request) == '1') {
+ $flattener = new Flattener($this->apiModule, $this->apiMethod, $this->request);
+ if (Common::getRequestVar('include_aggregate_rows', '0', 'string', $this->request) == '1') {
+ $flattener->includeAggregateRows();
+ }
+ $dataTable = $flattener->flatten($dataTable);
+ }
+ return $dataTable;
+ }
+
+ /**
+ * @param DataTableInterface $dataTable
+ * @return DataTableInterface
+ */
+ public function applyTotalsCalculator($dataTable)
+ {
+ if (1 == Common::getRequestVar('totals', '1', 'integer', $this->request)) {
+ $reportTotalsCalculator = new ReportTotalsCalculator($this->apiModule, $this->apiMethod, $this->request);
+ $dataTable = $reportTotalsCalculator->calculate($dataTable);
+ }
+ return $dataTable;
+ }
+
+ /**
+ * @param DataTableInterface $dataTable
+ * @return DataTableInterface
+ */
+ public function applyGenericFilters($dataTable)
+ {
+ // if the flag disable_generic_filters is defined we skip the generic filters
+ if (0 == Common::getRequestVar('disable_generic_filters', '0', 'string', $this->request)) {
+ $this->applyProcessedMetricsGenericFilters($dataTable);
+
+ $genericFilter = new DataTableGenericFilter($this->request);
+
+ $self = $this;
+ $report = $this->report;
+ $dataTable->filter(function (DataTable $table) use ($genericFilter, $report, $self) {
+ $processedMetrics = Report::getProcessedMetricsForTable($table, $report);
+ if ($genericFilter->areProcessedMetricsNeededFor($processedMetrics)) {
+ $self->computeProcessedMetrics($table);
+ }
+ });
+
+ $label = self::getLabelFromRequest($this->request);
+ if (!empty($label)) {
+ $genericFilter->disableFilters(array('Limit', 'Truncate'));
+ }
+
+ $genericFilter->filter($dataTable);
+ }
+
+ return $dataTable;
+ }
+
+ /**
+ * @param DataTableInterface $dataTable
+ * @return DataTableInterface
+ */
+ public function applyProcessedMetricsGenericFilters($dataTable)
+ {
+ $addNormalProcessedMetrics = null;
+ try {
+ $addNormalProcessedMetrics = Common::getRequestVar(
+ 'filter_add_columns_when_show_all_columns', null, 'integer', $this->request);
+ } catch (Exception $ex) {
+ // ignore
+ }
+
+ if ($addNormalProcessedMetrics !== null) {
+ $dataTable->filter('AddColumnsProcessedMetrics', array($addNormalProcessedMetrics));
+ }
+
+ $addGoalProcessedMetrics = null;
+ try {
+ $addGoalProcessedMetrics = Common::getRequestVar(
+ 'filter_update_columns_when_show_all_goals', null, 'integer', $this->request);
+ } catch (Exception $ex) {
+ // ignore
+ }
+
+ if ($addGoalProcessedMetrics !== null) {
+ $idGoal = Common::getRequestVar(
+ 'idGoal', DataTable\Filter\AddColumnsProcessedMetricsGoal::GOALS_OVERVIEW, 'string', $this->request);
+
+ $dataTable->filter('AddColumnsProcessedMetricsGoal', array($ignore = true, $idGoal));
+ }
+
+ return $dataTable;
+ }
+
+ /**
+ * @param DataTableInterface $dataTable
+ * @return DataTableInterface
+ */
+ public function applyQueuedFilters($dataTable)
+ {
+ // if the flag disable_queued_filters is defined we skip the filters that were queued
+ if (Common::getRequestVar('disable_queued_filters', 0, 'int', $this->request) == 0) {
+ $dataTable->applyQueuedFilters();
+ }
+ return $dataTable;
+ }
+
+ /**
+ * @param DataTableInterface $dataTable
+ * @return DataTableInterface
+ */
+ public function applyRequestedColumnDeletion($dataTable)
+ {
+ // use the ColumnDelete filter if hideColumns/showColumns is provided (must be done
+ // after queued filters are run so processed metrics can be removed, too)
+ $hideColumns = Common::getRequestVar('hideColumns', '', 'string', $this->request);
+ $showColumns = Common::getRequestVar('showColumns', '', 'string', $this->request);
+ if (!empty($hideColumns)
+ || !empty($showColumns)
+ ) {
+ $dataTable->filter('ColumnDelete', array($hideColumns, $showColumns));
+ } else {
+ $this->removeTemporaryMetrics($dataTable);
+ }
+
+ return $dataTable;
+ }
+
+ /**
+ * @param DataTableInterface $dataTable
+ */
+ public function removeTemporaryMetrics(DataTableInterface $dataTable)
+ {
+ $allColumns = !empty($this->report) ? $this->report->getAllMetrics() : array();
+
+ $report = $this->report;
+ $dataTable->filter(function (DataTable $table) use ($report, $allColumns) {
+ $processedMetrics = Report::getProcessedMetricsForTable($table, $report);
+
+ $allTemporaryMetrics = array();
+ foreach ($processedMetrics as $metric) {
+ $allTemporaryMetrics = array_merge($allTemporaryMetrics, $metric->getTemporaryMetrics());
+ }
+
+ if (!empty($allTemporaryMetrics)) {
+ $table->filter('ColumnDelete', array($allTemporaryMetrics));
+ }
+ });
+ }
+
+ /**
+ * @param DataTableInterface $dataTable
+ * @return DataTableInterface
+ */
+ public function applyLabelFilter($dataTable)
+ {
+ $label = self::getLabelFromRequest($this->request);
+
+ // apply label filter: only return rows matching the label parameter (more than one if more than one label)
+ if (!empty($label)) {
+ $addLabelIndex = Common::getRequestVar('labelFilterAddLabelIndex', 0, 'int', $this->request) == 1;
+
+ $filter = new LabelFilter($this->apiModule, $this->apiMethod, $this->request);
+ $dataTable = $filter->filter($label, $dataTable, $addLabelIndex);
+ }
+ return $dataTable;
+ }
+
+ /**
+ * @param DataTableInterface $dataTable
+ * @return DataTableInterface
+ */
+ public function applyMetricsFormatting($dataTable)
+ {
+ $formatMetrics = Common::getRequestVar('format_metrics', 0, 'string', $this->request);
+ if ($formatMetrics == '0') {
+ return $dataTable;
+ }
+
+ // in Piwik 2.X & below, metrics are not formatted in API responses except for percents.
+ // this code implements this inconsistency
+ $onlyFormatPercents = $formatMetrics === 'bc';
+
+ $metricsToFormat = null;
+ if ($onlyFormatPercents) {
+ $metricsToFormat = $this->apiInconsistencies->getPercentMetricsToFormat();
+ }
+
+ $dataTable->filter(array($this->formatter, 'formatMetrics'), array($this->report, $metricsToFormat));
+ return $dataTable;
+ }
+
+ /**
+ * Returns the value for the label query parameter which can be either a string
+ * (ie, label=...) or array (ie, label[]=...).
+ *
+ * @param array $request
+ * @return array
+ */
+ public static function getLabelFromRequest($request)
+ {
+ $label = Common::getRequestVar('label', array(), 'array', $request);
+ if (empty($label)) {
+ $label = Common::getRequestVar('label', '', 'string', $request);
+ if (!empty($label)) {
+ $label = array($label);
+ }
+ }
+
+ $label = self::unsanitizeLabelParameter($label);
+ return $label;
+ }
+
+ public static function unsanitizeLabelParameter($label)
+ {
+ // this is needed because Proxy uses Common::getRequestVar which in turn
+ // uses Common::sanitizeInputValue. This causes the > that separates recursive labels
+ // to become &gt; and we need to undo that here.
+ $label = Common::unsanitizeInputValues($label);
+ return $label;
+ }
+
+ public function computeProcessedMetrics(DataTable $dataTable)
+ {
+ if ($dataTable->getMetadata(self::PROCESSED_METRICS_COMPUTED_FLAG)) {
+ return;
+ }
+
+ /** @var ProcessedMetric[] $processedMetrics */
+ $processedMetrics = Report::getProcessedMetricsForTable($dataTable, $this->report);
+ if (empty($processedMetrics)) {
+ return;
+ }
+
+ $dataTable->setMetadata(self::PROCESSED_METRICS_COMPUTED_FLAG, true);
+
+ foreach ($processedMetrics as $name => $processedMetric) {
+ if (!$processedMetric->beforeCompute($this->report, $dataTable)) {
+ continue;
+ }
+
+ foreach ($dataTable->getRows() as $row) {
+ if ($row->getColumn($name) === false) { // only compute the metric if it has not been computed already
+ $computedValue = $processedMetric->compute($row);
+ if ($computedValue !== false) {
+ $row->addColumn($name, $computedValue);
+ }
+
+ $subtable = $row->getSubtable();
+ if (!empty($subtable)) {
+ $this->computeProcessedMetrics($subtable);
+ }
+ }
+ }
+ }
+ }
+
+ public function applyComputeProcessedMetrics(DataTableInterface $dataTable)
+ {
+ $dataTable->filter(array($this, 'computeProcessedMetrics'));
+ }
+} \ No newline at end of file
diff --git a/core/API/DocumentationGenerator.php b/core/API/DocumentationGenerator.php
index 6a140ac8fb..3c88f62027 100644
--- a/core/API/DocumentationGenerator.php
+++ b/core/API/DocumentationGenerator.php
@@ -132,13 +132,13 @@ class DocumentationGenerator
$lastNUrls = '';
if (preg_match('/(&period)|(&date)/', $exampleUrl)) {
$exampleUrlRss = $prefixUrls . $this->getExampleUrl($class, $methodName, array('date' => 'last10', 'period' => 'day') + $parametersToSet);
- $lastNUrls = ", RSS of the last <a target=_blank href='$exampleUrlRss&format=rss$token_auth&translateColumnNames=1'>10 days</a>";
+ $lastNUrls = ", RSS of the last <a target='_blank' href='$exampleUrlRss&format=rss$token_auth&translateColumnNames=1'>10 days</a>";
}
$exampleUrl = $prefixUrls . $exampleUrl;
$str .= " [ Example in
- <a target=_blank href='$exampleUrl&format=xml$token_auth'>XML</a>,
- <a target=_blank href='$exampleUrl&format=JSON$token_auth'>Json</a>,
- <a target=_blank href='$exampleUrl&format=Tsv$token_auth&translateColumnNames=1'>Tsv (Excel)</a>
+ <a target='_blank' href='$exampleUrl&format=xml$token_auth'>XML</a>,
+ <a target='_blank' href='$exampleUrl&format=JSON$token_auth'>Json</a>,
+ <a target='_blank' href='$exampleUrl&format=Tsv$token_auth&translateColumnNames=1'>Tsv (Excel)</a>
$lastNUrls
]";
} else {
@@ -350,13 +350,13 @@ class DocumentationGenerator
$lastNUrls = '';
if (preg_match('/(&period)|(&date)/', $exampleUrl)) {
$exampleUrlRss = $prefixUrls . $this->getExampleUrl($class, $methodName, array('date' => 'last10', 'period' => 'day') + $parametersToSet);
- $lastNUrls = ", RSS of the last <a target=_blank href='$exampleUrlRss&format=rss$token_auth&translateColumnNames=1'>10 days</a>";
+ $lastNUrls = ", RSS of the last <a target='_blank' href='$exampleUrlRss&format=rss$token_auth&translateColumnNames=1'>10 days</a>";
}
$exampleUrl = $prefixUrls . $exampleUrl;
$str .= " [ Example in
- <a target=_blank href='$exampleUrl&format=xml$token_auth'>XML</a>,
- <a target=_blank href='$exampleUrl&format=JSON$token_auth'>Json</a>,
- <a target=_blank href='$exampleUrl&format=Tsv$token_auth&translateColumnNames=1'>Tsv (Excel)</a>
+ <a target='_blank' href='$exampleUrl&format=xml$token_auth'>XML</a>,
+ <a target='_blank' href='$exampleUrl&format=JSON$token_auth'>Json</a>,
+ <a target='_blank' href='$exampleUrl&format=Tsv$token_auth&translateColumnNames=1'>Tsv (Excel)</a>
$lastNUrls
]";
} else {
diff --git a/core/API/Inconsistencies.php b/core/API/Inconsistencies.php
new file mode 100644
index 0000000000..5d0c20d418
--- /dev/null
+++ b/core/API/Inconsistencies.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\API;
+
+/**
+ * Contains logic to replicate inconsistencies in Piwik's API. This class exists
+ * to provide a way to clean up existing Piwik code and behavior without breaking
+ * backwards compatibility immediately.
+ *
+ * Code that handles the case when the 'format_metrics' query parameter value is
+ * 'bc' should be removed as well. This code is in API\Request and DataTablePostProcessor.
+ *
+ * Should be removed before releasing Piwik 3.0.
+ */
+class Inconsistencies
+{
+ /**
+ * In Piwik 2.X and below, the "raw" API would format percent values but no others.
+ * This method returns the list of percent metrics that were returned from the API
+ * formatted so we can maintain BC.
+ *
+ * Used by DataTablePostProcessor.
+ */
+ public function getPercentMetricsToFormat()
+ {
+ return array(
+ 'bounce_rate',
+ 'conversion_rate',
+ 'interaction_rate',
+ 'exit_rate',
+ 'bounce_rate_returning',
+ 'nb_visits_percentage',
+ '/.*_evolution/',
+ '/goal_.*_conversion_rate/'
+ );
+ }
+} \ No newline at end of file
diff --git a/core/API/Request.php b/core/API/Request.php
index 64e8e054fa..979f1299d0 100644
--- a/core/API/Request.php
+++ b/core/API/Request.php
@@ -79,15 +79,23 @@ class Request
*
* @param string|array $request The base request string or array, eg,
* `'module=UserSettings&action=getWidescreen'`.
+ * @param array $defaultRequest Default query parameters. If a query parameter is absent in `$request`, it will be loaded
+ * from this. Defaults to `$_GET + $_POST`.
* @return array
*/
- public static function getRequestArrayFromString($request)
+ public static function getRequestArrayFromString($request, $defaultRequest = null)
{
- $defaultRequest = $_GET + $_POST;
+ if ($defaultRequest === null) {
+ $defaultRequest = $_GET + $_POST;
- $requestRaw = self::getRequestParametersGET();
- if (!empty($requestRaw['segment'])) {
- $defaultRequest['segment'] = $requestRaw['segment'];
+ $requestRaw = self::getRequestParametersGET();
+ if (!empty($requestRaw['segment'])) {
+ $defaultRequest['segment'] = $requestRaw['segment'];
+ }
+
+ if (empty($defaultRequest['format_metrics'])) {
+ $defaultRequest['format_metrics'] = 'bc';
+ }
}
$requestArray = $defaultRequest;
@@ -120,10 +128,12 @@ class Request
* eg, `'method=UserSettings.getWideScreen&idSite=1&date=yesterday&period=week&format=xml'`
* If a request is not provided, then we use the values in the `$_GET` and `$_POST`
* superglobals.
+ * @param array $defaultRequest Default query parameters. If a query parameter is absent in `$request`, it will be loaded
+ * from this. Defaults to `$_GET + $_POST`.
*/
- public function __construct($request = null)
+ public function __construct($request = null, $defaultRequest = null)
{
- $this->request = self::getRequestArrayFromString($request);
+ $this->request = self::getRequestArrayFromString($request, $defaultRequest);
$this->sanitizeRequest();
}
@@ -289,9 +299,13 @@ class Request
* @param string $method The API method to call, ie, `'Actions.getPageTitles'`.
* @param array $paramOverride The parameter name-value pairs to use instead of what's
* in `$_GET` & `$_POST`.
+ * @param array $defaultRequest Default query parameters. If a query parameter is absent in `$request`, it will be loaded
+ * from this. Defaults to `$_GET + $_POST`.
+ *
+ * To avoid using any parameters from $_GET or $_POST, set this to an empty `array()`.
* @return mixed The result of the API request. See {@link process()}.
*/
- public static function processRequest($method, $paramOverride = array())
+ public static function processRequest($method, $paramOverride = array(), $defaultRequest = null)
{
$params = array();
$params['format'] = 'original';
@@ -300,7 +314,7 @@ class Request
$params = $paramOverride + $params;
// process request
- $request = new Request($params);
+ $request = new Request($params, $defaultRequest);
return $request->process();
}
diff --git a/core/API/ResponseBuilder.php b/core/API/ResponseBuilder.php
index 5b00c01a13..4ebe50305d 100644
--- a/core/API/ResponseBuilder.php
+++ b/core/API/ResponseBuilder.php
@@ -9,15 +9,13 @@
namespace Piwik\API;
use Exception;
-use Piwik\API\DataTableManipulator\Flattener;
-use Piwik\API\DataTableManipulator\LabelFilter;
-use Piwik\API\DataTableManipulator\ReportTotalsCalculator;
use Piwik\Common;
use Piwik\DataTable;
-use Piwik\DataTable\Filter\PivotByDimension;
use Piwik\DataTable\Renderer;
use Piwik\DataTable\DataTableInterface;
use Piwik\DataTable\Filter\ColumnDelete;
+use Piwik\Plugin\Report;
+use Piwik\Plugins\API\Renderer\Original;
/**
*/
@@ -166,66 +164,8 @@ class ResponseBuilder
private function handleDataTable(DataTableInterface $datatable)
{
- $label = $this->getLabelFromRequest($this->request);
-
- // handle pivot by dimension filter
- $pivotBy = Common::getRequestVar('pivotBy', false, 'string', $this->request);
- if (!empty($pivotBy)) {
- $reportId = $this->apiModule . '.' . $this->apiMethod;
- $pivotByColumn = Common::getRequestVar('pivotByColumn', false, 'string', $this->request);
- $pivotByColumnLimit = Common::getRequestVar('pivotByColumnLimit', false, 'int', $this->request);
-
- $datatable->filter('PivotByDimension', array($reportId, $pivotBy, $pivotByColumn, $pivotByColumnLimit,
- PivotByDimension::isSegmentFetchingEnabledInConfig()));
- }
-
- // if requested, flatten nested tables
- if (Common::getRequestVar('flat', '0', 'string', $this->request) == '1') {
- $flattener = new Flattener($this->apiModule, $this->apiMethod, $this->request);
- if (Common::getRequestVar('include_aggregate_rows', '0', 'string', $this->request) == '1') {
- $flattener->includeAggregateRows();
- }
- $datatable = $flattener->flatten($datatable);
- }
-
- if (1 == Common::getRequestVar('totals', '1', 'integer', $this->request)) {
- $genericFilter = new ReportTotalsCalculator($this->apiModule, $this->apiMethod, $this->request);
- $datatable = $genericFilter->calculate($datatable);
- }
-
- // if the flag disable_generic_filters is defined we skip the generic filters
- if (0 == Common::getRequestVar('disable_generic_filters', '0', 'string', $this->request)) {
- $genericFilter = new DataTableGenericFilter($this->request);
- if (!empty($label)) {
- $genericFilter->disableFilters(array('Limit', 'Truncate'));
- }
-
- $genericFilter->filter($datatable);
- }
-
- // we automatically safe decode all datatable labels (against xss)
- $datatable->queueFilter('SafeDecodeLabel');
-
- // if the flag disable_queued_filters is defined we skip the filters that were queued
- if (Common::getRequestVar('disable_queued_filters', 0, 'int', $this->request) == 0) {
- $datatable->applyQueuedFilters();
- }
-
- // use the ColumnDelete filter if hideColumns/showColumns is provided (must be done
- // after queued filters are run so processed metrics can be removed, too)
- $hideColumns = Common::getRequestVar('hideColumns', '', 'string', $this->request);
- $showColumns = Common::getRequestVar('showColumns', '', 'string', $this->request);
- if ($hideColumns !== '' || $showColumns !== '') {
- $datatable->filter('ColumnDelete', array($hideColumns, $showColumns));
- }
-
- // apply label filter: only return rows matching the label parameter (more than one if more than one label)
- if (!empty($label)) {
- $addLabelIndex = Common::getRequestVar('labelFilterAddLabelIndex', 0, 'int', $this->request) == 1;
-
- $filter = new LabelFilter($this->apiModule, $this->apiMethod, $this->request);
- $datatable = $filter->filter($label, $datatable, $addLabelIndex);
- }
+ $postProcessor = new DataTablePostProcessor($this->apiModule, $this->apiMethod, $this->request);
+ $datatable = $postProcessor->process($datatable);
return $this->apiRenderer->renderDataTable($datatable);
}
@@ -260,36 +200,6 @@ class ResponseBuilder
return $this->apiRenderer->renderArray($array);
}
- /**
- * Returns the value for the label query parameter which can be either a string
- * (ie, label=...) or array (ie, label[]=...).
- *
- * @param array $request
- * @return array
- */
- public static function getLabelFromRequest($request)
- {
- $label = Common::getRequestVar('label', array(), 'array', $request);
- if (empty($label)) {
- $label = Common::getRequestVar('label', '', 'string', $request);
- if (!empty($label)) {
- $label = array($label);
- }
- }
-
- $label = self::unsanitizeLabelParameter($label);
- return $label;
- }
-
- public static function unsanitizeLabelParameter($label)
- {
- // this is needed because Proxy uses Common::getRequestVar which in turn
- // uses Common::sanitizeInputValue. This causes the > that separates recursive labels
- // to become &gt; and we need to undo that here.
- $label = Common::unsanitizeInputValues($label);
- return $label;
- }
-
private function sendHeaderIfEnabled()
{
if ($this->sendHeader) {
diff --git a/core/Archive.php b/core/Archive.php
index 7101850c1d..b407465a45 100644
--- a/core/Archive.php
+++ b/core/Archive.php
@@ -744,7 +744,10 @@ class Archive
*/
private function getArchiveGroupOfPlugin($plugin)
{
- if ($this->getPeriodLabel() != 'range') {
+ $periods = $this->params->getPeriods();
+ $periodLabel = reset($periods)->getLabel();
+
+ if (Rules::shouldProcessReportsAllPlugins($this->params->getIdSites(), $this->params->getSegment(), $periodLabel)) {
return self::ARCHIVE_ALL_PLUGINS_FLAG;
}
diff --git a/core/Archive/DataTableFactory.php b/core/Archive/DataTableFactory.php
index 71eaa7a8c1..59af8a4e0b 100644
--- a/core/Archive/DataTableFactory.php
+++ b/core/Archive/DataTableFactory.php
@@ -10,6 +10,7 @@
namespace Piwik\Archive;
use Piwik\DataTable;
+use Piwik\DataTable\DataTableInterface;
use Piwik\DataTable\Row;
use Piwik\Site;
@@ -96,6 +97,23 @@ class DataTableFactory
}
/**
+ * Returns the ID of the site a table is related to based on the 'site' metadata entry,
+ * or null if there is none.
+ *
+ * @param DataTable $table
+ * @return int|null
+ */
+ public static function getSiteIdFromMetadata(DataTable $table)
+ {
+ $site = $table->getMetadata('site');
+ if (empty($site)) {
+ return null;
+ } else {
+ return $site->getId();
+ }
+ }
+
+ /**
* Tells the factory instance to expand the DataTables that are created by
* creating subtables and setting the subtable IDs of rows w/ subtables correctly.
*
@@ -345,10 +363,10 @@ class DataTableFactory
* Converts site IDs and period string ranges into Site instances and
* Period instances in DataTable metadata.
*/
- private function transformMetadata($table)
+ private function transformMetadata(DataTableInterface $table)
{
$periods = $this->periods;
- $table->filter(function ($table) use ($periods) {
+ $table->filter(function (DataTable $table) use ($periods) {
$table->setMetadata(DataTableFactory::TABLE_METADATA_SITE_INDEX, new Site($table->getMetadata(DataTableFactory::TABLE_METADATA_SITE_INDEX)));
$table->setMetadata(DataTableFactory::TABLE_METADATA_PERIOD_INDEX, $periods[$table->getMetadata(DataTableFactory::TABLE_METADATA_PERIOD_INDEX)]);
});
@@ -373,7 +391,7 @@ class DataTableFactory
* @param $keyMetadata
* @param $result
*/
- private function setTableMetadata($keyMetadata, $result)
+ private function setTableMetadata($keyMetadata, DataTableInterface $result)
{
if (!isset($keyMetadata[DataTableFactory::TABLE_METADATA_SITE_INDEX])) {
$keyMetadata[DataTableFactory::TABLE_METADATA_SITE_INDEX] = reset($this->sitesId);
@@ -385,7 +403,7 @@ class DataTableFactory
}
// Note: $result can be a DataTable\Map
- $result->filter(function ($table) use ($keyMetadata) {
+ $result->filter(function (DataTable $table) use ($keyMetadata) {
foreach ($keyMetadata as $name => $value) {
$table->setMetadata($name, $value);
}
@@ -423,5 +441,4 @@ class DataTableFactory
$result = $table;
return $result;
}
-}
-
+} \ No newline at end of file
diff --git a/core/CronArchive.php b/core/CronArchive.php
index 151298fc6a..eb4e45e383 100644
--- a/core/CronArchive.php
+++ b/core/CronArchive.php
@@ -12,6 +12,7 @@ use Exception;
use Piwik\ArchiveProcessor\Rules;
use Piwik\CronArchive\FixedSiteIds;
use Piwik\CronArchive\SharedSiteIds;
+use Piwik\Metrics\Formatter;
use Piwik\Period\Factory as PeriodFactory;
use Piwik\DataAccess\InvalidatedReports;
use Piwik\Plugins\SitesManager\API as APISitesManager;
@@ -187,6 +188,8 @@ class CronArchive
private $processed = 0;
private $archivedPeriodsArchivesWebsite = 0;
+ private $formatter;
+
/**
* Returns the option name of the option that stores the time core:archive was last executed.
*
@@ -209,6 +212,8 @@ class CronArchive
*/
public function __construct($piwikUrl = false)
{
+ $this->formatter = new Formatter();
+
$this->initLog();
$this->initPiwikHost($piwikUrl);
$this->initCore();
@@ -489,7 +494,7 @@ class CronArchive
if ($skipDayArchive) {
$this->log("Skipped website id $idSite, already done "
- . \Piwik\MetricsFormatter::getPrettyTimeFromSeconds($elapsedSinceLastArchiving, true, $isHtml = false)
+ . $this->formatter->getPrettyTimeFromSeconds($elapsedSinceLastArchiving, true)
. " ago, " . $timerWebsite->__toString());
$this->skippedDayArchivesWebsites++;
$this->skipped++;
@@ -503,7 +508,7 @@ class CronArchive
if (!$shouldArchivePeriods) {
$this->log("Skipped website id $idSite periods processing, already done "
- . \Piwik\MetricsFormatter::getPrettyTimeFromSeconds($elapsedSinceLastArchiving, true, $isHtml = false)
+ . $this->formatter->getPrettyTimeFromSeconds($elapsedSinceLastArchiving, true)
. " ago, " . $timerWebsite->__toString());
$this->skippedDayArchivesWebsites++;
$this->skipped++;
@@ -860,6 +865,8 @@ class CronArchive
$config->log = $log;
+ Log::unsetInstance();
+
// Make sure we log at least INFO (if logger is set to DEBUG then keep it)
$logLevel = Log::getInstance()->getLogLevel();
if ($logLevel < Log::INFO) {
@@ -1048,7 +1055,7 @@ class CronArchive
{
$sitesIdWithVisits = APISitesManager::getInstance()->getSitesIdWithVisits(time() - $this->shouldArchiveOnlySitesWithTrafficSince);
$websiteIds = !empty($sitesIdWithVisits) ? ", IDs: " . implode(", ", $sitesIdWithVisits) : "";
- $prettySeconds = \Piwik\MetricsFormatter::getPrettyTimeFromSeconds( $this->shouldArchiveOnlySitesWithTrafficSince, true, false);
+ $prettySeconds = $this->formatter->getPrettyTimeFromSeconds( $this->shouldArchiveOnlySitesWithTrafficSince, true);
$this->log("- Will process " . count($sitesIdWithVisits) . " websites with new visits since "
. $prettySeconds
. " "
@@ -1156,7 +1163,8 @@ class CronArchive
// Try and not request older data we know is already archived
if ($this->lastSuccessRunTimestamp !== false) {
$dateLast = time() - $this->lastSuccessRunTimestamp;
- $this->log("- Archiving was last executed without error " . \Piwik\MetricsFormatter::getPrettyTimeFromSeconds($dateLast, true, $isHtml = false) . " ago");
+ $this->log("- Archiving was last executed without error "
+ . $this->formatter->getPrettyTimeFromSeconds($dateLast, true) . " ago");
}
}
@@ -1213,6 +1221,10 @@ class CronArchive
$today = end($stats);
+ if (empty($today['nb_visits'])) {
+ return 0;
+ }
+
return $today['nb_visits'];
}
diff --git a/core/DataTable.php b/core/DataTable.php
index 4d308f7d21..61e8abb1eb 100644
--- a/core/DataTable.php
+++ b/core/DataTable.php
@@ -200,6 +200,13 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess
const LABEL_SUMMARY_ROW = -1;
/**
+ * Name for metadata that contains extra {@link Piwik\Plugin\ProcessedMetric}s for a DataTable.
+ * These metrics will be added in addition to the ones specified in the table's associated
+ * {@link Piwik\Plugin\Report} class.
+ */
+ const EXTRA_PROCESSED_METRICS_METADATA_NAME = 'extra_processed_metrics';
+
+ /**
* Maximum nesting level.
*/
private static $maximumDepthLevelAllowed = self::MAX_DEPTH_DEFAULT;
@@ -1672,4 +1679,4 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess
{
$this->deleteRow($offset);
}
-}
+} \ No newline at end of file
diff --git a/core/DataTable/Filter/AddColumnsProcessedMetrics.php b/core/DataTable/Filter/AddColumnsProcessedMetrics.php
index f3d8191b1f..a3a9bd9776 100644
--- a/core/DataTable/Filter/AddColumnsProcessedMetrics.php
+++ b/core/DataTable/Filter/AddColumnsProcessedMetrics.php
@@ -11,7 +11,11 @@ namespace Piwik\DataTable\Filter;
use Piwik\DataTable\BaseFilter;
use Piwik\DataTable\Row;
use Piwik\DataTable;
-use Piwik\Metrics;
+use Piwik\Plugin\Metric;
+use Piwik\Plugins\CoreHome\Columns\Metrics\ActionsPerVisit;
+use Piwik\Plugins\CoreHome\Columns\Metrics\AverageTimeOnSite;
+use Piwik\Plugins\CoreHome\Columns\Metrics\BounceRate;
+use Piwik\Plugins\CoreHome\Columns\Metrics\ConversionRate;
/**
* Adds processed metrics columns to a {@link DataTable} using metrics that already exist.
@@ -65,34 +69,21 @@ class AddColumnsProcessedMetrics extends BaseFilter
$this->deleteRowsWithNoVisit($table);
}
- $metrics = new Metrics\Processed();
+ $extraProcessedMetrics = $table->getMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME);
- foreach ($table->getRows() as $row) {
- $this->tryToAddColumn($row, 'conversion_rate', array($metrics, 'getConversionRate'));
- $this->tryToAddColumn($row, 'nb_actions_per_visit', array($metrics, 'getActionsPerVisit'));
- $this->tryToAddColumn($row, 'avg_time_on_site', array($metrics, 'getAvgTimeOnSite'));
- $this->tryToAddColumn($row, 'bounce_rate', array($metrics, 'getBounceRate'));
+ $extraProcessedMetrics[] = new ConversionRate();
+ $extraProcessedMetrics[] = new ActionsPerVisit();
+ $extraProcessedMetrics[] = new AverageTimeOnSite();
+ $extraProcessedMetrics[] = new BounceRate();
- $this->filterSubTable($row);
- }
- }
-
- private function tryToAddColumn(Row $row, $column, $callable)
- {
- try {
- $row->addColumn($column, $callable);
- } catch (\Exception $e) {
-
- }
+ $table->setMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME, $extraProcessedMetrics);
}
private function deleteRowsWithNoVisit(DataTable $table)
{
- $metrics = new Metrics\Processed();
-
foreach ($table->getRows() as $key => $row) {
- $nbVisits = $metrics->getColumn($row, Metrics::INDEX_NB_VISITS);
- $nbActions = $metrics->getColumn($row, Metrics::INDEX_NB_ACTIONS);
+ $nbVisits = Metric::getMetric($row, 'nb_visits');
+ $nbActions = Metric::getMetric($row, 'nb_actions');
if ($nbVisits == 0
&& $nbActions == 0
@@ -102,4 +93,4 @@ class AddColumnsProcessedMetrics extends BaseFilter
}
}
}
-}
+} \ No newline at end of file
diff --git a/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php b/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php
index 963ac9acbd..d63d9b9bc5 100644
--- a/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php
+++ b/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php
@@ -8,10 +8,18 @@
*/
namespace Piwik\DataTable\Filter;
+use Piwik\Archive\DataTableFactory;
use Piwik\DataTable;
use Piwik\DataTable\Row;
-use Piwik\Metrics;
use Piwik\Piwik;
+use Piwik\Plugin\Metric;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific\AverageOrderRevenue;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific\ConversionRate;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific\Conversions;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific\ItemsCount;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific\Revenue;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific\RevenuePerVisit as GoalSpecificRevenuePerVisit;
+use Piwik\Plugins\Goals\Columns\Metrics\RevenuePerVisit;
/**
* Adds goal related metrics to a {@link DataTable} using metrics that already exist.
@@ -66,8 +74,6 @@ class AddColumnsProcessedMetricsGoal extends AddColumnsProcessedMetrics
*/
const GOALS_FULL_TABLE = 0;
- private $expectedColumns = array();
-
/**
* Constructor.
*
@@ -78,19 +84,14 @@ class AddColumnsProcessedMetricsGoal extends AddColumnsProcessedMetrics
* If self::GOALS_OVERVIEW, only the main goal metrics will be added.
* If an int > 0, then will process only metrics for this specific Goal.
*/
- public function __construct($table, $enable = true, $processOnlyIdGoal)
+ public function __construct($table, $enable = true, $processOnlyIdGoal, $goalsToProcess = null)
{
$this->processOnlyIdGoal = $processOnlyIdGoal;
$this->isEcommerce = $this->processOnlyIdGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER || $this->processOnlyIdGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART;
parent::__construct($table);
// Ensure that all rows with no visit but conversions will be displayed
$this->deleteRowsWithNoVisit = false;
- }
-
- private function addColumn(Row $row, $columnName, $callback)
- {
- $this->expectedColumns[$columnName] = true;
- $row->addColumn($columnName, $callback);
+ $this->goalsToProcess = $goalsToProcess;
}
/**
@@ -104,40 +105,27 @@ class AddColumnsProcessedMetricsGoal extends AddColumnsProcessedMetrics
// Add standard processed metrics
parent::filter($table);
- $this->expectedColumns = array();
-
- $metrics = new Metrics\ProcessedGoals();
-
- foreach ($table->getRows() as $row) {
- $goals = $metrics->getColumn($row, Metrics::INDEX_GOALS);
-
- if (!$goals) {
- continue;
- }
-
- $this->addColumn($row, 'revenue_per_visit', function (Row $row) use ($metrics) {
- return $metrics->getRevenuePerVisit($row);
- });
+ $goals = $this->getGoalsInTable($table);
+ if (!empty($this->goalsToProcess)) {
+ $goals = array_unique(array_merge($goals, $this->goalsToProcess));
+ sort($goals);
+ }
- if ($this->processOnlyIdGoal == self::GOALS_MINIMAL_REPORT) {
- continue;
- }
+ $idSite = DataTableFactory::getSiteIdFromMetadata($table);
- foreach ($goals as $goalId => $goalMetrics) {
- $goalId = str_replace("idgoal=", "", $goalId);
+ $extraProcessedMetrics = $table->getMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME);
+ $extraProcessedMetrics[] = new RevenuePerVisit();
+ if ($this->processOnlyIdGoal != self::GOALS_MINIMAL_REPORT) {
+ foreach ($goals as $idGoal) {
if (($this->processOnlyIdGoal > self::GOALS_FULL_TABLE
|| $this->isEcommerce)
- && $this->processOnlyIdGoal != $goalId
+ && $this->processOnlyIdGoal != $idGoal
) {
continue;
}
- $columnPrefix = 'goal_' . $goalId;
-
- $this->addColumn($row, $columnPrefix . '_conversion_rate', function (Row $row) use ($metrics, $goalMetrics) {
- return $metrics->getConversionRate($row, $goalMetrics);
- });
+ $extraProcessedMetrics[] = new ConversionRate($idSite, $idGoal); // PerGoal\ConversionRate
// When the table is displayed by clicking on the flag icon, we only display the columns
// Visits, Conversions, Per goal conversion rate, Revenue
@@ -145,51 +133,34 @@ class AddColumnsProcessedMetricsGoal extends AddColumnsProcessedMetrics
continue;
}
- // Goal Conversions
- $this->addColumn($row, $columnPrefix . '_nb_conversions', function () use ($metrics, $goalMetrics) {
- return $metrics->getNbConversions($goalMetrics);
- });
-
- // Goal Revenue per visit
- $this->addColumn($row, $columnPrefix . '_revenue_per_visit', function (Row $row) use ($metrics, $goalMetrics) {
- return $metrics->getRevenuePerVisitForGoal($row, $goalMetrics);
- });
-
- // Total revenue
- $this->addColumn($row, $columnPrefix . '_revenue', function () use ($metrics, $goalMetrics) {
- return $metrics->getRevenue($goalMetrics);
- });
+ $extraProcessedMetrics[] = new Conversions($idSite, $idGoal); // PerGoal\Conversions or GoalSpecific\
+ $extraProcessedMetrics[] = new GoalSpecificRevenuePerVisit($idSite, $idGoal); // PerGoal\Revenue
+ $extraProcessedMetrics[] = new Revenue($idSite, $idGoal); // PerGoal\Revenue
if ($this->isEcommerce) {
-
- // AOV Average Order Value
- $this->addColumn($row, $columnPrefix . '_avg_order_revenue', function () use ($metrics, $goalMetrics) {
- return $metrics->getAvgOrderRevenue($goalMetrics);
- });
-
- // Items qty
- $this->addColumn($row, $columnPrefix . '_items', function () use ($metrics, $goalMetrics) {
- return $metrics->getItems($goalMetrics);
- });
-
+ $extraProcessedMetrics[] = new AverageOrderRevenue($idSite, $idGoal);
+ $extraProcessedMetrics[] = new ItemsCount($idSite, $idGoal);
}
}
}
- $expectedColumns = array_keys($this->expectedColumns);
- $rows = $table->getRows();
- foreach ($rows as $row) {
- foreach ($expectedColumns as $name) {
- if (!$row->hasColumn($name)) {
- if (strpos($name, 'conversion_rate') !== false) {
- $row->addColumn($name, function () {
- return '0%';
- });
- } else {
- $row->addColumn($name, 0);
- }
- }
+ $table->setMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME, $extraProcessedMetrics);
+ }
+
+ private function getGoalsInTable(DataTable $table)
+ {
+ $result = array();
+ foreach ($table->getRows() as $row) {
+ $goals = Metric::getMetric($row, 'goals');
+ if (!$goals) {
+ continue;
+ }
+
+ foreach ($goals as $goalId => $goalMetrics) {
+ $goalId = str_replace("idgoal=", "", $goalId);
+ $result[] = $goalId;
}
}
+ return array_unique($result);
}
-}
+} \ No newline at end of file
diff --git a/core/DataTable/Filter/CalculateEvolutionFilter.php b/core/DataTable/Filter/CalculateEvolutionFilter.php
index 5fa55b329e..a8bd04d08d 100755
--- a/core/DataTable/Filter/CalculateEvolutionFilter.php
+++ b/core/DataTable/Filter/CalculateEvolutionFilter.php
@@ -27,6 +27,7 @@ use Piwik\Site;
* ((currentValue - pastValue) / pastValue) * 100
*
* @api
+ * @deprecated since v2.10.0
*/
class CalculateEvolutionFilter extends ColumnCallbackAddColumnPercentage
{
diff --git a/core/DataTable/Filter/ColumnCallbackReplace.php b/core/DataTable/Filter/ColumnCallbackReplace.php
index ca53405d7e..3e167b5593 100644
--- a/core/DataTable/Filter/ColumnCallbackReplace.php
+++ b/core/DataTable/Filter/ColumnCallbackReplace.php
@@ -29,6 +29,7 @@ use Piwik\DataTable\Row;
* // label, url and truncate_length are columns in $dataTable
* $dataTable->filter('ColumnCallbackReplace', array('label', 'url'), $truncateString, null, array('truncate_length'));
*
+ * @api
*/
class ColumnCallbackReplace extends BaseFilter
{
diff --git a/core/DataTable/Filter/ExcludeLowPopulation.php b/core/DataTable/Filter/ExcludeLowPopulation.php
index ee135b59d6..cf54c5c7eb 100644
--- a/core/DataTable/Filter/ExcludeLowPopulation.php
+++ b/core/DataTable/Filter/ExcludeLowPopulation.php
@@ -10,6 +10,7 @@ namespace Piwik\DataTable\Filter;
use Piwik\DataTable;
use Piwik\DataTable\BaseFilter;
+use Piwik\Plugin\Metric;
/**
* Deletes all rows for which a specific column has a value that is lower than
@@ -59,6 +60,7 @@ class ExcludeLowPopulation extends BaseFilter
public function __construct($table, $columnToFilter, $minimumValue, $minimumPercentageThreshold = false)
{
parent::__construct($table);
+
$this->columnToFilter = $columnToFilter;
if ($minimumValue == 0) {
diff --git a/core/DataTable/Filter/PivotByDimension.php b/core/DataTable/Filter/PivotByDimension.php
index ce3ac98ec5..61e68423e8 100644
--- a/core/DataTable/Filter/PivotByDimension.php
+++ b/core/DataTable/Filter/PivotByDimension.php
@@ -161,7 +161,7 @@ class PivotByDimension extends BaseFilter
$this->pivotByColumnLimit = $pivotByColumnLimit ?: self::getDefaultColumnLimit();
$this->isFetchingBySegmentEnabled = $isFetchingBySegmentEnabled;
- $namesToId = Metrics::getMappingFromIdToName();
+ $namesToId = Metrics::getMappingFromNameToId();
$this->metricIndexValue = isset($namesToId[$this->pivotColumn]) ? $namesToId[$this->pivotColumn] : null;
$this->setPivotByDimension($pivotByDimension);
diff --git a/core/DataTable/Filter/Sort.php b/core/DataTable/Filter/Sort.php
index 9df2250288..6ffe33bced 100644
--- a/core/DataTable/Filter/Sort.php
+++ b/core/DataTable/Filter/Sort.php
@@ -192,7 +192,7 @@ class Sort extends BaseFilter
return $this->columnToSort;
}
- $columnIdToName = Metrics::getMappingFromIdToName();
+ $columnIdToName = Metrics::getMappingFromNameToId();
// sorting by "nb_visits" but the index is Metrics::INDEX_NB_VISITS in the table
if (isset($columnIdToName[$this->columnToSort])) {
$column = $columnIdToName[$this->columnToSort];
diff --git a/core/Error.php b/core/Error.php
index c56e3301a7..d8fa0706fc 100644
--- a/core/Error.php
+++ b/core/Error.php
@@ -148,7 +148,7 @@ class Error
$htmlString = '';
$htmlString .= "\n<div style='word-wrap: break-word; border: 3px solid red; padding:4px; width:70%; background-color:#FFFF96;'>
<strong>There is an error. Please report the message (Piwik " . (class_exists('Piwik\Version') ? Version::VERSION : '') . ")
- and full backtrace in the <a href='?module=Proxy&action=redirect&url=http://forum.piwik.org' target='_blank'>Piwik forums</a> (please do a Search first as it might have been reported already!).<br /><br/>
+ and full backtrace in the <a href='?module=Proxy&action=redirect&url=http://forum.piwik.org' rel='noreferrer' target='_blank'>Piwik forums</a> (please do a Search first as it might have been reported already!).<br /><br/>
";
$htmlString .= Error::getErrNoString($message->errno);
$htmlString .= ":</strong> <em>{$message->errstr}</em> in <strong>{$message->errfile}</strong>";
diff --git a/core/Metrics.php b/core/Metrics.php
index 0f8baf5a10..009fa36151 100644
--- a/core/Metrics.php
+++ b/core/Metrics.php
@@ -10,6 +10,7 @@ namespace Piwik;
use Piwik\Cache\LanguageAwareStaticCache;
use Piwik\Cache\PluginAwareStaticCache;
+use Piwik\Metrics\Formatter;
require_once PIWIK_INCLUDE_PATH . "/core/Piwik.php";
@@ -183,11 +184,22 @@ class Metrics
return $names;
}
- // TODO: this method is named wrong
- public static function getMappingFromIdToName()
+ public static function getMappingFromNameToId()
{
- $idToName = array_flip(self::$mappingFromIdToName);
- return $idToName;
+ static $nameToId = null;
+ if ($nameToId === null) {
+ $nameToId = array_flip(self::$mappingFromIdToName);
+ }
+ return $nameToId;
+ }
+
+ public static function getMappingFromNameToIdGoal()
+ {
+ static $nameToId = null;
+ if ($nameToId === null) {
+ $nameToId = array_flip(self::$mappingFromIdToNameGoal);
+ }
+ return $nameToId;
}
/**
@@ -223,7 +235,7 @@ class Metrics
{
$nameToUnit = array(
'_rate' => '%',
- 'revenue' => MetricsFormatter::getCurrencySymbol($idSite),
+ 'revenue' => Formatter::getCurrencySymbol($idSite),
'_time_' => 's'
);
diff --git a/core/Metrics/Base.php b/core/Metrics/Base.php
deleted file mode 100644
index 838d7c2ee6..0000000000
--- a/core/Metrics/Base.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Metrics;
-
-use Piwik\Metrics;
-use Piwik\DataTable\Row;
-
-class Base
-{
- protected $invalidDivision = 0;
- protected $roundPrecision = 2;
-
- protected function getNumVisits(Row $row)
- {
- return (int) $this->getColumn($row, Metrics::INDEX_NB_VISITS);
- }
-
- /**
- * Returns column from a given row.
- * Will work with 2 types of datatable
- * - raw datatables coming from the archive DB, which columns are int indexed
- * - datatables processed resulting of API calls, which columns have human readable english names
- *
- * @param Row|array $row
- * @param int $columnIdRaw see consts in Archive::
- * @param bool|array $mappingIdToName
- * @return mixed Value of column, false if not found
- */
- public function getColumn($row, $columnIdRaw, $mappingIdToName = false)
- {
- if (empty($mappingIdToName)) {
- $mappingIdToName = Metrics::$mappingFromIdToName;
- }
-
- $columnIdReadable = $mappingIdToName[$columnIdRaw];
-
- if ($row instanceof Row) {
- $raw = $row->getColumn($columnIdRaw);
- if ($raw !== false) {
- return $raw;
- }
- return $row->getColumn($columnIdReadable);
- }
-
- if (isset($row[$columnIdRaw])) {
- return $row[$columnIdRaw];
- }
-
- if (isset($row[$columnIdReadable])) {
- return $row[$columnIdReadable];
- }
-
- return false;
- }
-} \ No newline at end of file
diff --git a/core/Metrics/Formatter.php b/core/Metrics/Formatter.php
new file mode 100644
index 0000000000..0e5bbe719e
--- /dev/null
+++ b/core/Metrics/Formatter.php
@@ -0,0 +1,305 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Metrics;
+
+use Piwik\Common;
+use Piwik\DataTable;
+use Piwik\Piwik;
+use Piwik\Plugin\Metric;
+use Piwik\Plugin\ProcessedMetric;
+use Piwik\Plugin\Report;
+use Piwik\Site;
+use Piwik\Tracker\GoalManager;
+
+/**
+ * Contains methods to format metric values. Passed to the {@link \Piwik\Plugin\Metric::format()}
+ * method when formatting Metrics.
+ *
+ * @api
+ */
+class Formatter
+{
+ const PROCESSED_METRICS_FORMATTED_FLAG = 'processed_metrics_formatted';
+
+ private $decimalPoint = null;
+ private $thousandsSeparator = null;
+
+ /**
+ * Returns a prettified string representation of a number. The result will have
+ * thousands separators and a decimal point specific to the current locale, eg,
+ * `'1,000,000.05'` or `'1.000.000,05'`.
+ *
+ * @param number $value
+ * @return string
+ */
+ public function getPrettyNumber($value, $precision = 0)
+ {
+ if ($this->decimalPoint === null) {
+ $locale = localeconv();
+
+ $this->decimalPoint = $locale['decimal_point'];
+ $this->thousandsSeparator = $locale['thousands_sep'];
+ }
+
+ return number_format($value, $precision, $this->decimalPoint, $this->thousandsSeparator);
+ }
+
+ /**
+ * Returns a prettified time value (in seconds).
+ *
+ * @param int $numberOfSeconds The number of seconds.
+ * @param bool $displayTimeAsSentence If set to true, will output `"5min 17s"`, if false `"00:05:17"`.
+ * @param bool $round Whether to round to the nearest second or not.
+ * @return string
+ */
+ public function getPrettyTimeFromSeconds($numberOfSeconds, $displayTimeAsSentence = false, $round = false)
+ {
+ $numberOfSeconds = $round ? (int)$numberOfSeconds : (float)$numberOfSeconds;
+
+ $isNegative = false;
+ if ($numberOfSeconds < 0) {
+ $numberOfSeconds = -1 * $numberOfSeconds;
+ $isNegative = true;
+ }
+
+ // Display 01:45:17 time format
+ if ($displayTimeAsSentence === false) {
+ $hours = floor($numberOfSeconds / 3600);
+ $minutes = floor(($reminder = ($numberOfSeconds - $hours * 3600)) / 60);
+ $seconds = floor($reminder - $minutes * 60);
+ $time = sprintf("%02s", $hours) . ':' . sprintf("%02s", $minutes) . ':' . sprintf("%02s", $seconds);
+ $centiSeconds = ($numberOfSeconds * 100) % 100;
+ if ($centiSeconds) {
+ $time .= '.' . sprintf("%02s", $centiSeconds);
+ }
+ if ($isNegative) {
+ $time = '-' . $time;
+ }
+ return $time;
+ }
+ $secondsInYear = 86400 * 365.25;
+
+ $years = floor($numberOfSeconds / $secondsInYear);
+ $minusYears = $numberOfSeconds - $years * $secondsInYear;
+ $days = floor($minusYears / 86400);
+
+ $minusDays = $numberOfSeconds - $days * 86400;
+ $hours = floor($minusDays / 3600);
+
+ $minusDaysAndHours = $minusDays - $hours * 3600;
+ $minutes = floor($minusDaysAndHours / 60);
+
+ $seconds = $minusDaysAndHours - $minutes * 60;
+ $precision = ($seconds > 0 && $seconds < 0.01 ? 3 : 2);
+ $seconds = round($seconds, $precision);
+
+ if ($years > 0) {
+ $return = sprintf(Piwik::translate('General_YearsDays'), $years, $days);
+ } elseif ($days > 0) {
+ $return = sprintf(Piwik::translate('General_DaysHours'), $days, $hours);
+ } elseif ($hours > 0) {
+ $return = sprintf(Piwik::translate('General_HoursMinutes'), $hours, $minutes);
+ } elseif ($minutes > 0) {
+ $return = sprintf(Piwik::translate('General_MinutesSeconds'), $minutes, $seconds);
+ } else {
+ $return = sprintf(Piwik::translate('General_Seconds'), $seconds);
+ }
+
+ if ($isNegative) {
+ $return = '-' . $return;
+ }
+
+ return $return;
+ }
+
+ /**
+ * Returns a prettified memory size value.
+ *
+ * @param number $size The size in bytes.
+ * @param string $unit The specific unit to use, if any. If null, the unit is determined by $size.
+ * @param int $precision The precision to use when rounding.
+ * @return string eg, `'128 M'` or `'256 K'`.
+ */
+ public function getPrettySizeFromBytes($size, $unit = null, $precision = 1)
+ {
+ if ($size == 0) {
+ return '0 M';
+ }
+
+ $units = array('B', 'K', 'M', 'G', 'T');
+
+ $currentUnit = null;
+ foreach ($units as $idx => $currentUnit) {
+ if ($size >= 1024 && $unit != $currentUnit && $idx != count($units) - 1) {
+ $size = $size / 1024;
+ } else {
+ break;
+ }
+ }
+
+ return round($size, $precision) . " " . $currentUnit;
+ }
+
+ /**
+ * Returns a pretty formated monetary value using the currency associated with a site.
+ *
+ * @param int|string $value The monetary value to format.
+ * @param int $idSite The ID of the site whose currency will be used.
+ * @return string
+ */
+ public function getPrettyMoney($value, $idSite)
+ {
+ $space = ' ';
+
+ $currencySymbol = self::getCurrencySymbol($idSite);
+
+ $currencyBefore = $currencySymbol . $space;
+ $currencyAfter = '';
+
+ // (maybe more currencies prefer this notation?)
+ $currencySymbolToAppend = array('€', 'kr', 'zł');
+
+ // manually put the currency symbol after the amount
+ if (in_array($currencySymbol, $currencySymbolToAppend)) {
+ $currencyAfter = $space . $currencySymbol;
+ $currencyBefore = '';
+ }
+
+ // if the input is a number (it could be a string or INPUT form),
+ // and if this number is not an int, we round to precision 2
+ if (is_numeric($value)) {
+ if ($value == round($value)) {
+ // 0.0 => 0
+ $value = round($value);
+ } else {
+ $precision = GoalManager::REVENUE_PRECISION;
+ $value = sprintf("%01." . $precision . "f", $value);
+ }
+ }
+
+ $prettyMoney = $currencyBefore . $value . $currencyAfter;
+ return $prettyMoney;
+ }
+
+ /**
+ * Returns a percent string from a quotient value. Forces the use of a '.'
+ * decimal place.
+ *
+ * @param float $value
+ * @return string
+ */
+ public function getPrettyPercentFromQuotient($value)
+ {
+ $result = ($value * 100) . '%';
+ return Common::forceDotAsSeparatorForDecimalPoint($result);
+ }
+
+ /**
+ * Returns the currency symbol for a site.
+ *
+ * @param int $idSite The ID of the site to return the currency symbol for.
+ * @return string eg, `'$'`.
+ */
+ public static function getCurrencySymbol($idSite)
+ {
+ $symbols = self::getCurrencyList();
+ $currency = Site::getCurrencyFor($idSite);
+
+ if (isset($symbols[$currency])) {
+ return $symbols[$currency][0];
+ }
+
+ return '';
+ }
+
+ /**
+ * Returns the list of all known currency symbols.
+ *
+ * @return array An array mapping currency codes to their respective currency symbols
+ * and a description, eg, `array('USD' => array('$', 'US dollar'))`.
+ */
+ public static function getCurrencyList()
+ {
+ static $currenciesList = null;
+
+ if (is_null($currenciesList)) {
+ require_once PIWIK_INCLUDE_PATH . '/core/DataFiles/Currencies.php';
+ $currenciesList = $GLOBALS['Piwik_CurrencyList'];
+ }
+
+ return $currenciesList;
+ }
+
+ /**
+ * Formats all metrics, including processed metrics, for a DataTable. Metrics to format
+ * are found through report metadata and DataTable metadata.
+ *
+ * @param DataTable $dataTable The table to format metrics for.
+ * @param Report|null $report The report the table belongs to.
+ * @param string[]|null $metricsToFormat Whitelist of names of metrics to format.
+ */
+ public function formatMetrics(DataTable $dataTable, Report $report = null, $metricsToFormat = null)
+ {
+ $metrics = $this->getMetricsToFormat($dataTable, $report);
+ if (empty($metrics)
+ || $dataTable->getMetadata(self::PROCESSED_METRICS_FORMATTED_FLAG)
+ ) {
+ return;
+ }
+
+ $dataTable->setMetadata(self::PROCESSED_METRICS_FORMATTED_FLAG, true);
+
+ if ($metricsToFormat !== null) {
+ $metricMatchRegex = $this->makeRegexToMatchMetrics($metricsToFormat);
+ $metrics = array_filter($metrics, function (ProcessedMetric $metric) use ($metricMatchRegex) {
+ return preg_match($metricMatchRegex, $metric->getName());
+ });
+ }
+
+ foreach ($metrics as $name => $metric) {
+ if (!$metric->beforeFormat($report, $dataTable)) {
+ continue;
+ }
+
+ foreach ($dataTable->getRows() as $row) {
+ $columnValue = $row->getColumn($name);
+ if ($columnValue !== false) {
+ $row->setColumn($name, $metric->format($columnValue, $this));
+ }
+
+ $subtable = $row->getSubtable();
+ if (!empty($subtable)) {
+ $this->formatMetrics($subtable, $report, $metricsToFormat);
+ }
+ }
+ }
+ }
+
+ private function makeRegexToMatchMetrics($metricsToFormat)
+ {
+ $metricsRegexParts = array();
+ foreach ($metricsToFormat as $metricFilter) {
+ if ($metricFilter[0] == '/') {
+ $metricsRegexParts[] = '(?:' . substr($metricFilter, 1, strlen($metricFilter) - 2) . ')';
+ } else {
+ $metricsRegexParts[] = preg_quote($metricFilter);
+ }
+ }
+ return '/^' . implode('|', $metricsRegexParts) . '$/';
+ }
+
+ /**
+ * @param DataTable $dataTable
+ * @param Report $report
+ * @return Metric[]
+ */
+ private function getMetricsToFormat(DataTable $dataTable, Report $report = null)
+ {
+ return Report::getMetricsForTable($dataTable, $report, $baseType = 'Piwik\\Plugin\\Metric');
+ }
+} \ No newline at end of file
diff --git a/core/Metrics/Formatter/Html.php b/core/Metrics/Formatter/Html.php
new file mode 100644
index 0000000000..c4f9e05664
--- /dev/null
+++ b/core/Metrics/Formatter/Html.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Metrics\Formatter;
+
+use Piwik\Metrics\Formatter;
+
+/**
+ * Metrics formatter that formats for HTML output. Uses non-breaking spaces in formatted values
+ * so text will stay unbroken in HTML views.
+ */
+class Html extends Formatter
+{
+ public function getPrettyTimeFromSeconds($numberOfSeconds, $displayTimeAsSentence = true, $round = false)
+ {
+ $result = parent::getPrettyTimeFromSeconds($numberOfSeconds, $displayTimeAsSentence, $round);
+ $result = $this->replaceSpaceWithNonBreakingSpace($result);
+ return $result;
+ }
+
+ public function getPrettySizeFromBytes($size, $unit = null, $precision = 1)
+ {
+ $result = parent::getPrettySizeFromBytes($size, $unit, $precision);
+ $result = $this->replaceSpaceWithNonBreakingSpace($result);
+ return $result;
+ }
+
+ public function getPrettyMoney($value, $idSite)
+ {
+ $result = parent::getPrettyMoney($value, $idSite);
+ $result = $this->replaceSpaceWithNonBreakingSpace($result);
+ return $result;
+ }
+
+ private function replaceSpaceWithNonBreakingSpace($value)
+ {
+ return str_replace(' ', '&nbsp;', $value);
+ }
+} \ No newline at end of file
diff --git a/core/Metrics/Processed.php b/core/Metrics/Processed.php
deleted file mode 100644
index 0e6b7c969b..0000000000
--- a/core/Metrics/Processed.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Metrics;
-
-use Piwik\Metrics;
-use Piwik\DataTable\Row;
-use Piwik\DataTable;
-
-class Processed extends Base
-{
-
- public function getConversionRate(Row $row)
- {
- $nbVisits = $this->getNumVisits($row);
-
- $nbVisitsConverted = (int) $this->getColumn($row, Metrics::INDEX_NB_VISITS_CONVERTED);
- if ($nbVisitsConverted > 0) {
- $conversionRate = round(100 * $nbVisitsConverted / $nbVisits, $this->roundPrecision);
-
- return $conversionRate . '%';
- }
- }
-
- public function getActionsPerVisit(Row $row)
- {
- $nbVisits = $this->getNumVisits($row);
- $nbActions = $this->getColumn($row, Metrics::INDEX_NB_ACTIONS);
-
- if ($nbVisits == 0) {
- return $this->invalidDivision;
- }
-
- return round($nbActions / $nbVisits, $this->roundPrecision);
- }
-
- public function getAvgTimeOnSite(Row $row)
- {
- $nbVisits = $this->getNumVisits($row);
-
- if ($nbVisits == 0) {
- return $this->invalidDivision;
- }
-
- $visitLength = $this->getColumn($row, Metrics::INDEX_SUM_VISIT_LENGTH);
-
- return round($visitLength / $nbVisits, $rounding = 0);
- }
-
- public function getBounceRate(Row $row)
- {
- $nbVisits = $this->getNumVisits($row);
-
- if ($nbVisits == 0) {
- return $this->invalidDivision;
- }
-
- $bounceRate = round(100 * $this->getColumn($row, Metrics::INDEX_BOUNCE_COUNT) / $nbVisits, $this->roundPrecision);
-
- return $bounceRate . "%";
- }
-
-} \ No newline at end of file
diff --git a/core/Metrics/ProcessedGoals.php b/core/Metrics/ProcessedGoals.php
deleted file mode 100644
index 6fb62231f3..0000000000
--- a/core/Metrics/ProcessedGoals.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Metrics;
-
-use Piwik\Metrics;
-use Piwik\DataTable\Row;
-use Piwik\DataTable;
-use Piwik\Piwik;
-use Piwik\Tracker\GoalManager;
-
-class ProcessedGoals extends Base
-{
-
- public function getRevenuePerVisit(Row $row)
- {
- $goals = $this->getColumn($row, Metrics::INDEX_GOALS);
-
- $revenue = 0;
- foreach ($goals as $goalId => $goalMetrics) {
- if ($goalId == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART) {
- continue;
- }
- if ($goalId >= GoalManager::IDGOAL_ORDER
- || $goalId == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER
- ) {
- $revenue += (int) $this->getColumn($goalMetrics, Metrics::INDEX_GOAL_REVENUE, Metrics::$mappingFromIdToNameGoal);
- }
- }
-
- if ($revenue == 0) {
- $revenue = (int) $this->getColumn($row, Metrics::INDEX_REVENUE);
- }
-
- $nbVisits = $this->getNumVisits($row);
- $conversions = (int) $this->getColumn($row, Metrics::INDEX_NB_CONVERSIONS);
-
- // If no visit for this metric, but some conversions, we still want to display some kind of "revenue per visit"
- // even though it will actually be in this edge case "Revenue per conversion"
- $revenuePerVisit = $this->invalidDivision;
-
- if ($nbVisits > 0
- || $conversions > 0
- ) {
- $revenuePerVisit = round($revenue / ($nbVisits == 0 ? $conversions : $nbVisits), GoalManager::REVENUE_PRECISION);
- }
-
- return $revenuePerVisit;
- }
-
- public function getConversionRate(Row $row, $goalMetrics)
- {
- $nbVisits = $this->getNumVisits($row);
-
- if ($nbVisits == 0) {
- $value = $this->invalidDivision;
- } else {
- $conversions = $this->getNbConversions($goalMetrics);
- $value = round(100 * $conversions / $nbVisits, GoalManager::REVENUE_PRECISION);
- }
-
- if (empty($value)) {
- return '0%';
- }
-
- return $value . "%";
- }
-
- public function getNbConversions($goalMetrics)
- {
- return (int) $this->getColumn($goalMetrics,
- Metrics::INDEX_GOAL_NB_CONVERSIONS,
- Metrics::$mappingFromIdToNameGoal);
- }
-
- public function getRevenue($goalMetrics)
- {
- return (float) $this->getColumn($goalMetrics,
- Metrics::INDEX_GOAL_REVENUE,
- Metrics::$mappingFromIdToNameGoal);
- }
-
- public function getRevenuePerVisitForGoal(Row $row, $goalMetrics)
- {
- $nbVisits = $this->getNumVisits($row);
-
- $div = $nbVisits;
- if ($nbVisits == 0) {
- $div = $this->getNbConversions($goalMetrics);
- }
-
- $goalRevenue = $this->getRevenue($goalMetrics);
-
- return round($goalRevenue / $div, GoalManager::REVENUE_PRECISION);
- }
-
- public function getAvgOrderRevenue($goalMetrics)
- {
- $goalRevenue = $this->getRevenue($goalMetrics);
- $conversions = $this->getNbConversions($goalMetrics);
-
- return $goalRevenue / $conversions;
- }
-
- public function getItems($goalMetrics)
- {
- $items = $this->getColumn($goalMetrics,
- Metrics::INDEX_GOAL_ECOMMERCE_ITEMS,
- Metrics::$mappingFromIdToNameGoal);
-
- if (empty($items)) {
- return 0;
- }
-
- return $items;
- }
-
-} \ No newline at end of file
diff --git a/core/MetricsFormatter.php b/core/MetricsFormatter.php
index 8554663525..daa8710fc6 100644
--- a/core/MetricsFormatter.php
+++ b/core/MetricsFormatter.php
@@ -4,251 +4,69 @@
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
*/
namespace Piwik;
-use Piwik\Tracker\GoalManager;
+use Piwik\Metrics\Formatter;
+use Piwik\Plugins\API\ProcessedReport;
/**
* Contains helper function that format numerical values in different ways.
*
- * @api
+ * @deprecated
*/
class MetricsFormatter
{
- /**
- * Returns a prettified string representation of a number. The result will have
- * thousands separators and a decimal point specific to the current locale, eg,
- * `'1,000,000.05'` or `'1.000.000,05'`.
- *
- * @param number $value
- * @return string
- */
- public static function getPrettyNumber($value)
- {
- static $decimalPoint = null;
- static $thousandsSeparator = null;
-
- if ($decimalPoint === null) {
- $locale = localeconv();
-
- $decimalPoint = $locale['decimal_point'];
- $thousandsSeparator = $locale['thousands_sep'];
- }
-
- return number_format($value, 0, $decimalPoint, $thousandsSeparator);
- }
+ private static $formatter = null;
+ private static $htmlFormatter = null;
- /**
- * Returns a prettified time value (in seconds).
- *
- * @param int $numberOfSeconds The number of seconds.
- * @param bool $displayTimeAsSentence If set to true, will output `"5min 17s"`, if false `"00:05:17"`.
- * @param bool $isHtml If true, replaces all spaces with `'&nbsp;'`.
- * @param bool $round Whether to round to the nearest second or not.
- * @return string
- */
- public static function getPrettyTimeFromSeconds($numberOfSeconds, $displayTimeAsSentence = true, $isHtml = true, $round = false)
+ public static function getFormatter($isHtml = false)
{
- $numberOfSeconds = $round ? (int)$numberOfSeconds : (float)$numberOfSeconds;
-
- $isNegative = false;
- if ($numberOfSeconds < 0) {
- $numberOfSeconds = -1 * $numberOfSeconds;
- $isNegative = true;
- }
-
- // Display 01:45:17 time format
- if ($displayTimeAsSentence === false) {
- $hours = floor($numberOfSeconds / 3600);
- $minutes = floor(($reminder = ($numberOfSeconds - $hours * 3600)) / 60);
- $seconds = floor($reminder - $minutes * 60);
- $time = sprintf("%02s", $hours) . ':' . sprintf("%02s", $minutes) . ':' . sprintf("%02s", $seconds);
- $centiSeconds = ($numberOfSeconds * 100) % 100;
- if ($centiSeconds) {
- $time .= '.' . sprintf("%02s", $centiSeconds);
- }
- if ($isNegative) {
- $time = '-' . $time;
+ if ($isHtml) {
+ if (self::$formatter === null) {
+ self::$formatter = new Formatter();
}
- return $time;
- }
- $secondsInYear = 86400 * 365.25;
-
- $years = floor($numberOfSeconds / $secondsInYear);
- $minusYears = $numberOfSeconds - $years * $secondsInYear;
- $days = floor($minusYears / 86400);
-
- $minusDays = $numberOfSeconds - $days * 86400;
- $hours = floor($minusDays / 3600);
-
- $minusDaysAndHours = $minusDays - $hours * 3600;
- $minutes = floor($minusDaysAndHours / 60);
-
- $seconds = $minusDaysAndHours - $minutes * 60;
- $precision = ($seconds > 0 && $seconds < 0.01 ? 3 : 2);
- $seconds = round($seconds, $precision);
-
- if ($years > 0) {
- $return = sprintf(Piwik::translate('General_YearsDays'), $years, $days);
- } elseif ($days > 0) {
- $return = sprintf(Piwik::translate('General_DaysHours'), $days, $hours);
- } elseif ($hours > 0) {
- $return = sprintf(Piwik::translate('General_HoursMinutes'), $hours, $minutes);
- } elseif ($minutes > 0) {
- $return = sprintf(Piwik::translate('General_MinutesSeconds'), $minutes, $seconds);
+ return self::$formatter;
} else {
- $return = sprintf(Piwik::translate('General_Seconds'), $seconds);
- }
-
- if ($isNegative) {
- $return = '-' . $return;
+ if (self::$htmlFormatter === null) {
+ self::$htmlFormatter = new Formatter\Html();
+ }
+ return self::$htmlFormatter;
}
+ }
- if ($isHtml) {
- return str_replace(' ', '&nbsp;', $return);
- }
+ public static function getPrettyNumber($value)
+ {
+ return self::getFormatter()->getPrettyNumber($value);
+ }
- return $return;
+ public static function getPrettyTimeFromSeconds($numberOfSeconds, $displayTimeAsSentence = true, $isHtml = true, $round = false)
+ {
+ return self::getFormatter($isHtml)->getPrettyTimeFromSeconds($numberOfSeconds, $displayTimeAsSentence, $round);
}
- /**
- * Returns a prettified memory size value.
- *
- * @param number $size The size in bytes.
- * @param string $unit The specific unit to use, if any. If null, the unit is determined by $size.
- * @param int $precision The precision to use when rounding.
- * @return string eg, `'128 M'` or `'256 K'`.
- */
public static function getPrettySizeFromBytes($size, $unit = null, $precision = 1)
{
- if ($size == 0) {
- return '0 M';
- }
-
- $units = array('B', 'K', 'M', 'G', 'T');
- foreach ($units as $currentUnit) {
- if ($size >= 1024 && $unit != $currentUnit) {
- $size = $size / 1024;
- } else {
- break;
- }
- }
-
- return round($size, $precision) . " " . $currentUnit;
+ return self::getFormatter()->getPrettySizeFromBytes($size, $unit, $precision);
}
- /**
- * Returns a pretty formated monetary value using the currency associated with a site.
- *
- * @param int|string $value The monetary value to format.
- * @param int $idSite The ID of the site whose currency will be used.
- * @param bool $isHtml If true, replaces all spaces with `'&nbsp;'`.
- * @return string
- */
public static function getPrettyMoney($value, $idSite, $isHtml = true)
{
- $currencyBefore = MetricsFormatter::getCurrencySymbol($idSite);
-
- $space = ' ';
- if ($isHtml) {
- $space = '&nbsp;';
- }
-
- $currencyAfter = '';
- // (maybe more currencies prefer this notation?)
- $currencySymbolToAppend = array('€', 'kr', 'zł');
-
- // manually put the currency symbol after the amount
- if (in_array($currencyBefore, $currencySymbolToAppend)) {
- $currencyAfter = $space . $currencyBefore;
- $currencyBefore = '';
- }
-
- // if the input is a number (it could be a string or INPUT form),
- // and if this number is not an int, we round to precision 2
- if (is_numeric($value)) {
- if ($value == round($value)) {
- // 0.0 => 0
- $value = round($value);
- } else {
- $precision = GoalManager::REVENUE_PRECISION;
- $value = sprintf("%01." . $precision . "f", $value);
- }
- }
-
- $prettyMoney = $currencyBefore . $space . $value . $currencyAfter;
- return $prettyMoney;
+ return self::getFormatter($isHtml)->getPrettyMoney($value, $idSite);
}
- /**
- * Prettifies a metric value based on the column name.
- *
- * @param int $idSite The ID of the site the metric is for (used if the column value is an amount of money).
- * @param string $columnName The metric name.
- * @param mixed $value The metric value.
- * @param bool $isHtml If true, replaces all spaces with `'&nbsp;'`.
- * @return string
- */
public static function getPrettyValue($idSite, $columnName, $value, $isHtml)
{
- // Display time in human readable
- if (strpos($columnName, 'time') !== false) {
- // Little hack: Display 15s rather than 00:00:15, only for "(avg|min|max)_generation_time"
- $timeAsSentence = (substr($columnName, -16) == '_time_generation');
- return self::getPrettyTimeFromSeconds($value, $timeAsSentence);
- }
-
- // Add revenue symbol to revenues
- if (strpos($columnName, 'revenue') !== false && strpos($columnName, 'evolution') === false) {
- return self::getPrettyMoney($value, $idSite, $isHtml);
- }
-
- // Add % symbol to rates
- if (strpos($columnName, '_rate') !== false) {
- if (strpos($value, "%") === false) {
- return $value . "%";
- }
- }
-
- return $value;
+ return ProcessedReport::getPrettyValue(self::getFormatter($isHtml), $idSite, $columnName, $value);
}
- /**
- * Returns the currency symbol for a site.
- *
- * @param int $idSite The ID of the site to return the currency symbol for.
- * @return string eg, `'$'`.
- */
public static function getCurrencySymbol($idSite)
{
- $symbols = MetricsFormatter::getCurrencyList();
- $site = new Site($idSite);
- $currency = $site->getCurrency();
-
- if (isset($symbols[$currency])) {
- return $symbols[$currency][0];
- }
-
- return '';
+ return Formatter::getCurrencySymbol($idSite);
}
- /**
- * Returns the list of all known currency symbols.
- *
- * @return array An array mapping currency codes to their respective currency symbols
- * and a description, eg, `array('USD' => array('$', 'US dollar'))`.
- */
public static function getCurrencyList()
{
- static $currenciesList = null;
-
- if (is_null($currenciesList)) {
- require_once PIWIK_INCLUDE_PATH . '/core/DataFiles/Currencies.php';
- $currenciesList = $GLOBALS['Piwik_CurrencyList'];
- }
-
- return $currenciesList;
+ return Formatter::getCurrencyList();
}
}
diff --git a/core/Piwik.php b/core/Piwik.php
index 80ed01cd8c..bc5244dd52 100644
--- a/core/Piwik.php
+++ b/core/Piwik.php
@@ -112,10 +112,23 @@ class Piwik
*/
public static function getPercentageSafe($dividend, $divisor, $precision = 0)
{
+ return self::getQuotientSafe(100 * $dividend, $divisor, $precision);
+ }
+
+ /**
+ * Safely compute a ratio. Returns 0 if divisor is 0 (to avoid division by 0 error).
+ *
+ * @param number $dividend
+ * @param number $divisor
+ * @param int $precision
+ * @return number
+ */
+ public static function getQuotientSafe($dividend, $divisor, $precision = 0)
+ {
if ($divisor == 0) {
return 0;
}
- return round(100 * $dividend / $divisor, $precision);
+ return round($dividend / $divisor, $precision);
}
/**
diff --git a/core/Plugin/AggregatedMetric.php b/core/Plugin/AggregatedMetric.php
new file mode 100644
index 0000000000..7df1535727
--- /dev/null
+++ b/core/Plugin/AggregatedMetric.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugin;
+
+use Piwik\DataTable\Row;
+
+/**
+ * Base type for metric metadata classes that describe aggregated metrics. These metrics are
+ * computed in the backend data store and are aggregated in PHP when Piwik archives period reports.
+ *
+ * Note: This class is a placeholder. It will be filled out at a later date. Right now, only
+ * processed metrics can be defined this way.
+ */
+abstract class AggregatedMetric extends Metric
+{
+ // stub, to be filled out later
+} \ No newline at end of file
diff --git a/core/Plugin/ComponentFactory.php b/core/Plugin/ComponentFactory.php
index 9cb9cd1c1b..68415e9397 100644
--- a/core/Plugin/ComponentFactory.php
+++ b/core/Plugin/ComponentFactory.php
@@ -74,7 +74,7 @@ class ComponentFactory
* @param callback $predicate
* @return mixed The component that satisfies $predicate or null if not found.
*/
- public static function getComponentif ($componentTypeClass, $pluginName, $predicate)
+ public static function getComponentIf($componentTypeClass, $pluginName, $predicate)
{
$pluginManager = PluginManager::getInstance();
diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php
index 746395e88e..008cb4d2f4 100644
--- a/core/Plugin/ControllerAdmin.php
+++ b/core/Plugin/ControllerAdmin.php
@@ -131,7 +131,7 @@ abstract class ControllerAdmin extends Controller
$message = sprintf("You are using the PHP accelerator & optimizer eAccelerator which is known to be not compatible with Piwik.
We have disabled eAccelerator, which might affect the performance of Piwik.
Read the %srelated ticket%s for more information and how to fix this problem.",
- '<a target="_blank" href="https://github.com/piwik/piwik/issues/4439">', '</a>');
+ '<a rel="noreferrer" target="_blank" href="https://github.com/piwik/piwik/issues/4439">', '</a>');
$notification = new Notification($message);
$notification->context = Notification::CONTEXT_WARNING;
diff --git a/core/Plugin/Metric.php b/core/Plugin/Metric.php
new file mode 100644
index 0000000000..e475eb837f
--- /dev/null
+++ b/core/Plugin/Metric.php
@@ -0,0 +1,179 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugin;
+
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Metrics;
+use Piwik\Metrics\Formatter;
+
+/**
+ * Base type of metric metadata classes.
+ *
+ * A metric metadata class is a class that describes how a metric is described, computed and
+ * formatted.
+ *
+ * There are two types of metrics: aggregated and processed. An aggregated metric is computed
+ * in the backend datastore and aggregated in PHP when archiving period reports.
+ *
+ * Currently, only processed metrics can be defined as metric metadata classes. Support for
+ * aggregated metrics will be added at a later date.
+ *
+ * See {@link Piwik\Plugin\ProcessedMetric} and {@link Piwik\Plugin|AggregatedMetric}.
+ *
+ * @api
+ */
+abstract class Metric
+{
+ /**
+ * The sub-namespace name in a plugin where Metric components are stored.
+ */
+ const COMPONENT_SUBNAMESPACE = 'Metrics';
+
+ /**
+ * Returns the column name of this metric, eg, `"nb_visits"` or `"avg_time_on_site"`.
+ *
+ * This string is what appears in API output.
+ *
+ * @return string
+ */
+ abstract public function getName();
+
+ /**
+ * Returns the human readable translated name of this metric, eg, `"Visits"` or `"Avg. time on site"`.
+ *
+ * This string is what appears in the UI.
+ *
+ * @return string
+ */
+ abstract public function getTranslatedName();
+
+ /**
+ * Returns a string describing what the metric represents. The result will be included in report metadata
+ * API output, including processed reports.
+ *
+ * Implementing this method is optional.
+ *
+ * @return string
+ */
+ public function getDocumentation()
+ {
+ return "";
+ }
+
+ /**
+ * Returns a formatted metric value. This value is what appears in API output. From within Piwik,
+ * (core & plugins) the computed value is used. Only when outputting to the API does a metric
+ * get formatted.
+ *
+ * By default, just returns the value.
+ *
+ * @param mixed $value The metric value.
+ * @param Formatter $formatter The formatter to use when formatting a value.
+ * @return mixed $value
+ */
+ public function format($value, Formatter $formatter)
+ {
+ return $value;
+ }
+
+ /**
+ * Executed before formatting all metrics for a report. Implementers can return `false`
+ * to skip formatting this metric and can use this method to access information needed for
+ * formatting (for example, the site ID).
+ *
+ * @param Report $report
+ * @param DataTable $table
+ * @return bool Return `true` to format the metric for the table, `false` to skip formatting.
+ */
+ public function beforeFormat($report, DataTable $table)
+ {
+ return true;
+ }
+
+ /**
+ * Helper method that will access a metric in a {@link Piwik\DataTable\Row} or array either by
+ * its name or by its special numerical index value.
+ *
+ * @param Row|array $row
+ * @param string $columnName
+ * @param int[]|null $mappingNameToId A custom mapping of metric names to special index values. By
+ * default {@link Metrics::getMappingFromNameToId()} is used.
+ * @return mixed The metric value or false if none exists.
+ */
+ public static function getMetric($row, $columnName, $mappingNameToId = null)
+ {
+ if (empty($mappingNameToId)) {
+ $mappingNameToId = Metrics::getMappingFromNameToId();
+ }
+
+ if ($row instanceof Row) {
+ $value = $row->getColumn($columnName);
+ if ($value === false
+ && isset($mappingNameToId[$columnName])
+ ) {
+ $value = $row->getColumn($mappingNameToId[$columnName]);
+ }
+ } else {
+ $value = @$row[$columnName];
+ if ($value === null
+ && isset($mappingNameToId[$columnName])
+ ) {
+ $columnName = $mappingNameToId[$columnName];
+ $value = @$row[$columnName];
+ }
+ return $value;
+ }
+
+ return $value;
+ }
+
+ /**
+ * Helper method that will determine the actual column name for a metric in a
+ * {@link Piwik\DataTable} and return every column value for this name.
+ *
+ * @param DataTable $table
+ * @param string $columnName
+ * @param int[]|null $mappingNameToId A custom mapping of metric names to special index values. By
+ * default {@link Metrics::getMappingFromNameToId()} is used.
+ * @return array
+ */
+ public static function getMetricValues(DataTable $table, $columnName, $mappingNameToId = null)
+ {
+ if (empty($mappingIdToName)) {
+ $mappingNameToId = Metrics::getMappingFromNameToId();
+ }
+
+ $columnName = self::getActualMetricColumn($table, $columnName, $mappingNameToId);
+ return $table->getColumn($columnName);
+ }
+
+ /**
+ * Helper method that determines the actual column for a metric in a {@link Piwik\DataTable}.
+ *
+ * @param DataTable $table
+ * @param string $columnName
+ * @param int[]|null $mappingNameToId A custom mapping of metric names to special index values. By
+ * default {@link Metrics::getMappingFromNameToId()} is used.
+ * @return string
+ */
+ public static function getActualMetricColumn(DataTable $table, $columnName, $mappingNameToId = null)
+ {
+ if (empty($mappingIdToName)) {
+ $mappingNameToId = Metrics::getMappingFromNameToId();
+ }
+
+ $firstRow = $table->getFirstRow();
+ if (!empty($firstRow)
+ && $firstRow->getColumn($columnName) === false
+ ) {
+ $columnName = $mappingNameToId[$columnName];
+ }
+ return $columnName;
+ }
+} \ No newline at end of file
diff --git a/core/Plugin/ProcessedMetric.php b/core/Plugin/ProcessedMetric.php
new file mode 100644
index 0000000000..20201d0887
--- /dev/null
+++ b/core/Plugin/ProcessedMetric.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugin;
+
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+
+/**
+ * Base type for processed metrics. A processed metric is a metric that is computed using
+ * one or more other metrics.
+ *
+ * @api
+ */
+abstract class ProcessedMetric extends Metric
+{
+ /**
+ * The sub-namespace name in a plugin where ProcessedMetrics are stored.
+ */
+ const COMPONENT_SUBNAMESPACE = 'Columns\\Metrics';
+
+ /**
+ * Computes the metric using the values in a {@link Piwik\DataTable\Row}.
+ *
+ * The computed value should be numerical and not formatted in any way. For example, for
+ * a percent value, `0.14` should be returned instead of `"14%"`.
+ *
+ * @return mixed
+ */
+ abstract public function compute(Row $row);
+
+ /**
+ * Returns the array of metrics that are necessary for computing this metric. The elements
+ * of the array are metric names.
+ *
+ * @return string[]
+ */
+ abstract public function getDependentMetrics();
+
+ /**
+ * Returns the array of metrics that are necessary for computing this metric, but should not
+ * be displayed to the user unless explicitly requested. These metrics are intermediate
+ * metrics that are not really valuable to the user. On a request, if showColumns or hideColumns
+ * is not used, they will be removed automatically.
+ *
+ * @return string[]
+ */
+ public function getTemporaryMetrics()
+ {
+ return array();
+ }
+
+ /**
+ * Executed before computing all processed metrics for a report. Implementers can return `false`
+ * to skip computing this metric.
+ *
+ * @param Report $report
+ * @param DataTable $table
+ * @return bool Return `true` to compute the metric for the table, `false` to skip computing
+ * this metric.
+ */
+ public function beforeCompute($report, DataTable $table)
+ {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/core/Plugin/Report.php b/core/Plugin/Report.php
index c30e731d46..1824b6774f 100644
--- a/core/Plugin/Report.php
+++ b/core/Plugin/Report.php
@@ -119,7 +119,7 @@ class Report
* platform default processed metrics, see {@link Metrics::getDefaultProcessedMetrics()}. Set it to boolean `false`
* if your report does not support any processed metrics at all. Otherwise an array of metric names.
* Eg `array('avg_time_on_site', 'nb_actions_per_visit', ...)`
- * @var array|false
+ * @var array
* @api
*/
protected $processedMetrics = array('nb_actions_per_visit', 'avg_time_on_site', 'bounce_rate', 'conversion_rate');
@@ -196,6 +196,7 @@ class Report
'General_Visitors',
'DevicesDetection_DevicesDetection',
'UserSettings_VisitorSettings',
+ 'API'
);
/**
@@ -359,6 +360,44 @@ class Report
}
/**
+ * Returns the list of metrics required at minimum for a report factoring in the columns requested by
+ * the report requester.
+ *
+ * This will return all the metrics requested (or all the metrics in the report if nothing is requested)
+ * **plus** the metrics required to calculate the requested processed metrics.
+ *
+ * This method should be used in **Plugin.get** API methods.
+ *
+ * @param string[]|null $allMetrics The list of all available unprocessed metrics. Defaults to this report's
+ * metrics.
+ * @param string[]|null $restrictToColumns The requested columns.
+ * @return string[]
+ */
+ public function getMetricsRequiredForReport($allMetrics = null, $restrictToColumns = null)
+ {
+ if (empty($allMetrics)) {
+ $allMetrics = $this->metrics;
+ }
+
+ if (empty($restrictToColumns)) {
+ $restrictToColumns = array_merge($allMetrics, array_keys($this->getProcessedMetrics()));
+ }
+
+ $processedMetricsById = $this->getProcessedMetricsById();
+ $metricsSet = array_flip($allMetrics);
+
+ $metrics = array();
+ foreach ($restrictToColumns as $column) {
+ if (isset($processedMetricsById[$column])) {
+ $metrics = array_merge($metrics, $processedMetricsById[$column]->getDependentMetrics());
+ } else if (isset($metricsSet[$column])) {
+ $metrics[] = $column;
+ }
+ }
+ return array_unique($metrics);
+ }
+
+ /**
* Returns an array of supported processed metrics and their corresponding translations. Eg
* `array('nb_visits' => 'Visits')`. By default the given {@link $processedMetrics} are used and their
* corresponding translations are looked up automatically. If a metric is not translated, you should add the
@@ -378,6 +417,18 @@ class Report
}
/**
+ * Returns the array of all metrics displayed by this report.
+ *
+ * @return array
+ * @api
+ */
+ public function getAllMetrics()
+ {
+ $processedMetrics = $this->getProcessedMetrics() ?: array();
+ return array_keys(array_merge($this->getMetrics(), $processedMetrics));
+ }
+
+ /**
* Returns an array of metric documentations and their corresponding translations. Eg
* `array('nb_visits' => 'If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after...')`.
* By default the given {@link $metrics} are used and their corresponding translations are looked up automatically.
@@ -399,6 +450,23 @@ class Report
}
}
+ $processedMetrics = $this->processedMetrics ?: array();
+ foreach ($processedMetrics as $processedMetric) {
+ if (!($processedMetric instanceof ProcessedMetric)) {
+ continue;
+ }
+
+ $name = $processedMetric->getName();
+ $metricDocs = $processedMetric->getDocumentation();
+ if (empty($metricDocs)) {
+ $metricDocs = @$translations[$name];
+ }
+
+ if (!empty($metricDocs)) {
+ $documentation[$processedMetric->getName()] = $metricDocs;
+ }
+ }
+
return $documentation;
}
@@ -666,7 +734,7 @@ class Report
*/
public static function getAllReports()
{
- $reports = PluginManager::getInstance()->findMultipleComponents('Reports', '\\Piwik\\Plugin\\Report');
+ $reports = self::getAllReportClasses();
$cache = new LanguageAwareStaticCache('Reports' . implode('', $reports));
if (!$cache->has()) {
@@ -685,6 +753,17 @@ class Report
}
/**
+ * Returns class names of all Report metadata classes.
+ *
+ * @return string[]
+ * @api
+ */
+ public static function getAllReportClasses()
+ {
+ return PluginManager::getInstance()->findMultipleComponents('Reports', '\\Piwik\\Plugin\\Report');
+ }
+
+ /**
* API metadata are sorted by category/name,
* with a little tweak to replicate the standard Piwik category ordering
*
@@ -705,11 +784,15 @@ class Report
$metrics = array();
foreach ($metricsToTranslate as $metric) {
- if (!empty($translations[$metric])) {
- $metrics[$metric] = $translations[$metric];
+ if ($metric instanceof Metric) {
+ $metricName = $metric->getName();
+ $translation = $metric->getTranslatedName();
} else {
- $metrics[$metric] = $metric;
+ $metricName = $metric;
+ $translation = @$translations[$metric];
}
+
+ $metrics[$metricName] = $translation ?: $metricName;
}
return $metrics;
@@ -738,10 +821,76 @@ class Report
*/
public static function getForDimension(Dimension $dimension)
{
- return ComponentFactory::getComponentif (__CLASS__, $dimension->getModule(), function (Report $report) use ($dimension) {
+ return ComponentFactory::getComponentIf(__CLASS__, $dimension->getModule(), function (Report $report) use ($dimension) {
return !$report->isSubtableReport()
&& $report->getDimension()
&& $report->getDimension()->getId() == $dimension->getId();
});
}
-}
+
+ /**
+ * Returns an array mapping the ProcessedMetrics served by this report by their string names.
+ *
+ * @return ProcessedMetric[]
+ */
+ public function getProcessedMetricsById()
+ {
+ $processedMetrics = $this->processedMetrics ?: array();
+
+ $result = array();
+ foreach ($processedMetrics as $processedMetric) {
+ if ($processedMetric instanceof ProcessedMetric) { // instanceof check for backwards compatibility
+ $result[$processedMetric->getName()] = $processedMetric;
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * Returns the Metrics that are displayed by a DataTable of a certain Report type.
+ *
+ * Includes ProcessedMetrics and Metrics.
+ *
+ * @param DataTable $dataTable
+ * @param Report|null $report
+ * @param string $baseType The base type each metric class needs to be of.
+ * @return Metric[]
+ * @api
+ */
+ public static function getMetricsForTable(DataTable $dataTable, Report $report = null, $baseType = 'Piwik\\Plugin\\Metric')
+ {
+ $metrics = $dataTable->getMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME) ?: array();
+
+ if (!empty($report)) {
+ $metrics = array_merge($metrics, $report->getProcessedMetricsById());
+ }
+
+ $result = array();
+
+ /** @var Metric $metric */
+ foreach ($metrics as $metric) {
+ if (!($metric instanceof $baseType)) {
+ continue;
+ }
+
+ $result[$metric->getName()] = $metric;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Returns the ProcessedMetrics that should be computed and formatted for a DataTable of a
+ * certain report. The ProcessedMetrics returned are those specified by the Report metadata
+ * as well as the DataTable metadata.
+ *
+ * @param DataTable $dataTable
+ * @param Report|null $report
+ * @return ProcessedMetric[]
+ * @api
+ */
+ public static function getProcessedMetricsForTable(DataTable $dataTable, Report $report = null)
+ {
+ return self::getMetricsForTable($dataTable, $report, 'Piwik\\Plugin\\ProcessedMetric');
+ }
+} \ No newline at end of file
diff --git a/core/Plugin/Visualization.php b/core/Plugin/Visualization.php
index 938bcb7a4d..7e6aec2eaa 100644
--- a/core/Plugin/Visualization.php
+++ b/core/Plugin/Visualization.php
@@ -9,11 +9,12 @@
namespace Piwik\Plugin;
+use Piwik\API\DataTablePostProcessor;
use Piwik\Common;
use Piwik\DataTable;
use Piwik\Date;
use Piwik\Log;
-use Piwik\MetricsFormatter;
+use Piwik\Metrics\Formatter\Html as HtmlFormatter;
use Piwik\NoAccessException;
use Piwik\Option;
use Piwik\Period;
@@ -143,6 +144,12 @@ class Visualization extends ViewDataTable
private $templateVars = array();
private $reportLastUpdatedMessage = null;
private $metadata = null;
+ protected $metricsFormatter = null;
+
+ /**
+ * @var Report
+ */
+ protected $report;
final public function __construct($controllerAction, $apiMethodToRequestDataTable, $params = array())
{
@@ -152,7 +159,11 @@ class Visualization extends ViewDataTable
throw new \Exception('You have not defined a constant named TEMPLATE_FILE in your visualization class.');
}
+ $this->metricsFormatter = new HtmlFormatter();
+
parent::__construct($controllerAction, $apiMethodToRequestDataTable, $params);
+
+ $this->report = Report::factory($this->requestConfig->getApiModuleToRequest(), $this->requestConfig->getApiMethodToRequest());
}
protected function buildView()
@@ -160,20 +171,19 @@ class Visualization extends ViewDataTable
$this->overrideSomeConfigPropertiesIfNeeded();
try {
-
$this->beforeLoadDataTable();
- $this->loadDataTableFromAPI(array('disable_generic_filters' => 1));
+ $this->loadDataTableFromAPI(array('disable_generic_filters' => 1, 'format_metrics' => 0));
$this->postDataTableLoadedFromAPI();
$requestPropertiesAfterLoadDataTable = $this->requestConfig->getProperties();
$this->applyFilters();
+ $this->addVisualizationInfoFromMetricMetadata();
$this->afterAllFiltersAreApplied();
$this->beforeRender();
$this->logMessageIfRequestPropertiesHaveChanged($requestPropertiesAfterLoadDataTable);
-
} catch (NoAccessException $e) {
throw $e;
} catch (\Exception $e) {
@@ -306,6 +316,27 @@ class Visualization extends ViewDataTable
}
}
+ private function addVisualizationInfoFromMetricMetadata()
+ {
+ $dataTable = $this->dataTable instanceof DataTable\Map ? $this->dataTable->getFirstRow() : $this->dataTable;
+
+ $metrics = Report::getMetricsForTable($dataTable, $this->report);
+
+ // TODO: instead of iterating & calling translate everywhere, maybe we can get all translated names in one place.
+ // may be difficult, though, since translated metrics are specific to the report.
+ foreach ($metrics as $metric) {
+ $name = $metric->getName();
+
+ if (empty($this->config->translations[$name])) {
+ $this->config->translations[$name] = $metric->getTranslatedName();
+ }
+
+ if (empty($this->config->metrics_documentation[$name])) {
+ $this->config->metrics_documentation[$name] = $metric->getDocumentation();
+ }
+ }
+ }
+
private function applyFilters()
{
list($priorityFilters, $otherFilters) = $this->config->getFiltersToRun();
@@ -322,10 +353,14 @@ class Visualization extends ViewDataTable
$this->requestConfig->setDefaultSort($this->config->columns_to_display, $hasNbUniqVisitors, $this->dataTable->getColumns());
}
+ $postProcessor = $this->makeDataTablePostProcessor(); // must be created after requestConfig is final
+
if (!$this->requestConfig->areGenericFiltersDisabled()) {
- $this->applyGenericFilters();
+ $this->dataTable = $postProcessor->applyGenericFilters($this->dataTable);
}
+ $postProcessor->applyComputeProcessedMetrics($this->dataTable);
+
$this->afterGenericFiltersAreAppliedToLoadedDataTable();
// queue other filters so they can be applied later if queued filters are disabled
@@ -338,6 +373,12 @@ class Visualization extends ViewDataTable
if (!$this->requestConfig->areQueuedFiltersDisabled()) {
$this->dataTable->applyQueuedFilters();
}
+
+ $formatter = $this->metricsFormatter;
+ $report = $this->report;
+ $this->dataTable->filter(function (DataTable $table) use ($formatter, $report) {
+ $formatter->formatMetrics($table, $report);
+ });
}
private function removeEmptyColumnsFromDisplay()
@@ -372,9 +413,8 @@ class Visualization extends ViewDataTable
$today = mktime(0, 0, 0);
if ($date->getTimestamp() > $today) {
-
$elapsedSeconds = time() - $date->getTimestamp();
- $timeAgo = MetricsFormatter::getPrettyTimeFromSeconds($elapsedSeconds);
+ $timeAgo = $this->metricsFormatter->getPrettyTimeFromSeconds($elapsedSeconds);
return Piwik::translate('CoreHome_ReportGeneratedXAgo', $timeAgo);
}
@@ -567,10 +607,7 @@ class Visualization extends ViewDataTable
// eg $this->config->showFooterColumns = true;
}
- /**
- * Second, generic filters (Sort, Limit, Replace Column Names, etc.)
- */
- private function applyGenericFilters()
+ private function makeDataTablePostProcessor()
{
$requestArray = $this->request->getRequestArray();
$request = \Piwik\API\Request::getRequestArrayFromString($requestArray);
@@ -580,8 +617,7 @@ class Visualization extends ViewDataTable
$request['filter_sort_order'] = '';
}
- $genericFilter = new \Piwik\API\DataTableGenericFilter($request);
- $genericFilter->filter($this->dataTable);
+ return new DataTablePostProcessor($this->requestConfig->getApiModuleToRequest(), $this->requestConfig->getApiMethodToRequest(), $request);
}
private function logMessageIfRequestPropertiesHaveChanged(array $requestPropertiesBefore)
diff --git a/core/Session.php b/core/Session.php
index d55d399bbe..a002243f70 100644
--- a/core/Session.php
+++ b/core/Session.php
@@ -121,7 +121,7 @@ class Session extends Zend_Session
$enableDbSessions = '';
if (DbHelper::isInstalled()) {
$enableDbSessions = "<br/>If you still experience issues after trying these changes,
- we recommend that you <a href='http://piwik.org/faq/how-to-install/#faq_133' target='_blank'>enable database session storage</a>.";
+ we recommend that you <a href='http://piwik.org/faq/how-to-install/#faq_133' rel='noreferrer' target='_blank'>enable database session storage</a>.";
}
$pathToSessions = Filechecks::getErrorMessageMissingPermissions(Filesystem::getPathToPiwikRoot() . '/tmp/sessions/');
diff --git a/core/Timer.php b/core/Timer.php
index 82addaa1cd..c7401677bf 100644
--- a/core/Timer.php
+++ b/core/Timer.php
@@ -7,6 +7,7 @@
*
*/
namespace Piwik;
+use Piwik\Metrics\Formatter;
/**
*
@@ -15,12 +16,15 @@ class Timer
{
private $timerStart;
private $memoryStart;
+ private $formatter;
/**
* @return \Piwik\Timer
*/
public function __construct()
{
+ $this->formatter = new Formatter();
+
$this->init();
}
@@ -56,7 +60,7 @@ class Timer
*/
public function getMemoryLeak()
{
- return "Memory delta: " . MetricsFormatter::getPrettySizeFromBytes($this->getMemoryUsage() - $this->memoryStart);
+ return "Memory delta: " . $this->formatter->getPrettySizeFromBytes($this->getMemoryUsage() - $this->memoryStart);
}
/**
diff --git a/core/Twig.php b/core/Twig.php
index 1ce277e235..1127d47a60 100755
--- a/core/Twig.php
+++ b/core/Twig.php
@@ -11,6 +11,7 @@ namespace Piwik;
use Exception;
use Piwik\Container\StaticContainer;
use Piwik\DataTable\Filter\SafeDecodeLabel;
+use Piwik\Metrics\Formatter;
use Piwik\Translate;
use Piwik\View\RenderTokenParser;
use Piwik\Visualization\Sparkline;
@@ -35,6 +36,8 @@ class Twig
*/
private $twig;
+ private $formatter;
+
public function __construct()
{
$loader = $this->getDefaultThemeLoader();
@@ -45,6 +48,8 @@ class Twig
$theme = $manager->getThemeEnabled();
$loaders = array();
+ $this->formatter = new Formatter();
+
//create loader for custom theme to overwrite twig templates
if ($theme && $theme->getPluginName() != \Piwik\Plugin\Manager::DEFAULT_THEME) {
$customLoader = $this->getCustomThemeLoader($theme);
@@ -272,21 +277,23 @@ class Twig
protected function addFilter_money()
{
- $moneyFilter = new Twig_SimpleFilter('money', function ($amount) {
+ $formatter = $this->formatter;
+ $moneyFilter = new Twig_SimpleFilter('money', function ($amount) use ($formatter) {
if (func_num_args() != 2) {
throw new Exception('the money modifier expects one parameter: the idSite.');
}
$idSite = func_get_args();
$idSite = $idSite[1];
- return MetricsFormatter::getPrettyMoney($amount, $idSite);
+ return $formatter->getPrettyMoney($amount, $idSite);
});
$this->twig->addFilter($moneyFilter);
}
protected function addFilter_sumTime()
{
- $sumtimeFilter = new Twig_SimpleFilter('sumtime', function ($numberOfSeconds) {
- return MetricsFormatter::getPrettyTimeFromSeconds($numberOfSeconds);
+ $formatter = $this->formatter;
+ $sumtimeFilter = new Twig_SimpleFilter('sumtime', function ($numberOfSeconds) use ($formatter) {
+ return $formatter->getPrettyTimeFromSeconds($numberOfSeconds, true);
});
$this->twig->addFilter($sumtimeFilter);
}
diff --git a/core/Updates/0.6-rc1.php b/core/Updates/0.6-rc1.php
index 9f293dda97..9a946251ad 100644
--- a/core/Updates/0.6-rc1.php
+++ b/core/Updates/0.6-rc1.php
@@ -42,8 +42,8 @@ class Updates_0_6_rc1 extends Updates
{
// first we disable the plugins and keep an array of warnings messages
$pluginsToDisableMessage = array(
- 'SearchEnginePosition' => "SearchEnginePosition plugin was disabled, because it is not compatible with the new Piwik 0.6. \n You can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/502'>Click here.</a>",
- 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 0.6. \nYou can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/45'>Click here.</a>"
+ 'SearchEnginePosition' => "SearchEnginePosition plugin was disabled, because it is not compatible with the new Piwik 0.6. \n You can download the latest version of the plugin, compatible with Piwik 0.6.\n<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/502'>Click here.</a>",
+ 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 0.6. \nYou can download the latest version of the plugin, compatible with Piwik 0.6.\n<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/45'>Click here.</a>"
);
$disabledPlugins = array();
foreach ($pluginsToDisableMessage as $pluginToDisable => $warningMessage) {
diff --git a/core/Updates/1.2-rc1.php b/core/Updates/1.2-rc1.php
index e268ad8570..658dffeb27 100644
--- a/core/Updates/1.2-rc1.php
+++ b/core/Updates/1.2-rc1.php
@@ -129,7 +129,7 @@ class Updates_1_2_rc1 extends Updates
{
// first we disable the plugins and keep an array of warnings messages
$pluginsToDisableMessage = array(
- 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 1.2. \nYou can download the latest version of the plugin, compatible with Piwik 1.2.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/45'>Click here.</a>",
+ 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 1.2. \nYou can download the latest version of the plugin, compatible with Piwik 1.2.\n<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/45'>Click here.</a>",
'EntryPage' => "EntryPage plugin is not compatible with this version of Piwik, it was disabled.",
);
$disabledPlugins = array();
diff --git a/core/testMinimumPhpVersion.php b/core/testMinimumPhpVersion.php
index a24780077d..eec5a50d1b 100644
--- a/core/testMinimumPhpVersion.php
+++ b/core/testMinimumPhpVersion.php
@@ -52,11 +52,11 @@ if ($minimumPhpInvalid) {
$composerInstall = "Download and run <a href=\"https://getcomposer.org/Composer-Setup.exe\"><b>Composer-Setup.exe</b></a>, it will install the latest Composer version and set up your PATH so that you can just call composer from any directory in your command line. "
. " <br>Then run this command in a terminal in the piwik directory: <br> $ php composer.phar update ";
}
- $piwik_errorMessage .= "<p>It appears the <a href='https://getcomposer.org/' target='_blank'>composer</a> tool is not yet installed. You can install Composer in a few easy steps:\n\n".
+ $piwik_errorMessage .= "<p>It appears the <a href='https://getcomposer.org/' rel='noreferrer' target='_blank'>composer</a> tool is not yet installed. You can install Composer in a few easy steps:\n\n".
"<br/>" . $composerInstall.
" This will initialize composer for Piwik and download libraries we use in vendor/* directory.".
"\n\n<br/><br/>Then reload this page to access your analytics reports." .
- "\n\n<br/><br/>For more information check out this FAQ: <a href='http://piwik.org/faq/how-to-install/faq_18271/' target='_blank'>How do I use Piwik from the Git repository?</a>." .
+ "\n\n<br/><br/>For more information check out this FAQ: <a href='http://piwik.org/faq/how-to-install/faq_18271/' rel='noreferrer' target='_blank'>How do I use Piwik from the Git repository?</a>." .
"\n\n<br/><br/>Note: if for some reasons you cannot install composer, instead install the latest Piwik release from ".
"<a href='http://builds.piwik.org/piwik.zip'>builds.piwik.org</a>.</p>";
}
@@ -122,11 +122,11 @@ if (!function_exists('Piwik_GetErrorMessagePage')) {
if ($optionalLinks) {
$optionalLinks = '<ul>
- <li><a target="_blank" href="http://piwik.org">Piwik.org homepage</a></li>
- <li><a target="_blank" href="http://piwik.org/faq/">Piwik Frequently Asked Questions</a></li>
- <li><a target="_blank" href="http://piwik.org/docs/">Piwik Documentation</a></li>
- <li><a target="_blank" href="http://forum.piwik.org/">Piwik Forums</a></li>
- <li><a target="_blank" href="http://demo.piwik.org">Piwik Online Demo</a></li>
+ <li><a rel="noreferrer" target="_blank" href="http://piwik.org">Piwik.org homepage</a></li>
+ <li><a rel="noreferrer" target="_blank" href="http://piwik.org/faq/">Piwik Frequently Asked Questions</a></li>
+ <li><a rel="noreferrer" target="_blank" href="http://piwik.org/docs/">Piwik Documentation</a></li>
+ <li><a rel="noreferrer" target="_blank" href="http://forum.piwik.org/">Piwik Forums</a></li>
+ <li><a rel="noreferrer" target="_blank" href="http://demo.piwik.org">Piwik Online Demo</a></li>
</ul>';
}
if ($optionalLinkBack) {
diff --git a/plugins/API/API.php b/plugins/API/API.php
index c65c04fffe..f9f60dd261 100644
--- a/plugins/API/API.php
+++ b/plugins/API/API.php
@@ -30,7 +30,7 @@ use Piwik\Version;
require_once PIWIK_INCLUDE_PATH . '/core/Config.php';
/**
- * This API is the <a href='http://piwik.org/docs/analytics-api/metadata/' target='_blank'>Metadata API</a>: it gives information about all other available APIs methods, as well as providing
+ * This API is the <a href='http://piwik.org/docs/analytics-api/metadata/' rel='noreferrer' target='_blank'>Metadata API</a>: it gives information about all other available APIs methods, as well as providing
* human readable and more complete outputs than normal API methods.
*
* Some of the information that is returned by the Metadata API:
@@ -43,7 +43,7 @@ require_once PIWIK_INCLUDE_PATH . '/core/Config.php';
* <li>the method "getSuggestedValuesForSegment" returns top suggested values for a particular segment. It uses the Live.getLastVisitsDetails API to fetch the most recently used values, and will return the most often used values first.</li>
* </ul>
* The Metadata API is for example used by the Piwik Mobile App to automatically display all Piwik reports, with translated report & columns names and nicely formatted values.
- * More information on the <a href='http://piwik.org/docs/analytics-api/metadata/' target='_blank'>Metadata API documentation page</a>
+ * More information on the <a href='http://piwik.org/docs/analytics-api/metadata/' rel='noreferrer' target='_blank'>Metadata API documentation page</a>
*
* @method static \Piwik\Plugins\API\API getInstance()
*/
@@ -381,7 +381,8 @@ class API extends \Piwik\Plugin\API
&& !empty($reportMeta['metrics'])
) {
$plugin = $reportMeta['module'];
- foreach ($reportMeta['metrics'] as $column => $columnTranslation) {
+ $allMetrics = array_merge($reportMeta['metrics'], @$reportMeta['processedMetrics'] ?: array());
+ foreach ($allMetrics as $column => $columnTranslation) {
// a metric from this report has been requested
if (isset($columnsMap[$column])
// or by default, return all metrics
@@ -402,23 +403,9 @@ class API extends \Piwik\Plugin\API
$params['columns'] = implode(',', $columns);
$dataTable = Proxy::getInstance()->call($className, 'get', $params);
- // make sure the table has all columns
- $array = ($dataTable instanceof DataTable\Map ? $dataTable->getDataTables() : array($dataTable));
- foreach ($array as $table) {
- // we don't support idSites=all&date=DATE1,DATE2
- if ($table instanceof DataTable) {
- $firstRow = $table->getFirstRow();
- if (!$firstRow) {
- $firstRow = new Row;
- $table->addRow($firstRow);
- }
- foreach ($columns as $column) {
- if ($firstRow->getColumn($column) === false) {
- $firstRow->setColumn($column, 0);
- }
- }
- }
- }
+ $dataTable->filter(function (DataTable $table) {
+ $table->clearQueuedFilters();
+ });
// merge reports
if ($mergedDataTable === false) {
@@ -427,6 +414,13 @@ class API extends \Piwik\Plugin\API
$this->mergeDataTables($mergedDataTable, $dataTable);
}
}
+
+ if (!empty($columnsMap)
+ && !empty($mergedDataTable)
+ ) {
+ $mergedDataTable->queueFilter('ColumnDelete', array(false, array_keys($columnsMap)));
+ }
+
return $mergedDataTable;
}
@@ -450,12 +444,18 @@ class API extends \Piwik\Plugin\API
return;
}
- $firstRow1 = $table1->getFirstRow();
$firstRow2 = $table2->getFirstRow();
- if ($firstRow2 instanceof Row) {
- foreach ($firstRow2->getColumns() as $metric => $value) {
- $firstRow1->setColumn($metric, $value);
- }
+ if (!($firstRow2 instanceof Row)) {
+ return;
+ }
+
+ $firstRow1 = $table1->getFirstRow();
+ if (empty($firstRow1)) {
+ $firstRow1 = $table1->addRow(new Row());
+ }
+
+ foreach ($firstRow2->getColumns() as $metric => $value) {
+ $firstRow1->setColumn($metric, $value);
}
}
diff --git a/plugins/API/ProcessedReport.php b/plugins/API/ProcessedReport.php
index 418ef4a30a..52fd98c657 100644
--- a/plugins/API/ProcessedReport.php
+++ b/plugins/API/ProcessedReport.php
@@ -18,7 +18,7 @@ use Piwik\DataTable\Row;
use Piwik\DataTable\Simple;
use Piwik\Date;
use Piwik\Metrics;
-use Piwik\MetricsFormatter;
+use Piwik\Metrics\Formatter;
use Piwik\Period;
use Piwik\Piwik;
use Piwik\Plugin\Report;
@@ -263,9 +263,6 @@ class ProcessedReport
// Sort results to ensure consistent order
usort($availableReports, array('self', 'sortReports'));
- // Add the magic API.get report metadata aggregating all plugins API.get API calls automatically
- $this->addApiGetMetdata($availableReports);
-
$knownMetrics = array_merge(Metrics::getDefaultMetrics(), Metrics::getDefaultProcessedMetrics());
$columnsToKeep = $this->getColumnsToKeep();
$columnsToRemove = $this->getColumnsToRemove();
@@ -362,40 +359,6 @@ class ProcessedReport
: $category;
}
- /**
- * Add the metadata for the API.get report
- * In other plugins, this would hook on 'API.getReportMetadata'
- */
- private function addApiGetMetdata(&$availableReports)
- {
- $metadata = array(
- 'category' => Piwik::translate('General_API'),
- 'name' => Piwik::translate('General_MainMetrics'),
- 'module' => 'API',
- 'action' => 'get',
- 'metrics' => array(),
- 'processedMetrics' => array(),
- 'metricsDocumentation' => array(),
- 'order' => 1
- );
-
- $indexesToMerge = array('metrics', 'processedMetrics', 'metricsDocumentation');
-
- foreach ($availableReports as $report) {
- if ($report['action'] == 'get') {
- foreach ($indexesToMerge as $index) {
- if (isset($report[$index])
- && is_array($report[$index])
- ) {
- $metadata[$index] = array_merge($metadata[$index], $report[$index]);
- }
- }
- }
- }
-
- $availableReports[] = $metadata;
- }
-
public function getProcessedReport($idSite, $period, $date, $apiModule, $apiAction, $segment = false,
$apiParameters = false, $idGoal = false, $language = false,
$showTimer = true, $hideMetricsDoc = false, $idSubtable = false, $showRawMetrics = false)
@@ -427,19 +390,21 @@ class ProcessedReport
'format' => 'original',
'serialize' => '0',
'language' => $language,
- 'idSubtable' => $idSubtable
+ 'idSubtable' => $idSubtable,
+ 'format_metrics' => 1,
));
- if (isset($reportMetadata['processedMetrics'])) {
- $deleteRowsWithNoVisit = '1';
- if (!empty($reportMetadata['constantRowsCount'])) {
- $deleteRowsWithNoVisit = '0';
- }
- $parameters['filter_add_columns_when_show_all_columns'] = $deleteRowsWithNoVisit;
- }
-
if (!empty($segment)) $parameters['segment'] = $segment;
+ if (!empty($reportMetadata['processedMetrics'])
+ && !empty($reportMetadata['metrics']['nb_visits'])
+ && @$reportMetadata['category'] != Piwik::translate('Goals_Ecommerce')
+ && $apiModule !== 'MultiSites'
+ ) {
+ $deleteRowsWithNoVisits = empty($reportMetadata['constantRowsCount']) ? '1' : '0';
+ $parameters['filter_add_columns_when_show_all_columns'] = $deleteRowsWithNoVisits;
+ }
+
$url = Url::getQueryStringFromParameters($parameters);
$request = new Request($url);
try {
@@ -492,36 +457,36 @@ class ProcessedReport
private function handleTableReport($idSite, $dataTable, &$reportMetadata, $showRawMetrics = false)
{
$hasDimension = isset($reportMetadata['dimension']);
- $columns = $reportMetadata['metrics'];
+ $columns = @$reportMetadata['metrics'] ?: array();
if ($hasDimension) {
$columns = array_merge(
array('label' => $reportMetadata['dimension']),
$columns
);
+ }
- if (isset($reportMetadata['processedMetrics']) && is_array($reportMetadata['processedMetrics'])) {
- $processedMetricsAdded = Metrics::getDefaultProcessedMetrics();
- foreach ($reportMetadata['processedMetrics'] as $processedMetricId => $processedMetricTranslation) {
- // this processed metric can be displayed for this report
+ if (isset($reportMetadata['processedMetrics']) && is_array($reportMetadata['processedMetrics'])) {
+ $processedMetricsAdded = Metrics::getDefaultProcessedMetrics();
+ foreach ($reportMetadata['processedMetrics'] as $processedMetricId => $processedMetricTranslation) {
+ // this processed metric can be displayed for this report
- if ($processedMetricTranslation && $processedMetricId !== $processedMetricTranslation) {
- $columns[$processedMetricId] = $processedMetricTranslation;
- } elseif (isset($processedMetricsAdded[$processedMetricId])) {
- // for instance in case 'nb_visits' => 'nb_visits' we will translate it
- $columns[$processedMetricId] = $processedMetricsAdded[$processedMetricId];
- }
+ if ($processedMetricTranslation && $processedMetricId !== $processedMetricTranslation) {
+ $columns[$processedMetricId] = $processedMetricTranslation;
+ } elseif (isset($processedMetricsAdded[$processedMetricId])) {
+ // for instance in case 'nb_visits' => 'nb_visits' we will translate it
+ $columns[$processedMetricId] = $processedMetricsAdded[$processedMetricId];
}
}
+ }
- // Display the global Goal metrics
- if (isset($reportMetadata['metricsGoal'])) {
- $metricsGoalDisplay = array('revenue');
- // Add processed metrics to be displayed for this report
- foreach ($metricsGoalDisplay as $goalMetricId) {
- if (isset($reportMetadata['metricsGoal'][$goalMetricId])) {
- $columns[$goalMetricId] = $reportMetadata['metricsGoal'][$goalMetricId];
- }
+ // Display the global Goal metrics
+ if (isset($reportMetadata['metricsGoal'])) {
+ $metricsGoalDisplay = array('revenue');
+ // Add processed metrics to be displayed for this report
+ foreach ($metricsGoalDisplay as $goalMetricId) {
+ if (isset($reportMetadata['metricsGoal'][$goalMetricId])) {
+ $columns[$goalMetricId] = $reportMetadata['metricsGoal'][$goalMetricId];
}
}
}
@@ -683,6 +648,8 @@ class ProcessedReport
$enhancedDataTable = new Simple();
}
+ $formatter = new Formatter();
+
foreach ($simpleDataTable->getRows() as $row) {
$rowMetrics = $row->getColumns();
@@ -709,7 +676,7 @@ class ProcessedReport
$idSiteForRow = (int) $row->getMetadata('idsite');
}
- $prettyValue = MetricsFormatter::getPrettyValue($idSiteForRow, $columnName, $columnValue, $htmlAllowed = false);
+ $prettyValue = self::getPrettyValue($formatter, $idSiteForRow, $columnName, $columnValue, $htmlAllowed = false);
$enhancedRow->addColumn($columnName, $prettyValue);
} // For example the Maps Widget requires the raw metrics to do advanced datavis
elseif ($returnRawMetrics) {
@@ -833,4 +800,39 @@ class ProcessedReport
return $entry;
}, $v));
}
-}
+
+ /**
+ * Prettifies a metric value based on the column name.
+ *
+ * @param int $idSite The ID of the site the metric is for (used if the column value is an amount of money).
+ * @param string $columnName The metric name.
+ * @param mixed $value The metric value.
+ * @param bool $isHtml If true, replaces all spaces with `'&nbsp;'`.
+ * @return string
+ */
+ public static function getPrettyValue(Formatter $formatter, $idSite, $columnName, $value)
+ {
+ if (!is_numeric($value)) {
+ return $value;
+ }
+
+ // Display time in human readable
+ if (strpos($columnName, 'time') !== false) {
+ return $formatter->getPrettyTimeFromSeconds($value);
+ }
+
+ // Add revenue symbol to revenues
+ if (strpos($columnName, 'revenue') !== false && strpos($columnName, 'evolution') === false) {
+ return $formatter->getPrettyMoney($value, $idSite);
+ }
+
+ // Add % symbol to rates
+ if (strpos($columnName, '_rate') !== false) {
+ if (strpos($value, "%") === false) {
+ return $value . "%";
+ }
+ }
+
+ return $value;
+ }
+} \ No newline at end of file
diff --git a/plugins/API/Reports/Get.php b/plugins/API/Reports/Get.php
new file mode 100644
index 0000000000..11a4df5d6a
--- /dev/null
+++ b/plugins/API/Reports/Get.php
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\API\Reports;
+
+use Piwik\Piwik;
+use Piwik\Plugin\Report;
+
+class Get extends Report
+{
+ /**
+ * List of Plugin.Get reports that are merged in this one.
+ *
+ * @var Report[]
+ */
+ private $reportsToMerge = array();
+
+ protected function init()
+ {
+ parent::init();
+
+ $this->reportsToMerge = $this->getReportsToMerge();
+
+ $this->module = 'API';
+ $this->action = 'get';
+
+ $this->category = 'API';
+ $this->name = Piwik::translate('General_MainMetrics');
+ $this->documentation = '';
+
+ $this->processedMetrics = array();
+ foreach ($this->reportsToMerge as $report) {
+ if (!is_array($report->processedMetrics)) {
+ continue;
+ }
+
+ $this->processedMetrics = array_merge($this->processedMetrics, $report->processedMetrics);
+ }
+
+ $this->metrics = array();
+ foreach ($this->reportsToMerge as $report) {
+ if (!is_array($report->metrics)) {
+ continue;
+ }
+
+ $this->metrics = array_merge($this->metrics, $report->metrics);
+ }
+
+ $this->order = 6;
+ }
+
+ public function getMetrics()
+ {
+ $metrics = array();
+ foreach ($this->reportsToMerge as $report) {
+ $metrics = array_merge($metrics, $report->getMetrics());
+ }
+ return $metrics;
+ }
+
+ public function getProcessedMetrics()
+ {
+ $processedMetrics = array();
+ foreach ($this->reportsToMerge as $report) {
+ $processedMetrics = array_merge($processedMetrics, $report->getProcessedMetrics());
+ }
+ return $processedMetrics;
+ }
+
+ /**
+ * @return Report[]
+ */
+ private function getReportsToMerge()
+ {
+ $result = array();
+ foreach (Report::getAllReportClasses() as $reportClass) {
+ if ($reportClass == 'Piwik\\Plugins\\API\\Reports\\Get') {
+ continue;
+ }
+
+ /** @var Report $report */
+ $report = new $reportClass();
+
+ if ($report->getModule() == 'API'
+ || $report->getAction() != 'get'
+ ) {
+ continue;
+ }
+
+ $metrics = $report->getMetrics();
+ if (!empty($report->parameters)
+ || empty($metrics)
+ ) {
+ continue;
+ }
+
+ $result[] = $report;
+ }
+ return $result;
+ }
+} \ No newline at end of file
diff --git a/plugins/API/RowEvolution.php b/plugins/API/RowEvolution.php
index b57a788050..c4d96fb912 100644
--- a/plugins/API/RowEvolution.php
+++ b/plugins/API/RowEvolution.php
@@ -10,6 +10,7 @@ namespace Piwik\Plugins\API;
use Exception;
use Piwik\API\DataTableManipulator\LabelFilter;
+use Piwik\API\DataTablePostProcessor;
use Piwik\API\Request;
use Piwik\API\ResponseBuilder;
use Piwik\Common;
@@ -48,7 +49,7 @@ class RowEvolution
throw new Exception("Row evolutions can not be processed with this combination of \'date\' and \'period\' parameters.");
}
- $label = ResponseBuilder::unsanitizeLabelParameter($label);
+ $label = DataTablePostProcessor::unsanitizeLabelParameter($label);
$labels = Piwik::getArrayFromApiParameter($label);
$metadata = $this->getRowEvolutionMetaData($idSite, $period, $date, $apiModule, $apiAction, $language, $idGoal);
diff --git a/plugins/API/templates/listAllAPI.twig b/plugins/API/templates/listAllAPI.twig
index e4cf96174c..6ccd5db38f 100644
--- a/plugins/API/templates/listAllAPI.twig
+++ b/plugins/API/templates/listAllAPI.twig
@@ -16,7 +16,7 @@
<p>{{ 'API_PluginDescription'|translate }}</p>
<p>
- <strong>{{ 'API_MoreInformation'|translate("<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/analytics-api'>","</a>","<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/analytics-api/reference'>","</a>")|raw }}</strong>
+ <strong>{{ 'API_MoreInformation'|translate("<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/analytics-api'>","</a>","<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/analytics-api/reference'>","</a>")|raw }}</strong>
</p>
<h2>{{ 'API_UserAuthentication'|translate }}</h2>
diff --git a/plugins/Actions/API.php b/plugins/Actions/API.php
index ed161bdfec..37a3815394 100644
--- a/plugins/Actions/API.php
+++ b/plugins/Actions/API.php
@@ -16,6 +16,11 @@ use Piwik\DataTable;
use Piwik\Date;
use Piwik\Metrics;
use Piwik\Piwik;
+use Piwik\Plugin\Report;
+use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime;
+use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage;
+use Piwik\Plugins\Actions\Columns\Metrics\BounceRate;
+use Piwik\Plugins\Actions\Columns\Metrics\ExitRate;
use Piwik\Plugins\CustomVariables\API as APICustomVariables;
use Piwik\Plugins\Actions\Actions\ActionSiteSearch;
use Piwik\Tracker\Action;
@@ -25,7 +30,7 @@ use Piwik\Tracker\PageUrl;
* 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.
*
- * For example, "getPageTitles" will return all your page titles along with standard <a href='http://piwik.org/docs/analytics-api/reference/#toc-metric-definitions' target='_blank'>Actions metrics</a> for each row.
+ * For example, "getPageTitles" will return all your page titles along with standard <a href='http://piwik.org/docs/analytics-api/reference/#toc-metric-definitions' rel='noreferrer' target='_blank'>Actions metrics</a> for each row.
*
* It is also possible to request data for a specific Page Title with "getPageTitle"
* and setting the parameter pageName to the page title you wish to request.
@@ -50,60 +55,25 @@ class API extends \Piwik\Plugin\API
public function get($idSite, $period, $date, $segment = false, $columns = false)
{
Piwik::checkUserHasViewAccess($idSite);
+
+ $report = Report::factory("Actions", "get");
$archive = Archive::build($idSite, $period, $date, $segment);
- $metrics = Archiver::$actionsAggregateMetrics;
- $metrics['Actions_avg_time_generation'] = 'avg_time_generation';
-
- // get requested columns
- $columns = Piwik::getArrayFromApiParameter($columns);
- if (!empty($columns)) {
- // get the columns that are available and requested
- $columns = array_intersect($columns, array_values($metrics));
- $columns = array_values($columns); // make sure indexes are right
- $nameReplace = array();
- foreach ($columns as $i => $column) {
- $fullColumn = array_search($column, $metrics);
- $columns[$i] = $fullColumn;
- $nameReplace[$fullColumn] = $column;
- }
+ $requestedColumns = Piwik::getArrayFromApiParameter($columns);
+ $columns = $report->getMetricsRequiredForReport($allColumns = null, $requestedColumns);
- if (false !== ($avgGenerationTimeRequested = array_search('Actions_avg_time_generation', $columns))) {
- unset($columns[$avgGenerationTimeRequested]);
- $avgGenerationTimeRequested = true;
- }
- } else {
- // get all columns
- unset($metrics['Actions_avg_time_generation']);
- $columns = array_keys($metrics);
- $nameReplace = & $metrics;
- $avgGenerationTimeRequested = true;
- }
+ $inDbColumnNames = array_map(function ($value) { return 'Actions_' . $value; }, $columns);
+ $dataTable = $archive->getDataTableFromNumeric($inDbColumnNames);
- if ($avgGenerationTimeRequested) {
- $tempColumns = array(
- Archiver::METRIC_SUM_TIME_RECORD_NAME,
- Archiver::METRIC_HITS_TIMED_RECORD_NAME,
- );
- $columns = array_merge($columns, $tempColumns);
- $columns = array_unique($columns);
+ $dataTable->deleteColumns(array_diff($requestedColumns, $columns));
- $nameReplace[Archiver::METRIC_SUM_TIME_RECORD_NAME] = 'sum_time_generation';
- $nameReplace[Archiver::METRIC_HITS_TIMED_RECORD_NAME] = 'nb_hits_with_time_generation';
- }
-
- $table = $archive->getDataTableFromNumeric($columns);
+ $newNameMapping = array_combine($inDbColumnNames, $columns);
+ $dataTable->filter('ReplaceColumnNames', array($newNameMapping));
- // replace labels (remove Actions_)
- $table->filter('ReplaceColumnNames', array($nameReplace));
+ $columnsToShow = $requestedColumns ?: $report->getAllMetrics();
+ $dataTable->queueFilter('ColumnDelete', array($columnsToRemove = array(), $columnsToShow));
- // compute avg generation time
- if ($avgGenerationTimeRequested) {
- $table->filter('ColumnCallbackAddColumnQuotient', array('avg_time_generation', 'sum_time_generation', 'nb_hits_with_time_generation', 3));
- $table->deleteColumns(array('sum_time_generation', 'nb_hits_with_time_generation'));
- }
-
- return $table;
+ return $dataTable;
}
/**
@@ -121,7 +91,6 @@ class API extends \Piwik\Plugin\API
$depth = false)
{
$dataTable = $this->getDataTableFromArchive('Actions_actions_url', $idSite, $period, $date, $segment, $expanded, $idSubtable, $depth);
- $this->filterPageDatatable($dataTable);
$this->filterActionsDataTable($dataTable, $expanded);
return $dataTable;
}
@@ -200,7 +169,7 @@ class API extends \Piwik\Plugin\API
{
$callBackParameters = array('Actions_actions_url', $idSite, $period, $date, $segment, $expanded = false, $idSubtable = false);
$dataTable = $this->getFilterPageDatatableSearch($callBackParameters, $pageUrl, Action::TYPE_PAGE_URL);
- $this->filterPageDatatable($dataTable);
+ $this->addPageProcessedMetrics($dataTable);
$this->filterActionsDataTable($dataTable);
return $dataTable;
}
@@ -208,7 +177,6 @@ class API extends \Piwik\Plugin\API
public function getPageTitles($idSite, $period, $date, $segment = false, $expanded = false, $idSubtable = false)
{
$dataTable = $this->getDataTableFromArchive('Actions_actions', $idSite, $period, $date, $segment, $expanded, $idSubtable);
- $this->filterPageDatatable($dataTable);
$this->filterActionsDataTable($dataTable, $expanded);
return $dataTable;
}
@@ -241,7 +209,7 @@ class API extends \Piwik\Plugin\API
{
$callBackParameters = array('Actions_actions', $idSite, $period, $date, $segment, $expanded = false, $idSubtable = false);
$dataTable = $this->getFilterPageDatatableSearch($callBackParameters, $pageName, Action::TYPE_PAGE_TITLE);
- $this->filterPageDatatable($dataTable);
+ $this->addPageProcessedMetrics($dataTable);
$this->filterActionsDataTable($dataTable);
return $dataTable;
}
@@ -280,7 +248,6 @@ class API extends \Piwik\Plugin\API
{
$dataTable = $this->getSiteSearchKeywordsRaw($idSite, $period, $date, $segment);
$dataTable->deleteColumn(Metrics::INDEX_SITE_SEARCH_HAS_NO_RESULT);
- $this->filterPageDatatable($dataTable);
$this->filterActionsDataTable($dataTable);
$this->addPagesPerSearchColumn($dataTable);
return $dataTable;
@@ -316,7 +283,6 @@ class API extends \Piwik\Plugin\API
));
$dataTable->deleteRow(DataTable::ID_SUMMARY_ROW);
$dataTable->deleteColumn(Metrics::INDEX_SITE_SEARCH_HAS_NO_RESULT);
- $this->filterPageDatatable($dataTable);
$this->filterActionsDataTable($dataTable);
$this->addPagesPerSearchColumn($dataTable);
return $dataTable;
@@ -476,75 +442,6 @@ class API extends \Piwik\Plugin\API
}
/**
- * Common filters for Page URLs and Page Titles
- *
- * @param DataTable|DataTable\Simple|DataTable\Map $dataTable
- */
- protected function filterPageDatatable($dataTable)
- {
- $columnsToRemove = array('bounce_rate');
- $dataTable->queueFilter('ColumnDelete', array($columnsToRemove));
-
- // Average time on page = total time on page / number visits on that page
- $dataTable->queueFilter('ColumnCallbackAddColumnQuotient',
- array('avg_time_on_page',
- 'sum_time_spent',
- 'nb_visits',
- 0)
- );
-
- // Bounce rate = single page visits on this page / visits started on this page
- $dataTable->queueFilter('ColumnCallbackAddColumnPercentage',
- array('bounce_rate',
- 'entry_bounce_count',
- 'entry_nb_visits',
- 0));
-
- // % Exit = Number of visits that finished on this page / visits on this page
- $dataTable->queueFilter('ColumnCallbackAddColumnPercentage',
- array('exit_rate',
- 'exit_nb_visits',
- 'nb_visits',
- 0)
- );
-
- // Handle performance analytics
- $hasTimeGeneration = (array_sum($dataTable->getColumn(Metrics::INDEX_PAGE_SUM_TIME_GENERATION)) > 0);
- if ($hasTimeGeneration) {
- // Average generation time = total generation time / number of pageviews
- $precisionAvgTimeGeneration = 3;
- $dataTable->queueFilter('ColumnCallbackAddColumnQuotient',
- array('avg_time_generation',
- 'sum_time_generation',
- 'nb_hits_with_time_generation',
- $precisionAvgTimeGeneration)
- );
- $dataTable->queueFilter('ColumnDelete', array(array('sum_time_generation')));
- } else {
- // No generation time: remove it from the API output and add it to empty_columns metadata, so that
- // the columns can also be removed from the view
- $dataTable->filter('ColumnDelete', array(array(
- Metrics::INDEX_PAGE_SUM_TIME_GENERATION,
- Metrics::INDEX_PAGE_NB_HITS_WITH_TIME_GENERATION,
- Metrics::INDEX_PAGE_MIN_TIME_GENERATION,
- Metrics::INDEX_PAGE_MAX_TIME_GENERATION
- )));
-
- if ($dataTable instanceof DataTable) {
- $emptyColumns = $dataTable->getMetadata(DataTable::EMPTY_COLUMNS_METADATA_NAME);
- if (!is_array($emptyColumns)) {
- $emptyColumns = array();
- }
- $emptyColumns[] = 'sum_time_generation';
- $emptyColumns[] = 'avg_time_generation';
- $emptyColumns[] = 'min_time_generation';
- $emptyColumns[] = 'max_time_generation';
- $dataTable->setMetadata(DataTable::EMPTY_COLUMNS_METADATA_NAME, $emptyColumns);
- }
- }
- }
-
- /**
* Common filters for all Actions API
*
* @param DataTable|DataTable\Simple|DataTable\Map $dataTable
@@ -603,4 +500,16 @@ class API extends \Piwik\Plugin\API
}
return Archive::getDataTableFromArchive($name, $idSite, $period, $date, $segment, $expanded, $idSubtable, $skipAggregationOfSubTables, $depth);
}
+
+ private function addPageProcessedMetrics(DataTable\DataTableInterface $dataTable)
+ {
+ $dataTable->filter(function (DataTable $table) {
+ $extraProcessedMetrics = $table->getMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME);
+ $extraProcessedMetrics[] = new AverageTimeOnPage();
+ $extraProcessedMetrics[] = new BounceRate();
+ $extraProcessedMetrics[] = new ExitRate();
+ $extraProcessedMetrics[] = new AveragePageGenerationTime();
+ $table->setMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME, $extraProcessedMetrics);
+ });
+ }
}
diff --git a/plugins/Actions/Columns/Metrics/AveragePageGenerationTime.php b/plugins/Actions/Columns/Metrics/AveragePageGenerationTime.php
new file mode 100644
index 0000000000..9b44e88943
--- /dev/null
+++ b/plugins/Actions/Columns/Metrics/AveragePageGenerationTime.php
@@ -0,0 +1,108 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Actions\Columns\Metrics;
+
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Metrics;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+use Piwik\Plugin\Report;
+
+/**
+ * The average amount of time it takes to generate a page. Calculated as
+ *
+ * sum_time_generation / nb_hits_with_time_generation
+ *
+ * The above metrics are calculated during archiving. This metric is calculated before
+ * serving a report.
+ */
+class AveragePageGenerationTime extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'avg_time_generation';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_ColumnAverageGenerationTime');
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('sum_time_generation', 'nb_hits_with_time_generation');
+ }
+
+ public function getTemporaryMetrics()
+ {
+ return array('sum_time_generation');
+ }
+
+ public function compute(Row $row)
+ {
+ $sumGenerationTime = $this->getMetric($row, 'sum_time_generation');
+ $hitsWithTimeGeneration = $this->getMetric($row, 'nb_hits_with_time_generation');
+
+ return Piwik::getQuotientSafe($sumGenerationTime, $hitsWithTimeGeneration, $precision = 3);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ if ($formatter instanceof Formatter\Html
+ && !$value
+ ) {
+ return '-';
+ } else {
+ return $formatter->getPrettyTimeFromSeconds($value, $displayAsSentence = true);
+ }
+ }
+
+ public function beforeCompute($report, DataTable $table)
+ {
+ $hasTimeGeneration = array_sum($this->getMetricValues($table, 'sum_time_generation')) > 0;
+
+ if (!$hasTimeGeneration
+ && $table->getRowsCount() != 0
+ && !$this->hasAverageTimeGeneration($table)
+ ) {
+ // No generation time: remove it from the API output and add it to empty_columns metadata, so that
+ // the columns can also be removed from the view
+ $table->filter('ColumnDelete', array(array(
+ Metrics::INDEX_PAGE_SUM_TIME_GENERATION,
+ Metrics::INDEX_PAGE_NB_HITS_WITH_TIME_GENERATION,
+ Metrics::INDEX_PAGE_MIN_TIME_GENERATION,
+ Metrics::INDEX_PAGE_MAX_TIME_GENERATION,
+ 'sum_time_generation',
+ 'nb_hits_with_time_generation',
+ 'min_time_generation',
+ 'max_time_generation'
+ )));
+
+ if ($table instanceof DataTable) {
+ $emptyColumns = $table->getMetadata(DataTable::EMPTY_COLUMNS_METADATA_NAME);
+ if (!is_array($emptyColumns)) {
+ $emptyColumns = array();
+ }
+ $emptyColumns[] = 'sum_time_generation';
+ $emptyColumns[] = 'avg_time_generation';
+ $emptyColumns[] = 'min_time_generation';
+ $emptyColumns[] = 'max_time_generation';
+ $table->setMetadata(DataTable::EMPTY_COLUMNS_METADATA_NAME, $emptyColumns);
+ }
+ }
+
+ return $hasTimeGeneration;
+ }
+
+ private function hasAverageTimeGeneration(DataTable $table)
+ {
+ return $table->getFirstRow()->getColumn('avg_time_generation') !== false;
+ }
+} \ No newline at end of file
diff --git a/plugins/Actions/Columns/Metrics/AverageTimeOnPage.php b/plugins/Actions/Columns/Metrics/AverageTimeOnPage.php
new file mode 100644
index 0000000000..a11c60e853
--- /dev/null
+++ b/plugins/Actions/Columns/Metrics/AverageTimeOnPage.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Actions\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * The average amount of time spent on a page. Calculated as:
+ *
+ * sum_time_spent / nb_visits
+ *
+ * sum_time_spent and nb_visits are calculated by Archiver classes.
+ */
+class AverageTimeOnPage extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'avg_time_on_page';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_ColumnAverageTimeOnPage');
+ }
+
+ public function compute(Row $row)
+ {
+ $sumTimeSpent = $this->getMetric($row, 'sum_time_spent');
+ $visits = $this->getMetric($row, 'nb_visits');
+
+ return Piwik::getQuotientSafe($sumTimeSpent, $visits, $precision = 0);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyTimeFromSeconds($value, $timeAsSentence = false);
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('sum_time_spent', 'nb_visits');
+ }
+} \ No newline at end of file
diff --git a/plugins/Actions/Columns/Metrics/BounceRate.php b/plugins/Actions/Columns/Metrics/BounceRate.php
new file mode 100644
index 0000000000..da748b5ea6
--- /dev/null
+++ b/plugins/Actions/Columns/Metrics/BounceRate.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Actions\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * The bounce rate for individual pages. Calculated as:
+ *
+ * entry_bounce_count (single page visits on this page) / entry_nb_visits (all visits that started on this page)
+ *
+ * entry_bounce_count & entry_nb_visits are calculated by the Actions archiver.
+ */
+class BounceRate extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'bounce_rate';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_ColumnBounceRate');
+ }
+
+ public function compute(Row $row)
+ {
+ $entryBounceCount = $this->getMetric($row, 'entry_bounce_count');
+ $entryVisits = $this->getMetric($row, 'entry_nb_visits');
+
+ return Piwik::getQuotientSafe($entryBounceCount, $entryVisits, $precision = 2);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyPercentFromQuotient($value);
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('entry_bounce_count', 'entry_nb_visits');
+ }
+} \ No newline at end of file
diff --git a/plugins/Actions/Columns/Metrics/ExitRate.php b/plugins/Actions/Columns/Metrics/ExitRate.php
new file mode 100644
index 0000000000..4f78b2482f
--- /dev/null
+++ b/plugins/Actions/Columns/Metrics/ExitRate.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Actions\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * Percent of visits that finished on this page. Calculated as:
+ *
+ * exit_nb_visits / nb_visits
+ *
+ * exit_nb_visits & nb_visits are calculated by the Actions archiver.
+ */
+class ExitRate extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'exit_rate';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_ColumnExitRate');
+ }
+
+ public function compute(Row $row)
+ {
+ $exitVisits = $this->getMetric($row, 'exit_nb_visits');
+ $visits = $this->getMetric($row, 'nb_visits');
+
+ return Piwik::getQuotientSafe($exitVisits, $visits, $precision = 2);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyPercentFromQuotient($value);
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('exit_nb_visits', 'nb_visits');
+ }
+} \ No newline at end of file
diff --git a/plugins/Actions/Reports/Base.php b/plugins/Actions/Reports/Base.php
index 36fd1d67c6..08d5ac6f69 100644
--- a/plugins/Actions/Reports/Base.php
+++ b/plugins/Actions/Reports/Base.php
@@ -9,7 +9,7 @@
namespace Piwik\Plugins\Actions\Reports;
use Piwik\Common;
-use Piwik\MetricsFormatter;
+use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\Actions\Actions;
@@ -58,27 +58,13 @@ abstract class Base extends \Piwik\Plugin\Report
{
$view->config->addTranslations(array(
'nb_hits' => Piwik::translate('General_ColumnPageviews'),
- 'nb_visits' => Piwik::translate('General_ColumnUniquePageviews'),
- 'avg_time_on_page' => Piwik::translate('General_ColumnAverageTimeOnPage'),
- 'bounce_rate' => Piwik::translate('General_ColumnBounceRate'),
- 'exit_rate' => Piwik::translate('General_ColumnExitRate'),
- 'avg_time_generation' => Piwik::translate('General_ColumnAverageGenerationTime'),
+ 'nb_visits' => Piwik::translate('General_ColumnUniquePageviews')
));
- // prettify avg_time_on_page column
- $getPrettyTimeFromSeconds = function ($time) {
- return MetricsFormatter::getPrettyTimeFromSeconds($time, $timeAsSentence = false);
- };
- $view->config->filters[] = array('ColumnCallbackReplace', array('avg_time_on_page', $getPrettyTimeFromSeconds));
-
- // prettify avg_time_generation column
- $avgTimeCallback = function ($time) {
- return $time ? MetricsFormatter::getPrettyTimeFromSeconds($time, true, true, false) : "-";
- };
- $view->config->filters[] = array('ColumnCallbackReplace', array('avg_time_generation', $avgTimeCallback));
+ $formatter = new Formatter();
// add avg_generation_time tooltip
- $tooltipCallback = function ($hits, $min, $max) {
+ $tooltipCallback = function ($hits, $min, $max) use ($formatter) {
if (!$hits) {
return false;
}
@@ -86,8 +72,8 @@ abstract class Base extends \Piwik\Plugin\Report
return Piwik::translate("Actions_AvgGenerationTimeTooltip", array(
$hits,
"<br />",
- MetricsFormatter::getPrettyTimeFromSeconds($min),
- MetricsFormatter::getPrettyTimeFromSeconds($max)
+ $formatter->getPrettyTimeFromSeconds($min),
+ $formatter->getPrettyTimeFromSeconds($max)
));
};
$view->config->filters[] = array('ColumnCallbackAddMetadata',
@@ -117,5 +103,4 @@ abstract class Base extends \Piwik\Plugin\Report
};
}
}
-
}
diff --git a/plugins/Actions/Reports/Get.php b/plugins/Actions/Reports/Get.php
index 612666c32a..cc97e91c6d 100644
--- a/plugins/Actions/Reports/Get.php
+++ b/plugins/Actions/Reports/Get.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\Actions\Reports;
use Piwik\Piwik;
+use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime;
class Get extends Base
{
@@ -19,6 +20,9 @@ class Get extends Base
$this->name = Piwik::translate('General_Actions') . ' - ' . Piwik::translate('General_MainMetrics');
$this->documentation = ''; // TODO
$this->order = 1;
+ $this->processedMetrics = array(
+ new AveragePageGenerationTime()
+ );
$this->metrics = array(
'nb_pageviews',
'nb_uniq_pageviews',
@@ -27,8 +31,7 @@ class Get extends Base
'nb_outlinks',
'nb_uniq_outlinks',
'nb_searches',
- 'nb_keywords',
- 'avg_time_generation'
+ 'nb_keywords'
);
}
}
diff --git a/plugins/Actions/Reports/GetEntryPageTitles.php b/plugins/Actions/Reports/GetEntryPageTitles.php
index f5b9c41817..5abb8ca824 100644
--- a/plugins/Actions/Reports/GetEntryPageTitles.php
+++ b/plugins/Actions/Reports/GetEntryPageTitles.php
@@ -11,6 +11,10 @@ namespace Piwik\Plugins\Actions\Reports;
use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\Actions\Columns\EntryPageTitle;
+use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime;
+use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage;
+use Piwik\Plugins\Actions\Columns\Metrics\BounceRate;
+use Piwik\Plugins\Actions\Columns\Metrics\ExitRate;
class GetEntryPageTitles extends Base
{
@@ -22,18 +26,40 @@ class GetEntryPageTitles extends Base
$this->name = Piwik::translate('Actions_EntryPageTitles');
$this->documentation = Piwik::translate('Actions_ExitPageTitlesReportDocumentation', '<br />')
. ' ' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
- $this->metrics = array('entry_nb_visits', 'entry_bounce_count', 'bounce_rate');
+ $this->metrics = array('entry_nb_visits', 'entry_bounce_count');
+ $this->processedMetrics = array(
+ new AverageTimeOnPage(),
+ new BounceRate(),
+ new ExitRate(),
+ new AveragePageGenerationTime()
+ );
$this->order = 6;
$this->actionToLoadSubTables = $this->action;
$this->widgetTitle = 'Actions_WidgetEntryPageTitles';
}
+ public function getProcessedMetrics()
+ {
+ $result = parent::getProcessedMetrics();
+
+ // these metrics are not displayed in the API.getProcessedReport version of this report,
+ // so they are removed here.
+ unset($result['avg_time_on_page']);
+ unset($result['exit_rate']);
+
+ return $result;
+ }
+
protected function getMetricsDocumentation()
{
$metrics = parent::getMetricsDocumentation();
$metrics['bounce_rate'] = Piwik::translate('General_ColumnBounceRateForPageDocumentation');
+ // remove these metrics from API.getProcessedReport version of this report
+ unset($metrics['avg_time_on_page']);
+ unset($metrics['exit_rate']);
+
return $metrics;
}
diff --git a/plugins/Actions/Reports/GetEntryPageUrls.php b/plugins/Actions/Reports/GetEntryPageUrls.php
index 71cab238b7..05b1102299 100644
--- a/plugins/Actions/Reports/GetEntryPageUrls.php
+++ b/plugins/Actions/Reports/GetEntryPageUrls.php
@@ -13,6 +13,10 @@ use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\API\Request;
use Piwik\Plugins\Actions\Columns\EntryPageUrl;
+use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime;
+use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage;
+use Piwik\Plugins\Actions\Columns\Metrics\BounceRate;
+use Piwik\Plugins\Actions\Columns\Metrics\ExitRate;
class GetEntryPageUrls extends Base
{
@@ -25,7 +29,13 @@ class GetEntryPageUrls extends Base
$this->documentation = Piwik::translate('Actions_EntryPagesReportDocumentation', '<br />')
. '<br />' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
- $this->metrics = array('entry_nb_visits', 'entry_bounce_count', 'bounce_rate');
+ $this->metrics = array('entry_nb_visits', 'entry_bounce_count');
+ $this->processedMetrics = array(
+ new AverageTimeOnPage(),
+ new BounceRate(),
+ new ExitRate(),
+ new AveragePageGenerationTime()
+ );
$this->order = 3;
$this->actionToLoadSubTables = $this->action;
@@ -34,11 +44,26 @@ class GetEntryPageUrls extends Base
$this->widgetTitle = 'Actions_WidgetPagesEntry';
}
+ public function getProcessedMetrics()
+ {
+ $result = parent::getProcessedMetrics();
+
+ // these metrics are not displayed in the API.getProcessedReport version of this report,
+ // so they are removed here.
+ unset($result['avg_time_on_page']);
+ unset($result['exit_rate']);
+
+ return $result;
+ }
+
protected function getMetricsDocumentation()
{
$metrics = parent::getMetricsDocumentation();
$metrics['bounce_rate'] = Piwik::translate('General_ColumnBounceRateForPageDocumentation');
+ unset($metrics['bounce_rate']);
+ unset($metrics['exit_rate']);
+
return $metrics;
}
diff --git a/plugins/Actions/Reports/GetExitPageTitles.php b/plugins/Actions/Reports/GetExitPageTitles.php
index a9d29bd552..261b364eff 100644
--- a/plugins/Actions/Reports/GetExitPageTitles.php
+++ b/plugins/Actions/Reports/GetExitPageTitles.php
@@ -11,6 +11,10 @@ namespace Piwik\Plugins\Actions\Reports;
use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\Actions\Columns\ExitPageTitle;
+use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime;
+use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage;
+use Piwik\Plugins\Actions\Columns\Metrics\BounceRate;
+use Piwik\Plugins\Actions\Columns\Metrics\ExitRate;
class GetExitPageTitles extends Base
{
@@ -23,7 +27,13 @@ class GetExitPageTitles extends Base
$this->documentation = Piwik::translate('Actions_EntryPageTitlesReportDocumentation', '<br />')
. ' ' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
- $this->metrics = array('exit_nb_visits', 'nb_visits', 'exit_rate');
+ $this->metrics = array('exit_nb_visits', 'nb_visits');
+ $this->processedMetrics = array(
+ new AverageTimeOnPage(),
+ new BounceRate(),
+ new ExitRate(),
+ new AveragePageGenerationTime()
+ );
$this->order = 7;
$this->actionToLoadSubTables = $this->action;
@@ -31,6 +41,18 @@ class GetExitPageTitles extends Base
$this->widgetTitle = 'Actions_WidgetExitPageTitles';
}
+ public function getProcessedMetrics()
+ {
+ $result = parent::getProcessedMetrics();
+
+ // these metrics are not displayed in the API.getProcessedReport version of this report,
+ // so they are removed here.
+ unset($result['bounce_rate']);
+ unset($result['avg_time_on_page']);
+
+ return $result;
+ }
+
public function getMetrics()
{
$metrics = parent::getMetrics();
@@ -44,6 +66,9 @@ class GetExitPageTitles extends Base
$metrics = parent::getMetricsDocumentation();
$metrics['nb_visits'] = Piwik::translate('General_ColumnUniquePageviewsDocumentation');
+ unset($metrics['bounce_rate']);
+ unset($metrics['avg_time_on_page']);
+
return $metrics;
}
diff --git a/plugins/Actions/Reports/GetExitPageUrls.php b/plugins/Actions/Reports/GetExitPageUrls.php
index 72a95379b6..e41039c9f1 100644
--- a/plugins/Actions/Reports/GetExitPageUrls.php
+++ b/plugins/Actions/Reports/GetExitPageUrls.php
@@ -13,6 +13,10 @@ use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\API\Request;
use Piwik\Plugins\Actions\Columns\ExitPageUrl;
+use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime;
+use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage;
+use Piwik\Plugins\Actions\Columns\Metrics\BounceRate;
+use Piwik\Plugins\Actions\Columns\Metrics\ExitRate;
class GetExitPageUrls extends Base
{
@@ -25,7 +29,13 @@ class GetExitPageUrls extends Base
$this->documentation = Piwik::translate('Actions_ExitPagesReportDocumentation', '<br />')
. '<br />' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
- $this->metrics = array('exit_nb_visits', 'nb_visits', 'exit_rate');
+ $this->metrics = array('exit_nb_visits', 'nb_visits');
+ $this->processedMetrics = array(
+ new AverageTimeOnPage(),
+ new BounceRate(),
+ new ExitRate(),
+ new AveragePageGenerationTime()
+ );
$this->actionToLoadSubTables = $this->action;
$this->order = 4;
@@ -34,11 +44,26 @@ class GetExitPageUrls extends Base
$this->widgetTitle = 'Actions_WidgetPagesExit';
}
+ public function getProcessedMetrics()
+ {
+ $result = parent::getProcessedMetrics();
+
+ // these metrics are not displayed in the API.getProcessedReport version of this report,
+ // so they are removed here.
+ unset($result['bounce_rate']);
+ unset($result['avg_time_on_page']);
+
+ return $result;
+ }
+
public function getMetrics()
{
$metrics = parent::getMetrics();
$metrics['nb_visits'] = Piwik::translate('General_ColumnUniquePageviews');
+ unset($metrics['bounce_rate']);
+ unset($metrics['avg_time_on_page']);
+
return $metrics;
}
diff --git a/plugins/Actions/Reports/GetPageTitles.php b/plugins/Actions/Reports/GetPageTitles.php
index ed6e4aed68..058d382ee9 100644
--- a/plugins/Actions/Reports/GetPageTitles.php
+++ b/plugins/Actions/Reports/GetPageTitles.php
@@ -13,6 +13,10 @@ use Piwik\Plugin\ViewDataTable;
use Piwik\API\Request;
use Piwik\Common;
use Piwik\Plugins\Actions\Columns\PageTitle;
+use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime;
+use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage;
+use Piwik\Plugins\Actions\Columns\Metrics\BounceRate;
+use Piwik\Plugins\Actions\Columns\Metrics\ExitRate;
class GetPageTitles extends Base
{
@@ -26,7 +30,13 @@ class GetPageTitles extends Base
array('<br />', htmlentities('<title>')));
$this->order = 5;
- $this->metrics = array('nb_hits', 'nb_visits', 'bounce_rate', 'avg_time_on_page', 'exit_rate', 'avg_time_generation');
+ $this->metrics = array('nb_hits', 'nb_visits');
+ $this->processedMetrics = array(
+ new AverageTimeOnPage(),
+ new BounceRate(),
+ new ExitRate(),
+ new AveragePageGenerationTime()
+ );
$this->actionToLoadSubTables = $this->action;
diff --git a/plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php b/plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php
index 51177e7878..620b1af214 100644
--- a/plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php
+++ b/plugins/Actions/Reports/GetPageTitlesFollowingSiteSearch.php
@@ -11,6 +11,10 @@ namespace Piwik\Plugins\Actions\Reports;
use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\Actions\Columns\DestinationPage;
+use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime;
+use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage;
+use Piwik\Plugins\Actions\Columns\Metrics\BounceRate;
+use Piwik\Plugins\Actions\Columns\Metrics\ExitRate;
class GetPageTitlesFollowingSiteSearch extends SiteSearchBase
{
@@ -21,6 +25,12 @@ class GetPageTitlesFollowingSiteSearch extends SiteSearchBase
$this->name = Piwik::translate('Actions_WidgetPageTitlesFollowingSearch');
$this->documentation = Piwik::translate('Actions_SiteSearchFollowingPagesDoc') . '<br/>' . Piwik::translate('General_UsePlusMinusIconsDocumentation');
$this->metrics = array('nb_hits_following_search', 'nb_hits');
+ $this->processedMetrics = array(
+ new AverageTimeOnPage(),
+ new BounceRate(),
+ new ExitRate(),
+ new AveragePageGenerationTime()
+ );
$this->order = 19;
$this->widgetTitle = 'Actions_WidgetPageTitlesFollowingSearch';
}
@@ -40,6 +50,11 @@ class GetPageTitlesFollowingSiteSearch extends SiteSearchBase
);
}
+ public function getProcessedMetrics()
+ {
+ return array();
+ }
+
protected function getMetricsDocumentation()
{
return array(
diff --git a/plugins/Actions/Reports/GetPageUrls.php b/plugins/Actions/Reports/GetPageUrls.php
index 17ad2b1750..0af899ef0e 100644
--- a/plugins/Actions/Reports/GetPageUrls.php
+++ b/plugins/Actions/Reports/GetPageUrls.php
@@ -10,7 +10,11 @@ namespace Piwik\Plugins\Actions\Reports;
use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
+use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime;
+use Piwik\Plugins\Actions\Columns\Metrics\BounceRate;
use Piwik\Plugins\Actions\Columns\PageUrl;
+use Piwik\Plugins\Actions\Columns\Metrics\ExitRate;
+use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage;
class GetPageUrls extends Base
{
@@ -25,7 +29,13 @@ class GetPageUrls extends Base
$this->actionToLoadSubTables = $this->action;
$this->order = 2;
- $this->metrics = array('nb_hits', 'nb_visits', 'bounce_rate', 'avg_time_on_page', 'exit_rate', 'avg_time_generation');
+ $this->metrics = array('nb_hits', 'nb_visits');
+ $this->processedMetrics = array(
+ new AverageTimeOnPage(),
+ new BounceRate(),
+ new ExitRate(),
+ new AveragePageGenerationTime()
+ );
$this->segmentSql = 'log_visit.visit_entry_idaction_url';
diff --git a/plugins/Actions/Reports/GetSiteSearchKeywords.php b/plugins/Actions/Reports/GetSiteSearchKeywords.php
index 61fc0a84ed..d88684cd15 100644
--- a/plugins/Actions/Reports/GetSiteSearchKeywords.php
+++ b/plugins/Actions/Reports/GetSiteSearchKeywords.php
@@ -11,6 +11,10 @@ namespace Piwik\Plugins\Actions\Reports;
use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\Actions\Columns\Keyword;
+use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime;
+use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage;
+use Piwik\Plugins\Actions\Columns\Metrics\BounceRate;
+use Piwik\Plugins\Actions\Columns\Metrics\ExitRate;
class GetSiteSearchKeywords extends SiteSearchBase
{
@@ -20,8 +24,14 @@ class GetSiteSearchKeywords extends SiteSearchBase
$this->dimension = new Keyword();
$this->name = Piwik::translate('Actions_WidgetSearchKeywords');
$this->documentation = Piwik::translate('Actions_SiteSearchKeywordsDocumentation') . '<br/><br/>' . Piwik::translate('Actions_SiteSearchIntro') . '<br/><br/>'
- . '<a href="http://piwik.org/docs/site-search/" target="_blank">' . Piwik::translate('Actions_LearnMoreAboutSiteSearchLink') . '</a>';
- $this->metrics = array('nb_visits', 'nb_pages_per_search', 'exit_rate');
+ . '<a href="http://piwik.org/docs/site-search/" rel="noreferrer" target="_blank">' . Piwik::translate('Actions_LearnMoreAboutSiteSearchLink') . '</a>';
+ $this->metrics = array('nb_visits', 'nb_pages_per_search');
+ $this->processedMetrics = array(
+ new AverageTimeOnPage(),
+ new BounceRate(),
+ new ExitRate(),
+ new AveragePageGenerationTime()
+ );
$this->order = 15;
$this->widgetTitle = 'Actions_WidgetSearchKeywords';
}
@@ -31,6 +41,12 @@ class GetSiteSearchKeywords extends SiteSearchBase
return array(
'nb_visits' => Piwik::translate('Actions_ColumnSearches'),
'nb_pages_per_search' => Piwik::translate('Actions_ColumnPagesPerSearch'),
+ );
+ }
+
+ public function getProcessedMetrics()
+ {
+ return array(
'exit_rate' => Piwik::translate('Actions_ColumnSearchExits'),
);
}
@@ -51,4 +67,4 @@ class GetSiteSearchKeywords extends SiteSearchBase
$this->addSiteSearchDisplayProperties($view);
}
-}
+} \ No newline at end of file
diff --git a/plugins/Actions/Reports/GetSiteSearchNoResultKeywords.php b/plugins/Actions/Reports/GetSiteSearchNoResultKeywords.php
index df39684c2e..94b19e8566 100644
--- a/plugins/Actions/Reports/GetSiteSearchNoResultKeywords.php
+++ b/plugins/Actions/Reports/GetSiteSearchNoResultKeywords.php
@@ -11,6 +11,10 @@ namespace Piwik\Plugins\Actions\Reports;
use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\Actions\Columns\KeywordwithNoSearchResult;
+use Piwik\Plugins\Actions\Columns\Metrics\AveragePageGenerationTime;
+use Piwik\Plugins\Actions\Columns\Metrics\AverageTimeOnPage;
+use Piwik\Plugins\Actions\Columns\Metrics\BounceRate;
+use Piwik\Plugins\Actions\Columns\Metrics\ExitRate;
class GetSiteSearchNoResultKeywords extends SiteSearchBase
{
@@ -20,7 +24,13 @@ class GetSiteSearchNoResultKeywords extends SiteSearchBase
$this->dimension = new KeywordwithNoSearchResult();
$this->name = Piwik::translate('Actions_WidgetSearchNoResultKeywords');
$this->documentation = Piwik::translate('Actions_SiteSearchIntro') . '<br /><br />' . Piwik::translate('Actions_SiteSearchKeywordsNoResultDocumentation');
- $this->metrics = array('nb_visits', 'exit_rate');
+ $this->metrics = array('nb_visits');
+ $this->processedMetrics = array(
+ new AverageTimeOnPage(),
+ new BounceRate(),
+ new ExitRate(),
+ new AveragePageGenerationTime()
+ );
$this->order = 16;
$this->widgetTitle = 'Actions_WidgetSearchNoResultKeywords';
}
@@ -28,8 +38,14 @@ class GetSiteSearchNoResultKeywords extends SiteSearchBase
public function getMetrics()
{
return array(
- 'nb_visits' => Piwik::translate('Actions_ColumnSearches'),
- 'exit_rate' => Piwik::translate('Actions_ColumnSearchExits'),
+ 'nb_visits' => Piwik::translate('Actions_ColumnSearches')
+ );
+ }
+
+ public function getProcessedMetrics()
+ {
+ return array(
+ 'exit_rate' => Piwik::translate('Actions_ColumnSearchExits')
);
}
diff --git a/plugins/Contents/API.php b/plugins/Contents/API.php
index 002360588f..43d07b7cdc 100644
--- a/plugins/Contents/API.php
+++ b/plugins/Contents/API.php
@@ -61,8 +61,5 @@ class API extends \Piwik\Plugin\API
}
}
});
-
- // Content interaction rate = interactions / impressions
- $dataTable->queueFilter('ColumnCallbackAddColumnPercentage', array('interaction_rate', 'nb_interactions', 'nb_impressions', $precision = 2));
}
}
diff --git a/plugins/Contents/Columns/Metrics/InteractionRate.php b/plugins/Contents/Columns/Metrics/InteractionRate.php
new file mode 100644
index 0000000000..64485fe0e6
--- /dev/null
+++ b/plugins/Contents/Columns/Metrics/InteractionRate.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Contents\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * The content interaction rate. Calculated as:
+ *
+ * nb_interactions / nb_impressions
+ *
+ * nb_interactions & nb_impressions are calculated by the Contents archiver.
+ */
+class InteractionRate extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'interaction_rate';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('Contents_InteractionRate');
+ }
+
+ public function compute(Row $row)
+ {
+ $interactions = $this->getMetric($row, 'nb_interactions');
+ $impressions = $this->getMetric($row, 'nb_impressions');
+
+ return Piwik::getQuotientSafe($interactions, $impressions, $precision = 4);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyPercentFromQuotient($value);
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('nb_interactions', 'nb_impressions');
+ }
+} \ No newline at end of file
diff --git a/plugins/Contents/Reports/Base.php b/plugins/Contents/Reports/Base.php
index 752dab959e..f07baf973d 100644
--- a/plugins/Contents/Reports/Base.php
+++ b/plugins/Contents/Reports/Base.php
@@ -37,7 +37,12 @@ abstract class Base extends Report
$view->config->addTranslations(array('label' => $this->dimension->getName()));
}
- $view->config->columns_to_display = array_merge(array('label'), $this->metrics, $this->processedMetrics);
+ $view->config->columns_to_display = array_merge(
+ array('label'),
+ array_keys($this->getMetrics()),
+ array_keys($this->getProcessedMetrics())
+ );
+
$view->requestConfig->filter_sort_column = 'nb_impressions';
if ($this->hasSubtableId()) {
diff --git a/plugins/Contents/Reports/GetContentNames.php b/plugins/Contents/Reports/GetContentNames.php
index 1a946f3a21..d217af5d71 100644
--- a/plugins/Contents/Reports/GetContentNames.php
+++ b/plugins/Contents/Reports/GetContentNames.php
@@ -11,6 +11,7 @@ namespace Piwik\Plugins\Contents\Reports;
use Piwik\Piwik;
use Piwik\Plugin\Report;
use Piwik\Plugins\Contents\Columns\ContentName;
+use Piwik\Plugins\Contents\Columns\Metrics\InteractionRate;
use Piwik\View;
/**
@@ -33,6 +34,6 @@ class GetContentNames extends Base
$this->widgetTitle = 'Contents_ContentName';
$this->metrics = array('nb_impressions', 'nb_interactions');
- $this->processedMetrics = array('interaction_rate');
+ $this->processedMetrics = array(new InteractionRate());
}
}
diff --git a/plugins/Contents/Reports/GetContentPieces.php b/plugins/Contents/Reports/GetContentPieces.php
index 4601430ee1..7ab3f1ed1c 100644
--- a/plugins/Contents/Reports/GetContentPieces.php
+++ b/plugins/Contents/Reports/GetContentPieces.php
@@ -11,6 +11,7 @@ namespace Piwik\Plugins\Contents\Reports;
use Piwik\Piwik;
use Piwik\Plugin\Report;
use Piwik\Plugins\Contents\Columns\ContentPiece;
+use Piwik\Plugins\Contents\Columns\Metrics\InteractionRate;
use Piwik\View;
/**
@@ -34,6 +35,6 @@ class GetContentPieces extends Base
$this->widgetTitle = 'Contents_ContentPiece';
$this->metrics = array('nb_impressions', 'nb_interactions');
- $this->processedMetrics = array('interaction_rate');
+ $this->processedMetrics = array(new InteractionRate());
}
}
diff --git a/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml
index 0a76c67ee3..6c8c8875f0 100644
--- a/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml
@@ -40,7 +40,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>271</visitDuration>
- <visitDurationPretty>4 min 31s</visitDurationPretty>
+ <visitDurationPretty>4 min 31s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
@@ -140,7 +140,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>271</visitDuration>
- <visitDurationPretty>4 min 31s</visitDurationPretty>
+ <visitDurationPretty>4 min 31s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
diff --git a/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml
index 0a76c67ee3..6c8c8875f0 100644
--- a/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml
@@ -40,7 +40,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>271</visitDuration>
- <visitDurationPretty>4 min 31s</visitDurationPretty>
+ <visitDurationPretty>4 min 31s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
@@ -140,7 +140,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>271</visitDuration>
- <visitDurationPretty>4 min 31s</visitDurationPretty>
+ <visitDurationPretty>4 min 31s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
diff --git a/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml
index 0a76c67ee3..6c8c8875f0 100644
--- a/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml
@@ -40,7 +40,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>271</visitDuration>
- <visitDurationPretty>4 min 31s</visitDurationPretty>
+ <visitDurationPretty>4 min 31s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
@@ -140,7 +140,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>271</visitDuration>
- <visitDurationPretty>4 min 31s</visitDurationPretty>
+ <visitDurationPretty>4 min 31s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
diff --git a/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml
index 0a76c67ee3..6c8c8875f0 100644
--- a/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml
@@ -40,7 +40,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>271</visitDuration>
- <visitDurationPretty>4 min 31s</visitDurationPretty>
+ <visitDurationPretty>4 min 31s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
@@ -140,7 +140,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>271</visitDuration>
- <visitDurationPretty>4 min 31s</visitDurationPretty>
+ <visitDurationPretty>4 min 31s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
diff --git a/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml
index 0a76c67ee3..6c8c8875f0 100644
--- a/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml
@@ -40,7 +40,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>271</visitDuration>
- <visitDurationPretty>4 min 31s</visitDurationPretty>
+ <visitDurationPretty>4 min 31s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
@@ -140,7 +140,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>271</visitDuration>
- <visitDurationPretty>4 min 31s</visitDurationPretty>
+ <visitDurationPretty>4 min 31s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
diff --git a/plugins/CoreAdminHome/Controller.php b/plugins/CoreAdminHome/Controller.php
index 55452ad5db..2306147b08 100644
--- a/plugins/CoreAdminHome/Controller.php
+++ b/plugins/CoreAdminHome/Controller.php
@@ -219,7 +219,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$view->idSite = Common::getRequestVar('idSite', $defaultIdSite, 'int');
$view->defaultReportSiteName = Site::getNameFor($view->idSite);
- $view->defaultSiteRevenue = \Piwik\MetricsFormatter::getCurrencySymbol($view->idSite);
+ $view->defaultSiteRevenue = \Piwik\Metrics\Formatter::getCurrencySymbol($view->idSite);
$view->maxCustomVariables = CustomVariables::getMaxCustomVariables();
$allUrls = APISitesManager::getInstance()->getSiteUrlsFromId($view->idSite);
diff --git a/plugins/CoreAdminHome/templates/generalSettings.twig b/plugins/CoreAdminHome/templates/generalSettings.twig
index 772d5d600c..d7f49b07e9 100644
--- a/plugins/CoreAdminHome/templates/generalSettings.twig
+++ b/plugins/CoreAdminHome/templates/generalSettings.twig
@@ -24,13 +24,13 @@
<input id="enableBrowserTriggerArchiving-no" type="radio" value="0" name="enableBrowserTriggerArchiving"{% if enableBrowserTriggerArchiving==0 %} checked="checked"{% endif %} />
<label for="enableBrowserTriggerArchiving-no">{{ 'General_No'|translate }}</label><br/>
- <span class="form-description">{{ 'General_ArchivingTriggerDescription'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/setup-auto-archiving/' target='_blank'>","</a>")|raw }}</span>
+ <span class="form-description">{{ 'General_ArchivingTriggerDescription'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/setup-auto-archiving/' rel='noreferrer' target='_blank'>","</a>")|raw }}</span>
</fieldset>
<td>
{% set browserArchivingHelp %}
{{ 'General_ArchivingInlineHelp'|translate }}
<br/>
- {{ 'General_SeeTheOfficialDocumentationForMoreInformation'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/setup-auto-archiving/' target='_blank'>","</a>")|raw }}
+ {{ 'General_SeeTheOfficialDocumentationForMoreInformation'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/setup-auto-archiving/' rel='noreferrer' target='_blank'>","</a>")|raw }}
{% endset %}
{{ piwik.inlineHelp(browserArchivingHelp) }}
</td>
@@ -100,9 +100,9 @@
</fieldset>
<td>
{% set checkReleaseHelp %}
- {{ 'CoreAdminHome_DevelopmentProcess'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/participate/development-process/' target='_blank'>","</a>")|raw }}
+ {{ 'CoreAdminHome_DevelopmentProcess'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/participate/development-process/' rel='noreferrer' target='_blank'>","</a>")|raw }}
<br/>
- {{ 'CoreAdminHome_StableReleases'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/participate/user-feedback/' target='_blank'>","</a>")|raw }}
+ {{ 'CoreAdminHome_StableReleases'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/participate/user-feedback/' rel='noreferrer' target='_blank'>","</a>")|raw }}
{% endset %}
{{ piwik.inlineHelp(checkReleaseHelp) }}
</td>
@@ -225,7 +225,7 @@
<td id="inlineHelpCustomLogo">
{% set giveUsFeedbackText %}"{{ 'General_GiveUsYourFeedback'|translate }}"{% endset %}
{% set customLogoHelp %}
- {{ 'CoreAdminHome_CustomLogoFeedbackInfo'|translate(giveUsFeedbackText,"<a href='?module=CorePluginsAdmin&action=plugins' target='_blank'>","</a>")|raw }}
+ {{ 'CoreAdminHome_CustomLogoFeedbackInfo'|translate(giveUsFeedbackText,"<a href='?module=CorePluginsAdmin&action=plugins' rel='noreferrer' target='_blank'>","</a>")|raw }}
{% endset %}
{{ piwik.inlineHelp(customLogoHelp) }}
</td>
@@ -344,7 +344,7 @@
{% endset %}
<code>{{ iframeOptOut|escape }}</code>
<br/>
- {{ 'CoreAdminHome_OptOutExplanationBis'|translate("<a href='" ~ optOutUrl ~ "' target='_blank'>","</a>")|raw }}
+ {{ 'CoreAdminHome_OptOutExplanationBis'|translate("<a href='" ~ optOutUrl ~ "' rel='noreferrer' target='_blank'>","</a>")|raw }}
</p>
{% endblock %}
diff --git a/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig b/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig
index b3bfbf8d6b..bd54182b76 100644
--- a/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig
+++ b/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig
@@ -18,11 +18,11 @@
<p>
{{ 'CoreAdminHome_JSTrackingIntro1'|translate }}
<br/><br/>
- {{ 'CoreAdminHome_JSTrackingIntro2'|translate }} {{ 'CoreAdminHome_JSTrackingIntro3'|translate('<a href="http://piwik.org/integrate/" target="_blank">','</a>')|raw }}
+ {{ 'CoreAdminHome_JSTrackingIntro2'|translate }} {{ 'CoreAdminHome_JSTrackingIntro3'|translate('<a href="http://piwik.org/integrate/" rel="noreferrer" target="_blank">','</a>')|raw }}
<br/><br/>
{{ 'CoreAdminHome_JSTrackingIntro4'|translate('<a href="#image-tracking-link">','</a>')|raw }}
<br/><br/>
- {{ 'CoreAdminHome_JSTrackingIntro5'|translate('<a target="_blank" href="http://piwik.org/docs/javascript-tracking/">','</a>')|raw }}
+ {{ 'CoreAdminHome_JSTrackingIntro5'|translate('<a rel="noreferrer" target="_blank" href="http://piwik.org/docs/javascript-tracking/">','</a>')|raw }}
</p>
<div>
@@ -167,7 +167,7 @@
<label for="custom-campaign-query-params-check">{{ 'CoreAdminHome_JSTracking_CustomCampaignQueryParam'|translate }}</label>
<div class="small-form-description">
- {{ 'CoreAdminHome_JSTracking_CustomCampaignQueryParamDesc'|translate('<a href="http://piwik.org/faq/general/#faq_119" target="_blank">','</a>')|raw }}
+ {{ 'CoreAdminHome_JSTracking_CustomCampaignQueryParamDesc'|translate('<a href="http://piwik.org/faq/general/#faq_119" rel="noreferrer" target="_blank">','</a>')|raw }}
</div>
<table style="display:none;" id="js-campaign-query-param-extra">
@@ -206,7 +206,7 @@
<p>
{{ 'CoreAdminHome_ImageTrackingIntro1'|translate }} {{ 'CoreAdminHome_ImageTrackingIntro2'|translate("<em>&lt;noscript&gt;&lt;/noscript&gt;</em>")|raw }}
<br/><br/>
- {{ 'CoreAdminHome_ImageTrackingIntro3'|translate('<a href="http://piwik.org/docs/tracking-api/reference/" target="_blank">','</a>')|raw }}
+ {{ 'CoreAdminHome_ImageTrackingIntro3'|translate('<a href="http://piwik.org/docs/tracking-api/reference/" rel="noreferrer" target="_blank">','</a>')|raw }}
</p>
<div>
@@ -276,7 +276,7 @@
<h2>{{ 'CoreAdminHome_ImportingServerLogs'|translate }}</h2>
<p>
- {{ 'CoreAdminHome_ImportingServerLogsDesc'|translate('<a href="http://piwik.org/log-analytics/" target="_blank">','</a>')|raw }}
+ {{ 'CoreAdminHome_ImportingServerLogsDesc'|translate('<a href="http://piwik.org/log-analytics/" rel="noreferrer" target="_blank">','</a>')|raw }}
</p>
{% endblock %}
diff --git a/plugins/CoreHome/Columns/Metrics/ActionsPerVisit.php b/plugins/CoreHome/Columns/Metrics/ActionsPerVisit.php
new file mode 100644
index 0000000000..0ced958086
--- /dev/null
+++ b/plugins/CoreHome/Columns/Metrics/ActionsPerVisit.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\CoreHome\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+use Piwik\Translate;
+
+/**
+ * The average number of actions per visit. Calculated as:
+ *
+ * nb_actions / nb_visits
+ *
+ * nb_actions & nb_visits are calculated during archiving.
+ */
+class ActionsPerVisit extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'nb_actions_per_visit';
+ }
+
+ public function compute(Row $row)
+ {
+ $actions = $this->getMetric($row, 'nb_actions');
+ $visits = $this->getMetric($row, 'nb_visits');
+
+ return Piwik::getQuotientSafe($actions, $visits, $precision = 1);
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_ColumnActionsPerVisit');
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('nb_actions', 'nb_visits');
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/Metrics/AverageTimeOnSite.php b/plugins/CoreHome/Columns/Metrics/AverageTimeOnSite.php
new file mode 100644
index 0000000000..e590e19871
--- /dev/null
+++ b/plugins/CoreHome/Columns/Metrics/AverageTimeOnSite.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\CoreHome\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * The average number of seconds spent on the site per visit. Calculated as:
+ *
+ * sum_visit_length / nb_visits
+ *
+ * sum_visit_length & nb_visits are calculated during archiving.
+ *
+ * @api
+ */
+class AverageTimeOnSite extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'avg_time_on_site';
+ }
+
+ public function compute(Row $row)
+ {
+ $sumVisitLength = $this->getMetric($row, 'sum_visit_length');
+ $nbVisits = $this->getMetric($row, 'nb_visits');
+
+ return Piwik::getQuotientSafe($sumVisitLength, $nbVisits, $precision = 0);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyTimeFromSeconds($value);
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_ColumnAvgTimeOnSite');
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('sum_visit_length', 'nb_visits');
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/Metrics/BounceRate.php b/plugins/CoreHome/Columns/Metrics/BounceRate.php
new file mode 100644
index 0000000000..65d46fb435
--- /dev/null
+++ b/plugins/CoreHome/Columns/Metrics/BounceRate.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\CoreHome\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * The percentage of visits that leave the site without visiting another page. Calculated
+ * as:
+ *
+ * bounce_count / nb_visits
+ *
+ * bounce_count & nb_visits are calculated by an Archiver.
+ */
+class BounceRate extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'bounce_rate';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_ColumnBounceRate');
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('bounce_count', 'nb_visits');
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyPercentFromQuotient($value);
+ }
+
+ public function compute(Row $row)
+ {
+ $bounceCount = $this->getMetric($row, 'bounce_count');
+ $visits = $this->getMetric($row, 'nb_visits');
+
+ return Piwik::getQuotientSafe($bounceCount, $visits, $precision = 2);
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/Metrics/ConversionRate.php b/plugins/CoreHome/Columns/Metrics/ConversionRate.php
new file mode 100644
index 0000000000..0865825238
--- /dev/null
+++ b/plugins/CoreHome/Columns/Metrics/ConversionRate.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\CoreHome\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * The percent of visits that result in a conversion. Calculated as:
+ *
+ * nb_visits_converted / nb_visits
+ *
+ * nb_visits_converted & nb_visits are calculated by the archiving process.
+ */
+class ConversionRate extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'conversion_rate';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_ColumnConversionRate');
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('nb_visits_converted', 'nb_visits');
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyPercentFromQuotient($value);
+ }
+
+ public function compute(Row $row)
+ {
+ $nbVisitsConverted = $this->getMetric($row, 'nb_visits_converted');
+ $nbVisits = $this->getMetric($row, 'nb_visits');
+
+ return Piwik::getQuotientSafe($nbVisitsConverted, $nbVisits, $precision = 4);
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/Metrics/EvolutionMetric.php b/plugins/CoreHome/Columns/Metrics/EvolutionMetric.php
new file mode 100644
index 0000000000..537e42a520
--- /dev/null
+++ b/plugins/CoreHome/Columns/Metrics/EvolutionMetric.php
@@ -0,0 +1,123 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\CoreHome\Columns\Metrics;
+
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\Metric;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * Calculates evolution values for any other metric. An evolution is the percent change from a
+ * point in the past to the present. They are computed as:
+ *
+ * (current value - value in past) / value in past
+ *
+ * @api
+ */
+class EvolutionMetric extends ProcessedMetric
+{
+ /**
+ * @var Metric|string
+ */
+ private $wrapped;
+
+ /**
+ * @var string
+ */
+ private $evolutionMetricName;
+
+ /**
+ * @var int
+ */
+ private $quotientPrecision;
+
+ /**
+ * @var DataTable
+ */
+ private $pastData;
+
+ /**
+ * Constructor.
+ *
+ * @param string|Metric $wrapped The metric used to calculate the evolution.
+ * @param DataTable $pastData The data in the past to use when calculating evolutions.
+ * @param string|false $evolutionMetricName The name of the evolution processed metric. Defaults to
+ * $wrapped's name with `'_evolution'` appended.
+ * @param int $quotientPrecision The percent's quotient precision.
+ */
+ public function __construct($wrapped, DataTable $pastData, $evolutionMetricName = false, $quotientPrecision = 0)
+ {
+ $this->wrapped = $wrapped;
+ $this->pastData = $pastData;
+
+ if (empty($evolutionMetricName)) {
+ $wrappedName = $this->getWrappedName();
+ $evolutionMetricName = $wrappedName . '_evolution';
+ }
+
+ $this->evolutionMetricName = $evolutionMetricName;
+ $this->quotientPrecision = $quotientPrecision;
+ }
+
+ public function getName()
+ {
+ return $this->evolutionMetricName;
+ }
+
+ public function getTranslatedName()
+ {
+ return $this->wrapped instanceof Metric ? $this->wrapped->getTranslatedName() : $this->getName();
+ }
+
+ public function compute(Row $row)
+ {
+ $columnName = $this->getWrappedName();
+ $pastRow = $this->getPastRowFromCurrent($row);
+
+ $currentValue = $this->getMetric($row, $columnName);
+ $pastValue = $pastRow ? $this->getMetric($pastRow, $columnName) : 0;
+
+ $dividend = $currentValue - $pastValue;
+ $divisor = $pastValue;
+
+ if ($dividend == 0) {
+ return 0;
+ } else if ($divisor == 0) {
+ return 1;
+ } else {
+ return Piwik::getQuotientSafe($dividend, $divisor, $this->quotientPrecision + 2);
+ }
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyPercentFromQuotient($value);
+ }
+
+ public function getDependentMetrics()
+ {
+ return array($this->getWrappedName());
+ }
+
+ protected function getWrappedName()
+ {
+ return $this->wrapped instanceof Metric ? $this->wrapped->getName() : $this->wrapped;
+ }
+
+ /**
+ * public for Insights use.
+ */
+ public function getPastRowFromCurrent(Row $row)
+ {
+ return $this->pastData->getRowFromLabel($row->getColumn('label'));
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/Columns/Metrics/VisitsPercent.php b/plugins/CoreHome/Columns/Metrics/VisitsPercent.php
new file mode 100644
index 0000000000..70fd7d7d51
--- /dev/null
+++ b/plugins/CoreHome/Columns/Metrics/VisitsPercent.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\CoreHome\Columns\Metrics;
+
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+use Piwik\Plugin\Report;
+
+/**
+ * Percent of visits in the whole table. Calculated as:
+ *
+ * nb_visits / sum(all nb_visits in table)
+ *
+ * nb_visits is calculated by core archiving process.
+ */
+class VisitsPercent extends ProcessedMetric
+{
+ private $cachedTotalVisits = null;
+ private $forceTotalVisits = null;
+
+ /**
+ * Constructor.
+ *
+ * @param int|null $totalVisits The forced value of total visits to use.
+ */
+ public function __construct($totalVisits = null)
+ {
+ $this->forceTotalVisits = $totalVisits;
+ }
+
+ public function getName()
+ {
+ return 'nb_visits_percentage';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_ColumnPercentageVisits');
+ }
+
+ public function compute(Row $row)
+ {
+ $visits = $this->getMetric($row, 'nb_visits');
+
+ return Piwik::getQuotientSafe($visits, $this->cachedTotalVisits, $precision = 2);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyPercentFromQuotient($value);
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('nb_visits');
+ }
+
+ public function beforeCompute($report, DataTable $table)
+ {
+ if ($this->forceTotalVisits === null) {
+ $this->cachedTotalVisits = array_sum($this->getMetricValues($table, 'nb_visits'));
+ } else {
+ $this->cachedTotalVisits = $this->forceTotalVisits;
+ }
+
+ return true; // always compute
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php
index 6f2db7ab9d..2e2631203a 100644
--- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php
+++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\CoreHome\DataTableRowAction;
use Exception;
+use Piwik\API\DataTablePostProcessor;
use Piwik\API\Request;
use Piwik\API\ResponseBuilder;
use Piwik\Common;
@@ -85,7 +86,7 @@ class RowEvolution
$this->apiMethod = Common::getRequestVar('apiMethod', '', 'string');
if (empty($this->apiMethod)) throw new Exception("Parameter apiMethod not set.");
- $this->label = ResponseBuilder::getLabelFromRequest($_GET);
+ $this->label = DataTablePostProcessor::getLabelFromRequest($_GET);
if (!is_array($this->label)) {
throw new Exception("Expected label to be an array, got instead: " . $this->label);
}
diff --git a/plugins/CoreHome/Visitor.php b/plugins/CoreHome/Visitor.php
index 35b64b3d30..35b5ee5d22 100644
--- a/plugins/CoreHome/Visitor.php
+++ b/plugins/CoreHome/Visitor.php
@@ -8,15 +8,18 @@
*/
namespace Piwik\Plugins\CoreHome;
+use Piwik\Metrics\Formatter;
use Piwik\Plugins\CoreHome\Columns\VisitGoalBuyer;
class Visitor
{
private $details = array();
+ private $metricsFormatter = null;
public function __construct($details)
{
$this->details = $details;
+ $this->metricsFormatter = new Formatter();
}
function getTimestampFirstAction()
@@ -96,7 +99,7 @@ class Visitor
function getVisitLengthPretty()
{
- return \Piwik\MetricsFormatter::getPrettyTimeFromSeconds($this->details['visit_total_time']);
+ return $this->metricsFormatter->getPrettyTimeFromSeconds($this->details['visit_total_time'], true);
}
function getUserId()
@@ -107,5 +110,4 @@ class Visitor
}
return null;
}
-
} \ No newline at end of file
diff --git a/plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.html b/plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.html
index 53f04ecac1..2a03f809c4 100644
--- a/plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.html
+++ b/plugins/CoreHome/angularjs/enrichedheadline/enrichedheadline.directive.html
@@ -4,6 +4,7 @@
<span ng-show="view.showIcons">
<a ng-if="helpUrl && !inlineHelp"
+ rel="noreferrer"
target="_blank"
href="{{ helpUrl }}"
title="{{ 'CoreHome_ExternalHelp'|translate }}"
@@ -22,6 +23,7 @@
<div class="inlineHelp" ng-show="view.showIcons && view.showInlineHelp">
<div ng-bind-html="inlineHelp"></div>
<a ng-if="helpUrl"
+ rel="noreferrer"
target="_blank"
href="{{ helpUrl }}"
class="readMore">{{ 'General_MoreDetails'|translate }}</a>
diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js
index 60b703ecbd..ac59e4ff2b 100644
--- a/plugins/CoreHome/javascripts/dataTable.js
+++ b/plugins/CoreHome/javascripts/dataTable.js
@@ -1708,7 +1708,7 @@ $.extend(DataTable.prototype, UIControl.prototype, {
},
handleSummaryRow: function (domElem) {
- var details = _pk_translate('General_LearnMore', [' (<a href="http://piwik.org/faq/how-to/faq_54/" target="_blank">', '</a>)']);
+ var details = _pk_translate('General_LearnMore', [' (<a href="http://piwik.org/faq/how-to/faq_54/" rel="noreferrer" target="_blank">', '</a>)']);
domElem.find('tr.summaryRow').each(function () {
var labelSpan = $(this).find('.label .value');
diff --git a/plugins/CoreHome/templates/ReportRenderer/_htmlReportHeader.twig b/plugins/CoreHome/templates/ReportRenderer/_htmlReportHeader.twig
index e594377e35..a471b38adf 100644
--- a/plugins/CoreHome/templates/ReportRenderer/_htmlReportHeader.twig
+++ b/plugins/CoreHome/templates/ReportRenderer/_htmlReportHeader.twig
@@ -4,7 +4,7 @@
</head>
<body style="color: rgb({{ reportTextColor }});">
-<a id="reportTop" target="_blank" href="{{ currentPath }}"><img title="{{ 'General_GoTo'|translate("Piwik") }}" border="0" alt="Piwik" src='{{ logoHeader }}'/></a>
+<a id="reportTop" rel="noreferrer" target="_blank" href="{{ currentPath }}"><img title="{{ 'General_GoTo'|translate("Piwik") }}" border="0" alt="Piwik" src='{{ logoHeader }}'/></a>
<h1 style="color: rgb({{ reportTitleTextColor }}); font-size: {{ reportTitleTextSize }}pt;">
{{ reportTitle }}
diff --git a/plugins/CoreHome/templates/_dataTableCell.twig b/plugins/CoreHome/templates/_dataTableCell.twig
index 0b040fe86b..1dd22bf024 100644
--- a/plugins/CoreHome/templates/_dataTableCell.twig
+++ b/plugins/CoreHome/templates/_dataTableCell.twig
@@ -2,7 +2,7 @@
{% set tooltipIndex = column ~ '_tooltip' %}
{% if row.getMetadata(tooltipIndex) %}<span class="cell-tooltip" data-tooltip="{{ row.getMetadata(tooltipIndex) }}">{% endif %}
{% if not row.getIdSubDataTable() and column=='label' and row.getMetadata('url') %}
- <a target="_blank" href='{% if row.getMetadata('url')|slice(0,4) not in ['http','ftp:'] %}http://{% endif %}{{ row.getMetadata('url')|rawSafeDecoded }}'>
+ <a rel="noreferrer" target="_blank" href='{% if row.getMetadata('url')|slice(0,4) not in ['http','ftp:'] %}http://{% endif %}{{ row.getMetadata('url')|rawSafeDecoded }}'>
{% if not row.getMetadata('logo') %}
<img class="link" width="10" height="9" src="plugins/Morpheus/images/link.gif"/>
{% endif %}
diff --git a/plugins/CoreHome/templates/_donate.twig b/plugins/CoreHome/templates/_donate.twig
index 1fff9d4015..d7dbde58c2 100755
--- a/plugins/CoreHome/templates/_donate.twig
+++ b/plugins/CoreHome/templates/_donate.twig
@@ -37,7 +37,7 @@
title="{{ 'CoreHome_SubscribeAndBecomePiwikSupporter'|translate }}"/>
<a class="donate-spacer">{{ 'CoreHome_MakeOneTimeDonation'|translate }}</a>
<a href="index.php?module=CoreHome&action=redirectToPaypal&idSite=1&cmd=_s-xclick&hosted_button_id=RPL23NJURMTFA&bb2_screener_=1357583494+83.233.186.82"
- target="_blank" class="donate-one-time">{{ 'CoreHome_MakeOneTimeDonation'|translate }}</a>
+ rel="noreferrer" target="_blank" class="donate-one-time">{{ 'CoreHome_MakeOneTimeDonation'|translate }}</a>
</div>
<!-- to cache images -->
diff --git a/plugins/CoreHome/templates/_headerMessage.twig b/plugins/CoreHome/templates/_headerMessage.twig
index d25fc17bdc..0d13585f1a 100644
--- a/plugins/CoreHome/templates/_headerMessage.twig
+++ b/plugins/CoreHome/templates/_headerMessage.twig
@@ -31,12 +31,12 @@
<br/>
{% endif %}
{% if latest_version_available and isSuperUser %}
- {{ 'General_PiwikXIsAvailablePleaseUpdateNow'|translate(latest_version_available,"<br /><a href='index.php?module=CoreUpdater&amp;action=newVersionAvailable'>","</a>","<a href='?module=Proxy&amp;action=redirect&amp;url=http://piwik.org/changelog/' target='_blank'>","</a>")|raw }}
+ {{ 'General_PiwikXIsAvailablePleaseUpdateNow'|translate(latest_version_available,"<br /><a href='index.php?module=CoreUpdater&amp;action=newVersionAvailable'>","</a>","<a href='?module=Proxy&amp;action=redirect&amp;url=http://piwik.org/changelog/' rel='noreferrer' target='_blank'>","</a>")|raw }}
<br/>
{{ 'General_YouAreCurrentlyUsing'|translate(piwik_version) }}
{% elseif latest_version_available and not isPiwikDemo and hasSomeViewAccess and not isUserIsAnonymous %}
{% set updateSubject = 'General_NewUpdatePiwikX'|translate(latest_version_available)|e('url') %}
- {{ 'General_PiwikXIsAvailablePleaseNotifyPiwikAdmin'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/' target='_blank'>Piwik</a> <a href='?module=Proxy&action=redirect&url=http://piwik.org/changelog/' target='_blank'>" ~ latest_version_available ~ "</a>", "<a href='mailto:" ~ superUserEmails ~ "?subject=" ~ updateSubject ~ "'>", "</a>")|raw }}
+ {{ 'General_PiwikXIsAvailablePleaseNotifyPiwikAdmin'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/' rel='noreferrer' target='_blank'>Piwik</a> <a href='?module=Proxy&action=redirect&url=http://piwik.org/changelog/' rel='noreferrer' target='_blank'>" ~ latest_version_available ~ "</a>", "<a href='mailto:" ~ superUserEmails ~ "?subject=" ~ updateSubject ~ "'>", "</a>")|raw }}
{% elseif isSuperUser and adminMenu is defined and adminMenu %}
{{ updateCheck|raw }}
<br />
diff --git a/plugins/CoreHome/templates/_warningInvalidHost.twig b/plugins/CoreHome/templates/_warningInvalidHost.twig
index d3a2661a86..71d2716893 100644
--- a/plugins/CoreHome/templates/_warningInvalidHost.twig
+++ b/plugins/CoreHome/templates/_warningInvalidHost.twig
@@ -1,14 +1,14 @@
{# untrusted host warning #}
{% if (isValidHost is defined and invalidHostMessage is defined and isValidHost == false) %}
{% set invalidHostText %}
- <a style="float:right;" href="http://piwik.org/faq/troubleshooting/#faq_171" target="_blank"><img src="plugins/Morpheus/images/help.png"/></a>
+ <a style="float:right;" href="http://piwik.org/faq/troubleshooting/#faq_171" rel="noreferrer" target="_blank"><img src="plugins/Morpheus/images/help.png"/></a>
<strong>{{ 'General_Warning'|translate }}:&nbsp;</strong>{{ invalidHostMessage|raw }}
<br>
<br>
<small>{{ invalidHostMessageHowToFix|raw }}
- <br/><br/><a style="float:right;" href="http://piwik.org/faq/troubleshooting/#faq_171" target="_blank">{{ 'General_Help'|translate }}
+ <br/><br/><a style="float:right;" href="http://piwik.org/faq/troubleshooting/#faq_171" rel="noreferrer" target="_blank">{{ 'General_Help'|translate }}
<img style="vertical-align: bottom;" src="plugins/Morpheus/images/help.png"/></a><br/>
</small>
{% endset %}
diff --git a/plugins/CoreHome/templates/getPromoVideo.twig b/plugins/CoreHome/templates/getPromoVideo.twig
index 36d94381a9..0a0bd0fb63 100755
--- a/plugins/CoreHome/templates/getPromoVideo.twig
+++ b/plugins/CoreHome/templates/getPromoVideo.twig
@@ -8,7 +8,7 @@
</div>
</div>
- <a id="piwik-promo-videos-link" href="http://piwik.org/blog/2012/12/piwik-how-to-videos/" target="_blank">
+ <a id="piwik-promo-videos-link" href="http://piwik.org/blog/2012/12/piwik-how-to-videos/" rel="noreferrer" target="_blank">
{{ 'CoreHome_ViewAllPiwikVideoTutorials'|translate }}
</a>
@@ -16,12 +16,12 @@
<span>{{ 'CoreHome_ShareThis'|translate }}:</span>
{# facebook #}
- <a href="http://www.facebook.com/sharer.php?u={{ promoVideoUrl|url_encode }}" target="_blank">
+ <a href="http://www.facebook.com/sharer.php?u={{ promoVideoUrl|url_encode }}" rel="noreferrer" target="_blank">
<img src="plugins/Referrers/images/socials/facebook.com.png" />
</a>
{# twitter #}
- <a href="http://twitter.com/share?text={{ shareText|url_encode }}&url={{ promoVideoUrl|url_encode }}" target="_blank">
+ <a href="http://twitter.com/share?text={{ shareText|url_encode }}&url={{ promoVideoUrl|url_encode }}" rel="noreferrer" target="_blank">
<img src="plugins/Referrers/images/socials/twitter.com.png" />
</a>
diff --git a/plugins/CorePluginsAdmin/templates/browsePlugins.twig b/plugins/CorePluginsAdmin/templates/browsePlugins.twig
index 9259081a0c..2624dd00e9 100644
--- a/plugins/CorePluginsAdmin/templates/browsePlugins.twig
+++ b/plugins/CorePluginsAdmin/templates/browsePlugins.twig
@@ -55,6 +55,6 @@
{% set marketplaceSellPluginSubject = 'CorePluginsAdmin_MarketplaceSellPluginSubject'|translate %}
{{ 'CorePluginsAdmin_GetEarlyAccessForPaidPlugins'|translate("<a href='mailto:hello@piwik.org?subject=" ~ marketplaceSellPluginSubject ~ "'>", "</a>")|raw }}
<br/>
- {{ 'CorePluginsAdmin_DevelopersLearnHowToDevelopPlugins'|translate('<a href="?module=Proxy&action=redirect&url=http://developer.piwik.org/plugins" target="_blank">', '</a>')|raw }}
+ {{ 'CorePluginsAdmin_DevelopersLearnHowToDevelopPlugins'|translate('<a href="?module=Proxy&action=redirect&url=http://developer.piwik.org/plugins" rel="noreferrer" target="_blank">', '</a>')|raw }}
</div>
{% endblock %}
diff --git a/plugins/CorePluginsAdmin/templates/macros.twig b/plugins/CorePluginsAdmin/templates/macros.twig
index 8c057ed06f..3f6ad112c0 100644
--- a/plugins/CorePluginsAdmin/templates/macros.twig
+++ b/plugins/CorePluginsAdmin/templates/macros.twig
@@ -190,7 +190,7 @@
</div>
{% if plugin.info.license is defined %}
<div class="plugin-license">
- {% if plugin.info.license_homepage is defined %}<a title="{{ 'CorePluginsAdmin_LicenseHomepage'|translate }}" target="_blank" href="{{ plugin.info.license_homepage }}">{% endif %}{{ plugin.info.license }}{% if plugin.info.license_homepage is defined %}</a>{% endif %}
+ {% if plugin.info.license_homepage is defined %}<a title="{{ 'CorePluginsAdmin_LicenseHomepage'|translate }}" rel="noreferrer" target="_blank" href="{{ plugin.info.license_homepage }}">{% endif %}{{ plugin.info.license }}{% if plugin.info.license_homepage is defined %}</a>{% endif %}
</div>
{% endif %}
{% if plugin.info.authors is defined %}
@@ -200,7 +200,7 @@
{% spaceless %}
{% for author in plugin.info.authors if author.name %}
{% if author.homepage is defined %}
- <a title="{{ 'CorePluginsAdmin_AuthorHomepage'|translate }}" href="{{ author.homepage }}" target="_blank">{{ author.name }}</a>
+ <a title="{{ 'CorePluginsAdmin_AuthorHomepage'|translate }}" href="{{ author.homepage }}" rel="noreferrer" target="_blank">{{ author.name }}</a>
{% else %}
{{ author.name }}
{% endif %}
diff --git a/plugins/CorePluginsAdmin/templates/pluginDetails.twig b/plugins/CorePluginsAdmin/templates/pluginDetails.twig
index 2487ef41d6..077f3755c5 100644
--- a/plugins/CorePluginsAdmin/templates/pluginDetails.twig
+++ b/plugins/CorePluginsAdmin/templates/pluginDetails.twig
@@ -69,7 +69,7 @@
{{ pluginsMacro.missingRequirementsPleaseUpdateNotice(plugin) }}
{% if plugin.canBeUpdated %}
<p class="updateAvailableNotice">{{ 'CorePluginsAdmin_PluginUpdateAvailable'|translate(plugin.currentVersion, plugin.latestVersion) }}
- {% if plugin.repositoryChangelogUrl %}<a target="_blank" href="{{ plugin.repositoryChangelogUrl }}">{{ 'CorePluginsAdmin_ViewRepositoryChangelog'|translate }}</a>{% endif %}
+ {% if plugin.repositoryChangelogUrl %}<a rel="noreferrer" target="_blank" href="{{ plugin.repositoryChangelogUrl }}">{{ 'CorePluginsAdmin_ViewRepositoryChangelog'|translate }}</a>{% endif %}
</p>
{% endif %}
diff --git a/plugins/CorePluginsAdmin/templates/safemode.twig b/plugins/CorePluginsAdmin/templates/safemode.twig
index e2608c147e..4321d3f8c3 100644
--- a/plugins/CorePluginsAdmin/templates/safemode.twig
+++ b/plugins/CorePluginsAdmin/templates/safemode.twig
@@ -63,7 +63,8 @@
<p>
If this error continues to happen, you may be able to fix this issue by disabling one or more of
the Third-Party plugins. You can enable them again in the
- <a target="_blank" href="index.php?module=CorePluginsAdmin&action=plugins">Plugins</a> or <a target="_blank" href="index.php?module=CorePluginsAdmin&action=themes">Themes</a> page under
+ <a rel="noreferrer" target="_blank" href="index.php?module=CorePluginsAdmin&action=plugins">Plugins</a>
+ or <a target="_blank" href="index.php?module=CorePluginsAdmin&action=themes">Themes</a> page under
settings at any time.
{% if pluginCausesIssue %}
diff --git a/plugins/CoreUpdater/templates/oneClickResults.twig b/plugins/CoreUpdater/templates/oneClickResults.twig
index 555e1ef568..7696e724ae 100644
--- a/plugins/CoreUpdater/templates/oneClickResults.twig
+++ b/plugins/CoreUpdater/templates/oneClickResults.twig
@@ -14,7 +14,7 @@
<br/>
<div class="warning">
<img src="plugins/Morpheus/images/warning_medium.png"/>
- {{ 'CoreUpdater_UpdateHasBeenCancelledExplanation'|translate("<br /><br />","<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/update/'>","</a>")|raw }}
+ {{ 'CoreUpdater_UpdateHasBeenCancelledExplanation'|translate("<br /><br />","<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/update/'>","</a>")|raw }}
</div>
<br/>
<br/>
diff --git a/plugins/CoreUpdater/templates/runUpdaterAndExit_done.twig b/plugins/CoreUpdater/templates/runUpdaterAndExit_done.twig
index 0a2eaa5efe..8ddf66876d 100644
--- a/plugins/CoreUpdater/templates/runUpdaterAndExit_done.twig
+++ b/plugins/CoreUpdater/templates/runUpdaterAndExit_done.twig
@@ -1,6 +1,6 @@
{% extends '@CoreUpdater/layout.twig' %}
{% set helpMessage %}
- {{ 'CoreUpdater_HelpMessageContent'|translate('<a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/faq/">','</a>','</li><li>')|raw }}
+ {{ 'CoreUpdater_HelpMessageContent'|translate('<a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/faq/">','</a>','</li><li>')|raw }}
{% endset %}
{% block content %}
@@ -24,7 +24,7 @@
<ul>
<li>{{ 'CoreUpdater_ErrorDIYHelp_1'|translate }}</li>
<li>{{ 'CoreUpdater_ErrorDIYHelp_2'|translate }}</li>
- <li>{{ 'CoreUpdater_ErrorDIYHelp_3'|translate }} <a href='https://piwik.org/faq/how-to-update/#faq_179' target='_blank'>(see FAQ)</a></li>
+ <li>{{ 'CoreUpdater_ErrorDIYHelp_3'|translate }} <a href='https://piwik.org/faq/how-to-update/#faq_179' rel='noreferrer' target='_blank'>(see FAQ)</a></li>
<li>{{ 'CoreUpdater_ErrorDIYHelp_4'|translate }}</li>
<li>{{ 'CoreUpdater_ErrorDIYHelp_5'|translate }}</li>
</ul>
diff --git a/plugins/CoreUpdater/templates/runUpdaterAndExit_welcome.twig b/plugins/CoreUpdater/templates/runUpdaterAndExit_welcome.twig
index b6318e5c6a..c468beb3db 100644
--- a/plugins/CoreUpdater/templates/runUpdaterAndExit_welcome.twig
+++ b/plugins/CoreUpdater/templates/runUpdaterAndExit_welcome.twig
@@ -4,7 +4,7 @@
{% spaceless %}
<span style="float:right;">{{ postEvent('Template.topBar')|raw }}</span>
{% set helpMessage %}
- {{ 'CoreUpdater_HelpMessageContent'|translate('<a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/faq/">','</a>','</li><li>')|raw }}
+ {{ 'CoreUpdater_HelpMessageContent'|translate('<a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/faq/">','</a>','</li><li>')|raw }}
{% endset %}
{% if coreError %}
@@ -49,7 +49,7 @@
{% endif %}
<ul>
<li>{{ 'CoreUpdater_TheUpgradeProcessMayFailExecuteCommand'|translate(commandUpgradePiwik)|raw }}</li>
- <li>{{ 'CoreUpdater_HighTrafficPiwikServerEnableMaintenance'|translate('<a target="_blank" href="?module=Proxy&action=redirect&url=http%3A%2F%2Fpiwik.org%2Ffaq%2Fhow-to%2F%23faq_111">', '</a>')|raw }}</li>
+ <li>{{ 'CoreUpdater_HighTrafficPiwikServerEnableMaintenance'|translate('<a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http%3A%2F%2Fpiwik.org%2Ffaq%2Fhow-to%2F%23faq_111">', '</a>')|raw }}</li>
<li>{{ 'CoreUpdater_YouCouldManuallyExecuteSqlQueries'|translate }}<br/>
<a href="#titleUpdate" id="showSql" style="margin-left:20px;">› {{ 'CoreUpdater_ClickHereToViewSqlQueries'|translate }}</a>
diff --git a/plugins/CoreVisualizations/Visualizations/HtmlTable.php b/plugins/CoreVisualizations/Visualizations/HtmlTable.php
index b89b8d7452..dcd2374df9 100644
--- a/plugins/CoreVisualizations/Visualizations/HtmlTable.php
+++ b/plugins/CoreVisualizations/Visualizations/HtmlTable.php
@@ -51,7 +51,6 @@ class HtmlTable extends Visualization
}
if ($this->dataTable->getRowsCount()) {
-
$request = new ApiRequest(array(
'method' => 'API.get',
'module' => 'API',
diff --git a/plugins/CoreVisualizations/Visualizations/HtmlTable/AllColumns.php b/plugins/CoreVisualizations/Visualizations/HtmlTable/AllColumns.php
index 2ccd5a9e01..da9a82ac75 100644
--- a/plugins/CoreVisualizations/Visualizations/HtmlTable/AllColumns.php
+++ b/plugins/CoreVisualizations/Visualizations/HtmlTable/AllColumns.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
+use Piwik\DataTable;
use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
use Piwik\View;
@@ -36,7 +37,7 @@ class AllColumns extends HtmlTable
$properties = $this->config;
- $this->dataTable->filter(function ($dataTable) use ($properties) {
+ $this->dataTable->filter(function (DataTable $dataTable) use ($properties) {
$columnsToDisplay = array('label', 'nb_visits');
if (in_array('nb_uniq_visitors', $dataTable->getColumns())) {
@@ -60,11 +61,4 @@ class AllColumns extends HtmlTable
$properties->columns_to_display = $columnsToDisplay;
});
}
-
- public function afterGenericFiltersAreAppliedToLoadedDataTable()
- {
- $prettifyTime = array('\Piwik\MetricsFormatter', 'getPrettyTimeFromSeconds');
-
- $this->dataTable->filter('ColumnCallbackReplace', array('avg_time_on_site', $prettifyTime));
- }
-}
+} \ No newline at end of file
diff --git a/plugins/CoreVisualizations/templates/_dataTableViz_tagCloud.twig b/plugins/CoreVisualizations/templates/_dataTableViz_tagCloud.twig
index 1513daca34..d7f328b923 100644
--- a/plugins/CoreVisualizations/templates/_dataTableViz_tagCloud.twig
+++ b/plugins/CoreVisualizations/templates/_dataTableViz_tagCloud.twig
@@ -5,7 +5,7 @@
{# we strike tags with 0 hits #}
{% if value.value == 0 %}valueIsZero{% endif %}">
{% if labelMetadata[value.word].url is not sameas(false) %}
- <a href="{{ labelMetadata[value.word].url }}" target="_blank">
+ <a href="{{ labelMetadata[value.word].url }}" rel="noreferrer" target="_blank">
{% endif %}
{% if labelMetadata[value.word].logo is not sameas(false) %}
<img src="{{ labelMetadata[value.word].logo }}" width="{{ value.logoWidth }}" />
diff --git a/plugins/CustomVariables/API.php b/plugins/CustomVariables/API.php
index 1f03f873fe..727ef7d42c 100644
--- a/plugins/CustomVariables/API.php
+++ b/plugins/CustomVariables/API.php
@@ -16,7 +16,7 @@ use Piwik\Piwik;
use Piwik\Plugins\Actions\Actions\ActionSiteSearch;
/**
- * The Custom Variables API lets you access reports for your <a href='http://piwik.org/docs/custom-variables/' target='_blank'>Custom Variables</a> names and values.
+ * The Custom Variables API lets you access reports for your <a href='http://piwik.org/docs/custom-variables/' rel='noreferrer' target='_blank'>Custom Variables</a> names and values.
*
* @method static \Piwik\Plugins\CustomVariables\API getInstance()
*/
diff --git a/plugins/CustomVariables/Reports/GetCustomVariables.php b/plugins/CustomVariables/Reports/GetCustomVariables.php
index 3edc0d276c..2ddedc4e97 100644
--- a/plugins/CustomVariables/Reports/GetCustomVariables.php
+++ b/plugins/CustomVariables/Reports/GetCustomVariables.php
@@ -20,7 +20,7 @@ class GetCustomVariables extends Base
$this->dimension = new CustomVariableName();
$this->name = Piwik::translate('CustomVariables_CustomVariables');
$this->documentation = Piwik::translate('CustomVariables_CustomVariablesReportDocumentation',
- array('<br />', '<a href="http://piwik.org/docs/custom-variables/" target="_blank">', '</a>'));
+ array('<br />', '<a href="http://piwik.org/docs/custom-variables/" rel="noreferrer" target="_blank">', '</a>'));
$this->actionToLoadSubTables = 'getCustomVariablesValuesFromNameId';
$this->order = 10;
$this->widgetTitle = 'CustomVariables_CustomVariables';
diff --git a/plugins/CustomVariables/Reports/GetCustomVariablesValuesFromNameId.php b/plugins/CustomVariables/Reports/GetCustomVariablesValuesFromNameId.php
index 8b88fb20bb..e4f57af4fc 100644
--- a/plugins/CustomVariables/Reports/GetCustomVariablesValuesFromNameId.php
+++ b/plugins/CustomVariables/Reports/GetCustomVariablesValuesFromNameId.php
@@ -20,7 +20,7 @@ class GetCustomVariablesValuesFromNameId extends Base
$this->dimension = new CustomVariableValue();
$this->name = Piwik::translate('CustomVariables_CustomVariables');
$this->documentation = Piwik::translate('CustomVariables_CustomVariablesReportDocumentation',
- array('<br />', '<a href="http://piwik.org/docs/custom-variables/" target="_blank">', '</a>'));
+ array('<br />', '<a href="http://piwik.org/docs/custom-variables/" rel="noreferrer" target="_blank">', '</a>'));
$this->isSubtableReport = true;
$this->order = 15;
}
diff --git a/plugins/DBStats/Controller.php b/plugins/DBStats/Controller.php
index de36313264..1e8aad1311 100644
--- a/plugins/DBStats/Controller.php
+++ b/plugins/DBStats/Controller.php
@@ -8,7 +8,7 @@
*/
namespace Piwik\Plugins\DBStats;
-use Piwik\MetricsFormatter;
+use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use Piwik\Plugins\DBStats\Reports\GetAdminDataSummary;
use Piwik\Plugins\DBStats\Reports\GetDatabaseUsageSummary;
@@ -42,9 +42,10 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
list($siteCount, $userCount, $totalSpaceUsed) = API::getInstance()->getGeneralInformation();
- $view->siteCount = MetricsFormatter::getPrettyNumber($siteCount);
- $view->userCount = MetricsFormatter::getPrettyNumber($userCount);
- $view->totalSpaceUsed = MetricsFormatter::getPrettySizeFromBytes($totalSpaceUsed);
+ $formatter = new Formatter();
+ $view->siteCount = $formatter->getPrettyNumber($siteCount);
+ $view->userCount = $formatter->getPrettyNumber($userCount);
+ $view->totalSpaceUsed = $formatter->getPrettySizeFromBytes($totalSpaceUsed);
return $view->render();
}
diff --git a/plugins/DBStats/Reports/Base.php b/plugins/DBStats/Reports/Base.php
index a37452a6a3..c32e2d7410 100644
--- a/plugins/DBStats/Reports/Base.php
+++ b/plugins/DBStats/Reports/Base.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Plugins\DBStats\Reports;
+use Piwik\Metrics\Formatter;
use Piwik\Option;
use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
@@ -17,7 +18,6 @@ use Piwik\Plugins\DBStats\DBStats;
abstract class Base extends \Piwik\Plugin\Report
{
-
public function isEnabled()
{
return Piwik::hasUserSuperUserAccess();
@@ -119,7 +119,9 @@ abstract class Base extends \Piwik\Plugin\Report
$view->config->selectable_rows = array();
}
- $getPrettySize = array('\Piwik\MetricsFormatter', 'getPrettySizeFromBytes');
+ $formatter = new Formatter();
+
+ $getPrettySize = array($formatter, 'getPrettySizeFromBytes');
$params = !isset($fixedMemoryUnit) ? array() : array($fixedMemoryUnit);
$view->config->filters[] = function ($dataTable) use ($sizeColumns, $getPrettySize, $params) {
@@ -135,7 +137,7 @@ abstract class Base extends \Piwik\Plugin\Report
$view->config->filters[] = array('ColumnCallbackReplace', array($sizeColumns, $replaceSpaces));
}
- $getPrettyNumber = array('\Piwik\MetricsFormatter', 'getPrettyNumber');
+ $getPrettyNumber = array($formatter, 'getPrettyNumber');
$view->config->filters[] = array('ColumnCallbackReplace', array('row_count', $getPrettyNumber));
}
diff --git a/plugins/DBStats/templates/index.twig b/plugins/DBStats/templates/index.twig
index 32a8e78d08..3d0d578f26 100755
--- a/plugins/DBStats/templates/index.twig
+++ b/plugins/DBStats/templates/index.twig
@@ -5,7 +5,7 @@
<h2 id="databaseUsageSummary">{{ 'DBStats_DatabaseUsage'|translate }}</h2>
<p>
{{ 'DBStats_MainDescription'|translate(totalSpaceUsed) }}<br/>
- {{ 'DBStats_LearnMore'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/setup-auto-archiving/' target='_blank'>Piwik Auto Archiving</a>")|raw }}
+ {{ 'DBStats_LearnMore'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/setup-auto-archiving/' rel='noreferrer' target='_blank'>Piwik Auto Archiving</a>")|raw }}
<br/>
<br/>
</p>
diff --git a/plugins/Dashboard/API.php b/plugins/Dashboard/API.php
index 21003135c5..ec41bb626f 100644
--- a/plugins/Dashboard/API.php
+++ b/plugins/Dashboard/API.php
@@ -11,7 +11,7 @@ use Piwik\Piwik;
use Piwik\WidgetsList;
/**
- * This API is the <a href='http://piwik.org/docs/analytics-api/reference/' target='_blank'>Dashboard API</a>: it gives information about dashboards.
+ * This API is the <a href='http://piwik.org/docs/analytics-api/reference/' rel='noreferrer' target='_blank'>Dashboard API</a>: it gives information about dashboards.
*
* @method static \Piwik\Plugins\Dashboard\API getInstance()
*/
diff --git a/plugins/Events/API.php b/plugins/Events/API.php
index 890979db2c..d81144f855 100644
--- a/plugins/Events/API.php
+++ b/plugins/Events/API.php
@@ -217,14 +217,5 @@ class API extends \Piwik\Plugin\API
$row->setColumn('label', Piwik::translate('General_NotDefined', Piwik::translate('Events_EventName')));
}
});
-
- // add processed metric avg_event_value
- $dataTable->queueFilter('ColumnCallbackAddColumnQuotient',
- array('avg_event_value',
- 'sum_event_value',
- 'nb_events_with_value',
- $precision = 2,
- $shouldSkipRows = true)
- );
}
} \ No newline at end of file
diff --git a/plugins/Events/Columns/Metrics/AverageEventValue.php b/plugins/Events/Columns/Metrics/AverageEventValue.php
new file mode 100644
index 0000000000..7efb513729
--- /dev/null
+++ b/plugins/Events/Columns/Metrics/AverageEventValue.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Events\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * The average value for a triggered event. Calculated as:
+ *
+ * sum_event_value / nb_events_with_value
+ *
+ * sum_event_value and nb_events_with_value are calculated by the Event archiver.
+ */
+class AverageEventValue extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'avg_event_value';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('Events_AvgValueDocumentation');
+ }
+
+ public function compute(Row $row)
+ {
+ $sumEventValue = $this->getMetric($row, 'sum_event_value');
+ $eventsWithValue = $this->getMetric($row, 'nb_events_with_value');
+
+ return Piwik::getQuotientSafe($sumEventValue, $eventsWithValue, $precision = 2);
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('sum_event_value', 'nb_events_with_value');
+ }
+} \ No newline at end of file
diff --git a/plugins/Events/Reports/Base.php b/plugins/Events/Reports/Base.php
index 2caf9b6a75..4430b31407 100644
--- a/plugins/Events/Reports/Base.php
+++ b/plugins/Events/Reports/Base.php
@@ -9,13 +9,16 @@
namespace Piwik\Plugins\Events\Reports;
use Piwik\Plugins\Events\API;
+use Piwik\Plugins\Events\Columns\Metrics\AverageEventValue;
abstract class Base extends \Piwik\Plugin\Report
{
protected function init()
{
$this->category = 'Events_Events';
- $this->processedMetrics = false;
+ $this->processedMetrics = array(
+ new AverageEventValue()
+ );
$this->widgetParams = array(
'secondaryDimension' => API::getInstance()->getDefaultSecondaryDimension($this->action)
diff --git a/plugins/Events/Reports/GetAction.php b/plugins/Events/Reports/GetAction.php
index 4fa80bf4e1..84f750e264 100644
--- a/plugins/Events/Reports/GetAction.php
+++ b/plugins/Events/Reports/GetAction.php
@@ -20,7 +20,7 @@ class GetAction extends Base
$this->dimension = new EventAction();
$this->name = Piwik::translate('Events_EventActions');
$this->documentation = ''; // TODO
- $this->metrics = array('nb_events', 'sum_event_value', 'min_event_value', 'max_event_value', 'avg_event_value', 'nb_events_with_value');
+ $this->metrics = array('nb_events', 'sum_event_value', 'min_event_value', 'max_event_value', 'nb_events_with_value');
if (Common::getRequestVar('secondaryDimension', false) == 'eventCategory') {
$this->actionToLoadSubTables = 'getCategoryFromNameId';
} else {
diff --git a/plugins/Events/Reports/GetCategory.php b/plugins/Events/Reports/GetCategory.php
index 9d3817cd71..be867705ea 100644
--- a/plugins/Events/Reports/GetCategory.php
+++ b/plugins/Events/Reports/GetCategory.php
@@ -20,7 +20,7 @@ class GetCategory extends Base
$this->dimension = new EventCategory();
$this->name = Piwik::translate('Events_EventCategories');
$this->documentation = ''; // TODO
- $this->metrics = array('nb_events', 'sum_event_value', 'min_event_value', 'max_event_value', 'avg_event_value', 'nb_events_with_value');
+ $this->metrics = array('nb_events', 'sum_event_value', 'min_event_value', 'max_event_value', 'nb_events_with_value');
if (Common::getRequestVar('secondaryDimension', false) == 'eventName') {
$this->actionToLoadSubTables = 'getNameFromCategoryId';
} else {
diff --git a/plugins/Events/Reports/GetName.php b/plugins/Events/Reports/GetName.php
index 1f97eb7099..aa21f968be 100644
--- a/plugins/Events/Reports/GetName.php
+++ b/plugins/Events/Reports/GetName.php
@@ -20,7 +20,7 @@ class GetName extends Base
$this->dimension = new EventName();
$this->name = Piwik::translate('Events_EventNames');
$this->documentation = ''; // TODO
- $this->metrics = array('nb_events', 'sum_event_value', 'min_event_value', 'max_event_value', 'avg_event_value', 'nb_events_with_value');
+ $this->metrics = array('nb_events', 'sum_event_value', 'min_event_value', 'max_event_value', 'nb_events_with_value');
if (Common::getRequestVar('secondaryDimension', false) == 'eventCategory') {
$this->actionToLoadSubTables = 'getCategoryFromNameId';
} else {
diff --git a/plugins/ExampleAPI/API.php b/plugins/ExampleAPI/API.php
index 63e66fac9b..f0d331c010 100644
--- a/plugins/ExampleAPI/API.php
+++ b/plugins/ExampleAPI/API.php
@@ -16,7 +16,7 @@ use Piwik\Version;
/**
* The ExampleAPI is useful to developers building a custom Piwik plugin.
*
- * Please see the <a href='https://github.com/piwik/piwik/blob/master/plugins/ExampleAPI/API.php' target='_blank'>source code in in the file plugins/ExampleAPI/API.php</a> for more documentation.
+ * Please see the <a href='https://github.com/piwik/piwik/blob/master/plugins/ExampleAPI/API.php' rel='noreferrer' target='_blank'>source code in in the file plugins/ExampleAPI/API.php</a> for more documentation.
* @method static \Piwik\Plugins\ExampleAPI\API getInstance()
*/
class API extends \Piwik\Plugin\API
diff --git a/plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml b/plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml
index c04d73d2c7..9327934fa5 100644
--- a/plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml
+++ b/plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml
@@ -5,22 +5,18 @@
<nb_users>0</nb_users>
<nb_actions>4</nb_actions>
<max_actions>2</max_actions>
- <bounce_rate>0%</bounce_rate>
- <nb_actions_per_visit>2</nb_actions_per_visit>
- <avg_time_on_site>632</avg_time_on_site>
+ <bounce_count>0</bounce_count>
+ <sum_visit_length>1264</sum_visit_length>
<nb_visits_returning>0</nb_visits_returning>
<nb_actions_returning>0</nb_actions_returning>
<nb_uniq_visitors_returning>0</nb_uniq_visitors_returning>
- <sum_visit_length_returning>0</sum_visit_length_returning>
<nb_users_returning>0</nb_users_returning>
- <nb_visits_converted_returning>0</nb_visits_converted_returning>
<max_actions_returning>0</max_actions_returning>
<bounce_rate_returning>0%</bounce_rate_returning>
<nb_actions_per_visit_returning>0</nb_actions_per_visit_returning>
<avg_time_on_site_returning>0</avg_time_on_site_returning>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>50</conversion_rate>
<revenue>2541</revenue>
<nb_pageviews>3</nb_pageviews>
<nb_uniq_pageviews>3</nb_uniq_pageviews>
@@ -30,5 +26,8 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>1</nb_searches>
<nb_keywords>1</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
+ <conversion_rate>50%</conversion_rate>
+ <bounce_rate>0%</bounce_rate>
+ <nb_actions_per_visit>2</nb_actions_per_visit>
+ <avg_time_on_site>632</avg_time_on_site>
</result> \ No newline at end of file
diff --git a/plugins/ExampleRssWidget/RssRenderer.php b/plugins/ExampleRssWidget/RssRenderer.php
index 7990b1acb8..829b6dfa2c 100644
--- a/plugins/ExampleRssWidget/RssRenderer.php
+++ b/plugins/ExampleRssWidget/RssRenderer.php
@@ -62,7 +62,7 @@ class RssRenderer
$date = @strftime("%B %e, %Y", strtotime($post->pubDate));
$link = $post->link;
- $output .= '<li><a class="rss-title" title="" target="_blank" href="?module=Proxy&action=redirect&url=' . $link . '">' . $title . '</a>' .
+ $output .= '<li><a class="rss-title" title="" rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=' . $link . '">' . $title . '</a>' .
'<span class="rss-date">' . $date . '</span>';
if ($this->showDescription) {
$output .= '<div class="rss-description">' . $post->description . '</div>';
diff --git a/plugins/Feedback/templates/index.twig b/plugins/Feedback/templates/index.twig
index e72ad2a5da..ba194dc9eb 100644
--- a/plugins/Feedback/templates/index.twig
+++ b/plugins/Feedback/templates/index.twig
@@ -12,13 +12,13 @@
<div class="header_full">
<p>{{ 'General_PiwikIsACollaborativeProjectYouCanContributeAndDonate'|translate(
- "<a href='?module=Proxy&action=redirect&url=http://piwik.org' target='_blank'>",
+ "<a href='?module=Proxy&action=redirect&url=http://piwik.org' rel='noreferrer' target='_blank'>",
"</a>",
- "<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/get-involved/'>",
+ "<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/get-involved/'>",
"</a>",
"<a href='#donate'>",
"</a>",
- "<a href='?module=Proxy&action=redirect&url=http://piwik.org/team/' target='_blank'>",
+ "<a href='?module=Proxy&action=redirect&url=http://piwik.org/team/' rel='noreferrer' target='_blank'>",
"</a>"
)|raw }}
</p>
@@ -28,9 +28,9 @@
<h2>{{ 'Do you need help?'|translate }}</h2>
<div class="header_full">
- <p> &bull; {{ 'Feedback_ViewUserGuides'|translate("<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/'>","</a>")|raw }}.</p>
- <p> &bull; {{ 'Feedback_ViewAnswersToFAQ'|translate("<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/faq/'>","</a>")|raw }}.</p>
- <p> &bull; {{ 'Feedback_VisitTheForums'|translate("<a target='_blank' href='?module=Proxy&action=redirect&url=http://forum.piwik.org/'>","</a>")|raw }}.</p>
+ <p> &bull; {{ 'Feedback_ViewUserGuides'|translate("<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/'>","</a>")|raw }}.</p>
+ <p> &bull; {{ 'Feedback_ViewAnswersToFAQ'|translate("<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/faq/'>","</a>")|raw }}.</p>
+ <p> &bull; {{ 'Feedback_VisitTheForums'|translate("<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=http://forum.piwik.org/'>","</a>")|raw }}.</p>
<br/>
</div>
@@ -38,13 +38,13 @@
<div class="header_full">
<p>{{ 'Feedback_HowToCreateTicket'|translate(
- "<a target='_blank' href='?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/core-team-workflow%23submitting-a-bug-report'>",
+ "<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/core-team-workflow%23submitting-a-bug-report'>",
"</a>",
- "<a target='_blank' href='?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/core-team-workflow%23submitting-a-feature-request'>",
+ "<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/core-team-workflow%23submitting-a-feature-request'>",
"</a>",
- "<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues'>",
+ "<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues'>",
"</a>",
- "<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/new'>",
+ "<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/new'>",
"</a>"
)|raw }}</p>
<br/>
@@ -54,7 +54,7 @@
<div class="header_full">
<p>{{ 'Feedback_GetInTouch'|translate }}
- <a target='_blank' href="?module=Proxy&action=redirect&url=http://piwik.org/contact/"
+ <a rel='noreferrer' target='_blank' href="?module=Proxy&action=redirect&url=http://piwik.org/contact/"
>{{ 'Feedback_ContactThePiwikTeam'|translate }}</a>
</p>
<br/>
@@ -68,35 +68,35 @@
<hr/>
<ul class="social">
<li>
- <a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/newsletter/"><img class="icon" src="plugins/Feedback/images/newsletter.png"></a>
- <a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/newsletter/">Newsletter</a>
+ <a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/newsletter/"><img class="icon" src="plugins/Feedback/images/newsletter.png"></a>
+ <a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/newsletter/">Newsletter</a>
</li>
<li>
- <a target="_blank" href="http://www.facebook.com/Piwik"><img class="icon" src="plugins/Feedback/images/facebook.png"></a>
- <a target="_blank" href="http://www.facebook.com/Piwik">Facebook</a>
+ <a rel="noreferrer" target="_blank" href="http://www.facebook.com/Piwik"><img class="icon" src="plugins/Feedback/images/facebook.png"></a>
+ <a rel="noreferrer" target="_blank" href="http://www.facebook.com/Piwik">Facebook</a>
</li>
<li>
- <a target="_blank" href="http://twitter.com/piwik"><img class="icon" src="plugins/Feedback/images/twitter.png"></a>
- <a target="_blank" href="http://twitter.com/piwik">Twitter</a>
+ <a rel="noreferrer" target="_blank" href="http://twitter.com/piwik"><img class="icon" src="plugins/Feedback/images/twitter.png"></a>
+ <a rel="noreferrer" target="_blank" href="http://twitter.com/piwik">Twitter</a>
</li>
<li>
- <a target="_blank" href="http://www.linkedin.com/groups?gid=867857"><img class="icon" src="plugins/Feedback/images/linkedin.png"></a>
- <a target="_blank" href="http://www.linkedin.com/groups?gid=867857">Linkedin</a>
+ <a rel="noreferrer" target="_blank" href="http://www.linkedin.com/groups?gid=867857"><img class="icon" src="plugins/Feedback/images/linkedin.png"></a>
+ <a rel="noreferrer" target="_blank" href="http://www.linkedin.com/groups?gid=867857">Linkedin</a>
</li>
<li>
- <a target="_blank" href="https://github.com/piwik/piwik"><img class="icon" src="plugins/Feedback/images/github.png"></a>
- <a target="_blank" href="https://github.com/piwik/piwik">GitHub</a>
+ <a rel="noreferrer" target="_blank" href="https://github.com/piwik/piwik"><img class="icon" src="plugins/Feedback/images/github.png"></a>
+ <a rel="noreferrer" target="_blank" href="https://github.com/piwik/piwik">GitHub</a>
</li>
</ul>
<ul class="menu">
- <li><a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/blog/">Blog</a></li>
- <li><a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/about/sponsors/">Sponsors</a></li>
- <li><a target="_blank" href="?module=Proxy&action=redirect&url=http://developer.piwik.org">Developers</a></li>
- <li><a target="_blank" href="?module=Proxy&action=redirect&url=http://plugins.piwik.org">Marketplace</a></li>
- <li><a target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/thank-you-all/">Credits</a></li>
+ <li><a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/blog/">Blog</a></li>
+ <li><a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/about/sponsors/">Sponsors</a></li>
+ <li><a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://developer.piwik.org">Developers</a></li>
+ <li><a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://plugins.piwik.org">Marketplace</a></li>
+ <li><a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://piwik.org/thank-you-all/">Credits</a></li>
</ul>
<p class="claim"><small>{{ 'Feedback_PrivacyClaim'|translate(
- "<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/privacy/'>",
+ "<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/privacy/'>",
"</a>"
)|raw}}</small></p>
</div>
diff --git a/plugins/Goals/API.php b/plugins/Goals/API.php
index 735b647866..acd99d9a82 100644
--- a/plugins/Goals/API.php
+++ b/plugins/Goals/API.php
@@ -10,11 +10,15 @@ namespace Piwik\Plugins\Goals;
use Exception;
use Piwik\Archive;
+use Piwik\Cache\PluginAwareStaticCache;
use Piwik\Common;
use Piwik\DataTable;
use Piwik\Db;
use Piwik\Metrics;
use Piwik\Piwik;
+use Piwik\Plugin\Report;
+use Piwik\Plugins\CoreHome\Columns\Metrics\ConversionRate;
+use Piwik\Plugins\Goals\Columns\Metrics\AverageOrderRevenue;
use Piwik\Site;
use Piwik\Tracker\Cache;
use Piwik\Tracker\GoalManager;
@@ -35,7 +39,7 @@ use Piwik\Tracker\GoalManager;
* If you wish to request specific metrics about Ecommerce goals, you can set the parameter &idGoal=ecommerceAbandonedCart to get metrics about abandoned carts (including Lost revenue, and number of items left in the cart)
* or &idGoal=ecommerceOrder to get metrics about Ecommerce orders (number of orders, visits with an order, subtotal, tax, shipping, discount, revenue, items ordered)
*
- * See also the documentation about <a href='http://piwik.org/docs/tracking-goals-web-analytics/' target='_blank'>Tracking Goals</a> in Piwik.
+ * See also the documentation about <a href='http://piwik.org/docs/tracking-goals-web-analytics/' rel='noreferrer' target='_blank'>Tracking Goals</a> in Piwik.
*
* @method static \Piwik\Plugins\Goals\API getInstance()
*/
@@ -51,29 +55,31 @@ class API extends \Piwik\Plugin\API
*/
public function getGoals($idSite)
{
- //TODO calls to this function could be cached as static
- // would help UI at least, since some UI requests would call this 2-3 times..
- $idSite = Site::getIdSitesFromIdSitesString($idSite);
+ $cache = $this->getGoalsInfoStaticCache($idSite);
+ if (!$cache->has()) {
+ $idSite = Site::getIdSitesFromIdSitesString($idSite);
- if (empty($idSite)) {
- return array();
- }
+ if (empty($idSite)) {
+ return array();
+ }
- Piwik::checkUserHasViewAccess($idSite);
+ Piwik::checkUserHasViewAccess($idSite);
- $goals = $this->getModel()->getActiveGoals($idSite);
+ $goals = $this->getModel()->getActiveGoals($idSite);
- $cleanedGoals = array();
- foreach ($goals as &$goal) {
- if ($goal['match_attribute'] == 'manually') {
- unset($goal['pattern']);
- unset($goal['pattern_type']);
- unset($goal['case_sensitive']);
+ $cleanedGoals = array();
+ foreach ($goals as &$goal) {
+ if ($goal['match_attribute'] == 'manually') {
+ unset($goal['pattern']);
+ unset($goal['pattern_type']);
+ unset($goal['case_sensitive']);
+ }
+ $cleanedGoals[$goal['idgoal']] = $goal;
}
- $cleanedGoals[$goal['idgoal']] = $goal;
- }
- return $cleanedGoals;
+ $cache->set($cleanedGoals);
+ }
+ return $cache->get();
}
/**
@@ -113,6 +119,8 @@ class API extends \Piwik\Plugin\API
$idGoal = $this->getModel()->createGoalForSite($idSite, $goal);
+ $this->getGoalsInfoStaticCache($idSite)->clear();
+
Cache::regenerateCacheWebsiteAttributes($idSite);
return $idGoal;
}
@@ -158,6 +166,8 @@ class API extends \Piwik\Plugin\API
'revenue' => $revenue,
));
+ $this->getGoalsInfoStaticCache($idSite)->clear();
+
Cache::regenerateCacheWebsiteAttributes($idSite);
}
@@ -196,6 +206,8 @@ class API extends \Piwik\Plugin\API
$this->getModel()->deleteGoal($idSite, $idGoal);
$this->getModel()->deleteGoalConversions($idSite, $idGoal);
+ $this->getGoalsInfoStaticCache($idSite)->clear();
+
Cache::regenerateCacheWebsiteAttributes($idSite);
}
@@ -221,7 +233,7 @@ class API extends \Piwik\Plugin\API
// First rename the avg_price_viewed column
$renameColumn = array(self::AVG_PRICE_VIEWED => 'avg_price');
- $dataTable->queueFilter('ReplaceColumnNames', array($renameColumn));
+ $dataTable->filter('ReplaceColumnNames', array($renameColumn));
$dataTable->queueFilter('ReplaceColumnNames');
$dataTable->queueFilter('ReplaceSummaryRowLabel');
@@ -232,17 +244,8 @@ class API extends \Piwik\Plugin\API
$dataTable->renameColumn(Metrics::INDEX_ECOMMERCE_ORDERS, $ordersColumn);
}
- // Average price = sum product revenue / quantity
- $dataTable->queueFilter('ColumnCallbackAddColumnQuotient', array('avg_price', 'price', $ordersColumn, GoalManager::REVENUE_PRECISION));
-
- // Average quantity = sum product quantity / abandoned carts
- $dataTable->queueFilter('ColumnCallbackAddColumnQuotient',
- array('avg_quantity', 'quantity', $ordersColumn, $precision = 1));
$dataTable->queueFilter('ColumnDelete', array('price'));
- // Product conversion rate = orders / visits
- $dataTable->queueFilter('ColumnCallbackAddColumnPercentage', array('conversion_rate', $ordersColumn, 'nb_visits', GoalManager::REVENUE_PRECISION));
-
return $dataTable;
}
@@ -338,59 +341,50 @@ class API extends \Piwik\Plugin\API
{
Piwik::checkUserHasViewAccess($idSite);
$archive = Archive::build($idSite, $period, $date, $segment);
- $columns = Piwik::getArrayFromApiParameter($columns);
// Mapping string idGoal to internal ID
$idGoal = self::convertSpecialGoalIds($idGoal);
+ $isEcommerceGoal = $idGoal === GoalManager::IDGOAL_ORDER || $idGoal === GoalManager::IDGOAL_CART;
- if (empty($columns)) {
- $columns = Goals::getGoalColumns($idGoal);
- if ($idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER) {
- $columns[] = 'avg_order_revenue';
- }
- }
- if (in_array('avg_order_revenue', $columns)
- && $idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER
+ $allMetrics = Goals::getGoalColumns($idGoal);
+ $requestedColumns = Piwik::getArrayFromApiParameter($columns);
+
+ $report = Report::factory("Goals", "get");
+ $columnsToGet = $report->getMetricsRequiredForReport($allMetrics, $requestedColumns);
+
+ $inDbMetricNames = array_map(function ($name) use ($idGoal) {
+ return $name == 'nb_visits' ? $name : Archiver::getRecordName($name, $idGoal);
+ }, $columnsToGet);
+ $dataTable = $archive->getDataTableFromNumeric($inDbMetricNames);
+
+ $newNameMapping = array_combine($inDbMetricNames, $columnsToGet);
+ $dataTable->filter('ReplaceColumnNames', array($newNameMapping));
+
+ // TODO: this should be in Goals/Get.php but it depends on idGoal parameter which isn't always in _GET (ie,
+ // it's not in ProcessedReport.php). more refactoring must be done to report class before this can be
+ // corrected.
+ if ((in_array('avg_order_revenue', $requestedColumns)
+ || empty($requestedColumns))
+ && $isEcommerceGoal
) {
- $columns[] = 'nb_conversions';
- $columns[] = 'revenue';
- $columns = array_values(array_unique($columns));
+ $dataTable->filter(function (DataTable $table) {
+ $extraProcessedMetrics = $table->getMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME);
+ $extraProcessedMetrics[] = new AverageOrderRevenue();
+ $table->setMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME, $extraProcessedMetrics);
+ });
}
- $columnsToSelect = array();
- foreach ($columns as &$columnName) {
- $columnsToSelect[] = Archiver::getRecordName($columnName, $idGoal);
- }
- $dataTable = $archive->getDataTableFromNumeric($columnsToSelect);
- // Rewrite column names as we expect them
- foreach ($columnsToSelect as $id => $oldName) {
- $dataTable->renameColumn($oldName, $columns[$id]);
- }
- if ($idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER) {
- if ($dataTable instanceof DataTable\Map) {
- foreach ($dataTable->getDataTables() as $row) {
- $this->enrichTable($row);
- }
- } else {
- $this->enrichTable($dataTable);
- }
+ // remove temporary metrics that were not explicitly requested
+ $allColumns = $allMetrics;
+ $allColumns[] = 'conversion_rate';
+ if ($isEcommerceGoal) {
+ $allColumns[] = 'avg_order_revenue';
}
- return $dataTable;
- }
- protected function enrichTable($table)
- {
- $row = $table->getFirstRow();
- if (!$row) {
- return;
- }
- // AVG order per visit
- if (false !== $table->getColumn('avg_order_revenue')) {
- $conversions = $row->getColumn('nb_conversions');
- if ($conversions) {
- $row->setColumn('avg_order_revenue', round($row->getColumn('revenue') / $conversions, 2));
- }
- }
+ $columnsToShow = $requestedColumns ?: $allColumns;
+ $dataTable->queueFilter('ColumnDelete', array($columnsToRemove = array(), $columnsToShow));
+
+ return $dataTable;
}
protected function getNumeric($idSite, $period, $date, $segment, $toFetch)
@@ -422,7 +416,9 @@ class API extends \Piwik\Plugin\API
*/
public function getConversionRate($idSite, $period, $date, $segment = false, $idGoal = false)
{
- return $this->getNumeric($idSite, $period, $date, $segment, Archiver::getRecordName('conversion_rate', $idGoal));
+ $table = $this->get($idSite, $period, $date, $segment, $idGoal, 'conversion_rate');
+ $table->setMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME, array(new ConversionRate()));
+ return $table;
}
/**
@@ -570,4 +566,9 @@ class API extends \Piwik\Plugin\API
$this->renameNotDefinedRow($dataTable, $notDefinedStringPretty);
}
}
+
+ private function getGoalsInfoStaticCache($idSite)
+ {
+ return new PluginAwareStaticCache("Goals.getGoals.$idSite");
+ }
}
diff --git a/plugins/Goals/Archiver.php b/plugins/Goals/Archiver.php
index 146cdccd6f..379752a6e2 100644
--- a/plugins/Goals/Archiver.php
+++ b/plugins/Goals/Archiver.php
@@ -154,7 +154,6 @@ class Archiver extends \Piwik\Plugin\Archiver
// Stats for all goals
$nbConvertedVisits = $this->getProcessor()->getNumberOfVisitsConverted();
$metrics = array(
- self::getRecordName('conversion_rate') => $this->getConversionRate($nbConvertedVisits),
self::getRecordName('nb_conversions') => $totalConversions,
self::getRecordName('nb_visits_converted') => $nbConvertedVisits,
self::getRecordName('revenue') => $totalRevenue,
@@ -172,11 +171,6 @@ class Archiver extends \Piwik\Plugin\Archiver
$recordName = self::getRecordName($metricName, $idGoal);
$numericRecords[$recordName] = $value;
}
- if (!empty($array[Metrics::INDEX_GOAL_NB_VISITS_CONVERTED])) {
- $conversion_rate = $this->getConversionRate($array[Metrics::INDEX_GOAL_NB_VISITS_CONVERTED]);
- $recordName = self::getRecordName('conversion_rate', $idGoal);
- $numericRecords[$recordName] = $conversion_rate;
- }
}
return $numericRecords;
}
@@ -195,12 +189,6 @@ class Archiver extends \Piwik\Plugin\Archiver
return 'Goal_' . $idGoalStr . $recordName;
}
- protected function getConversionRate($count)
- {
- $visits = $this->getProcessor()->getNumberOfVisits();
- return round(100 * $count / $visits, GoalManager::REVENUE_PRECISION);
- }
-
protected function insertReports($recordName, $visitsToConversions)
{
foreach ($visitsToConversions as $idGoal => $table) {
@@ -389,19 +377,13 @@ class Archiver extends \Piwik\Plugin\Archiver
$fieldsToSum = array();
foreach ($goalIdsToSum as $goalId) {
$metricsToSum = Goals::getGoalColumns($goalId);
- unset($metricsToSum[array_search('conversion_rate', $metricsToSum)]);
foreach ($metricsToSum as $metricName) {
$fieldsToSum[] = self::getRecordName($metricName, $goalId);
}
}
- $records = $this->getProcessor()->aggregateNumericMetrics($fieldsToSum);
+ $this->getProcessor()->aggregateNumericMetrics($fieldsToSum);
- // also recording conversion_rate for each goal
foreach ($goalIdsToSum as $goalId) {
- $nb_conversions = $records[self::getRecordName('nb_visits_converted', $goalId)];
- $conversion_rate = $this->getConversionRate($nb_conversions);
- $this->getProcessor()->insertNumericRecord(self::getRecordName('conversion_rate', $goalId), $conversion_rate);
-
// sum up the visits to conversion data table & the days to conversion data table
$this->getProcessor()->aggregateDataTableRecords(array(
self::getRecordName(self::VISITS_UNTIL_RECORD_NAME, $goalId),
diff --git a/plugins/Goals/Columns/Metrics/AverageOrderRevenue.php b/plugins/Goals/Columns/Metrics/AverageOrderRevenue.php
new file mode 100644
index 0000000000..053477bf60
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/AverageOrderRevenue.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Goals\Columns\Metrics;
+
+use Piwik\Archive\DataTableFactory;
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * The average value for each order. Calculated as:
+ *
+ * revenue / nb_conversions
+ *
+ * revenue & nb_conversions are calculated by the Goals archiver.
+ */
+class AverageOrderRevenue extends ProcessedMetric
+{
+ private $idSite;
+
+ public function getName()
+ {
+ return 'avg_order_revenue';
+ }
+
+ public function compute(Row $row)
+ {
+ $revenue = $this->getMetric($row, 'revenue');
+ $conversions = $this->getMetric($row, 'nb_conversions');
+
+ return Piwik::getQuotientSafe($revenue, $conversions, $precision = 2);
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_AverageOrderValue');
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('revenue', 'nb_conversions');
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyMoney($value, $this->idSite);
+ }
+
+ public function beforeFormat($report, DataTable $table)
+ {
+ $this->idSite = DataTableFactory::getSiteIdFromMetadata($table);
+ return !empty($this->idSite); // skip formatting if there is no site to get currency info from
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/AveragePrice.php b/plugins/Goals/Columns/Metrics/AveragePrice.php
new file mode 100644
index 0000000000..521ca15d17
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/AveragePrice.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Goals\Columns\Metrics;
+
+use Piwik\Archive\DataTableFactory;
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+use Piwik\Tracker\GoalManager;
+
+/**
+ * The average price for each ecommerce order or abandoned cart. Calculated as:
+ *
+ * price / (orders or abandoned_carts)
+ *
+ * price, orders and abandoned_carts are calculated by the Goals archiver.
+ */
+class AveragePrice extends ProcessedMetric
+{
+ private $idSite;
+
+ public function getName()
+ {
+ return 'avg_price';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_AveragePrice');
+ }
+
+ public function compute(Row $row)
+ {
+ $price = $this->getMetric($row, 'price');
+ $orders = $this->getMetric($row, 'orders');
+ $abandonedCarts = $this->getMetric($row, 'abandoned_carts');
+
+ return Piwik::getQuotientSafe($price, $orders === false ? $abandonedCarts : $orders, GoalManager::REVENUE_PRECISION);
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('price', 'orders', 'abandoned_carts');
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyMoney($value, $this->idSite);
+ }
+
+ public function beforeFormat($report, DataTable $table)
+ {
+ $this->idSite = DataTableFactory::getSiteIdFromMetadata($table);
+ return !empty($this->idSite); // skip formatting if there is no site to get currency info from
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/AverageQuantity.php b/plugins/Goals/Columns/Metrics/AverageQuantity.php
new file mode 100644
index 0000000000..dd5de214fb
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/AverageQuantity.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Goals\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * The average amount of products in each order or abandoned cart. Calculated as:
+ *
+ * quantity / (orders or abandoned_carts)
+ *
+ * quantity, orders and abandoned_carts are calculated by the Goals archiver.
+ */
+class AverageQuantity extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'avg_quantity';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_AverageQuantity');
+ }
+
+ public function compute(Row $row)
+ {
+ $quantity = $this->getMetric($row, 'quantity');
+ $orders = $this->getMetric($row, 'orders');
+ $abandonedCarts = $this->getMetric($row, 'abandoned_carts');
+
+ return Piwik::getQuotientSafe($quantity, $orders === false ? $abandonedCarts : $orders, $precision = 1);
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('quantity', 'orders', 'abandoned_carts');
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/AverageOrderRevenue.php b/plugins/Goals/Columns/Metrics/GoalSpecific/AverageOrderRevenue.php
new file mode 100644
index 0000000000..845310e39c
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/AverageOrderRevenue.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific;
+
+use Piwik\Archive\DataTableFactory;
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Metrics;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+use Piwik\Tracker\GoalManager;
+
+/**
+ * The average order revenue for a specific goal. Calculated as:
+ *
+ * goals' revenue / goal's nb_conversions
+ */
+class AverageOrderRevenue extends GoalSpecificProcessedMetric
+{
+ public function getName()
+ {
+ return $this->getColumnPrefix() . '_avg_order_revenue';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_AverageOrderValue');
+ }
+
+ public function getDocumentation()
+ {
+ return Piwik::translate('Goals_ColumnAverageOrderRevenueDocumentation', $this->getGoalNameForDocs());
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('goals');
+ }
+
+ public function compute(Row $row)
+ {
+ $mappingFromNameToIdGoal = Metrics::getMappingFromNameToIdGoal();
+
+ $goalMetrics = $this->getGoalMetrics($row);
+
+ $goalRevenue = $this->getMetric($goalMetrics, 'revenue', $mappingFromNameToIdGoal);
+ $conversions = $this->getMetric($goalMetrics, 'nb_conversions', $mappingFromNameToIdGoal);
+
+ return Piwik::getQuotientSafe($goalRevenue, $conversions, GoalManager::REVENUE_PRECISION);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyMoney($value, $this->idSite);
+ }
+
+ public function beforeFormat($report, DataTable $table)
+ {
+ $this->idSite = DataTableFactory::getSiteIdFromMetadata($table);
+ return !empty($this->idSite); // skip formatting if there is no site to get currency info from
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/ConversionRate.php b/plugins/Goals/Columns/Metrics/GoalSpecific/ConversionRate.php
new file mode 100644
index 0000000000..2f355c2762
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/ConversionRate.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+use Piwik\Tracker\GoalManager;
+
+/**
+ * The conversion rate for a specific goal. Calculated as:
+ *
+ * goal's nb_conversions / nb_visits
+ *
+ * The goal's nb_conversions is calculated by the Goal archiver and nb_visits
+ * by the core archiving process.
+ */
+class ConversionRate extends GoalSpecificProcessedMetric
+{
+ public function getName()
+ {
+ return $this->getColumnPrefix() . '_conversion_rate';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('Goals_ConversionRate', $this->getGoalName());
+ }
+
+ public function getDocumentation()
+ {
+ return Piwik::translate('Goals_ColumnConversionRateDocumentation', $this->getGoalNameForDocs());
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('goals');
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyPercentFromQuotient($value);
+ }
+
+ public function compute(Row $row)
+ {
+ $mappingFromNameToIdGoal = Metrics::getMappingFromNameToIdGoal();
+
+ $goalMetrics = $this->getGoalMetrics($row);
+
+ $nbVisits = $this->getMetric($row, 'nb_visits');
+ $conversions = $this->getMetric($goalMetrics, 'nb_conversions', $mappingFromNameToIdGoal);
+
+ return Piwik::getQuotientSafe($conversions, $nbVisits, GoalManager::REVENUE_PRECISION + 2);
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/Conversions.php b/plugins/Goals/Columns/Metrics/GoalSpecific/Conversions.php
new file mode 100644
index 0000000000..0a15a94e39
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/Conversions.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics;
+use Piwik\Piwik;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+
+/**
+ * The conversions for a specific goal. Returns the conversions for a single goal which
+ * is then treated as a new column.
+ */
+class Conversions extends GoalSpecificProcessedMetric
+{
+ public function getName()
+ {
+ return $this->getColumnPrefix() . '_nb_conversions';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('Goals_Conversions', $this->getGoalNameForDocs());
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('goals');
+ }
+
+ public function compute(Row $row)
+ {
+ $mappingFromNameToIdGoal = Metrics::getMappingFromNameToIdGoal();
+
+ $goalMetrics = $this->getGoalMetrics($row);
+ return (int) $this->getMetric($goalMetrics, 'nb_conversions', $mappingFromNameToIdGoal);
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/ItemsCount.php b/plugins/Goals/Columns/Metrics/GoalSpecific/ItemsCount.php
new file mode 100644
index 0000000000..49b8184742
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/ItemsCount.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics;
+use Piwik\Piwik;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+
+/**
+ * The number of ecommerce order items for conversions of a goal. Returns the 'items'
+ * goal specific metric.
+ */
+class ItemsCount extends GoalSpecificProcessedMetric
+{
+ public function getName()
+ {
+ return $this->getColumnPrefix() . '_items';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_PurchasedProducts');
+ }
+
+ public function getDocumentation()
+ {
+ return Piwik::translate('Goals_ColumnPurchasedProductsDocumentation', $this->getGoalNameForDocs());
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('goals');
+ }
+
+ public function compute(Row $row)
+ {
+ $mappingFromNameToIdGoal = Metrics::getMappingFromNameToIdGoal();
+
+ $goalMetrics = $this->getGoalMetrics($row);
+ return (int) $this->getMetric($goalMetrics, 'items', $mappingFromNameToIdGoal);
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/Revenue.php b/plugins/Goals/Columns/Metrics/GoalSpecific/Revenue.php
new file mode 100644
index 0000000000..27b5b9dad5
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/Revenue.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific;
+
+use Piwik\Archive\DataTableFactory;
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Metrics;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+
+/**
+ * Revenue for a specific goal.
+ */
+class Revenue extends GoalSpecificProcessedMetric
+{
+ public function getName()
+ {
+ return $this->getColumnPrefix() . '_revenue';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('%s ' . Piwik::translate('General_ColumnRevenue'), $this->getGoalName());
+ }
+
+ public function getDocumentation()
+ {
+ return Piwik::translate('Goals_ColumnRevenueDocumentation', $this->getGoalNameForDocs());
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('goals');
+ }
+
+ public function compute(Row $row)
+ {
+ $mappingFromNameToIdGoal = Metrics::getMappingFromNameToIdGoal();
+
+ $goalMetrics = $this->getGoalMetrics($row);
+ return (float) $this->getMetric($goalMetrics, 'revenue', $mappingFromNameToIdGoal);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyMoney($value, $this->idSite);
+ }
+
+ public function beforeFormat($report, DataTable $table)
+ {
+ $this->idSite = DataTableFactory::getSiteIdFromMetadata($table);
+ return !empty($this->idSite); // skip formatting if there is no site to get currency info from
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/RevenuePerVisit.php b/plugins/Goals/Columns/Metrics/GoalSpecific/RevenuePerVisit.php
new file mode 100644
index 0000000000..a90c1058d6
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/RevenuePerVisit.php
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific;
+
+use Piwik\Archive\DataTableFactory;
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Metrics;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+use Piwik\Tracker\GoalManager;
+
+/**
+ * Revenue per visit for a specific goal. Calculated as:
+ *
+ * goal's revenue / (nb_visits or goal's nb_conversions depending on what is present in data)
+ *
+ * Goal revenue & nb_conversion are calculated by the Goals archiver.
+ */
+class RevenuePerVisit extends GoalSpecificProcessedMetric
+{
+ public function getName()
+ {
+ return $this->getColumnPrefix() . '_revenue_per_visit';
+ }
+
+ public function getTranslatedName()
+ {
+ return $this->getGoalName() . ' ' . Piwik::translate('General_ColumnValuePerVisit');
+ }
+
+ public function getDocumentation()
+ {
+ if ($this->idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER) {
+ return Piwik::translate('Goals_ColumnAverageOrderRevenueDocumentation', $this->getGoalNameForDocs());
+ } else {
+ return Piwik::translate('Goals_ColumnRevenuePerVisitDocumentation', Piwik::translate('Goals_EcommerceAndGoalsMenu'));
+ }
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('goals', 'nb_visits');
+ }
+
+ public function compute(Row $row)
+ {
+ $mappingFromNameToIdGoal = Metrics::getMappingFromNameToIdGoal();
+
+ $goalMetrics = $this->getGoalMetrics($row);
+
+ $nbVisits = $this->getMetric($row, 'nb_visits');
+ $conversions = $this->getMetric($goalMetrics, 'nb_conversions', $mappingFromNameToIdGoal);
+
+ $goalRevenue = (float) $this->getMetric($goalMetrics, 'revenue', $mappingFromNameToIdGoal);
+
+ return Piwik::getQuotientSafe($goalRevenue, $nbVisits == 0 ? $conversions : $nbVisits, GoalManager::REVENUE_PRECISION);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyMoney($value, $this->idSite);
+ }
+
+ public function beforeFormat($report, DataTable $table)
+ {
+ $this->idSite = DataTableFactory::getSiteIdFromMetadata($table);
+ return !empty($this->idSite); // skip formatting if there is no site to get currency info from
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecificProcessedMetric.php b/plugins/Goals/Columns/Metrics/GoalSpecificProcessedMetric.php
new file mode 100644
index 0000000000..1ae1c41149
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/GoalSpecificProcessedMetric.php
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Goals\Columns\Metrics;
+
+use Piwik\Common;
+use Piwik\DataTable\Row;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+use Piwik\Plugins\Goals\API as GoalsAPI;
+
+/**
+ * Base class for processed metrics that are calculated using metrics that are
+ * specific to certain goals.
+ */
+abstract class GoalSpecificProcessedMetric extends ProcessedMetric
+{
+ /**
+ * The ID of the goal to calculate metrics for.
+ *
+ * @var int
+ */
+ protected $idGoal;
+
+ /**
+ * The ID of the site the goal belongs to.
+ *
+ * @var int
+ */
+ protected $idSite;
+
+ /**
+ * Constructor.
+ *
+ * @param int|null $idSite The ID of the site the goal belongs to. If supplied, affects the formatting
+ * and translated name of the metric.
+ * @param int $idGoal The ID of the goal to calculate metrics for.
+ */
+ public function __construct($idSite, $idGoal)
+ {
+ $this->idSite = $idSite;
+ $this->idGoal = $idGoal;
+ }
+
+ protected function getColumnPrefix()
+ {
+ return 'goal_' . $this->idGoal;
+ }
+
+ protected function getGoalMetrics(Row $row)
+ {
+ $allGoalMetrics = $this->getMetric($row, 'goals');
+ if (isset($allGoalMetrics[$this->idGoal])) {
+ return $allGoalMetrics[$this->idGoal];
+ } else {
+ $alternateKey = 'idgoal=' . $this->idGoal;
+ if (isset($allGoalMetrics[$alternateKey])) {
+ return $allGoalMetrics[$alternateKey];
+ } else {
+ return array();
+ }
+ }
+ }
+
+ protected function getGoalName()
+ {
+ if ($this->idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER) {
+ return Piwik::translate('Goals_EcommerceOrder');
+ }
+
+ if (isset($this->idSite)) {
+ $allGoals = GoalsAPI::getInstance()->getGoals($this->idSite);
+ $goalName = @$allGoals[$this->idGoal]['name'];
+ return Common::sanitizeInputValue($goalName);
+ } else {
+ return "";
+ }
+ }
+
+ protected function getGoalNameForDocs()
+ {
+ $goalName = $this->getGoalName();
+ if ($goalName == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER) {
+ $goalName = '"' . $goalName . '"';
+ }
+ return $goalName;
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/ProductConversionRate.php b/plugins/Goals/Columns/Metrics/ProductConversionRate.php
new file mode 100644
index 0000000000..a0cf0b0436
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/ProductConversionRate.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Goals\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+use Piwik\Tracker\GoalManager;
+
+/**
+ * The conversion rate for ecommerce orders. Calculated as:
+ *
+ * (orders or abandoned_carts) / nb_visits
+ *
+ * orders and abandoned_carts are calculated by the Goals archiver.
+ */
+class ProductConversionRate extends ProcessedMetric
+{
+ public function getName()
+ {
+ return 'conversion_rate';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_ProductConversionRate');
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyPercentFromQuotient($value);
+ }
+
+ public function compute(Row $row)
+ {
+ $orders = $this->getMetric($row, 'orders');
+ $abandonedCarts = $this->getMetric($row, 'abandoned_carts');
+ $visits = $this->getMetric($row, 'nb_visits');
+
+ return Piwik::getQuotientSafe($orders === false ? $abandonedCarts : $orders, $visits, GoalManager::REVENUE_PRECISION + 2);
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('orders', 'abandoned_carts', 'nb_visits');
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/RevenuePerVisit.php b/plugins/Goals/Columns/Metrics/RevenuePerVisit.php
new file mode 100644
index 0000000000..488d65c20a
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/RevenuePerVisit.php
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Goals\Columns\Metrics;
+
+use Piwik\Archive\DataTableFactory;
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Metrics;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+use Piwik\Tracker\GoalManager;
+
+/**
+ * The amount of revenue per visit (or per conversion if there are no visits). Calculated as:
+ *
+ * sum(revenue for all goals) / (nb_visits or nb_conversions if no visits)
+ *
+ * Goal revenue and nb_visits & nb_conversions are calculated by the archiving process.
+ */
+class RevenuePerVisit extends ProcessedMetric
+{
+ private $idSite;
+
+ public function getName()
+ {
+ return 'revenue_per_visit';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('General_ColumnValuePerVisit');
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('revenue', 'nb_visits', 'nb_conversions','goals');
+ }
+
+ public function compute(Row $row)
+ {
+ $mappingFromNameToIdGoal = Metrics::getMappingFromNameToIdGoal();
+ $goals = $this->getMetric($row, 'goals') ?: array();
+
+ $revenue = 0;
+ foreach ($goals as $goalId => $goalMetrics) {
+ if ($goalId == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART) {
+ continue;
+ }
+ if ($goalId >= GoalManager::IDGOAL_ORDER
+ || $goalId == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER
+ ) {
+ $revenue += (int) $this->getMetric($goalMetrics, 'revenue', $mappingFromNameToIdGoal);
+ }
+ }
+
+ if ($revenue == 0) {
+ $revenue = (int) $this->getMetric($row, 'revenue');
+ }
+
+ $nbVisits = (int) $this->getMetric($row, 'nb_visits');
+ $conversions = (int) $this->getMetric($row, 'nb_conversions');
+
+ // If no visit for this metric, but some conversions, we still want to display some kind of "revenue per visit"
+ // even though it will actually be in this edge case "Revenue per conversion"
+ return Piwik::getQuotientSafe($revenue, $nbVisits == 0 ? $conversions : $nbVisits, GoalManager::REVENUE_PRECISION);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyMoney($value, $this->idSite);
+ }
+
+ public function beforeFormat($report, DataTable $table)
+ {
+ $this->idSite = DataTableFactory::getSiteIdFromMetadata($table);
+ return !empty($this->idSite); // skip formatting if there is no site to get currency info from
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Controller.php b/plugins/Goals/Controller.php
index 3e61eb06e3..5a30166e8f 100644
--- a/plugins/Goals/Controller.php
+++ b/plugins/Goals/Controller.php
@@ -49,11 +49,15 @@ class Controller extends \Piwik\Plugin\Controller
if ($conversionRate->getRowsCount() == 0) {
$conversionRate = 0;
} else {
- $columns = $conversionRate->getFirstRow()->getColumns();
- $conversionRate = (float)reset($columns);
+ $conversionRate = $conversionRate->getFirstRow()->getColumn('conversion_rate');
}
}
- return sprintf('%.' . self::CONVERSION_RATE_PRECISION . 'f%%', $conversionRate);
+
+ if (!is_numeric($conversionRate)) {
+ $conversionRate = sprintf('%.' . self::CONVERSION_RATE_PRECISION . 'f%%', $conversionRate);
+ }
+
+ return $conversionRate;
}
public function __construct()
@@ -145,11 +149,13 @@ class Controller extends \Piwik\Plugin\Controller
// conversion rate for new and returning visitors
$segment = urldecode(\Piwik\Plugins\VisitFrequency\API::RETURNING_VISITOR_SEGMENT);
- $conversionRateReturning = API::getInstance()->getConversionRate($this->idSite, Common::getRequestVar('period'), Common::getRequestVar('date'), $segment, $idGoal);
+ $conversionRateReturning = Request::processRequest("Goals.get", array('segment' => $segment, 'idGoal' => $idGoal));
$view->conversion_rate_returning = $this->formatConversionRate($conversionRateReturning);
+
$segment = 'visitorType==new';
- $conversionRateNew = API::getInstance()->getConversionRate($this->idSite, Common::getRequestVar('period'), Common::getRequestVar('date'), $segment, $idGoal);
+ $conversionRateNew = Request::processRequest("Goals.get", array('segment' => $segment, 'idGoal' => $idGoal));
$view->conversion_rate_new = $this->formatConversionRate($conversionRateNew);
+
$view->goalReportsByDimension = $this->getGoalReportsByDimensionTable(
$view->nb_conversions, isset($ecommerce), !empty($view->cart_nb_conversions));
return $view;
@@ -200,6 +206,7 @@ class Controller extends \Piwik\Plugin\Controller
$request = new Request("method=Goals.get&format=original&idGoal=");
$datatable = $request->process();
$dataRow = $datatable->getFirstRow();
+
$view->nb_conversions = $dataRow->getColumn('nb_conversions');
$view->nb_visits_converted = $dataRow->getColumn('nb_visits_converted');
$view->conversion_rate = $this->formatConversionRate($dataRow->getColumn('conversion_rate'));
diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php
index 381c37f7ee..f6b5e2f0f1 100644
--- a/plugins/Goals/Goals.php
+++ b/plugins/Goals/Goals.php
@@ -24,7 +24,7 @@ class Goals extends \Piwik\Plugin
public function getInformation()
{
$suffix = Piwik::translate('SitesManager_PiwikOffersEcommerceAnalytics',
- array('<a href="http://piwik.org/docs/ecommerce-analytics/" target="_blank">', '</a>'));
+ array('<a href="http://piwik.org/docs/ecommerce-analytics/" rel="noreferrer" target="_blank">', '</a>'));
$info = parent::getInformation();
$info['description'] .= ' ' . $suffix;
return $info;
@@ -69,7 +69,6 @@ class Goals extends \Piwik\Plugin
$columns = array(
'nb_conversions',
'nb_visits_converted',
- 'conversion_rate',
'revenue',
);
if ($idGoal === false) {
diff --git a/plugins/Goals/Reports/BaseEcommerceItem.php b/plugins/Goals/Reports/BaseEcommerceItem.php
index 8699fe386b..32b2fff770 100644
--- a/plugins/Goals/Reports/BaseEcommerceItem.php
+++ b/plugins/Goals/Reports/BaseEcommerceItem.php
@@ -9,19 +9,27 @@
namespace Piwik\Plugins\Goals\Reports;
use Piwik\Common;
+use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use Piwik\Plugin\Report;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\Goals\Goals;
+use Piwik\Plugins\Goals\Columns\Metrics\AveragePrice;
+use Piwik\Plugins\Goals\Columns\Metrics\AverageQuantity;
+use Piwik\Plugins\Goals\Columns\Metrics\ProductConversionRate;
abstract class BaseEcommerceItem extends BaseEcommerce
{
protected function init()
{
parent::init();
- $this->processedMetrics = false;
+ $this->processedMetrics = array(
+ new AveragePrice(),
+ new AverageQuantity(),
+ new ProductConversionRate()
+ );
$this->metrics = array(
- 'revenue', 'quantity', 'orders', 'avg_price', 'avg_quantity', 'nb_visits', 'conversion_rate'
+ 'revenue', 'quantity', 'orders', 'nb_visits'
);
}
@@ -30,8 +38,6 @@ abstract class BaseEcommerceItem extends BaseEcommerce
$metrics = parent::getMetrics();
$metrics['revenue'] = Piwik::translate('General_ProductRevenue');
$metrics['orders'] = Piwik::translate('General_UniquePurchases');
- $metrics['conversion_rate'] = Piwik::translate('General_ProductConversionRate');
-
return $metrics;
}
@@ -63,8 +69,8 @@ abstract class BaseEcommerceItem extends BaseEcommerce
$view->config->show_exclude_low_population = false;
$view->config->show_table_all_columns = false;
- $moneyColumns = array('revenue', 'avg_price');
- $formatter = '\Piwik\MetricsFormatter::getPrettyMoney';
+ $moneyColumns = array('revenue');
+ $formatter = array(new Formatter(), 'getPrettyMoney');
$view->config->filters[] = array('ColumnCallbackReplace', array($moneyColumns, $formatter, array($idSite)));
$view->requestConfig->filter_limit = 10;
@@ -75,7 +81,9 @@ abstract class BaseEcommerceItem extends BaseEcommerce
// set columns/translations which differ based on viewDataTable TODO: shouldn't have to do this check...
// amount of reports should be dynamic, but metadata should be static
- $columns = $this->getMetrics();
+ $columns = array_merge($this->getMetrics(), $this->getProcessedMetrics());
+ $columnsOrdered = array('label', 'revenue', 'quantity', 'orders', 'avg_price', 'avg_quantity',
+ 'nb_visits', 'conversion_rate');
$abandonedCart = $this->isAbandonedCart();
if ($abandonedCart) {
@@ -87,12 +95,15 @@ abstract class BaseEcommerceItem extends BaseEcommerce
unset($columns['conversion_rate']);
$view->requestConfig->request_parameters_to_modify['abandonedCarts'] = '1';
+
+ $columnsOrdered = array('label', 'revenue', 'quantity', 'avg_price', 'avg_quantity', 'nb_visits',
+ 'abandoned_carts');
}
$translations = array_merge(array('label' => $this->name), $columns);
$view->config->addTranslations($translations);
- $view->config->columns_to_display = array_keys($translations);
+ $view->config->columns_to_display = $columnsOrdered;
$view->config->custom_parameters['viewDataTable'] =
$abandonedCart ? Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART : Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER;
diff --git a/plugins/Goals/Reports/Get.php b/plugins/Goals/Reports/Get.php
index 7fd804ec26..78cf680b66 100644
--- a/plugins/Goals/Reports/Get.php
+++ b/plugins/Goals/Reports/Get.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\Goals\Reports;
use Piwik\Piwik;
+use Piwik\Plugins\CoreHome\Columns\Metrics\ConversionRate;
class Get extends BaseGoal
{
@@ -17,11 +18,11 @@ class Get extends BaseGoal
parent::init();
$this->name = Piwik::translate('Goals_Goals');
- $this->processedMetrics = array();
+ $this->processedMetrics = array(new ConversionRate());
$this->documentation = ''; // TODO
$this->order = 1;
$this->orderGoal = 50;
- $this->metrics = array('nb_conversions', 'nb_visits_converted', 'conversion_rate', 'revenue');
+ $this->metrics = array('nb_conversions', 'nb_visits_converted', 'revenue');
$this->parameters = null;
}
diff --git a/plugins/Goals/Reports/GetEcommerceAbandonedCart.php b/plugins/Goals/Reports/GetEcommerceAbandonedCart.php
index 97c1e7e26c..279de4b940 100644
--- a/plugins/Goals/Reports/GetEcommerceAbandonedCart.php
+++ b/plugins/Goals/Reports/GetEcommerceAbandonedCart.php
@@ -17,7 +17,7 @@ class GetEcommerceAbandonedCart extends BaseEcommerce
parent::init();
$this->action = 'get';
$this->name = Piwik::translate('General_AbandonedCarts');
- $this->processedMetrics = false;
+ $this->processedMetrics = array('avg_order_revenue');
$this->order = 15;
$this->metrics = array('nb_conversions', 'conversion_rate', 'revenue', 'items');
diff --git a/plugins/Goals/Reports/GetEcommerceOrder.php b/plugins/Goals/Reports/GetEcommerceOrder.php
index 74a7a8841c..95c42ba568 100644
--- a/plugins/Goals/Reports/GetEcommerceOrder.php
+++ b/plugins/Goals/Reports/GetEcommerceOrder.php
@@ -17,7 +17,7 @@ class GetEcommerceOrder extends BaseEcommerce
parent::init();
$this->action = 'get';
$this->name = Piwik::translate('General_EcommerceOrders');
- $this->processedMetrics = false;
+ $this->processedMetrics = array('avg_order_revenue');
$this->order = 10;
$this->metrics = array(
'nb_conversions',
@@ -27,15 +27,14 @@ class GetEcommerceOrder extends BaseEcommerce
'revenue_subtotal',
'revenue_tax',
'revenue_shipping',
- 'revenue_discount',
- 'items',
- 'avg_order_revenue'
+ 'revenue_discount'
);
$this->parameters = array('idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER);
}
- public function getMetrics() {
+ public function getMetrics()
+ {
$metrics = parent::getMetrics();
$metrics['nb_conversions'] = Piwik::translate('General_EcommerceOrders');
diff --git a/plugins/Goals/Reports/GetVisitsUntilConversion.php b/plugins/Goals/Reports/GetVisitsUntilConversion.php
index 6be172a866..8d7c27e027 100644
--- a/plugins/Goals/Reports/GetVisitsUntilConversion.php
+++ b/plugins/Goals/Reports/GetVisitsUntilConversion.php
@@ -22,7 +22,7 @@ class GetVisitsUntilConversion extends BaseGoal
$this->name = Piwik::translate('Goals_VisitsUntilConv');
$this->dimension = new VisitsUntilConversion();
$this->constantRowsCount = true;
- $this->processedMetrics = false;
+ $this->processedMetrics = array();
$this->parameters = array();
$this->metrics = array('nb_conversions');
$this->order = 5;
diff --git a/plugins/Goals/Reports/GetVisitsUntilConversionEcommerceOrder.php b/plugins/Goals/Reports/GetVisitsUntilConversionEcommerceOrder.php
index ba292c8b71..0e5d227e7e 100644
--- a/plugins/Goals/Reports/GetVisitsUntilConversionEcommerceOrder.php
+++ b/plugins/Goals/Reports/GetVisitsUntilConversionEcommerceOrder.php
@@ -22,7 +22,7 @@ class GetVisitsUntilConversionEcommerceOrder extends BaseEcommerce
$this->name = Piwik::translate('General_EcommerceOrders') . ' - ' . Piwik::translate('Goals_VisitsUntilConv');
$this->dimension = new VisitsUntilConversion();
$this->constantRowsCount = true;
- $this->processedMetrics = false;
+ $this->processedMetrics = array();
$this->metrics = array('nb_conversions');
$this->order = 11;
diff --git a/plugins/Goals/Visualizations/Goals.php b/plugins/Goals/Visualizations/Goals.php
index 9808621b14..0703889966 100644
--- a/plugins/Goals/Visualizations/Goals.php
+++ b/plugins/Goals/Visualizations/Goals.php
@@ -4,14 +4,12 @@
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
*/
namespace Piwik\Plugins\Goals\Visualizations;
use Piwik\Common;
use Piwik\DataTable\Filter\AddColumnsProcessedMetricsGoal;
-use Piwik\MetricsFormatter;
use Piwik\Piwik;
use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
use Piwik\Plugins\Goals\API as APIGoals;
@@ -45,19 +43,12 @@ class Goals extends HtmlTable
$this->config->datatable_css_class = 'dataTableVizGoals';
$this->config->show_exclude_low_population = true;
- $this->config->translations += array(
- 'nb_conversions' => Piwik::translate('Goals_ColumnConversions'),
- 'conversion_rate' => Piwik::translate('General_ColumnConversionRate'),
- 'revenue' => Piwik::translate('General_ColumnRevenue'),
- 'revenue_per_visit' => Piwik::translate('General_ColumnValuePerVisit'),
- );
-
$this->config->metrics_documentation['nb_visits'] = Piwik::translate('Goals_ColumnVisits');
if (1 == Common::getRequestVar('documentationForGoalsPage', 0, 'int')) {
// TODO: should not use query parameter
$this->config->documentation = Piwik::translate('Goals_ConversionByTypeReportDocumentation',
- array('<br />', '<br />', '<a href="http://piwik.org/docs/tracking-goals-web-analytics/" target="_blank">', '</a>'));
+ array('<br />', '<br />', '<a href="http://piwik.org/docs/tracking-goals-web-analytics/" rel="noreferrer" target="_blank">', '</a>'));
}
parent::beforeRender();
@@ -69,50 +60,27 @@ class Goals extends HtmlTable
$idSite = Common::getRequestVar('idSite', null, 'int');
$idGoal = Common::getRequestVar('idGoal', AddColumnsProcessedMetricsGoal::GOALS_OVERVIEW, 'string');
+ $goalsToProcess = null;
if (Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER == $idGoal) {
$this->setPropertiesForEcommerceView();
+
+ $goalsToProcess = array($idGoal);
} else if (AddColumnsProcessedMetricsGoal::GOALS_FULL_TABLE == $idGoal) {
$this->setPropertiesForGoals($idSite, 'all');
+
+ $goalsToProcess = $this->getAllGoalIds($idSite);
} else if (AddColumnsProcessedMetricsGoal::GOALS_OVERVIEW == $idGoal) {
$this->setPropertiesForGoalsOverview($idSite);
+
+ $goalsToProcess = $this->getAllGoalIds($idSite);
} else {
$this->setPropertiesForGoals($idSite, array($idGoal));
- }
-
- // add goals columns
- $this->config->filters[] = array('AddColumnsProcessedMetricsGoal', array($ignore = true, $idGoal), $priority = true);
-
- // prettify columns
- $setRatePercent = function ($rate, $thang = false) {
- return $rate == 0 ? "0%" : $rate;
- };
-
- foreach ($this->config->columns_to_display as $columnName) {
- if (false !== strpos($columnName, 'conversion_rate')) {
- $this->config->filters[] = array('ColumnCallbackReplace', array($columnName, $setRatePercent));
- }
- }
-
- $formatPercent = function ($value) use ($idSite) {
- return MetricsFormatter::getPrettyMoney(sprintf("%.1f", $value), $idSite);
- };
- foreach ($this->config->columns_to_display as $columnName) {
- if ($this->isRevenueColumn($columnName)) {
- $this->config->filters[] = array('ColumnCallbackReplace', array($columnName, $formatPercent));
- }
+ $goalsToProcess = array($idGoal);
}
- // this ensures that the value is set to zero for all rows where the value was not set (no conversion)
- $identityFunction = function ($value) {
- return $value;
- };
-
- foreach ($this->config->columns_to_display as $columnName) {
- if (!$this->isRevenueColumn($columnName)) {
- $this->config->filters[] = array('ColumnCallbackReplace', array($columnName, $identityFunction));
- }
- }
+ // add goals columns
+ $this->config->filters[] = array('AddColumnsProcessedMetricsGoal', array($enable = true, $idGoal, $goalsToProcess), $priority = true);
}
private function setPropertiesForEcommerceView()
@@ -126,25 +94,15 @@ class Goals extends HtmlTable
'goal_ecommerceOrder_revenue_per_visit'
);
- $this->config->translations += array(
- 'goal_ecommerceOrder_conversion_rate' => Piwik::translate('Goals_ConversionRate', Piwik::translate('Goals_EcommerceOrder')),
+ $this->config->translations = array_merge($this->config->translations, array(
'goal_ecommerceOrder_nb_conversions' => Piwik::translate('General_EcommerceOrders'),
'goal_ecommerceOrder_revenue' => Piwik::translate('General_TotalRevenue'),
- 'goal_ecommerceOrder_revenue_per_visit' => Piwik::translate('General_ColumnValuePerVisit'),
- 'goal_ecommerceOrder_avg_order_revenue' => Piwik::translate('General_AverageOrderValue'),
- 'goal_ecommerceOrder_items' => Piwik::translate('General_PurchasedProducts')
- );
+ 'goal_ecommerceOrder_revenue_per_visit' => Piwik::translate('General_ColumnValuePerVisit')
+ ));
$goalName = Piwik::translate('General_EcommerceOrders');
- $this->config->metrics_documentation += array(
- 'goal_ecommerceOrder_conversion_rate' => Piwik::translate('Goals_ColumnConversionRateDocumentation', $goalName),
- 'goal_ecommerceOrder_nb_conversions' => Piwik::translate('Goals_ColumnConversionsDocumentation', $goalName),
- 'goal_ecommerceOrder_revenue' => Piwik::translate('Goals_ColumnRevenueDocumentation', $goalName),
- 'goal_ecommerceOrder_revenue_per_visit' => Piwik::translate('Goals_ColumnAverageOrderRevenueDocumentation', $goalName),
- 'goal_ecommerceOrder_avg_order_revenue' => Piwik::translate('Goals_ColumnAverageOrderRevenueDocumentation', $goalName),
- 'goal_ecommerceOrder_items' => Piwik::translate('Goals_ColumnPurchasedProductsDocumentation', $goalName),
- 'revenue_per_visit' => Piwik::translate('Goals_ColumnRevenuePerVisitDocumentation', $goalName)
- );
+ $this->config->metrics_documentation['revenue_per_visit'] =
+ Piwik::translate('Goals_ColumnRevenuePerVisitDocumentation', $goalName);
}
private function setPropertiesForGoalsOverview($idSite)
@@ -156,16 +114,10 @@ class Goals extends HtmlTable
foreach ($allGoals as $goal) {
$column = "goal_{$goal['idgoal']}_conversion_rate";
- $documentation = Piwik::translate('Goals_ColumnConversionRateDocumentation', $goal['quoted_name'] ? : $goal['name']);
-
$this->config->columns_to_display[] = $column;
- $this->config->translations[$column] = Piwik::translate('Goals_ConversionRate', $goal['name']);
- $this->config->metrics_documentation[$column] = $documentation;
}
$this->config->columns_to_display[] = 'revenue_per_visit';
- $this->config->metrics_documentation['revenue_per_visit'] =
- Piwik::translate('Goals_ColumnRevenuePerVisitDocumentation', Piwik::translate('Goals_EcommerceAndGoalsMenu'));
}
private function setPropertiesForGoals($idSite, $idGoals)
@@ -197,62 +149,48 @@ class Goals extends HtmlTable
}
}
- // set translations & metric docs for goal specific metrics
- foreach ($idGoals as $idGoal) {
- $goalName = $allGoals[$idGoal]['name'];
- $quotedGoalName = $allGoals[$idGoal]['quoted_name'] ? : $goalName;
-
- $this->config->translations += array(
- 'goal_' . $idGoal . '_nb_conversions' => Piwik::translate('Goals_Conversions', $goalName),
- 'goal_' . $idGoal . '_conversion_rate' => Piwik::translate('Goals_ConversionRate', $goalName),
- 'goal_' . $idGoal . '_revenue' =>
- Piwik::translate('%s ' . Piwik::translate('General_ColumnRevenue'), $goalName),
- 'goal_' . $idGoal . '_revenue_per_visit' =>
- Piwik::translate('%s ' . Piwik::translate('General_ColumnValuePerVisit'), $goalName),
- );
-
- $this->config->metrics_documentation += array(
- 'goal_' . $idGoal . '_nb_conversions' => Piwik::translate('Goals_ColumnConversionsDocumentation', $quotedGoalName),
- 'goal_' . $idGoal . '_conversion_rate' => Piwik::translate('Goals_ColumnConversionRateDocumentation', $quotedGoalName),
- 'goal_' . $idGoal . '_revenue' => Piwik::translate('Goals_ColumnRevenueDocumentation', $quotedGoalName),
- 'goal_' . $idGoal . '_revenue_per_visit' =>
- Piwik::translate('Goals_ColumnRevenuePerVisitDocumentation', Piwik::translate('Goals_EcommerceAndGoalsMenu')),
- );
- }
-
$this->config->columns_to_display[] = 'revenue_per_visit';
}
+ private $goalsForCurrentSite = null;
+
private function getGoals($idSite)
{
- // get all goals to display info for
- $allGoals = array();
-
- // add the ecommerce goal if ecommerce is enabled for the site
- if (Site::isEcommerceEnabledFor($idSite)) {
- $ecommerceGoal = array(
- 'idgoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER,
- 'name' => Piwik::translate('Goals_EcommerceOrder'),
- 'quoted_name' => false
- );
- $allGoals[$ecommerceGoal['idgoal']] = $ecommerceGoal;
- }
+ if ($this->goalsForCurrentSite === null) {
+ // get all goals to display info for
+ $allGoals = array();
+
+ // add the ecommerce goal if ecommerce is enabled for the site
+ if (Site::isEcommerceEnabledFor($idSite)) {
+ $ecommerceGoal = array(
+ 'idgoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER,
+ 'name' => Piwik::translate('Goals_EcommerceOrder'),
+ 'quoted_name' => false
+ );
+ $allGoals[$ecommerceGoal['idgoal']] = $ecommerceGoal;
+ }
+
+ // add the site's goals (and escape all goal names)
+ $siteGoals = APIGoals::getInstance()->getGoals($idSite);
- // add the site's goals (and escape all goal names)
- $siteGoals = APIGoals::getInstance()->getGoals($idSite);
+ foreach ($siteGoals as &$goal) {
+ $goal['name'] = Common::sanitizeInputValue($goal['name']);
- foreach ($siteGoals as &$goal) {
- $goal['name'] = Common::sanitizeInputValue($goal['name']);
+ $goal['quoted_name'] = '"' . $goal['name'] . '"';
+ $allGoals[$goal['idgoal']] = $goal;
+ }
- $goal['quoted_name'] = '"' . $goal['name'] . '"';
- $allGoals[$goal['idgoal']] = $goal;
+ $this->goalsForCurrentSite = $allGoals;
}
- return $allGoals;
+ return $this->goalsForCurrentSite;
}
- private function isRevenueColumn($name)
+ private function getAllGoalIds($idSite)
{
- return strpos($name, '_revenue') !== false || $name == 'revenue_per_visit';
+ $allGoals = $this->getGoals($idSite);
+ return array_map(function ($data) {
+ return $data['idgoal'];
+ }, $allGoals);
}
}
diff --git a/plugins/Goals/templates/_addEditGoal.twig b/plugins/Goals/templates/_addEditGoal.twig
index f9449d8ce9..f7373b6b8e 100644
--- a/plugins/Goals/templates/_addEditGoal.twig
+++ b/plugins/Goals/templates/_addEditGoal.twig
@@ -4,7 +4,7 @@
<p>{{ 'Goals_NewGoalDescription'|translate }}
{{ 'Goals_NewWhatDoYouWantUsersToDo'|translate }}
{{ 'Goals_NewGoalYouWillBeAbleTo'|translate }}</p>
- <p>{{ 'Goals_LearnMoreAboutGoalTrackingDocumentation'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/tracking-goals-web-analytics/' target='_blank'>","</a>")|raw }}
+ <p>{{ 'Goals_LearnMoreAboutGoalTrackingDocumentation'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/tracking-goals-web-analytics/' rel='noreferrer' target='_blank'>","</a>")|raw }}
</p>
{% else %}
<div class="clear"></div>
@@ -13,7 +13,7 @@
<ul class='listCircle'>
<li><a onclick='' name='linkAddNewGoal'>{{ 'Goals_CreateNewGOal'|translate }}</a></li>
<li><a onclick='' name='linkEditGoals'>{{ 'Goals_ViewAndEditGoals'|translate }}</a></li>
- <li>{{ 'Goals_LearnMoreAboutGoalTrackingDocumentation'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/tracking-goals-web-analytics/' target='_blank'>","</a>")|raw }}</li>
+ <li>{{ 'Goals_LearnMoreAboutGoalTrackingDocumentation'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/tracking-goals-web-analytics/' rel='noreferrer' target='_blank'>","</a>")|raw }}</li>
<li>
{% if not ecommerceEnabled %}
@@ -21,11 +21,11 @@
<a href='{{ linkTo({'module':'SitesManager','action':'index' }) }}'>{{ 'SitesManager_WebsitesManagement'|translate }}</a>
{% endset %}
{% set ecommerceReportText %}
- <a href="http://piwik.org/docs/ecommerce-analytics/" target="_blank">{{ 'Goals_EcommerceReports'|translate }}</a>
+ <a href="http://piwik.org/docs/ecommerce-analytics/" rel="noreferrer" target="_blank">{{ 'Goals_EcommerceReports'|translate }}</a>
{% endset %}
{{ 'Goals_Optional'|translate }} {{ 'Goals_Ecommerce'|translate }}: {{ 'Goals_YouCanEnableEcommerceReports'|translate(ecommerceReportText,websiteManageText)|raw }}
{% else %}
- {{ 'SitesManager_PiwikOffersEcommerceAnalytics'|translate('<a href="http://piwik.org/docs/ecommerce-analytics/" target="_blank">',"</a>")|raw }}
+ {{ 'SitesManager_PiwikOffersEcommerceAnalytics'|translate('<a href="http://piwik.org/docs/ecommerce-analytics/" rel="noreferrer" target="_blank">',"</a>")|raw }}
{% endif %}
</li>
</ul>
diff --git a/plugins/Goals/templates/_formAddGoal.twig b/plugins/Goals/templates/_formAddGoal.twig
index 7bff75f8cb..e2da3c1ffb 100644
--- a/plugins/Goals/templates/_formAddGoal.twig
+++ b/plugins/Goals/templates/_formAddGoal.twig
@@ -67,7 +67,7 @@
<tbody id="manual_trigger_section" style="display:none;">
<tr>
<td colspan="2" class="first">
- {{ 'Goals_WhereVisitedPageManuallyCallsJavascriptTrackerLearnMore'|translate("<a target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/javascript-tracking/%23toc-manually-trigger-a-conversion-for-a-goal'>","</a>")|raw }}
+ {{ 'Goals_WhereVisitedPageManuallyCallsJavascriptTrackerLearnMore'|translate("<a rel='noreferrer' target='_blank' href='?module=Proxy&action=redirect&url=http://piwik.org/docs/javascript-tracking/%23toc-manually-trigger-a-conversion-for-a-goal'>","</a>")|raw }}
</td>
</tr>
</tbody>
diff --git a/plugins/Goals/templates/addNewGoal.twig b/plugins/Goals/templates/addNewGoal.twig
index e4cbaea787..6d227bc11c 100644
--- a/plugins/Goals/templates/addNewGoal.twig
+++ b/plugins/Goals/templates/addNewGoal.twig
@@ -6,6 +6,6 @@
{{ 'Goals_NoGoalsNeedAccess'|translate|raw }}
</p>
<p>
- {{ 'Goals_LearnMoreAboutGoalTrackingDocumentation'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/tracking-goals-web-analytics/' target='_blank'>","</a>")|raw }}
+ {{ 'Goals_LearnMoreAboutGoalTrackingDocumentation'|translate("<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/tracking-goals-web-analytics/' rel='noreferrer' target='_blank'>","</a>")|raw }}
</p>
{% endif %}
diff --git a/plugins/Insights/Model.php b/plugins/Insights/Model.php
index 9dae23c978..b8c4957e55 100644
--- a/plugins/Insights/Model.php
+++ b/plugins/Insights/Model.php
@@ -85,7 +85,7 @@ class Model
public function getTotalValue($idSite, $period, $date, $metric, $segment)
{
- $visits = VisitsSummaryAPI::getInstance()->get($idSite, $period, $date, $segment, array($metric));
+ $visits = VisitsSummaryAPI::getInstance()->get($idSite, $period, $date, $segment);
$firstRow = $visits->getFirstRow();
if (empty($firstRow)) {
diff --git a/plugins/Insights/tests/Integration/ModelTest.php b/plugins/Insights/tests/Integration/ModelTest.php
index dda3605309..8b98658f08 100644
--- a/plugins/Insights/tests/Integration/ModelTest.php
+++ b/plugins/Insights/tests/Integration/ModelTest.php
@@ -144,12 +144,10 @@ class ModelTest extends SystemTestCase
$this->assertEquals(1, $total);
}
- /**
- * @expectedException \Exception
- */
public function test_getTotalValue_shouldReturnZero_IfColumnDoesNotExist()
{
- $this->model->getTotalValue(self::$fixture->idSite, 'day', self::$fixture->date1, 'unknown_ColUmn', false);
+ $total = $this->model->getTotalValue(self::$fixture->idSite, 'day', self::$fixture->date1, 'unknown_ColUmn', false);
+ $this->assertEquals(0, $total);
}
public function test_getRelevantTotalValue_shouldReturnTotalValue_IfMetricTotalIsHighEnough()
diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php
index 28650856d9..69b14c7a89 100644
--- a/plugins/Installation/Controller.php
+++ b/plugins/Installation/Controller.php
@@ -635,30 +635,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
{
$view->infos = self::getSystemInformation();
- $view->helpMessages = array(
- 'zlib' => 'Installation_SystemCheckZlibHelp',
- 'gzopen' => 'Installation_SystemCheckZlibHelp',
- 'SPL' => 'Installation_SystemCheckSplHelp',
- 'iconv' => 'Installation_SystemCheckIconvHelp',
- 'mbstring' => 'Installation_SystemCheckMbstringHelp',
- 'Reflection' => 'Required extension that is built in PHP, see http://www.php.net/manual/en/book.reflection.php',
- 'json' => 'Installation_SystemCheckWarnJsonHelp',
- 'libxml' => 'Installation_SystemCheckWarnLibXmlHelp',
- 'dom' => 'Installation_SystemCheckWarnDomHelp',
- 'SimpleXML' => 'Installation_SystemCheckWarnSimpleXMLHelp',
- 'set_time_limit' => 'Installation_SystemCheckTimeLimitHelp',
- 'mail' => 'Installation_SystemCheckMailHelp',
- 'parse_ini_file' => 'Installation_SystemCheckParseIniFileHelp',
- 'glob' => 'Installation_SystemCheckGlobHelp',
- 'debug_backtrace' => 'Installation_SystemCheckDebugBacktraceHelp',
- 'create_function' => 'Installation_SystemCheckCreateFunctionHelp',
- 'eval' => 'Installation_SystemCheckEvalHelp',
- 'gzcompress' => 'Installation_SystemCheckGzcompressHelp',
- 'gzuncompress' => 'Installation_SystemCheckGzuncompressHelp',
- 'pack' => 'Installation_SystemCheckPackHelp',
- 'php5-json' => 'Installation_SystemCheckJsonHelp',
- 'session.auto_start' => 'Installation_SystemCheckSessionAutostart',
- );
+ $view->helpMessages = $this->getSystemCheckHelpMessages();
$view->problemWithSomeDirectories = (false !== array_search(false, $view->infos['directories']));
}
@@ -746,4 +723,44 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
return $result;
});
}
+
+ /**
+ * @return array
+ */
+ private function getSystemCheckHelpMessages()
+ {
+ $helpMessages = array(
+ // Extensions
+ 'zlib' => 'Installation_SystemCheckZlibHelp',
+ 'gzopen' => 'Installation_SystemCheckZlibHelp',
+ 'SPL' => 'Installation_SystemCheckSplHelp',
+ 'iconv' => 'Installation_SystemCheckIconvHelp',
+ 'mbstring' => 'Installation_SystemCheckMbstringHelp',
+ 'Reflection' => 'Required extension that is built in PHP, see http://www.php.net/manual/en/book.reflection.php',
+ 'json' => 'Installation_SystemCheckWarnJsonHelp',
+ 'libxml' => 'Installation_SystemCheckWarnLibXmlHelp',
+ 'dom' => 'Installation_SystemCheckWarnDomHelp',
+ 'SimpleXML' => 'Installation_SystemCheckWarnSimpleXMLHelp',
+
+ // Functions
+ 'set_time_limit' => 'Installation_SystemCheckTimeLimitHelp',
+ 'mail' => 'Installation_SystemCheckMailHelp',
+ 'parse_ini_file' => 'Installation_SystemCheckParseIniFileHelp',
+ 'glob' => 'Installation_SystemCheckGlobHelp',
+ 'debug_backtrace' => 'Installation_SystemCheckDebugBacktraceHelp',
+ 'create_function' => 'Installation_SystemCheckCreateFunctionHelp',
+ 'eval' => 'Installation_SystemCheckEvalHelp',
+ 'gzcompress' => 'Installation_SystemCheckGzcompressHelp',
+ 'gzuncompress' => 'Installation_SystemCheckGzuncompressHelp',
+ 'pack' => 'Installation_SystemCheckPackHelp',
+ 'php5-json' => 'Installation_SystemCheckJsonHelp',
+ );
+
+ // Add standard message for required PHP.ini settings
+ $requiredSettings = SystemCheck::getRequiredPhpSettings();
+ foreach($requiredSettings as $requiredSetting) {
+ $helpMessages[$requiredSetting] = Piwik::translate('Installation_SystemCheckPhpSetting', $requiredSetting);
+ }
+ return $helpMessages;
+ }
}
diff --git a/plugins/Installation/FormSuperUser.php b/plugins/Installation/FormSuperUser.php
index aef40d6a40..87adc47259 100644
--- a/plugins/Installation/FormSuperUser.php
+++ b/plugins/Installation/FormSuperUser.php
@@ -61,7 +61,7 @@ class FormSuperUser extends QuickForm2
$this->addElement('checkbox', 'subscribe_newsletter_piwikpro', null,
array(
'content' => '&nbsp;&nbsp;' . Piwik::translate('Installation_PiwikProNewsletter',
- array("<a href='http://piwik.pro' style='color:#444;' target='_blank'>", "</a>")
+ array("<a href='http://piwik.pro' style='color:#444;' rel='noreferrer' target='_blank'>", "</a>")
),
));
diff --git a/plugins/Installation/SystemCheck.php b/plugins/Installation/SystemCheck.php
index cd152f5efc..be714ac838 100644
--- a/plugins/Installation/SystemCheck.php
+++ b/plugins/Installation/SystemCheck.php
@@ -24,38 +24,16 @@ use Piwik\SettingsServer;
class SystemCheck
{
-
/**
* Get system information
*/
public static function getSystemInformation()
{
global $piwik_minimumPHPVersion;
- $minimumMemoryLimit = Config::getInstance()->General['minimum_memory_limit'];
$infos = array();
- $tmpPath = StaticContainer::getContainer()->get('path.tmp');
-
- $directoriesToCheck = array(
- $tmpPath,
- $tmpPath . '/assets/',
- $tmpPath . '/cache/',
- $tmpPath . '/climulti/',
- $tmpPath . '/latest/',
- $tmpPath . '/logs/',
- $tmpPath . '/sessions/',
- $tmpPath . '/tcpdf/',
- $tmpPath . '/templates_c/',
- );
-
- if (!DbHelper::isInstalled()) {
- // at install, need /config to be writable (so we can create config.ini.php)
- $directoriesToCheck[] = '/config/';
- }
-
- $infos['directories'] = Filechecks::checkDirectoriesWritable($directoriesToCheck);
-
+ $infos['directories'] = self::getDirectoriesWritableStatus();
$infos['can_auto_update'] = Filechecks::canAutoUpdate();
self::initServerFilesForSecurity();
@@ -65,111 +43,39 @@ class SystemCheck
$infos['phpVersion_ok'] = self::isPhpVersionValid($infos['phpVersion']);
// critical errors
- $extensions = @get_loaded_extensions();
- $needed_extensions = array(
- 'zlib',
- 'SPL',
- 'iconv',
- 'json',
- 'mbstring',
- );
- // HHVM provides the required subset of Reflection but lists Reflections as missing
- if (!defined('HHVM_VERSION')) {
- $needed_extensions[] = 'Reflection';
- }
- $infos['needed_extensions'] = $needed_extensions;
- $infos['missing_extensions'] = array();
- foreach ($needed_extensions as $needed_extension) {
- if (!in_array($needed_extension, $extensions)) {
- $infos['missing_extensions'][] = $needed_extension;
- }
- }
-
- // Special case for mbstring
- if (!function_exists('mb_get_info')
- || ((int)ini_get('mbstring.func_overload')) != 0) {
- $infos['missing_extensions'][] = 'mbstring';
- }
-
- $infos['pdo_ok'] = false;
- if (in_array('PDO', $extensions)) {
- $infos['pdo_ok'] = true;
- }
+ $infos['needed_extensions'] = self::getRequiredExtensions();
+ $infos['missing_extensions'] = self::getRequiredExtensionsMissing();
+ $infos['pdo_ok'] = self::isPhpExtensionLoaded('PDO');
$infos['adapters'] = Adapter::getAdapters();
- $needed_functions = array(
- 'debug_backtrace',
- 'create_function',
- 'eval',
- 'gzcompress',
- 'gzuncompress',
- 'pack',
- );
- $infos['needed_functions'] = $needed_functions;
- $infos['missing_functions'] = array();
- foreach ($needed_functions as $needed_function) {
- if (!self::functionExists($needed_function)) {
- $infos['missing_functions'][] = $needed_function;
- }
- }
+ $infos['needed_functions'] = self::getRequiredFunctions();
+ $infos['missing_functions'] = self::getRequiredFunctionsMissing();;
// warnings
- $desired_extensions = array(
- 'json',
- 'libxml',
- 'dom',
- 'SimpleXML',
- );
- $infos['desired_extensions'] = $desired_extensions;
- $infos['missing_desired_extensions'] = array();
- foreach ($desired_extensions as $desired_extension) {
- if (!in_array($desired_extension, $extensions)) {
- $infos['missing_desired_extensions'][] = $desired_extension;
- }
- }
- $desired_functions = array(
- 'set_time_limit',
- 'mail',
- 'parse_ini_file',
- 'glob',
- 'gzopen',
- );
- $infos['missing_desired_functions'] = array();
- foreach ($desired_functions as $desired_function) {
- if (!self::functionExists($desired_function)) {
- $infos['missing_desired_functions'][] = $desired_function;
- }
- }
+ $infos['desired_extensions'] = self::getRecommendedExtensions();
+ $infos['missing_desired_extensions'] = self::getRecommendedExtensionsMissing();
- $sessionAutoStarted = (int)ini_get('session.auto_start');
- if ($sessionAutoStarted) {
- $infos['missing_desired_functions'][] = 'session.auto_start';
- }
+ $infos['desired_functions'] = self::getRecommendedFunctions();
+ $infos['missing_desired_functions'] = self::getRecommendedFunctionsMissing();
- $desired_settings = array(
- 'session.auto_start',
- );
- $infos['desired_functions'] = array_merge($desired_functions, $desired_settings);
+ $infos['needed_settings'] = self::getRequiredPhpSettings();
+ $infos['missing_settings'] = self::getMissingPhpSettings();
$infos['openurl'] = Http::getTransportMethod();
-
$infos['gd_ok'] = SettingsServer::isGdExtensionEnabled();
-
- $serverSoftware = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '';
- $infos['serverVersion'] = addslashes($serverSoftware);
+ $infos['serverVersion'] = addslashes(isset($_SERVER['SERVER_SOFTWARE']) ?: '');
$infos['serverOs'] = @php_uname();
$infos['serverTime'] = date('H:i:s');
- $infos['memoryMinimum'] = $minimumMemoryLimit;
-
+ $infos['memoryMinimum'] = self::getMinimumRecommendedMemoryLimit();
$infos['memory_ok'] = true;
$infos['memoryCurrent'] = '';
- $raised = SettingsServer::raiseMemoryLimitIfNecessary();
+ SettingsServer::raiseMemoryLimitIfNecessary();
if (($memoryValue = SettingsServer::getMemoryLimitValue()) > 0) {
$infos['memoryCurrent'] = $memoryValue . 'M';
- $infos['memory_ok'] = $memoryValue >= $minimumMemoryLimit;
+ $infos['memory_ok'] = $memoryValue >= self::getMinimumRecommendedMemoryLimit();
}
$infos['isWindows'] = SettingsServer::isWindows();
@@ -192,7 +98,6 @@ class SystemCheck
$infos['tracker_status'] = Common::getRequestVar('trackerStatus', 0, 'int');
- // check if filesystem is NFS, if it is file based sessions won't work properly
$infos['is_nfs'] = Filesystem::checkIfFileSystemIsNFS();
$infos = self::enrichSystemChecks($infos);
@@ -200,6 +105,9 @@ class SystemCheck
}
/**
+ * This can be overriden to provide a Customised System Check.
+ *
+ * @api
* @param $infos
* @return mixed
*/
@@ -231,31 +139,92 @@ class SystemCheck
}
/**
- * Test if function exists. Also handles case where function is disabled via Suhosin.
- *
- * @param string $functionName Function name
- * @return bool True if function exists (not disabled); False otherwise.
+ * @return array
*/
- public static function functionExists($functionName)
+ protected static function getDirectoriesShouldBeWritable()
{
- // eval() is a language construct
- if ($functionName == 'eval') {
- // does not check suhosin.executor.eval.whitelist (or blacklist)
- if (extension_loaded('suhosin')) {
- return @ini_get("suhosin.executor.disable_eval") != "1";
- }
- return true;
+ $tmpPath = StaticContainer::getContainer()->get('path.tmp');
+
+ $directoriesToCheck = array(
+ $tmpPath,
+ $tmpPath . '/assets/',
+ $tmpPath . '/cache/',
+ $tmpPath . '/climulti/',
+ $tmpPath . '/latest/',
+ $tmpPath . '/logs/',
+ $tmpPath . '/sessions/',
+ $tmpPath . '/tcpdf/',
+ $tmpPath . '/templates_c/',
+ );
+
+ if (!DbHelper::isInstalled()) {
+ // at install, need /config to be writable (so we can create config.ini.php)
+ $directoriesToCheck[] = '/config/';
}
+ return $directoriesToCheck;
+ }
- $exists = function_exists($functionName);
- if (extension_loaded('suhosin')) {
- $blacklist = @ini_get("suhosin.executor.func.blacklist");
- if (!empty($blacklist)) {
- $blacklistFunctions = array_map('strtolower', array_map('trim', explode(',', $blacklist)));
- return $exists && !in_array($functionName, $blacklistFunctions);
- }
+ /**
+ * @return array
+ */
+ protected static function getRequiredFunctions()
+ {
+ return array(
+ 'debug_backtrace',
+ 'create_function',
+ 'eval',
+ 'gzcompress',
+ 'gzuncompress',
+ 'pack',
+ );
+ }
+
+ /**
+ * @return array
+ */
+ protected static function getRecommendedExtensions()
+ {
+ return array(
+ 'json',
+ 'libxml',
+ 'dom',
+ 'SimpleXML',
+ );
+ }
+
+ /**
+ * @return array
+ */
+ protected static function getRecommendedFunctions()
+ {
+ return array(
+ 'set_time_limit',
+ 'mail',
+ 'parse_ini_file',
+ 'glob',
+ 'gzopen',
+ );
+ }
+
+ /**
+ * @return array
+ */
+ protected static function getRequiredExtensions()
+ {
+ $requiredExtensions = array(
+ 'zlib',
+ 'SPL',
+ 'iconv',
+ 'json',
+ 'mbstring',
+ );
+
+ if (!defined('HHVM_VERSION')) {
+ // HHVM provides the required subset of Reflection but lists Reflections as missing
+ $requiredExtensions[] = 'Reflection';
}
- return $exists;
+
+ return $requiredExtensions;
}
/**
@@ -279,6 +248,34 @@ class SystemCheck
return $result;
}
+ /**
+ * Test if function exists. Also handles case where function is disabled via Suhosin.
+ *
+ * @param string $functionName Function name
+ * @return bool True if function exists (not disabled); False otherwise.
+ */
+ protected static function functionExists($functionName)
+ {
+ // eval() is a language construct
+ if ($functionName == 'eval') {
+ // does not check suhosin.executor.eval.whitelist (or blacklist)
+ if (extension_loaded('suhosin')) {
+ return @ini_get("suhosin.executor.disable_eval") != "1";
+ }
+ return true;
+ }
+
+ $exists = function_exists($functionName);
+ if (extension_loaded('suhosin')) {
+ $blacklist = @ini_get("suhosin.executor.func.blacklist");
+ if (!empty($blacklist)) {
+ $blacklistFunctions = array_map('strtolower', array_map('trim', explode(',', $blacklist)));
+ return $exists && !in_array($functionName, $blacklistFunctions);
+ }
+ }
+ return $exists;
+ }
+
private static function checkGeolocation(&$result)
{
$currentProviderId = LocationProvider::getCurrentProviderId();
@@ -323,13 +320,11 @@ class SystemCheck
{
ServerFilesGenerator::createWebConfigFiles();
ServerFilesGenerator::createHtAccessFiles();
-
ServerFilesGenerator::createWebRootFiles();
}
/**
- * @param $piwik_minimumPHPVersion
- * @param $infos
+ * @param string $phpVersion
* @return bool
*/
public static function isPhpVersionValid($phpVersion)
@@ -338,4 +333,142 @@ class SystemCheck
return version_compare($piwik_minimumPHPVersion, $phpVersion) <= 0;
}
+ /**
+ * @return array
+ */
+ protected static function getDirectoriesWritableStatus()
+ {
+ $directoriesToCheck = self::getDirectoriesShouldBeWritable();
+ $directoriesWritableStatus = Filechecks::checkDirectoriesWritable($directoriesToCheck);
+ return $directoriesWritableStatus;
+ }
+
+ /**
+ * @return array
+ */
+ protected static function getLoadedExtensions()
+ {
+ static $extensions = null;
+
+ if(is_null($extensions)) {
+ $extensions = @get_loaded_extensions();
+ }
+ return $extensions;
+ }
+
+
+ /**
+ * @param $needed_extension
+ * @return bool
+ */
+ protected static function isPhpExtensionLoaded($needed_extension)
+ {
+ return in_array($needed_extension, self::getLoadedExtensions());
+ }
+
+ /**
+ * @return array
+ */
+ protected static function getRequiredExtensionsMissing()
+ {
+ $missingExtensions = array();
+ foreach (self::getRequiredExtensions() as $requiredExtension) {
+ if (!self::isPhpExtensionLoaded($requiredExtension)) {
+ $missingExtensions[] = $requiredExtension;
+ }
+ }
+
+ // Special case for mbstring
+ if (!function_exists('mb_get_info')
+ || ((int)ini_get('mbstring.func_overload')) != 0) {
+ $missingExtensions[] = 'mbstring';
+ }
+
+ return $missingExtensions;
+ }
+
+ /**
+ * @return array
+ */
+ protected static function getRecommendedExtensionsMissing()
+ {
+ return array_diff(self::getRecommendedExtensions(), self::getLoadedExtensions());
+ }
+
+ /**
+ * @return array
+ */
+ protected static function getRecommendedFunctionsMissing()
+ {
+ return self::getFunctionsMissing(self::getRecommendedFunctions());
+ }
+
+ /**
+ * @return array
+ */
+ protected static function getRequiredFunctionsMissing()
+ {
+ return self::getFunctionsMissing(self::getRequiredFunctions());
+ }
+
+ protected static function getFunctionsMissing($functionsToTestFor)
+ {
+ $missingFunctions = array();
+ foreach ($functionsToTestFor as $function) {
+ if (!self::functionExists($function)) {
+ $missingFunctions[] = $function;
+ }
+ }
+ return $missingFunctions;
+ }
+
+ /**
+ * @return mixed
+ */
+ protected static function getMinimumRecommendedMemoryLimit()
+ {
+ return Config::getInstance()->General['minimum_memory_limit'];
+ }
+
+ private static function isPhpVersionAtLeast56()
+ {
+ return version_compare( PHP_VERSION, '5.6', '>=');
+ }
+
+ /**
+ * @return array
+ */
+ public static function getRequiredPhpSettings()
+ {
+ $requiredPhpSettings = array(
+ // setting = required value
+ // Note: value must be an integer only
+ 'session.auto_start=0',
+ );
+
+ if (self::isPhpVersionAtLeast56()) {
+ // always_populate_raw_post_data must be -1
+ $requiredPhpSettings[] = 'always_populate_raw_post_data=-1';
+ }
+ return $requiredPhpSettings;
+ }
+
+ /**
+ * @return array
+ */
+ protected static function getMissingPhpSettings()
+ {
+ $missingPhpSettings = array();
+ foreach(self::getRequiredPhpSettings() as $requiredSetting) {
+ list($requiredSettingName, $requiredSettingValue) = explode('=', $requiredSetting);
+
+ $currentValue = ini_get($requiredSettingName);
+ $currentValue = (int)$currentValue;
+
+ if($currentValue != $requiredSettingValue) {
+ $missingPhpSettings[] = $requiredSetting;
+ }
+ }
+ return $missingPhpSettings;
+ }
} \ No newline at end of file
diff --git a/plugins/Installation/lang/en.json b/plugins/Installation/lang/en.json
index d8e8b972d3..da68049906 100644
--- a/plugins/Installation/lang/en.json
+++ b/plugins/Installation/lang/en.json
@@ -95,6 +95,7 @@
"SystemCheckPhp": "PHP version",
"SystemCheckPhpPdoAndMysqli": "More information on: %1$sPHP PDO%2$s and %3$sMYSQLI%4$s.",
"SystemCheckSplHelp": "You need to configure and rebuild PHP with the Standard PHP Library (SPL) enabled (by default).",
+ "SystemCheckSettings": "Required PHP configuration (php.ini)",
"SystemCheckSummaryNoProblems": "Huzzah! There are no problems with your Piwik setup. Give yourself a pat on the back.",
"SystemCheckSummaryThereWereErrors": "Uh-oh! Piwik has detected some %1$scritical issues%2$s with your Piwik setup. %3$sThese issues should be fixed immediately.%4$s",
"SystemCheckSummaryThereWereWarnings": "There are some issues with your system. Piwik will run, but you might experience some minor problems.",
@@ -112,7 +113,7 @@
"SystemCheckZlibHelp": "You need to configure and rebuild PHP with \"zlib\" support enabled, --with-zlib.",
"SystemCheckCronArchiveProcess": "Archive Cron",
"SystemCheckCronArchiveProcessCLI": "Managing processes via CLI",
- "SystemCheckSessionAutostart": "To prevent some issues please set the following in your php.ini file: session.auto_start=0",
+ "SystemCheckPhpSetting": "To prevent some critical issue, you must set the following in your php.ini file: %s",
"NotSupported": "not supported",
"Tables": "Creating the Tables",
"TablesCreatedSuccess": "Tables created with success!",
diff --git a/plugins/Installation/templates/_systemCheckSection.twig b/plugins/Installation/templates/_systemCheckSection.twig
index 22247455ae..871b06d981 100755
--- a/plugins/Installation/templates/_systemCheckSection.twig
+++ b/plugins/Installation/templates/_systemCheckSection.twig
@@ -56,14 +56,13 @@
{% for needed_extension in infos.needed_extensions %}
{% if needed_extension in infos.missing_extensions %}
{{ error }}
- {% set hasError %}1{% endset %}
+ <br/>{{ 'Installation_RestartWebServer'|translate }}
{% else %}
{{ ok }}
{% endif %}
{{ needed_extension }}
<br/>
{% endfor %}
- <br/>{% if hasError is defined %}{{ 'Installation_RestartWebServer'|translate }}{% endif %}
</td>
</tr>
{% if infos.missing_extensions|length > 0 %}
@@ -84,16 +83,37 @@
{% if needed_function in infos.missing_functions %}
{{ error }}
<span class='err'>{{ needed_function }}</span>
- {% set hasError %}1{% endset %}
<p>
- <em>{{ helpMessages[needed_function]|translate }}</em>
+ <em>
+ {{ helpMessages[needed_function]|translate }}
+ <br/>{{ 'Installation_RestartWebServer'|translate }}
+ </em>
</p>
{% else %}
{{ ok }} {{ needed_function }}
<br/>
{% endif %}
{% endfor %}
- <br/>{% if hasError is defined %}{{ 'Installation_RestartWebServer'|translate }}{% endif %}
+ </td>
+ </tr>
+ <tr>
+ <td class="label">{{ 'Installation_SystemCheckSettings'|translate }}</td>
+ <td>
+ {% for needed_setting in infos.needed_settings %}
+ {% if needed_setting in infos.missing_settings %}
+ {{ error }}
+ <span class='err'>{{ needed_setting }}</span>
+ <p>
+ <em>
+ {{ helpMessages[needed_setting]|translate }}
+ <br/>{{ 'Installation_RestartWebServer'|translate }}
+ </em>
+ </p>
+ {% else %}
+ {{ ok }} {{ needed_setting }}
+ <br/>
+ {% endif %}
+ {% endfor %}
</td>
</tr>
<tr>
@@ -189,7 +209,7 @@
{{ warning }}
<span class="warn">{{ 'SitesManager_AdvancedTimezoneSupportNotFound'|translate }} </span>
<br/>
- <a href="http://php.net/manual/en/datetime.installation.php" target="_blank">Timezone PHP documentation</a>
+ <a href="http://php.net/manual/en/datetime.installation.php" rel="noreferrer" target="_blank">Timezone PHP documentation</a>
.
{% endif %}
</td>
@@ -291,12 +311,12 @@
{% elseif infos.extra.geolocation_using_non_recommended %}
{{ warning }}
<span class="warn">{{ 'UserCountry_GeoIpLocationProviderNotRecomnended'|translate }}
- {{ 'UserCountry_GeoIpLocationProviderDesc_ServerBased2'|translate('<a href="http://piwik.org/docs/geo-locate/" target="_blank">', '', '', '</a>')|raw }}</span>
+ {{ 'UserCountry_GeoIpLocationProviderDesc_ServerBased2'|translate('<a href="http://piwik.org/docs/geo-locate/" rel="noreferrer" target="_blank">', '', '', '</a>')|raw }}</span>
<br/>
{% else %}
{{ warning }}
<span class="warn">{{ 'UserCountry_DefaultLocationProviderDesc1'|translate }}
- {{ 'UserCountry_DefaultLocationProviderDesc2'|translate('<a href="http://piwik.org/docs/geo-locate/" target="_blank">', '', '', '</a>')|raw }} </span>
+ {{ 'UserCountry_DefaultLocationProviderDesc2'|translate('<a href="http://piwik.org/docs/geo-locate/" rel="noreferrer" target="_blank">', '', '', '</a>')|raw }} </span>
</span>
{% endif %}
</td>
@@ -320,7 +340,7 @@
<em><strong>{{ 'General_Error'|translate }}:</strong></em>
{{ infos.extra.load_data_infile_error|raw }}
{% endif %}
- <p>Troubleshooting: <a target='_blank' href="?module=Proxy&action=redirect&url=http://piwik.org/faq/troubleshooting/%23faq_194">FAQ on piwik.org</a></p>
+ <p>Troubleshooting: <a rel='noreferrer' target='_blank' href="?module=Proxy&action=redirect&url=http://piwik.org/faq/troubleshooting/%23faq_194">FAQ on piwik.org</a></p>
{% endif %}
</td>
</tr>
diff --git a/plugins/Installation/templates/finished.twig b/plugins/Installation/templates/finished.twig
index 468fe0600b..6e428916fb 100644
--- a/plugins/Installation/templates/finished.twig
+++ b/plugins/Installation/templates/finished.twig
@@ -11,8 +11,8 @@
{{ 'Installation_CollaborativeProject'|translate }}
</p>
<p>
- {{ 'Installation_GetInvolved'|translate('<a target="_blank" href="http://piwik.org/get-involved/">','</a>')|raw }}
- {{ 'General_HelpTranslatePiwik'|translate("<a target='_blank' href=\'http://piwik.org/translations/\'>","<\/a>")|raw }}
+ {{ 'Installation_GetInvolved'|translate('<a rel="noreferrer" target="_blank" href="http://piwik.org/get-involved/">','</a>')|raw }}
+ {{ 'General_HelpTranslatePiwik'|translate("<a rel='noreferrer' target='_blank' href=\'http://piwik.org/translations/\'>","<\/a>")|raw }}
</p>
<p>{{ 'Installation_WeHopeYouWillEnjoyPiwik'|translate }}</p>
<p><i>{{ 'Installation_HappyAnalysing'|translate }}</i></p>
diff --git a/plugins/Installation/templates/reuseTables.twig b/plugins/Installation/templates/reuseTables.twig
index 909c6d5c95..12eb53bca6 100644
--- a/plugins/Installation/templates/reuseTables.twig
+++ b/plugins/Installation/templates/reuseTables.twig
@@ -26,7 +26,7 @@
<ul>
<li>{{ 'CoreUpdater_ErrorDIYHelp_1'|translate }}</li>
<li>{{ 'CoreUpdater_ErrorDIYHelp_2'|translate }}</li>
- <li>{{ 'CoreUpdater_ErrorDIYHelp_3'|translate }} <a href='https://piwik.org/faq/how-to-update/#faq_179' target='_blank'>(see FAQ)</a></li>
+ <li>{{ 'CoreUpdater_ErrorDIYHelp_3'|translate }} <a href='https://piwik.org/faq/how-to-update/#faq_179' rel='noreferrer' target='_blank'>(see FAQ)</a></li>
<li>{{ 'CoreUpdater_ErrorDIYHelp_4'|translate }}</li>
<li>{{ 'CoreUpdater_ErrorDIYHelp_5'|translate }}</li>
</ul>
diff --git a/plugins/Installation/templates/systemCheck.twig b/plugins/Installation/templates/systemCheck.twig
index f142e4edef..a8bb2c2e99 100644
--- a/plugins/Installation/templates/systemCheck.twig
+++ b/plugins/Installation/templates/systemCheck.twig
@@ -24,7 +24,7 @@
<br/>
<p>
<img src='plugins/Morpheus/images/link.gif'/> &nbsp;
- <a href="?module=Proxy&action=redirect&url=http://piwik.org/docs/requirements/" target="_blank">{{ 'Installation_Requirements'|translate }}</a>
+ <a href="?module=Proxy&action=redirect&url=http://piwik.org/docs/requirements/" rel="noreferrer" target="_blank">{{ 'Installation_Requirements'|translate }}</a>
</p>
{% include "@Installation/_systemCheckLegend.twig" %}
{% endif %}
diff --git a/plugins/Installation/templates/trackingCode.twig b/plugins/Installation/templates/trackingCode.twig
index 3ca7992cfa..08e78abeda 100644
--- a/plugins/Installation/templates/trackingCode.twig
+++ b/plugins/Installation/templates/trackingCode.twig
@@ -11,7 +11,7 @@
{{ trackingHelp|raw }}
<br/><br/>
<h2>{{ 'Installation_LargePiwikInstances'|translate }}</h2>
-{{ 'Installation_JsTagArchivingHelp1'|translate('<a target="_blank" href="http://piwik.org/docs/setup-auto-archiving/">','</a>')|raw }}
-{{ 'General_ReadThisToLearnMore'|translate('<a target="_blank" href="http://piwik.org/docs/optimize/">','</a>')|raw }}
+{{ 'Installation_JsTagArchivingHelp1'|translate('<a rel="noreferrer" target="_blank" href="http://piwik.org/docs/setup-auto-archiving/">','</a>')|raw }}
+{{ 'General_ReadThisToLearnMore'|translate('<a rel="noreferrer" target="_blank" href="http://piwik.org/docs/optimize/">','</a>')|raw }}
{% endblock %} \ No newline at end of file
diff --git a/plugins/LanguagesManager/API.php b/plugins/LanguagesManager/API.php
index eaa5263ff6..2c8d74978a 100644
--- a/plugins/LanguagesManager/API.php
+++ b/plugins/LanguagesManager/API.php
@@ -19,7 +19,7 @@ use Piwik\Plugin\Manager as PluginManager;
* The LanguagesManager API lets you access existing Piwik translations, and change Users languages preferences.
*
* "getTranslationsForLanguage" will return all translation strings for a given language,
- * so you can leverage Piwik translations in your application (and automatically benefit from the <a href='http://piwik.org/translations/' target='_blank'>40+ translations</a>!).
+ * so you can leverage Piwik translations in your application (and automatically benefit from the <a href='http://piwik.org/translations/' rel='noreferrer' target='_blank'>40+ translations</a>!).
* This is mostly useful to developers who integrate Piwik API results in their own application.
*
* You can also request the default language to load for a user via "getLanguageForUser",
diff --git a/plugins/LanguagesManager/angularjs/translationsearch/translationsearch.directive.html b/plugins/LanguagesManager/angularjs/translationsearch/translationsearch.directive.html
index 55ee2281fe..c21cffd24a 100644
--- a/plugins/LanguagesManager/angularjs/translationsearch/translationsearch.directive.html
+++ b/plugins/LanguagesManager/angularjs/translationsearch/translationsearch.directive.html
@@ -2,7 +2,7 @@
<p class="adminTable">
This page helps you to find existing translations that you can reuse in your Plugin.
- If you want to know more about translations have a look at our <a href="http://developer.piwik.org/guides/internationalization" target="_blank">Internationalization guide</a>.
+ If you want to know more about translations have a look at our <a href="http://developer.piwik.org/guides/internationalization" rel="noreferrer" target="_blank">Internationalization guide</a>.
Enter a search term to find translations and their corresponding keys:
</p>
diff --git a/plugins/Live/API.php b/plugins/Live/API.php
index d15cca9e36..7a36822534 100644
--- a/plugins/Live/API.php
+++ b/plugins/Live/API.php
@@ -15,7 +15,7 @@ use Piwik\DataTable;
use Piwik\DataTable\Row;
use Piwik\Date;
use Piwik\Db;
-use Piwik\MetricsFormatter;
+use Piwik\Metrics\Formatter;
use Piwik\Period\Range;
use Piwik\Period;
use Piwik\Piwik;
@@ -44,12 +44,12 @@ require_once PIWIK_INCLUDE_PATH . '/plugins/UserCountry/functions.php';
* browser, type of screen, resolution, supported browser plugins (flash, java, silverlight, pdf, etc.), various dates & times format to make
* it easier for API users... and more!
*
- * With the parameter <a href='http://piwik.org/docs/analytics-api/segmentation/' target='_blank'>'&segment='</a> you can filter the
+ * With the parameter <a href='http://piwik.org/docs/analytics-api/segmentation/' rel='noreferrer' target='_blank'>'&segment='</a> you can filter the
* returned visits by any criteria (visitor IP, visitor ID, country, keyword used, time of day, etc.).
*
* The method "getCounters" is used to return a simple counter: visits, number of actions, number of converted visits, in the last N minutes.
*
- * See also the documentation about <a href='http://piwik.org/docs/real-time/' target='_blank'>Real time widget and visitor level reports</a> in Piwik.
+ * See also the documentation about <a href='http://piwik.org/docs/real-time/' rel='noreferrer' target='_blank'>Real time widget and visitor level reports</a> in Piwik.
* @method static \Piwik\Plugins\Live\API getInstance()
*/
class API extends \Piwik\Plugin\API
@@ -345,7 +345,8 @@ class API extends \Piwik\Plugin\API
round($pageGenerationTimeTotal / $result['totalPageViews'], $precision = 2);
}
- $result['totalVisitDurationPretty'] = MetricsFormatter::getPrettyTimeFromSeconds($result['totalVisitDuration']);
+ $formatter = new Formatter();
+ $result['totalVisitDurationPretty'] = $formatter->getPrettyTimeFromSeconds($result['totalVisitDuration'], true);
// use requested visits for first/last visit info
$rows = $visits->getRows();
diff --git a/plugins/Live/Reports/GetSimpleLastVisitCount.php b/plugins/Live/Reports/GetSimpleLastVisitCount.php
index 1b44e4ad69..34ba773fa9 100644
--- a/plugins/Live/Reports/GetSimpleLastVisitCount.php
+++ b/plugins/Live/Reports/GetSimpleLastVisitCount.php
@@ -9,7 +9,7 @@
namespace Piwik\Plugins\Live\Reports;
use Piwik\Config;
-use Piwik\MetricsFormatter;
+use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use Piwik\Plugin\Report;
use Piwik\Plugins\Live\Controller;
@@ -32,11 +32,13 @@ class GetSimpleLastVisitCount extends Base
$lastNData = Request::processRequest('Live.getCounters', array('lastMinutes' => $lastMinutes));
+ $formatter = new Formatter();
+
$view = new View('@Live/getSimpleLastVisitCount');
$view->lastMinutes = $lastMinutes;
- $view->visitors = MetricsFormatter::getPrettyNumber($lastNData[0]['visitors']);
- $view->visits = MetricsFormatter::getPrettyNumber($lastNData[0]['visits']);
- $view->actions = MetricsFormatter::getPrettyNumber($lastNData[0]['actions']);
+ $view->visitors = $formatter->getPrettyNumber($lastNData[0]['visitors']);
+ $view->visits = $formatter->getPrettyNumber($lastNData[0]['visits']);
+ $view->actions = $formatter->getPrettyNumber($lastNData[0]['actions']);
$view->refreshAfterXSecs = Config::getInstance()->General['live_widget_refresh_after_seconds'];
$view->translations = array(
'one_visitor' => Piwik::translate('Live_NbVisitor'),
@@ -51,5 +53,4 @@ class GetSimpleLastVisitCount extends Base
return $view->render();
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php
index 27873ec2a1..5cbe823cd9 100644
--- a/plugins/Live/Visitor.php
+++ b/plugins/Live/Visitor.php
@@ -13,6 +13,7 @@ use Piwik\DataAccess\LogAggregator;
use Piwik\DataTable\Filter\ColumnDelete;
use Piwik\Date;
use Piwik\Db;
+use Piwik\Metrics\Formatter;
use Piwik\Network\IPUtils;
use Piwik\Piwik;
use Piwik\Plugins\CustomVariables\CustomVariables;
@@ -282,6 +283,8 @@ class Visitor implements VisitorInterface
";
$actionDetails = Db::fetchAll($sql, array($idVisit));
+ $formatter = new Formatter();
+
foreach ($actionDetails as $actionIdx => &$actionDetail) {
$actionDetail =& $actionDetails[$actionIdx];
$customVariablesPage = array();
@@ -327,7 +330,7 @@ class Visitor implements VisitorInterface
$actionDetail['eventValue'] = round($actionDetail['custom_float'], self::EVENT_VALUE_PRECISION);
}
} elseif ($actionDetail['custom_float'] > 0) {
- $actionDetail['generationTime'] = \Piwik\MetricsFormatter::getPrettyTimeFromSeconds($actionDetail['custom_float'] / 1000);
+ $actionDetail['generationTime'] = $formatter->getPrettyTimeFromSeconds($actionDetail['custom_float'] / 1000, true);
}
unset($actionDetail['custom_float']);
@@ -343,7 +346,7 @@ class Visitor implements VisitorInterface
// Set the time spent for this action (which is the timeSpentRef of the next action)
if (isset($actionDetails[$actionIdx + 1])) {
$actionDetail['timeSpent'] = $actionDetails[$actionIdx + 1]['timeSpentRef'];
- $actionDetail['timeSpentPretty'] = \Piwik\MetricsFormatter::getPrettyTimeFromSeconds($actionDetail['timeSpent']);
+ $actionDetail['timeSpentPretty'] = $formatter->getPrettyTimeFromSeconds($actionDetail['timeSpent'], true);
}
unset($actionDetails[$actionIdx]['timeSpentRef']); // not needed after timeSpent is added
diff --git a/plugins/Live/templates/_actionsList.twig b/plugins/Live/templates/_actionsList.twig
index 8463d0e461..cc798f4f6e 100644
--- a/plugins/Live/templates/_actionsList.twig
+++ b/plugins/Live/templates/_actionsList.twig
@@ -101,7 +101,7 @@
and previousAction.url|default(false) == action.url %}
{# For events, do not show (url) if the Event URL is the same as the URL last displayed #}
{% else %}
- <a href="{{ action.url }}" target="_blank" class="{% if action.eventCategory|default(false) is empty %}action-list-url{# don't put URL on new line for events #}{% endif %} truncated-text-line"
+ <a href="{{ action.url }}" rel="noreferrer" target="_blank" rel="noreferrer" class="{% if action.eventCategory|default(false) is empty %}action-list-url{# don't put URL on new line for events #}{% endif %} truncated-text-line"
{% if overrideLinkStyle is not defined or overrideLinkStyle %}style="{% if action.type=='action' and action.pageTitle|default(false) is not empty %}margin-left: 9px;{% endif %}text-decoration:underline;"{% endif %}>
{% if action.eventCategory|default(false) is not empty %}
(url)
diff --git a/plugins/Live/templates/_dataTableViz_visitorLog.twig b/plugins/Live/templates/_dataTableViz_visitorLog.twig
index e91ee9a75a..922ed2057b 100644
--- a/plugins/Live/templates/_dataTableViz_visitorLog.twig
+++ b/plugins/Live/templates/_dataTableViz_visitorLog.twig
@@ -71,7 +71,7 @@
<div class="referrer">
{% if visitor.getColumn('referrerType') == 'website' %}
{{ 'Referrers_ColumnWebsite'|translate }}:
- <a href="{{ visitor.getColumn('referrerUrl') }}" target="_blank" title="{{ visitor.getColumn('referrerUrl') }}"
+ <a href="{{ visitor.getColumn('referrerUrl') }}" rel="noreferrer" target="_blank" title="{{ visitor.getColumn('referrerUrl') }}"
style="text-decoration:underline;">
{{ visitor.getColumn('referrerName') }}
</a>
@@ -91,7 +91,7 @@
<span {% if not showKeyword %}title="{{ keywordNotDefined }}"{% endif %}>{{ visitor.getColumn('referrerName') }}</span>
{% if showKeyword %}{{ 'Referrers_Keywords'|translate }}:
<br/>
- <a href="{{ visitor.getColumn('referrerUrl') }}" target="_blank" style="text-decoration:underline;">
+ <a href="{{ visitor.getColumn('referrerUrl') }}" rel="noreferrer" target="_blank" style="text-decoration:underline;">
"{{ visitor.getColumn('referrerKeyword') }}"</a>
{% endif %}
{% set keyword %}{{ visitor.getColumn('referrerKeyword') }}{% endset %}
@@ -134,7 +134,7 @@ GPS (lat/long): {{ visitor.getColumn('latitude') }},{{ visitor.getColumn('longit
{% if visitor.getColumn('provider') %}
<br/>
{{ 'Provider_ColumnProvider'|translate }}:
- <a href="{{ visitor.getColumn('providerUrl') }}" target="_blank" title="{{ visitor.getColumn('providerUrl') }}" style="text-decoration:underline;">
+ <a href="{{ visitor.getColumn('providerUrl') }}" rel="noreferrer" target="_blank" title="{{ visitor.getColumn('providerUrl') }}" style="text-decoration:underline;">
{{ visitor.getColumn('providerName') }}
</a>
{% endif %}
diff --git a/plugins/Live/templates/getLastVisitsStart.twig b/plugins/Live/templates/getLastVisitsStart.twig
index c762688f58..7b9f6a4d9d 100644
--- a/plugins/Live/templates/getLastVisitsStart.twig
+++ b/plugins/Live/templates/getLastVisitsStart.twig
@@ -42,7 +42,7 @@
{% if visitor.referrerType is defined and visitor.referrerType != 'direct' %}
{{ 'General_FromReferrer'|translate }}
{% if visitor.referrerUrl is not empty %}
- <a href="{{ visitor.referrerUrl }}" target="_blank">
+ <a href="{{ visitor.referrerUrl }}" rel="noreferrer" target="_blank">
{% endif %}
{% if visitor.searchEngineIcon is defined %}
<img src="{{ visitor.searchEngineIcon }}" />
diff --git a/plugins/Live/templates/getVisitorProfilePopup.twig b/plugins/Live/templates/getVisitorProfilePopup.twig
index 9e68dde96b..0a25de6a39 100644
--- a/plugins/Live/templates/getVisitorProfilePopup.twig
+++ b/plugins/Live/templates/getVisitorProfilePopup.twig
@@ -26,7 +26,7 @@
{%- if visitorData.userId is not empty %}: <span title="{{'General_UserId'|translate}}: {{ visitorData.userId|raw }}">{{ visitorData.userId|raw }}</span>{% endif -%}
<img class="loadingPiwik" style="display:none;" src="plugins/Morpheus/images/loading-blue.gif"/>
</h1>
- <a href="http://piwik.org/docs/user-profile/" class="reportDocumentationIcon" target="_blank" title="{{ 'General_ViewDocumentationFor'|translate("Live_VisitorProfile"|translate|ucwords) }}"></a>
+ <a href="http://piwik.org/docs/user-profile/" class="reportDocumentationIcon" rel="noreferrer" target="_blank" title="{{ 'General_ViewDocumentationFor'|translate("Live_VisitorProfile"|translate|ucwords) }}"></a>
{% if visitorData.nextVisitorId is not empty %}<a class="visitor-profile-next-visitor" href="#" title="{{ 'Live_NextVisitor'|translate }}">&rarr;</a>{% endif %}
</div>
<div class="visitor-profile-latest-visit">
diff --git a/plugins/Login/Controller.php b/plugins/Login/Controller.php
index 62c8b40740..ed790ec899 100644
--- a/plugins/Login/Controller.php
+++ b/plugins/Login/Controller.php
@@ -194,7 +194,7 @@ class Controller extends \Piwik\Plugin\Controller
protected function getMessageExceptionNoAccess()
{
- $message = Piwik::translate('Login_InvalidNonceOrHeadersOrReferrer', array('<a href="?module=Proxy&action=redirect&url=' . urlencode('http://piwik.org/faq/how-to-install/#faq_98') . '" target="_blank">', '</a>'));
+ $message = Piwik::translate('Login_InvalidNonceOrHeadersOrReferrer', array('<a href="?module=Proxy&action=redirect&url=' . urlencode('http://piwik.org/faq/how-to-install/#faq_98') . '" rel="noreferrer" target="_blank">', '</a>'));
// Should mention trusted_hosts or link to FAQ
return $message;
}
diff --git a/plugins/Login/templates/login.twig b/plugins/Login/templates/login.twig
index aca53736f6..bc756aebc4 100644
--- a/plugins/Login/templates/login.twig
+++ b/plugins/Login/templates/login.twig
@@ -54,7 +54,7 @@
{% if isCustomLogo %}
{% set poweredByPiwik %}
- <i><a href="http://piwik.org/" target="_blank">{{ linkTitle }}</a></i>
+ <i><a href="http://piwik.org/" rel="noreferrer" target="_blank">{{ linkTitle }}</a></i>
{% endset %}
{% endif %}
diff --git a/plugins/MobileMessaging/SMSProvider.php b/plugins/MobileMessaging/SMSProvider.php
index c9212971e2..c3794f7d7b 100644
--- a/plugins/MobileMessaging/SMSProvider.php
+++ b/plugins/MobileMessaging/SMSProvider.php
@@ -24,15 +24,15 @@ abstract class SMSProvider extends BaseFactory
const MAX_UCS2_CHARS_IN_ONE_CONCATENATED_SMS = 67;
public static $availableSMSProviders = array(
- 'Clockwork' => 'You can use <a target="_blank" href="?module=Proxy&action=redirect&url=http://www.clockworksms.com/platforms/piwik/"><img src="plugins/MobileMessaging/images/Clockwork.png"/></a> to send SMS Reports from Piwik.<br/>
+ 'Clockwork' => 'You can use <a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://www.clockworksms.com/platforms/piwik/"><img src="plugins/MobileMessaging/images/Clockwork.png"/></a> to send SMS Reports from Piwik.<br/>
<ul>
- <li> First, <a target="_blank" href="?module=Proxy&action=redirect&url=http://www.clockworksms.com/platforms/piwik/">get an API Key from Clockwork</a> (Signup is free!)
+ <li> First, <a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://www.clockworksms.com/platforms/piwik/">get an API Key from Clockwork</a> (Signup is free!)
</li><li> Enter your Clockwork API Key on this page. </li>
</ul>
<br/><em>About Clockwork: </em><ul>
<li>Clockwork gives you fast, reliable high quality worldwide SMS delivery, over 450 networks in every corner of the globe.
</li><li>Cost per SMS message is around ~0.08USD (0.06EUR).
- </li><li>Most countries and networks are supported but we suggest you check the latest position on their coverage map <a target="_blank" href="?module=Proxy&action=redirect&url=http://www.clockworksms.com/sms-coverage/">here</a>.
+ </li><li>Most countries and networks are supported but we suggest you check the latest position on their coverage map <a rel="noreferrer" target="_blank" href="?module=Proxy&action=redirect&url=http://www.clockworksms.com/sms-coverage/">here</a>.
</li>
</ul>
',
diff --git a/plugins/MultiSites/API.php b/plugins/MultiSites/API.php
index ea393414f7..b5de1060a5 100755
--- a/plugins/MultiSites/API.php
+++ b/plugins/MultiSites/API.php
@@ -30,6 +30,7 @@ class API extends \Piwik\Plugin\API
const METRIC_TRANSLATION_KEY = 'translation';
const METRIC_EVOLUTION_COL_NAME_KEY = 'evolution_column_name';
const METRIC_RECORD_NAME_KEY = 'record_name';
+ const METRIC_COL_NAME_KEY = 'metric_column_name';
const METRIC_IS_ECOMMERCE_KEY = 'is_ecommerce';
const NB_VISITS_METRIC = 'nb_visits';
@@ -46,12 +47,14 @@ class API extends \Piwik\Plugin\API
self::METRIC_TRANSLATION_KEY => 'General_ColumnNbVisits',
self::METRIC_EVOLUTION_COL_NAME_KEY => 'visits_evolution',
self::METRIC_RECORD_NAME_KEY => self::NB_VISITS_METRIC,
+ self::METRIC_COL_NAME_KEY => self::NB_VISITS_METRIC,
self::METRIC_IS_ECOMMERCE_KEY => false,
),
self::NB_ACTIONS_METRIC => array(
self::METRIC_TRANSLATION_KEY => 'General_ColumnNbActions',
self::METRIC_EVOLUTION_COL_NAME_KEY => 'actions_evolution',
self::METRIC_RECORD_NAME_KEY => self::NB_ACTIONS_METRIC,
+ self::METRIC_COL_NAME_KEY => self::NB_ACTIONS_METRIC,
self::METRIC_IS_ECOMMERCE_KEY => false,
)
);
@@ -239,19 +242,6 @@ class API extends \Piwik\Plugin\API
// use past data to calculate evolution percentages
$this->calculateEvolutionPercentages($dataTable, $pastData, $apiMetrics);
- Common::destroy($pastData);
- }
-
- // remove eCommerce related metrics on non eCommerce Piwik sites
- // note: this is not optimal in terms of performance: those metrics should not be retrieved in the first place
- if ($enhanced) {
- if ($dataTable instanceof DataTable\Map) {
- foreach ($dataTable->getDataTables() as $table) {
- $this->removeEcommerceRelatedMetricsOnNonEcommercePiwikSites($table, $apiECommerceMetrics);
- }
- } else {
- $this->removeEcommerceRelatedMetricsOnNonEcommercePiwikSites($dataTable, $apiECommerceMetrics);
- }
}
// move the site id to a metadata column
@@ -261,15 +251,15 @@ class API extends \Piwik\Plugin\API
// set the label of each row to the site name
if ($multipleWebsitesRequested) {
- $dataTable->filter('ColumnCallbackReplace', array('label', '\Piwik\Site::getNameFor'));
+ $dataTable->queueFilter('ColumnCallbackReplace', array('label', '\Piwik\Site::getNameFor'));
} else {
- $dataTable->filter('ColumnDelete', array('label'));
+ $dataTable->queueFilter('ColumnDelete', array('label'));
}
Site::clearCache();
// replace record names with user friendly metric names
- $dataTable->filter('ReplaceColumnNames', array($columnNameRewrites));
+ $dataTable->queueFilter('ReplaceColumnNames', array($columnNameRewrites));
// Ensures data set sorted, for Metadata output
$dataTable->filter('Sort', array(self::NB_VISITS_METRIC, 'desc', $naturalSort = false));
@@ -326,16 +316,20 @@ class API extends \Piwik\Plugin\API
next($pastArray);
}
} else {
+ $extraProcessedMetrics = $currentData->getMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME);
foreach ($apiMetrics as $metricSettings) {
- $currentData->filter(
- 'CalculateEvolutionFilter',
- array(
- $pastData,
- $metricSettings[self::METRIC_EVOLUTION_COL_NAME_KEY],
- $metricSettings[self::METRIC_RECORD_NAME_KEY],
- $quotientPrecision = 1)
+ $evolutionMetricClass = $this->isEcommerceEvolutionMetric($metricSettings)
+ ? "Piwik\\Plugins\\MultiSites\\Columns\\Metrics\\EcommerceOnlyEvolutionMetric"
+ : "Piwik\\Plugins\\CoreHome\\Columns\\Metrics\\EvolutionMetric";
+
+ $extraProcessedMetrics[] = new $evolutionMetricClass(
+ $metricSettings[self::METRIC_RECORD_NAME_KEY],
+ $pastData,
+ $metricSettings[self::METRIC_EVOLUTION_COL_NAME_KEY],
+ $quotientPrecision = 1
);
}
+ $currentData->setMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME, $extraProcessedMetrics);
}
}
@@ -351,6 +345,7 @@ class API extends \Piwik\Plugin\API
self::METRIC_TRANSLATION_KEY => 'General_ColumnPageviews',
self::METRIC_EVOLUTION_COL_NAME_KEY => 'pageviews_evolution',
self::METRIC_RECORD_NAME_KEY => self::NB_PAGEVIEWS_METRIC,
+ self::METRIC_COL_NAME_KEY => self::NB_PAGEVIEWS_LABEL,
self::METRIC_IS_ECOMMERCE_KEY => false,
);
}
@@ -361,6 +356,7 @@ class API extends \Piwik\Plugin\API
self::METRIC_TRANSLATION_KEY => 'General_ColumnRevenue',
self::METRIC_EVOLUTION_COL_NAME_KEY => self::GOAL_REVENUE_METRIC . '_evolution',
self::METRIC_RECORD_NAME_KEY => Archiver::getRecordName(self::GOAL_REVENUE_METRIC),
+ self::METRIC_COL_NAME_KEY => self::GOAL_REVENUE_METRIC,
self::METRIC_IS_ECOMMERCE_KEY => false,
);
@@ -370,6 +366,7 @@ class API extends \Piwik\Plugin\API
self::METRIC_TRANSLATION_KEY => 'Goals_ColumnConversions',
self::METRIC_EVOLUTION_COL_NAME_KEY => self::GOAL_CONVERSION_METRIC . '_evolution',
self::METRIC_RECORD_NAME_KEY => Archiver::getRecordName(self::GOAL_CONVERSION_METRIC),
+ self::METRIC_COL_NAME_KEY => self::GOAL_CONVERSION_METRIC,
self::METRIC_IS_ECOMMERCE_KEY => false,
);
@@ -378,6 +375,7 @@ class API extends \Piwik\Plugin\API
self::METRIC_TRANSLATION_KEY => 'General_EcommerceOrders',
self::METRIC_EVOLUTION_COL_NAME_KEY => self::ECOMMERCE_ORDERS_METRIC . '_evolution',
self::METRIC_RECORD_NAME_KEY => Archiver::getRecordName(self::GOAL_CONVERSION_METRIC, 0),
+ self::METRIC_COL_NAME_KEY => self::ECOMMERCE_ORDERS_METRIC,
self::METRIC_IS_ECOMMERCE_KEY => true,
);
@@ -386,6 +384,7 @@ class API extends \Piwik\Plugin\API
self::METRIC_TRANSLATION_KEY => 'General_ProductRevenue',
self::METRIC_EVOLUTION_COL_NAME_KEY => self::ECOMMERCE_REVENUE_METRIC . '_evolution',
self::METRIC_RECORD_NAME_KEY => Archiver::getRecordName(self::GOAL_REVENUE_METRIC, 0),
+ self::METRIC_COL_NAME_KEY => self::ECOMMERCE_REVENUE_METRIC,
self::METRIC_IS_ECOMMERCE_KEY => true,
);
}
@@ -497,5 +496,13 @@ class API extends \Piwik\Plugin\API
return $dataTable;
}
-}
+ private function isEcommerceEvolutionMetric($metricSettings)
+ {
+ return in_array($metricSettings[self::METRIC_EVOLUTION_COL_NAME_KEY], array(
+ self::GOAL_REVENUE_METRIC . '_evolution',
+ self::ECOMMERCE_ORDERS_METRIC . '_evolution',
+ self::ECOMMERCE_REVENUE_METRIC . '_evolution'
+ ));
+ }
+} \ No newline at end of file
diff --git a/plugins/MultiSites/Columns/Metrics/EcommerceOnlyEvolutionMetric.php b/plugins/MultiSites/Columns/Metrics/EcommerceOnlyEvolutionMetric.php
new file mode 100644
index 0000000000..cee88af3f5
--- /dev/null
+++ b/plugins/MultiSites/Columns/Metrics/EcommerceOnlyEvolutionMetric.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\MultiSites\Columns\Metrics;
+
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Plugins\CoreHome\Columns\Metrics\EvolutionMetric;
+use Piwik\Site;
+
+/**
+ * Ecommerce evolution metric adapter. This is a special processed metric for MultiSites API methods. It will
+ * only be calculated for sites that have ecommerce enabled. The site is determined by the label
+ * of each row.
+ */
+class EcommerceOnlyEvolutionMetric extends EvolutionMetric
+{
+ private $isRevenueEvolution;
+
+ public function __construct($wrapped, DataTable $pastData, $evolutionMetricName = false, $quotientPrecision = 0)
+ {
+ parent::__construct($wrapped, $pastData, $evolutionMetricName, $quotientPrecision);
+
+ $this->isRevenueEvolution = $this->getName() == 'revenue_evolution';
+ }
+
+ public function compute(Row $row)
+ {
+ $columnName = $this->getWrappedName();
+ $currentValue = $this->getMetric($row, $columnName);
+
+ // if the site this is for doesn't support ecommerce & this is for the revenue_evolution column,
+ // we don't add the new column
+ if (($currentValue === false
+ || !$this->isRevenueEvolution)
+ && !Site::isEcommerceEnabledFor($row->getColumn('label'))
+ ) {
+ $row->deleteColumn($columnName);
+
+ return false;
+ }
+
+ return parent::compute($row);
+ }
+} \ No newline at end of file
diff --git a/plugins/MultiSites/Reports/Base.php b/plugins/MultiSites/Reports/Base.php
index 12aa3f7d30..7b72df674b 100644
--- a/plugins/MultiSites/Reports/Base.php
+++ b/plugins/MultiSites/Reports/Base.php
@@ -17,15 +17,21 @@ abstract class Base extends \Piwik\Plugin\Report
{
$this->category = 'General_MultiSitesSummary';
+ $allMetricsInfo = API::getApiMetrics($enhanced = true);
+
$metadataMetrics = array();
- foreach (API::getApiMetrics($enhanced = true) as $metricName => $metricSettings) {
+ $processedMetricsMetadata = array();
+
+ foreach ($allMetricsInfo as $metricName => $metricSettings) {
$metadataMetrics[$metricName] =
Piwik::translate($metricSettings[API::METRIC_TRANSLATION_KEY]);
- $metadataMetrics[$metricSettings[API::METRIC_EVOLUTION_COL_NAME_KEY]] =
+
+ $processedMetricsMetadata[$metricSettings[API::METRIC_EVOLUTION_COL_NAME_KEY]] =
Piwik::translate($metricSettings[API::METRIC_TRANSLATION_KEY]) . " " . Piwik::translate('MultiSites_Evolution');
}
$this->metrics = array_keys($metadataMetrics);
+ $this->processedMetrics = array_keys($processedMetricsMetadata);
}
}
diff --git a/plugins/MultiSites/Reports/GetAll.php b/plugins/MultiSites/Reports/GetAll.php
index e4bf5c22ca..f867b98714 100644
--- a/plugins/MultiSites/Reports/GetAll.php
+++ b/plugins/MultiSites/Reports/GetAll.php
@@ -19,7 +19,6 @@ class GetAll extends Base
$this->dimension = new Website();
$this->name = Piwik::translate('General_AllWebsitesDashboard');
$this->documentation = ''; // TODO
- $this->processedMetrics = false;
$this->constantRowsCount = false;
$this->order = 4;
}
diff --git a/plugins/MultiSites/Reports/GetOne.php b/plugins/MultiSites/Reports/GetOne.php
index bb57f6f04e..f487b4b9b0 100644
--- a/plugins/MultiSites/Reports/GetOne.php
+++ b/plugins/MultiSites/Reports/GetOne.php
@@ -20,7 +20,6 @@ class GetOne extends Base
$this->name = Piwik::translate('General_SingleWebsitesDashboard');
$this->documentation = ''; // TODO
$this->constantRowsCount = false;
- $this->processedMetrics = false;
$this->order = 5;
}
diff --git a/plugins/MultiSites/angularjs/site/site.directive.html b/plugins/MultiSites/angularjs/site/site.directive.html
index a976edccbc..dbca619b87 100644
--- a/plugins/MultiSites/angularjs/site/site.directive.html
+++ b/plugins/MultiSites/angularjs/site/site.directive.html
@@ -3,7 +3,7 @@
<a title="View reports" ng-href="index.php?module=CoreHome&action=index&date={{ date }}&period={{ period }}&idSite={{ website.idsite }}">{{ website.label }}</a>
<span style="width: 10px; margin-left:3px;">
- <a target="_blank" title="{{ 'General_GoTo'|translate:website.main_url }}" ng-href="{{ website.main_url }}">
+ <a rel="noreferrer" target="_blank" title="{{ 'General_GoTo'|translate:website.main_url }}" ng-href="{{ website.main_url }}">
<img src="plugins/Morpheus/images/link.gif"/></a>
</span>
</td>
@@ -30,7 +30,7 @@
<td ng-if="showSparklines" style="width:180px;">
<div ng-if="!website.isGroup" class="sparkline" style="width: 100px; margin: auto;">
- <a target="_blank" ng-href="index.php?module=CoreHome&action=index&date={{ date }}&period={{ period }}&idSite={{ website.idsite }}"
+ <a rel="noreferrer" target="_blank" ng-href="index.php?module=CoreHome&action=index&date={{ date }}&period={{ period }}&idSite={{ website.idsite }}"
title="{{ 'General_GoTo'|translate:('Dashboard_DashboardOf'|translate:website.label) }}">
<img alt="" ng-src="{{ sparklineImage(website) }}" width="100" height="25" />
</a>
diff --git a/plugins/Overlay/Controller.php b/plugins/Overlay/Controller.php
index 7ddfde1e41..3d11b0dd0f 100644
--- a/plugins/Overlay/Controller.php
+++ b/plugins/Overlay/Controller.php
@@ -13,8 +13,8 @@ use Piwik\API\Request;
use Piwik\Common;
use Piwik\Config;
use Piwik\Metrics;
-use Piwik\MetricsFormatter;
use Piwik\Piwik;
+use Piwik\Plugin\Report;
use Piwik\Plugins\Actions\ArchivingHelper;
use Piwik\Plugins\SitesManager\API as APISitesManager;
use Piwik\ProxyHttp;
@@ -73,9 +73,12 @@ class Controller extends \Piwik\Plugin\Controller
. '&period=' . urlencode($period)
. '&label=' . urlencode($label)
. '&format=original'
+ . '&format_metrics=0'
);
$dataTable = $request->process();
+ $formatter = new Metrics\Formatter\Html();
+
$data = array();
if ($dataTable->getRowsCount() > 0) {
$row = $dataTable->getFirstRow();
@@ -90,9 +93,15 @@ class Controller extends \Piwik\Plugin\Controller
// skip unique visitors for period != day
continue;
}
- if ($metric == 'avg_time_on_page') {
- $value = MetricsFormatter::getPrettyTimeFromSeconds($value);
+
+ if ($metric == 'bounce_rate'
+ || $metric == 'exit_rate'
+ ) {
+ $value = $formatter->getPrettyPercentFromQuotient($value);
+ } else if ($metric == 'avg_time_on_page') {
+ $value = $formatter->getPrettyTimeFromSeconds($value, $displayAsSentence = true);
}
+
$data[] = array(
'name' => $translations[$metric],
'value' => $value
diff --git a/plugins/Overlay/templates/index.twig b/plugins/Overlay/templates/index.twig
index 7984e8302b..7c400b9e57 100644
--- a/plugins/Overlay/templates/index.twig
+++ b/plugins/Overlay/templates/index.twig
@@ -8,7 +8,7 @@
{% block content %}
<div class="overlay-sidebar-container">
- <a id="Overlay_Title" href="http://piwik.org/docs/page-overlay/" target="_blank">
+ <a id="Overlay_Title" href="http://piwik.org/docs/page-overlay/" rel="noreferrer" target="_blank">
{{ 'Overlay_Overlay'|translate }}
<img src="plugins/Morpheus/images/help.png" alt="Documentation"/>
</a>
@@ -37,7 +37,7 @@
</p>
<p>
- <a href="http://piwik.org/docs/page-overlay/#toc-page-overlay-troubleshooting" target="_blank">
+ <a href="http://piwik.org/docs/page-overlay/#toc-page-overlay-troubleshooting" rel="noreferrer" target="_blank">
{{ 'Overlay_ErrorNotLoadingLink'|translate }}
</a>
</p>
diff --git a/plugins/PrivacyManager/Controller.php b/plugins/PrivacyManager/Controller.php
index 1a50d7ac63..d8965147a3 100644
--- a/plugins/PrivacyManager/Controller.php
+++ b/plugins/PrivacyManager/Controller.php
@@ -12,7 +12,7 @@ use Piwik\Common;
use Piwik\Config as PiwikConfig;
use Piwik\Date;
use Piwik\Db;
-use Piwik\MetricsFormatter;
+use Piwik\Metrics\Formatter;
use Piwik\Nonce;
use Piwik\Notification;
use Piwik\Option;
@@ -197,8 +197,9 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$totalBytes += $status['Data_length'] + $status['Index_length'];
}
+ $formatter = new Formatter();
$result = array(
- 'currentSize' => MetricsFormatter::getPrettySizeFromBytes($totalBytes)
+ 'currentSize' => $formatter->getPrettySizeFromBytes($totalBytes)
);
// if the db size estimate feature is enabled, get the estimate
@@ -225,8 +226,8 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
}
}
- $result['sizeAfterPurge'] = MetricsFormatter::getPrettySizeFromBytes($totalAfterPurge);
- $result['spaceSaved'] = MetricsFormatter::getPrettySizeFromBytes($totalBytes - $totalAfterPurge);
+ $result['sizeAfterPurge'] = $formatter->getPrettySizeFromBytes($totalAfterPurge);
+ $result['spaceSaved'] = $formatter->getPrettySizeFromBytes($totalBytes - $totalAfterPurge);
}
return $result;
@@ -288,7 +289,9 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
}
}
- $deleteDataInfos["nextRunPretty"] = MetricsFormatter::getPrettyTimeFromSeconds($deleteDataInfos["nextScheduleTime"] - time());
+ $formatter = new Formatter();
+
+ $deleteDataInfos["nextRunPretty"] = $formatter->getPrettyTimeFromSeconds($deleteDataInfos["nextScheduleTime"] - time());
return $deleteDataInfos;
}
diff --git a/plugins/PrivacyManager/templates/privacySettings.twig b/plugins/PrivacyManager/templates/privacySettings.twig
index 588e0537c3..dc989fbf04 100644
--- a/plugins/PrivacyManager/templates/privacySettings.twig
+++ b/plugins/PrivacyManager/templates/privacySettings.twig
@@ -6,7 +6,7 @@
<h2 piwik-enriched-headline
help-url="http://piwik.org/docs/privacy/">{{ 'PrivacyManager_TeaserHeadline'|translate }}</h2>
<p>{{ 'PrivacyManager_Teaser'|translate('<a href="#anonymizeIPAnchor">',"</a>",'<a href="#deleteLogsAnchor">',"</a>",'<a href="#optOutAnchor">',"</a>")|raw }}
- {{'PrivacyManager_SeeAlsoOurOfficialGuidePrivacy'|translate('<strong><a href="http://piwik.org/privacy/" target="_blank">','</a></strong>')|raw }}</p>
+ {{'PrivacyManager_SeeAlsoOurOfficialGuidePrivacy'|translate('<strong><a href="http://piwik.org/privacy/" rel="noreferrer" target="_blank">','</a></strong>')|raw }}</p>
<h2 id="anonymizeIPAnchor">{{ 'PrivacyManager_UseAnonymizeIp'|translate }}</h2>
<form method="post" action="{{ {'action':'saveSettings', 'form':'formMaskLength', 'token_auth':token_auth} | urlRewriteWithParameters }}" id="formMaskLength">
<div id='anonymizeIpSettings'>
@@ -118,7 +118,7 @@
<span id="privacyManagerDeleteLogDescription" style="margin-top: 10px;display:inline-block;">
{% set deleteLogDescription %}
{{ 'PrivacyManager_DeleteLogDescription2'|translate|raw }}
- <a href="http://piwik.org/faq/general/#faq_125" target="_blank">
+ <a href="http://piwik.org/faq/general/#faq_125" rel="noreferrer" target="_blank">
{{ 'General_ClickHere'|translate }}
</a>
{% endset %}
@@ -307,7 +307,7 @@
{% set iframeOptOut %}<iframe style="border: 0; height: 200px; width: 600px;" src="{{ optOutUrl }}"></iframe>{% endset %}
<code>{{ iframeOptOut|e('html') }}</code>
<br/>
- {{ 'CoreAdminHome_OptOutExplanationBis'|translate("<a href='" ~ optOutUrl ~ "' target='_blank'>","</a>")|raw }}
+ {{ 'CoreAdminHome_OptOutExplanationBis'|translate("<a href='" ~ optOutUrl ~ "' rel='noreferrer' target='_blank'>","</a>")|raw }}
</p>
<div style="height:100px;"></div>
diff --git a/plugins/Provider/Reports/GetProvider.php b/plugins/Provider/Reports/GetProvider.php
index 739124088c..e7cfcfa753 100644
--- a/plugins/Provider/Reports/GetProvider.php
+++ b/plugins/Provider/Reports/GetProvider.php
@@ -35,7 +35,7 @@ class GetProvider extends Report
if (! Common::getRequestVar('disableLink', 0, 'int')) {
$message .= ' ' . Piwik::translate(
'General_SeeThisFaq',
- array('<a href="http://piwik.org/faq/general/faq_52/" target="_blank">', '</a>')
+ array('<a href="http://piwik.org/faq/general/faq_52/" rel="noreferrer" target="_blank">', '</a>')
);
}
$view->config->show_footer_message = $message;
diff --git a/plugins/Referrers/API.php b/plugins/Referrers/API.php
index 01854ac9f1..5172729e86 100644
--- a/plugins/Referrers/API.php
+++ b/plugins/Referrers/API.php
@@ -21,11 +21,11 @@ use Piwik\Piwik;
/**
* The Referrers API lets you access reports about Websites, Search engines, Keywords, Campaigns used to access your website.
*
- * For example, "getKeywords" returns all search engine keywords (with <a href='http://piwik.org/docs/analytics-api/reference/#toc-metric-definitions' target='_blank'>general analytics metrics</a> for each keyword), "getWebsites" returns referrer websites (along with the full Referrer URL if the parameter &expanded=1 is set).
+ * For example, "getKeywords" returns all search engine keywords (with <a href='http://piwik.org/docs/analytics-api/reference/#toc-metric-definitions' rel='noreferrer' target='_blank'>general analytics metrics</a> for each keyword), "getWebsites" returns referrer websites (along with the full Referrer URL if the parameter &expanded=1 is set).
* "getReferrerType" returns the Referrer overview report. "getCampaigns" returns the list of all campaigns (and all campaign keywords if the parameter &expanded=1 is set).
*
* The methods "getKeywordsForPageUrl" and "getKeywordsForPageTitle" are used to output the top keywords used to find a page.
- * Check out the widget <a href='http://demo.piwik.org/index.php?module=Widgetize&action=iframe&moduleToWidgetize=Referrers&actionToWidgetize=getKeywordsForPage&idSite=7&period=day&date=2011-02-15&disableLink=1' target='_blank'>"Top keywords used to find this page"</a> that you can easily re-use on your website.
+ * Check out the widget <a href='http://demo.piwik.org/index.php?module=Widgetize&action=iframe&moduleToWidgetize=Referrers&actionToWidgetize=getKeywordsForPage&idSite=7&period=day&date=2011-02-15&disableLink=1' rel='noreferrer' target='_blank'>"Top keywords used to find this page"</a> that you can easily re-use on your website.
* @method static \Piwik\Plugins\Referrers\API getInstance()
*/
class API extends \Piwik\Plugin\API
diff --git a/plugins/Referrers/Controller.php b/plugins/Referrers/Controller.php
index f01c61f647..71960c379b 100644
--- a/plugins/Referrers/Controller.php
+++ b/plugins/Referrers/Controller.php
@@ -354,8 +354,8 @@ function DisplayTopKeywords($url = "")
echo "<p>This widget is designed to work in your website directly.
This widget makes it easy to use Piwik to <i>automatically display the list of Top Keywords</i>, for each of your website Page URLs.</p>
<p>
- <b>Example API URL</b> - For example if you would like to get the top 10 keywords, used last week, to land on the page <a target='_blank' href='$topPageUrl'>$topPageUrl</a>,
- in format JSON: you would dynamically fetch the data using <a target='_blank' href='$jsonRequest&url=" . urlencode($topPageUrl) . "'>this API request URL</a>. Make sure you encode the 'url' parameter in the URL.</p>
+ <b>Example API URL</b> - For example if you would like to get the top 10 keywords, used last week, to land on the page <a rel='noreferrer' target='_blank' href='$topPageUrl'>$topPageUrl</a>,
+ in format JSON: you would dynamically fetch the data using <a rel='noreferrer' target='_blank' href='$jsonRequest&url=" . urlencode($topPageUrl) . "'>this API request URL</a>. Make sure you encode the 'url' parameter in the URL.</p>
<p><b>PHP Function ready to use!</b> - If you use PHP on your website, we have prepared a small code snippet that you can copy paste in your Website PHP files. You can then simply call the function <code>DisplayTopKeywords();</code> anywhere in your template, at the bottom of the content or in your blog sidebar.
If you run this code in your page $topPageUrl, it would output the following:";
diff --git a/plugins/Referrers/Reports/GetCampaigns.php b/plugins/Referrers/Reports/GetCampaigns.php
index fbc0835a3b..a09affa70c 100644
--- a/plugins/Referrers/Reports/GetCampaigns.php
+++ b/plugins/Referrers/Reports/GetCampaigns.php
@@ -20,7 +20,7 @@ class GetCampaigns extends Base
$this->dimension = new Campaign();
$this->name = Piwik::translate('Referrers_Campaigns');
$this->documentation = Piwik::translate('Referrers_CampaignsReportDocumentation',
- array('<br />', '<a href="http://piwik.org/docs/tracking-campaigns/" target="_blank">', '</a>'));
+ array('<br />', '<a href="http://piwik.org/docs/tracking-campaigns/" rel="noreferrer" target="_blank">', '</a>'));
$this->actionToLoadSubTables = 'getKeywordsFromCampaignId';
$this->hasGoalMetrics = true;
$this->order = 9;
diff --git a/plugins/Referrers/Reports/GetKeywordsFromCampaignId.php b/plugins/Referrers/Reports/GetKeywordsFromCampaignId.php
index 6230faec9f..0a12e87fde 100644
--- a/plugins/Referrers/Reports/GetKeywordsFromCampaignId.php
+++ b/plugins/Referrers/Reports/GetKeywordsFromCampaignId.php
@@ -20,7 +20,7 @@ class GetKeywordsFromCampaignId extends Base
$this->dimension = new Keyword();
$this->name = Piwik::translate('Referrers_Campaigns');
$this->documentation = Piwik::translate('Referrers_CampaignsReportDocumentation',
- array('<br />', '<a href="http://piwik.org/docs/tracking-campaigns/" target="_blank">', '</a>'));
+ array('<br />', '<a href="http://piwik.org/docs/tracking-campaigns/" rel="noreferrer" target="_blank">', '</a>'));
$this->isSubtableReport = true;
$this->order = 10;
}
diff --git a/plugins/SEO/RankChecker.php b/plugins/SEO/RankChecker.php
index 88010814a1..fa254070df 100644
--- a/plugins/SEO/RankChecker.php
+++ b/plugins/SEO/RankChecker.php
@@ -11,7 +11,7 @@ namespace Piwik\Plugins\SEO;
use Exception;
use Piwik\Http;
use Piwik\Log;
-use Piwik\MetricsFormatter;
+use Piwik\Metrics\Formatter;
/**
* The functions below are derived/adapted from GetRank.org's
@@ -25,10 +25,12 @@ class RankChecker
{
private $url;
private $majesticInfo = null;
+ private $formatter = null;
public function __construct($url)
{
$this->url = self::extractDomainFromUrl($url);
+ $this->formatter = new Formatter();
}
/**
@@ -171,7 +173,7 @@ class RankChecker
}
if ($maxAge) {
- return MetricsFormatter::getPrettyTimeFromSeconds(time() - $maxAge);
+ return $this->formatter->getPrettyTimeFromSeconds(time() - $maxAge);
}
return false;
}
diff --git a/plugins/SEO/templates/getRank.twig b/plugins/SEO/templates/getRank.twig
index 08839997b3..491e36ea57 100644
--- a/plugins/SEO/templates/getRank.twig
+++ b/plugins/SEO/templates/getRank.twig
@@ -18,14 +18,14 @@
{{ 'General_Error'|translate }}
{% else %}
{% set cleanUrl %}
- <a href="http://{{ urlToRank }}" target="_blank">{{ urlToRank }}</a>
+ <a href="http://{{ urlToRank }}" rel="noreferrer" target="_blank">{{ urlToRank }}</a>
{% endset %}
{{ 'SEO_SEORankingsFor'|translate(cleanUrl)|raw }}
<table cellspacing="2" style="margin:auto;line-height:1.5em;padding-top:10px;">
{% for rank in ranks %}
<tr>
{% set seoLink %}{% if rank.logo_link is defined %}<a class="linkContent" href="?module=Proxy&action=redirect&url={{ rank.logo_link|url_encode }}"
- target="_blank"
+ rel="noreferrer" target="_blank"
{% if rank.logo_tooltip is not empty %}title="{{ rank.logo_tooltip }}"{% endif %}>{% endif %}{% endset %}
{% set majesticLink %}{{ seoLink }}Majestic</a>{% endset %}
<td>{% if rank.logo_link is defined %}{{ seoLink|raw }}{% endif %}<img
diff --git a/plugins/ScheduledReports/API.php b/plugins/ScheduledReports/API.php
index 3798c166da..54cbf41125 100644
--- a/plugins/ScheduledReports/API.php
+++ b/plugins/ScheduledReports/API.php
@@ -31,7 +31,7 @@ use Piwik\Translate;
*
* You can also get the list of all existing reports via "getReports", create new reports via "addReport",
* or manage existing reports with "updateReport" and "deleteReport".
- * See also the documentation about <a href='http://piwik.org/docs/email-reports/' target='_blank'>Scheduled Email reports</a> in Piwik.
+ * See also the documentation about <a href='http://piwik.org/docs/email-reports/' rel='noreferrer' target='_blank'>Scheduled Email reports</a> in Piwik.
*
* @method static \Piwik\Plugins\ScheduledReports\API getInstance()
*/
diff --git a/plugins/ScheduledReports/templates/_addReport.twig b/plugins/ScheduledReports/templates/_addReport.twig
index c059692ecb..3fbc21b98b 100644
--- a/plugins/ScheduledReports/templates/_addReport.twig
+++ b/plugins/ScheduledReports/templates/_addReport.twig
@@ -41,7 +41,7 @@
<div class="entityInlineHelp">
{% set SegmentEditor_DefaultAllVisits %}{{ 'SegmentEditor_DefaultAllVisits'|translate }}{% endset %}
{% set SegmentEditor_AddNewSegment %}{{ 'SegmentEditor_AddNewSegment'|translate }}{% endset %}
- {{ 'ScheduledReports_Segment_Help'|translate('<a href="./" target="_blank">','</a>',SegmentEditor_DefaultAllVisits,SegmentEditor_AddNewSegment)|raw }}
+ {{ 'ScheduledReports_Segment_Help'|translate('<a href="./" rel="noreferrer" target="_blank">','</a>',SegmentEditor_DefaultAllVisits,SegmentEditor_AddNewSegment)|raw }}
</div>
</td>
</tr>
diff --git a/plugins/ScheduledReports/templates/_listReports.twig b/plugins/ScheduledReports/templates/_listReports.twig
index 5497dfc98e..b9359f21a0 100644
--- a/plugins/ScheduledReports/templates/_listReports.twig
+++ b/plugins/ScheduledReports/templates/_listReports.twig
@@ -75,7 +75,7 @@
'outputType':downloadOutputType, 'language':language,
'format': (report.format in ['html', 'csv']) ? report.format : false
}) }}"
- target="_blank" name="linkDownloadReport" id="{{ report.idreport }}" class="link_but">
+ rel="noreferrer" target="_blank" name="linkDownloadReport" id="{{ report.idreport }}" class="link_but">
<img src='{{ reportFormatsByReportType[report.type][report.format] }}' border="0"/>
{{ 'General_Download'|translate }}
</a>
diff --git a/plugins/SecurityInfo b/plugins/SecurityInfo
-Subproject c76e640f2404371566a65a640c41af85075e336
+Subproject 36fa09c37715435b96731dceae7ebab05a7d6a0
diff --git a/plugins/SegmentEditor/templates/_segmentSelector.twig b/plugins/SegmentEditor/templates/_segmentSelector.twig
index 1d1b2275d8..a3a8ee90ae 100644
--- a/plugins/SegmentEditor/templates/_segmentSelector.twig
+++ b/plugins/SegmentEditor/templates/_segmentSelector.twig
@@ -139,7 +139,7 @@
</div>
<div class="segment-footer">
<div piwik-rate-feature title="Segment Editor" style="display:inline-block;float: left;margin-top: 2px;margin-right: 10px;"></div>
- <span class="segmentFooterNote">The Segment Editor was <a class='crowdfundingLink' href='http://crowdfunding.piwik.org/custom-segments-editor/' target='_blank'>crowdfunded</a> with the awesome support of 80 companies and Piwik users worldwide!</span>
+ <span class="segmentFooterNote">The Segment Editor was <a class='crowdfundingLink' href='http://crowdfunding.piwik.org/custom-segments-editor/' rel='noreferrer' target='_blank'>crowdfunded</a> with the awesome support of 80 companies and Piwik users worldwide!</span>
<a class="delete" href="#">{{ 'General_Delete'|translate }}</a>
<a class="close" href="#">{{ 'General_Close'|translate }}</a>
<button class="saveAndApply">{{ 'SegmentEditor_SaveAndApply'|translate }}</button>
diff --git a/plugins/SitesManager/API.php b/plugins/SitesManager/API.php
index 24bb750f12..1e7ffb2867 100644
--- a/plugins/SitesManager/API.php
+++ b/plugins/SitesManager/API.php
@@ -13,8 +13,7 @@ use Piwik\Access;
use Piwik\Common;
use Piwik\Date;
use Piwik\Db;
-use Piwik\IP;
-use Piwik\MetricsFormatter;
+use Piwik\Metrics\Formatter;
use Piwik\Network\IPUtils;
use Piwik\Option;
use Piwik\Piwik;
@@ -41,7 +40,7 @@ use Piwik\UrlHelper;
* Some methods will affect all websites globally: "setGlobalExcludedIps" will set the list of IPs to be excluded on all websites,
* "setGlobalExcludedQueryParameters" will set the list of URL parameters to remove from URLs for all websites.
* The existing values can be fetched via "getExcludedIpsGlobal" and "getExcludedQueryParametersGlobal".
- * See also the documentation about <a href='http://piwik.org/docs/manage-websites/' target='_blank'>Managing Websites</a> in Piwik.
+ * See also the documentation about <a href='http://piwik.org/docs/manage-websites/' rel='noreferrer' target='_blank'>Managing Websites</a> in Piwik.
* @method static \Piwik\Plugins\SitesManager\API getInstance()
*/
class API extends \Piwik\Plugin\API
@@ -1157,7 +1156,7 @@ class API extends \Piwik\Plugin\API
*/
public function getCurrencyList()
{
- $currencies = MetricsFormatter::getCurrencyList();
+ $currencies = Formatter::getCurrencyList();
return array_map(function ($a) {
return $a[1] . " (" . $a[0] . ")";
}, $currencies);
@@ -1170,7 +1169,7 @@ class API extends \Piwik\Plugin\API
*/
public function getCurrencySymbols()
{
- $currencies = MetricsFormatter::getCurrencyList();
+ $currencies = Formatter::getCurrencyList();
return array_map(function ($a) {
return $a[0];
}, $currencies);
diff --git a/plugins/SitesManager/templates/_displayJavascriptCode.twig b/plugins/SitesManager/templates/_displayJavascriptCode.twig
index 9684358aee..d82826b3be 100644
--- a/plugins/SitesManager/templates/_displayJavascriptCode.twig
+++ b/plugins/SitesManager/templates/_displayJavascriptCode.twig
@@ -3,7 +3,7 @@
<div class='trackingHelp'>
<p>{{ 'Installation_JSTracking_Intro'|translate }}</p>
- <p>{{ 'CoreAdminHome_JSTrackingIntro3'|translate('<a href="http://piwik.org/integrate/" target="_blank">','</a>')|raw }}</p>
+ <p>{{ 'CoreAdminHome_JSTrackingIntro3'|translate('<a href="http://piwik.org/integrate/" rel="noreferrer" target="_blank">','</a>')|raw }}</p>
<h3>{{ 'General_JsTrackingTag'|translate }}</h3>
@@ -12,7 +12,7 @@
<pre class="code-pre"><code>{{ jsTag|raw }}</code></pre>
<br/>
- <p>{{ 'CoreAdminHome_JSTrackingIntro5'|translate('<a target="_blank" href="http://piwik.org/docs/javascript-tracking/">','</a>')|raw }}</p>
+ <p>{{ 'CoreAdminHome_JSTrackingIntro5'|translate('<a rel="noreferrer" target="_blank" href="http://piwik.org/docs/javascript-tracking/">','</a>')|raw }}</p>
<p>{{ 'Installation_JSTracking_EndNote'|translate('<em>','</em>')|raw }}</p>
</div> \ No newline at end of file
diff --git a/plugins/UserCountry/LocationProvider/Default.php b/plugins/UserCountry/LocationProvider/Default.php
index 1681efb4f7..ab93545dd9 100755
--- a/plugins/UserCountry/LocationProvider/Default.php
+++ b/plugins/UserCountry/LocationProvider/Default.php
@@ -104,7 +104,7 @@ class DefaultProvider extends LocationProvider
$desc = Piwik::translate('UserCountry_DefaultLocationProviderDesc1') . ' '
. Piwik::translate('UserCountry_DefaultLocationProviderDesc2',
array('<strong>', '<em>', '</em>', '</strong>'))
- . '<p><em><a href="http://piwik.org/faq/how-to/#faq_163" target="_blank">'
+ . '<p><em><a href="http://piwik.org/faq/how-to/#faq_163" rel="noreferrer" target="_blank">'
. Piwik::translate('UserCountry_HowToInstallGeoIPDatabases')
. '</em></a></p>';
return array('id' => self::ID, 'title' => self::TITLE, 'description' => $desc, 'order' => 1);
diff --git a/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php b/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php
index 3326248ecc..f5f28c9719 100755
--- a/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php
+++ b/plugins/UserCountry/LocationProvider/GeoIp/Pecl.php
@@ -218,7 +218,7 @@ class Pecl extends GeoIp
$desc = Piwik::translate('UserCountry_GeoIpLocationProviderDesc_Pecl1') . '<br/><br/>'
. Piwik::translate('UserCountry_GeoIpLocationProviderDesc_Pecl2');
$installDocs = '<em>'
- . '<a target="_blank" href="http://piwik.org/faq/how-to/#faq_164">'
+ . '<a rel="noreferrer" target="_blank" href="http://piwik.org/faq/how-to/#faq_164">'
. Piwik::translate('UserCountry_HowToInstallGeoIpPecl')
. '</a>'
. '</em>';
diff --git a/plugins/UserCountry/LocationProvider/GeoIp/Php.php b/plugins/UserCountry/LocationProvider/GeoIp/Php.php
index 2a3fda9dee..abaa88139d 100755
--- a/plugins/UserCountry/LocationProvider/GeoIp/Php.php
+++ b/plugins/UserCountry/LocationProvider/GeoIp/Php.php
@@ -297,7 +297,7 @@ class Php extends GeoIp
$desc = Piwik::translate('UserCountry_GeoIpLocationProviderDesc_Php1') . '<br/><br/>'
. Piwik::translate('UserCountry_GeoIpLocationProviderDesc_Php2',
array('<strong><em>', '</em></strong>', '<strong><em>', '</em></strong>'));
- $installDocs = '<em><a target="_blank" href="http://piwik.org/faq/how-to/#faq_163">'
+ $installDocs = '<em><a rel="noreferrer" target="_blank" href="http://piwik.org/faq/how-to/#faq_163">'
. Piwik::translate('UserCountry_HowToInstallGeoIPDatabases')
. '</em></a>';
diff --git a/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php b/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php
index b7df996637..90a73b8c79 100755
--- a/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php
+++ b/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php
@@ -223,10 +223,10 @@ class ServerBased extends GeoIp
. Piwik::translate('UserCountry_GeoIpLocationProviderDesc_ServerBased2',
array('<strong><em>', '</em></strong>', '<strong><em>', '</em></strong>'));
$installDocs =
- '<em><a target="_blank" href="http://piwik.org/faq/how-to/#faq_165">'
+ '<em><a rel="noreferrer" target="_blank" href="http://piwik.org/faq/how-to/#faq_165">'
. Piwik::translate('UserCountry_HowToInstallApacheModule')
. '</a></em><br/><em>'
- . '<a target="_blank" href="http://piwik.org/faq/how-to/#faq_166">'
+ . '<a rel="noreferrer" target="_blank" href="http://piwik.org/faq/how-to/#faq_166">'
. Piwik::translate('UserCountry_HowToInstallNginxModule')
. '</a></em>';
diff --git a/plugins/UserCountry/Reports/Base.php b/plugins/UserCountry/Reports/Base.php
index 9e62b0a6b6..f7a4f34203 100644
--- a/plugins/UserCountry/Reports/Base.php
+++ b/plugins/UserCountry/Reports/Base.php
@@ -23,9 +23,9 @@ abstract class Base extends \Piwik\Plugin\Report
protected function getGeoIPReportDocSuffix()
{
return Piwik::translate('UserCountry_GeoIPDocumentationSuffix',
- array('<a target="_blank" href="http://www.maxmind.com/?rId=piwik">',
+ array('<a rel="noreferrer" target="_blank" href="http://www.maxmind.com/?rId=piwik">',
'</a>',
- '<a target="_blank" href="http://www.maxmind.com/en/city_accuracy?rId=piwik">',
+ '<a rel="noreferrer" target="_blank" href="http://www.maxmind.com/en/city_accuracy?rId=piwik">',
'</a>')
);
}
@@ -50,11 +50,11 @@ abstract class Base extends \Piwik\Plugin\Report
$footerMessage .= ' ' . Piwik::translate('UserCountry_NoDataForGeoIPReport2',
array('<a target="_blank" href="' . Url::getCurrentQueryStringWithParametersModified($params) . '">',
'</a>',
- '<a target="_blank" href="http://dev.maxmind.com/geoip/geolite?rId=piwik">',
+ '<a rel="noreferrer" target="_blank" href="http://dev.maxmind.com/geoip/geolite?rId=piwik">',
'</a>'));
} else {
$footerMessage .= ' ' . Piwik::translate('UserCountry_ToGeolocateOldVisits',
- array('<a target="_blank" href="http://piwik.org/faq/how-to/#faq_167">', '</a>'));
+ array('<a rel="noreferrer" target="_blank" href="http://piwik.org/faq/how-to/#faq_167">', '</a>'));
}
$view->config->show_footer_message = $footerMessage;
diff --git a/plugins/UserCountry/Reports/GetCountry.php b/plugins/UserCountry/Reports/GetCountry.php
index 17d8e8a83c..88363e1efa 100644
--- a/plugins/UserCountry/Reports/GetCountry.php
+++ b/plugins/UserCountry/Reports/GetCountry.php
@@ -40,7 +40,7 @@ class GetCountry extends Base
// if we're using the default location provider, add a note explaining how it works
$footerMessage = Piwik::translate("General_Note") . ': '
. Piwik::translate('UserCountry_DefaultLocationProviderExplanation',
- array('<a target="_blank" href="http://piwik.org/docs/geo-locate/">', '</a>'));
+ array('<a rel="noreferrer" target="_blank" href="http://piwik.org/docs/geo-locate/">', '</a>'));
$view->config->show_footer_message = $footerMessage;
}
diff --git a/plugins/UserCountry/templates/adminIndex.twig b/plugins/UserCountry/templates/adminIndex.twig
index 65d83cba31..587abe25bd 100755
--- a/plugins/UserCountry/templates/adminIndex.twig
+++ b/plugins/UserCountry/templates/adminIndex.twig
@@ -15,7 +15,7 @@
<h3 style="margin-top:0;">{{ 'UserCountry_HowToSetupGeoIP'|translate }}</h3>
<p>{{ 'UserCountry_HowToSetupGeoIPIntro'|translate }}</p>
<ul style="list-style:disc;margin-left:2em;">
- <li>{{ 'UserCountry_HowToSetupGeoIP_Step1'|translate('<a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz">','</a>','<a target="_blank" href="http://www.maxmind.com/?rId=piwik">','</a>')|raw }}</li>
+ <li>{{ 'UserCountry_HowToSetupGeoIP_Step1'|translate('<a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz">','</a>','<a rel="noreferrer" target="_blank" href="http://www.maxmind.com/?rId=piwik">','</a>')|raw }}</li>
<li>{{ 'UserCountry_HowToSetupGeoIP_Step2'|translate("'GeoLiteCity.dat'",'<strong>','</strong>')|raw }}</li>
<li>{{ 'UserCountry_HowToSetupGeoIP_Step3'|translate('<strong>','</strong>','<span style="color:green"><strong>','</strong></span>')|raw }}</li>
<li>{{ 'UserCountry_HowToSetupGeoIP_Step4'|translate }}</li>
diff --git a/plugins/UserSettings/API.php b/plugins/UserSettings/API.php
index 0754ccd45c..28d224cbdf 100644
--- a/plugins/UserSettings/API.php
+++ b/plugins/UserSettings/API.php
@@ -13,6 +13,7 @@ use Piwik\DataTable;
use Piwik\Metrics;
use Piwik\Piwik;
use Piwik\Plugins\DevicesDetection\Archiver AS DDArchiver;
+use Piwik\Plugins\CoreHome\Columns\Metrics\VisitsPercent;
/**
* @see plugins/UserSettings/functions.php
@@ -142,48 +143,27 @@ class API extends \Piwik\Plugin\API
// walk through the results and calculate the percentage
foreach ($dataTableMap as $key => $table) {
- // get according browserType table
- foreach ($browserTypesArray as $k => $browsers) {
- if ($k == $key) {
- $browserType = $browsers;
- }
- }
-
- // get according visitsSum
- foreach ($visitSumsArray as $k => $visits) {
- if ($k == $key) {
- if (is_object($visits)) {
- if ($visits->getRowsCount() == 0) {
- $visitsSumTotal = 0;
- } else {
- $visitsSumTotal = (float)$visits->getFirstRow()->getColumn('nb_visits');
- }
- } else {
- $visitsSumTotal = (float)$visits;
- }
- }
- }
-
// Calculate percentage, but ignore IE users because plugin detection doesn't work on IE
$ieVisits = 0;
- $ieStats = $browserType->getRowFromLabel('Trident');
+ $ieStats = $browserTypesArray[$key]->getRowFromLabel('Trident');
if ($ieStats !== false) {
$ieVisits = $ieStats->getColumn(Metrics::INDEX_NB_VISITS);
}
- $visitsSum = $visitsSumTotal - $ieVisits;
+ // get according visitsSum
+ $visits = $visitSumsArray[$key];
+ if ($visits->getRowsCount() == 0) {
+ $visitsSumTotal = 0;
+ } else {
+ $visitsSumTotal = (float) $visits->getFirstRow()->getColumn('nb_visits');
+ }
- // When Truncate filter is applied, it will call AddSummaryRow which tries to sum all rows.
- // We tell the object to skip the column nb_visits_percentage when aggregating (since it's not correct to sum % values)
- $columnAggregationOps = $table->getMetadata(DataTable::COLUMN_AGGREGATION_OPS_METADATA_NAME);
- $columnAggregationOps['nb_visits_percentage'] = 'skip';
- $table->setMetadata(DataTable::COLUMN_AGGREGATION_OPS_METADATA_NAME, $columnAggregationOps);
+ $visitsSum = $visitsSumTotal - $ieVisits;
- // The filter must be applied now so that the new column can
- // be sorted by the generic filters (applied right after this loop exits)
- $table->filter('ColumnCallbackAddColumnPercentage', array('nb_visits_percentage', Metrics::INDEX_NB_VISITS, $visitsSum, 1));
- $table->filter('RangeCheck', array('nb_visits_percentage', '0.00%', '100.00%'));
+ $extraProcessedMetrics = $table->getMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME);
+ $extraProcessedMetrics[] = new VisitsPercent($visitsSum);
+ $table->setMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME, $extraProcessedMetrics);
}
$dataTable->queueFilter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getPluginsLogo'));
diff --git a/plugins/UserSettings/Reports/GetPlugin.php b/plugins/UserSettings/Reports/GetPlugin.php
index 9b3890f1b3..e9512c4256 100644
--- a/plugins/UserSettings/Reports/GetPlugin.php
+++ b/plugins/UserSettings/Reports/GetPlugin.php
@@ -20,9 +20,9 @@ class GetPlugin extends Base
$this->dimension = new Plugin();
$this->name = Piwik::translate('UserSettings_WidgetPlugins');
$this->documentation = Piwik::translate('UserSettings_WidgetPluginsDocumentation', '<br />');
- $this->metrics = array('nb_visits', 'nb_visits_percentage');
+ $this->metrics = array('nb_visits');
$this->constantRowsCount = true;
- $this->processedMetrics = array();
+ $this->processedMetrics = array('nb_visits_percentage');
$this->order = 4;
$this->widgetTitle = 'UserSettings_WidgetPlugins';
}
diff --git a/plugins/UsersManager/API.php b/plugins/UsersManager/API.php
index 751e61dbbc..1e651eef13 100644
--- a/plugins/UsersManager/API.php
+++ b/plugins/UsersManager/API.php
@@ -28,7 +28,7 @@ use Piwik\Tracker\Cache;
* Existing Permissions are listed given a login via "getSitesAccessFromUser", or a website ID via "getUsersAccessFromSite",
* or you can list all users and websites for a given permission via "getUsersSitesFromAccess". Permissions are set and updated
* via the method "setUserAccess".
- * See also the documentation about <a href='http://piwik.org/docs/manage-users/' target='_blank'>Managing Users</a> in Piwik.
+ * See also the documentation about <a href='http://piwik.org/docs/manage-users/' rel='noreferrer' target='_blank'>Managing Users</a> in Piwik.
*/
class API extends \Piwik\Plugin\API
{
diff --git a/plugins/UsersManager/Controller.php b/plugins/UsersManager/Controller.php
index a0b184ceb9..65f55b9a01 100644
--- a/plugins/UsersManager/Controller.php
+++ b/plugins/UsersManager/Controller.php
@@ -11,7 +11,7 @@ namespace Piwik\Plugins\UsersManager;
use Exception;
use Piwik\API\ResponseBuilder;
use Piwik\Common;
-use Piwik\MetricsFormatter;
+use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use Piwik\Plugins\LanguagesManager\API as APILanguagesManager;
use Piwik\Plugins\LanguagesManager\LanguagesManager;
@@ -83,6 +83,8 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$superUsers = array();
$usersAliasByLogin = array();
+ $formatter = new Formatter();
+
if (Piwik::isUserHasSomeAdminAccess()) {
$view->showLastSeen = true;
@@ -92,7 +94,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$lastSeen = LastSeenTimeLogger::getLastSeenTimeForUser($user['login']);
$users[$index]['last_seen'] = $lastSeen == 0
- ? false : MetricsFormatter::getPrettyTimeFromSeconds(time() - $lastSeen);
+ ? false : $formatter->getPrettyTimeFromSeconds(time() - $lastSeen);
}
if (Piwik::hasUserSuperUserAccess()) {
diff --git a/plugins/UsersManager/Model.php b/plugins/UsersManager/Model.php
index 3d69f0ab14..f6b453e4e9 100644
--- a/plugins/UsersManager/Model.php
+++ b/plugins/UsersManager/Model.php
@@ -22,7 +22,7 @@ use Piwik\Piwik;
* Existing Permissions are listed given a login via "getSitesAccessFromUser", or a website ID via "getUsersAccessFromSite",
* or you can list all users and websites for a given permission via "getUsersSitesFromAccess". Permissions are set and updated
* via the method "setUserAccess".
- * See also the documentation about <a href='http://piwik.org/docs/manage-users/' target='_blank'>Managing Users</a> in Piwik.
+ * See also the documentation about <a href='http://piwik.org/docs/manage-users/' rel='noreferrer' target='_blank'>Managing Users</a> in Piwik.
*/
class Model
{
diff --git a/plugins/VisitFrequency/API.php b/plugins/VisitFrequency/API.php
index 60a12c273b..97a98f27f8 100644
--- a/plugins/VisitFrequency/API.php
+++ b/plugins/VisitFrequency/API.php
@@ -45,8 +45,10 @@ class API extends \Piwik\Plugin\API
'segment' => $segment,
'columns' => implode(',', $columns),
'format' => 'original',
- 'serialize' => 0 // tests set this to 1
+ 'serialize' => 0, // tests set this to 1
+ 'format_metrics' => 0
);
+
$table = Request::processRequest('VisitsSummary.get', $params);
$this->prefixColumns($table, $period);
return $table;
diff --git a/plugins/VisitFrequency/Columns/Metrics/ReturningMetric.php b/plugins/VisitFrequency/Columns/Metrics/ReturningMetric.php
new file mode 100644
index 0000000000..3477667275
--- /dev/null
+++ b/plugins/VisitFrequency/Columns/Metrics/ReturningMetric.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\VisitFrequency\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugin\ProcessedMetric;
+
+/**
+ * Processed metric for VisitFrequency.get API method which just copies VisitsSummary.get
+ * metrics as differently named metrics.
+ *
+ * This metric must be supplied in order to ensure correct formatting for processed
+ * metrics that are copied from VisitsSummary.get.
+ */
+class ReturningMetric extends ProcessedMetric
+{
+ private static $translations = array(
+ 'avg_time_on_site_returning' => 'VisitFrequency_ColumnAverageVisitDurationForReturningVisitors',
+ 'nb_actions_per_visit_returning' => 'VisitFrequency_ColumnAvgActionsPerReturningVisit',
+ 'bounce_rate_returning' => 'VisitFrequency_ColumnBounceRateForReturningVisits',
+ );
+
+ /**
+ * @var ProcessedMetric
+ */
+ private $wrapped;
+
+ public function __construct(ProcessedMetric $wrapped)
+ {
+ $this->wrapped = $wrapped;
+ }
+
+ public function getName()
+ {
+ return $this->wrapped->getName() . '_returning';
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate(self::$translations[$this->getName()]);
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $this->wrapped->format($value, $formatter);
+ }
+
+ public function compute(Row $row)
+ {
+ return 0; // (metric is not computed, it is copied from segmented report)
+ }
+
+ public function getDependentMetrics()
+ {
+ return array();
+ }
+} \ No newline at end of file
diff --git a/plugins/VisitFrequency/Controller.php b/plugins/VisitFrequency/Controller.php
index 03541de78c..ee1d3620a9 100644
--- a/plugins/VisitFrequency/Controller.php
+++ b/plugins/VisitFrequency/Controller.php
@@ -98,8 +98,7 @@ class Controller extends \Piwik\Plugin\Controller
$view->nbActionsReturning = $dataRow->getColumn('nb_actions_returning');
$view->nbActionsPerVisitReturning = $dataRow->getColumn('nb_actions_per_visit_returning');
$view->avgVisitDurationReturning = $dataRow->getColumn('avg_time_on_site_returning');
- $nbBouncedReturningVisits = $dataRow->getColumn('bounce_count_returning');
- $view->bounceRateReturning = Piwik::getPercentageSafe($nbBouncedReturningVisits, $nbVisitsReturning);
+ $view->bounceRateReturning = $dataRow->getColumn('bounce_rate_returning');
}
protected function getSummary()
diff --git a/plugins/VisitFrequency/Reports/Get.php b/plugins/VisitFrequency/Reports/Get.php
index 5db2ebebf6..eb4c7ddfbe 100644
--- a/plugins/VisitFrequency/Reports/Get.php
+++ b/plugins/VisitFrequency/Reports/Get.php
@@ -9,6 +9,10 @@
namespace Piwik\Plugins\VisitFrequency\Reports;
use Piwik\Piwik;
+use Piwik\Plugins\CoreHome\Columns\Metrics\ActionsPerVisit;
+use Piwik\Plugins\CoreHome\Columns\Metrics\AverageTimeOnSite;
+use Piwik\Plugins\CoreHome\Columns\Metrics\BounceRate;
+use Piwik\Plugins\VisitFrequency\Columns\Metrics\ReturningMetric;
class Get extends \Piwik\Plugin\Report
{
@@ -18,20 +22,18 @@ class Get extends \Piwik\Plugin\Report
$this->category = 'General_Visitors';
$this->name = Piwik::translate('VisitFrequency_ColumnReturningVisits');
$this->documentation = ''; // TODO
+ $this->processedMetrics = array(
+ new ReturningMetric(new AverageTimeOnSite()),
+ new ReturningMetric(new ActionsPerVisit()),
+ new ReturningMetric(new BounceRate())
+ );
$this->metrics = array(
'nb_visits_returning',
'nb_actions_returning',
- 'avg_time_on_site_returning',
- 'bounce_rate_returning',
- 'nb_actions_per_visit_returning',
'nb_uniq_visitors_returning',
- 'sum_visit_length_returning',
'nb_users_returning',
- 'nb_visits_converted_returning',
- 'sum_visit_length_returning',
'max_actions_returning'
);
- $this->processedMetrics = false;
$this->order = 40;
}
}
diff --git a/plugins/VisitFrequency/templates/_sparklines.twig b/plugins/VisitFrequency/templates/_sparklines.twig
index 5acca4b3dc..2c2c0f81a2 100644
--- a/plugins/VisitFrequency/templates/_sparklines.twig
+++ b/plugins/VisitFrequency/templates/_sparklines.twig
@@ -17,6 +17,6 @@
</div>
<div class="sparkline">
{{ sparkline(urlSparklineBounceRateReturning) }}
- {{ 'VisitFrequency_ReturnBounceRate'|translate("<strong>"~bounceRateReturning~"%</strong>")|raw }}
+ {{ 'VisitFrequency_ReturnBounceRate'|translate("<strong>"~bounceRateReturning~"</strong>")|raw }}
</div>
{% include "_sparklineFooter.twig" %}
diff --git a/plugins/VisitorGenerator b/plugins/VisitorGenerator
-Subproject f516179c7e7d5ae3cf28123c8e09f168e03dfca
+Subproject 0ed78a595d4d12965cd66f85a7a09b91ec94b55
diff --git a/plugins/VisitorInterest/API.php b/plugins/VisitorInterest/API.php
index 44df111588..33f6d97b58 100644
--- a/plugins/VisitorInterest/API.php
+++ b/plugins/VisitorInterest/API.php
@@ -87,28 +87,6 @@ class API extends \Piwik\Plugin\API
$dataTable->queueFilter('BeautifyRangeLabels', array(
Piwik::translate('General_OneVisit'), Piwik::translate('General_NVisits')));
- // add visit percent column
- self::addVisitsPercentColumn($dataTable);
-
return $dataTable;
}
-
- /**
- * Utility function that adds a visit percent column to a data table,
- * regardless of whether the data table is an data table array or just
- * a data table.
- *
- * @param DataTable $dataTable The data table to modify.
- */
- private static function addVisitsPercentColumn($dataTable)
- {
- if ($dataTable instanceof DataTable\Map) {
- foreach ($dataTable->getDataTables() as $table) {
- self::addVisitsPercentColumn($table);
- }
- } else {
- $totalVisits = array_sum($dataTable->getColumn(Metrics::INDEX_NB_VISITS));
- $dataTable->queueFilter('ColumnCallbackAddColumnPercentage', array('nb_visits_percentage', 'nb_visits', $totalVisits));
- }
- }
}
diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php
index 74cf975a4d..0cebfe2e2a 100644
--- a/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php
+++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php
@@ -12,6 +12,7 @@ use Piwik\Metrics;
use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\VisitorInterest\Columns\VisitsbyVisitNumber;
+use Piwik\Plugins\CoreHome\Columns\Metrics\VisitsPercent;
class GetNumberOfVisitsByVisitCount extends Base
{
@@ -22,8 +23,10 @@ class GetNumberOfVisitsByVisitCount extends Base
$this->name = Piwik::translate('VisitorInterest_visitsByVisitCount');
$this->documentation = Piwik::translate('VisitorInterest_WidgetVisitsByNumDocumentation')
. '<br />' . Piwik::translate('General_ChangeTagCloudView');
- $this->metrics = array('nb_visits', 'nb_visits_percentage');
- $this->processedMetrics = false;
+ $this->metrics = array('nb_visits');
+ $this->processedMetrics = array(
+ new VisitsPercent()
+ );
$this->constantRowsCount = true;
$this->order = 25;
$this->widgetTitle = 'VisitorInterest_visitsByVisitCount';
diff --git a/plugins/VisitsSummary/API.php b/plugins/VisitsSummary/API.php
index 8012de8f50..b80c505fbb 100644
--- a/plugins/VisitsSummary/API.php
+++ b/plugins/VisitsSummary/API.php
@@ -9,8 +9,9 @@
namespace Piwik\Plugins\VisitsSummary;
use Piwik\Archive;
-use Piwik\MetricsFormatter;
+use Piwik\Metrics\Formatter;
use Piwik\Piwik;
+use Piwik\Plugin\Report;
use Piwik\SettingsPiwik;
/**
@@ -26,51 +27,18 @@ class API extends \Piwik\Plugin\API
Piwik::checkUserHasViewAccess($idSite);
$archive = Archive::build($idSite, $period, $date, $segment);
- // array values are comma separated
- $columns = Piwik::getArrayFromApiParameter($columns);
- $tempColumns = array();
-
- $bounceRateRequested = $actionsPerVisitRequested = $averageVisitDurationRequested = false;
- if (!empty($columns)) {
- // make sure base metrics are there for processed metrics
- if (false !== ($bounceRateRequested = array_search('bounce_rate', $columns))) {
- if (!in_array('nb_visits', $columns)) $tempColumns[] = 'nb_visits';
- if (!in_array('bounce_count', $columns)) $tempColumns[] = 'bounce_count';
- unset($columns[$bounceRateRequested]);
- }
- if (false !== ($actionsPerVisitRequested = array_search('nb_actions_per_visit', $columns))) {
- if (!in_array('nb_visits', $columns)) $tempColumns[] = 'nb_visits';
- if (!in_array('nb_actions', $columns)) $tempColumns[] = 'nb_actions';
- unset($columns[$actionsPerVisitRequested]);
- }
- if (false !== ($averageVisitDurationRequested = array_search('avg_time_on_site', $columns))) {
- if (!in_array('nb_visits', $columns)) $tempColumns[] = 'nb_visits';
- if (!in_array('sum_visit_length', $columns)) $tempColumns[] = 'sum_visit_length';
- unset($columns[$averageVisitDurationRequested]);
- }
- $tempColumns = array_unique($tempColumns);
- rsort($tempColumns);
- $columns = array_merge($columns, $tempColumns);
- } else {
- $bounceRateRequested = $actionsPerVisitRequested = $averageVisitDurationRequested = true;
- $columns = $this->getCoreColumns($period);
- }
+ $requestedColumns = Piwik::getArrayFromApiParameter($columns);
+
+ $report = Report::factory("VisitsSummary", "get");
+ $columns = $report->getMetricsRequiredForReport($this->getCoreColumns($period), $requestedColumns);
$dataTable = $archive->getDataTableFromNumeric($columns);
- // Process ratio metrics from base metrics, when requested
- if ($bounceRateRequested !== false) {
- $dataTable->filter('ColumnCallbackAddColumnPercentage', array('bounce_rate', 'bounce_count', 'nb_visits', 0));
- }
- if ($actionsPerVisitRequested !== false) {
- $dataTable->filter('ColumnCallbackAddColumnQuotient', array('nb_actions_per_visit', 'nb_actions', 'nb_visits', 1));
- }
- if ($averageVisitDurationRequested !== false) {
- $dataTable->filter('ColumnCallbackAddColumnQuotient', array('avg_time_on_site', 'sum_visit_length', 'nb_visits', 0));
+ if (!empty($requestedColumns)) {
+ $columnsToShow = $requestedColumns ?: $report->getAllMetrics();
+ $dataTable->queueFilter('ColumnDelete', array($columnsToRemove = array(), $columnsToShow));
}
- // remove temp metrics that were used to compute processed metrics
- $dataTable->deleteColumns($tempColumns);
return $dataTable;
}
@@ -155,12 +123,14 @@ class API extends \Piwik\Plugin\API
public function getSumVisitsLengthPretty($idSite, $period, $date, $segment = false)
{
+ $formatter = new Formatter();
+
$table = $this->getSumVisitsLength($idSite, $period, $date, $segment);
if (is_object($table)) {
$table->filter('ColumnCallbackReplace',
- array('sum_visit_length', '\Piwik\MetricsFormatter::getPrettyTimeFromSeconds'));
+ array('sum_visit_length', array($formatter, 'getPrettyTimeFromSeconds'), array(true)));
} else {
- $table = MetricsFormatter::getPrettyTimeFromSeconds($table);
+ $table = $formatter->getPrettyTimeFromSeconds($table, true);
}
return $table;
}
diff --git a/plugins/VisitsSummary/Controller.php b/plugins/VisitsSummary/Controller.php
index 63fe8ef205..84916cf057 100644
--- a/plugins/VisitsSummary/Controller.php
+++ b/plugins/VisitsSummary/Controller.php
@@ -61,7 +61,7 @@ class Controller extends \Piwik\Plugin\Controller
. Piwik::translate('General_ColumnNbActionsDocumentation') . '<br />'
. '<b>' . Piwik::translate('General_ColumnNbUsers') . ':</b> '
- . Piwik::translate('General_ColumnNbUsersDocumentation') . ' (<a target="_blank" href="http://piwik.org/docs/user-id/">User ID</a>)<br />'
+ . Piwik::translate('General_ColumnNbUsersDocumentation') . ' (<a rel="noreferrer" target="_blank" href="http://piwik.org/docs/user-id/">User ID</a>)<br />'
. '<b>' . Piwik::translate('General_ColumnActionsPerVisit') . ':</b> '
. Piwik::translate('General_ColumnActionsPerVisitDocumentation');
@@ -147,22 +147,26 @@ class Controller extends \Piwik\Plugin\Controller
$dataTableVisit = self::getVisitsSummary();
$dataRow = $dataTableVisit->getRowsCount() == 0 ? new Row() : $dataTableVisit->getFirstRow();
-
$view->nbUniqVisitors = (int)$dataRow->getColumn('nb_uniq_visitors');
$view->nbUsers = (int)$dataRow->getColumn('nb_users');
$nbVisits = (int)$dataRow->getColumn('nb_visits');
$view->nbVisits = $nbVisits;
$view->averageVisitDuration = $dataRow->getColumn('avg_time_on_site');
- $nbBouncedVisits = $dataRow->getColumn('bounce_count');
- $view->bounceRate = Piwik::getPercentageSafe($nbBouncedVisits, $nbVisits);
+ $view->bounceRate = $dataRow->getColumn('bounce_rate');
$view->maxActions = (int)$dataRow->getColumn('max_actions');
$view->nbActionsPerVisit = $dataRow->getColumn('nb_actions_per_visit');
if (Common::isActionsPluginEnabled()) {
$view->showActionsPluginReports = true;
- $dataTableActions = APIActions::getInstance()->get($idSite, Common::getRequestVar('period'), Common::getRequestVar('date'),
- \Piwik\API\Request::getRawSegmentFromRequest());
+
+ $dataTableActions = Request::processRequest("Actions.get", array(
+ 'idSite' => $idSite,
+ 'period' => Common::getRequestVar('period'),
+ 'date' => Common::getRequestVar('date'),
+ 'segment' => Request::getRawSegmentFromRequest()
+ ), $defaultParams = array());
+
$dataActionsRow =
$dataTableActions->getRowsCount() == 0 ? new Row() : $dataTableActions->getFirstRow();
diff --git a/plugins/VisitsSummary/Reports/Get.php b/plugins/VisitsSummary/Reports/Get.php
index 82a21f1cc9..f2a087a517 100644
--- a/plugins/VisitsSummary/Reports/Get.php
+++ b/plugins/VisitsSummary/Reports/Get.php
@@ -9,6 +9,9 @@
namespace Piwik\Plugins\VisitsSummary\Reports;
use Piwik\Piwik;
+use Piwik\Plugins\CoreHome\Columns\Metrics\ActionsPerVisit;
+use Piwik\Plugins\CoreHome\Columns\Metrics\AverageTimeOnSite;
+use Piwik\Plugins\CoreHome\Columns\Metrics\BounceRate;
class Get extends \Piwik\Plugin\Report
{
@@ -18,15 +21,16 @@ class Get extends \Piwik\Plugin\Report
$this->category = 'VisitsSummary_VisitsSummary';
$this->name = Piwik::translate('VisitsSummary_VisitsSummary');
$this->documentation = ''; // TODO
- $this->processedMetrics = false;
+ $this->processedMetrics = array(
+ new BounceRate(),
+ new ActionsPerVisit(),
+ new AverageTimeOnSite()
+ );
$this->metrics = array(
'nb_uniq_visitors',
'nb_visits',
'nb_users',
'nb_actions',
- 'nb_actions_per_visit',
- 'bounce_rate',
- 'avg_time_on_site',
'max_actions'
);
// Used to process metrics, not displayed/used directly
@@ -39,9 +43,17 @@ class Get extends \Piwik\Plugin\Report
{
$metrics = parent::getMetrics();
- $metrics['avg_time_on_site'] = Piwik::translate('General_VisitDuration');
$metrics['max_actions'] = Piwik::translate('General_ColumnMaxActions');
return $metrics;
}
-}
+
+ public function getProcessedMetrics()
+ {
+ $metrics = parent::getProcessedMetrics();
+
+ $metrics['avg_time_on_site'] = Piwik::translate('General_VisitDuration');
+
+ return $metrics;
+ }
+} \ No newline at end of file
diff --git a/plugins/VisitsSummary/templates/_sparklines.twig b/plugins/VisitsSummary/templates/_sparklines.twig
index fd58642ad2..92bc44b6a0 100644
--- a/plugins/VisitsSummary/templates/_sparklines.twig
+++ b/plugins/VisitsSummary/templates/_sparklines.twig
@@ -18,7 +18,7 @@
</div>
<div class="sparkline">
{{ sparkline(urlSparklineBounceRate)|raw }}
- {{ 'VisitsSummary_NbVisitsBounced'|translate("<strong>"~bounceRate~"%</strong>")|raw }}
+ {{ 'VisitsSummary_NbVisitsBounced'|translate("<strong>"~bounceRate~"</strong>")|raw }}
</div>
<div class="sparkline">
{{ sparkline(urlSparklineActionsPerVisit)|raw }}
diff --git a/plugins/Widgetize/javascripts/widgetize.js b/plugins/Widgetize/javascripts/widgetize.js
index c341c7c5c3..3e7d8787b6 100644
--- a/plugins/Widgetize/javascripts/widgetize.js
+++ b/plugins/Widgetize/javascripts/widgetize.js
@@ -64,7 +64,7 @@ function widgetize() {
'</span>' +
'</div>' +
'<div> <label for="embedThisWidgetDirectLink">&rsaquo; Direct Link</label>' +
- '<span id="embedThisWidgetDirectLink"> ' + self.getInputFormWithHtml('directLinkEmbed', urlIframe) + ' - <a href="' + urlIframe + '" target="_blank">' + _pk_translate('Widgetize_OpenInNewWindow') + '</a></span>'
+ '<span id="embedThisWidgetDirectLink"> ' + self.getInputFormWithHtml('directLinkEmbed', urlIframe) + ' - <a href="' + urlIframe + '" rel="noreferrer" target="_blank">' + _pk_translate('Widgetize_OpenInNewWindow') + '</a></span>'
+ '</div>'
);
diff --git a/plugins/Widgetize/templates/index.twig b/plugins/Widgetize/templates/index.twig
index 4ef49917bd..4763473a62 100644
--- a/plugins/Widgetize/templates/index.twig
+++ b/plugins/Widgetize/templates/index.twig
@@ -35,14 +35,14 @@
<p>
<strong>&rsaquo; Widget authentication:</strong> If you want your widgets to be viewable by everybody, you first have to set the 'view' permissions
- to the anonymous user in the <a href='index.php?module=UsersManager' target='_blank'>Users Management section</a>.
+ to the anonymous user in the <a href='index.php?module=UsersManager' rel='noreferrer' target='_blank'>Users Management section</a>.
<br/>Alternatively, if you are publishing widgets on a password protected or private page,
you don't necessarily have to allow 'anonymous' to view your reports. In this case, you can add the secret token_auth parameter (found in the
- <a href='{{ linkTo({'module':'API','action':'listAllAPI'}) }}' target='_blank'>API page</a>) in the widget URL.
+ <a href='{{ linkTo({'module':'API','action':'listAllAPI'}) }}' rel='noreferrer' target='_blank'>API page</a>) in the widget URL.
</p>
<p><strong>&rsaquo; Widgetize the full dashboard:</strong> You can also display the full Piwik dashboard in your application or website in an IFRAME
- (<a href='' target='_blank' id='linkDashboardUrl'>see example</a>).
+ (<a href='' rel='noreferrer' target='_blank' id='linkDashboardUrl'>see example</a>).
The date parameter can be set to a specific calendar date, "today", or "yesterday". The period parameter can be set to "day", "week", "month", or
"year".
The language parameter can be set to the language code of a translation, such as language=fr.
@@ -50,7 +50,7 @@
</p>
<p>
- <strong>&rsaquo; Widgetize the all websites dashboard in an IFRAME</strong> (<a href='' target='_blank' id='linkAllWebsitesDashboardUrl'>see example</a>)
+ <strong>&rsaquo; Widgetize the all websites dashboard in an IFRAME</strong> (<a href='' rel='noreferrer' target='_blank' id='linkAllWebsitesDashboardUrl'>see example</a>)
<span id='exportAllWebsitesDashboard'></span>
</p>
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php
index f12e522c9a..6735a8d126 100644
--- a/tests/PHPUnit/Framework/Fixture.php
+++ b/tests/PHPUnit/Framework/Fixture.php
@@ -8,6 +8,7 @@
namespace Piwik\Tests\Framework;
use Piwik\Access;
+use Piwik\Cache\StaticCache;
use Piwik\CacheFile;
use Piwik\Common;
use Piwik\Config;
@@ -243,6 +244,8 @@ class Fixture extends \PHPUnit_Framework_Assert
$this->getTestEnvironment()->executeSetupTestEnvHook();
Piwik_TestingEnvironment::addSendMailHook();
+ StaticCache::clearAll();
+
if ($this->overwriteExisting
|| !$this->isFixtureSetUp()
) {
diff --git a/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php b/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
index ee36b68c63..becfac3a18 100644
--- a/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
+++ b/tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php
@@ -8,6 +8,7 @@
namespace Piwik\Tests\Framework\TestCase;
+use Piwik\Cache\StaticCache;
use Piwik\Config;
use Piwik\Db;
use Piwik\Tests\Framework\Fixture;
@@ -76,6 +77,8 @@ abstract class IntegrationTestCase extends SystemTestCase
if (!empty(self::$tableData)) {
self::restoreDbTables(self::$tableData);
}
+
+ StaticCache::clearAll();
}
/**
@@ -83,6 +86,8 @@ abstract class IntegrationTestCase extends SystemTestCase
*/
public function tearDown()
{
+ StaticCache::clearAll();
+
self::$fixture->clearInMemoryCaches();
parent::tearDown();
diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
index d0a7c340ca..8b85f255aa 100755
--- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
+++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
@@ -295,7 +295,8 @@ abstract class SystemTestCase extends PHPUnit_Framework_TestCase
}
try {
- Response::assertEquals($expectedResponse, $processedResponse, "Differences with expected in '$processedFilePath'");
+ $errorMessage = get_class($this) . ": Differences with expected in '$processedFilePath'";
+ Response::assertEquals($expectedResponse, $processedResponse, $errorMessage);
} catch (Exception $ex) {
$this->comparisonFailures[] = $ex;
}
diff --git a/tests/PHPUnit/Framework/TestRequest/Response.php b/tests/PHPUnit/Framework/TestRequest/Response.php
index 7c740dd2c6..3d0b1622d4 100644
--- a/tests/PHPUnit/Framework/TestRequest/Response.php
+++ b/tests/PHPUnit/Framework/TestRequest/Response.php
@@ -77,7 +77,7 @@ class Response
}
// check content size to get quick feedback and avoid lengthy diff
- $checkSizeFirst = array('pdf', 'csv');
+ $checkSizeFirst = array('pdf', 'csv', 'html');
if(!empty($expected->requestUrl['reportFormat'])
&& in_array($expected->requestUrl['reportFormat'], $checkSizeFirst)) {
Asserts::assertEquals(strlen($expectedText), strlen($actualText), $message);
@@ -127,7 +127,6 @@ class Response
|| strpos($apiResponse, '<result') === false) {
return $apiResponse;
}
-
return str_replace('&amp;#039;', "'", $apiResponse);
}
diff --git a/tests/PHPUnit/Integration/LogTest.php b/tests/PHPUnit/Integration/LogTest.php
index e3950fea65..2ca084fd59 100644
--- a/tests/PHPUnit/Integration/LogTest.php
+++ b/tests/PHPUnit/Integration/LogTest.php
@@ -44,7 +44,7 @@ dummy backtrace'
public static $expectedErrorOutput = array(
'screen' => '<div style=\'word-wrap: break-word; border: 3px solid red; padding:4px; width:70%; background-color:#FFFF96;\'>
<strong>There is an error. Please report the message (Piwik 2.0)
- and full backtrace in the <a href=\'?module=Proxy&action=redirect&url=http://forum.piwik.org\' target=\'_blank\'>Piwik forums</a> (please do a Search first as it might have been reported already!).<br /><br/>
+ and full backtrace in the <a href=\'?module=Proxy&action=redirect&url=http://forum.piwik.org\' rel=\'noreferrer\' target=\'_blank\'>Piwik forums</a> (please do a Search first as it might have been reported already!).<br /><br/>
Unknown error (102):</strong> <em>dummy error string</em> in <strong>dummyerrorfile.php</strong> on line <strong>145</strong>
<br /><br />Backtrace --&gt;<div style="font-family:Courier;font-size:10pt"><br />
dummy backtrace</div><br />
diff --git a/tests/PHPUnit/Integration/PiwikTest.php b/tests/PHPUnit/Integration/PiwikTest.php
index 252c08cd78..6043736e04 100644
--- a/tests/PHPUnit/Integration/PiwikTest.php
+++ b/tests/PHPUnit/Integration/PiwikTest.php
@@ -9,8 +9,6 @@
namespace Piwik\Tests\Integration;
use Piwik\Access;
-use Piwik\Filesystem;
-use Piwik\MetricsFormatter;
use Piwik\Piwik;
use Piwik\Plugins\SitesManager\API;
use Piwik\Translate;
@@ -80,52 +78,6 @@ class PiwikTest extends IntegrationTestCase
}
/**
- * Dataprovider for testGetPrettyTimeFromSeconds
- */
- public function getPrettyTimeFromSecondsData()
- {
- return array(
- array(30, array('30s', '00:00:30')),
- array(60, array('1 min 0s', '00:01:00')),
- array(100, array('1 min 40s', '00:01:40')),
- array(3600, array('1 hours 0 min', '01:00:00')),
- array(3700, array('1 hours 1 min', '01:01:40')),
- array(86400 + 3600 * 10, array('1 days 10 hours', '34:00:00')),
- array(86400 * 365, array('365 days 0 hours', '8760:00:00')),
- array((86400 * (365.25 + 10)), array('1 years 10 days', '9006:00:00')),
- array(1.342, array('1.34s', '00:00:01.34')),
- array(.342, array('0.34s', '00:00:00.34')),
- array(.02, array('0.02s', '00:00:00.02')),
- array(.002, array('0.002s', '00:00:00')),
- array(1.002, array('1s', '00:00:01')),
- array(1.02, array('1.02s', '00:00:01.02')),
- array(1.2, array('1.2s', '00:00:01.20')),
- array(122.1, array('2 min 2.1s', '00:02:02.10')),
- array(-122.1, array('-2 min 2.1s', '-00:02:02.10')),
- array(86400 * -365, array('-365 days 0 hours', '-8760:00:00'))
- );
- }
-
- /**
- * @dataProvider getPrettyTimeFromSecondsData
- */
- public function testGetPrettyTimeFromSeconds($seconds, $expected)
- {
- if (($seconds * 100) > PHP_INT_MAX) {
- $this->markTestSkipped("Will not pass on 32-bit machine.");
- }
-
- Translate::loadEnglishTranslation();
-
- $sentenceExpected = str_replace(' ', '&nbsp;', $expected[0]);
- $numericExpected = $expected[1];
- $this->assertEquals($sentenceExpected, MetricsFormatter::getPrettyTimeFromSeconds($seconds, $sentence = true));
- $this->assertEquals($numericExpected, MetricsFormatter::getPrettyTimeFromSeconds($seconds, $sentence = false));
-
- Translate::unloadEnglishTranslation();
- }
-
- /**
* Dataprovider for testCheckValidLoginString
*/
public function getInvalidLoginStringData()
@@ -184,41 +136,6 @@ class PiwikTest extends IntegrationTestCase
}
/**
- * Dataprovider for testGetPrettyValue
- */
- public function getGetPrettyValueTestCases()
- {
- return array(
- array('revenue', 12, '$ 12'),
- array('revenue_evolution', '100 %', '100 %'),
- array('avg_time_generation', '3.333', '3.33s'),
- array('avg_time_generation', '333.333', '5&nbsp;min&nbsp;33.33s'),
- array('avg_time_on_page', '3', '00:00:03'),
- array('avg_time_on_page', '333', '00:05:33'),
- );
- }
-
- /**
- * @dataProvider getGetPrettyValueTestCases
- */
- public function testGetPrettyValue($columnName, $value, $expected)
- {
- Translate::loadEnglishTranslation();
-
- $access = Access::getInstance();
- $access->setSuperUserAccess(true);
-
- $idsite = API::getInstance()->addSite("test", "http://test");
-
- $this->assertEquals(
- $expected,
- MetricsFormatter::getPrettyValue($idsite, $columnName, $value, false, false)
- );
-
- Translate::unloadEnglishTranslation();
- }
-
- /**
* Data provider for testIsAssociativeArray.
*/
public function getIsAssociativeArrayTestCases()
diff --git a/tests/PHPUnit/Integration/ReportTest.php b/tests/PHPUnit/Integration/ReportTest.php
index 13c404375c..1e141db383 100644
--- a/tests/PHPUnit/Integration/ReportTest.php
+++ b/tests/PHPUnit/Integration/ReportTest.php
@@ -466,7 +466,8 @@ class ReportTest extends IntegrationTestCase
'date' => '2012-01-02',
'format' => 'original',
'module' => 'API',
- 'method' => 'ExampleReport.getExampleReport'
+ 'method' => 'ExampleReport.getExampleReport',
+ 'format_metrics' => 'bc'
)
)->willReturn("result");
Proxy::setSingletonInstance($proxyMock);
@@ -488,7 +489,8 @@ class ReportTest extends IntegrationTestCase
'date' => '2012-01-02',
'format' => 'original',
'module' => 'API',
- 'method' => 'Referrers.getSearchEnginesFromKeywordId'
+ 'method' => 'Referrers.getSearchEnginesFromKeywordId',
+ 'format_metrics' => 'bc'
)
)->willReturn("result");
Proxy::setSingletonInstance($proxyMock);
diff --git a/tests/PHPUnit/System/BlobReportLimitingTest.php b/tests/PHPUnit/System/BlobReportLimitingTest.php
index 8048c31de5..b539e111b8 100755
--- a/tests/PHPUnit/System/BlobReportLimitingTest.php
+++ b/tests/PHPUnit/System/BlobReportLimitingTest.php
@@ -43,7 +43,6 @@ class BlobReportLimitingTest extends SystemTestCase
);
$ecommerceApi = array('Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory');
-
return array(
array($apiToCall, array('idSite' => self::$fixture->idSite,
'date' => self::$fixture->dateTime,
diff --git a/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php
index 9918f108d9..88727c30a2 100755
--- a/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php
+++ b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php
@@ -7,7 +7,9 @@
*/
namespace Piwik\Tests\System;
+use Piwik\Archive;
use Piwik\Plugins\Goals\Archiver;
+use Piwik\Segment;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
use Piwik\Tests\Fixtures\TwoSitesTwoVisitorsDifferentDays;
@@ -109,19 +111,28 @@ class TwoVisitorsTwoWebsitesDifferentDaysConversionsTest extends SystemTestCase
);
}
+ return $result;
+ }
+
+ // TODO: this test should be in an integration test for Piwik\Archive. setup code for getting metrics from different
+ // plugins is non-trivial, so not done now.
+ public function test_Archive_getNumeric_ReturnsMetricsFromDifferentPlugins_WhenThoseMetricsAreRequested()
+ {
// Tests that getting a visits summary metric (nb_visits) & a Goal's metric (Goal_revenue)
// at the same time works.
$dateTimeRange = '2010-01-03,2010-01-06';
- $columns = 'nb_visits,' . Archiver::getRecordName('conversion_rate');
+ $columns = array('nb_visits', 'Goal_nb_conversions');
+ $idSite1 = self::$fixture->idSite1;
- $result[] = array(
- 'VisitsSummary.get', array('idSite' => 'all', 'date' => $dateTimeRange, 'periods' => 'range',
- 'otherRequestParameters' => array('columns' => $columns),
- 'testSuffix' => '_getMetricsFromDifferentReports')
+ $archive = Archive::build($idSite1, 'range', $dateTimeRange);
+ $result = $archive->getNumeric($columns);
+ $this->assertEquals(
+ array(
+ 'nb_visits' => 4,
+ 'Goal_nb_conversions' => 6
+ ),
+ $result
);
-
-
- return $result;
}
public static function getOutputPrefix()
diff --git a/tests/PHPUnit/System/expected/test_ArchiveCronTest_archive_php_cron_output.txt b/tests/PHPUnit/System/expected/test_ArchiveCronTest_archive_php_cron_output.txt
deleted file mode 100644
index 814737fdd4..0000000000
--- a/tests/PHPUnit/System/expected/test_ArchiveCronTest_archive_php_cron_output.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-
--------------------------------------------------------
-Using this 'archive.php' script is no longer recommended.
-Please use '/path/to/php /home/travis/build/piwik/piwik/tests/PHPUnit/proxy/../../..//console core:archive --url=http://localhost/tests/PHPUnit/proxy/index.php' instead.
-To get help use '/path/to/php /home/travis/build/piwik/piwik/tests/PHPUnit/proxy/../../..//console core:archive --help'
-See also: http://piwik.org/docs/setup-auto-archiving/
-
-If you cannot use the console because it requires CLI
-try 'php archive.php -- url=http://your.piwik/path'
--------------------------------------------------------
-
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml
index 121915e8e4..a7be13ef56 100644
--- a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml
@@ -131,7 +131,7 @@
<pageId>30</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -148,7 +148,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -193,7 +193,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -412,7 +412,7 @@
<pageId>27</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -457,7 +457,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -676,7 +676,7 @@
<pageId>23</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -693,7 +693,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -738,7 +738,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -957,7 +957,7 @@
<pageId>20</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -1002,7 +1002,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -1221,7 +1221,7 @@
<pageId>16</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -1238,7 +1238,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -1283,7 +1283,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -1502,7 +1502,7 @@
<pageId>13</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -1547,7 +1547,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -1641,7 +1641,7 @@
<pageId>52</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -1686,7 +1686,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -2022,7 +2022,7 @@
<pageId>9</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -2039,7 +2039,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -2084,7 +2084,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -2178,7 +2178,7 @@
<pageId>48</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -2195,7 +2195,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -2240,7 +2240,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -2576,7 +2576,7 @@
<pageId>6</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -2621,7 +2621,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -2715,7 +2715,7 @@
<pageId>38</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -2760,7 +2760,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -2854,7 +2854,7 @@
<pageId>45</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -2899,7 +2899,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -2985,7 +2985,7 @@
<pageId>59</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -3030,7 +3030,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -3624,7 +3624,7 @@
<pageId>2</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -3641,7 +3641,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -3686,7 +3686,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -3780,7 +3780,7 @@
<pageId>34</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -3797,7 +3797,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -3842,7 +3842,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -3936,7 +3936,7 @@
<pageId>41</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -3953,7 +3953,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -3998,7 +3998,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -4084,7 +4084,7 @@
<pageId>55</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -4101,7 +4101,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -4146,7 +4146,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml
index ef94481043..18509953c4 100644
--- a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml
@@ -13,7 +13,6 @@
<sum_event_value>Total value</sum_event_value>
<min_event_value>Minimum value</min_event_value>
<max_event_value>Maximum value</max_event_value>
- <avg_event_value>Average value</avg_event_value>
<nb_events_with_value>Events with a value</nb_events_with_value>
</metrics>
<metricsDocumentation>
@@ -21,9 +20,12 @@
<sum_event_value>The sum of event values</sum_event_value>
<min_event_value>The minimum value for this event</min_event_value>
<max_event_value>The maximum value for this event</max_event_value>
- <avg_event_value>The average of all values for this event</avg_event_value>
<nb_events_with_value>Number of events where an Event value was set</nb_events_with_value>
+ <avg_event_value>The average of all values for this event</avg_event_value>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_event_value>The average of all values for this event</avg_event_value>
+ </processedMetrics>
<actionToLoadSubTables>getNameFromActionId</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getAction&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getAction&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
@@ -35,8 +37,8 @@
<sum_event_value>Total value</sum_event_value>
<min_event_value>Minimum value</min_event_value>
<max_event_value>Maximum value</max_event_value>
- <avg_event_value>Average value</avg_event_value>
<nb_events_with_value>Events with a value</nb_events_with_value>
+ <avg_event_value>The average of all values for this event</avg_event_value>
</columns>
<reportData>
<result prettyDate="Sunday 3 January 2010">
diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml
index b503ab7292..dbf61d55a0 100644
--- a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml
@@ -13,7 +13,6 @@
<sum_event_value>Total value</sum_event_value>
<min_event_value>Minimum value</min_event_value>
<max_event_value>Maximum value</max_event_value>
- <avg_event_value>Average value</avg_event_value>
<nb_events_with_value>Events with a value</nb_events_with_value>
</metrics>
<metricsDocumentation>
@@ -21,9 +20,12 @@
<sum_event_value>The sum of event values</sum_event_value>
<min_event_value>The minimum value for this event</min_event_value>
<max_event_value>The maximum value for this event</max_event_value>
- <avg_event_value>The average of all values for this event</avg_event_value>
<nb_events_with_value>Number of events where an Event value was set</nb_events_with_value>
+ <avg_event_value>The average of all values for this event</avg_event_value>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_event_value>The average of all values for this event</avg_event_value>
+ </processedMetrics>
<actionToLoadSubTables>getActionFromCategoryId</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getCategory&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getCategory&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
@@ -35,8 +37,8 @@
<sum_event_value>Total value</sum_event_value>
<min_event_value>Minimum value</min_event_value>
<max_event_value>Maximum value</max_event_value>
- <avg_event_value>Average value</avg_event_value>
<nb_events_with_value>Events with a value</nb_events_with_value>
+ <avg_event_value>The average of all values for this event</avg_event_value>
</columns>
<reportData>
<result prettyDate="Sunday 3 January 2010">
diff --git a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml
index 403acff85f..15678442b5 100644
--- a/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml
@@ -13,7 +13,6 @@
<sum_event_value>Total value</sum_event_value>
<min_event_value>Minimum value</min_event_value>
<max_event_value>Maximum value</max_event_value>
- <avg_event_value>Average value</avg_event_value>
<nb_events_with_value>Events with a value</nb_events_with_value>
</metrics>
<metricsDocumentation>
@@ -21,9 +20,12 @@
<sum_event_value>The sum of event values</sum_event_value>
<min_event_value>The minimum value for this event</min_event_value>
<max_event_value>The maximum value for this event</max_event_value>
- <avg_event_value>The average of all values for this event</avg_event_value>
<nb_events_with_value>Number of events where an Event value was set</nb_events_with_value>
+ <avg_event_value>The average of all values for this event</avg_event_value>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_event_value>The average of all values for this event</avg_event_value>
+ </processedMetrics>
<actionToLoadSubTables>getActionFromNameId</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getName&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getName&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
@@ -35,8 +37,8 @@
<sum_event_value>Total value</sum_event_value>
<min_event_value>Minimum value</min_event_value>
<max_event_value>Maximum value</max_event_value>
- <avg_event_value>Average value</avg_event_value>
<nb_events_with_value>Events with a value</nb_events_with_value>
+ <avg_event_value>The average of all values for this event</avg_event_value>
</columns>
<reportData>
<result prettyDate="Sunday 3 January 2010">
diff --git a/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_day.xml
index 9317026f72..cabb71c501 100644
--- a/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_day.xml
@@ -220,7 +220,7 @@
<eventAction>play50%</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>1320</timeSpent>
- <timeSpentPretty>22 min 0s</timeSpentPretty>
+ <timeSpentPretty>22 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -233,7 +233,7 @@
<eventAction>play75%</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>420</timeSpent>
- <timeSpentPretty>7 min 0s</timeSpentPretty>
+ <timeSpentPretty>7 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -246,7 +246,7 @@
<eventAction>Search</eventAction>
<eventName>Search query here</eventName>
<timeSpent>900</timeSpent>
- <timeSpentPretty>15 min 0s</timeSpentPretty>
+ <timeSpentPretty>15 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -259,7 +259,7 @@
<eventAction>playEnd</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -273,7 +273,7 @@
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<eventValue>9.66</eventValue>
<timeSpent>720</timeSpent>
- <timeSpentPretty>12 min 0s</timeSpentPretty>
+ <timeSpentPretty>12 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -310,7 +310,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>3481</visitDuration>
- <visitDurationPretty>58 min 1s</visitDurationPretty>
+ <visitDurationPretty>58 min 1s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>Visit Scope Custom var</customVariableName1>
@@ -491,7 +491,7 @@
<pageId>1</pageId>
<generationTime>0.33s</generationTime>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -520,7 +520,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -539,7 +539,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -558,7 +558,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -636,7 +636,7 @@
<eventName>La fiancée de l&amp;#039;eau</eventName>
<eventValue>10</eventValue>
<timeSpent>1499</timeSpent>
- <timeSpentPretty>24 min 59s</timeSpentPretty>
+ <timeSpentPretty>24 min 59s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -648,7 +648,7 @@
<pageId>9</pageId>
<generationTime>0.67s</generationTime>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -661,7 +661,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Princess Mononoke (もののけ姫)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -674,7 +674,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Ponyo (崖の上のポニョ)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -687,7 +687,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -700,7 +700,7 @@
<eventAction>clickBuyNow</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -713,7 +713,7 @@
<eventAction>playStart</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>1320</timeSpent>
- <timeSpentPretty>22 min 0s</timeSpentPretty>
+ <timeSpentPretty>22 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -749,7 +749,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>3601</visitDuration>
- <visitDurationPretty>1 hours 0 min</visitDurationPretty>
+ <visitDurationPretty>1 hours 0 min</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>Visit Scope Custom var</customVariableName1>
@@ -1025,7 +1025,7 @@
<eventAction>play50%</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>1320</timeSpent>
- <timeSpentPretty>22 min 0s</timeSpentPretty>
+ <timeSpentPretty>22 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1038,7 +1038,7 @@
<eventAction>play75%</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>420</timeSpent>
- <timeSpentPretty>7 min 0s</timeSpentPretty>
+ <timeSpentPretty>7 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1051,7 +1051,7 @@
<eventAction>Search</eventAction>
<eventName>Search query here</eventName>
<timeSpent>900</timeSpent>
- <timeSpentPretty>15 min 0s</timeSpentPretty>
+ <timeSpentPretty>15 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1064,7 +1064,7 @@
<eventAction>playEnd</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1078,7 +1078,7 @@
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<eventValue>9.66</eventValue>
<timeSpent>720</timeSpent>
- <timeSpentPretty>12 min 0s</timeSpentPretty>
+ <timeSpentPretty>12 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1115,7 +1115,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>3481</visitDuration>
- <visitDurationPretty>58 min 1s</visitDurationPretty>
+ <visitDurationPretty>58 min 1s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>Visit Scope Custom var</customVariableName1>
@@ -1288,7 +1288,7 @@
<pageId>25</pageId>
<generationTime>0.33s</generationTime>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -1317,7 +1317,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1336,7 +1336,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1355,7 +1355,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1433,7 +1433,7 @@
<eventName>La fiancée de l&amp;#039;eau</eventName>
<eventValue>10</eventValue>
<timeSpent>1499</timeSpent>
- <timeSpentPretty>24 min 59s</timeSpentPretty>
+ <timeSpentPretty>24 min 59s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1445,7 +1445,7 @@
<pageId>33</pageId>
<generationTime>0.67s</generationTime>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -1458,7 +1458,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Princess Mononoke (もののけ姫)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1471,7 +1471,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Ponyo (崖の上のポニョ)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1484,7 +1484,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1497,7 +1497,7 @@
<eventAction>clickBuyNow</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1510,7 +1510,7 @@
<eventAction>playStart</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>1320</timeSpent>
- <timeSpentPretty>22 min 0s</timeSpentPretty>
+ <timeSpentPretty>22 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1546,7 +1546,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>3601</visitDuration>
- <visitDurationPretty>1 hours 0 min</visitDurationPretty>
+ <visitDurationPretty>1 hours 0 min</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>Visit Scope Custom var</customVariableName1>
diff --git a/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_month.xml
index 9317026f72..cabb71c501 100644
--- a/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_month.xml
@@ -220,7 +220,7 @@
<eventAction>play50%</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>1320</timeSpent>
- <timeSpentPretty>22 min 0s</timeSpentPretty>
+ <timeSpentPretty>22 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -233,7 +233,7 @@
<eventAction>play75%</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>420</timeSpent>
- <timeSpentPretty>7 min 0s</timeSpentPretty>
+ <timeSpentPretty>7 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -246,7 +246,7 @@
<eventAction>Search</eventAction>
<eventName>Search query here</eventName>
<timeSpent>900</timeSpent>
- <timeSpentPretty>15 min 0s</timeSpentPretty>
+ <timeSpentPretty>15 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -259,7 +259,7 @@
<eventAction>playEnd</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -273,7 +273,7 @@
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<eventValue>9.66</eventValue>
<timeSpent>720</timeSpent>
- <timeSpentPretty>12 min 0s</timeSpentPretty>
+ <timeSpentPretty>12 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -310,7 +310,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>3481</visitDuration>
- <visitDurationPretty>58 min 1s</visitDurationPretty>
+ <visitDurationPretty>58 min 1s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>Visit Scope Custom var</customVariableName1>
@@ -491,7 +491,7 @@
<pageId>1</pageId>
<generationTime>0.33s</generationTime>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -520,7 +520,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -539,7 +539,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -558,7 +558,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -636,7 +636,7 @@
<eventName>La fiancée de l&amp;#039;eau</eventName>
<eventValue>10</eventValue>
<timeSpent>1499</timeSpent>
- <timeSpentPretty>24 min 59s</timeSpentPretty>
+ <timeSpentPretty>24 min 59s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -648,7 +648,7 @@
<pageId>9</pageId>
<generationTime>0.67s</generationTime>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -661,7 +661,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Princess Mononoke (もののけ姫)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -674,7 +674,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Ponyo (崖の上のポニョ)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -687,7 +687,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -700,7 +700,7 @@
<eventAction>clickBuyNow</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -713,7 +713,7 @@
<eventAction>playStart</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>1320</timeSpent>
- <timeSpentPretty>22 min 0s</timeSpentPretty>
+ <timeSpentPretty>22 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -749,7 +749,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>3601</visitDuration>
- <visitDurationPretty>1 hours 0 min</visitDurationPretty>
+ <visitDurationPretty>1 hours 0 min</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>Visit Scope Custom var</customVariableName1>
@@ -1025,7 +1025,7 @@
<eventAction>play50%</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>1320</timeSpent>
- <timeSpentPretty>22 min 0s</timeSpentPretty>
+ <timeSpentPretty>22 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1038,7 +1038,7 @@
<eventAction>play75%</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>420</timeSpent>
- <timeSpentPretty>7 min 0s</timeSpentPretty>
+ <timeSpentPretty>7 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1051,7 +1051,7 @@
<eventAction>Search</eventAction>
<eventName>Search query here</eventName>
<timeSpent>900</timeSpent>
- <timeSpentPretty>15 min 0s</timeSpentPretty>
+ <timeSpentPretty>15 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1064,7 +1064,7 @@
<eventAction>playEnd</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1078,7 +1078,7 @@
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<eventValue>9.66</eventValue>
<timeSpent>720</timeSpent>
- <timeSpentPretty>12 min 0s</timeSpentPretty>
+ <timeSpentPretty>12 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1115,7 +1115,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>3481</visitDuration>
- <visitDurationPretty>58 min 1s</visitDurationPretty>
+ <visitDurationPretty>58 min 1s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>Visit Scope Custom var</customVariableName1>
@@ -1288,7 +1288,7 @@
<pageId>25</pageId>
<generationTime>0.33s</generationTime>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -1317,7 +1317,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1336,7 +1336,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1355,7 +1355,7 @@
</customVariables>
<eventName>La fiancée de l&amp;#039;eau</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1433,7 +1433,7 @@
<eventName>La fiancée de l&amp;#039;eau</eventName>
<eventValue>10</eventValue>
<timeSpent>1499</timeSpent>
- <timeSpentPretty>24 min 59s</timeSpentPretty>
+ <timeSpentPretty>24 min 59s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1445,7 +1445,7 @@
<pageId>33</pageId>
<generationTime>0.67s</generationTime>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -1458,7 +1458,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Princess Mononoke (もののけ姫)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1471,7 +1471,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Ponyo (崖の上のポニョ)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1484,7 +1484,7 @@
<eventAction>playTrailer</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>60</timeSpent>
- <timeSpentPretty>1 min 0s</timeSpentPretty>
+ <timeSpentPretty>1 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1497,7 +1497,7 @@
<eventAction>clickBuyNow</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>120</timeSpent>
- <timeSpentPretty>2 min 0s</timeSpentPretty>
+ <timeSpentPretty>2 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1510,7 +1510,7 @@
<eventAction>playStart</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>1320</timeSpent>
- <timeSpentPretty>22 min 0s</timeSpentPretty>
+ <timeSpentPretty>22 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/event.png</icon>
</row>
<row>
@@ -1546,7 +1546,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>3601</visitDuration>
- <visitDurationPretty>1 hours 0 min</visitDurationPretty>
+ <visitDurationPretty>1 hours 0 min</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>Visit Scope Custom var</customVariableName1>
diff --git a/tests/PHPUnit/System/expected/test_FlattenReports__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_FlattenReports__Actions.getPageUrls_week.xml
index 2e48a2f945..1db9719c00 100644
--- a/tests/PHPUnit/System/expected/test_FlattenReports__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_FlattenReports__Actions.getPageUrls_week.xml
@@ -170,7 +170,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://example.org/page1.html</url>
</row>
<row>
diff --git a/tests/PHPUnit/System/expected/test_FlattenReports_expandedWithDepth__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_FlattenReports_expandedWithDepth__Actions.getPageUrls_week.xml
index 326bf6903d..60400f15ef 100644
--- a/tests/PHPUnit/System/expected/test_FlattenReports_expandedWithDepth__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_FlattenReports_expandedWithDepth__Actions.getPageUrls_week.xml
@@ -153,9 +153,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>2</entry_nb_actions>
<entry_sum_visit_length>1</entry_sum_visit_length>
@@ -163,7 +160,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
diff --git a/tests/PHPUnit/System/expected/test_FlattenReports_withAggregate__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_FlattenReports_withAggregate__Actions.getPageUrls_week.xml
index fb09d47fce..eda55355bc 100644
--- a/tests/PHPUnit/System/expected/test_FlattenReports_withAggregate__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_FlattenReports_withAggregate__Actions.getPageUrls_week.xml
@@ -384,6 +384,7 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
+ <avg_time_generation>0</avg_time_generation>
<is_aggregate>1</is_aggregate>
</row>
<row>
@@ -398,6 +399,7 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
+ <avg_time_generation>0</avg_time_generation>
<is_aggregate>1</is_aggregate>
</row>
<row>
@@ -414,6 +416,7 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
+ <avg_time_generation>0</avg_time_generation>
<url>http://example.org/sub/dir/dir1/page1.html</url>
<is_aggregate>0</is_aggregate>
</row>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml
index d8014b0c28..2d81bb9f19 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml
@@ -64,9 +64,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>180</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>2</entry_nb_actions>
<entry_sum_visit_length>182</entry_sum_visit_length>
@@ -76,7 +73,6 @@
<avg_time_on_page>180</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
@@ -103,9 +99,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -117,7 +110,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
@@ -144,9 +136,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -158,7 +147,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml
index b8b7233c2e..b7cbdc125b 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml
@@ -163,9 +163,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -174,16 +171,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>/index</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -195,7 +188,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/blog/2012/08/survey-your-opinion-matters/</url>
</row>
</subtable>
@@ -519,9 +511,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -533,7 +522,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/docs/manage-users/</url>
</row>
</subtable>
@@ -603,9 +591,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -617,7 +602,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/faq/how-to/</url>
</row>
</subtable>
@@ -645,9 +629,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -659,7 +640,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/faq/how-to-install/</url>
</row>
</subtable>
@@ -689,9 +669,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -700,16 +677,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>/index</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -721,7 +694,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/download/counter/</url>
</row>
</subtable>
@@ -900,9 +872,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>79</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>2</entry_nb_actions>
<entry_sum_visit_length>81</entry_sum_visit_length>
@@ -912,7 +881,6 @@
<avg_time_on_page>79</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.org/changelog/</url>
</row>
</subtable>
@@ -940,9 +908,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -954,7 +919,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/hosting/</url>
</row>
</subtable>
@@ -982,9 +946,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -996,7 +957,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/intranet-analytics/</url>
</row>
</subtable>
@@ -1024,9 +984,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1038,7 +995,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/newsletter/</url>
</row>
</subtable>
@@ -1066,9 +1022,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1077,16 +1030,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>not</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1095,16 +1044,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>the</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1113,16 +1058,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>page</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1131,16 +1072,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>i</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1149,16 +1086,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>am</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1167,16 +1100,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>looking</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1185,16 +1114,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>for</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1203,16 +1128,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>/index</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1224,7 +1145,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/this/is/not/the/page/i/am/looking/for/</url>
</row>
</subtable>
@@ -1268,9 +1188,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1282,7 +1199,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/translations/</url>
</row>
</subtable>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml
index fbb87d260d..867e27cd0d 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml
@@ -61,16 +61,12 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<exit_nb_visits>1</exit_nb_visits>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
@@ -97,9 +93,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -111,7 +104,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
@@ -138,9 +130,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -152,7 +141,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml
index ebf0fdffcf..7721a10da1 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml
@@ -163,9 +163,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -174,16 +171,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>/index</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -195,7 +188,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/blog/2012/08/survey-your-opinion-matters/</url>
</row>
</subtable>
@@ -519,9 +511,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -533,7 +522,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/docs/manage-users/</url>
</row>
</subtable>
@@ -603,9 +591,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -617,7 +602,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/faq/how-to/</url>
</row>
</subtable>
@@ -645,9 +629,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -659,7 +640,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/faq/how-to-install/</url>
</row>
</subtable>
@@ -689,9 +669,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -700,16 +677,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>/index</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -721,7 +694,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/download/counter/</url>
</row>
</subtable>
@@ -894,16 +866,12 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<exit_nb_visits>1</exit_nb_visits>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.org/contact/</url>
</row>
</subtable>
@@ -931,9 +899,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -945,7 +910,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/hosting/</url>
</row>
</subtable>
@@ -973,9 +937,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -987,7 +948,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/intranet-analytics/</url>
</row>
</subtable>
@@ -1015,9 +975,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1029,7 +986,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/newsletter/</url>
</row>
</subtable>
@@ -1057,9 +1013,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1068,16 +1021,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>not</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1086,16 +1035,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>the</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1104,16 +1049,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>page</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1122,16 +1063,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>i</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1140,16 +1077,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>am</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1158,16 +1091,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>looking</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1176,16 +1105,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>for</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1194,16 +1119,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>/index</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1215,7 +1136,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/this/is/not/the/page/i/am/looking/for/</url>
</row>
</subtable>
@@ -1259,9 +1179,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1273,7 +1190,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/translations/</url>
</row>
</subtable>
@@ -1297,16 +1213,12 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<exit_nb_visits>1</exit_nb_visits>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.org/what-is-piwisk/</url>
</row>
</subtable>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml
index 6285169aa5..509723308f 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml
@@ -78,9 +78,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>180</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>2</entry_nb_actions>
<entry_sum_visit_length>182</entry_sum_visit_length>
@@ -90,7 +87,6 @@
<avg_time_on_page>180</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
@@ -113,16 +109,12 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<exit_nb_visits>1</exit_nb_visits>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
@@ -149,9 +141,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -163,7 +152,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
@@ -190,9 +178,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -204,7 +189,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
</row>
</subtable>
</row>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml
index 4ce246f6cf..aaabfb8fc3 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml
@@ -163,9 +163,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -174,16 +171,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>/index</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -195,7 +188,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/blog/2012/08/survey-your-opinion-matters/</url>
</row>
</subtable>
@@ -519,9 +511,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -533,7 +522,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/docs/manage-users/</url>
</row>
</subtable>
@@ -603,9 +591,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -617,7 +602,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/faq/how-to/</url>
</row>
</subtable>
@@ -645,9 +629,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -659,7 +640,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/faq/how-to-install/</url>
</row>
</subtable>
@@ -722,9 +702,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -736,7 +713,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/download/counter/</url>
</row>
</subtable>
@@ -932,9 +908,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>79</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>2</entry_nb_actions>
<entry_sum_visit_length>81</entry_sum_visit_length>
@@ -944,7 +917,6 @@
<avg_time_on_page>79</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.org/changelog/</url>
</row>
</subtable>
@@ -968,16 +940,12 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<exit_nb_visits>1</exit_nb_visits>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.org/contact/</url>
</row>
</subtable>
@@ -1005,9 +973,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1019,7 +984,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/hosting/</url>
</row>
</subtable>
@@ -1047,9 +1011,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1061,7 +1022,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/intranet-analytics/</url>
</row>
</subtable>
@@ -1089,9 +1049,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1103,7 +1060,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/newsletter/</url>
</row>
</subtable>
@@ -1131,9 +1087,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1142,16 +1095,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>not</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1160,16 +1109,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>the</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1178,16 +1123,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>page</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1196,16 +1137,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>i</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1214,16 +1151,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>am</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1232,16 +1165,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>looking</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1250,16 +1179,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>for</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation>0</max_time_generation>
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1268,16 +1193,12 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<subtable>
<row>
<label>/index</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1289,7 +1210,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/this/is/not/the/page/i/am/looking/for/</url>
</row>
</subtable>
@@ -1333,9 +1253,6 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<entry_nb_visits>1</entry_nb_visits>
<entry_nb_actions>1</entry_nb_actions>
<entry_sum_visit_length>0</entry_sum_visit_length>
@@ -1347,7 +1264,6 @@
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.net/translations/</url>
</row>
</subtable>
@@ -1371,16 +1287,12 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
- <nb_hits_with_time_generation>0</nb_hits_with_time_generation>
- <min_time_generation />
- <max_time_generation />
<exit_nb_visits>1</exit_nb_visits>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_exit_nb_uniq_visitors>1</sum_daily_exit_nb_uniq_visitors>
<avg_time_on_page>0</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0</avg_time_generation>
<url>http://piwik.org/what-is-piwisk/</url>
</row>
</subtable>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml
index 1f9e1351ba..c8388c1f4d 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml
@@ -8,5 +8,4 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>0</nb_searches>
<nb_keywords>0</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Goals.get_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.get_month.xml
index fc80cf81c0..4c6855264a 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Goals.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.get_month.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>25</nb_conversions>
<nb_visits_converted>25</nb_visits_converted>
- <conversion_rate>92.59</conversion_rate>
<revenue>125</revenue>
+ <conversion_rate>92.59%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
index dd6812feea..23cef7562d 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
@@ -142,7 +142,7 @@
</row>
</customVariables>
<timeSpent>79</timeSpent>
- <timeSpentPretty>1 min 19s</timeSpentPretty>
+ <timeSpentPretty>1 min 19s</timeSpentPretty>
<icon />
</row>
<row>
@@ -192,7 +192,7 @@
<daysSinceFirstVisit>181</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>81</visitDuration>
- <visitDurationPretty>1 min 21s</visitDurationPretty>
+ <visitDurationPretty>1 min 21s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>Domain landed</customVariableName1>
@@ -2199,7 +2199,7 @@
</row>
</customVariables>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -2249,7 +2249,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>182</visitDuration>
- <visitDurationPretty>3 min 2s</visitDurationPretty>
+ <visitDurationPretty>3 min 2s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>Not-Bot</customVariableName1>
@@ -2324,7 +2324,7 @@
</row>
</customVariables>
<timeSpent>61</timeSpent>
- <timeSpentPretty>1 min 1s</timeSpentPretty>
+ <timeSpentPretty>1 min 1s</timeSpentPretty>
<icon>plugins/Morpheus/images/download.png</icon>
</row>
<row>
@@ -2341,7 +2341,7 @@
</row>
</customVariables>
<timeSpent>61</timeSpent>
- <timeSpentPretty>1 min 1s</timeSpentPretty>
+ <timeSpentPretty>1 min 1s</timeSpentPretty>
<icon>plugins/Morpheus/images/download.png</icon>
</row>
<row>
@@ -2381,7 +2381,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>123</visitDuration>
- <visitDurationPretty>2 min 3s</visitDurationPretty>
+ <visitDurationPretty>2 min 3s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>Not-Bot</customVariableName1>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getPlugin_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getPlugin_month.xml
index 7079af5413..d1f2bda02f 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getPlugin_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getPlugin_month.xml
@@ -3,43 +3,43 @@
<row>
<label>Cookie</label>
<nb_visits>2</nb_visits>
- <nb_visits_percentage>9.5%</nb_visits_percentage>
+ <nb_visits_percentage>10%</nb_visits_percentage>
<logo>plugins/UserSettings/images/plugins/cookie.gif</logo>
</row>
<row>
<label>Flash</label>
<nb_visits>2</nb_visits>
- <nb_visits_percentage>9.5%</nb_visits_percentage>
+ <nb_visits_percentage>10%</nb_visits_percentage>
<logo>plugins/UserSettings/images/plugins/flash.gif</logo>
</row>
<row>
<label>Java</label>
<nb_visits>2</nb_visits>
- <nb_visits_percentage>9.5%</nb_visits_percentage>
+ <nb_visits_percentage>10%</nb_visits_percentage>
<logo>plugins/UserSettings/images/plugins/java.gif</logo>
</row>
<row>
<label>Director</label>
<nb_visits>1</nb_visits>
- <nb_visits_percentage>4.8%</nb_visits_percentage>
+ <nb_visits_percentage>5%</nb_visits_percentage>
<logo>plugins/UserSettings/images/plugins/director.gif</logo>
</row>
<row>
<label>Gears</label>
<nb_visits>1</nb_visits>
- <nb_visits_percentage>4.8%</nb_visits_percentage>
+ <nb_visits_percentage>5%</nb_visits_percentage>
<logo>plugins/UserSettings/images/plugins/gears.gif</logo>
</row>
<row>
<label>Pdf</label>
<nb_visits>1</nb_visits>
- <nb_visits_percentage>4.8%</nb_visits_percentage>
+ <nb_visits_percentage>5%</nb_visits_percentage>
<logo>plugins/UserSettings/images/plugins/pdf.gif</logo>
</row>
<row>
<label>Windowsmedia</label>
<nb_visits>1</nb_visits>
- <nb_visits_percentage>4.8%</nb_visits_percentage>
+ <nb_visits_percentage>5%</nb_visits_percentage>
<logo>plugins/UserSettings/images/plugins/windowsmedia.gif</logo>
</row>
<row>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getSumVisitsLengthPretty_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getSumVisitsLengthPretty_month.xml
index 2c93902a53..0a9c671f55 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getSumVisitsLengthPretty_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getSumVisitsLengthPretty_month.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8" ?>
-<result>5 min 5s</result> \ No newline at end of file
+<result>5 min 5s</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisitAsc__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisitAsc__Live.getLastVisitsDetails_month.xml
index 1e9d9ac92f..8e034ec059 100644
--- a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisitAsc__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisitAsc__Live.getLastVisitsDetails_month.xml
@@ -147,7 +147,7 @@
<pageId>2</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -164,7 +164,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -209,7 +209,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -424,7 +424,7 @@
<pageId>34</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -441,7 +441,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -486,7 +486,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -701,7 +701,7 @@
<pageId>41</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -718,7 +718,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -763,7 +763,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
diff --git a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisit__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisit__Live.getLastVisitsDetails_month.xml
index a1a7876269..c6ff4bfdff 100644
--- a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisit__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisit__Live.getLastVisitsDetails_month.xml
@@ -131,7 +131,7 @@
<pageId>30</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -148,7 +148,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -193,7 +193,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -412,7 +412,7 @@
<pageId>27</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -457,7 +457,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -676,7 +676,7 @@
<pageId>23</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -693,7 +693,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -738,7 +738,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
diff --git a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByVisitCount__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByVisitCount__Live.getLastVisitsDetails_month.xml
index d8315dbc59..9c5c5cc080 100644
--- a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByVisitCount__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByVisitCount__Live.getLastVisitsDetails_month.xml
@@ -24,7 +24,7 @@
<pageId>30</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -41,7 +41,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -86,7 +86,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -305,7 +305,7 @@
<pageId>23</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -322,7 +322,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -367,7 +367,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -461,7 +461,7 @@
<pageId>27</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -506,7 +506,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
diff --git a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortDesc__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortDesc__Live.getLastVisitsDetails_month.xml
index a1a7876269..c6ff4bfdff 100644
--- a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortDesc__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortDesc__Live.getLastVisitsDetails_month.xml
@@ -131,7 +131,7 @@
<pageId>30</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -148,7 +148,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -193,7 +193,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -412,7 +412,7 @@
<pageId>27</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -457,7 +457,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -676,7 +676,7 @@
<pageId>23</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -693,7 +693,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -738,7 +738,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
diff --git a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__Live.getLastVisitsDetails_month.xml
index e5c58280d5..6bc6d4b5aa 100644
--- a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__Live.getLastVisitsDetails_month.xml
@@ -131,7 +131,7 @@
<pageId>30</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -148,7 +148,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -193,7 +193,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -412,7 +412,7 @@
<pageId>27</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -457,7 +457,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -676,7 +676,7 @@
<pageId>23</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -693,7 +693,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -738,7 +738,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
@@ -957,7 +957,7 @@
<pageId>20</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -1002,7 +1002,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>0</searches>
<actions>2</actions>
<referrerType>direct</referrerType>
@@ -1221,7 +1221,7 @@
<pageId>16</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -1238,7 +1238,7 @@
</customVariables>
<siteSearchKeyword>Bring on the party</siteSearchKeyword>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -1283,7 +1283,7 @@
<daysSinceFirstVisit>100</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>50</daysSinceLastEcommerceOrder>
<visitDuration>1261</visitDuration>
- <visitDurationPretty>21 min 1s</visitDurationPretty>
+ <visitDurationPretty>21 min 1s</visitDurationPretty>
<searches>1</searches>
<actions>3</actions>
<referrerType>direct</referrerType>
diff --git a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml
index ea574a289f..5c5dea9f59 100644
--- a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml
@@ -12,17 +12,20 @@
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_page>Avg. time on page</avg_time_on_page>
- <exit_rate>Exit rate</exit_rate>
</metrics>
<metricsDocumentation>
<nb_hits>The number of times this page was visited.</nb_hits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
- <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2010-01-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2009-12-05,2010-01-03</imageGraphEvolutionUrl>
@@ -32,26 +35,26 @@
<label>Page URL</label>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
<exit_rate>Exit rate</exit_rate>
</columns>
<reportData>
<row>
- <label>space</label>
+ <label>grue</label>
<nb_visits>4</nb_visits>
<nb_hits>4</nb_hits>
- <avg_time_on_page>00:06:00</avg_time_on_page>
- <bounce_rate>0%</bounce_rate>
- <exit_rate>0%</exit_rate>
+ <bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
+ <exit_rate>100%</exit_rate>
</row>
<row>
- <label>grue</label>
+ <label>space</label>
<nb_visits>4</nb_visits>
<nb_hits>4</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
- <bounce_rate>100%</bounce_rate>
- <exit_rate>100%</exit_rate>
+ <bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:06:00</avg_time_on_page>
+ <exit_rate>0%</exit_rate>
</row>
</reportData>
<reportMetadata>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageTitles_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageTitles_day.xml
index 124e271777..668fad20f4 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageTitles_day.xml
@@ -5,6 +5,7 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
@@ -24,6 +25,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
@@ -47,6 +49,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>180</sum_time_spent>
+ <sum_time_generation>0.234</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.234</min_time_generation>
<max_time_generation>0.234</max_time_generation>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageUrls_day.xml
index 5b3878f7b2..782624f6dc 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageUrls_day.xml
@@ -6,6 +6,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>180</sum_time_spent>
+ <sum_time_generation>0.234</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.234</min_time_generation>
<max_time_generation>0.234</max_time_generation>
@@ -25,6 +26,7 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
@@ -44,6 +46,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageTitles_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageTitles_day.xml
index f80bfdd222..e6cc3fafe0 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageTitles_day.xml
@@ -5,6 +5,7 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
@@ -24,6 +25,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
@@ -47,6 +49,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.023</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.023</min_time_generation>
<max_time_generation>0.023</max_time_generation>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageUrls_day.xml
index 3986b5b44b..39e9d36014 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageUrls_day.xml
@@ -6,6 +6,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.023</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.023</min_time_generation>
<max_time_generation>0.023</max_time_generation>
@@ -22,6 +23,7 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
@@ -41,6 +43,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitle_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitle_day.xml
index 629847ae61..5f687c3a3f 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitle_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitle_day.xml
@@ -6,6 +6,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml
index 510f81282a..863bb0ecb6 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml
@@ -5,6 +5,7 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
@@ -24,6 +25,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
@@ -47,6 +49,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>180</sum_time_spent>
+ <sum_time_generation>0.234</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.234</min_time_generation>
<max_time_generation>0.234</max_time_generation>
@@ -66,6 +69,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.023</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.023</min_time_generation>
<max_time_generation>0.023</max_time_generation>
@@ -82,6 +86,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>900</sum_time_spent>
+ <sum_time_generation>0.224</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.224</min_time_generation>
<max_time_generation>0.224</max_time_generation>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrl_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrl_day.xml
index 0880f58750..dda8223114 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrl_day.xml
@@ -6,6 +6,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.023</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.023</min_time_generation>
<max_time_generation>0.023</max_time_generation>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrls_day.xml
index 62c8fa6fc8..099d3c8c45 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrls_day.xml
@@ -6,6 +6,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>180</sum_time_spent>
+ <sum_time_generation>0.224</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.224</min_time_generation>
<max_time_generation>0.224</max_time_generation>
@@ -21,6 +22,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.023</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.023</min_time_generation>
<max_time_generation>0.023</max_time_generation>
@@ -38,6 +40,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>180</sum_time_spent>
+ <sum_time_generation>0.234</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.234</min_time_generation>
<max_time_generation>0.234</max_time_generation>
@@ -57,6 +60,7 @@
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
@@ -76,6 +80,7 @@
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
<sum_time_spent>0</sum_time_spent>
+ <sum_time_generation>0.134</sum_time_generation>
<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getConversionRate_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getConversionRate_day.xml
index dff1089a71..01cf6797a0 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getConversionRate_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getConversionRate_day.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8" ?>
-<result>100</result> \ No newline at end of file
+<result>100%</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.get_day.xml
index d0e395f9e8..24662c288c 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.get_day.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>2</nb_visits_converted>
- <conversion_rate>100</conversion_rate>
<revenue>43</revenue>
+ <conversion_rate>100%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLengthPretty_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLengthPretty_day.xml
index 3912ba15a2..c7ce53bdef 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLengthPretty_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLengthPretty_day.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8" ?>
-<result>27 min 1s</result> \ No newline at end of file
+<result>27 min 1s</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
index 7279329235..1c2d3f6a74 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
@@ -12,19 +12,21 @@
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_page>Avg. time on page</avg_time_on_page>
- <exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_hits>The number of times this page was visited.</nb_hits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
- <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=week&amp;date=2010-03-06&amp;idSubtable=</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=week&amp;date=2009-08-10,2010-03-07&amp;idSubtable=</imageGraphEvolutionUrl>
@@ -34,8 +36,8 @@
<label>Page URL</label>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
<exit_rate>Exit rate</exit_rate>
<avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
@@ -44,8 +46,8 @@
<label>/purchase.htm</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.13s</avg_time_generation>
</row>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv
index 86a07c0d50..ccf95a9d55 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv
Binary files differ
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
index fe3da65352..c9d8cb0877 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
@@ -9,12 +9,12 @@
<action>getPageTitles</action>
<dimension>Page Name</dimension>
<documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
- <metrics>
- <exit_rate>Exit rate</exit_rate>
- </metrics>
<metricsDocumentation>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <exit_rate>Exit rate</exit_rate>
+ </processedMetrics>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-03-06</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-02-05,2010-03-06</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___Actions.getPageTitles_day.xml
index 793f02d8be..0d2e438d08 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___Actions.getPageTitles_day.xml
@@ -2,6 +2,7 @@
<result>
<row>
<label>Checkout</label>
+ <sum_time_generation>0.134</sum_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
<avg_time_on_page>0</avg_time_on_page>
@@ -10,6 +11,7 @@
<row>
<label> Purchasing...</label>
<nb_uniq_visitors>1</nb_uniq_visitors>
+ <sum_time_generation>0.134</sum_time_generation>
<min_time_generation>0.134</min_time_generation>
<max_time_generation>0.134</max_time_generation>
<avg_time_on_page>0</avg_time_on_page>
@@ -20,6 +22,7 @@
<row>
<label> incredible title!</label>
<nb_uniq_visitors>1</nb_uniq_visitors>
+ <sum_time_generation>0.234</sum_time_generation>
<min_time_generation>0.234</min_time_generation>
<max_time_generation>0.234</max_time_generation>
<avg_time_on_page>180</avg_time_on_page>
@@ -28,6 +31,7 @@
<row>
<label> Looking at homepage (again)...</label>
<nb_uniq_visitors>1</nb_uniq_visitors>
+ <sum_time_generation>0.023</sum_time_generation>
<min_time_generation>0.023</min_time_generation>
<max_time_generation>0.023</max_time_generation>
<avg_time_on_page>0</avg_time_on_page>
@@ -36,6 +40,7 @@
<row>
<label> Second page view - should be registered as URL</label>
<nb_uniq_visitors>1</nb_uniq_visitors>
+ <sum_time_generation>0.224</sum_time_generation>
<min_time_generation>0.224</min_time_generation>
<max_time_generation>0.224</max_time_generation>
<avg_time_on_page>900</avg_time_on_page>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns__API.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns__API.get_day.xml
index cdd370d354..606de13a5f 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns__API.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns__API.get_day.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<result>
<nb_uniq_visitors>1</nb_uniq_visitors>
- <bounce_rate>50%</bounce_rate>
<nb_pageviews>4</nb_pageviews>
+ <bounce_rate>50%</bounce_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
index 6c94a197f7..0997fc815f 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
@@ -11,12 +11,14 @@
<documentation>This report contains information about the titles of the pages that have been visited. &lt;br /&gt; The page title is the HTML &lt;title&gt; Tag that most browsers show in their window title.</documentation>
<metrics>
<nb_hits>Pageviews</nb_hits>
- <bounce_rate>Bounce Rate</bounce_rate>
</metrics>
<metricsDocumentation>
<nb_hits>The number of times this page was visited.</nb_hits>
<bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ </processedMetrics>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-03-06</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-02-05,2010-03-06</imageGraphEvolutionUrl>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.get_day.xml
index d0e395f9e8..24662c288c 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.get_day.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>2</nb_visits_converted>
- <conversion_rate>100</conversion_rate>
<revenue>43</revenue>
+ <conversion_rate>100%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml
index b0e326e03d..849af36fed 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml
@@ -123,7 +123,7 @@
<pageId>1</pageId>
<generationTime>0.23s</generationTime>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -135,7 +135,7 @@
<pageId>2</pageId>
<generationTime>0.22s</generationTime>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -146,7 +146,7 @@
<pageId>3</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon>plugins/Morpheus/images/link.gif</icon>
</row>
<row>
@@ -157,7 +157,7 @@
<pageId>4</pageId>
<timeSpent>72</timeSpent>
- <timeSpentPretty>1 min 12s</timeSpentPretty>
+ <timeSpentPretty>1 min 12s</timeSpentPretty>
<icon>plugins/Morpheus/images/download.png</icon>
</row>
<row>
@@ -168,7 +168,7 @@
<pageId>5</pageId>
<timeSpent>108</timeSpent>
- <timeSpentPretty>1 min 48s</timeSpentPretty>
+ <timeSpentPretty>1 min 48s</timeSpentPretty>
<icon>plugins/Morpheus/images/link.gif</icon>
</row>
<row>
@@ -179,7 +179,7 @@
<pageId>6</pageId>
<timeSpent>72</timeSpent>
- <timeSpentPretty>1 min 12s</timeSpentPretty>
+ <timeSpentPretty>1 min 12s</timeSpentPretty>
<icon>plugins/Morpheus/images/link.gif</icon>
</row>
<row>
@@ -201,7 +201,7 @@
<siteSearchKeyword>Banks Own The World</siteSearchKeyword>
<generationTime>0.81s</generationTime>
<timeSpent>108</timeSpent>
- <timeSpentPretty>1 min 48s</timeSpentPretty>
+ <timeSpentPretty>1 min 48s</timeSpentPretty>
<icon>plugins/Morpheus/images/search_ico.png</icon>
</row>
<row>
@@ -236,7 +236,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>1621</visitDuration>
- <visitDurationPretty>27 min 1s</visitDurationPretty>
+ <visitDurationPretty>27 min 1s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLengthPretty_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLengthPretty_day.xml
index 3912ba15a2..c7ce53bdef 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLengthPretty_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLengthPretty_day.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8" ?>
-<result>27 min 1s</result> \ No newline at end of file
+<result>27 min 1s</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__UserSettings.getPlugin_day.xml b/tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__UserSettings.getPlugin_day.xml
index 1058fa4e08..aa46939be4 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__UserSettings.getPlugin_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__UserSettings.getPlugin_day.xml
@@ -15,6 +15,6 @@
<row>
<label>Autres</label>
<nb_visits>7</nb_visits>
- <nb_visits_percentage />
+ <nb_visits_percentage>100%</nb_visits_percentage>
</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml
index 884a614a5b..8173b17251 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml
@@ -144,7 +144,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>1084</visitDuration>
- <visitDurationPretty>18 min 4s</visitDurationPretty>
+ <visitDurationPretty>18 min 4s</visitDurationPretty>
<customVariables>
</customVariables>
<deviceType>Inconnu</deviceType>
diff --git a/tests/PHPUnit/System/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml
index e73ba39d1d..71e2b84f9a 100644
--- a/tests/PHPUnit/System/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml
@@ -8,6 +8,7 @@
<entry_nb_visits>1</entry_nb_visits>
<entry_bounce_count>1</entry_bounce_count>
<bounce_rate>100%</bounce_rate>
+ <avg_time_generation>2.8</avg_time_generation>
</row>
</result>
<result date="2010-02-08" />
@@ -17,6 +18,7 @@
<entry_nb_visits>1</entry_nb_visits>
<entry_bounce_count>1</entry_bounce_count>
<bounce_rate>100%</bounce_rate>
+ <avg_time_generation>2.5</avg_time_generation>
</row>
</result>
<result date="2010-02-11" />
@@ -26,6 +28,7 @@
<entry_nb_visits>1</entry_nb_visits>
<entry_bounce_count>1</entry_bounce_count>
<bounce_rate>100%</bounce_rate>
+ <avg_time_generation>2.2</avg_time_generation>
</row>
</result>
<result date="2010-02-14" />
@@ -35,6 +38,7 @@
<entry_nb_visits>1</entry_nb_visits>
<entry_bounce_count>1</entry_bounce_count>
<bounce_rate>100%</bounce_rate>
+ <avg_time_generation>1.9</avg_time_generation>
</row>
</result>
<result date="2010-02-17" />
@@ -44,6 +48,7 @@
<entry_nb_visits>1</entry_nb_visits>
<entry_bounce_count>1</entry_bounce_count>
<bounce_rate>100%</bounce_rate>
+ <avg_time_generation>1.6</avg_time_generation>
</row>
</result>
<result date="2010-02-20" />
@@ -53,6 +58,7 @@
<entry_nb_visits>1</entry_nb_visits>
<entry_bounce_count>1</entry_bounce_count>
<bounce_rate>100%</bounce_rate>
+ <avg_time_generation>1.3</avg_time_generation>
</row>
</result>
<result date="2010-02-23" />
@@ -62,6 +68,7 @@
<entry_nb_visits>1</entry_nb_visits>
<entry_bounce_count>1</entry_bounce_count>
<bounce_rate>100%</bounce_rate>
+ <avg_time_generation>1</avg_time_generation>
</row>
</result>
<result date="2010-02-26" />
@@ -71,6 +78,7 @@
<entry_nb_visits>1</entry_nb_visits>
<entry_bounce_count>1</entry_bounce_count>
<bounce_rate>100%</bounce_rate>
+ <avg_time_generation>0.7</avg_time_generation>
</row>
</result>
<result date="2010-03-01" />
@@ -80,6 +88,7 @@
<entry_nb_visits>1</entry_nb_visits>
<entry_bounce_count>1</entry_bounce_count>
<bounce_rate>100%</bounce_rate>
+ <avg_time_generation>0.4</avg_time_generation>
</row>
</result>
<result date="2010-03-04" />
@@ -89,6 +98,7 @@
<entry_nb_visits>1</entry_nb_visits>
<entry_bounce_count>1</entry_bounce_count>
<bounce_rate>100%</bounce_rate>
+ <avg_time_generation>0.1</avg_time_generation>
</row>
</result>
</reportData>
@@ -109,6 +119,11 @@
<min>0</min>
<max>100</max>
</bounce_rate>
+ <avg_time_generation>
+ <name>Avg. generation time</name>
+ <min>0</min>
+ <max>2.8</max>
+ </avg_time_generation>
</metrics>
<dimension>Entry Page title</dimension>
</metadata>
diff --git a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml
index 67f2b8e444..649d127ab5 100644
--- a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml
@@ -194,8 +194,8 @@
<columns>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
<exit_rate>Exit rate</exit_rate>
<avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
diff --git a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml
index 49ee397bd0..6c91eca8d8 100644
--- a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml
@@ -52,8 +52,8 @@
<columns>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
<exit_rate>Exit rate</exit_rate>
<avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
diff --git a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml
index 00281d68e1..5b049977a4 100644
--- a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml
@@ -7,8 +7,8 @@
<row>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>2.8</avg_time_generation>
</row>
@@ -19,8 +19,8 @@
<row>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>2.5</avg_time_generation>
</row>
@@ -31,8 +31,8 @@
<row>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>2.2</avg_time_generation>
</row>
@@ -43,8 +43,8 @@
<row>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>1.9</avg_time_generation>
</row>
@@ -55,8 +55,8 @@
<row>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>1.6</avg_time_generation>
</row>
@@ -67,8 +67,8 @@
<row>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>1.3</avg_time_generation>
</row>
@@ -79,8 +79,8 @@
<row>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>1</avg_time_generation>
</row>
@@ -91,8 +91,8 @@
<row>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.7</avg_time_generation>
</row>
@@ -103,8 +103,8 @@
<row>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.4</avg_time_generation>
</row>
@@ -115,8 +115,8 @@
<row>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.1</avg_time_generation>
</row>
@@ -134,14 +134,14 @@
<min>0</min>
<max>1</max>
</nb_visits>
+ <avg_time_on_page>
+ <name>Avg. time on page</name>
+ </avg_time_on_page>
<bounce_rate>
<name>Bounce Rate</name>
<min>0</min>
<max>100</max>
</bounce_rate>
- <avg_time_on_page>
- <name>Avg. time on page</name>
- </avg_time_on_page>
<exit_rate>
<name>Exit rate</name>
<min>0</min>
diff --git a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml
index ffd938a2fb..fcb7a55ef8 100644
--- a/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml
@@ -6,8 +6,8 @@
<row>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>2.95</avg_time_generation>
</row>
@@ -16,8 +16,8 @@
<row>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>2.35</avg_time_generation>
</row>
@@ -26,8 +26,8 @@
<row>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>1.75</avg_time_generation>
</row>
@@ -36,8 +36,8 @@
<row>
<nb_visits>3</nb_visits>
<nb_hits>3</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>1</avg_time_generation>
</row>
@@ -46,8 +46,8 @@
<row>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.25</avg_time_generation>
</row>
@@ -67,15 +67,15 @@
<max>3</max>
<change>0%</change>
</nb_visits>
+ <avg_time_on_page>
+ <name>Avg. time on page</name>
+ </avg_time_on_page>
<bounce_rate>
<name>Bounce Rate</name>
<min>100</min>
<max>100</max>
<change>0%</change>
</bounce_rate>
- <avg_time_on_page>
- <name>Avg. time on page</name>
- </avg_time_on_page>
<exit_rate>
<name>Exit rate</name>
<min>100</min>
diff --git a/tests/PHPUnit/System/expected/test_RowEvolution_pageUrls__API.getRowEvolution_range.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageUrls__API.getRowEvolution_range.xml
index c58ead4c78..2aeb0c3679 100644
--- a/tests/PHPUnit/System/expected/test_RowEvolution_pageUrls__API.getRowEvolution_range.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageUrls__API.getRowEvolution_range.xml
@@ -8,8 +8,8 @@
<row>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>0</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>0</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.45</avg_time_generation>
</row>
@@ -30,14 +30,14 @@
<min>0</min>
<max>2</max>
</nb_visits>
+ <avg_time_on_page>
+ <name>Avg. time on page</name>
+ </avg_time_on_page>
<bounce_rate>
<name>Bounce Rate</name>
<min>0</min>
<max>100</max>
</bounce_rate>
- <avg_time_on_page>
- <name>Avg. time on page</name>
- </avg_time_on_page>
<exit_rate>
<name>Exit rate</name>
<min>0</min>
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
index c1f7037343..0ac93d5428 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
@@ -12,19 +12,20 @@
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_page>Avg. time on page</avg_time_on_page>
- <exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_hits>The number of times this page was visited.</nb_hits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
- <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
@@ -34,10 +35,9 @@
<label>Page Name</label>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
<exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
<reportData>
<result prettyDate="Sunday 3 January 2010">
@@ -45,28 +45,25 @@
<label> Im just a page</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:36</avg_time_on_page>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
<row>
<label> Pageview, not search</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
<row>
<label> This is a pageview, not a Search - IS_FOLLOWING_SEARCH ONCE</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:03:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:03:36</avg_time_on_page>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
</result>
<result prettyDate="Monday 4 January 2010" />
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
index 33516984c8..99cb37e592 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
@@ -12,19 +12,20 @@
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_page>Avg. time on page</avg_time_on_page>
- <exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_hits>The number of times this page was visited.</nb_hits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
- <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=range&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
@@ -34,10 +35,9 @@
<label>Page Name</label>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
<exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
<reportData>
<result prettyDate="2010, January">
@@ -45,28 +45,25 @@
<label> Im just a page</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:36</avg_time_on_page>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
<row>
<label> Pageview, not search</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
<row>
<label> This is a pageview, not a Search - IS_FOLLOWING_SEARCH ONCE</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:03:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:03:36</avg_time_on_page>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
</result>
<result prettyDate="2010, February" />
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
index 3778066188..0e98c5b577 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
@@ -12,19 +12,20 @@
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_page>Avg. time on page</avg_time_on_page>
- <exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_hits>The number of times this page was visited.</nb_hits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
- <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
@@ -34,10 +35,9 @@
<label>Page URL</label>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
<exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
<reportData>
<result prettyDate="Sunday 3 January 2010">
@@ -45,28 +45,25 @@
<label>/index.htm</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:36</avg_time_on_page>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
<row>
<label>/index.htm?gkwd=SHOULD be a PageView, NOT a search</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
<row>
<label>/index.htm?random=PAGEVIEW, NOT SEARCH&amp;mykwd=&amp;IS_FOLLOWING_SEARCH ONCE</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:03:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:03:36</avg_time_on_page>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
</result>
<result prettyDate="Monday 4 January 2010" />
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml
index c4d5795571..ac1a2430de 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml
@@ -12,19 +12,20 @@
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_page>Avg. time on page</avg_time_on_page>
- <exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_hits>The number of times this page was visited.</nb_hits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
- <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
- <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=range&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
@@ -34,10 +35,9 @@
<label>Page URL</label>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
<exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
<reportData>
<result prettyDate="2010, January">
@@ -45,28 +45,25 @@
<label>/index.htm</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:36</avg_time_on_page>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
<row>
<label>/index.htm?gkwd=SHOULD be a PageView, NOT a search</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
<row>
<label>/index.htm?random=PAGEVIEW, NOT SEARCH&amp;mykwd=&amp;IS_FOLLOWING_SEARCH ONCE</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:03:36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:03:36</avg_time_on_page>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0s</avg_time_generation>
</row>
</result>
<result prettyDate="2010, February" />
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml
index 84b4b19ea1..d5932307ff 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,17 +8,19 @@
<module>Actions</module>
<action>getSiteSearchKeywords</action>
<dimension>Keyword</dimension>
- <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
+ <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; rel=&quot;noreferrer&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<nb_pages_per_search>Search Results pages</nb_pages_per_search>
- <exit_rate>% Search Exits</exit_rate>
</metrics>
<metricsDocumentation>
<nb_visits>The number of visits that searched for this keyword on your website's search engine.</nb_visits>
<nb_pages_per_search>Visitors will search on your website, and sometimes click &quot;next&quot; to view more results. This is the average number of search results pages viewed for this keyword.</nb_pages_per_search>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <exit_rate>% Search Exits</exit_rate>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchKeywords</uniqueId>
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml
index 133ef2f538..e37617d098 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml
@@ -8,17 +8,19 @@
<module>Actions</module>
<action>getSiteSearchKeywords</action>
<dimension>Keyword</dimension>
- <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
+ <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; rel=&quot;noreferrer&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<nb_pages_per_search>Search Results pages</nb_pages_per_search>
- <exit_rate>% Search Exits</exit_rate>
</metrics>
<metricsDocumentation>
<nb_visits>The number of visits that searched for this keyword on your website's search engine.</nb_visits>
<nb_pages_per_search>Visitors will search on your website, and sometimes click &quot;next&quot; to view more results. This is the average number of search results pages viewed for this keyword.</nb_pages_per_search>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <exit_rate>% Search Exits</exit_rate>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=range&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchKeywords</uniqueId>
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml
index e52d6cd8f3..1f90a947fa 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml
@@ -11,12 +11,14 @@
<documentation>Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br /&gt;&lt;br /&gt;This report lists the Search Keywords that did not return any Search result: maybe the search engine algorithm can be improved, or maybe your visitors are looking for content that is not (yet) on your website?</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
- <exit_rate>% Search Exits</exit_rate>
</metrics>
<metricsDocumentation>
<nb_visits>The number of visits that searched for this keyword on your website's search engine.</nb_visits>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <exit_rate>% Search Exits</exit_rate>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchNoResultKeywords</uniqueId>
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml
index 63ba94eaf9..8619ee693c 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml
@@ -11,12 +11,14 @@
<documentation>Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br /&gt;&lt;br /&gt;This report lists the Search Keywords that did not return any Search result: maybe the search engine algorithm can be improved, or maybe your visitors are looking for content that is not (yet) on your website?</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
- <exit_rate>% Search Exits</exit_rate>
</metrics>
<metricsDocumentation>
<nb_visits>The number of visits that searched for this keyword on your website's search engine.</nb_visits>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <exit_rate>% Search Exits</exit_rate>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=range&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchNoResultKeywords</uniqueId>
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_day.xml
index 77af413fc5..9a97a11562 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_day.xml
@@ -16,7 +16,6 @@
<nb_uniq_outlinks>Unique Outlinks</nb_uniq_outlinks>
<nb_searches>Searches</nb_searches>
<nb_keywords>Unique Keywords</nb_keywords>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_pageviews>The number of times this page was visited.</nb_pageviews>
@@ -26,8 +25,10 @@
<nb_outlinks>The number of times this link was clicked.</nb_outlinks>
<nb_uniq_outlinks>The number of visits that involved a click on this link. If a link was clicked multiple times during one visit, it is only counted once.</nb_uniq_outlinks>
<nb_searches>The number of visits that searched for this keyword on your website's search engine.</nb_searches>
- <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=get&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=get&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>Actions_get</uniqueId>
@@ -41,7 +42,6 @@
<nb_uniq_outlinks>Unique Outlinks</nb_uniq_outlinks>
<nb_searches>Searches</nb_searches>
<nb_keywords>Unique Keywords</nb_keywords>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
<reportData>
<result prettyDate="Sunday 3 January 2010">
@@ -53,7 +53,6 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>5</nb_searches>
<nb_keywords>3</nb_keywords>
- <avg_time_generation>0s</avg_time_generation>
</result>
<result prettyDate="Monday 4 January 2010">
<nb_pageviews>0</nb_pageviews>
@@ -64,7 +63,6 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>3</nb_searches>
<nb_keywords>3</nb_keywords>
- <avg_time_generation>0s</avg_time_generation>
</result>
<result prettyDate="Tuesday 5 January 2010" />
<result prettyDate="Wednesday 6 January 2010" />
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_month.xml
index 1b0f9d2bec..c62212321d 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_month.xml
@@ -16,7 +16,6 @@
<nb_uniq_outlinks>Unique Outlinks</nb_uniq_outlinks>
<nb_searches>Searches</nb_searches>
<nb_keywords>Unique Keywords</nb_keywords>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_pageviews>The number of times this page was visited.</nb_pageviews>
@@ -26,8 +25,10 @@
<nb_outlinks>The number of times this link was clicked.</nb_outlinks>
<nb_uniq_outlinks>The number of visits that involved a click on this link. If a link was clicked multiple times during one visit, it is only counted once.</nb_uniq_outlinks>
<nb_searches>The number of visits that searched for this keyword on your website's search engine.</nb_searches>
- <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=get&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=get&amp;period=month&amp;date=2010-01-03,2010-07-03</imageGraphEvolutionUrl>
<uniqueId>Actions_get</uniqueId>
@@ -41,7 +42,6 @@
<nb_uniq_outlinks>Unique Outlinks</nb_uniq_outlinks>
<nb_searches>Searches</nb_searches>
<nb_keywords>Unique Keywords</nb_keywords>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
<reportData>
<result prettyDate="2010, January">
@@ -53,7 +53,6 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>8</nb_searches>
<nb_keywords>5</nb_keywords>
- <avg_time_generation>0s</avg_time_generation>
</result>
<result prettyDate="2010, February" />
<result prettyDate="2010, March" />
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_day.xml
index 13c2a7e8ac..17aad549b7 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_day.xml
@@ -10,7 +10,6 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>5</nb_searches>
<nb_keywords>3</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
</result>
<result date="2010-01-04">
<nb_pageviews>0</nb_pageviews>
@@ -21,7 +20,6 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>3</nb_searches>
<nb_keywords>3</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
</result>
<result date="2010-01-05" />
<result date="2010-01-06" />
@@ -39,7 +37,6 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>3</nb_searches>
<nb_keywords>3</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
</result>
<result date="2010-01-04" />
<result date="2010-01-05" />
@@ -58,7 +55,6 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>0</nb_searches>
<nb_keywords>0</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
</result>
<result date="2010-01-04" />
<result date="2010-01-05" />
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_month.xml
index d078913108..9f2910f086 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_month.xml
@@ -10,7 +10,6 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>8</nb_searches>
<nb_keywords>5</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
</result>
<result date="2010-02" />
<result date="2010-03" />
@@ -29,7 +28,6 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>3</nb_searches>
<nb_keywords>3</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
</result>
<result date="2010-02" />
<result date="2010-03" />
@@ -48,7 +46,6 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>0</nb_searches>
<nb_keywords>0</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
</result>
<result date="2010-02" />
<result date="2010-03" />
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
index 349f30ef0e..ea51e28ebb 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
@@ -8,7 +8,7 @@
<module>CustomVariables</module>
<action>getCustomVariables</action>
<dimension>Custom Variable name</dimension>
- <documentation>This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. &lt;br /&gt; For more information about Custom Variables in general, read the &lt;a href=&quot;http://piwik.org/docs/custom-variables/&quot; target=&quot;_blank&quot;&gt;Custom Variables documentation on piwik.org&lt;/a&gt;</documentation>
+ <documentation>This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. &lt;br /&gt; For more information about Custom Variables in general, read the &lt;a href=&quot;http://piwik.org/docs/custom-variables/&quot; rel=&quot;noreferrer&quot; target=&quot;_blank&quot;&gt;Custom Variables documentation on piwik.org&lt;/a&gt;</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
index d2c8572231..5b5894b0f2 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
@@ -8,7 +8,7 @@
<module>CustomVariables</module>
<action>getCustomVariables</action>
<dimension>Custom Variable name</dimension>
- <documentation>This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. &lt;br /&gt; For more information about Custom Variables in general, read the &lt;a href=&quot;http://piwik.org/docs/custom-variables/&quot; target=&quot;_blank&quot;&gt;Custom Variables documentation on piwik.org&lt;/a&gt;</documentation>
+ <documentation>This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. &lt;br /&gt; For more information about Custom Variables in general, read the &lt;a href=&quot;http://piwik.org/docs/custom-variables/&quot; rel=&quot;noreferrer&quot; target=&quot;_blank&quot;&gt;Custom Variables documentation on piwik.org&lt;/a&gt;</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_actions>Actions</nb_actions>
@@ -51,7 +51,7 @@
<label>_pk_scount</label>
<nb_visits>7</nb_visits>
<nb_actions>9</nb_actions>
- <nb_actions_per_visit>1.29</nb_actions_per_visit>
+ <nb_actions_per_visit>1.3</nb_actions_per_visit>
<avg_time_on_site>00:00:00</avg_time_on_site>
<bounce_rate>0%</bounce_rate>
<revenue>$ 0</revenue>
@@ -60,7 +60,7 @@
<label>_pk_scat</label>
<nb_visits>4</nb_visits>
<nb_actions>5</nb_actions>
- <nb_actions_per_visit>1.25</nb_actions_per_visit>
+ <nb_actions_per_visit>1.3</nb_actions_per_visit>
<avg_time_on_site>00:00:00</avg_time_on_site>
<bounce_rate>0%</bounce_rate>
<revenue>$ 0</revenue>
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_day.xml
index f125336842..a5e5d16d73 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_day.xml
@@ -8,5 +8,4 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>5</nb_searches>
<nb_keywords>3</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_month.xml
index 9d598b649a..f1ac621851 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_month.xml
@@ -8,5 +8,4 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>8</nb_searches>
<nb_keywords>5</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
index 7d8be22272..6d2cd7c44f 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
@@ -12,19 +12,21 @@
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_page>Avg. time on page</avg_time_on_page>
- <exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_hits>The number of times this page was visited.</nb_hits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
- <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
@@ -34,8 +36,8 @@
<label>Page Name</label>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
<exit_rate>Exit rate</exit_rate>
<avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
@@ -45,8 +47,8 @@
<label> first page view</label>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>50%</exit_rate>
<avg_time_generation>0.14s</avg_time_generation>
</row>
@@ -56,8 +58,8 @@
<label>Page Name not defined</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.22s</avg_time_generation>
</row>
@@ -67,8 +69,8 @@
<label>second visitor</label>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:07:30</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:07:30</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.25s</avg_time_generation>
</row>
@@ -76,8 +78,8 @@
<label>Checkout</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.45s</avg_time_generation>
</row>
@@ -87,8 +89,8 @@
<label>second visitor</label>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:07:30</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:07:30</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.25s</avg_time_generation>
</row>
@@ -96,8 +98,8 @@
<label>Checkout</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.45s</avg_time_generation>
</row>
@@ -107,8 +109,8 @@
<label>second visitor</label>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:07:30</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:07:30</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.25s</avg_time_generation>
</row>
@@ -116,8 +118,8 @@
<label>Checkout</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.45s</avg_time_generation>
</row>
@@ -127,8 +129,8 @@
<label>second visitor</label>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:07:30</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:07:30</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.25s</avg_time_generation>
</row>
@@ -136,8 +138,8 @@
<label>Checkout</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.45s</avg_time_generation>
</row>
@@ -147,8 +149,8 @@
<label>second visitor</label>
<nb_visits>2</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:07:30</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:07:30</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.25s</avg_time_generation>
</row>
@@ -156,8 +158,8 @@
<label>Checkout</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.45s</avg_time_generation>
</row>
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
index dfccc81659..1ce5abef77 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
@@ -12,19 +12,21 @@
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_page>Avg. time on page</avg_time_on_page>
- <exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_hits>The number of times this page was visited.</nb_hits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
- <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
@@ -34,8 +36,8 @@
<label>Page URL</label>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
<avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
<exit_rate>Exit rate</exit_rate>
<avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
@@ -45,8 +47,8 @@
<label>/index.htm</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.12s</avg_time_generation>
</row>
@@ -54,8 +56,8 @@
<label>/products</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>100%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.15s</avg_time_generation>
</row>
@@ -65,8 +67,8 @@
<label>Page URL not defined</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.22s</avg_time_generation>
</row>
@@ -76,8 +78,8 @@
<label>/index.htm</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:06:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:06:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.32s</avg_time_generation>
</row>
@@ -85,8 +87,8 @@
<label>/thankyou</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:06:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:06:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.31s</avg_time_generation>
</row>
@@ -94,8 +96,8 @@
<label>Page URL not defined</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0s</avg_time_generation>
</row>
@@ -105,8 +107,8 @@
<label>/index.htm</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:06:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:06:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.32s</avg_time_generation>
</row>
@@ -114,8 +116,8 @@
<label>/thankyou</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:06:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:06:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.31s</avg_time_generation>
</row>
@@ -123,8 +125,8 @@
<label>Page URL not defined</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0s</avg_time_generation>
</row>
@@ -134,8 +136,8 @@
<label>/index.htm</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:06:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:06:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.32s</avg_time_generation>
</row>
@@ -143,8 +145,8 @@
<label>/thankyou</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:06:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:06:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.31s</avg_time_generation>
</row>
@@ -152,8 +154,8 @@
<label>Page URL not defined</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0s</avg_time_generation>
</row>
@@ -163,8 +165,8 @@
<label>/index.htm</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:06:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:06:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.32s</avg_time_generation>
</row>
@@ -172,8 +174,8 @@
<label>/thankyou</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:06:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:06:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.31s</avg_time_generation>
</row>
@@ -181,8 +183,8 @@
<label>Page URL not defined</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0s</avg_time_generation>
</row>
@@ -192,8 +194,8 @@
<label>/index.htm</label>
<nb_visits>1</nb_visits>
<nb_hits>1</nb_hits>
- <avg_time_on_page>00:06:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:06:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.32s</avg_time_generation>
</row>
@@ -201,8 +203,8 @@
<label>/thankyou</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:06:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:06:00</avg_time_on_page>
<exit_rate>100%</exit_rate>
<avg_time_generation>0.31s</avg_time_generation>
</row>
@@ -210,8 +212,8 @@
<label>Page URL not defined</label>
<nb_visits>1</nb_visits>
<nb_hits>2</nb_hits>
- <avg_time_on_page>00:00:00</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
+ <avg_time_on_page>00:00:00</avg_time_on_page>
<exit_rate>0%</exit_rate>
<avg_time_generation>0s</avg_time_generation>
</row>
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml
index 31f9f11927..aabc0dcb25 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml
@@ -10,25 +10,27 @@
<dimension>Website</dimension>
<metrics>
<nb_visits>Visits</nb_visits>
- <visits_evolution>Visits Evolution</visits_evolution>
<nb_actions>Actions</nb_actions>
- <actions_evolution>Actions Evolution</actions_evolution>
<nb_pageviews>Pageviews</nb_pageviews>
- <pageviews_evolution>Pageviews Evolution</pageviews_evolution>
<revenue>Revenue</revenue>
- <revenue_evolution>Revenue Evolution</revenue_evolution>
<nb_conversions>Conversions</nb_conversions>
- <nb_conversions_evolution>Conversions Evolution</nb_conversions_evolution>
<orders>Ecommerce Orders</orders>
- <orders_evolution>Ecommerce Orders Evolution</orders_evolution>
<ecommerce_revenue>Product Revenue</ecommerce_revenue>
- <ecommerce_revenue_evolution>Product Revenue Evolution</ecommerce_revenue_evolution>
</metrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
<nb_pageviews>The number of times this page was visited.</nb_pageviews>
</metricsDocumentation>
+ <processedMetrics>
+ <visits_evolution>Visits Evolution</visits_evolution>
+ <actions_evolution>Actions Evolution</actions_evolution>
+ <pageviews_evolution>Pageviews Evolution</pageviews_evolution>
+ <revenue_evolution>Revenue Evolution</revenue_evolution>
+ <nb_conversions_evolution>Conversions Evolution</nb_conversions_evolution>
+ <orders_evolution>Ecommerce Orders Evolution</orders_evolution>
+ <ecommerce_revenue_evolution>Product Revenue Evolution</ecommerce_revenue_evolution>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getAll&amp;period=range&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getAll&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>MultiSites_getAll</uniqueId>
@@ -36,18 +38,18 @@
<columns>
<label>Website</label>
<nb_visits>Visits</nb_visits>
- <visits_evolution>Visits Evolution</visits_evolution>
<nb_actions>Actions</nb_actions>
- <actions_evolution>Actions Evolution</actions_evolution>
<nb_pageviews>Pageviews</nb_pageviews>
- <pageviews_evolution>Pageviews Evolution</pageviews_evolution>
<revenue>Revenue</revenue>
- <revenue_evolution>Revenue Evolution</revenue_evolution>
<nb_conversions>Conversions</nb_conversions>
- <nb_conversions_evolution>Conversions Evolution</nb_conversions_evolution>
<orders>Ecommerce Orders</orders>
- <orders_evolution>Ecommerce Orders Evolution</orders_evolution>
<ecommerce_revenue>Product Revenue</ecommerce_revenue>
+ <visits_evolution>Visits Evolution</visits_evolution>
+ <actions_evolution>Actions Evolution</actions_evolution>
+ <pageviews_evolution>Pageviews Evolution</pageviews_evolution>
+ <revenue_evolution>Revenue Evolution</revenue_evolution>
+ <nb_conversions_evolution>Conversions Evolution</nb_conversions_evolution>
+ <orders_evolution>Ecommerce Orders Evolution</orders_evolution>
<ecommerce_revenue_evolution>Product Revenue Evolution</ecommerce_revenue_evolution>
</columns>
<reportData>
@@ -63,10 +65,10 @@
<pageviews_evolution>100%</pageviews_evolution>
<revenue_evolution>100%</revenue_evolution>
<nb_conversions>0</nb_conversions>
- <nb_conversions_evolution>0</nb_conversions_evolution>
<orders>0</orders>
- <orders_evolution>0</orders_evolution>
<ecommerce_revenue>$ 0</ecommerce_revenue>
+ <nb_conversions_evolution>0</nb_conversions_evolution>
+ <orders_evolution>0</orders_evolution>
<ecommerce_revenue_evolution>0</ecommerce_revenue_evolution>
</row>
</result>
@@ -82,10 +84,10 @@
<pageviews_evolution>-50%</pageviews_evolution>
<revenue_evolution>-100%</revenue_evolution>
<nb_conversions>0</nb_conversions>
- <nb_conversions_evolution>0</nb_conversions_evolution>
<orders>0</orders>
- <orders_evolution>0</orders_evolution>
<ecommerce_revenue>$ 0</ecommerce_revenue>
+ <nb_conversions_evolution>0</nb_conversions_evolution>
+ <orders_evolution>0</orders_evolution>
<ecommerce_revenue_evolution>0</ecommerce_revenue_evolution>
</row>
<row>
@@ -99,10 +101,10 @@
<pageviews_evolution>100%</pageviews_evolution>
<revenue_evolution>0%</revenue_evolution>
<nb_conversions>0</nb_conversions>
- <nb_conversions_evolution>0</nb_conversions_evolution>
<orders>0</orders>
- <orders_evolution>0</orders_evolution>
<ecommerce_revenue>$ 0</ecommerce_revenue>
+ <nb_conversions_evolution>0</nb_conversions_evolution>
+ <orders_evolution>0</orders_evolution>
<ecommerce_revenue_evolution>0</ecommerce_revenue_evolution>
</row>
</result>
@@ -118,10 +120,10 @@
<pageviews_evolution>400%</pageviews_evolution>
<revenue_evolution>100%</revenue_evolution>
<nb_conversions>0</nb_conversions>
- <nb_conversions_evolution>0</nb_conversions_evolution>
<orders>0</orders>
- <orders_evolution>0</orders_evolution>
<ecommerce_revenue>$ 0</ecommerce_revenue>
+ <nb_conversions_evolution>0</nb_conversions_evolution>
+ <orders_evolution>0</orders_evolution>
<ecommerce_revenue_evolution>0</ecommerce_revenue_evolution>
</row>
</result>
@@ -137,10 +139,10 @@
<pageviews_evolution>0%</pageviews_evolution>
<revenue_evolution>0%</revenue_evolution>
<nb_conversions>0</nb_conversions>
- <nb_conversions_evolution>0</nb_conversions_evolution>
<orders>0</orders>
- <orders_evolution>0</orders_evolution>
<ecommerce_revenue>$ 0</ecommerce_revenue>
+ <nb_conversions_evolution>0</nb_conversions_evolution>
+ <orders_evolution>0</orders_evolution>
<ecommerce_revenue_evolution>0</ecommerce_revenue_evolution>
</row>
</result>
@@ -156,10 +158,10 @@
<pageviews_evolution>0%</pageviews_evolution>
<revenue_evolution>0%</revenue_evolution>
<nb_conversions>0</nb_conversions>
- <nb_conversions_evolution>0</nb_conversions_evolution>
<orders>0</orders>
- <orders_evolution>0</orders_evolution>
<ecommerce_revenue>$ 0</ecommerce_revenue>
+ <nb_conversions_evolution>0</nb_conversions_evolution>
+ <orders_evolution>0</orders_evolution>
<ecommerce_revenue_evolution>0</ecommerce_revenue_evolution>
</row>
</result>
@@ -175,10 +177,10 @@
<pageviews_evolution>0%</pageviews_evolution>
<revenue_evolution>0%</revenue_evolution>
<nb_conversions>0</nb_conversions>
- <nb_conversions_evolution>0</nb_conversions_evolution>
<orders>0</orders>
- <orders_evolution>0</orders_evolution>
<ecommerce_revenue>$ 0</ecommerce_revenue>
+ <nb_conversions_evolution>0</nb_conversions_evolution>
+ <orders_evolution>0</orders_evolution>
<ecommerce_revenue_evolution>0</ecommerce_revenue_evolution>
</row>
</result>
@@ -194,10 +196,10 @@
<pageviews_evolution>0%</pageviews_evolution>
<revenue_evolution>0%</revenue_evolution>
<nb_conversions>0</nb_conversions>
- <nb_conversions_evolution>0</nb_conversions_evolution>
<orders>0</orders>
- <orders_evolution>0</orders_evolution>
<ecommerce_revenue>$ 0</ecommerce_revenue>
+ <nb_conversions_evolution>0</nb_conversions_evolution>
+ <orders_evolution>0</orders_evolution>
<ecommerce_revenue_evolution>0</ecommerce_revenue_evolution>
</row>
</result>
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_day.xml
index 6dc2190ded..13d4b19d4b 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_day.xml
@@ -3,8 +3,8 @@
<result idSite="1">
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>100</conversion_rate>
<revenue>10</revenue>
+ <conversion_rate>100%</conversion_rate>
</result>
<result idSite="2" />
</results> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_month.xml
index 5c85081c9f..11701117f1 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_month.xml
@@ -3,13 +3,13 @@
<result idSite="1">
<nb_conversions>14</nb_conversions>
<nb_visits_converted>10</nb_visits_converted>
- <conversion_rate>100</conversion_rate>
<revenue>50</revenue>
+ <conversion_rate>100%</conversion_rate>
</result>
<result idSite="2">
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>100</conversion_rate>
<revenue>0</revenue>
+ <conversion_rate>100%</conversion_rate>
</result>
</results> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_day.xml
index 1c7f2179e5..12226c72f5 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_day.xml
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<results>
- <result idSite="1" />
+ <result idSite="1">
+ <nb_conversions>0</nb_conversions>
+ <nb_visits_converted>0</nb_visits_converted>
+ <revenue>0</revenue>
+ <conversion_rate>0%</conversion_rate>
+ </result>
<result idSite="2" />
</results> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_month.xml
index 1c7f2179e5..6a88282877 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_month.xml
@@ -1,5 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<results>
- <result idSite="1" />
- <result idSite="2" />
+ <result idSite="1">
+ <nb_conversions>0</nb_conversions>
+ <nb_visits_converted>0</nb_visits_converted>
+ <revenue>0</revenue>
+ <conversion_rate>0%</conversion_rate>
+ </result>
+ <result idSite="2">
+ <nb_conversions>0</nb_conversions>
+ <nb_visits_converted>0</nb_visits_converted>
+ <revenue>0</revenue>
+ <conversion_rate>0%</conversion_rate>
+ </result>
</results> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml
index 0c51c09208..dae913cd1b 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml
@@ -10,15 +10,15 @@
<metrics>
<nb_visits_returning>Returning Visits</nb_visits_returning>
<nb_actions_returning>Actions by Returning Visits</nb_actions_returning>
- <avg_time_on_site_returning>Avg. Duration of a Returning Visit (in sec)</avg_time_on_site_returning>
- <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning>
- <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning>
<nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning>
- <sum_visit_length_returning>Total time spent by returning visitors (in seconds)</sum_visit_length_returning>
<nb_users_returning>Returning Users</nb_users_returning>
- <nb_visits_converted_returning>Number of converted returning visits</nb_visits_converted_returning>
<max_actions_returning>Maximum actions in one returning visit</max_actions_returning>
</metrics>
+ <processedMetrics>
+ <avg_time_on_site_returning>Avg. Duration of a Returning Visit (in sec)</avg_time_on_site_returning>
+ <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning>
+ <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitFrequency&amp;apiAction=get&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitFrequency&amp;apiAction=get&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>VisitFrequency_get</uniqueId>
@@ -26,14 +26,12 @@
<columns>
<nb_visits_returning>Returning Visits</nb_visits_returning>
<nb_actions_returning>Actions by Returning Visits</nb_actions_returning>
- <avg_time_on_site_returning>Avg. Duration of a Returning Visit (in sec)</avg_time_on_site_returning>
- <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning>
- <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning>
<nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning>
- <sum_visit_length_returning>Total time spent by returning visitors (in seconds)</sum_visit_length_returning>
<nb_users_returning>Returning Users</nb_users_returning>
- <nb_visits_converted_returning>Number of converted returning visits</nb_visits_converted_returning>
<max_actions_returning>Maximum actions in one returning visit</max_actions_returning>
+ <avg_time_on_site_returning>Avg. Duration of a Returning Visit (in sec)</avg_time_on_site_returning>
+ <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning>
+ <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning>
</columns>
<reportData>
<result prettyDate="Sunday 3 January 2010" />
@@ -43,8 +41,6 @@
<nb_users_returning>0</nb_users_returning>
<nb_visits_returning>1</nb_visits_returning>
<nb_actions_returning>5</nb_actions_returning>
- <nb_visits_converted_returning>0</nb_visits_converted_returning>
- <sum_visit_length_returning>901</sum_visit_length_returning>
<max_actions_returning>5</max_actions_returning>
<bounce_rate_returning>0%</bounce_rate_returning>
<nb_actions_per_visit_returning>5</nb_actions_per_visit_returning>
@@ -55,8 +51,6 @@
<nb_users_returning>0</nb_users_returning>
<nb_visits_returning>1</nb_visits_returning>
<nb_actions_returning>5</nb_actions_returning>
- <nb_visits_converted_returning>0</nb_visits_converted_returning>
- <sum_visit_length_returning>901</sum_visit_length_returning>
<max_actions_returning>5</max_actions_returning>
<bounce_rate_returning>0%</bounce_rate_returning>
<nb_actions_per_visit_returning>5</nb_actions_per_visit_returning>
@@ -67,8 +61,6 @@
<nb_users_returning>0</nb_users_returning>
<nb_visits_returning>1</nb_visits_returning>
<nb_actions_returning>5</nb_actions_returning>
- <nb_visits_converted_returning>0</nb_visits_converted_returning>
- <sum_visit_length_returning>901</sum_visit_length_returning>
<max_actions_returning>5</max_actions_returning>
<bounce_rate_returning>0%</bounce_rate_returning>
<nb_actions_per_visit_returning>5</nb_actions_per_visit_returning>
@@ -79,8 +71,6 @@
<nb_users_returning>0</nb_users_returning>
<nb_visits_returning>1</nb_visits_returning>
<nb_actions_returning>5</nb_actions_returning>
- <nb_visits_converted_returning>0</nb_visits_converted_returning>
- <sum_visit_length_returning>901</sum_visit_length_returning>
<max_actions_returning>5</max_actions_returning>
<bounce_rate_returning>0%</bounce_rate_returning>
<nb_actions_per_visit_returning>5</nb_actions_per_visit_returning>
@@ -91,8 +81,6 @@
<nb_users_returning>0</nb_users_returning>
<nb_visits_returning>1</nb_visits_returning>
<nb_actions_returning>5</nb_actions_returning>
- <nb_visits_converted_returning>0</nb_visits_converted_returning>
- <sum_visit_length_returning>901</sum_visit_length_returning>
<max_actions_returning>5</max_actions_returning>
<bounce_rate_returning>0%</bounce_rate_returning>
<nb_actions_per_visit_returning>5</nb_actions_per_visit_returning>
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml
index 0e48ca569f..8c6861a211 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml
@@ -12,9 +12,6 @@
<nb_visits>Visits</nb_visits>
<nb_users>Users</nb_users>
<nb_actions>Actions</nb_actions>
- <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_site>Avg. Visit Duration (in seconds)</avg_time_on_site>
<max_actions>Maximum actions in one visit</max_actions>
</metrics>
<metricsDocumentation>
@@ -22,10 +19,15 @@
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_users>The number of users logged in your website. It is the number of unique active users that have a User ID set (via the Tracking code function 'setUserId').</nb_users>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
<bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
+ <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
<avg_time_on_site>The average duration of a visit.</avg_time_on_site>
</metricsDocumentation>
+ <processedMetrics>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit>
+ <avg_time_on_site>Avg. Visit Duration (in seconds)</avg_time_on_site>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitsSummary&amp;apiAction=get&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitsSummary&amp;apiAction=get&amp;period=day&amp;date=2010-01-03,2010-01-09</imageGraphEvolutionUrl>
<uniqueId>VisitsSummary_get</uniqueId>
@@ -35,10 +37,10 @@
<nb_visits>Visits</nb_visits>
<nb_users>Users</nb_users>
<nb_actions>Actions</nb_actions>
- <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit>
+ <max_actions>Maximum actions in one visit</max_actions>
<bounce_rate>Bounce Rate</bounce_rate>
+ <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit>
<avg_time_on_site>Avg. Visit Duration (in seconds)</avg_time_on_site>
- <max_actions>Maximum actions in one visit</max_actions>
</columns>
<reportData>
<result prettyDate="Sunday 3 January 2010">
@@ -47,9 +49,9 @@
<nb_visits>1</nb_visits>
<nb_actions>1</nb_actions>
<max_actions>1</max_actions>
- <bounce_rate>100%</bounce_rate>
<nb_actions_per_visit>1</nb_actions_per_visit>
<avg_time_on_site>00:00:00</avg_time_on_site>
+ <bounce_rate>100%</bounce_rate>
</result>
<result prettyDate="Monday 4 January 2010">
<nb_uniq_visitors>1</nb_uniq_visitors>
@@ -57,9 +59,9 @@
<nb_visits>1</nb_visits>
<nb_actions>2</nb_actions>
<max_actions>2</max_actions>
- <bounce_rate>0%</bounce_rate>
<nb_actions_per_visit>2</nb_actions_per_visit>
<avg_time_on_site>00:06:01</avg_time_on_site>
+ <bounce_rate>0%</bounce_rate>
</result>
<result prettyDate="Tuesday 5 January 2010">
<nb_uniq_visitors>1</nb_uniq_visitors>
@@ -67,9 +69,9 @@
<nb_visits>1</nb_visits>
<nb_actions>5</nb_actions>
<max_actions>5</max_actions>
- <bounce_rate>0%</bounce_rate>
<nb_actions_per_visit>5</nb_actions_per_visit>
<avg_time_on_site>00:15:01</avg_time_on_site>
+ <bounce_rate>0%</bounce_rate>
</result>
<result prettyDate="Wednesday 6 January 2010">
<nb_uniq_visitors>1</nb_uniq_visitors>
@@ -77,9 +79,9 @@
<nb_visits>1</nb_visits>
<nb_actions>5</nb_actions>
<max_actions>5</max_actions>
- <bounce_rate>0%</bounce_rate>
<nb_actions_per_visit>5</nb_actions_per_visit>
<avg_time_on_site>00:15:01</avg_time_on_site>
+ <bounce_rate>0%</bounce_rate>
</result>
<result prettyDate="Thursday 7 January 2010">
<nb_uniq_visitors>1</nb_uniq_visitors>
@@ -87,9 +89,9 @@
<nb_visits>1</nb_visits>
<nb_actions>5</nb_actions>
<max_actions>5</max_actions>
- <bounce_rate>0%</bounce_rate>
<nb_actions_per_visit>5</nb_actions_per_visit>
<avg_time_on_site>00:15:01</avg_time_on_site>
+ <bounce_rate>0%</bounce_rate>
</result>
<result prettyDate="Friday 8 January 2010">
<nb_uniq_visitors>1</nb_uniq_visitors>
@@ -97,9 +99,9 @@
<nb_visits>1</nb_visits>
<nb_actions>5</nb_actions>
<max_actions>5</max_actions>
- <bounce_rate>0%</bounce_rate>
<nb_actions_per_visit>5</nb_actions_per_visit>
<avg_time_on_site>00:15:01</avg_time_on_site>
+ <bounce_rate>0%</bounce_rate>
</result>
<result prettyDate="Saturday 9 January 2010">
<nb_uniq_visitors>1</nb_uniq_visitors>
@@ -107,9 +109,9 @@
<nb_visits>1</nb_visits>
<nb_actions>5</nb_actions>
<max_actions>5</max_actions>
- <bounce_rate>0%</bounce_rate>
<nb_actions_per_visit>5</nb_actions_per_visit>
<avg_time_on_site>00:15:01</avg_time_on_site>
+ <bounce_rate>0%</bounce_rate>
</result>
</reportData>
<reportMetadata>
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv
index 6671d8d79d..a6f8e9e9fe 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv
@@ -1,11 +1,11 @@
All Websites dashboard
-label,nb_visits,nb_actions,nb_pageviews,revenue,nb_conversions,visits_evolution,actions_evolution,pageviews_evolution,revenue_evolution,nb_conversions_evolution,orders,orders_evolution,ecommerce_revenue,ecommerce_revenue_evolution
-Site 1,10,43,43,$ 0,0,100%,100%,100%,0%,0%,0,0,$ 0,0
-Site 2,1,3,3,$ 0,0,100%,100%,100%,0%,0%,0,0,$ 0,0
+label,nb_visits,nb_actions,nb_pageviews,revenue,nb_conversions,visits_evolution,actions_evolution,pageviews_evolution,revenue_evolution,nb_conversions_evolution,orders,ecommerce_revenue,orders_evolution,ecommerce_revenue_evolution
+Site 1,10,43,43,$ 0,0,100%,100%,100%,0%,0%,0,$ 0,0,0
+Site 2,1,3,3,$ 0,0,100%,100%,100%,0%,0%,0,$ 0,0,0
Visits Summary
-nb_uniq_visitors,nb_users,nb_visits,nb_actions,max_actions,bounce_rate,nb_actions_per_visit,avg_time_on_site
-2,0,10,43,5,10%,4.3,00:12:37
+nb_uniq_visitors,nb_users,nb_visits,nb_actions,max_actions,nb_actions_per_visit,avg_time_on_site,bounce_rate
+2,0,10,43,5,4.3,00:12:37,10%
Visits by Server Time
label,nb_visits,nb_actions,nb_actions_per_visit,avg_time_on_site,bounce_rate,revenue
@@ -73,7 +73,7 @@ Sunday,2,6,0%,3,00:07:31,50%
Screen Resolution
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
-800x300,9,41,0%,4.56,00:13:21,11.11%
+800x300,9,41,0%,4.6,00:13:21,11%
1024x768,1,2,0%,2,00:06:01,0%
Browser Plugins
@@ -91,7 +91,7 @@ Windowsmedia,0,0%
Normal / Widescreen
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
-Dual,9,41,0%,4.56,00:13:21,11.11%
+Dual,9,41,0%,4.6,00:13:21,11%
Normal,1,2,0%,2,00:06:01,0%
Visitor Configuration
@@ -115,38 +115,38 @@ nb_pageviews,nb_uniq_pageviews,nb_downloads,nb_uniq_downloads,nb_outlinks,nb_uni
43,27,0,0,0,0,0,0,0.3s
Page URLs
-label,nb_visits,nb_hits,avg_time_on_page,bounce_rate,exit_rate,avg_time_generation
-/index.htm,9,9,00:05:20,0%,0%,0.3s
-Page URL not defined,9,17,00:00:00,0%,0%,0.22s
-/thankyou,8,16,00:06:00,0%,100%,0.31s
-/products,1,1,00:00:00,100%,100%,0.15s
+label,nb_visits,nb_hits,bounce_rate,avg_time_on_page,exit_rate,avg_time_generation
+/index.htm,9,9,0%,00:05:20,0%,0.3s
+Page URL not defined,9,17,0%,00:00:00,0%,0.22s
+/thankyou,8,16,0%,00:06:00,100%,0.31s
+/products,1,1,100%,00:00:00,100%,0.15s
Entry pages
-label,entry_nb_visits,entry_bounce_count,bounce_rate
-/index.htm,8,0,0%
-/products,1,1,100%
+label,entry_nb_visits,entry_bounce_count,bounce_rate,avg_time_generation
+/index.htm,8,0,0%,0.3s
+/products,1,1,100%,0.15s
Exit pages
-label,nb_visits,exit_nb_visits,exit_rate
-/thankyou,8,8,100%
-/products,1,1,100%
+label,nb_visits,exit_nb_visits,exit_rate,avg_time_generation
+/thankyou,8,8,100%,0.31s
+/products,1,1,100%,0.15s
Page titles
-label,nb_visits,nb_hits,avg_time_on_page,bounce_rate,exit_rate,avg_time_generation
-second visitor,16,16,00:07:30,0%,0%,0.25s
-Checkout,8,8,00:00:00,0%,100%,0.45s
- first page view,2,2,00:00:00,100%,50%,0.14s
-Page Name not defined,1,1,00:00:00,0%,0%,0.22s
+label,nb_visits,nb_hits,bounce_rate,avg_time_on_page,exit_rate,avg_time_generation
+second visitor,16,16,0%,00:07:30,0%,0.25s
+Checkout,8,8,0%,00:00:00,100%,0.45s
+ first page view,2,2,100%,00:00:00,50%,0.14s
+Page Name not defined,1,1,0%,00:00:00,0%,0.22s
Entry page titles
-label,entry_nb_visits,entry_bounce_count,bounce_rate
-second visitor,8,0,0%
- first page view,1,1,100%
+label,entry_nb_visits,entry_bounce_count,bounce_rate,avg_time_generation
+second visitor,8,0,0%,0.25s
+ first page view,1,1,100%,0.14s
Exit page titles
-label,nb_visits,exit_nb_visits,exit_rate
-Checkout,8,8,100%
- first page view,2,1,50%
+label,nb_visits,exit_nb_visits,exit_rate,avg_time_generation
+Checkout,8,8,100%,0.45s
+ first page view,2,1,50%,0.14s
Outlinks
No data available
@@ -213,8 +213,8 @@ Social Networks
No data available
Goals
-nb_conversions,nb_visits_converted,conversion_rate,revenue
-0,0,0%,$ 0
+nb_conversions,nb_visits_converted,revenue,conversion_rate
+0,0,$ 0,0%
Visits to Conversion
No data available
@@ -305,8 +305,8 @@ New visits,2
365+ days,0
Returning Visits
-nb_uniq_visitors_returning,nb_users_returning,nb_visits_returning,nb_actions_returning,nb_visits_converted_returning,sum_visit_length_returning,max_actions_returning,bounce_rate_returning,nb_actions_per_visit_returning,avg_time_on_site_returning
-1,0,8,40,0,7208,5,0%,5,00:15:01
+nb_uniq_visitors_returning,nb_users_returning,nb_visits_returning,nb_actions_returning,max_actions_returning,bounce_rate_returning,nb_actions_per_visit_returning,avg_time_on_site_returning
+1,0,8,40,5,0%,5,00:15:01
Provider
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
@@ -317,26 +317,26 @@ label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site
Unknown,8,40,0%,5,00:15:01,0%
Desktop,2,3,0%,1.5,00:03:01,50%
-Device brand
-label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
-Unknown,10,43,0%,4.3,00:12:37,10%
-
Visitor Browser
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
Unknown,8,40,0%,5,00:15:01,0%
Firefox,1,2,0%,2,00:06:01,0%
Opera,1,1,0%,1,00:00:00,100%
-Browser version
+Device brand
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
-Unknown,8,40,0%,5,00:15:01,0%
-Firefox 3.6,1,2,0%,2,00:06:01,0%
-Opera 9.63,1,1,0%,1,00:00:00,100%
+Unknown,10,43,0%,4.3,00:12:37,10%
Device model
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
Unknown,10,43,0%,4.3,00:12:37,10%
+Browser version
+label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
+Unknown,8,40,0%,5,00:15:01,0%
+Firefox 3.6,1,2,0%,2,00:06:01,0%
+Opera 9.63,1,1,0%,1,00:00:00,100%
+
Operating System families
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
Unknown,8,40,0%,5,00:15:01,0%
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html
index 15141b271a..560e7ebe33 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html
@@ -266,7 +266,7 @@
</li>
<li>
<a href="#DevicesDetection_getBrowserVersions" style="text-decoration:none; color: rgb(68,68,68);">
- Browser version
+ Browser Version
</a>
</li>
<li>
@@ -4890,7 +4890,7 @@
Back to top
</a>
<h2 id="DevicesDetection_getBrowserVersions" style="color: rgb(126,115,99); font-size: 11pt;">
- Browser version
+ Browser Version
</h2>
<img alt=""
diff --git a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
index 5f93dac2dc..3454389180 100644
--- a/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
@@ -4,7 +4,7 @@
</head>
<body style="color: rgb(68,68,68);">
-<a id="reportTop" target="_blank" href=""><img title="Go to Piwik" border="0" alt="Piwik" src='plugins/Morpheus/images/logo-header.png'/></a>
+<a id="reportTop" rel="noreferrer" target="_blank" href=""><img title="Go to Piwik" border="0" alt="Piwik" src='plugins/Morpheus/images/logo-header.png'/></a>
<h1 style="color: rgb(126,115,99); font-size: 11pt;">
Site 1
@@ -280,18 +280,13 @@
</a>
</li>
<li>
- <a href="#DevicesDetection_getBrand" style="text-decoration:none; color: rgb(68,68,68);">
- Device brand
- </a>
- </li>
- <li>
<a href="#DevicesDetection_getBrowsers" style="text-decoration:none; color: rgb(68,68,68);">
Visitor Browser
</a>
</li>
<li>
- <a href="#DevicesDetection_getBrowserVersions" style="text-decoration:none; color: rgb(68,68,68);">
- Browser version
+ <a href="#DevicesDetection_getBrand" style="text-decoration:none; color: rgb(68,68,68);">
+ Device brand
</a>
</li>
<li>
@@ -300,6 +295,11 @@
</a>
</li>
<li>
+ <a href="#DevicesDetection_getBrowserVersions" style="text-decoration:none; color: rgb(68,68,68);">
+ Browser version
+ </a>
+ </li>
+ <li>
<a href="#DevicesDetection_getOsFamilies" style="text-decoration:none; color: rgb(68,68,68);">
Operating System families
</a>
@@ -466,25 +466,25 @@
<tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Bounce Rate </td>
+ Actions per Visit </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 10%
+ 4.3
</td>
</tr>
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Actions per Visit </td>
+ Avg. Visit Duration (in seconds) </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 4.3
+ 00:12:37
</td>
</tr>
<tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Avg. Visit Duration (in seconds) </td>
+ Bounce Rate </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:12:37
+ 10%
</td>
</tr>
</tbody>
@@ -1911,13 +1911,13 @@
41
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 4.56
+ 4.6
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
00:13:21
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 11.11%
+ 11%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -2151,13 +2151,13 @@
41
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 4.56
+ 4.6
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
00:13:21
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 11.11%
+ 11%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -2578,10 +2578,10 @@
&nbsp;Unique Pageviews&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Bounce Rate&nbsp;&nbsp;
+ &nbsp;Avg. time on page&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Avg. time on page&nbsp;&nbsp;
+ &nbsp;Bounce Rate&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Exit rate&nbsp;&nbsp;
@@ -2604,10 +2604,10 @@
9
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:05:20
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:05:20
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -2629,10 +2629,10 @@
9
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:00:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:00:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -2654,10 +2654,10 @@
8
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:06:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:06:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
@@ -2679,10 +2679,10 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 100%
+ 00:00:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:00:00
+ 100%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
@@ -2717,6 +2717,9 @@
<th style="padding: 6px 0;">
&nbsp;Bounce Rate&nbsp;&nbsp;
</th>
+ <th style="padding: 6px 0;">
+ &nbsp;Avg. generation time&nbsp;&nbsp;
+ </th>
</thead>
<tbody>
@@ -2734,6 +2737,9 @@
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
</td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 0.3s
+ </td>
</tr>
<tr style="background-color: rgb(249,250,250)">
@@ -2750,6 +2756,9 @@
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
</td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 0.15s
+ </td>
</tr>
</tbody>
</table>
@@ -2777,6 +2786,9 @@
<th style="padding: 6px 0;">
&nbsp;Exit rate&nbsp;&nbsp;
</th>
+ <th style="padding: 6px 0;">
+ &nbsp;Avg. generation time&nbsp;&nbsp;
+ </th>
</thead>
<tbody>
@@ -2794,6 +2806,9 @@
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
</td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 0.31s
+ </td>
</tr>
<tr style="background-color: rgb(249,250,250)">
@@ -2810,6 +2825,9 @@
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
</td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 0.15s
+ </td>
</tr>
</tbody>
</table>
@@ -2835,10 +2853,10 @@
&nbsp;Unique Pageviews&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Bounce Rate&nbsp;&nbsp;
+ &nbsp;Avg. time on page&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Avg. time on page&nbsp;&nbsp;
+ &nbsp;Bounce Rate&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Exit rate&nbsp;&nbsp;
@@ -2859,10 +2877,10 @@
16
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:07:30
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:07:30
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -2882,10 +2900,10 @@
8
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:00:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:00:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
@@ -2905,10 +2923,10 @@
2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 100%
+ 00:00:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:00:00
+ 100%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
50%
@@ -2928,10 +2946,10 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:00:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:00:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -2966,6 +2984,9 @@
<th style="padding: 6px 0;">
&nbsp;Bounce Rate&nbsp;&nbsp;
</th>
+ <th style="padding: 6px 0;">
+ &nbsp;Avg. generation time&nbsp;&nbsp;
+ </th>
</thead>
<tbody>
@@ -2981,6 +3002,9 @@
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
</td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 0.25s
+ </td>
</tr>
<tr style="background-color: rgb(249,250,250)">
@@ -2995,6 +3019,9 @@
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
</td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 0.14s
+ </td>
</tr>
</tbody>
</table>
@@ -3022,6 +3049,9 @@
<th style="padding: 6px 0;">
&nbsp;Exit rate&nbsp;&nbsp;
</th>
+ <th style="padding: 6px 0;">
+ &nbsp;Avg. generation time&nbsp;&nbsp;
+ </th>
</thead>
<tbody>
@@ -3037,6 +3067,9 @@
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
</td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 0.45s
+ </td>
</tr>
<tr style="background-color: rgb(249,250,250)">
@@ -3051,6 +3084,9 @@
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
50%
</td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 0.14s
+ </td>
</tr>
</tbody>
</table>
@@ -3477,17 +3513,17 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Conversion Rate </td>
+ Revenue </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ $ 0
</td>
</tr>
<tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Revenue </td>
+ Conversion Rate </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- $ 0
+ 0%
</td>
</tr>
</tbody>
@@ -4381,22 +4417,6 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Number of converted returning visits </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
- </td>
- </tr>
-
- <tr style="background-color: rgb(249,250,250)">
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Total time spent by returning visitors (in seconds) </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 7208
- </td>
- </tr>
-
- <tr style="">
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
Maximum actions in one returning visit </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
5
@@ -4581,8 +4601,8 @@
<a style="text-decoration:none; color: rgb(126,115,99); font-size: 9pt;" href="#reportTop">
Back to top
</a>
-<h2 id="DevicesDetection_getBrand" style="color: rgb(126,115,99); font-size: 11pt;">
- Device brand
+<h2 id="DevicesDetection_getBrowsers" style="color: rgb(126,115,99); font-size: 11pt;">
+ Visitor Browser
</h2>
@@ -4590,7 +4610,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Device brand&nbsp;&nbsp;
+ &nbsp;Browser&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Visits&nbsp;&nbsp;
@@ -4615,23 +4635,73 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- <img src='plugins/DevicesDetection/images/brand/Unknown.ico'>
+ <img src='plugins/UserSettings/images/browsers/UNK.gif'>
&nbsp;
Unknown </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 10
+ 8
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 43
+ 40
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 4.3
+ 5
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:12:37
+ 00:15:01
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 10%
+ 0%
+ </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 0%
+ </td>
+ </tr>
+
+ <tr style="background-color: rgb(249,250,250)">
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ <img src='plugins/UserSettings/images/browsers/FF.gif'>
+ &nbsp;
+ Firefox </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 1
+ </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 2
+ </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 2
+ </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 00:06:01
+ </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 0%
+ </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 0%
+ </td>
+ </tr>
+
+ <tr style="">
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ <img src='plugins/UserSettings/images/browsers/OP.gif'>
+ &nbsp;
+ Opera </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 1
+ </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 1
+ </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 1
+ </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 00:00:00
+ </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 100%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -4643,8 +4713,8 @@
<a style="text-decoration:none; color: rgb(126,115,99); font-size: 9pt;" href="#reportTop">
Back to top
</a>
-<h2 id="DevicesDetection_getBrowsers" style="color: rgb(126,115,99); font-size: 11pt;">
- Visitor Browser
+<h2 id="DevicesDetection_getBrand" style="color: rgb(126,115,99); font-size: 11pt;">
+ Device brand
</h2>
@@ -4652,7 +4722,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Browser&nbsp;&nbsp;
+ &nbsp;Device brand&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Visits&nbsp;&nbsp;
@@ -4677,73 +4747,83 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- <img src='plugins/UserSettings/images/browsers/UNK.gif'>
+ <img src='plugins/DevicesDetection/images/brand/Unknown.ico'>
&nbsp;
Unknown </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 8
- </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 40
- </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 5
- </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:15:01
- </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
- </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
- </td>
- </tr>
-
- <tr style="background-color: rgb(249,250,250)">
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- <img src='plugins/UserSettings/images/browsers/FF.gif'>
- &nbsp;
- Firefox </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1
+ 10
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 2
+ 43
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 2
+ 4.3
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:06:01
+ 00:12:37
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 10%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
</td>
</tr>
-
+ </tbody>
+ </table>
+ <br/>
+ <a style="text-decoration:none; color: rgb(126,115,99); font-size: 9pt;" href="#reportTop">
+ Back to top
+ </a>
+<h2 id="DevicesDetection_getModel" style="color: rgb(126,115,99); font-size: 11pt;">
+ Device model
+</h2>
+
+
+
+ <table style="border-collapse:collapse; margin-left: 5px;">
+ <thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
+ <th style="padding: 6px 0;">
+ &nbsp;Device model&nbsp;&nbsp;
+ </th>
+ <th style="padding: 6px 0;">
+ &nbsp;Visits&nbsp;&nbsp;
+ </th>
+ <th style="padding: 6px 0;">
+ &nbsp;Actions&nbsp;&nbsp;
+ </th>
+ <th style="padding: 6px 0;">
+ &nbsp;Actions per Visit&nbsp;&nbsp;
+ </th>
+ <th style="padding: 6px 0;">
+ &nbsp;Avg. Time on Website&nbsp;&nbsp;
+ </th>
+ <th style="padding: 6px 0;">
+ &nbsp;Bounce Rate&nbsp;&nbsp;
+ </th>
+ <th style="padding: 6px 0;">
+ &nbsp;Conversion Rate&nbsp;&nbsp;
+ </th>
+ </thead>
+ <tbody>
+
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- <img src='plugins/UserSettings/images/browsers/OP.gif'>
- &nbsp;
- Opera </td>
+ Unknown </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1
+ 10
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1
+ 43
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1
+ 4.3
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:00:00
+ 00:12:37
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 100%
+ 10%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -4867,66 +4947,6 @@
<a style="text-decoration:none; color: rgb(126,115,99); font-size: 9pt;" href="#reportTop">
Back to top
</a>
-<h2 id="DevicesDetection_getModel" style="color: rgb(126,115,99); font-size: 11pt;">
- Device model
-</h2>
-
-
-
- <table style="border-collapse:collapse; margin-left: 5px;">
- <thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
- <th style="padding: 6px 0;">
- &nbsp;Device model&nbsp;&nbsp;
- </th>
- <th style="padding: 6px 0;">
- &nbsp;Visits&nbsp;&nbsp;
- </th>
- <th style="padding: 6px 0;">
- &nbsp;Actions&nbsp;&nbsp;
- </th>
- <th style="padding: 6px 0;">
- &nbsp;Actions per Visit&nbsp;&nbsp;
- </th>
- <th style="padding: 6px 0;">
- &nbsp;Avg. Time on Website&nbsp;&nbsp;
- </th>
- <th style="padding: 6px 0;">
- &nbsp;Bounce Rate&nbsp;&nbsp;
- </th>
- <th style="padding: 6px 0;">
- &nbsp;Conversion Rate&nbsp;&nbsp;
- </th>
- </thead>
- <tbody>
-
- <tr style="">
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Unknown </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 10
- </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 43
- </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 4.3
- </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:12:37
- </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 10%
- </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
- </td>
- </tr>
- </tbody>
- </table>
- <br/>
- <a style="text-decoration:none; color: rgb(126,115,99); font-size: 9pt;" href="#reportTop">
- Back to top
- </a>
<h2 id="DevicesDetection_getOsFamilies" style="color: rgb(126,115,99); font-size: 11pt;">
Operating System families
</h2>
diff --git a/tests/PHPUnit/System/expected/test_UserId_VisitorId__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId__Live.getLastVisitsDetails_month.xml
index cc28b360a0..551c6e66c3 100644
--- a/tests/PHPUnit/System/expected/test_UserId_VisitorId__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId__Live.getLastVisitsDetails_month.xml
@@ -30,7 +30,7 @@
<serverTimePretty>Sat 6 Mar 11:25:33</serverTimePretty>
<pageId>2</pageId>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -59,7 +59,7 @@
<serverTimePretty>Sat 6 Mar 13:16:33</serverTimePretty>
<pageId>4</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -70,7 +70,7 @@
<serverTimePretty>Sat 6 Mar 13:22:33</serverTimePretty>
<pageId>5</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -117,7 +117,7 @@
<serverTimePretty>Sat 6 Mar 16:22:33</serverTimePretty>
<pageId>8</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
diff --git a/tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserId__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserId__Goals.get_day.xml
index a43cbc433e..b7555aa8c6 100644
--- a/tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserId__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserId__Goals.get_day.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>50</conversion_rate>
<revenue>0</revenue>
+ <conversion_rate>50%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
index 27d565b42f..72a5b780f3 100644
--- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
@@ -8,25 +8,27 @@
<dimension>Website</dimension>
<metrics>
<nb_visits>Visits</nb_visits>
- <visits_evolution>Visits Evolution</visits_evolution>
<nb_actions>Actions</nb_actions>
- <actions_evolution>Actions Evolution</actions_evolution>
<nb_pageviews>Pageviews</nb_pageviews>
- <pageviews_evolution>Pageviews Evolution</pageviews_evolution>
<revenue>Revenue</revenue>
- <revenue_evolution>Revenue Evolution</revenue_evolution>
<nb_conversions>Conversions</nb_conversions>
- <nb_conversions_evolution>Conversions Evolution</nb_conversions_evolution>
<orders>Ecommerce Orders</orders>
- <orders_evolution>Ecommerce Orders Evolution</orders_evolution>
<ecommerce_revenue>Product Revenue</ecommerce_revenue>
- <ecommerce_revenue_evolution>Product Revenue Evolution</ecommerce_revenue_evolution>
</metrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
<nb_pageviews>The number of times this page was visited.</nb_pageviews>
</metricsDocumentation>
+ <processedMetrics>
+ <visits_evolution>Visits Evolution</visits_evolution>
+ <actions_evolution>Actions Evolution</actions_evolution>
+ <pageviews_evolution>Pageviews Evolution</pageviews_evolution>
+ <revenue_evolution>Revenue Evolution</revenue_evolution>
+ <nb_conversions_evolution>Conversions Evolution</nb_conversions_evolution>
+ <orders_evolution>Ecommerce Orders Evolution</orders_evolution>
+ <ecommerce_revenue_evolution>Product Revenue Evolution</ecommerce_revenue_evolution>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getAll&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getAll&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>MultiSites_getAll</uniqueId>
@@ -39,25 +41,27 @@
<dimension>Website</dimension>
<metrics>
<nb_visits>Visits</nb_visits>
- <visits_evolution>Visits Evolution</visits_evolution>
<nb_actions>Actions</nb_actions>
- <actions_evolution>Actions Evolution</actions_evolution>
<nb_pageviews>Pageviews</nb_pageviews>
- <pageviews_evolution>Pageviews Evolution</pageviews_evolution>
<revenue>Revenue</revenue>
- <revenue_evolution>Revenue Evolution</revenue_evolution>
<nb_conversions>Conversions</nb_conversions>
- <nb_conversions_evolution>Conversions Evolution</nb_conversions_evolution>
<orders>Ecommerce Orders</orders>
- <orders_evolution>Ecommerce Orders Evolution</orders_evolution>
<ecommerce_revenue>Product Revenue</ecommerce_revenue>
- <ecommerce_revenue_evolution>Product Revenue Evolution</ecommerce_revenue_evolution>
</metrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
<nb_pageviews>The number of times this page was visited.</nb_pageviews>
</metricsDocumentation>
+ <processedMetrics>
+ <visits_evolution>Visits Evolution</visits_evolution>
+ <actions_evolution>Actions Evolution</actions_evolution>
+ <pageviews_evolution>Pageviews Evolution</pageviews_evolution>
+ <revenue_evolution>Revenue Evolution</revenue_evolution>
+ <nb_conversions_evolution>Conversions Evolution</nb_conversions_evolution>
+ <orders_evolution>Ecommerce Orders Evolution</orders_evolution>
+ <ecommerce_revenue_evolution>Product Revenue Evolution</ecommerce_revenue_evolution>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getOne&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=MultiSites&amp;apiAction=getOne&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>MultiSites_getOne</uniqueId>
@@ -72,9 +76,6 @@
<nb_visits>Visits</nb_visits>
<nb_users>Users</nb_users>
<nb_actions>Actions</nb_actions>
- <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_site>Avg. Visit Duration (in seconds)</avg_time_on_site>
<max_actions>Maximum actions in one visit</max_actions>
</metrics>
<metricsDocumentation>
@@ -82,10 +83,15 @@
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
<nb_users>The number of users logged in your website. It is the number of unique active users that have a User ID set (via the Tracking code function 'setUserId').</nb_users>
<nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
<bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
+ <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
<avg_time_on_site>The average duration of a visit.</avg_time_on_site>
</metricsDocumentation>
+ <processedMetrics>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit>
+ <avg_time_on_site>Avg. Visit Duration (in seconds)</avg_time_on_site>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitsSummary&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitsSummary&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>VisitsSummary_get</uniqueId>
@@ -220,11 +226,13 @@
<documentation>This report shows which browser plugins your visitors had enabled. This information might be important for choosing the right way to deliver your content.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
- <nb_visits_percentage>% Visits</nb_visits_percentage>
</metrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
</metricsDocumentation>
+ <processedMetrics>
+ <nb_visits_percentage>% Visits</nb_visits_percentage>
+ </processedMetrics>
<constantRowsCount>1</constantRowsCount>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserSettings&amp;apiAction=getPlugin&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<uniqueId>UserSettings_getPlugin</uniqueId>
@@ -343,6 +351,66 @@
<uniqueId>UserSettings_getLanguageCode</uniqueId>
</row>
<row>
+ <category>API</category>
+ <name>Main metrics</name>
+ <module>API</module>
+ <action>get</action>
+ <metrics>
+ <nb_pageviews>Pageviews</nb_pageviews>
+ <nb_uniq_pageviews>Unique Pageviews</nb_uniq_pageviews>
+ <nb_downloads>Downloads</nb_downloads>
+ <nb_uniq_downloads>Unique Downloads</nb_uniq_downloads>
+ <nb_outlinks>Outlinks</nb_outlinks>
+ <nb_uniq_outlinks>Unique Outlinks</nb_uniq_outlinks>
+ <nb_searches>Searches</nb_searches>
+ <nb_keywords>Unique Keywords</nb_keywords>
+ <nb_conversions>Conversions</nb_conversions>
+ <nb_visits_converted>Visits with Conversions</nb_visits_converted>
+ <revenue>Revenue</revenue>
+ <nb_visits_returning>Returning Visits</nb_visits_returning>
+ <nb_actions_returning>Actions by Returning Visits</nb_actions_returning>
+ <nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning>
+ <nb_users_returning>Returning Users</nb_users_returning>
+ <max_actions_returning>Maximum actions in one returning visit</max_actions_returning>
+ <nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
+ <nb_visits>Visits</nb_visits>
+ <nb_users>Users</nb_users>
+ <nb_actions>Actions</nb_actions>
+ <max_actions>Maximum actions in one visit</max_actions>
+ </metrics>
+ <metricsDocumentation>
+ <nb_pageviews>The number of times this page was visited.</nb_pageviews>
+ <nb_uniq_pageviews>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_uniq_pageviews>
+ <nb_downloads>The number of times this link was clicked.</nb_downloads>
+ <nb_uniq_downloads>The number of visits that involved a click on this link. If a link was clicked multiple times during one visit, it is only counted once.</nb_uniq_downloads>
+ <nb_outlinks>The number of times this link was clicked.</nb_outlinks>
+ <nb_uniq_outlinks>The number of visits that involved a click on this link. If a link was clicked multiple times during one visit, it is only counted once.</nb_uniq_outlinks>
+ <nb_searches>The number of visits that searched for this keyword on your website's search engine.</nb_searches>
+ <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ <nb_users>The number of users logged in your website. It is the number of unique active users that have a User ID set (via the Tracking code function 'setUserId').</nb_users>
+ <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
+ <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
+ <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
+ <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
+ <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
+ <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
+ </metricsDocumentation>
+ <processedMetrics>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ <conversion_rate>Conversion Rate</conversion_rate>
+ <avg_time_on_site_returning>Avg. Duration of a Returning Visit (in sec)</avg_time_on_site_returning>
+ <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning>
+ <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit>
+ <avg_time_on_site>Avg. Visit Duration (in seconds)</avg_time_on_site>
+ </processedMetrics>
+ <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=API&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
+ <imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=API&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
+ <uniqueId>API_get</uniqueId>
+ </row>
+ <row>
<category>Ecommerce</category>
<name>Ecommerce Orders</name>
<module>Goals</module>
@@ -360,11 +428,13 @@
<revenue_shipping>Shipping</revenue_shipping>
<revenue_discount>Discount</revenue_discount>
<items>Purchased Products</items>
- <avg_order_revenue>Average Order Value</avg_order_revenue>
</metrics>
<metricsDocumentation>
<conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_order_revenue>Average Order Value</avg_order_revenue>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=ecommerceOrder&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=ecommerceOrder&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Goals_get_idGoal--ecommerceOrder</uniqueId>
@@ -418,6 +488,9 @@
<metricsDocumentation>
<conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_order_revenue>Average Order Value</avg_order_revenue>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=ecommerceAbandonedCart&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=ecommerceAbandonedCart&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Goals_get_idGoal--ecommerceAbandonedCart</uniqueId>
@@ -464,11 +537,13 @@
<revenue>Product Revenue</revenue>
<quantity>Quantity</quantity>
<orders>Unique Purchases</orders>
+ <nb_visits>Visits</nb_visits>
+ </metrics>
+ <processedMetrics>
<avg_price>Average Price</avg_price>
<avg_quantity>Average Quantity</avg_quantity>
- <nb_visits>Visits</nb_visits>
<conversion_rate>Product Conversion Rate</conversion_rate>
- </metrics>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=getItemsSku&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=getItemsSku&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Goals_getItemsSku</uniqueId>
@@ -483,11 +558,13 @@
<revenue>Product Revenue</revenue>
<quantity>Quantity</quantity>
<orders>Unique Purchases</orders>
+ <nb_visits>Visits</nb_visits>
+ </metrics>
+ <processedMetrics>
<avg_price>Average Price</avg_price>
<avg_quantity>Average Quantity</avg_quantity>
- <nb_visits>Visits</nb_visits>
<conversion_rate>Product Conversion Rate</conversion_rate>
- </metrics>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=getItemsName&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=getItemsName&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Goals_getItemsName</uniqueId>
@@ -502,11 +579,13 @@
<revenue>Product Revenue</revenue>
<quantity>Quantity</quantity>
<orders>Unique Purchases</orders>
+ <nb_visits>Visits</nb_visits>
+ </metrics>
+ <processedMetrics>
<avg_price>Average Price</avg_price>
<avg_quantity>Average Quantity</avg_quantity>
- <nb_visits>Visits</nb_visits>
<conversion_rate>Product Conversion Rate</conversion_rate>
- </metrics>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=getItemsCategory&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=getItemsCategory&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Goals_getItemsCategory</uniqueId>
@@ -525,7 +604,6 @@
<nb_uniq_outlinks>Unique Outlinks</nb_uniq_outlinks>
<nb_searches>Searches</nb_searches>
<nb_keywords>Unique Keywords</nb_keywords>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_pageviews>The number of times this page was visited.</nb_pageviews>
@@ -537,6 +615,9 @@
<nb_searches>The number of visits that searched for this keyword on your website's search engine.</nb_searches>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Actions_get</uniqueId>
@@ -551,19 +632,21 @@
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_page>Avg. time on page</avg_time_on_page>
- <exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_hits>The number of times this page was visited.</nb_hits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
- <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageUrls&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -579,13 +662,17 @@
<metrics>
<entry_nb_visits>Entrances</entry_nb_visits>
<entry_bounce_count>Bounces</entry_bounce_count>
- <bounce_rate>Bounce Rate</bounce_rate>
</metrics>
<metricsDocumentation>
<entry_nb_visits>Number of visits that started on this page.</entry_nb_visits>
<entry_bounce_count>Number of visits that started and ended on this page. This means that the visitor left the website after viewing only this page.</entry_bounce_count>
- <bounce_rate>Percentage of visits that started and ended on this page.</bounce_rate>
+ <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getEntryPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getEntryPageUrls&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getEntryPageUrls&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -601,13 +688,19 @@
<metrics>
<exit_nb_visits>Exits</exit_nb_visits>
<nb_visits>Unique Pageviews</nb_visits>
- <exit_rate>Exit rate</exit_rate>
</metrics>
<metricsDocumentation>
<exit_nb_visits>Number of visits that ended on this page.</exit_nb_visits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
+ <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
+ <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getExitPageUrls</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getExitPageUrls&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getExitPageUrls&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -623,19 +716,21 @@
<metrics>
<nb_hits>Pageviews</nb_hits>
<nb_visits>Unique Pageviews</nb_visits>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_page>Avg. time on page</avg_time_on_page>
- <exit_rate>Exit rate</exit_rate>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
<metricsDocumentation>
<nb_hits>The number of times this page was visited.</nb_hits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
- <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page>
+ <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
<avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_time_on_page>Avg. time on page</avg_time_on_page>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getPageTitles&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -651,13 +746,17 @@
<metrics>
<entry_nb_visits>Entrances</entry_nb_visits>
<entry_bounce_count>Bounces</entry_bounce_count>
- <bounce_rate>Bounce Rate</bounce_rate>
</metrics>
<metricsDocumentation>
<entry_nb_visits>Number of visits that started on this page.</entry_nb_visits>
<entry_bounce_count>Number of visits that started and ended on this page. This means that the visitor left the website after viewing only this page.</entry_bounce_count>
<bounce_rate>Percentage of visits that started and ended on this page.</bounce_rate>
+ <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <bounce_rate>Bounce Rate</bounce_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getEntryPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getEntryPageTitles&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getEntryPageTitles&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -673,13 +772,17 @@
<metrics>
<exit_nb_visits>Exits</exit_nb_visits>
<nb_visits>Unique Pageviews</nb_visits>
- <exit_rate>Exit rate</exit_rate>
</metrics>
<metricsDocumentation>
<exit_nb_visits>Number of visits that ended on this page.</exit_nb_visits>
<nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits>
<exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate>
+ <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
</metricsDocumentation>
+ <processedMetrics>
+ <exit_rate>Exit rate</exit_rate>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<actionToLoadSubTables>getExitPageTitles</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getExitPageTitles&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getExitPageTitles&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -772,7 +875,6 @@
<sum_event_value>Total value</sum_event_value>
<min_event_value>Minimum value</min_event_value>
<max_event_value>Maximum value</max_event_value>
- <avg_event_value>Average value</avg_event_value>
<nb_events_with_value>Events with a value</nb_events_with_value>
</metrics>
<metricsDocumentation>
@@ -780,9 +882,12 @@
<sum_event_value>The sum of event values</sum_event_value>
<min_event_value>The minimum value for this event</min_event_value>
<max_event_value>The maximum value for this event</max_event_value>
- <avg_event_value>The average of all values for this event</avg_event_value>
<nb_events_with_value>Number of events where an Event value was set</nb_events_with_value>
+ <avg_event_value>The average of all values for this event</avg_event_value>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_event_value>The average of all values for this event</avg_event_value>
+ </processedMetrics>
<actionToLoadSubTables>getActionFromCategoryId</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getCategory&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getCategory&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -799,7 +904,6 @@
<sum_event_value>Total value</sum_event_value>
<min_event_value>Minimum value</min_event_value>
<max_event_value>Maximum value</max_event_value>
- <avg_event_value>Average value</avg_event_value>
<nb_events_with_value>Events with a value</nb_events_with_value>
</metrics>
<metricsDocumentation>
@@ -807,9 +911,12 @@
<sum_event_value>The sum of event values</sum_event_value>
<min_event_value>The minimum value for this event</min_event_value>
<max_event_value>The maximum value for this event</max_event_value>
- <avg_event_value>The average of all values for this event</avg_event_value>
<nb_events_with_value>Number of events where an Event value was set</nb_events_with_value>
+ <avg_event_value>The average of all values for this event</avg_event_value>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_event_value>The average of all values for this event</avg_event_value>
+ </processedMetrics>
<actionToLoadSubTables>getNameFromActionId</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getAction&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getAction&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -826,7 +933,6 @@
<sum_event_value>Total value</sum_event_value>
<min_event_value>Minimum value</min_event_value>
<max_event_value>Maximum value</max_event_value>
- <avg_event_value>Average value</avg_event_value>
<nb_events_with_value>Events with a value</nb_events_with_value>
</metrics>
<metricsDocumentation>
@@ -834,9 +940,12 @@
<sum_event_value>The sum of event values</sum_event_value>
<min_event_value>The minimum value for this event</min_event_value>
<max_event_value>The maximum value for this event</max_event_value>
- <avg_event_value>The average of all values for this event</avg_event_value>
<nb_events_with_value>Number of events where an Event value was set</nb_events_with_value>
+ <avg_event_value>The average of all values for this event</avg_event_value>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_event_value>The average of all values for this event</avg_event_value>
+ </processedMetrics>
<actionToLoadSubTables>getActionFromNameId</actionToLoadSubTables>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getName&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Events&amp;apiAction=getName&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
@@ -848,17 +957,19 @@
<module>Actions</module>
<action>getSiteSearchKeywords</action>
<dimension>Keyword</dimension>
- <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
+ <documentation>This report lists the Search Keywords that visitors searched for on your internal Search Engine.&lt;br/&gt;&lt;br/&gt;Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://piwik.org/docs/site-search/&quot; rel=&quot;noreferrer&quot; target=&quot;_blank&quot;&gt;Learn more about Tracking how your visitors use your Search engine.&lt;/a&gt;</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
<nb_pages_per_search>Search Results pages</nb_pages_per_search>
- <exit_rate>% Search Exits</exit_rate>
</metrics>
<metricsDocumentation>
<nb_visits>The number of visits that searched for this keyword on your website's search engine.</nb_visits>
<nb_pages_per_search>Visitors will search on your website, and sometimes click &quot;next&quot; to view more results. This is the average number of search results pages viewed for this keyword.</nb_pages_per_search>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <exit_rate>% Search Exits</exit_rate>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchKeywords&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchKeywords</uniqueId>
@@ -872,12 +983,14 @@
<documentation>Tracking searches that visitors make on your website is a very effective way to learn more about what your audience is looking for, it can help find ideas for new content, new Ecommerce products that potential customers might be searching for, and generally improve the visitors' experience on your website.&lt;br /&gt;&lt;br /&gt;This report lists the Search Keywords that did not return any Search result: maybe the search engine algorithm can be improved, or maybe your visitors are looking for content that is not (yet) on your website?</documentation>
<metrics>
<nb_visits>Searches</nb_visits>
- <exit_rate>% Search Exits</exit_rate>
</metrics>
<metricsDocumentation>
<nb_visits>The number of visits that searched for this keyword on your website's search engine.</nb_visits>
<exit_rate>The percentage of visits that left the website after searching for this Keyword on your Site Search engine.</exit_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <exit_rate>% Search Exits</exit_rate>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=getSiteSearchNoResultKeywords&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Actions_getSiteSearchNoResultKeywords</uniqueId>
@@ -1119,7 +1232,7 @@
<module>Referrers</module>
<action>getCampaigns</action>
<dimension>Campaign</dimension>
- <documentation>This report shows which campaigns led visitors to your website. &lt;br /&gt; For more information about tracking campaigns, read the &lt;a href=&quot;http://piwik.org/docs/tracking-campaigns/&quot; target=&quot;_blank&quot;&gt;campaigns documentation on piwik.org&lt;/a&gt;</documentation>
+ <documentation>This report shows which campaigns led visitors to your website. &lt;br /&gt; For more information about tracking campaigns, read the &lt;a href=&quot;http://piwik.org/docs/tracking-campaigns/&quot; rel=&quot;noreferrer&quot; target=&quot;_blank&quot;&gt;campaigns documentation on piwik.org&lt;/a&gt;</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
@@ -1187,12 +1300,14 @@
<metrics>
<nb_conversions>Conversions</nb_conversions>
<nb_visits_converted>Visits with Conversions</nb_visits_converted>
- <conversion_rate>Conversion Rate</conversion_rate>
<revenue>Revenue</revenue>
</metrics>
<metricsDocumentation>
<conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <conversion_rate>Conversion Rate</conversion_rate>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Goals_get</uniqueId>
@@ -1248,12 +1363,14 @@
<metrics>
<nb_conversions>Conversions</nb_conversions>
<nb_visits_converted>Visits with Conversions</nb_visits_converted>
- <conversion_rate>Conversion Rate</conversion_rate>
<revenue>Revenue</revenue>
</metrics>
<metricsDocumentation>
<conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <conversion_rate>Conversion Rate</conversion_rate>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=1&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=1&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Goals_get_idGoal--1</uniqueId>
@@ -1301,12 +1418,14 @@
<metrics>
<nb_conversions>Conversions</nb_conversions>
<nb_visits_converted>Visits with Conversions</nb_visits_converted>
- <conversion_rate>Conversion Rate</conversion_rate>
<revenue>Revenue</revenue>
</metrics>
<metricsDocumentation>
<conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <conversion_rate>Conversion Rate</conversion_rate>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=2&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=2&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Goals_get_idGoal--2</uniqueId>
@@ -1354,12 +1473,14 @@
<metrics>
<nb_conversions>Conversions</nb_conversions>
<nb_visits_converted>Visits with Conversions</nb_visits_converted>
- <conversion_rate>Conversion Rate</conversion_rate>
<revenue>Revenue</revenue>
</metrics>
<metricsDocumentation>
<conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <conversion_rate>Conversion Rate</conversion_rate>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=3&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=3&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Goals_get_idGoal--3</uniqueId>
@@ -1468,7 +1589,7 @@
<module>UserCountry</module>
<action>getRegion</action>
<dimension>Region</dimension>
- <documentation>This report shows which region your visitors were in when they accessed your website.&lt;br/&gt;In order to see data for this report, you must setup GeoIP in the Geolocation admin tab. The commercial &lt;a target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/?rId=piwik&quot;&gt;Maxmind&lt;/a&gt; GeoIP databases are more accurate than the free ones. To see how accurate they are, click &lt;a target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/en/city_accuracy?rId=piwik&quot;&gt;here&lt;/a&gt;.</documentation>
+ <documentation>This report shows which region your visitors were in when they accessed your website.&lt;br/&gt;In order to see data for this report, you must setup GeoIP in the Geolocation admin tab. The commercial &lt;a rel=&quot;noreferrer&quot; target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/?rId=piwik&quot;&gt;Maxmind&lt;/a&gt; GeoIP databases are more accurate than the free ones. To see how accurate they are, click &lt;a rel=&quot;noreferrer&quot; target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/en/city_accuracy?rId=piwik&quot;&gt;here&lt;/a&gt;.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
@@ -1501,7 +1622,7 @@
<module>UserCountry</module>
<action>getCity</action>
<dimension>City</dimension>
- <documentation>This report shows the cities your visitors were in when they accessed your website.&lt;br/&gt;In order to see data for this report, you must setup GeoIP in the Geolocation admin tab. The commercial &lt;a target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/?rId=piwik&quot;&gt;Maxmind&lt;/a&gt; GeoIP databases are more accurate than the free ones. To see how accurate they are, click &lt;a target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/en/city_accuracy?rId=piwik&quot;&gt;here&lt;/a&gt;.</documentation>
+ <documentation>This report shows the cities your visitors were in when they accessed your website.&lt;br/&gt;In order to see data for this report, you must setup GeoIP in the Geolocation admin tab. The commercial &lt;a rel=&quot;noreferrer&quot; target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/?rId=piwik&quot;&gt;Maxmind&lt;/a&gt; GeoIP databases are more accurate than the free ones. To see how accurate they are, click &lt;a rel=&quot;noreferrer&quot; target=&quot;_blank&quot; href=&quot;http://www.maxmind.com/en/city_accuracy?rId=piwik&quot;&gt;here&lt;/a&gt;.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
@@ -1534,7 +1655,7 @@
<module>CustomVariables</module>
<action>getCustomVariables</action>
<dimension>Custom Variable name</dimension>
- <documentation>This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. &lt;br /&gt; For more information about Custom Variables in general, read the &lt;a href=&quot;http://piwik.org/docs/custom-variables/&quot; target=&quot;_blank&quot;&gt;Custom Variables documentation on piwik.org&lt;/a&gt;</documentation>
+ <documentation>This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. &lt;br /&gt; For more information about Custom Variables in general, read the &lt;a href=&quot;http://piwik.org/docs/custom-variables/&quot; rel=&quot;noreferrer&quot; target=&quot;_blank&quot;&gt;Custom Variables documentation on piwik.org&lt;/a&gt;</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
@@ -1607,11 +1728,13 @@
<documentation>In this report, you can see the number of visits who were the Nth visit, ie. visitors who visited your website at least N times.&lt;br /&gt;Please note, that you can view the report in other ways than as a tag cloud. Use the controls at the bottom of the report to do so.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
- <nb_visits_percentage>% Visits</nb_visits_percentage>
</metrics>
<metricsDocumentation>
<nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
</metricsDocumentation>
+ <processedMetrics>
+ <nb_visits_percentage>% Visits</nb_visits_percentage>
+ </processedMetrics>
<constantRowsCount>1</constantRowsCount>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitorInterest&amp;apiAction=getNumberOfVisitsByVisitCount&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
<uniqueId>VisitorInterest_getNumberOfVisitsByVisitCount</uniqueId>
@@ -1641,15 +1764,15 @@
<metrics>
<nb_visits_returning>Returning Visits</nb_visits_returning>
<nb_actions_returning>Actions by Returning Visits</nb_actions_returning>
- <avg_time_on_site_returning>Avg. Duration of a Returning Visit (in sec)</avg_time_on_site_returning>
- <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning>
- <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning>
<nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning>
- <sum_visit_length_returning>Total time spent by returning visitors (in seconds)</sum_visit_length_returning>
<nb_users_returning>Returning Users</nb_users_returning>
- <nb_visits_converted_returning>Number of converted returning visits</nb_visits_converted_returning>
<max_actions_returning>Maximum actions in one returning visit</max_actions_returning>
</metrics>
+ <processedMetrics>
+ <avg_time_on_site_returning>Avg. Duration of a Returning Visit (in sec)</avg_time_on_site_returning>
+ <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning>
+ <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitFrequency&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=VisitFrequency&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>VisitFrequency_get</uniqueId>
@@ -1713,11 +1836,10 @@
</row>
<row>
<category>Visitor Devices</category>
- <name>Visitor Browser</name>
+ <name>Device brand</name>
<module>DevicesDetection</module>
- <action>getBrowsers</action>
- <dimension>Browser</dimension>
- <documentation>This report contains information about what kind of browser your visitors were using. Each browser version is listed separately.</documentation>
+ <action>getBrand</action>
+ <dimension>Device brand</dimension>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
@@ -1736,16 +1858,17 @@
<bounce_rate>Bounce Rate</bounce_rate>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowsers&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
- <imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowsers&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
- <uniqueId>DevicesDetection_getBrowsers</uniqueId>
+ <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrand&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
+ <imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrand&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
+ <uniqueId>DevicesDetection_getBrand</uniqueId>
</row>
<row>
<category>Visitor Devices</category>
- <name>Device brand</name>
+ <name>Visitor Browser</name>
<module>DevicesDetection</module>
- <action>getBrand</action>
- <dimension>Device brand</dimension>
+ <action>getBrowsers</action>
+ <dimension>Browser</dimension>
+ <documentation>This report contains information about what kind of browser your visitors were using. Each browser version is listed separately.</documentation>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
@@ -1764,16 +1887,16 @@
<bounce_rate>Bounce Rate</bounce_rate>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrand&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
- <imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrand&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
- <uniqueId>DevicesDetection_getBrand</uniqueId>
+ <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowsers&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
+ <imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowsers&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
+ <uniqueId>DevicesDetection_getBrowsers</uniqueId>
</row>
<row>
<category>Visitor Devices</category>
- <name>Device model</name>
+ <name>Browser version</name>
<module>DevicesDetection</module>
- <action>getModel</action>
- <dimension>Device model</dimension>
+ <action>getBrowserVersions</action>
+ <dimension>Browser version</dimension>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
@@ -1792,16 +1915,16 @@
<bounce_rate>Bounce Rate</bounce_rate>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getModel&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
- <imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getModel&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
- <uniqueId>DevicesDetection_getModel</uniqueId>
+ <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowserVersions&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
+ <imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowserVersions&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
+ <uniqueId>DevicesDetection_getBrowserVersions</uniqueId>
</row>
<row>
<category>Visitor Devices</category>
- <name>Browser version</name>
+ <name>Device model</name>
<module>DevicesDetection</module>
- <action>getBrowserVersions</action>
- <dimension>Browser version</dimension>
+ <action>getModel</action>
+ <dimension>Device model</dimension>
<metrics>
<nb_visits>Visits</nb_visits>
<nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
@@ -1820,9 +1943,9 @@
<bounce_rate>Bounce Rate</bounce_rate>
<conversion_rate>Conversion Rate</conversion_rate>
</processedMetrics>
- <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowserVersions&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
- <imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowserVersions&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
- <uniqueId>DevicesDetection_getBrowserVersions</uniqueId>
+ <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getModel&amp;period=day&amp;date=2009-01-04</imageGraphUrl>
+ <imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getModel&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
+ <uniqueId>DevicesDetection_getModel</uniqueId>
</row>
<row>
<category>Visitor Devices</category>
@@ -1909,68 +2032,4 @@
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicesDetection&amp;apiAction=getBrowserEngines&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>DevicesDetection_getBrowserEngines</uniqueId>
</row>
- <row>
- <category>API</category>
- <name>Main metrics</name>
- <module>API</module>
- <action>get</action>
- <metrics>
- <nb_uniq_visitors>Unique visitors</nb_uniq_visitors>
- <nb_visits>Visits</nb_visits>
- <nb_users>Users</nb_users>
- <nb_actions>Actions</nb_actions>
- <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit>
- <bounce_rate>Bounce Rate</bounce_rate>
- <avg_time_on_site>Avg. Visit Duration (in seconds)</avg_time_on_site>
- <max_actions>Maximum actions in one visit</max_actions>
- <nb_conversions>Conversions</nb_conversions>
- <nb_visits_converted>Visits with Conversions</nb_visits_converted>
- <conversion_rate>Conversion Rate</conversion_rate>
- <revenue>Revenue</revenue>
- <revenue_subtotal>Subtotal</revenue_subtotal>
- <revenue_tax>Tax</revenue_tax>
- <revenue_shipping>Shipping</revenue_shipping>
- <revenue_discount>Discount</revenue_discount>
- <items>Products left in cart</items>
- <avg_order_revenue>Average Order Value</avg_order_revenue>
- <nb_pageviews>Pageviews</nb_pageviews>
- <nb_uniq_pageviews>Unique Pageviews</nb_uniq_pageviews>
- <nb_downloads>Downloads</nb_downloads>
- <nb_uniq_downloads>Unique Downloads</nb_uniq_downloads>
- <nb_outlinks>Outlinks</nb_outlinks>
- <nb_uniq_outlinks>Unique Outlinks</nb_uniq_outlinks>
- <nb_searches>Searches</nb_searches>
- <nb_keywords>Unique Keywords</nb_keywords>
- <avg_time_generation>Avg. generation time</avg_time_generation>
- <nb_visits_returning>Returning Visits</nb_visits_returning>
- <nb_actions_returning>Actions by Returning Visits</nb_actions_returning>
- <avg_time_on_site_returning>Avg. Duration of a Returning Visit (in sec)</avg_time_on_site_returning>
- <bounce_rate_returning>Bounce Rate for Returning Visits</bounce_rate_returning>
- <nb_actions_per_visit_returning>Avg. Actions per Returning Visit</nb_actions_per_visit_returning>
- <nb_uniq_visitors_returning>Unique returning visitors</nb_uniq_visitors_returning>
- <sum_visit_length_returning>Total time spent by returning visitors (in seconds)</sum_visit_length_returning>
- <nb_users_returning>Returning Users</nb_users_returning>
- <nb_visits_converted_returning>Number of converted returning visits</nb_visits_converted_returning>
- <max_actions_returning>Maximum actions in one returning visit</max_actions_returning>
- </metrics>
- <metricsDocumentation>
- <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors>
- <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
- <nb_users>The number of users logged in your website. It is the number of unique active users that have a User ID set (via the Tracking code function 'setUserId').</nb_users>
- <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions>
- <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit>
- <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate>
- <avg_time_on_site>The average duration of a visit.</avg_time_on_site>
- <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
- <nb_pageviews>The number of times this page was visited.</nb_pageviews>
- <nb_uniq_pageviews>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_uniq_pageviews>
- <nb_downloads>The number of times this link was clicked.</nb_downloads>
- <nb_uniq_downloads>The number of visits that involved a click on this link. If a link was clicked multiple times during one visit, it is only counted once.</nb_uniq_downloads>
- <nb_outlinks>The number of times this link was clicked.</nb_outlinks>
- <nb_uniq_outlinks>The number of visits that involved a click on this link. If a link was clicked multiple times during one visit, it is only counted once.</nb_uniq_outlinks>
- <nb_searches>The number of visits that searched for this keyword on your website's search engine.</nb_searches>
- <avg_time_generation>The average time it took to generate the page. This metric includes the time it took the server to generate the web page, plus the time it took for the visitor to download the response from the server. A lower 'Avg. generation time' means a faster website for your visitors!</avg_time_generation>
- </metricsDocumentation>
- <uniqueId>API_get</uniqueId>
- </row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml
index fe0924b8d9..57438262e4 100644
--- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml
@@ -5,22 +5,18 @@
<nb_users>0</nb_users>
<nb_actions>1</nb_actions>
<max_actions>1</max_actions>
- <bounce_rate>100%</bounce_rate>
- <nb_actions_per_visit>1</nb_actions_per_visit>
- <avg_time_on_site>1086</avg_time_on_site>
+ <bounce_count>1</bounce_count>
+ <sum_visit_length>1086</sum_visit_length>
<nb_visits_returning>0</nb_visits_returning>
<nb_actions_returning>0</nb_actions_returning>
<nb_uniq_visitors_returning>0</nb_uniq_visitors_returning>
- <sum_visit_length_returning>0</sum_visit_length_returning>
<nb_users_returning>0</nb_users_returning>
- <nb_visits_converted_returning>0</nb_visits_converted_returning>
<max_actions_returning>0</max_actions_returning>
<bounce_rate_returning>0%</bounce_rate_returning>
<nb_actions_per_visit_returning>0</nb_actions_per_visit_returning>
<avg_time_on_site_returning>0</avg_time_on_site_returning>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>100</conversion_rate>
<revenue>42.26</revenue>
<nb_pageviews>1</nb_pageviews>
<nb_uniq_pageviews>1</nb_uniq_pageviews>
@@ -30,5 +26,8 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>0</nb_searches>
<nb_keywords>0</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
+ <conversion_rate>100%</conversion_rate>
+ <bounce_rate>100%</bounce_rate>
+ <nb_actions_per_visit>1</nb_actions_per_visit>
+ <avg_time_on_site>1086</avg_time_on_site>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getMetadata_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getMetadata_day.xml
index 590b2acbe5..7e1c898ec6 100644
--- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getMetadata_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getMetadata_day.xml
@@ -14,8 +14,10 @@
<nb_uniq_outlinks>Unique Outlinks</nb_uniq_outlinks>
<nb_searches>Searches</nb_searches>
<nb_keywords>Unique Keywords</nb_keywords>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
+ <processedMetrics>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Actions_get</uniqueId>
diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getProcessedReport_day.xml
index 6eb752956e..92986c8118 100644
--- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getProcessedReport_day.xml
@@ -16,8 +16,10 @@
<nb_uniq_outlinks>Unique Outlinks</nb_uniq_outlinks>
<nb_searches>Searches</nb_searches>
<nb_keywords>Unique Keywords</nb_keywords>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</metrics>
+ <processedMetrics>
+ <avg_time_generation>Avg. generation time</avg_time_generation>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Actions&amp;apiAction=get&amp;period=day&amp;date=2008-12-06,2009-01-04</imageGraphEvolutionUrl>
<uniqueId>Actions_get</uniqueId>
@@ -31,7 +33,6 @@
<nb_uniq_outlinks>Unique Outlinks</nb_uniq_outlinks>
<nb_searches>Searches</nb_searches>
<nb_keywords>Unique Keywords</nb_keywords>
- <avg_time_generation>Avg. generation time</avg_time_generation>
</columns>
<reportData>
<nb_pageviews>1</nb_pageviews>
@@ -42,7 +43,6 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>0</nb_searches>
<nb_keywords>0</nb_keywords>
- <avg_time_generation>0s</avg_time_generation>
</reportData>
<reportMetadata />
<reportTotal>
diff --git a/tests/PHPUnit/System/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml
index 4b38b3da7f..a701470308 100644
--- a/tests/PHPUnit/System/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml
@@ -64,7 +64,7 @@
</goals>
<nb_conversions>1</nb_conversions>
<revenue>$ 42.26</revenue>
- <conversion_rate>0</conversion_rate>
+ <conversion_rate>0%</conversion_rate>
<nb_actions_per_visit>1</nb_actions_per_visit>
<avg_time_on_site>00:18:06</avg_time_on_site>
<bounce_rate>100%</bounce_rate>
diff --git a/tests/PHPUnit/System/expected/test_csvExport__Live.getLastVisitsDetails_day.csv b/tests/PHPUnit/System/expected/test_csvExport__Live.getLastVisitsDetails_day.csv
index 5bec541cf6..27a8a409e0 100644
--- a/tests/PHPUnit/System/expected/test_csvExport__Live.getLastVisitsDetails_day.csv
+++ b/tests/PHPUnit/System/expected/test_csvExport__Live.getLastVisitsDetails_day.csv
Binary files differ
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_day.xml
index f321ae62e1..ebf215db8e 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_day.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<result>
<nb_visits>3</nb_visits>
- <avg_time_on_site>1801</avg_time_on_site>
<nb_visits_converted>2</nb_visits_converted>
<nb_pageviews>13</nb_pageviews>
+ <avg_time_on_site>1801</avg_time_on_site>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_week.xml
index 330e0110bf..3194b95fa1 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_week.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<result>
<nb_visits>5</nb_visits>
- <avg_time_on_site>1369</avg_time_on_site>
<nb_visits_converted>4</nb_visits_converted>
<nb_pageviews>16</nb_pageviews>
+ <avg_time_on_site>1369</avg_time_on_site>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_day.xml
index 343be649b7..b82a3a8c27 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_day.xml
@@ -2,7 +2,8 @@
<result>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>2</nb_visits_converted>
- <conversion_rate>66.67</conversion_rate>
<revenue>5020.22</revenue>
<items>8</items>
+ <avg_order_revenue>2510.11</avg_order_revenue>
+ <conversion_rate>66.67%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_week.xml
index a2d20e0f55..e69257b0fa 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_week.xml
@@ -2,7 +2,8 @@
<result>
<nb_conversions>3</nb_conversions>
<nb_visits_converted>3</nb_visits_converted>
- <conversion_rate>60</conversion_rate>
<revenue>7530.33</revenue>
<items>12</items>
+ <avg_order_revenue>2510.11</avg_order_revenue>
+ <conversion_rate>60%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_day.xml
index 28ecffa619..1245b5cd8f 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_day.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>33.33</conversion_rate>
<revenue>10</revenue>
+ <conversion_rate>33.33%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_week.xml
index 46934b1c19..b5daa8ba92 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_week.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>20</conversion_rate>
<revenue>10</revenue>
+ <conversion_rate>20%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml
index ebcd365223..b1c28a0a8d 100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml
@@ -2,7 +2,6 @@
<result>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>33.33</conversion_rate>
<revenue>3111.11</revenue>
<revenue_subtotal>2500</revenue_subtotal>
<revenue_tax>511</revenue_tax>
@@ -10,4 +9,5 @@
<revenue_discount>666</revenue_discount>
<items>10</items>
<avg_order_revenue>1555.56</avg_order_revenue>
+ <conversion_rate>33.33%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml
index ea6729364c..92abb4962b 100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml
@@ -2,7 +2,6 @@
<result>
<nb_conversions>4</nb_conversions>
<nb_visits_converted>2</nb_visits_converted>
- <conversion_rate>40</conversion_rate>
<revenue>13351.11</revenue>
<revenue_subtotal>2700</revenue_subtotal>
<revenue_tax>531</revenue_tax>
@@ -10,4 +9,5 @@
<revenue_discount>686</revenue_discount>
<items>12</items>
<avg_order_revenue>3337.78</avg_order_revenue>
+ <conversion_rate>40%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml
index fc23e7158e..837cc2b4c6 100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>3</nb_conversions>
<nb_visits_converted>2</nb_visits_converted>
- <conversion_rate>66.67</conversion_rate>
<revenue>3121.11</revenue>
+ <conversion_rate>66.67%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml
index 221f89f826..c9cd54530d 100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>5</nb_conversions>
<nb_visits_converted>4</nb_visits_converted>
- <conversion_rate>80</conversion_rate>
<revenue>13361.11</revenue>
+ <conversion_rate>80%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml
index 76f06919db..a6103ff862 100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml
@@ -63,7 +63,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>363</visitDuration>
- <visitDurationPretty>6 min 3s</visitDurationPretty>
+ <visitDurationPretty>6 min 3s</visitDurationPretty>
<customVariables>
<row>
<customVariableName3>VisitorName</customVariableName3>
@@ -167,7 +167,7 @@
</row>
</customVariables>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -196,7 +196,7 @@
</row>
</customVariables>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -274,7 +274,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>1</daysSinceLastEcommerceOrder>
<visitDuration>1081</visitDuration>
- <visitDurationPretty>18 min 1s</visitDurationPretty>
+ <visitDurationPretty>18 min 1s</visitDurationPretty>
<customVariables>
<row>
<customVariableName3>VisitorName</customVariableName3>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_AbandonedCart__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_AbandonedCart__API.getProcessedReport_day.xml
index 65e862ccc6..3e099b5692 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_AbandonedCart__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_AbandonedCart__API.getProcessedReport_day.xml
@@ -19,6 +19,9 @@
<metricsDocumentation>
<conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_order_revenue>Average Order Value</avg_order_revenue>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=ecommerceAbandonedCart&amp;period=day&amp;date=2011-03-07,2011-04-05</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=ecommerceAbandonedCart&amp;period=day&amp;date=2011-03-07,2011-04-05</imageGraphEvolutionUrl>
<uniqueId>Goals_get_idGoal--ecommerceAbandonedCart</uniqueId>
@@ -28,12 +31,14 @@
<conversion_rate>Conversion Rate</conversion_rate>
<revenue>Revenue left in cart</revenue>
<items>Products left in cart</items>
+ <avg_order_revenue>Average Order Value</avg_order_revenue>
</columns>
<reportData>
<nb_conversions>2</nb_conversions>
- <conversion_rate>66.67%</conversion_rate>
<revenue>$ 5020.22</revenue>
<items>8</items>
+ <avg_order_revenue>$ 2510.11</avg_order_revenue>
+ <conversion_rate>66.67%</conversion_rate>
</reportData>
<reportMetadata />
<reportTotal>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NormalGoal__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NormalGoal__API.getProcessedReport_day.xml
index 358467f45e..d492e19c4b 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NormalGoal__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NormalGoal__API.getProcessedReport_day.xml
@@ -13,12 +13,14 @@
<metrics>
<nb_conversions>Conversions</nb_conversions>
<nb_visits_converted>Visits with Conversions</nb_visits_converted>
- <conversion_rate>Conversion Rate</conversion_rate>
<revenue>Revenue</revenue>
</metrics>
<metricsDocumentation>
<conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <conversion_rate>Conversion Rate</conversion_rate>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=1&amp;period=day&amp;date=2011-03-07,2011-04-05</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=1&amp;period=day&amp;date=2011-03-07,2011-04-05</imageGraphEvolutionUrl>
<uniqueId>Goals_get_idGoal--1</uniqueId>
@@ -26,14 +28,14 @@
<columns>
<nb_conversions>Conversions</nb_conversions>
<nb_visits_converted>Visits with Conversions</nb_visits_converted>
- <conversion_rate>Conversion Rate</conversion_rate>
<revenue>Revenue</revenue>
+ <conversion_rate>Conversion Rate</conversion_rate>
</columns>
<reportData>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>33.33%</conversion_rate>
<revenue>$ 10</revenue>
+ <conversion_rate>33.33%</conversion_rate>
</reportData>
<reportMetadata />
<reportTotal>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml
index 65ca5686e1..99d9d6ab69 100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml
@@ -20,11 +20,13 @@
<revenue_shipping>Shipping</revenue_shipping>
<revenue_discount>Discount</revenue_discount>
<items>Purchased Products</items>
- <avg_order_revenue>Average Order Value</avg_order_revenue>
</metrics>
<metricsDocumentation>
<conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate>
</metricsDocumentation>
+ <processedMetrics>
+ <avg_order_revenue>Average Order Value</avg_order_revenue>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=ecommerceOrder&amp;period=day&amp;date=2011-03-07,2011-04-05</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=get&amp;idGoal=ecommerceOrder&amp;period=day&amp;date=2011-03-07,2011-04-05</imageGraphEvolutionUrl>
<uniqueId>Goals_get_idGoal--ecommerceOrder</uniqueId>
@@ -44,7 +46,6 @@
<reportData>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>33.33%</conversion_rate>
<revenue>$ 3111.11</revenue>
<revenue_subtotal>$ 2500</revenue_subtotal>
<revenue_tax>$ 511</revenue_tax>
@@ -52,6 +53,7 @@
<revenue_discount>$ 666</revenue_discount>
<items>10</items>
<avg_order_revenue>$ 1555.56</avg_order_revenue>
+ <conversion_rate>33.33%</conversion_rate>
</reportData>
<reportMetadata />
<reportTotal>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsCategory__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsCategory__API.getProcessedReport_day.xml
index 002d38705c..70117fb4d3 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsCategory__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsCategory__API.getProcessedReport_day.xml
@@ -12,11 +12,13 @@
<revenue>Product Revenue</revenue>
<quantity>Quantity</quantity>
<orders>Unique Purchases</orders>
+ <nb_visits>Visits</nb_visits>
+ </metrics>
+ <processedMetrics>
<avg_price>Average Price</avg_price>
<avg_quantity>Average Quantity</avg_quantity>
- <nb_visits>Visits</nb_visits>
<conversion_rate>Product Conversion Rate</conversion_rate>
- </metrics>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=getItemsCategory&amp;period=day&amp;date=2011-04-05</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=getItemsCategory&amp;period=day&amp;date=2011-03-07,2011-04-05</imageGraphEvolutionUrl>
<uniqueId>Goals_getItemsCategory</uniqueId>
@@ -26,9 +28,9 @@
<revenue>Product Revenue</revenue>
<quantity>Quantity</quantity>
<orders>Unique Purchases</orders>
+ <nb_visits>Visits</nb_visits>
<avg_price>Average Price</avg_price>
<avg_quantity>Average Quantity</avg_quantity>
- <nb_visits>Visits</nb_visits>
<conversion_rate>Product Conversion Rate</conversion_rate>
</columns>
<reportData>
@@ -38,7 +40,7 @@
<quantity>3</quantity>
<orders>2</orders>
<nb_visits>3</nb_visits>
- <avg_price>1000</avg_price>
+ <avg_price>$ 1000</avg_price>
<avg_quantity>1.5</avg_quantity>
<conversion_rate>66.67%</conversion_rate>
</row>
@@ -48,7 +50,7 @@
<quantity>2</quantity>
<orders>1</orders>
<nb_visits>1</nb_visits>
- <avg_price>500</avg_price>
+ <avg_price>$ 500</avg_price>
<avg_quantity>2</avg_quantity>
<conversion_rate>100%</conversion_rate>
</row>
@@ -58,7 +60,7 @@
<quantity>2</quantity>
<orders>1</orders>
<nb_visits>1</nb_visits>
- <avg_price>500</avg_price>
+ <avg_price>$ 500</avg_price>
<avg_quantity>2</avg_quantity>
<conversion_rate>100%</conversion_rate>
</row>
@@ -68,7 +70,7 @@
<quantity>2</quantity>
<orders>1</orders>
<nb_visits>1</nb_visits>
- <avg_price>500</avg_price>
+ <avg_price>$ 500</avg_price>
<avg_quantity>2</avg_quantity>
<conversion_rate>100%</conversion_rate>
</row>
@@ -78,7 +80,7 @@
<quantity>2</quantity>
<orders>1</orders>
<nb_visits>1</nb_visits>
- <avg_price>500</avg_price>
+ <avg_price>$ 500</avg_price>
<avg_quantity>2</avg_quantity>
<conversion_rate>100%</conversion_rate>
</row>
@@ -88,14 +90,14 @@
<quantity>7</quantity>
<orders>2</orders>
<nb_visits>3</nb_visits>
- <avg_price>55.61</avg_price>
+ <avg_price>$ 55.61</avg_price>
<avg_quantity>3.5</avg_quantity>
<conversion_rate>66.67%</conversion_rate>
</row>
<row>
<label>Category TWO LEFT in cart</label>
<nb_visits>2</nb_visits>
- <avg_price>0</avg_price>
+ <avg_price>$ 0</avg_price>
<avg_quantity>0</avg_quantity>
<conversion_rate>0%</conversion_rate>
<revenue>$ 0</revenue>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsSku__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsSku__API.getProcessedReport_day.xml
index cb341801b4..20079eb4c4 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsSku__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsSku__API.getProcessedReport_day.xml
@@ -12,11 +12,13 @@
<revenue>Product Revenue</revenue>
<quantity>Quantity</quantity>
<orders>Unique Purchases</orders>
+ <nb_visits>Visits</nb_visits>
+ </metrics>
+ <processedMetrics>
<avg_price>Average Price</avg_price>
<avg_quantity>Average Quantity</avg_quantity>
- <nb_visits>Visits</nb_visits>
<conversion_rate>Product Conversion Rate</conversion_rate>
- </metrics>
+ </processedMetrics>
<imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=getItemsSku&amp;period=day&amp;date=2011-04-05</imageGraphUrl>
<imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=Goals&amp;apiAction=getItemsSku&amp;period=day&amp;date=2011-03-07,2011-04-05</imageGraphEvolutionUrl>
<uniqueId>Goals_getItemsSku</uniqueId>
@@ -26,9 +28,9 @@
<revenue>Product Revenue</revenue>
<quantity>Quantity</quantity>
<orders>Unique Purchases</orders>
+ <nb_visits>Visits</nb_visits>
<avg_price>Average Price</avg_price>
<avg_quantity>Average Quantity</avg_quantity>
- <nb_visits>Visits</nb_visits>
<conversion_rate>Product Conversion Rate</conversion_rate>
</columns>
<reportData>
@@ -38,7 +40,7 @@
<quantity>1</quantity>
<orders>1</orders>
<nb_visits>1</nb_visits>
- <avg_price>1500</avg_price>
+ <avg_price>$ 1500</avg_price>
<avg_quantity>1</avg_quantity>
<conversion_rate>100%</conversion_rate>
</row>
@@ -48,7 +50,7 @@
<quantity>3</quantity>
<orders>2</orders>
<nb_visits>3</nb_visits>
- <avg_price>255.61</avg_price>
+ <avg_price>$ 255.61</avg_price>
<avg_quantity>1.5</avg_quantity>
<conversion_rate>66.67%</conversion_rate>
</row>
@@ -57,7 +59,7 @@
<revenue>$ 600</revenue>
<quantity>6</quantity>
<orders>1</orders>
- <avg_price>100</avg_price>
+ <avg_price>$ 100</avg_price>
<avg_quantity>6</avg_quantity>
<conversion_rate>0%</conversion_rate>
<nb_visits>0</nb_visits>
@@ -65,7 +67,7 @@
<row>
<label>SKU IN ABANDONED CART TWO</label>
<nb_visits>2</nb_visits>
- <avg_price>0</avg_price>
+ <avg_price>$ 0</avg_price>
<avg_quantity>0</avg_quantity>
<conversion_rate>0%</conversion_rate>
<revenue>$ 0</revenue>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.get_week.xml
index 257dd359a5..2cb7df5a9e 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.get_week.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>0</nb_conversions>
<nb_visits_converted>0</nb_visits_converted>
- <conversion_rate>0</conversion_rate>
<revenue>0</revenue>
+ <conversion_rate>0%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.get_week.xml
index 78dc5020d7..8405e1d37a 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.get_week.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>100</conversion_rate>
<revenue>10</revenue>
+ <conversion_rate>100%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.get_week.xml
index 78dc5020d7..8405e1d37a 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.get_week.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>100</conversion_rate>
<revenue>10</revenue>
+ <conversion_rate>100%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.get_week.xml
index d896b423d7..76d1b80343 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.get_week.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
- <conversion_rate>50</conversion_rate>
<revenue>250</revenue>
+ <conversion_rate>50%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml
index fc23e7158e..837cc2b4c6 100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>3</nb_conversions>
<nb_visits_converted>2</nb_visits_converted>
- <conversion_rate>66.67</conversion_rate>
<revenue>3121.11</revenue>
+ <conversion_rate>66.67%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml
index 221f89f826..c9cd54530d 100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>5</nb_conversions>
<nb_visits_converted>4</nb_visits_converted>
- <conversion_rate>80</conversion_rate>
<revenue>13361.11</revenue>
+ <conversion_rate>80%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml
index d12d299554..de1db7a777 100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml
@@ -32,7 +32,7 @@
</row>
</customVariables>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -61,7 +61,7 @@
</row>
</customVariables>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -139,7 +139,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>721</visitDuration>
- <visitDurationPretty>12 min 1s</visitDurationPretty>
+ <visitDurationPretty>12 min 1s</visitDurationPretty>
<customVariables>
<row>
<customVariableName3>VisitorName</customVariableName3>
@@ -231,7 +231,7 @@
</row>
</customVariables>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -248,7 +248,7 @@
</row>
</customVariables>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -277,7 +277,7 @@
</row>
</customVariables>
<timeSpent>720</timeSpent>
- <timeSpentPretty>12 min 0s</timeSpentPretty>
+ <timeSpentPretty>12 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -362,7 +362,7 @@
</row>
</customVariables>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -391,7 +391,7 @@
</row>
</customVariables>
<timeSpent>180</timeSpent>
- <timeSpentPretty>3 min 0s</timeSpentPretty>
+ <timeSpentPretty>3 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -469,7 +469,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>3961</visitDuration>
- <visitDurationPretty>1 hours 6 min</visitDurationPretty>
+ <visitDurationPretty>1 hours 6 min</visitDurationPretty>
<customVariables>
<row>
<customVariableName3>VisitorName</customVariableName3>
@@ -583,7 +583,7 @@
</row>
</customVariables>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -612,7 +612,7 @@
</row>
</customVariables>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -689,7 +689,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>721</visitDuration>
- <visitDurationPretty>12 min 1s</visitDurationPretty>
+ <visitDurationPretty>12 min 1s</visitDurationPretty>
<customVariables>
<row>
<customVariableName4>ValueIsZero</customVariableName4>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv
index e629ceabf6..5610bff163 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv
@@ -4,8 +4,8 @@ Piwik test,5,16,16,$ 13361.11,5,4,$ 13351.11,100%,100%,100%,100%,100%,100%,100%
Piwik test,2,1,1,$ 250,1,0,$ 0,100%,100%,100%,100%,100%,0,0
Visits Summary
-nb_uniq_visitors,nb_users,nb_visits,nb_actions,max_actions,bounce_rate,nb_actions_per_visit,avg_time_on_site
-1,0,5,16,6,20%,3.2,00:22:49
+nb_uniq_visitors,nb_users,nb_visits,nb_actions,max_actions,nb_actions_per_visit,avg_time_on_site,bounce_rate
+1,0,5,16,6,3.2,00:22:49,20%
Visits by Server Time
label,nb_visits,nb_actions,revenue,nb_actions_per_visit,avg_time_on_site,bounce_rate
@@ -64,7 +64,7 @@ label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site
Visits by Day of Week
label,nb_visits,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate,nb_actions
Monday,0,0%,0,00:00:00,0%,0
-Tuesday,3,66.67%,4.33,00:30:01,0%,13
+Tuesday,3,66.67%,4.3,00:30:01,0%,13
Wednesday,2,100%,1.5,00:12:02,50%,3
Thursday,0,0%,0,00:00:00,0%,0
Friday,0,0%,0,00:00:00,0%,0
@@ -107,8 +107,8 @@ Polish (pl),4,12,75%,3,00:25:32,25%
French (fr),1,4,100%,4,00:12:01,0%
Ecommerce Orders
-nb_conversions,nb_visits_converted,conversion_rate,revenue,revenue_subtotal,revenue_tax,revenue_shipping,revenue_discount,items,avg_order_revenue
-4,2,40%,$ 13351.11,$ 2700,$ 531,$ 120.11,$ 686,12,$ 3337.78
+nb_conversions,nb_visits_converted,revenue,revenue_subtotal,revenue_tax,revenue_shipping,revenue_discount,items,avg_order_revenue,conversion_rate
+4,2,$ 13351.11,$ 2700,$ 531,$ 120.11,$ 686,12,$ 3337.78,40%
Ecommerce Orders - Visits to Conversion
label,nb_conversions
@@ -144,8 +144,8 @@ label,nb_conversions
365+ days,0
Abandoned Carts
-nb_conversions,conversion_rate,revenue,items
-3,60%,$ 7530.33,12
+nb_conversions,revenue,items,avg_order_revenue,conversion_rate
+3,$ 7530.33,12,$ 2510.11,60%
Abandoned Carts - Visits to Conversion
label,nb_conversions
@@ -182,39 +182,39 @@ label,nb_conversions
Product SKU
label,revenue,quantity,orders,nb_visits,avg_price,avg_quantity,conversion_rate
-SKU2,$ 1500,1,1,1,1500,1,100%
-SKU VERY nice indeed,$ 1011.22,3,2,4,255.61,1.5,50%
-ANOTHER SKU HERE,$ 600,6,1,0,100,6,0%
-TRIPOD SKU,$ 200,2,1,0,100,2,0%
-SKU IN ABANDONED CART TWO,$ 0,0,0,3,0,0,0%
+SKU2,$ 1500,1,1,1,$ 1500,1,100%
+SKU VERY nice indeed,$ 1011.22,3,2,4,$ 255.61,1.5,50%
+ANOTHER SKU HERE,$ 600,6,1,0,$ 100,6,0%
+TRIPOD SKU,$ 200,2,1,0,$ 100,2,0%
+SKU IN ABANDONED CART TWO,$ 0,0,0,3,$ 0,0,0%
Product Name
label,revenue,quantity,orders,avg_price,avg_quantity,conversion_rate,nb_visits
-Canon SLR,$ 1500,1,1,1500,1,0%,0
-PRODUCT name,$ 1011.22,3,2,255.61,1.5,100%,2
-PRODUCT name BIS,$ 600,6,1,100,6,0%,0
-TRIPOD - bought day after,$ 200,2,1,100,2,0%,0
-PRODUCT THREE LEFT in cart,$ 0,0,0,1332,0,0%,3
-PRODUCT TWO LEFT in cart,$ 0,0,0,0,0,0%,3
+Canon SLR,$ 1500,1,1,$ 1500,1,0%,0
+PRODUCT name,$ 1011.22,3,2,$ 255.61,1.5,100%,2
+PRODUCT name BIS,$ 600,6,1,$ 100,6,0%,0
+TRIPOD - bought day after,$ 200,2,1,$ 100,2,0%,0
+PRODUCT THREE LEFT in cart,$ 0,0,0,$ 1332,0,0%,3
+PRODUCT TWO LEFT in cart,$ 0,0,0,$ 0,0,0%,3
Product Category
label,revenue,quantity,orders,nb_visits,avg_price,avg_quantity,conversion_rate
-Electronics & Cameras,$ 2500,3,2,3,1000,1.5,66.67%
-Multiple Category 1,$ 1000,2,1,1,500,2,100%
-Multiple Category 2,$ 1000,2,1,1,500,2,100%
-Multiple Category 4,$ 1000,2,1,1,500,2,100%
-Multiple Category 5,$ 1000,2,1,1,500,2,100%
-Product Category not defined,$ 611.22,7,2,4,55.61,3.5,50%
-Tools,$ 200,2,1,0,100,2,0%
-Category TWO LEFT in cart,$ 0,0,0,3,0,0,0%
+Electronics & Cameras,$ 2500,3,2,3,$ 1000,1.5,66.67%
+Multiple Category 1,$ 1000,2,1,1,$ 500,2,100%
+Multiple Category 2,$ 1000,2,1,1,$ 500,2,100%
+Multiple Category 4,$ 1000,2,1,1,$ 500,2,100%
+Multiple Category 5,$ 1000,2,1,1,$ 500,2,100%
+Product Category not defined,$ 611.22,7,2,4,$ 55.61,3.5,50%
+Tools,$ 200,2,1,0,$ 100,2,0%
+Category TWO LEFT in cart,$ 0,0,0,3,$ 0,0,0%
Actions - Main metrics
-nb_pageviews,nb_uniq_pageviews,nb_downloads,nb_uniq_downloads,nb_outlinks,nb_uniq_outlinks,nb_searches,nb_keywords,avg_time_generation
-16,4,0,0,0,0,0,0,0s
+nb_pageviews,nb_uniq_pageviews,nb_downloads,nb_uniq_downloads,nb_outlinks,nb_uniq_outlinks,nb_searches,nb_keywords
+16,4,0,0,0,0,0,0
Page URLs
-label,nb_visits,nb_hits,avg_time_on_page,bounce_rate,exit_rate
-/index.htm,4,16,00:13:30,0%,100%
+label,nb_visits,nb_hits,bounce_rate,avg_time_on_page,exit_rate
+/index.htm,4,16,0%,00:13:30,100%
Entry pages
label,entry_nb_visits,entry_bounce_count,bounce_rate
@@ -225,15 +225,15 @@ label,nb_visits,exit_nb_visits,exit_rate
/index.htm,4,4,100%
Page titles
-label,nb_visits,nb_hits,avg_time_on_page,bounce_rate,exit_rate
- View product left in cart,3,9,00:06:00,0%,100%
- Another Product page,1,1,00:06:00,0%,0%
- Another Product page with multiple categories,1,1,00:00:00,0%,100%
- Another Product page with no category,1,1,00:00:00,0%,0%
- incredible title!,1,1,00:06:00,0%,0%
- Looking at Electronics & Cameras page again,1,1,00:06:00,0%,0%
- Looking at Electronics & Cameras page with a page level custom variable,1,1,00:06:00,0%,0%
- Looking at product page,1,1,00:12:00,0%,0%
+label,nb_visits,nb_hits,bounce_rate,avg_time_on_page,exit_rate
+ View product left in cart,3,9,0%,00:06:00,100%
+ Another Product page,1,1,0%,00:06:00,0%
+ Another Product page with multiple categories,1,1,0%,00:00:00,100%
+ Another Product page with no category,1,1,0%,00:00:00,0%
+ incredible title!,1,1,0%,00:06:00,0%
+ Looking at Electronics & Cameras page again,1,1,0%,00:06:00,0%
+ Looking at Electronics & Cameras page with a page level custom variable,1,1,0%,00:06:00,0%
+ Looking at product page,1,1,0%,00:12:00,0%
Entry page titles
label,entry_nb_visits,entry_bounce_count,bounce_rate
@@ -305,8 +305,8 @@ Social Networks
No data available
Goals
-nb_conversions,nb_visits_converted,conversion_rate,revenue
-5,4,80%,$ 13361.11
+nb_conversions,nb_visits_converted,revenue,conversion_rate
+5,4,$ 13361.11,80%
Visits to Conversion
label,nb_conversions,revenue
@@ -342,8 +342,8 @@ label,nb_conversions,revenue
365+ days,0,$ 0
Goal title match triggered ONCE
-nb_conversions,nb_visits_converted,conversion_rate,revenue
-1,1,20%,$ 10
+nb_conversions,nb_visits_converted,revenue,conversion_rate
+1,1,$ 10,20%
title match triggered ONCE - Visits to Conversion
label,nb_conversions
@@ -463,8 +463,8 @@ New visits,1
365+ days,0
Returning Visits
-nb_uniq_visitors_returning,nb_users_returning,nb_visits_returning,nb_actions_returning,nb_visits_converted_returning,sum_visit_length_returning,max_actions_returning,bounce_rate_returning,nb_actions_per_visit_returning,avg_time_on_site_returning
-1,0,4,12,3,6126,6,25%,3,00:25:32
+nb_uniq_visitors_returning,nb_users_returning,nb_visits_returning,nb_actions_returning,max_actions_returning,bounce_rate_returning,nb_actions_per_visit_returning,avg_time_on_site_returning
+1,0,4,12,6,25%,3,00:25:32
Provider
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
@@ -474,15 +474,11 @@ Device type
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
Desktop,5,16,80%,3.2,00:22:49,20%
-Device brand
-label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
-Unknown,5,16,80%,3.2,00:22:49,20%
-
Visitor Browser
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
Firefox,5,16,80%,3.2,00:22:49,20%
-Device model
+Device brand
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
Unknown,5,16,80%,3.2,00:22:49,20%
@@ -490,6 +486,10 @@ Browser version
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
Firefox 3.6,5,16,80%,3.2,00:22:49,20%
+Device model
+label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
+Unknown,5,16,80%,3.2,00:22:49,20%
+
Operating System families
label,nb_visits,nb_actions,conversion_rate,nb_actions_per_visit,avg_time_on_site,bounce_rate
Windows,5,16,80%,3.2,00:22:49,20%
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html
index 2a81f9f668..7861e2ab4e 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html
@@ -326,7 +326,7 @@
</li>
<li>
<a href="#DevicesDetection_getBrowserVersions" style="text-decoration:none; color: rgb(68,68,68);">
- Browser version
+ Browser Version
</a>
</li>
<li>
@@ -6604,7 +6604,7 @@
Back to top
</a>
<h2 id="DevicesDetection_getBrowserVersions" style="color: rgb(126,115,99); font-size: 11pt;">
- Browser version
+ Browser Version
</h2>
<img alt=""
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
index e87b70f40d..9bcbc71028 100644
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
@@ -4,7 +4,7 @@
</head>
<body style="color: rgb(68,68,68);">
-<a id="reportTop" target="_blank" href=""><img title="Go to Piwik" border="0" alt="Piwik" src='plugins/Morpheus/images/logo-header.png'/></a>
+<a id="reportTop" rel="noreferrer" target="_blank" href=""><img title="Go to Piwik" border="0" alt="Piwik" src='plugins/Morpheus/images/logo-header.png'/></a>
<h1 style="color: rgb(126,115,99); font-size: 11pt;">
Piwik test
@@ -340,18 +340,13 @@
</a>
</li>
<li>
- <a href="#DevicesDetection_getBrand" style="text-decoration:none; color: rgb(68,68,68);">
- Device brand
- </a>
- </li>
- <li>
<a href="#DevicesDetection_getBrowsers" style="text-decoration:none; color: rgb(68,68,68);">
Visitor Browser
</a>
</li>
<li>
- <a href="#DevicesDetection_getModel" style="text-decoration:none; color: rgb(68,68,68);">
- Device model
+ <a href="#DevicesDetection_getBrand" style="text-decoration:none; color: rgb(68,68,68);">
+ Device brand
</a>
</li>
<li>
@@ -360,6 +355,11 @@
</a>
</li>
<li>
+ <a href="#DevicesDetection_getModel" style="text-decoration:none; color: rgb(68,68,68);">
+ Device model
+ </a>
+ </li>
+ <li>
<a href="#DevicesDetection_getOsFamilies" style="text-decoration:none; color: rgb(68,68,68);">
Operating System families
</a>
@@ -526,25 +526,25 @@
<tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Bounce Rate </td>
+ Actions per Visit </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 20%
+ 3.2
</td>
</tr>
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Actions per Visit </td>
+ Avg. Visit Duration (in seconds) </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 3.2
+ 00:22:49
</td>
</tr>
<tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Avg. Visit Duration (in seconds) </td>
+ Bounce Rate </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:22:49
+ 20%
</td>
</tr>
</tbody>
@@ -1796,7 +1796,7 @@
13
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 4.33
+ 4.3
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
00:30:01
@@ -2467,21 +2467,13 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Conversion Rate </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 40%
- </td>
- </tr>
-
- <tr style="background-color: rgb(249,250,250)">
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
Revenue </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
$ 13351.11
</td>
</tr>
- <tr style="">
+ <tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
Subtotal </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
@@ -2489,7 +2481,7 @@
</td>
</tr>
- <tr style="background-color: rgb(249,250,250)">
+ <tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
Tax </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
@@ -2497,7 +2489,7 @@
</td>
</tr>
- <tr style="">
+ <tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
Shipping </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
@@ -2505,7 +2497,7 @@
</td>
</tr>
- <tr style="background-color: rgb(249,250,250)">
+ <tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
Discount </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
@@ -2513,7 +2505,7 @@
</td>
</tr>
- <tr style="">
+ <tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
Purchased Products </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
@@ -2521,13 +2513,21 @@
</td>
</tr>
- <tr style="background-color: rgb(249,250,250)">
+ <tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
Average Order Value </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
$ 3337.78
</td>
</tr>
+
+ <tr style="background-color: rgb(249,250,250)">
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ Conversion Rate </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 40%
+ </td>
+ </tr>
</tbody>
</table>
<br/>
@@ -2821,25 +2821,33 @@
<tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Conversion Rate </td>
+ Revenue left in cart </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 60%
+ $ 7530.33
</td>
</tr>
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Revenue left in cart </td>
+ Products left in cart </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- $ 7530.33
+ 12
</td>
</tr>
<tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Products left in cart </td>
+ Average Order Value </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 12
+ $ 2510.11
+ </td>
+ </tr>
+
+ <tr style="">
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ Conversion Rate </td>
+ <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
+ 60%
</td>
</tr>
</tbody>
@@ -3129,13 +3137,13 @@
&nbsp;Unique Purchases&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Average Price&nbsp;&nbsp;
+ &nbsp;Visits&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Average Quantity&nbsp;&nbsp;
+ &nbsp;Average Price&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Visits&nbsp;&nbsp;
+ &nbsp;Average Quantity&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Product Conversion Rate&nbsp;&nbsp;
@@ -3156,10 +3164,10 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1500
+ 1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1
+ $ 1500
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
1
@@ -3182,13 +3190,13 @@
2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 255.61
+ 4
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1.5
+ $ 255.61
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 4
+ 1.5
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
50%
@@ -3208,13 +3216,13 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 100
+ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 6
+ $ 100
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ 6
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -3234,13 +3242,13 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 100
+ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 2
+ $ 100
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ 2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -3260,13 +3268,13 @@
0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ 3
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ $ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 3
+ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -3299,13 +3307,13 @@
&nbsp;Unique Purchases&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Average Price&nbsp;&nbsp;
+ &nbsp;Visits&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Average Quantity&nbsp;&nbsp;
+ &nbsp;Average Price&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Visits&nbsp;&nbsp;
+ &nbsp;Average Quantity&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Product Conversion Rate&nbsp;&nbsp;
@@ -3326,13 +3334,13 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1500
+ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1
+ $ 1500
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ 1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -3352,13 +3360,13 @@
2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 255.61
+ 2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1.5
+ $ 255.61
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 2
+ 1.5
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
@@ -3378,13 +3386,13 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 100
+ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 6
+ $ 100
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ 6
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -3404,13 +3412,13 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 100
+ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 2
+ $ 100
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ 2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -3430,13 +3438,13 @@
0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1332
+ 3
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ $ 1332
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 3
+ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -3456,13 +3464,13 @@
0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ 3
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ $ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 3
+ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -3495,13 +3503,13 @@
&nbsp;Unique Purchases&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Average Price&nbsp;&nbsp;
+ &nbsp;Visits&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Average Quantity&nbsp;&nbsp;
+ &nbsp;Average Price&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Visits&nbsp;&nbsp;
+ &nbsp;Average Quantity&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Product Conversion Rate&nbsp;&nbsp;
@@ -3522,13 +3530,13 @@
2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1000
+ 3
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1.5
+ $ 1000
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 3
+ 1.5
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
66.67%
@@ -3548,13 +3556,13 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 500
+ 1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 2
+ $ 500
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1
+ 2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
@@ -3574,13 +3582,13 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 500
+ 1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 2
+ $ 500
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1
+ 2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
@@ -3600,13 +3608,13 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 500
+ 1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 2
+ $ 500
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1
+ 2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
@@ -3626,13 +3634,13 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 500
+ 1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 2
+ $ 500
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 1
+ 2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
@@ -3652,13 +3660,13 @@
2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 55.61
+ 4
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 3.5
+ $ 55.61
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 4
+ 3.5
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
50%
@@ -3678,13 +3686,13 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 100
+ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 2
+ $ 100
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ 2
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -3704,13 +3712,13 @@
0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ 3
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0
+ $ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 3
+ 0
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -3802,14 +3810,6 @@
0
</td>
</tr>
-
- <tr style="">
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Avg. generation time </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0s
- </td>
- </tr>
</tbody>
</table>
<br/>
@@ -3834,10 +3834,10 @@
&nbsp;Unique Pageviews&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Bounce Rate&nbsp;&nbsp;
+ &nbsp;Avg. time on page&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Avg. time on page&nbsp;&nbsp;
+ &nbsp;Bounce Rate&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Exit rate&nbsp;&nbsp;
@@ -3857,10 +3857,10 @@
4
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:13:30
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:13:30
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
@@ -3978,10 +3978,10 @@
&nbsp;Unique Pageviews&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Bounce Rate&nbsp;&nbsp;
+ &nbsp;Avg. time on page&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
- &nbsp;Avg. time on page&nbsp;&nbsp;
+ &nbsp;Bounce Rate&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Exit rate&nbsp;&nbsp;
@@ -3999,10 +3999,10 @@
3
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:06:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:06:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
@@ -4019,10 +4019,10 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:06:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:06:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -4039,10 +4039,10 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:00:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:00:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
100%
@@ -4059,10 +4059,10 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:00:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:00:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -4079,10 +4079,10 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:06:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:06:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -4099,10 +4099,10 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:06:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:06:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -4119,10 +4119,10 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:06:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:06:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -4139,10 +4139,10 @@
1
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 0%
+ 00:12:00
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 00:12:00
+ 0%
</td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
0%
@@ -4465,17 +4465,17 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Conversion Rate </td>
+ Revenue </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 80%
+ $ 13361.11
</td>
</tr>
<tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Revenue </td>
+ Conversion Rate </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- $ 13361.11
+ 80%
</td>
</tr>
</tbody>
@@ -4866,17 +4866,17 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Conversion Rate </td>
+ Revenue </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 20%
+ $ 10
</td>
</tr>
<tr style="background-color: rgb(249,250,250)">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Revenue </td>
+ Conversion Rate </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- $ 10
+ 20%
</td>
</tr>
</tbody>
@@ -6098,22 +6098,6 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Number of converted returning visits </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 3
- </td>
- </tr>
-
- <tr style="background-color: rgb(249,250,250)">
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Total time spent by returning visitors (in seconds) </td>
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- 6126
- </td>
- </tr>
-
- <tr style="">
- <td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
Maximum actions in one returning visit </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
6
@@ -6273,8 +6257,8 @@
<a style="text-decoration:none; color: rgb(126,115,99); font-size: 9pt;" href="#reportTop">
Back to top
</a>
-<h2 id="DevicesDetection_getBrand" style="color: rgb(126,115,99); font-size: 11pt;">
- Device brand
+<h2 id="DevicesDetection_getBrowsers" style="color: rgb(126,115,99); font-size: 11pt;">
+ Visitor Browser
</h2>
@@ -6282,7 +6266,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Device brand&nbsp;&nbsp;
+ &nbsp;Browser&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Visits&nbsp;&nbsp;
@@ -6307,9 +6291,9 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- <img src='plugins/DevicesDetection/images/brand/Unknown.ico'>
+ <img src='plugins/UserSettings/images/browsers/FF.gif'>
&nbsp;
- Unknown </td>
+ Firefox </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
5
</td>
@@ -6335,8 +6319,8 @@
<a style="text-decoration:none; color: rgb(126,115,99); font-size: 9pt;" href="#reportTop">
Back to top
</a>
-<h2 id="DevicesDetection_getBrowsers" style="color: rgb(126,115,99); font-size: 11pt;">
- Visitor Browser
+<h2 id="DevicesDetection_getBrand" style="color: rgb(126,115,99); font-size: 11pt;">
+ Device brand
</h2>
@@ -6344,7 +6328,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Browser&nbsp;&nbsp;
+ &nbsp;Device brand&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Visits&nbsp;&nbsp;
@@ -6369,9 +6353,9 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- <img src='plugins/UserSettings/images/browsers/FF.gif'>
+ <img src='plugins/DevicesDetection/images/brand/Unknown.ico'>
&nbsp;
- Firefox </td>
+ Unknown </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
5
</td>
@@ -6397,8 +6381,8 @@
<a style="text-decoration:none; color: rgb(126,115,99); font-size: 9pt;" href="#reportTop">
Back to top
</a>
-<h2 id="DevicesDetection_getModel" style="color: rgb(126,115,99); font-size: 11pt;">
- Device model
+<h2 id="DevicesDetection_getBrowserVersions" style="color: rgb(126,115,99); font-size: 11pt;">
+ Browser version
</h2>
@@ -6406,7 +6390,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Device model&nbsp;&nbsp;
+ &nbsp;Browser version&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Visits&nbsp;&nbsp;
@@ -6431,7 +6415,9 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- Unknown </td>
+ <img src='plugins/UserSettings/images/browsers/FF.gif'>
+ &nbsp;
+ Firefox 3.6 </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
5
</td>
@@ -6457,8 +6443,8 @@
<a style="text-decoration:none; color: rgb(126,115,99); font-size: 9pt;" href="#reportTop">
Back to top
</a>
-<h2 id="DevicesDetection_getBrowserVersions" style="color: rgb(126,115,99); font-size: 11pt;">
- Browser version
+<h2 id="DevicesDetection_getModel" style="color: rgb(126,115,99); font-size: 11pt;">
+ Device model
</h2>
@@ -6466,7 +6452,7 @@
<table style="border-collapse:collapse; margin-left: 5px;">
<thead style="background-color: rgb(228,226,215); color: rgb(37,87,146); font-size: 11pt;">
<th style="padding: 6px 0;">
- &nbsp;Browser version&nbsp;&nbsp;
+ &nbsp;Device model&nbsp;&nbsp;
</th>
<th style="padding: 6px 0;">
&nbsp;Visits&nbsp;&nbsp;
@@ -6491,9 +6477,7 @@
<tr style="">
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
- <img src='plugins/UserSettings/images/browsers/FF.gif'>
- &nbsp;
- Firefox 3.6 </td>
+ Unknown </td>
<td style="font-size: 11pt; border-bottom: 1px solid rgb(231,231,231); padding: 5px 0 5px 5px;">
5
</td>
diff --git a/tests/PHPUnit/System/expected/test_noVisit__Actions.get_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.get_day.xml
index 6eb4818cba..6006b449a7 100644
--- a/tests/PHPUnit/System/expected/test_noVisit__Actions.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.get_day.xml
@@ -8,5 +8,4 @@
<nb_uniq_outlinks>0</nb_uniq_outlinks>
<nb_searches>0</nb_searches>
<nb_keywords>0</nb_keywords>
- <avg_time_generation>0</avg_time_generation>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_noVisit__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Goals.get_day.xml
index 257dd359a5..2cb7df5a9e 100644
--- a/tests/PHPUnit/System/expected/test_noVisit__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Goals.get_day.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>0</nb_conversions>
<nb_visits_converted>0</nb_visits_converted>
- <conversion_rate>0</conversion_rate>
<revenue>0</revenue>
+ <conversion_rate>0%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__MultiSites.getAll_day.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__MultiSites.getAll_day.xml
index 75e0ce7728..3d6283b321 100644
--- a/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__MultiSites.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__MultiSites.getAll_day.xml
@@ -3,13 +3,13 @@
<row>
<nb_visits>2</nb_visits>
<nb_actions>3</nb_actions>
+ <nb_pageviews>3</nb_pageviews>
+ <revenue>0</revenue>
<label>Site AAAAAA</label>
<visits_evolution>0%</visits_evolution>
<actions_evolution>0%</actions_evolution>
<pageviews_evolution>0%</pageviews_evolution>
<revenue_evolution>0%</revenue_evolution>
- <nb_pageviews>3</nb_pageviews>
- <revenue>0</revenue>
<group />
<main_url>http://piwik.net</main_url>
<idsite>1</idsite>
diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
index 9efeb67c66..077a490219 100644
--- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
@@ -49,9 +49,9 @@
<nb_visits>3</nb_visits>
<nb_actions>5</nb_actions>
<revenue>$ 1000</revenue>
- <nb_actions_per_visit>1.67</nb_actions_per_visit>
+ <nb_actions_per_visit>1.7</nb_actions_per_visit>
<avg_time_on_site>00:04:02</avg_time_on_site>
- <bounce_rate>66.67%</bounce_rate>
+ <bounce_rate>67%</bounce_rate>
</row>
</reportData>
<reportMetadata>
diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Goals.get_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Goals.get_range.xml
index cf9900ec47..26bf6746c5 100644
--- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Goals.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Goals.get_range.xml
@@ -2,6 +2,6 @@
<result>
<nb_conversions>3</nb_conversions>
<nb_visits_converted>2</nb_visits_converted>
- <conversion_rate>66.67</conversion_rate>
<revenue>1000</revenue>
+ <conversion_rate>66.67%</conversion_rate>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml
index 53e26b56a6..a4a21e48af 100644
--- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisits.xml
@@ -152,7 +152,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>361</visitDuration>
- <visitDurationPretty>6 min 1s</visitDurationPretty>
+ <visitDurationPretty>6 min 1s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>VisitorType</customVariableName1>
@@ -244,7 +244,7 @@
<pageId>1</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -323,7 +323,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>364</visitDuration>
- <visitDurationPretty>6 min 4s</visitDurationPretty>
+ <visitDurationPretty>6 min 4s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>VisitorType</customVariableName1>
diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml
index 53e26b56a6..a4a21e48af 100644
--- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml
@@ -152,7 +152,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>361</visitDuration>
- <visitDurationPretty>6 min 1s</visitDurationPretty>
+ <visitDurationPretty>6 min 1s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>VisitorType</customVariableName1>
@@ -244,7 +244,7 @@
<pageId>1</pageId>
<timeSpent>360</timeSpent>
- <timeSpentPretty>6 min 0s</timeSpentPretty>
+ <timeSpentPretty>6 min 0s</timeSpentPretty>
<icon />
</row>
<row>
@@ -323,7 +323,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>364</visitDuration>
- <visitDurationPretty>6 min 4s</visitDurationPretty>
+ <visitDurationPretty>6 min 4s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>VisitorType</customVariableName1>
diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml
index 8cef8c5e23..b1e550645e 100644
--- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml
@@ -26,7 +26,7 @@
<prettyName>France</prettyName>
</row>
</countries>
- <totalVisitDurationPretty>6 min 1s</totalVisitDurationPretty>
+ <totalVisitDurationPretty>6 min 1s</totalVisitDurationPretty>
<firstVisit>
@@ -196,7 +196,7 @@
<daysSinceFirstVisit>0</daysSinceFirstVisit>
<daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
<visitDuration>361</visitDuration>
- <visitDurationPretty>6 min 1s</visitDurationPretty>
+ <visitDurationPretty>6 min 1s</visitDurationPretty>
<customVariables>
<row>
<customVariableName1>VisitorType</customVariableName1>
diff --git a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
index 104b5cfd27..29e569654b 100644
--- a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
@@ -8,7 +8,7 @@
<module>CustomVariables</module>
<action>getCustomVariablesValuesFromNameId</action>
<dimension>Custom Variable value</dimension>
- <documentation>This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. &lt;br /&gt; For more information about Custom Variables in general, read the &lt;a href=&quot;http://piwik.org/docs/custom-variables/&quot; target=&quot;_blank&quot;&gt;Custom Variables documentation on piwik.org&lt;/a&gt;</documentation>
+ <documentation>This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. &lt;br /&gt; For more information about Custom Variables in general, read the &lt;a href=&quot;http://piwik.org/docs/custom-variables/&quot; rel=&quot;noreferrer&quot; target=&quot;_blank&quot;&gt;Custom Variables documentation on piwik.org&lt;/a&gt;</documentation>
<isSubtableReport>1</isSubtableReport>
<metrics>
<nb_visits>Visits</nb_visits>
diff --git a/tests/PHPUnit/TestingEnvironment.php b/tests/PHPUnit/TestingEnvironment.php
index 98e1566c5d..3378f99444 100644
--- a/tests/PHPUnit/TestingEnvironment.php
+++ b/tests/PHPUnit/TestingEnvironment.php
@@ -278,4 +278,4 @@ class Piwik_TestingEnvironment
{
Piwik::postEvent("TestingEnvironment.addHooks", array($this), $pending = true);
}
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI
-Subproject bcdeaa3b62f66494d427239ffc9241020284517
+Subproject fc31cff5f41c1aba77ab03226f52ae721b91e0a
diff --git a/tests/PHPUnit/Unit/Metrics/Formatter/HtmlTest.php b/tests/PHPUnit/Unit/Metrics/Formatter/HtmlTest.php
new file mode 100644
index 0000000000..fd9b996f50
--- /dev/null
+++ b/tests/PHPUnit/Unit/Metrics/Formatter/HtmlTest.php
@@ -0,0 +1,91 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Tests\Unit\Metrics\Formatter;
+
+use Piwik\Metrics\Formatter\Html;
+use Piwik\Translate;
+use Piwik\Plugins\SitesManager\API as SitesManagerAPI;
+
+/**
+ * @group Core
+ */
+class HtmlTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var Html
+ */
+ private $formatter;
+
+ private $sitesInfo;
+
+ public function setUp()
+ {
+ $this->sitesInfo = array(
+ 1 => array(
+ 'idsite' => '1',
+ 'currency' => 'EUR'
+ )
+ );
+
+ $this->formatter = new Html();
+
+ setlocale(LC_ALL, null);
+
+ Translate::loadEnglishTranslation();
+ $this->setSiteManagerApiMock();
+ }
+
+ public function tearDown()
+ {
+ Translate::unloadEnglishTranslation();
+ $this->unsetSiteManagerApiMock();
+
+ setlocale(LC_ALL, null);
+ }
+
+ public function test_getPrettyTimeFromSeconds_DefaultsToShowingSentences_AndUsesNonBreakingSpaces()
+ {
+ $expected = '1&nbsp;days&nbsp;10&nbsp;hours';
+ $value = $this->formatter->getPrettyTimeFromSeconds(86400 + 3600 * 10);
+
+ $this->assertEquals($expected, $value);
+ }
+
+ public function test_getPrettySizeFromBytes_UsesNonBreakingSpaces()
+ {
+ $expected = '1.5&nbsp;K';
+ $value = $this->formatter->getPrettySizeFromBytes(1536);
+
+ $this->assertEquals($expected, $value);
+ }
+
+ public function test_getPrettyMoney_UsesNonBreakingSpaces()
+ {
+ $expected = '1&nbsp;€';
+ $value = $this->formatter->getPrettyMoney(1, 1);
+
+ $this->assertEquals($expected, $value);
+ }
+
+ private function unsetSiteManagerApiMock()
+ {
+ SitesManagerAPI::unsetInstance();
+ }
+
+ private function setSiteManagerApiMock()
+ {
+ $sitesInfo = $this->sitesInfo;
+
+ $mock = $this->getMock('stdClass', array('getSiteFromId'));
+ $mock->expects($this->any())->method('getSiteFromId')->willReturnCallback(function ($idSite) use ($sitesInfo) {
+ return $sitesInfo[$idSite];
+ });
+
+ SitesManagerAPI::setSingletonInstance($mock);
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Unit/Metrics/FormatterTest.php b/tests/PHPUnit/Unit/Metrics/FormatterTest.php
new file mode 100644
index 0000000000..8ef4831299
--- /dev/null
+++ b/tests/PHPUnit/Unit/Metrics/FormatterTest.php
@@ -0,0 +1,232 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Tests\Unit\Metrics;
+
+use Piwik\Metrics\Formatter;
+use Piwik\Translate;
+use Piwik\Plugins\SitesManager\API as SitesManagerAPI;
+
+/**
+ * @group Core
+ */
+class FormatterTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var Formatter
+ */
+ private $formatter;
+
+ private $sitesInfo;
+
+ public function setUp()
+ {
+ $this->sitesInfo = array(
+ 1 => array(
+ 'idsite' => '1',
+ 'currency' => 'EUR'
+ ),
+ 2 => array(
+ 'idsite' => '2',
+ 'currency' => 'DKK'
+ ),
+ 3 => array(
+ 'idsite' => '3',
+ 'currency' => 'PLN'
+ ),
+ 4 => array(
+ 'idsite' => '4',
+ 'currency' => 'NZD'
+ ),
+ 5 => array(
+ 'idsite' => '5',
+ 'currency' => 'JPY'
+ )
+ );
+
+ $this->formatter = new Formatter();
+
+ setlocale(LC_ALL, null);
+
+ Translate::loadEnglishTranslation();
+ $this->setSiteManagerApiMock();
+ }
+
+ public function tearDown()
+ {
+ Translate::unloadEnglishTranslation();
+ $this->unsetSiteManagerApiMock();
+
+ setlocale(LC_ALL, null);
+ }
+
+ /**
+ * @dataProvider getPrettyNumberTestData
+ */
+ public function test_getPrettyNumber_ReturnsCorrectResult($number, $expected)
+ {
+ $this->assertEquals($expected, $this->formatter->getPrettyNumber($number, 2));
+ }
+
+ /**
+ * @dataProvider getPrettyNumberLocaleTestData
+ */
+ public function test_getPrettyNumber_ReturnsCorrectResult_WhenLocaleIsEuropean($number, $expected)
+ {
+ $locale = setlocale(LC_ALL, array('de', 'de_DE', 'ge', 'de_DE.utf8'));
+ if (empty($locale)) {
+ $this->markTestSkipped("de_DE locale is not present on this system");
+ }
+
+ $this->assertEquals($expected, $this->formatter->getPrettyNumber($number, 2));
+ }
+
+ /**
+ * @dataProvider getPrettySizeFromBytesTestData
+ */
+ public function test_getPrettySizeFromBytes_ReturnsCorrectResult($bytesSize, $unit, $expected)
+ {
+ $this->assertEquals($expected, $this->formatter->getPrettySizeFromBytes($bytesSize, $unit));
+ }
+
+ /**
+ * @dataProvider getPrettyMoneyTestData
+ */
+ public function test_getPrettyMoney_ReturnsCorrectResult($value, $idSite, $expected)
+ {
+ $this->assertEquals($expected, $this->formatter->getPrettyMoney($value, $idSite));
+ }
+
+ /**
+ * @dataProvider getPrettyPercentFromQuotientTestData
+ */
+ public function test_getPrettyPercentFromQuotient_ReturnsCorrectResult($value, $expected)
+ {
+ $this->assertEquals($expected, $this->formatter->getPrettyPercentFromQuotient($value));
+ }
+
+ /**
+ * @dataProvider getPrettyTimeFromSecondsData
+ */
+ public function test_getPrettyTimeFromSeconds_ReturnsCorrectResult($seconds, $expected)
+ {
+ if (($seconds * 100) > PHP_INT_MAX) {
+ $this->markTestSkipped("Will not pass on 32-bit machine.");
+ }
+
+ $sentenceExpected = $expected[0];
+ $this->assertEquals($sentenceExpected, $this->formatter->getPrettyTimeFromSeconds($seconds, $sentence = true));
+
+ $numericExpected = $expected[1];
+ $this->assertEquals($numericExpected, $this->formatter->getPrettyTimeFromSeconds($seconds, $sentence = false));
+ }
+
+ public function getPrettyNumberTestData()
+ {
+ return array(
+ array(0.14, '0.14'),
+ array(0.14567, '0.15'),
+ array(100.1234, '100.12'),
+ array(1000.45, '1,000.45'),
+ array(23456789.00, '23,456,789.00')
+ );
+ }
+
+ public function getPrettyNumberLocaleTestData()
+ {
+ return array(
+ array(0.14, '0,14'),
+ array(0.14567, '0,15'),
+ array(100.1234, '100,12'),
+ array(1000.45, '1.000,45'),
+ array(23456789.00, '23.456.789,00')
+ );
+ }
+
+ public function getPrettySizeFromBytesTestData()
+ {
+ return array(
+ array(767, null, '767 B'),
+ array(1024, null, '1 K'),
+ array(1536, null, '1.5 K'),
+ array(1024 * 1024, null, '1 M'),
+ array(1.25 * 1024 * 1024, null, '1.3 M'),
+ array(1.25 * 1024 * 1024 * 1024, null, '1.3 G'),
+ array(1.25 * 1024 * 1024 * 1024 * 1024, null, '1.3 T'),
+ array(1.25 * 1024 * 1024 * 1024 * 1024 * 1024, null, '1280 T'),
+ array(1.25 * 1024 * 1024, 'M', '1.3 M'),
+ array(1.25 * 1024 * 1024 * 1024, 'M', '1280 M'),
+ array(0, null, '0 M')
+ );
+ }
+
+ public function getPrettyMoneyTestData()
+ {
+ return array(
+ array(1, 1, '1 €'),
+ array(1.045, 2, '1.04 kr'),
+ array(1000.4445, 3, '1000.44 zł'),
+ array(1234.56, 4, '$ 1234.56'),
+ array(234.76, 5, '¥ 234.76')
+ );
+ }
+
+ public function getPrettyPercentFromQuotientTestData()
+ {
+ return array(
+ array(100, '10000%'),
+ array(1, '100%'),
+ array(.85, '85%'),
+ array(.89999, '89.999%'),
+ array(.0004, '0.04%')
+ );
+ }
+
+ /**
+ * Dataprovider for testGetPrettyTimeFromSeconds
+ */
+ public function getPrettyTimeFromSecondsData()
+ {
+ return array(
+ array(30, array('30s', '00:00:30')),
+ array(60, array('1 min 0s', '00:01:00')),
+ array(100, array('1 min 40s', '00:01:40')),
+ array(3600, array('1 hours 0 min', '01:00:00')),
+ array(3700, array('1 hours 1 min', '01:01:40')),
+ array(86400 + 3600 * 10, array('1 days 10 hours', '34:00:00')),
+ array(86400 * 365, array('365 days 0 hours', '8760:00:00')),
+ array((86400 * (365.25 + 10)), array('1 years 10 days', '9006:00:00')),
+ array(1.342, array('1.34s', '00:00:01.34')),
+ array(.342, array('0.34s', '00:00:00.34')),
+ array(.02, array('0.02s', '00:00:00.02')),
+ array(.002, array('0.002s', '00:00:00')),
+ array(1.002, array('1s', '00:00:01')),
+ array(1.02, array('1.02s', '00:00:01.02')),
+ array(1.2, array('1.2s', '00:00:01.20')),
+ array(122.1, array('2 min 2.1s', '00:02:02.10')),
+ array(-122.1, array('-2 min 2.1s', '-00:02:02.10')),
+ array(86400 * -365, array('-365 days 0 hours', '-8760:00:00'))
+ );
+ }
+
+ private function unsetSiteManagerApiMock()
+ {
+ SitesManagerAPI::unsetInstance();
+ }
+
+ private function setSiteManagerApiMock()
+ {
+ $sitesInfo = $this->sitesInfo;
+
+ $mock = $this->getMock('stdClass', array('getSiteFromId'));
+ $mock->expects($this->any())->method('getSiteFromId')->willReturnCallback(function ($idSite) use ($sitesInfo) {
+ return $sitesInfo[$idSite];
+ });
+
+ SitesManagerAPI::setSingletonInstance($mock);
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Unit/MetricsTest.php b/tests/PHPUnit/Unit/MetricsTest.php
index 610e1cf459..20202232ef 100644
--- a/tests/PHPUnit/Unit/MetricsTest.php
+++ b/tests/PHPUnit/Unit/MetricsTest.php
@@ -39,7 +39,7 @@ class Core_MetricsTest extends \PHPUnit_Framework_TestCase
*/
public function testGetMappingFromIdToName()
{
- $mapping = Metrics::getMappingFromIdToName();
+ $mapping = Metrics::getMappingFromNameToId();
$expectedMapping = array(
'nb_uniq_visitors' => 1,
'nb_visits' => 2,
diff --git a/tmp/.gitkeep b/tmp/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tmp/.gitkeep
+++ /dev/null