diff options
author | sgiehl <stefan@matomo.org> | 2020-04-01 12:07:42 +0300 |
---|---|---|
committer | sgiehl <stefan@matomo.org> | 2020-04-01 13:15:52 +0300 |
commit | 677fec1f635e697927d389835a3ee53554f84ff9 (patch) | |
tree | bc0d60fdac68876c0d2bc715d49b2bb53975bc82 /plugins | |
parent | 53cc7a4299535b481d90c45ea5fb7137a6ef9092 (diff) | |
parent | 19af9b6c0a63b07020d935ea88710c80823c9d62 (diff) |
Merge branch '3.x-dev' into 4.x-dev
Diffstat (limited to 'plugins')
12 files changed, 104 insertions, 17 deletions
diff --git a/plugins/GeoIp2/templates/_updaterManage.twig b/plugins/GeoIp2/templates/_updaterManage.twig index f110de26da..f9b1b239b2 100644 --- a/plugins/GeoIp2/templates/_updaterManage.twig +++ b/plugins/GeoIp2/templates/_updaterManage.twig @@ -1,8 +1,9 @@ <div ng-show="locationUpdater.geoipDatabaseInstalled" id="geoipdb-update-info"> <p> - {{ 'GeoIp2_GeoIPUpdaterInstructions'|translate('<a href="http://www.maxmind.com/?rId=piwik">','</a>','<a rel="noreferrer noopener" href="https://db-ip.com/?refid=mtm">','</a>')|raw }} + {{ 'GeoIp2_GeoIPUpdaterInstructions'|translate('<a href="http://www.maxmind.com/?rId=piwik" rel="noreferrer noopener">','</a>','<a rel="noreferrer noopener" href="https://db-ip.com/?refid=mtm">','</a>')|raw }} <br/><br/> - {% if dbipLiteUrl|default is not empty %}{{ 'GeoIp2_GeoLiteCityLink'|translate('<a rel="noreferrer noopener" href="'~dbipLiteUrl|e('html_attr')~'">',dbipLiteUrl|e('html'),'</a>')|raw }}{% endif %} + {% if dbipLiteUrl|default is not empty %}{{ 'GeoIp2_GeoLiteCityLink'|translate('<a rel="noreferrer noopener" href="'~dbipLiteUrl|e('html_attr')~'">',dbipLiteUrl|e('html'),'</a>')|raw }}<br/><br/>{% endif %} + {{ 'UserCountry_MaxMindLinkExplanation'|translate('<a href="https://matomo.org/faq/how-to/how-do-i-get-the-geolocation-download-url-for-the-free-maxmind-db/" rel="noreferrer noopener" target="_blank">', '</a>')|raw }} <span ng-show="locationUpdater.geoipDatabaseInstalled"> <br/><br/>{{ 'GeoIp2_GeoIPUpdaterIntro'|translate }}: diff --git a/plugins/GeoIp2/templates/configuration.twig b/plugins/GeoIp2/templates/configuration.twig index 729e0f112d..91ea3dd5d6 100644 --- a/plugins/GeoIp2/templates/configuration.twig +++ b/plugins/GeoIp2/templates/configuration.twig @@ -13,7 +13,7 @@ <div id="manage-geoip-dbs"> <div class="row" id="geoipdb-screen1"> <div class="geoipdb-column-1 col s6"> - <p>{{ 'GeoIp2_IWantToDownloadFreeGeoIP'|translate|raw }}</p> + <p>{{ 'GeoIp2_IWantToDownloadFreeGeoIP'|translate|raw }}<sup><small>*</small></sup></p> </div> <div class="geoipdb-column-2 col s6"> <p>{{ 'GeoIp2_IPurchasedGeoIPDBs'|translate('<a rel="noreferrer noopener" href="http://www.maxmind.com/en/geolocation_landing?rId=piwik">','</a>','<a rel="noreferrer noopener" href="https://db-ip.com/db/?refid=mtm">','</a>')|raw }}</p> @@ -29,6 +29,9 @@ value="{{ 'General_GetStarted'|translate }}..." id="start-automatic-update-geoip"/> </div> </div> + <div class="row"> + <p><sup>* <small>{{ 'UserCountry_GeoIpDbIpAccuracyNote'|translate('<a href="https://dev.maxmind.com/geoip/geoip2/geolite2/?rId=piwik" rel="noreferrer noopener" target="_blank">', '</a>')|raw }}.</small></sup></p> + </div> </div> </div> <div id="geoipdb-screen2-download" ng-show="locationUpdater.showFreeDownload"> diff --git a/plugins/GeoIp2/templates/setupguide.twig b/plugins/GeoIp2/templates/setupguide.twig index 737ec17fb1..384ea58905 100644 --- a/plugins/GeoIp2/templates/setupguide.twig +++ b/plugins/GeoIp2/templates/setupguide.twig @@ -1,9 +1,15 @@ <h3 style="margin-top:0;">{{ 'GeoIp2_HowToSetupGeoIP'|translate }}</h3> <p>{{ 'GeoIp2_HowToSetupGeoIPIntro'|translate }}</p> <ul style="list-style:disc !important;margin-left:2em;"> - <li style="list-style-type: disc !important;">{{ 'GeoIp2_HowToSetupGeoIP_Step1'|translate('<a rel="noreferrer noopener" href="'~dbipLiteUrl~'">','</a>','<a rel="noreferrer noopener" target="_blank" href="http://db-ip.com/?refid=mtm">','</a>')|raw }}</li> + <li style="list-style-type: disc !important;">{{ 'GeoIp2_HowToSetupGeoIP_Step1'|translate('<a rel="noreferrer noopener" href="'~dbipLiteUrl~'">','</a>','<a rel="noreferrer noopener" target="_blank" href="http://db-ip.com/?refid=mtm">','</a>')|raw }}<sup>*</sup></li> <li style="list-style-type: disc !important;">{{ 'GeoIp2_HowToSetupGeoIP_Step2'|translate("'"~dbipLiteFilename~"'",'<strong>','</strong>','<strong>'~dbipLiteDesiredFilename~'</strong>')|raw }}</li> <li style="list-style-type: disc !important;">{{ 'GeoIp2_HowToSetupGeoIP_Step3'|translate('<strong>','</strong>','<span style="color:green"><strong>','</strong></span>')|raw }}</li> <li style="list-style-type: disc !important;">{{ 'GeoIp2_HowToSetupGeoIP_Step4'|translate }}</li> </ul> -<p> </p>
\ No newline at end of file +<p> </p> + +<div class="row"> + <div class="col s12"> + <p><sup>* <small>{{ 'UserCountry_GeoIpDbIpAccuracyNote'|translate('<a href="https://dev.maxmind.com/geoip/geoip2/geolite2/?rId=piwik" rel="noreferrer noopener" target="_blank">', '</a>')|raw }}.</small></sup></p> + </div> +</div>
\ No newline at end of file diff --git a/plugins/Live/Controller.php b/plugins/Live/Controller.php index a7af05e8d3..b69b5e658d 100644 --- a/plugins/Live/Controller.php +++ b/plugins/Live/Controller.php @@ -195,6 +195,8 @@ class Controller extends \Piwik\Plugin\Controller return ''; } + VisitorLog::groupActionsByPageviewId($nextVisits); + $view = new View('@Live/getVisitList.twig'); $view->idSite = $this->idSite; $view->startCounter = $startCounter < $nextVisits->getRowsCount() ? $nextVisits->getRowsCount() : $startCounter; diff --git a/plugins/Live/tests/UI/Live_spec.js b/plugins/Live/tests/UI/Live_spec.js index acbd621f03..9fbe17e9ef 100644 --- a/plugins/Live/tests/UI/Live_spec.js +++ b/plugins/Live/tests/UI/Live_spec.js @@ -75,6 +75,16 @@ describe("Live", function () { expect(await dialog.screenshot()).to.matchImage('visitor_profile'); }); + it('should load additional visits in visitor log', async function() { + + await page.click('.visitor-profile-more-info a'); + + await page.waitForNetworkIdle(); + + var dialog = await page.$('.ui-dialog'); + expect(await dialog.screenshot()).to.matchImage('visitor_profile_more_visits'); + }); + it('should hide all action details', async function() { await page.evaluate(function(){ $('.visitor-profile-toggle-actions').click(); diff --git a/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_action_details.png b/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_action_details.png index 14c6866db9..539126cbdc 100644 --- a/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_action_details.png +++ b/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_action_details.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb87e309174e3932f823cf29ef2f17aa7a843d8b1dc1839369da573c800f0226 -size 286483 +oid sha256:df49b91d892c15316435dc414b32a89bc63e7daa35d4cc173dedf547029133e4 +size 294750 diff --git a/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_actions_hidden.png b/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_actions_hidden.png index 9916a673f4..9f45d65d49 100644 --- a/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_actions_hidden.png +++ b/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_actions_hidden.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7469391d27c7b107ba69c5e45ac4544a98839af7088dbb49be0540630408d496 -size 253276 +oid sha256:7c78002e3ff02db7cd9e42b482deaaad48bb4263fadb3ab514a5355622683511 +size 260800 diff --git a/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_more_visits.png b/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_more_visits.png new file mode 100644 index 0000000000..c4d2802ca5 --- /dev/null +++ b/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_more_visits.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1409dfc32adddba803069a75341fbefa8954ecf73c06fccf761769fecde2982c +size 444126 diff --git a/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_visit_details.png b/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_visit_details.png index 02599bb8f0..74c5840384 100644 --- a/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_visit_details.png +++ b/plugins/Live/tests/UI/expected-screenshots/Live_visitor_profile_visit_details.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:69d8ed1bf1f34cd8aa7e06f98d6f8cd4a3a92e27101cb16c7220dfee2b575d75 -size 263202 +oid sha256:cf0fa7c246b8c1255085a39c16514403d410e31887b6424d03f9304949697343 +size 270398 diff --git a/plugins/Marketplace/Api/Client.php b/plugins/Marketplace/Api/Client.php index b1e42b9ee9..bf8aa6e478 100644 --- a/plugins/Marketplace/Api/Client.php +++ b/plugins/Marketplace/Api/Client.php @@ -8,14 +8,16 @@ */ namespace Piwik\Plugins\Marketplace\Api; +use Piwik\Access; +use Piwik\API\Request; use Matomo\Cache\Lazy; use Piwik\Common; use Piwik\Container\StaticContainer; +use Piwik\DataTable; use Piwik\Filesystem; use Piwik\Http; use Piwik\Plugin; use Piwik\Plugins\Marketplace\Environment; -use Piwik\Plugins\Marketplace\Api\Service; use Piwik\SettingsServer; use Exception as PhpException; use Psr\Log\LoggerInterface; @@ -142,7 +144,7 @@ class Client } // in the beginning we allowed to specify a download path but this way we make sure security is always taken - // care of and we always generate a random download filename. + // care of and we always generate a random download filename.Marketplace/Api/Client.php $target = $this->getRandomTmpPluginDownloadFilename(); Filesystem::deleteFileIfExists($target); @@ -177,8 +179,66 @@ class Client } $params = array('plugins' => $params); + $params = array('plugins' => json_encode($params)); - $hasUpdates = $this->fetch('plugins/checkUpdates', array('plugins' => json_encode($params))); + if ($this->service->hasAccessToken() && Plugin\Manager::getInstance()->isPluginActivated('MultiSites')) { + $numPageviews = 0; + + try { + $multiSites = null; + Access::doAsSuperUser(function () use (&$multiSites) { + $multiSites = Request::processRequest('MultiSites.getAll', array( + 'period' => 'month', + 'date' => 'previous1', + 'showColumns' => 'nb_pageviews', + 'filter_limit' => -1, + 'filter_offset' => 0 + )); + }); + + /** @var DataTable\Map $multiSites */ + if ($multiSites && $multiSites->getRowsCount()) { + foreach ($multiSites->getDataTables() as $table) { + foreach ($table->getRows() as $row) { + $pageviews = $row->getColumn('nb_pageviews'); + if ($pageviews) { + $numPageviews += $pageviews; + } + } + } + } + + $numPageviews = $numPageviews / 1000; + if ($numPageviews < 50) { + $params['bucket'] = 1; + } elseif ($numPageviews < 100) { + $params['bucket'] = 2; + } elseif ($numPageviews < 300) { + $params['bucket'] = 3; + } elseif ($numPageviews < 600) { + $params['bucket'] = 4; + } elseif ($numPageviews < 1000) { + $params['bucket'] = 5; + } elseif ($numPageviews < 2000) { + $params['bucket'] = 6; + } elseif ($numPageviews < 5000) { + $params['bucket'] = 7; + } elseif ($numPageviews < 10000) { + $params['bucket'] = 8; + } elseif ($numPageviews < 25000) { + $params['bucket'] = 9; + } elseif ($numPageviews < 50000) { + $params['bucket'] = 10; + } else { + $params['bucket'] = 11; + } + } catch (\Exception $e) { + // igonre any error + } + + } + + $hasUpdates = $this->fetch('plugins/checkUpdates', $params); if (empty($hasUpdates)) { return array(); diff --git a/plugins/UserCountry/lang/en.json b/plugins/UserCountry/lang/en.json index fc74a8a402..4c927f7345 100644 --- a/plugins/UserCountry/lang/en.json +++ b/plugins/UserCountry/lang/en.json @@ -40,6 +40,8 @@ "SubmenuLocations": "Locations", "TestIPLocatorFailed": "Matomo tried checking the location of a known IP address (%1$s), but your server returned no information. This provider may not be configured correctly (the geolocation database may be named incorrectly or located in the wrong directory, for instance).", "ToGeolocateOldVisits": "To get location data for your old visits, use the script described %1$shere%2$s.", - "WidgetLocation": "Visitor Location" + "WidgetLocation": "Visitor Location", + "GeoIpDbIpAccuracyNote": "Note: the DBIP databases are free and can be downloaded automatically, but geolocation results (specifically city results) are not as accurate as MaxMind's. MaxMind, however, requires that you create an account even for the free database. If you want to use MaxMind's geolocation database, you can start the process %1$shere%2$s", + "MaxMindLinkExplanation": "If you are using MaxMind's geolocation databases and you do not already know how to generate your download URL, %1$sclick here to learn how%2$s." } }
\ No newline at end of file diff --git a/plugins/UserCountry/tests/UI/expected-screenshots/UserCountry_admin_geoip2.png b/plugins/UserCountry/tests/UI/expected-screenshots/UserCountry_admin_geoip2.png index b473f43668..31e960ba67 100644 --- a/plugins/UserCountry/tests/UI/expected-screenshots/UserCountry_admin_geoip2.png +++ b/plugins/UserCountry/tests/UI/expected-screenshots/UserCountry_admin_geoip2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e61141b5348e44ee80558a5745ce954d782902a01413cf8d04318702d08b6130 -size 238072 +oid sha256:292b0caff23e0120ec9aad8d464da6578028e96df38ccbf8d0849d5592b96301 +size 247236 |