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:
-rw-r--r--core/API/Request.php33
-rw-r--r--core/Plugin/Visualization.php7
-rw-r--r--plugins/Referrers/API.php38
-rw-r--r--plugins/Referrers/tests/System/expected/test_Referrers_getReferrerType__API.getProcessedReport_day.xml62
-rw-r--r--plugins/Referrers/tests/System/expected/test_phpSerialized__Referrers.getReferrerType_year.originalbin2948 -> 2998 bytes
-rw-r--r--plugins/ScheduledReports/Controller.php5
-rw-r--r--plugins/SegmentEditor/SegmentSelectorControl.php2
-rw-r--r--plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_unprocessed_segment.png4
-rw-r--r--tests/PHPUnit/System/expected/test_DataComparisonTest_invertCompare__Referrers.getAll_month.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_DataComparisonTest_periods__Referrers.getAll_month.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_DataComparisonTest_rangePeriodAgainstSingle__Referrers.getAll_range.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_DataComparisonTest_segmentsAndPeriods__Referrers.getAll_month.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_DataComparisonTest_segments__Referrers.getAll_month.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getAll_month.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getReferrerType_month.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getAll_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getReferrerType_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getAll_day.xml4
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getReferrerType_day.xml2
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getAll_day.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getReferrerType_day.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_flattened__Referrers.getAll_day.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_flattened__Referrers.getReferrerType_day.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getAll_day.xml8
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getReferrerType_day.xml3
25 files changed, 159 insertions, 67 deletions
diff --git a/core/API/Request.php b/core/API/Request.php
index cf323f4483..08dfc241ca 100644
--- a/core/API/Request.php
+++ b/core/API/Request.php
@@ -215,25 +215,25 @@ class Request
*/
public function process()
{
- // read the format requested for the output data
- $outputFormat = strtolower(Common::getRequestVar('format', 'xml', 'string', $this->request));
+ try {
+ ++self::$nestedApiInvocationCount;
- $disablePostProcessing = $this->shouldDisablePostProcessing();
+ // read the format requested for the output data
+ $outputFormat = strtolower(Common::getRequestVar('format', 'xml', 'string', $this->request));
- // create the response
- $response = new ResponseBuilder($outputFormat, $this->request);
- if ($disablePostProcessing) {
- $response->disableDataTablePostProcessor();
- }
+ $disablePostProcessing = $this->shouldDisablePostProcessing();
- $corsHandler = new CORSHandler();
- $corsHandler->handle();
+ // create the response
+ $response = new ResponseBuilder($outputFormat, $this->request);
+ if ($disablePostProcessing) {
+ $response->disableDataTablePostProcessor();
+ }
- $tokenAuth = Common::getRequestVar('token_auth', '', 'string', $this->request);
- $shouldReloadAuth = false;
+ $corsHandler = new CORSHandler();
+ $corsHandler->handle();
- try {
- ++self::$nestedApiInvocationCount;
+ $tokenAuth = Common::getRequestVar('token_auth', '', 'string', $this->request);
+ $shouldReloadAuth = false;
// IP check is needed here as we cannot listen to API.Request.authenticate as it would then not return proper API format response.
// We can also not do it by listening to API.Request.dispatch as by then the user is already authenticated and we want to make sure
@@ -643,6 +643,11 @@ class Request
*/
Piwik::postEvent('Request.shouldDisablePostProcessing', [&$shouldDisable, $this->request]);
+ if (!$shouldDisable) {
+ $shouldDisable = self::isCurrentApiRequestTheRootApiRequest() &&
+ Common::getRequestVar('disable_root_datatable_post_processor', 0, 'int', $this->request) == 1;
+ }
+
return $shouldDisable;
}
}
diff --git a/core/Plugin/Visualization.php b/core/Plugin/Visualization.php
index 496a09cd1d..0827f46449 100644
--- a/core/Plugin/Visualization.php
+++ b/core/Plugin/Visualization.php
@@ -332,8 +332,12 @@ class Visualization extends ViewDataTable
PluginManager::getInstance()->checkIsPluginActivated($module);
+ $proxyRequestParams = array_merge($request, [
+ 'disable_root_datatable_post_processor' => 1,
+ ]);
+
$class = ApiRequest::getClassNameAPI($module);
- $dataTable = Proxy::getInstance()->call($class, $method, $request);
+ $dataTable = Proxy::getInstance()->call($class, $method, $proxyRequestParams);
$response = new ResponseBuilder($format = 'original', $request);
$response->disableSendHeader();
@@ -520,7 +524,6 @@ class Visualization extends ViewDataTable
$postProcessor->setCallbackAfterGenericFilters(function (DataTable\DataTableInterface $dataTable) use ($self) {
$self->setDataTable($dataTable);
-
$self->afterGenericFiltersAreAppliedToLoadedDataTable();
// queue other filters so they can be applied later if queued filters are disabled
diff --git a/plugins/Referrers/API.php b/plugins/Referrers/API.php
index dd5d223c8c..65041ce339 100644
--- a/plugins/Referrers/API.php
+++ b/plugins/Referrers/API.php
@@ -18,9 +18,8 @@ use Piwik\DataTable\Filter\ColumnCallbackAddColumnPercentage;
use Piwik\Date;
use Piwik\Metrics;
use Piwik\Piwik;
-use Piwik\Plugin\ReportsProvider;
+use Piwik\Plugins\LocalDevUtilities\LocalDevUtilities;
use Piwik\Plugins\Referrers\DataTable\Filter\GroupDifferentSocialWritings;
-use Piwik\Plugins\Referrers\Reports\Get;
use Piwik\Site;
/**
@@ -66,7 +65,7 @@ class API extends \Piwik\Plugin\API
$dataTable->filter(ColumnCallbackAddColumnPercentage::class, [
$column . '_percent',
$column,
- $totalVisits
+ $totalVisits,
]);
}
@@ -115,7 +114,7 @@ class API extends \Piwik\Plugin\API
* @return DataTable
*/
public function getReferrerType($idSite, $period, $date, $segment = false, $typeReferrer = false,
- $idSubtable = false, $expanded = false)
+ $idSubtable = false, $expanded = false, $_setReferrerTypeLabel = true)
{
Piwik::checkUserHasViewAccess($idSite);
@@ -170,8 +169,12 @@ class API extends \Piwik\Plugin\API
Common::REFERRER_TYPE_WEBSITE => 'website',
)
));
+
// set referrer type column to readable value
- $dataTable->queueFilter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getReferrerTypeLabel'));
+ if ($_setReferrerTypeLabel == 1) {
+ $dataTable->filter(DataTable\Filter\ColumnCallbackAddMetadata::class, ['label', 'referrer_type']);
+ $dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getReferrerTypeLabel'));
+ }
return $dataTable;
}
@@ -201,6 +204,7 @@ class API extends \Piwik\Plugin\API
'expanded' => true,
'disable_generic_filters' => true,
'disable_queued_filters' => true,
+ '_setReferrerTypeLabel' => 0,
], []);
if ($dataTable instanceof DataTable\Map) {
@@ -723,20 +727,22 @@ class API extends \Piwik\Plugin\API
{
if ($table instanceof DataTable) {
$nameToColumnId = array(
- 'Referrers_visitorsFromSearchEngines' => Common::REFERRER_TYPE_SEARCH_ENGINE,
- 'Referrers_visitorsFromSocialNetworks' => Common::REFERRER_TYPE_SOCIAL_NETWORK,
- 'Referrers_visitorsFromDirectEntry' => Common::REFERRER_TYPE_DIRECT_ENTRY,
- 'Referrers_visitorsFromWebsites' => Common::REFERRER_TYPE_WEBSITE,
- 'Referrers_visitorsFromCampaigns' => Common::REFERRER_TYPE_CAMPAIGN,
+ Common::REFERRER_TYPE_SEARCH_ENGINE => 'Referrers_visitorsFromSearchEngines',
+ Common::REFERRER_TYPE_SOCIAL_NETWORK => 'Referrers_visitorsFromSocialNetworks',
+ Common::REFERRER_TYPE_DIRECT_ENTRY => 'Referrers_visitorsFromDirectEntry',
+ Common::REFERRER_TYPE_WEBSITE => 'Referrers_visitorsFromWebsites',
+ Common::REFERRER_TYPE_CAMPAIGN => 'Referrers_visitorsFromCampaigns',
);
- $newRow = array();
- foreach ($nameToColumnId as $nameVar => $columnId) {
- $value = 0;
- $row = $table->getRowFromLabel($columnId);
- if ($row !== false) {
- $value = $row->getColumn(Metrics::INDEX_NB_VISITS);
+ $newRow = array_fill_keys(array_values($nameToColumnId), 0);
+ foreach ($table->getRows() as $row) {
+ $referrerType = $row->getMetadata('referrer_type');
+ if (empty($nameToColumnId[$referrerType])) {
+ continue;
}
+
+ $nameVar = $nameToColumnId[$referrerType];
+ $value = $row->getColumn(Metrics::INDEX_NB_VISITS);
$newRow[$nameVar] = $value;
}
diff --git a/plugins/Referrers/tests/System/expected/test_Referrers_getReferrerType__API.getProcessedReport_day.xml b/plugins/Referrers/tests/System/expected/test_Referrers_getReferrerType__API.getProcessedReport_day.xml
index 07f605a12b..6671bf1bce 100644
--- a/plugins/Referrers/tests/System/expected/test_Referrers_getReferrerType__API.getProcessedReport_day.xml
+++ b/plugins/Referrers/tests/System/expected/test_Referrers_getReferrerType__API.getProcessedReport_day.xml
@@ -876,310 +876,372 @@
<result prettyDate="Thursday, February 4, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Friday, February 5, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Saturday, February 6, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Sunday, February 7, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Monday, February 8, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Tuesday, February 9, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Wednesday, February 10, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Thursday, February 11, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Friday, February 12, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Saturday, February 13, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Sunday, February 14, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Monday, February 15, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Tuesday, February 16, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Wednesday, February 17, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Thursday, February 18, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Friday, February 19, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Saturday, February 20, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Sunday, February 21, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Monday, February 22, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Tuesday, February 23, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Wednesday, February 24, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Thursday, February 25, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Friday, February 26, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Saturday, February 27, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Sunday, February 28, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Monday, March 1, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Tuesday, March 2, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Wednesday, March 3, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Thursday, March 4, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Friday, March 5, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
<result prettyDate="Saturday, March 6, 2010">
<row>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<idsubdatatable>2</idsubdatatable>
</row>
<row>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<idsubdatatable>3</idsubdatatable>
</row>
</result>
diff --git a/plugins/Referrers/tests/System/expected/test_phpSerialized__Referrers.getReferrerType_year.original b/plugins/Referrers/tests/System/expected/test_phpSerialized__Referrers.getReferrerType_year.original
index b711e299fa..66da7d471e 100644
--- a/plugins/Referrers/tests/System/expected/test_phpSerialized__Referrers.getReferrerType_year.original
+++ b/plugins/Referrers/tests/System/expected/test_phpSerialized__Referrers.getReferrerType_year.original
Binary files differ
diff --git a/plugins/ScheduledReports/Controller.php b/plugins/ScheduledReports/Controller.php
index 22b977cdd5..ecbf950be4 100644
--- a/plugins/ScheduledReports/Controller.php
+++ b/plugins/ScheduledReports/Controller.php
@@ -114,8 +114,9 @@ class Controller extends \Piwik\Plugin\Controller
$savedSegmentsById = array(
'' => Piwik::translate('SegmentEditor_DefaultAllVisits')
- );
- foreach (APISegmentEditor::getInstance()->getAll($this->idSite) as $savedSegment) {
+ );
+ $response = Request::processRequest("SegmentEditor.getAll", ['idSite' => $this->idSite], $defaultRequest = []);
+ foreach ($response as $savedSegment) {
$savedSegmentsById[$savedSegment['idsegment']] = $savedSegment['name'];
}
$view->savedSegmentsById = $savedSegmentsById;
diff --git a/plugins/SegmentEditor/SegmentSelectorControl.php b/plugins/SegmentEditor/SegmentSelectorControl.php
index f9910e9420..0b57df483e 100644
--- a/plugins/SegmentEditor/SegmentSelectorControl.php
+++ b/plugins/SegmentEditor/SegmentSelectorControl.php
@@ -65,7 +65,7 @@ class SegmentSelectorControl extends UIControl
$this->nameOfCurrentSegment = '';
$this->isSegmentNotAppliedBecauseBrowserArchivingIsDisabled = 0;
- $this->availableSegments = API::getInstance()->getAll($this->idSite);
+ $this->availableSegments = Request::processRequest("SegmentEditor.getAll", ['idSite' => $this->idSite], $defaultRequest = []);
foreach ($this->availableSegments as &$savedSegment) {
$savedSegment['name'] = Common::sanitizeInputValue($savedSegment['name']);
diff --git a/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_unprocessed_segment.png b/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_unprocessed_segment.png
index a1372ad5fb..c51448e250 100644
--- a/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_unprocessed_segment.png
+++ b/plugins/SegmentEditor/tests/UI/expected-screenshots/UnprocessedSegmentTest_unprocessed_segment.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:1d039b8f35f1b4b3a319700cc969f7fa918b7286edad4120275165df2517401d
-size 57245
+oid sha256:5cce2f49e7cdef37dda6d24c4d5f799b0bbc0569a0354d1a161c6b274a8c94e5
+size 98733
diff --git a/tests/PHPUnit/System/expected/test_DataComparisonTest_invertCompare__Referrers.getAll_month.xml b/tests/PHPUnit/System/expected/test_DataComparisonTest_invertCompare__Referrers.getAll_month.xml
index 0b627a1e3a..291f1d6fe6 100644
--- a/tests/PHPUnit/System/expected/test_DataComparisonTest_invertCompare__Referrers.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_DataComparisonTest_invertCompare__Referrers.getAll_month.xml
@@ -19,7 +19,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<comparisons>
<row>
<nb_visits>1</nb_visits>
@@ -216,7 +216,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<comparisons>
<row>
<nb_visits>1</nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_DataComparisonTest_periods__Referrers.getAll_month.xml b/tests/PHPUnit/System/expected/test_DataComparisonTest_periods__Referrers.getAll_month.xml
index 1941a7134c..b0410d8141 100644
--- a/tests/PHPUnit/System/expected/test_DataComparisonTest_periods__Referrers.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_DataComparisonTest_periods__Referrers.getAll_month.xml
@@ -19,7 +19,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<comparisons>
<row>
<nb_visits>1</nb_visits>
@@ -139,7 +139,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<comparisons>
<row>
<nb_visits>1</nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_DataComparisonTest_rangePeriodAgainstSingle__Referrers.getAll_range.xml b/tests/PHPUnit/System/expected/test_DataComparisonTest_rangePeriodAgainstSingle__Referrers.getAll_range.xml
index 4e8c47c8aa..081384265e 100644
--- a/tests/PHPUnit/System/expected/test_DataComparisonTest_rangePeriodAgainstSingle__Referrers.getAll_range.xml
+++ b/tests/PHPUnit/System/expected/test_DataComparisonTest_rangePeriodAgainstSingle__Referrers.getAll_range.xml
@@ -19,7 +19,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<comparisons>
<row>
<nb_visits>1</nb_visits>
@@ -333,7 +333,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<comparisons>
<row>
<nb_visits>1</nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_DataComparisonTest_segmentsAndPeriods__Referrers.getAll_month.xml b/tests/PHPUnit/System/expected/test_DataComparisonTest_segmentsAndPeriods__Referrers.getAll_month.xml
index 46ffd8606f..f0b53d2276 100644
--- a/tests/PHPUnit/System/expected/test_DataComparisonTest_segmentsAndPeriods__Referrers.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_DataComparisonTest_segmentsAndPeriods__Referrers.getAll_month.xml
@@ -19,7 +19,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<comparisons>
<row>
<nb_visits>1</nb_visits>
@@ -333,7 +333,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<comparisons>
<row>
<nb_visits>1</nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_DataComparisonTest_segments__Referrers.getAll_month.xml b/tests/PHPUnit/System/expected/test_DataComparisonTest_segments__Referrers.getAll_month.xml
index d9e43f0b15..1e56f1d34d 100644
--- a/tests/PHPUnit/System/expected/test_DataComparisonTest_segments__Referrers.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_DataComparisonTest_segments__Referrers.getAll_month.xml
@@ -19,7 +19,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<comparisons>
<row>
<nb_visits>1</nb_visits>
@@ -99,7 +99,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<comparisons>
<row>
<nb_visits>1</nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getAll_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getAll_month.xml
index f474e66f38..ae7de96986 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getAll_month.xml
@@ -19,7 +19,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>1</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
</row>
<row>
<label>piwik.org</label>
@@ -40,7 +40,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
</row>
<row>
<label>sn110w.snt110.mail.live.com</label>
@@ -61,7 +61,7 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
</row>
<row>
<label>www.test.nl</label>
@@ -82,6 +82,6 @@
<revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getReferrerType_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getReferrerType_month.xml
index fc719074f4..571e6a1029 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getReferrerType_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getReferrerType_month.xml
@@ -20,6 +20,7 @@
<sum_daily_nb_uniq_visitors>38</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>3</sum_daily_nb_users>
<segment>referrerType==direct</segment>
+ <referrer_type>1</referrer_type>
</row>
<row>
<label>Websites</label>
@@ -41,6 +42,7 @@
<sum_daily_nb_uniq_visitors>4</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>1</sum_daily_nb_users>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<subtable>
<row>
<label>example.com</label>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getAll_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getAll_day.xml
index 11b9d69bf0..e5061b9add 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getAll_day.xml
@@ -18,7 +18,7 @@
</goals>
<nb_conversions>1</nb_conversions>
<revenue>1</revenue>
- <referer_type>2</referer_type>
+ <referer_type>Search Engines</referer_type>
</row>
<row>
<label>referrer.com</label>
@@ -38,6 +38,6 @@
</goals>
<nb_conversions>1</nb_conversions>
<revenue>42</revenue>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getReferrerType_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getReferrerType_day.xml
index 94c5ebbcb7..f784e17b36 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getReferrerType_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getReferrerType_day.xml
@@ -19,6 +19,7 @@
<nb_conversions>1</nb_conversions>
<revenue>1</revenue>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<subtable>
<row>
<label>purchase</label>
@@ -60,6 +61,7 @@
<nb_conversions>1</nb_conversions>
<revenue>42</revenue>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<subtable>
<row>
<label>referrer.com</label>
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getAll_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getAll_day.xml
index 0475723891..7806d128ae 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getAll_day.xml
@@ -19,7 +19,7 @@
</goals>
<nb_conversions>1</nb_conversions>
<revenue>1</revenue>
- <referer_type>2</referer_type>
+ <referer_type>Search Engines</referer_type>
</row>
<row>
<label>referrer.com</label>
@@ -40,6 +40,6 @@
</goals>
<nb_conversions>1</nb_conversions>
<revenue>42</revenue>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getReferrerType_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getReferrerType_day.xml
index 84ffaabdb9..f61eb0b084 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getReferrerType_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getReferrerType_day.xml
@@ -20,6 +20,7 @@
<nb_conversions>1</nb_conversions>
<revenue>1</revenue>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<subtable>
<row>
<label>purchase</label>
@@ -63,6 +64,7 @@
<nb_conversions>1</nb_conversions>
<revenue>42</revenue>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<subtable>
<row>
<label>referrer.com</label>
diff --git a/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getAll_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getAll_day.xml
index 52be85572a..5d9996856d 100644
--- a/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getAll_day.xml
@@ -10,7 +10,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>4</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
</row>
<row>
<label>this search term</label>
@@ -22,7 +22,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>3</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>2</referer_type>
+ <referer_type>Search Engines</referer_type>
</row>
<row>
<label>search term 2</label>
@@ -34,7 +34,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>2</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>2</referer_type>
+ <referer_type>Search Engines</referer_type>
</row>
<row>
<label>whatever1.com</label>
@@ -46,7 +46,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>2</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
</row>
<row>
<label>Others</label>
diff --git a/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getReferrerType_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getReferrerType_day.xml
index b05ee719f9..4816204d53 100644
--- a/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getReferrerType_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getReferrerType_day.xml
@@ -11,6 +11,7 @@
<bounce_count>55</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>referrerType==direct</segment>
+ <referrer_type>1</referrer_type>
</row>
<row>
<label>Search Engines</label>
@@ -23,6 +24,7 @@
<bounce_count>12</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<subtable>
<row>
<label>search term 2</label>
@@ -70,6 +72,7 @@
<bounce_count>8</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<subtable>
<row>
<label>whatever0.com</label>
diff --git a/tests/PHPUnit/System/expected/test_reportLimiting_flattened__Referrers.getAll_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_flattened__Referrers.getAll_day.xml
index f00d41d063..bb74ffcc64 100644
--- a/tests/PHPUnit/System/expected/test_reportLimiting_flattened__Referrers.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_flattened__Referrers.getAll_day.xml
@@ -23,7 +23,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>4</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<Referrers_Referrer>whatever0.com</Referrers_Referrer>
</row>
<row>
@@ -36,7 +36,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>3</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>2</referer_type>
+ <referer_type>Search Engines</referer_type>
<Referrers_Referrer>this search term</Referrers_Referrer>
</row>
<row>
@@ -49,7 +49,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>2</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>2</referer_type>
+ <referer_type>Search Engines</referer_type>
<Referrers_Referrer>search term 2</Referrers_Referrer>
</row>
<row>
@@ -62,7 +62,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>2</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
<Referrers_Referrer>whatever1.com</Referrers_Referrer>
</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_reportLimiting_flattened__Referrers.getReferrerType_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_flattened__Referrers.getReferrerType_day.xml
index 7db3ae2c01..cda2084b29 100644
--- a/tests/PHPUnit/System/expected/test_reportLimiting_flattened__Referrers.getReferrerType_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_flattened__Referrers.getReferrerType_day.xml
@@ -11,6 +11,7 @@
<bounce_count>55</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>referrerType==direct</segment>
+ <referrer_type>1</referrer_type>
</row>
<row>
<label>Search Engines</label>
@@ -23,6 +24,7 @@
<bounce_count>12</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
</row>
<row>
<label>Websites</label>
@@ -35,5 +37,6 @@
<bounce_count>8</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getAll_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getAll_day.xml
index 52be85572a..5d9996856d 100644
--- a/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getAll_day.xml
@@ -10,7 +10,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>4</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
</row>
<row>
<label>this search term</label>
@@ -22,7 +22,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>3</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>2</referer_type>
+ <referer_type>Search Engines</referer_type>
</row>
<row>
<label>search term 2</label>
@@ -34,7 +34,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>2</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>2</referer_type>
+ <referer_type>Search Engines</referer_type>
</row>
<row>
<label>whatever1.com</label>
@@ -46,7 +46,7 @@
<sum_visit_length>0</sum_visit_length>
<bounce_count>2</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
- <referer_type>3</referer_type>
+ <referer_type>Websites</referer_type>
</row>
<row>
<label>Others</label>
diff --git a/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getReferrerType_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getReferrerType_day.xml
index b05ee719f9..4816204d53 100644
--- a/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getReferrerType_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getReferrerType_day.xml
@@ -11,6 +11,7 @@
<bounce_count>55</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>referrerType==direct</segment>
+ <referrer_type>1</referrer_type>
</row>
<row>
<label>Search Engines</label>
@@ -23,6 +24,7 @@
<bounce_count>12</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>referrerType==search</segment>
+ <referrer_type>2</referrer_type>
<subtable>
<row>
<label>search term 2</label>
@@ -70,6 +72,7 @@
<bounce_count>8</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
<segment>referrerType==website</segment>
+ <referrer_type>3</referrer_type>
<subtable>
<row>
<label>whatever0.com</label>