diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..678fc08 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,20 @@ +# CODEOWNERS file (from GitHub template at +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) +# Each line is a file pattern followed by one or more owners. + +################################################################################ +# These owners will be the default owners for everything in the repo. Unless a +# later match takes precedence, @cabutlermit will be requested for review when +# someone opens a pull request.This is commented out in favor of using a team +# as the default (see below). It is left here as a comment to indicate the +# primary expert for this code. +# * @cabutlermit + +# Teams can be specified as code owners as well. Teams should be identified in +# the format @org/team-name. Teams must have explicit write access to the +# repository. +* @mitlibraries/infraeng-terraform-reviewers + +# We set the senior engineer in the team as the owner of the CODEOWNERS file as +# a layer of protection for unauthorized changes. +/.github/CODEOWNERS @cabutlermit diff --git a/Dockerfile b/Dockerfile index 63bf3d6..67e9eae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM matomo:5.1.2 +FROM matomo:5.2.2 # Add the EnvironmentVariables plugin -COPY ./files/plugin-EnvironmentVariables-5.0.2/ /var/www/html/plugins/EnvironmentVariables +COPY ./files/plugin-EnvironmentVariables-5.0.3/ /var/www/html/plugins/EnvironmentVariables # Add the CustomVariables plugin -COPY ./files/plugin-CustomVariables-5.0.2/ /var/www/html/plugins/CustomVariables +COPY ./files/plugin-CustomVariables-5.0.4/ /var/www/html/plugins/CustomVariables # Preconfigure settings COPY ./files/config.ini.php /var/www/html/config/config.ini.php diff --git a/README.md b/README.md index 1096760..b307590 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,15 @@ Matomo has built-in two-factor authentication, which we enforce for all accounts See the official [Recover from lost 2FA](https://matomo.org/faq/how-to/faq_27248) documentation. This allows us to recover the Superuser login if we lose the 2FA information. -## Additional documentation +## Related Assets -* [MIT Libraries dev docs](https://mitlibraries.github.io/guides/misc/matomo.html) - includes information about setting up a website for tracking in Matomo. -* [Matomo help center](https://matomo.org/help/) - offical Matomo docs. Includes user guide, developer guide, FAQ, and community support forum. +* Infrastructure: [mitlib-tf-workloads-matomo](https://github.com/MITLibraries/mitlib-tf-workloads-matomo) + +## Maintainers + +* Owner: See [CODEOWNERS](./.github/CODEOWNERS) +* Team: See [CODEOWNERS](./.github/CODEOWNERS) +* Last Maintenance: 2025-02 +* External Documentation: + * [MIT Libraries dev docs](https://mitlibraries.github.io/guides/misc/matomo.html) - includes information about setting up a website for tracking in Matomo. + * [Matomo help center](https://matomo.org/help/) - offical Matomo docs. Includes user guide, developer guide, FAQ, and community support forum. diff --git a/files/config.ini.php b/files/config.ini.php index 88e71e0..11ca2d7 100644 --- a/files/config.ini.php +++ b/files/config.ini.php @@ -3,6 +3,7 @@ [database] schema = Mariadb charset = utf8mb4 +collation = utf8mb4_general_ci [General] proxy_client_headers[] = "HTTP_X_FORWARDED_FOR" @@ -90,6 +91,7 @@ Plugins[] = "Tour" Plugins[] = "PagePerformance" Plugins[] = "CustomDimensions" +Plugins[] = "FeatureFlags" Plugins[] = "MobileAppMeasurable" Plugins[] = "CustomVariables" Plugins[] = "EnvironmentVariables" @@ -159,3 +161,4 @@ PluginsInstalled[] = "MobileAppMeasurable" PluginsInstalled[] = "PagePerformance" PluginsInstalled[] = "CustomDimensions" +PluginsInstalled[] = "FeatureFlags" diff --git a/files/plugin-CustomVariables-4.1.1/Archiver.php b/files/plugin-CustomVariables-4.1.1/Archiver.php deleted file mode 100644 index b3d4e35..0000000 --- a/files/plugin-CustomVariables-4.1.1/Archiver.php +++ /dev/null @@ -1,264 +0,0 @@ -maximumRowsInDataTableLevelZero = Config::getInstance()->General['datatable_archiving_maximum_rows_custom_variables'] ?? Config::getInstance()->General['datatable_archiving_maximum_rows_custom_dimensions']; - $this->maximumRowsInSubDataTable = Config::getInstance()->General['datatable_archiving_maximum_rows_subtable_custom_variables'] ?? Config::getInstance()->General['datatable_archiving_maximum_rows_subtable_custom_dimensions']; - } - - public function aggregateMultipleReports() - { - $columnsAggregationOperation = array('slots' => 'uniquearraymerge'); - - $this->getProcessor()->aggregateDataTableRecords( - self::CUSTOM_VARIABLE_RECORD_NAME, - $this->maximumRowsInDataTableLevelZero, - $this->maximumRowsInSubDataTable, - $columnToSort = Metrics::INDEX_NB_VISITS, - $columnsAggregationOperation, - $columnsToRenameAfterAggregation = null, - $countRowsRecursive = array()); - } - - public function aggregateDayReport() - { - $this->dataArray = new DataArray(); - - $maxCustomVariables = CustomVariables::getNumUsableCustomVariables(); - for ($i = 1; $i <= $maxCustomVariables; $i++) { - $this->aggregateCustomVariable($i); - } - - $this->removeVisitsMetricsFromActionsAggregate(); - $this->dataArray->enrichMetricsWithConversions(); - $table = $this->dataArray->asDataTable(); - - foreach ($table->getRows() as $row) { - $label = $row->getColumn('label'); - if (!empty($this->metadata[$label])) { - foreach ($this->metadata[$label] as $name => $value) { - $row->addMetadata($name, $value); - } - } - } - - $blob = $table->getSerialized( - $this->maximumRowsInDataTableLevelZero, $this->maximumRowsInSubDataTable, - $columnToSort = Metrics::INDEX_NB_VISITS - ); - - $this->getProcessor()->insertBlobRecord(self::CUSTOM_VARIABLE_RECORD_NAME, $blob); - } - - protected function aggregateCustomVariable($slot) - { - $keyField = "custom_var_k" . $slot; - $valueField = "custom_var_v" . $slot; - $where = "%s.$keyField != ''"; - $dimensions = array($keyField, $valueField); - - $query = $this->getLogAggregator()->queryVisitsByDimension($dimensions, $where); - $this->aggregateFromVisits($query, $keyField, $valueField); - - // IF we query Custom Variables scope "page" either: Product SKU, Product Name, - // then we also query the "Product page view" price which was possibly recorded. - $additionalSelects = false; - - // Before Matomo 4.0.0 ecommerce views were tracked in custom variables - // So if Matomo was installed before still try to archive it the old way, as old data might be archived - if (version_compare(DbHelper::getInstallVersion(),'4.0.0-b2', '<') && in_array($slot, array(3, 4, 5))) { - $additionalSelects = array($this->getSelectAveragePrice()); - } - $query = $this->getLogAggregator()->queryActionsByDimension($dimensions, $where, $additionalSelects); - $this->aggregateFromActions($query, $keyField, $valueField); - - $query = $this->getLogAggregator()->queryConversionsByDimension($dimensions, $where); - $this->aggregateFromConversions($query, $keyField, $valueField); - } - - protected function getSelectAveragePrice() - { - $field = "custom_var_v2"; - return LogAggregator::getSqlRevenue("AVG(log_link_visit_action." . $field . ")") . " as `" . Metrics::INDEX_ECOMMERCE_ITEM_PRICE_VIEWED . "`"; - } - - protected function aggregateFromVisits($query, $keyField, $valueField) - { - while ($row = $query->fetch()) { - $key = $row[$keyField]; - $value = $this->cleanCustomVarValue($row[$valueField]); - - $this->addMetadata($keyField, $key, Model::SCOPE_VISIT); - - $this->dataArray->sumMetricsVisits($key, $row); - $this->dataArray->sumMetricsVisitsPivot($key, $value, $row); - } - } - - protected function cleanCustomVarValue($value) - { - if ($value !== null && strlen($value)) { - return $value; - } - return self::LABEL_CUSTOM_VALUE_NOT_DEFINED; - } - - protected function aggregateFromActions($query, $keyField, $valueField) - { - while ($row = $query->fetch()) { - $key = $row[$keyField]; - $value = $this->cleanCustomVarValue($row[$valueField]); - - $this->addMetadata($keyField, $key, Model::SCOPE_PAGE); - - $alreadyAggregated = $this->aggregateEcommerceCategories($key, $value, $row); - if (!$alreadyAggregated) { - $this->aggregateActionByKeyAndValue($key, $value, $row); - $this->dataArray->sumMetricsActions($key, $row); - } - } - } - - private function addMetadata($keyField, $label, $scope) - { - $index = (int) str_replace('custom_var_k', '', $keyField); - - if (!array_key_exists($label, $this->metadata)) { - $this->metadata[$label] = array('slots' => array()); - } - - $uniqueId = $label . 'scope' . $scope . 'index' . $index; - - if (!isset($this->metadataFlat[$uniqueId])) { - $this->metadata[$label]['slots'][] = array('scope' => $scope, 'index' => $index); - $this->metadataFlat[$uniqueId] = true; - } - } - - /** - * @param string $key - * @param string $value - * @param $row - * @return bool True if the $row metrics were already added to the ->metrics - */ - protected function aggregateEcommerceCategories($key, $value, $row) - { - $ecommerceCategoriesAggregated = false; - if ($key == '_pkc' - && $value[0] == '[' && $value[1] == '"' - ) { - // In case categories were truncated, try closing the array - if (substr($value, -2) != '"]') { - $value .= '"]'; - } - $decoded = json_decode($value); - if (is_array($decoded)) { - $count = 0; - foreach ($decoded as $category) { - if (empty($category) - || $count >= GoalManager::MAXIMUM_PRODUCT_CATEGORIES - ) { - continue; - } - $this->aggregateActionByKeyAndValue($key, $category, $row); - $ecommerceCategoriesAggregated = true; - $count++; - } - } - } - return $ecommerceCategoriesAggregated; - } - - protected function aggregateActionByKeyAndValue($key, $value, $row) - { - $this->dataArray->sumMetricsActionsPivot($key, $value, $row); - - if ($this->isReservedKey($key)) { - // Price tracking on Ecommerce product/category pages: - // the average is returned from the SQL query so the price is not "summed" like other metrics - $index = Metrics::INDEX_ECOMMERCE_ITEM_PRICE_VIEWED; - if (!empty($row[$index])) { - $this->dataArray->setRowColumnPivot($key, $value, $index, (float)$row[$index]); - } - } - } - - protected static function isReservedKey($key) - { - return in_array($key, API::getReservedCustomVariableKeys()); - } - - protected function aggregateFromConversions($query, $keyField, $valueField) - { - if ($query === false) { - return; - } - while ($row = $query->fetch()) { - $key = $row[$keyField]; - - $value = $this->cleanCustomVarValue($row[$valueField]); - $this->dataArray->sumMetricsGoals($key, $row); - $this->dataArray->sumMetricsGoalsPivot($key, $value, $row); - } - } - - /** - * Delete Visit, Unique Visitor and Users metric from 'page' scope custom variables. - * - * - Custom variables of 'visit' scope: it is expected that these ones have the "visit" column set. - * - Custom variables of 'page' scope: we cannot process "Visits" count for these. - * Why? - * "Actions" column is processed with a SELECT count(*). - * A same visit can set the same custom variable of 'page' scope multiple times. - * We cannot sum the values of count(*) as it would be incorrect. - * The way we could process "Visits" Metric for 'page' scope variable is to issue a count(Distinct *) or so, - * but it is no implemented yet (this would likely be very slow for high traffic sites). - * - */ - protected function removeVisitsMetricsFromActionsAggregate() - { - $dataArray = & $this->dataArray->getDataArray(); - foreach ($dataArray as $key => &$row) { - if (!self::isReservedKey($key) - && DataArray::isRowActions($row) - ) { - unset($row[Metrics::INDEX_NB_UNIQ_VISITORS]); - unset($row[Metrics::INDEX_NB_VISITS]); - unset($row[Metrics::INDEX_NB_USERS]); - } - } - } - -} diff --git a/files/plugin-CustomVariables-4.1.1/CHANGELOG.md b/files/plugin-CustomVariables-4.1.1/CHANGELOG.md deleted file mode 100644 index 511df37..0000000 --- a/files/plugin-CustomVariables-4.1.1/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# CHANGELOG - -4.1.1 -- Translation updates - -4.1.0 -- migrate from AngularJS to Vue. -- Replaced substr() with mb_substr() to correctly cut utf8 values. -- Fixed warnings and depreciation for PHP8.1 diff --git a/files/plugin-CustomVariables-4.1.1/README.md b/files/plugin-CustomVariables-4.1.1/README.md deleted file mode 100644 index 1910b23..0000000 --- a/files/plugin-CustomVariables-4.1.1/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Matomo Custom Variables Plugin - -[![Build Status](https://travis-ci.com/matomo-org/plugin-CustomVariables.svg?branch=4.x-dev)](https://travis-ci.com/matomo-org/plugin-CustomVariables) - -## Description - -This plugins allows you to configure and track [Custom Variables](https://matomo.org/docs/custom-variables/) in your Matomo Analytics. - -This feature used to be part of Matomo. However, we no longer plan to further develop custom variables and only fix important bugs or security issues and we might stop supporting Custom Variables in the future. - -We therefore highly recommend using [Custom Dimensions](https://matomo.org/docs/custom-dimensions/) instead which is directly available within your Matomo. Learn more about the [advantages of Custom Dimensions](https://matomo.org/faq/general/faq_21117/). - -**Warning**: Depending on the database size of your Matomo this plugin may take a long time to install. - diff --git a/files/plugin-CustomVariables-4.1.1/config/tracker.php b/files/plugin-CustomVariables-4.1.1/config/tracker.php deleted file mode 100644 index ca2affe..0000000 --- a/files/plugin-CustomVariables-4.1.1/config/tracker.php +++ /dev/null @@ -1,2 +0,0 @@ -e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}))}},{key:"fetchUsages",value:function(){var e=this;return this.privateState.isLoading=!0,Promise.all([this.fetchCustomVariables(),o["AjaxHelper"].fetch({method:"CustomVariables.getUsagesOfSlots",filter_limit:"-1"})]).then((function(t){var n=g(t,2),r=n[1];e.privateState.customVariables=r,r.forEach((function(t){t.index>e.state.value.numSlotsAvailable&&(e.privateState.numSlotsAvailable=t.index),t.usages&&t.usages.length>0&&(e.privateState.hasAtLeastOneUsage=!0)}))})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),_=new A;function D(e){return I(e)||B(e)||T(e)||L()}function L(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(e,t){if(e){if("string"===typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}function B(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function I(e){if(Array.isArray(e))return M(e)}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n".concat(this.numSlotsAvailable,""))},setMaxCustomVariablesCmd:function(){return"./console customvariables:set-max-custom-variables ".concat(this.numSlotsAvailable+1)}}});U.render=h;var H=U; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Object(o["createAngularJsAdapter"])({component:H,directiveName:"piwikManageCustomVars"})}})})); -//# sourceMappingURL=CustomVariables.umd.min.js.map \ No newline at end of file diff --git a/files/plugin-CustomVariables-4.1.1/vue/src/ManageCustomVars/ManageCustomVars.adapter.ts b/files/plugin-CustomVariables-4.1.1/vue/src/ManageCustomVars/ManageCustomVars.adapter.ts deleted file mode 100644 index fd1c5d4..0000000 --- a/files/plugin-CustomVariables-4.1.1/vue/src/ManageCustomVars/ManageCustomVars.adapter.ts +++ /dev/null @@ -1,14 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -import { createAngularJsAdapter } from 'CoreHome'; -import ManageCustomVars from './ManageCustomVars.vue'; - -export default createAngularJsAdapter({ - component: ManageCustomVars, - directiveName: 'piwikManageCustomVars', -}); diff --git a/files/plugin-CustomVariables-4.1.1/API.php b/files/plugin-CustomVariables-5.0.4/API.php similarity index 97% rename from files/plugin-CustomVariables-4.1.1/API.php rename to files/plugin-CustomVariables-5.0.4/API.php index 87265d0..91f5127 100644 --- a/files/plugin-CustomVariables-4.1.1/API.php +++ b/files/plugin-CustomVariables-5.0.4/API.php @@ -1,4 +1,5 @@ getDataTable($idSite, $period, $date, $segment, $expanded, $flat, $idSubtable = null); - if ($dataTable instanceof DataTable + if ( + $dataTable instanceof DataTable && !$_leavePiwikCoreVariables ) { $mapping = self::getReservedCustomVariableKeys(); @@ -144,7 +147,8 @@ public function getUsagesOfSlots($idSite) /** @var DataTable $customVarUsages */ $today = StaticContainer::get('CustomVariables.today'); $date = '2008-12-12,' . $today; - $customVarUsages = Request::processRequest('CustomVariables.getCustomVariables', + $customVarUsages = Request::processRequest( + 'CustomVariables.getCustomVariables', array('idSite' => $idSite, 'period' => 'range', 'date' => $date, 'format' => 'original') ); @@ -177,4 +181,3 @@ public function getUsagesOfSlots($idSite) return $grouped; } } - diff --git a/files/plugin-CustomVariables-5.0.4/Archiver.php b/files/plugin-CustomVariables-5.0.4/Archiver.php new file mode 100644 index 0000000..774170f --- /dev/null +++ b/files/plugin-CustomVariables-5.0.4/Archiver.php @@ -0,0 +1,17 @@ +setDescription('Get info about configured custom variables'); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function doExecute(): int { + $output = $this->getOutput(); $maxVars = CustomVariables::getNumUsableCustomVariables(); if ($this->hasEverywhereSameAmountOfVariables()) { - $this->writeSuccessMessage($output, array( - 'Your Piwik is configured for ' . $maxVars . ' custom variables.' - )); - return 0; + $this->writeSuccessMessage([ + 'Your Matomo is configured for ' . $maxVars . ' custom variables.' + ]); + return self::SUCCESS; } $output->writeln('There is a problem with your custom variables configuration:'); $output->writeln('Some database tables miss custom variables columns.'); $output->writeln(''); - $output->writeln('Your Piwik seems to be configured for ' . $maxVars . ' custom variables.'); + $output->writeln('Your Matomo seems to be configured for ' . $maxVars . ' custom variables.'); $output->writeln('Executing "./console customvariables:set-max-custom-variables ' . $maxVars . '" might fix this issue.'); $output->writeln('If not check the following tables whether they have the same columns starting with custom_var_: '); foreach (Model::getScopes() as $scope) { $output->writeln(Common::prefixTable($scope)); } - return 0; + return self::SUCCESS; } private function hasEverywhereSameAmountOfVariables() diff --git a/files/plugin-CustomVariables-4.1.1/Commands/SetNumberOfCustomVariables.php b/files/plugin-CustomVariables-5.0.4/Commands/SetNumberOfCustomVariables.php similarity index 60% rename from files/plugin-CustomVariables-4.1.1/Commands/SetNumberOfCustomVariables.php rename to files/plugin-CustomVariables-5.0.4/Commands/SetNumberOfCustomVariables.php index 303173f..41eaac2 100644 --- a/files/plugin-CustomVariables-4.1.1/Commands/SetNumberOfCustomVariables.php +++ b/files/plugin-CustomVariables-5.0.4/Commands/SetNumberOfCustomVariables.php @@ -1,4 +1,5 @@ setName('customvariables:set-max-custom-variables'); @@ -33,29 +26,31 @@ protected function configure() ./console customvariables:set-max-custom-variables 10 => 10 custom variables will be available in total "); - $this->addArgument('maxCustomVars', InputArgument::REQUIRED, 'Set the number of max available custom variables'); + $this->addRequiredArgument('maxCustomVars', 'Set the number of max available custom variables'); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function doExecute(): int { - $numVarsToSet = $this->getNumVariablesToSet($input); + $input = $this->getInput(); + $output = $this->getOutput(); + $numVarsToSet = $this->getNumVariablesToSet(); $numChangesToPerform = $this->getNumberOfChangesToPerform($numVarsToSet); if (0 === $numChangesToPerform) { - $this->writeSuccessMessage($output, array( - 'Your Piwik is already configured for ' . $numVarsToSet . ' custom variables.' - )); + $this->writeSuccessMessage([ + 'Your Matomo is already configured for ' . $numVarsToSet . ' custom variables.' + ]); return 0; } $output->writeln(''); - $output->writeln(sprintf('Configuring Piwik for %d custom variables', $numVarsToSet)); + $output->writeln(sprintf('Configuring Matomo for %d custom variables', $numVarsToSet)); foreach (Model::getScopes() as $scope) { - $this->printChanges($scope, $numVarsToSet, $output); + $this->printChanges($scope, $numVarsToSet); } - if ($input->isInteractive() && !$this->confirmChange($output)) { + if ($input->isInteractive() && !$this->confirmChange()) { return 0; } @@ -63,48 +58,39 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln('Starting to apply changes'); $output->writeln(''); - $this->progress = $this->initProgress($numChangesToPerform, $output); + $this->initProgressBar($numChangesToPerform); foreach (Model::getScopes() as $scope) { - $this->performChange($scope, $numVarsToSet, $output); + $this->performChange($scope, $numVarsToSet); } Cache::clearCacheGeneral(); - $this->progress->finish(); + $this->finishProgressBar(); - $this->writeSuccessMessage($output, array( - 'Your Piwik is now configured for ' . $numVarsToSet . ' custom variables.' - )); + $this->writeSuccessMessage([ + 'Your Matomo is now configured for ' . $numVarsToSet . ' custom variables.' + ]); return 0; } - private function initProgress($numChangesToPerform, OutputInterface $output) - { - /** @var \Symfony\Component\Console\Helper\ProgressHelper $progress */ - $progress = $this->getHelperSet()->get('progress'); - $progress->start($output, $numChangesToPerform); - - return $progress; - } - - private function performChange($scope, $numVarsToSet, OutputInterface $output) + private function performChange($scope, $numVarsToSet) { $model = new Model($scope); $numCurrentVars = $model->getCurrentNumCustomVars(); $numDifference = $this->getAbsoluteDifference($numCurrentVars, $numVarsToSet); if ($numVarsToSet > $numCurrentVars) { - $this->addCustomVariables($model, $numDifference, $output); + $this->addCustomVariables($model, $numDifference); return; } - $this->removeCustomVariables($model, $numDifference, $output); + $this->removeCustomVariables($model, $numDifference); } - private function getNumVariablesToSet(InputInterface $input) + private function getNumVariablesToSet(): int { - $maxCustomVars = $input->getArgument('maxCustomVars'); + $maxCustomVars = $this->getInput()->getArgument('maxCustomVars'); if (!is_numeric($maxCustomVars)) { throw new \InvalidArgumentException('The number of available custom variables has to be a number'); @@ -119,20 +105,18 @@ private function getNumVariablesToSet(InputInterface $input) return $maxCustomVars; } - private function confirmChange(OutputInterface $output) + private function confirmChange() { - $output->writeln(''); - - $dialog = $this->getHelperSet()->get('dialog'); - return $dialog->askConfirmation( - $output, + $this->getOutput()->writeln(''); + return $this->askForConfirmation( 'Are you sure you want to perform these actions? (y/N)', false ); } - private function printChanges($scope, $numVarsToSet, OutputInterface $output) + private function printChanges($scope, $numVarsToSet) { + $output = $this->getOutput(); $model = new Model($scope); $scopeName = $model->getScopeName(); $highestIndex = $model->getHighestCustomVarIndex(); @@ -143,7 +127,6 @@ private function printChanges($scope, $numVarsToSet, OutputInterface $output) $output->writeln(sprintf('Scope "%s"', $scopeName)); if ($numVarsToSet > $numCurrentCustomVars) { - $indexes = $highestIndex + 1; if (1 !== $numVarsDifference) { $indexes .= ' - ' . ($highestIndex + $numVarsDifference); @@ -152,9 +135,7 @@ private function printChanges($scope, $numVarsToSet, OutputInterface $output) $output->writeln( sprintf('%s new custom variables having the index(es) %s will be ADDED', $numVarsDifference, $indexes) ); - } elseif ($numVarsToSet < $numCurrentCustomVars) { - $indexes = $highestIndex - $numVarsDifference + 1; if (1 !== $numVarsDifference) { @@ -168,30 +149,30 @@ private function printChanges($scope, $numVarsToSet, OutputInterface $output) } } - private function getAbsoluteDifference($currentNumber, $numberToSet) + private function getAbsoluteDifference(int $currentNumber, int $numberToSet): int { return abs($numberToSet - $currentNumber); } - private function removeCustomVariables(Model $model, $numberOfVarsToRemove, OutputInterface $output) + private function removeCustomVariables(Model $model, $numberOfVarsToRemove) { for ($index = 0; $index < $numberOfVarsToRemove; $index++) { $indexRemoved = $model->removeCustomVariable(); - $this->progress->advance(); - $output->writeln(' Removed a variable in scope "' . $model->getScopeName() . '" having the index ' . $indexRemoved . ''); + $this->advanceProgressBar(); + $this->getOutput()->writeln(' Removed a variable in scope "' . $model->getScopeName() . '" having the index ' . $indexRemoved . ''); } } - private function addCustomVariables(Model $model, $numberOfVarsToAdd, OutputInterface $output) + private function addCustomVariables(Model $model, $numberOfVarsToAdd) { for ($index = 0; $index < $numberOfVarsToAdd; $index++) { $indexAdded = $model->addCustomVariable(); - $this->progress->advance(); - $output->writeln(' Added a variable in scope "' . $model->getScopeName() . '" having the index ' . $indexAdded . ''); + $this->advanceProgressBar(); + $this->getOutput()->writeln(' Added a variable in scope "' . $model->getScopeName() . '" having the index ' . $indexAdded . ''); } } - private function getNumberOfChangesToPerform($numVarsToSet) + private function getNumberOfChangesToPerform(int $numVarsToSet): int { $numChangesToPerform = 0; diff --git a/files/plugin-CustomVariables-4.1.1/Controller.php b/files/plugin-CustomVariables-5.0.4/Controller.php similarity index 100% rename from files/plugin-CustomVariables-4.1.1/Controller.php rename to files/plugin-CustomVariables-5.0.4/Controller.php index 091dd95..6daf567 100644 --- a/files/plugin-CustomVariables-4.1.1/Controller.php +++ b/files/plugin-CustomVariables-5.0.4/Controller.php @@ -1,4 +1,5 @@ renderTemplate('manage', array()); } - } - diff --git a/files/plugin-CustomVariables-4.1.1/CustomDimension.php b/files/plugin-CustomVariables-5.0.4/CustomDimension.php similarity index 92% rename from files/plugin-CustomVariables-4.1.1/CustomDimension.php rename to files/plugin-CustomVariables-5.0.4/CustomDimension.php index 1c03ca9..109d0e2 100644 --- a/files/plugin-CustomVariables-4.1.1/CustomDimension.php +++ b/files/plugin-CustomVariables-5.0.4/CustomDimension.php @@ -1,4 +1,5 @@ getScopeDescription(); $this->id = 'CustomVariables.CustomVariable' . ucfirst($scope->getScope()) . $index; - $this->nameSingular = Piwik::translate('CustomVariables_ColumnCustomVariableValue') . ' ' . $index . ' (' . $category .')'; + $this->nameSingular = Piwik::translate('CustomVariables_ColumnCustomVariableValue') . ' ' . $index . ' (' . $category . ')'; $this->columnName = 'custom_var_v' . (int) $index; $this->category = 'CustomVariables_CustomVariables'; $this->dbTableName = $scope->getUnprefixedTableName(); } - -} \ No newline at end of file +} diff --git a/files/plugin-CustomVariables-4.1.1/CustomVariables.php b/files/plugin-CustomVariables-5.0.4/CustomVariables.php similarity index 98% rename from files/plugin-CustomVariables-4.1.1/CustomVariables.php rename to files/plugin-CustomVariables-5.0.4/CustomVariables.php index a77f5fd..8c4ef6a 100644 --- a/files/plugin-CustomVariables-4.1.1/CustomVariables.php +++ b/files/plugin-CustomVariables-5.0.4/CustomVariables.php @@ -5,9 +5,10 @@ * Description: Categorise your visitors and actions with custom name-value pairs. Segment by these values and get more insights to draw the right conclusions. * Author: Matomo * Author URI: https://matomo.org - * Version: 4.1.1 + * Version: 5.0.4 */ ?> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Matomo Copyright (C) 2007-2023 Matomo.org + + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/files/plugin-CustomVariables-4.1.1/Menu.php b/files/plugin-CustomVariables-5.0.4/Menu.php similarity index 99% rename from files/plugin-CustomVariables-4.1.1/Menu.php rename to files/plugin-CustomVariables-5.0.4/Menu.php index 1bb0dcb..d4f78a3 100644 --- a/files/plugin-CustomVariables-4.1.1/Menu.php +++ b/files/plugin-CustomVariables-5.0.4/Menu.php @@ -1,4 +1,5 @@ getCustomVarIndexes(); @@ -214,6 +216,4 @@ public static function uninstall() } } } - } - diff --git a/files/plugin-CustomVariables-4.1.1/ProfileSummary/VisitScopeSummary.php b/files/plugin-CustomVariables-5.0.4/ProfileSummary/VisitScopeSummary.php similarity index 99% rename from files/plugin-CustomVariables-4.1.1/ProfileSummary/VisitScopeSummary.php rename to files/plugin-CustomVariables-5.0.4/ProfileSummary/VisitScopeSummary.php index 43a5890..b93b646 100644 --- a/files/plugin-CustomVariables-4.1.1/ProfileSummary/VisitScopeSummary.php +++ b/files/plugin-CustomVariables-5.0.4/ProfileSummary/VisitScopeSummary.php @@ -1,4 +1,5 @@ 1 +* Name: User Role +* Value: Staff +* Scope: visit + +#### Action Scope Dimension: Tags +A common design pattern for websites on platforms like WordPress is filing content under a single “Category” while adding several “Tags” to add more specific definitions to the content. For example an article might be found in the “Marketing” category while also holding tags for “Analytics” “Matomo” and “Plugins”. + +**Sample Values:** + +* Index: 1 +* Name: Tags +* Value: Marketing +* Scope: action + +### How to Get Started with Custom Variables +While Custom Variables are available by default in [Matomo Cloud](https://matomo.org/matomo-cloud/), they are no longer installed by default in [Matomo On-Premise](https://matomo.org/matomo-on-premise/). Therefore if you do want to use them, the first thing that you need to do is install the [Custom Variables plugin](https://plugins.matomo.org/CustomVariables). You can find instructions on how to do that below. + +#### How to install the Custom Variables Plugin +##### How to install the Custom Variables Plugin for Matomo On-Premise + +1. Log in to your Matomo Dashboard with a **Super User** account. +2. Click the **Cog Icon** in the Top Menu to visit your Matomo settings. +3. Go to the **Marketplace** page within the **Platform** settings. +4. Find the **Custom Variables** plugin and click the big green **Install** button. (You may need to confirm your password at this stage.) +5. The plugin will be downloaded to your Matomo instance and you can click the big green **Activate Plugin** button to start using it. Note: It is also possible to activate it via the command line by using the following command: ./console plugin:activate CustomVariables + +##### How to install the Custom Variables Plugin for WordPress + +1. Log in to your WordPress dashboard. +2. Go to the **Marketplace** section of the **Matomo Analytics** menu. +3. Download the Custom Variables Plugin. +4. Tap on **Add New** within the WordPress **Plugins** menu. +5. Click **Upload Plugin** and follow the prompts to upload the Custom Variables plugin zip that you just downloaded. +6. Click **Activate** to enable the plugin with Matomo. + +#### How to add Custom Variables to your Web pages +Setting up Custom Variables will generally require that you are comfortable editing code or have access to a developer who can configure them for you. If you are already creating custom code to pull data from a content management system then it likely makes sense to set up your tracking within that custom code at the same time. However, in some cases it is possible to extract data using Matomo Tag Manager and there are details on that process below. + +##### How to set up the HTTP Tracking API with Tag Manager + +The actual code for setting Custom Variables is fairly simple. It starts by wrapping the function with a `_paq.push([ ]);` which sends it to Matomo. Next, the `setCustomVariable()` is set and within that are the four elements: index, name, value and scope. + +
+_paq.push([setCustomVariable(index, name, value, scope = "visit"]);
+
+ +It is important that you use a unique index for each value as the index will only ever store the most recent value. However, you can use the same name against multiple indexes so that you can store multiple values for a metric. You can find examples of this for both scopes formatted for the [HTTP tracking API](https://developer.matomo.org/api-reference/tracking-api) below. + +**Visit Scoped Custom Variable Examples** + +In this example we are tracking a Role variable where website users can hold multiple roles at the same time. In this case it is associating both a “Staff” and “Moderator” role with the visitor that will persist for all actions within their entire visit. + +
+_paq.push([setCustomVariable(1, "Role", "Staff", scope = "visit"]);
+_paq.push([setCustomVariable(2, "Role", "Moderator", scope = "visit"]);
+
+ +**Page Scoped Custom Variable Examples** + +In this example of a Page scoped custom variable multiple tags are associated with a specific page view. In this case both the “Guide” and “Videos” tag will be associated with the pageview, however this won’t be associated with other page views unless the same code is also present on those pages. + +
+_paq.push([setCustomVariable, 1, "Tag", "Guides", scope = "page"]);
+_paq.push([setCustomVariable, 2, "Tag", "Videos", scope = "page"]);
+
+ +When using the [HTTP tracking API](https://developer.matomo.org/api-reference/tracking-api) you must make sure that you set your custom variables before `trackPageview` is called. You can find more information on doing this via Matomo Tag Manager further down the page. + +##### Tracking/Capturing Custom Variables via Matomo Tag Manager + +While it may not always be the easiest way to pull data from your existing content management system, it is also possible to set up Custom Variables with [Matomo Tag Manager](https://matomo.org/docs/tag-manager/). The specific method for collecting data will vary depending on what you would like to collect but the general configuration is detailed below. + +
    +
  1. You will need to start out by installing and configuring Matomo Tag Manager if you haven’t already.
  2. +
  3. Next, Set up a Matomo Analytics Tag with the Tracking Type set to Initialise tracker only. Don’t track anything. This is because we will be creating separate tags to ensure that tracking works correctly. You will also need to click to Show advanced settings and look for the Priority text field. By default, this is set to 999, however you should change this to 1 so it becomes one of the first tags to fire when a page is loaded.
  4. +
  5. Next, you need to set up the tag that will actually track your pageviews. This can be done using a Custom HTML tag and should contain the following code: +
    +<script>
    +  var _paq = window._paq = window._paq || [];
    +  _paq.push(['trackPageView']);
    +</script>
    +
    +You will also want to ensure that this tag fires after your existing Priority for this tag so make sure you click Show advanced settings and update the Priority text field to 999 so that it always fires after the initial tag.
  6. +
  7. And finally you need to set up a Custom HTML tag for any Custom Variables that you would like to set. +
    +<script>
    +  var _paq = window._paq = window._paq || [];
    +_paq.push(['setCustomVariable', 1, 'User Role', 'Guest', scope = 'visit']);
    +_paq.push(['setCustomVariable', 1, 'Tag', 'Marketing', scope = 'page']);
    +_paq.push(['setCustomVariable', 2, 'Tag', {{dataLayer - Tags}}, scope = 'page']);
    +</script>
    +
    +You can combine several variables in a single tag if it makes sense, but you will need to ensure that the tag only fires when relevant. For example, if you create a Tags variable for tracking tags associated with pageviews, then you will need to create a Trigger that only fires when a page is loaded with the relevant tags. You can learn more about triggers here. Any tags that you create containing variables will need to be set to a Priority number somewhere between your first tag 1 and your pageview tag 999. This is so the tags all load in the correct sequence. For example: + +
      +
    • Matomo Analytics Init Tag - Priority 1
    • +
    • Custom Variables Tag - Priority 99
    • +
    • Pageview Tag - Priority 999
    • +
    +
  8. +
+ +##### Advanced: Output custom variables in your CMS dynamic code with the PHP API + +If you are a developer then you may also want to look at our case study where we show how one website integrated dynamic custom Variables with WordPress CMS using the [PHP Tracking API](https://developer.matomo.org/api-reference/PHP-Matomo-Tracker). You can also find full documentation on how to set custom variables this way in the [official PHP tracking development documentation](https://developer.matomo.org/api-reference/PHP-Matomo-Tracker#setcustomvariable) here. + +### How to Analyse Custom Variables + +You can find the **Custom Variables** report within the **Visitors** section of main navigation down the left hand side of the page. Custom Variable reports are shown in [Table format](https://matomo.org/docs/matomo-tour/#tables-5) by default, however, like most tables in Matomo there are [alternative visualisations available](https://matomo.org/docs/matomo-tour/#alternative-visualisations-of-table-data). + +The specific metrics available vary depending on the scope of the custom variable. The number of **Actions** will be shown for both **Page** and **Visit** scoped variables, but **Visit** scoped variables also offer the following additional metrics: + +* Visits +* Unique Visitors +* Users + +When reviewing Action scoped results, these values are simply blank and replaced with a hyphen as no relevant data is stored. + + + +#### Hierarchical vs Flat Analysis + +By default variable data is displayed in hierarchical format. This means you can click on the plus icon for any of the top level names to reveal the values stored against that specific Name for easy comparison. Below is an example comparing different page type on a dive review website: + + + +Alternatively you can flatten the table to compare disparate metrics against each other. For example comparing the success of certain page types against content from certain authors. Not all comparisons will make sense so it is up to you to consider whether this view is relevant for the custom variables tracked on your site. + + + +You can switch between these modes by hovering your mouse over the table to reveal a green icon menu in the bottom left of the screen. You can then click on the cog icon which provides several options including switching between hierarchical and flat data views, exclude rows with low data or [pivot your data](https://matomo.org/faq/custom-reports/faq_25253/). + + + +### Resources +* [Developer JavaScript Tracking Guide for Custom Variables](https://developer.matomo.org/guides/tracking-javascript-guide#custom-variables) +* [Developer Hooks for Custom Variables in the Reporting API](https://developer.matomo.org/api-reference/reporting-api#CustomVariables) +* [How to Extend Custom Variable Limits for Matomo On-Premise](https://matomo.org/faq/how-to/faq_17931/) +* [Advantages of Custom Dimensions over Custom Variables](https://matomo.org/faq/general/faq_21117/) +* [Developer Documentation of REST API for Custom Variables](http://developer.matomo.org/api-reference/reporting-api#CustomVariables) diff --git a/files/plugin-CustomVariables-5.0.4/RecordBuilders/CustomVariables.php b/files/plugin-CustomVariables-5.0.4/RecordBuilders/CustomVariables.php new file mode 100644 index 0000000..890cc09 --- /dev/null +++ b/files/plugin-CustomVariables-5.0.4/RecordBuilders/CustomVariables.php @@ -0,0 +1,349 @@ +maxRowsInTable = Config::getInstance()->General['datatable_archiving_maximum_rows_custom_variables'] + ?? Config::getInstance()->General['datatable_archiving_maximum_rows_custom_dimensions']; + $this->maxRowsInSubtable = Config::getInstance()->General['datatable_archiving_maximum_rows_subtable_custom_variables'] + ?? Config::getInstance()->General['datatable_archiving_maximum_rows_subtable_custom_dimensions']; + $this->columnToSortByBeforeTruncation = Metrics::INDEX_NB_VISITS; + $this->columnAggregationOps = ['slots' => 'uniquearraymerge']; + } + + public function getRecordMetadata(ArchiveProcessor $archiveProcessor): array + { + return [ + Record::make(Record::TYPE_BLOB, Archiver::CUSTOM_VARIABLE_RECORD_NAME), + ]; + } + + protected function aggregate(ArchiveProcessor $archiveProcessor): array + { + $record = new DataTable(); + $metadata = []; + $metadataFlat = []; + + $logAggregator = $archiveProcessor->getLogAggregator(); + + $maxCustomVariables = \Piwik\Plugins\CustomVariables\CustomVariables::getNumUsableCustomVariables(); + for ($i = 1; $i <= $maxCustomVariables; $i++) { + $this->aggregateCustomVariable($record, $metadata, $metadataFlat, $logAggregator, $i); + } + + $this->removeVisitsMetricsFromActionsAggregate($record); + $record->filter(DataTable\Filter\EnrichRecordWithGoalMetricSums::class); + + foreach ($record->getRows() as $row) { + $label = $row->getColumn('label'); + if (!empty($metadata[$label])) { + foreach ($metadata[$label] as $name => $value) { + $row->addMetadata($name, $value); + } + } + } + + return [Archiver::CUSTOM_VARIABLE_RECORD_NAME => $record]; + } + + + protected function aggregateCustomVariable(DataTable $record, array &$metadata, array &$metadataFlat, LogAggregator $logAggregator, string $slot): void + { + $keyField = "custom_var_k" . $slot; + $valueField = "custom_var_v" . $slot; + $where = "%s.$keyField != ''"; + $dimensions = array($keyField, $valueField); + + $query = $logAggregator->queryVisitsByDimension($dimensions, $where); + $this->aggregateFromVisits($record, $metadata, $metadataFlat, $query, $keyField, $valueField); + + // IF we query Custom Variables scope "page" either: Product SKU, Product Name, + // then we also query the "Product page view" price which was possibly recorded. + $additionalSelects = false; + + // Before Matomo 4.0.0 ecommerce views were tracked in custom variables + // So if Matomo was installed before still try to archive it the old way, as old data might be archived + if (version_compare(DbHelper::getInstallVersion(), '4.0.0-b2', '<') && in_array($slot, array(3, 4, 5))) { + $additionalSelects = array($this->getSelectAveragePrice()); + } + $query = $logAggregator->queryActionsByDimension($dimensions, $where, $additionalSelects); + $this->aggregateFromActions($record, $metadata, $metadataFlat, $query, $keyField, $valueField); + + $query = version_compare(Version::VERSION, '5.2.0-b6', '>=') + ? $logAggregator->queryConversionsByDimension($dimensions, $where, [], [], false, false, true) + : $logAggregator->queryConversionsByDimension($dimensions, $where); + $this->aggregateFromConversions($record, $query, $keyField, $valueField); + } + + protected function getSelectAveragePrice() + { + $field = "custom_var_v2"; + return LogAggregator::getSqlRevenue("AVG(log_link_visit_action." . $field . ")") . " as `" . Metrics::INDEX_ECOMMERCE_ITEM_PRICE_VIEWED . "`"; + } + + protected function aggregateFromVisits( + DataTable $record, + array &$metadata, + array &$metadataFlat, + $query, + string $keyField, + string $valueField + ): void { + while ($row = $query->fetch()) { + $key = $row[$keyField]; + $value = $this->cleanCustomVarValue($row[$valueField]); + + $this->addMetadata($metadata, $metadataFlat, $keyField, $key, Model::SCOPE_VISIT); + + $columns = [ + Metrics::INDEX_NB_UNIQ_VISITORS => $row[Metrics::INDEX_NB_UNIQ_VISITORS], + Metrics::INDEX_NB_VISITS => $row[Metrics::INDEX_NB_VISITS], + Metrics::INDEX_NB_ACTIONS => $row[Metrics::INDEX_NB_ACTIONS], + Metrics::INDEX_NB_USERS => $row[Metrics::INDEX_NB_USERS], + Metrics::INDEX_MAX_ACTIONS => $row[Metrics::INDEX_MAX_ACTIONS], + Metrics::INDEX_SUM_VISIT_LENGTH => $row[Metrics::INDEX_SUM_VISIT_LENGTH], + Metrics::INDEX_BOUNCE_COUNT => $row[Metrics::INDEX_BOUNCE_COUNT], + Metrics::INDEX_NB_VISITS_CONVERTED => $row[Metrics::INDEX_NB_VISITS_CONVERTED], + ]; + + $existingRow = $record->getRowFromLabel($key); + + // Edge case fail safe + if ( + !empty($existingRow) + && !$existingRow->hasColumn(Metrics::INDEX_NB_VISITS) + ) { + continue; + } + + // In case the existing Row had no action metrics (eg. Custom Variable XYZ with "visit" scope) + // but the new Row has action metrics (eg. same Custom Variable XYZ this time with a "page" scope) + if ( + !empty($existingRow) + && !$existingRow->hasColumn(Metrics::INDEX_MAX_ACTIONS) + ) { + $toZero = [ + Metrics::INDEX_NB_USERS, + Metrics::INDEX_MAX_ACTIONS, + Metrics::INDEX_SUM_VISIT_LENGTH, + Metrics::INDEX_BOUNCE_COUNT, + Metrics::INDEX_NB_VISITS_CONVERTED, + ]; + foreach ($toZero as $metric) { + $existingRow->setColumn($metric, 0); + } + } + + $topLevelRow = $record->sumRowWithLabel($key, $columns); + $topLevelRow->sumRowWithLabelToSubtable($value, $columns); + } + } + + protected function cleanCustomVarValue($value) + { + if ($value !== null && strlen($value)) { + return $value; + } + return Archiver::LABEL_CUSTOM_VALUE_NOT_DEFINED; + } + + protected function aggregateFromActions( + DataTable $record, + array &$metadata, + array &$metadataFlat, + $query, + string $keyField, + string $valueField + ): void { + while ($row = $query->fetch()) { + $key = $row[$keyField]; + $value = $this->cleanCustomVarValue($row[$valueField]); + + $this->addMetadata($metadata, $metadataFlat, $keyField, $key, Model::SCOPE_PAGE); + + $alreadyAggregated = $this->aggregateEcommerceCategories($record, $key, $value, $row); + if (!$alreadyAggregated) { + $this->aggregateActionByKeyAndValue($record, $key, $value, $row); + + $columns = [ + Metrics::INDEX_NB_UNIQ_VISITORS => $row[Metrics::INDEX_NB_UNIQ_VISITORS], + Metrics::INDEX_NB_VISITS => $row[Metrics::INDEX_NB_VISITS], + Metrics::INDEX_NB_ACTIONS => $row[Metrics::INDEX_NB_ACTIONS], + ]; + $record->sumRowWithLabel($key, $columns); + } + } + } + + private function addMetadata(array &$metadata, array &$metadataFlat, string $keyField, string $label, string $scope): void + { + $index = (int) str_replace('custom_var_k', '', $keyField); + + if (!array_key_exists($label, $metadata)) { + $metadata[$label] = array('slots' => array()); + } + + $uniqueId = $label . 'scope' . $scope . 'index' . $index; + + if (!isset($metadataFlat[$uniqueId])) { + $metadata[$label]['slots'][] = array('scope' => $scope, 'index' => $index); + $metadataFlat[$uniqueId] = true; + } + } + + /** + * @param string $key + * @param string $value + * @param $row + * @return bool True if the $row metrics were already added to the ->metrics + */ + protected function aggregateEcommerceCategories(DataTable $record, string $key, string $value, array $row): bool + { + $ecommerceCategoriesAggregated = false; + if ( + $key == '_pkc' + && $value[0] == '[' && $value[1] == '"' + ) { + // In case categories were truncated, try closing the array + if (substr($value, -2) != '"]') { + $value .= '"]'; + } + $decoded = json_decode($value); + if (is_array($decoded)) { + $count = 0; + foreach ($decoded as $category) { + if ( + empty($category) + || $count >= GoalManager::MAXIMUM_PRODUCT_CATEGORIES + ) { + continue; + } + $this->aggregateActionByKeyAndValue($record, $key, $category, $row); + $ecommerceCategoriesAggregated = true; + $count++; + } + } + } + return $ecommerceCategoriesAggregated; + } + + protected function aggregateActionByKeyAndValue(DataTable $record, string $key, string $value, array $row): void + { + $columns = [ + Metrics::INDEX_NB_UNIQ_VISITORS => $row[Metrics::INDEX_NB_UNIQ_VISITORS], + Metrics::INDEX_NB_VISITS => $row[Metrics::INDEX_NB_VISITS], + Metrics::INDEX_NB_ACTIONS => $row[Metrics::INDEX_NB_ACTIONS], + ]; + + $toplevelRow = $record->sumRowWithLabel($key, []); + + // Edge case fail safe + $subtable = $toplevelRow->getSubtable(); + $existingRow = !empty($subtable) ? $subtable->getRowFromLabel($value) : null; + if ( + !empty($existingRow) + && !$existingRow->hasColumn(Metrics::INDEX_NB_VISITS) + ) { + return; + } + + $subtableRow = $toplevelRow->sumRowWithLabelToSubtable($value, $columns); + + if ($this->isReservedKey($key)) { + // Price tracking on Ecommerce product/category pages: + // the average is returned from the SQL query so the price is not "summed" like other metrics + $index = Metrics::INDEX_ECOMMERCE_ITEM_PRICE_VIEWED; + if (!empty($row[$index])) { + $subtableRow->setColumn($index, (float)$row[$index]); + } + } + } + + protected static function isReservedKey($key) + { + return in_array($key, API::getReservedCustomVariableKeys()); + } + + protected function aggregateFromConversions(DataTable $record, $query, string $keyField, string $valueField): void + { + if ($query === false) { + return; + } + + while ($row = $query->fetch()) { + $key = $row[$keyField]; + + $value = $this->cleanCustomVarValue($row[$valueField]); + + $idGoal = (int) $row['idgoal']; + $columns = [ + Metrics::INDEX_GOALS => [ + $idGoal => Metrics::makeGoalColumnsRow($idGoal, $row), + ], + ]; + + $topLevelRow = $record->sumRowWithLabel($key, $columns); + $topLevelRow->sumRowWithLabelToSubtable($value, $columns); + } + } + + /** + * Delete Visit, Unique Visitor and Users metric from 'page' scope custom variables. + * + * - Custom variables of 'visit' scope: it is expected that these ones have the "visit" column set. + * - Custom variables of 'page' scope: we cannot process "Visits" count for these. + * Why? + * "Actions" column is processed with a SELECT count(*). + * A same visit can set the same custom variable of 'page' scope multiple times. + * We cannot sum the values of count(*) as it would be incorrect. + * The way we could process "Visits" Metric for 'page' scope variable is to issue a count(Distinct *) or so, + * but it is no implemented yet (this would likely be very slow for high traffic sites). + * + */ + protected function removeVisitsMetricsFromActionsAggregate(DataTable $record): void + { + foreach ($record->getRows() as $row) { + $label = $row->getColumn('label'); + if ( + !self::isReservedKey($label) + && $this->isActionsRow($row) + ) { + $row->deleteColumn(Metrics::INDEX_NB_UNIQ_VISITORS); + $row->deleteColumn(Metrics::INDEX_NB_VISITS); + $row->deleteColumn(Metrics::INDEX_NB_USERS); + } + } + } + + private function isActionsRow(DataTable\Row $row): bool + { + return count($row->getColumns()) == 4 && $row->hasColumn(Metrics::INDEX_NB_ACTIONS); + } +} diff --git a/files/plugin-CustomVariables-4.1.1/Reports/Base.php b/files/plugin-CustomVariables-5.0.4/Reports/Base.php similarity index 99% rename from files/plugin-CustomVariables-4.1.1/Reports/Base.php rename to files/plugin-CustomVariables-5.0.4/Reports/Base.php index 65a39bf..602aea7 100644 --- a/files/plugin-CustomVariables-4.1.1/Reports/Base.php +++ b/files/plugin-CustomVariables-5.0.4/Reports/Base.php @@ -1,4 +1,5 @@ categoryId = 'General_Visitors'; $this->onlineGuideUrl = 'https://matomo.org/docs/custom-variables/'; } - } diff --git a/files/plugin-CustomVariables-4.1.1/Reports/GetCustomVariables.php b/files/plugin-CustomVariables-5.0.4/Reports/GetCustomVariables.php similarity index 87% rename from files/plugin-CustomVariables-4.1.1/Reports/GetCustomVariables.php rename to files/plugin-CustomVariables-5.0.4/Reports/GetCustomVariables.php index f2490db..0f01ce2 100644 --- a/files/plugin-CustomVariables-4.1.1/Reports/GetCustomVariables.php +++ b/files/plugin-CustomVariables-5.0.4/Reports/GetCustomVariables.php @@ -1,4 +1,5 @@ dimension = new CustomVariableName(); $this->name = Piwik::translate('CustomVariables_CustomVariables'); - $this->documentation = Piwik::translate('CustomVariables_CustomVariablesReportDocumentation', - array('
', '', '')); + $this->documentation = Piwik::translate( + 'CustomVariables_CustomVariablesReportDocumentation', + array('
', '', '') + ); $this->actionToLoadSubTables = 'getCustomVariablesValuesFromNameId'; $this->order = 10; @@ -38,7 +42,7 @@ public function configureView(ViewDataTable $view) $that = $this; $view->config->filters[] = function (DataTable $table) use ($view, $that) { - if($that->isReportContainsUnsetVisitsColumns($table)) { + if ($that->isReportContainsUnsetVisitsColumns($table)) { $message = $that->getFooterMessageExplanationMissingMetrics(); $view->config->show_footer_message = $message; } @@ -50,7 +54,8 @@ public function configureView(ViewDataTable $view) */ public function getFooterMessageExplanationMissingMetrics() { - $metrics = sprintf("'%s', '%s' %s '%s'", + $metrics = sprintf( + "'%s', '%s' %s '%s'", Piwik::translate('General_ColumnNbVisits'), Piwik::translate('General_ColumnNbUniqVisitors'), Piwik::translate('General_And'), diff --git a/files/plugin-CustomVariables-4.1.1/Reports/GetCustomVariablesValuesFromNameId.php b/files/plugin-CustomVariables-5.0.4/Reports/GetCustomVariablesValuesFromNameId.php similarity index 90% rename from files/plugin-CustomVariables-4.1.1/Reports/GetCustomVariablesValuesFromNameId.php rename to files/plugin-CustomVariables-5.0.4/Reports/GetCustomVariablesValuesFromNameId.php index 1cc1bcb..d3af81f 100644 --- a/files/plugin-CustomVariables-4.1.1/Reports/GetCustomVariablesValuesFromNameId.php +++ b/files/plugin-CustomVariables-5.0.4/Reports/GetCustomVariablesValuesFromNameId.php @@ -1,4 +1,5 @@ dimension = new CustomVariableValue(); $this->name = Piwik::translate('CustomVariables_CustomVariables'); - $this->documentation = Piwik::translate('CustomVariables_CustomVariablesReportDocumentation', - array('
', '', '')); + $this->documentation = Piwik::translate( + 'CustomVariables_CustomVariablesReportDocumentation', + array('
', '', '') + ); $this->isSubtableReport = true; $this->order = 15; } @@ -35,5 +39,4 @@ public function configureView(ViewDataTable $view) $view->requestConfig->filter_sort_column = 'nb_actions'; $view->requestConfig->filter_sort_order = 'desc'; } - } diff --git a/files/plugin-CustomVariables-4.1.1/Segment.php b/files/plugin-CustomVariables-5.0.4/Segment.php similarity index 92% rename from files/plugin-CustomVariables-4.1.1/Segment.php rename to files/plugin-CustomVariables-5.0.4/Segment.php index 67459e2..a2298df 100644 --- a/files/plugin-CustomVariables-4.1.1/Segment.php +++ b/files/plugin-CustomVariables-5.0.4/Segment.php @@ -1,4 +1,5 @@ setCategory('CustomVariables_CustomVariables'); } } - diff --git a/files/plugin-CustomVariables-4.1.1/Tracker/CustomVariablesRequestProcessor.php b/files/plugin-CustomVariables-5.0.4/Tracker/CustomVariablesRequestProcessor.php similarity index 99% rename from files/plugin-CustomVariables-4.1.1/Tracker/CustomVariablesRequestProcessor.php rename to files/plugin-CustomVariables-5.0.4/Tracker/CustomVariablesRequestProcessor.php index 6253d73..e7752eb 100644 --- a/files/plugin-CustomVariables-4.1.1/Tracker/CustomVariablesRequestProcessor.php +++ b/files/plugin-CustomVariables-5.0.4/Tracker/CustomVariablesRequestProcessor.php @@ -1,4 +1,5 @@ $maxCustomVars || count($keyValue) != 2 || (!is_string($keyValue[0]) && !is_numeric($keyValue[0]) diff --git a/files/plugin-CustomVariables-4.1.1/VisitorDetails.php b/files/plugin-CustomVariables-5.0.4/VisitorDetails.php similarity index 94% rename from files/plugin-CustomVariables-4.1.1/VisitorDetails.php rename to files/plugin-CustomVariables-5.0.4/VisitorDetails.php index e514bf8..4de8a01 100644 --- a/files/plugin-CustomVariables-4.1.1/VisitorDetails.php +++ b/files/plugin-CustomVariables-5.0.4/VisitorDetails.php @@ -1,4 +1,5 @@ $customVariable) { - $scope = Model::SCOPE_PAGE; - $name = $customVariable['customVariablePageName'.$index]; - $value = $customVariable['customVariablePageValue'.$index]; + $name = $customVariable['customVariablePageName' . $index]; + $value = $customVariable['customVariablePageValue' . $index]; if (empty($value)) { continue; @@ -124,10 +125,9 @@ public function handleProfileVisit($visit, &$profile) } foreach ($visit['customVariables'] as $index => $customVariable) { - $scope = Model::SCOPE_VISIT; - $name = $customVariable['customVariableName'.$index]; - $value = $customVariable['customVariableValue'.$index]; + $name = $customVariable['customVariableName' . $index]; + $value = $customVariable['customVariableValue' . $index]; if (empty($value)) { continue; @@ -149,18 +149,16 @@ public function finalizeProfile($visits, &$profile) { $customVariables = $this->customVariables; foreach ($customVariables as $scope => &$variables) { - if (empty($variables)) { unset($customVariables[$scope]); continue; } - foreach ($variables AS $name => &$values) { + foreach ($variables as $name => &$values) { arsort($values); } } if (!empty($customVariables)) { - $profile['customVariables'] = $this->convertForProfile($customVariables); } } @@ -170,11 +168,9 @@ protected function convertForProfile($customVariables) $convertedVariables = []; foreach ($customVariables as $scope => $scopeVariables) { - $convertedVariables[$scope] = []; foreach ($scopeVariables as $name => $values) { - $variable = [ 'name' => $name, 'values' => [] @@ -193,4 +189,4 @@ protected function convertForProfile($customVariables) return $convertedVariables; } -} \ No newline at end of file +} diff --git a/files/plugin-CustomVariables-4.1.1/config/config.php b/files/plugin-CustomVariables-5.0.4/config/config.php similarity index 100% rename from files/plugin-CustomVariables-4.1.1/config/config.php rename to files/plugin-CustomVariables-5.0.4/config/config.php diff --git a/files/plugin-CustomVariables-5.0.4/config/tracker.php b/files/plugin-CustomVariables-5.0.4/config/tracker.php new file mode 100644 index 0000000..d5be5de --- /dev/null +++ b/files/plugin-CustomVariables-5.0.4/config/tracker.php @@ -0,0 +1,3 @@ + 值] 來配對。Matomo 接著會產生這些自訂名稱與值有多少訪問、頁面及轉換的報表。可以在訪客紀錄中查看每位使用者和活動的自定變數詳情。這個外掛必須要使用電子商務分析功能!", + "CustomVariablesSubcategoryHelp1": "此報表包括自定變數的資訊。點擊變數名稱查閲數值分佈。", + "CustomVariablesSubcategoryHelp2": "在線上說明了解更多此主題", + "Index": "索引", + "ManageDescription": "這個總覽顯示「%s」的所有自訂變數和它們的用途。每個欄位中的名稱將以總使用次數來排序。", + "MetricsAreOnlyAvailableForVisitScope": "注意:%1$s只有自訂變數的範圍有數據%2$s。", + "MetricsNotAvailableForPageScope": "自訂變數範圍 %1$s 中,欄位數據的值為 %2$s。", + "PluginDescription": "自訂變數是透過 Javascript API 為訪客或他們的活動以 [名稱 → 值] 來配對。Matomo 接著會產生這些自訂名稱與值有多少訪問、頁面及轉換的報表。可以在訪客紀錄中查看每位使用者和活動的自定變數詳情。這個外掛必須要使用電子商務分析功能!", + "ScopeConversion": "範圍轉換", "ScopePage": "網頁範圍", "ScopeVisit": "訪客範圍", - "ScopeConversion": "範圍轉換", - "ManageDescription": "這個總覽顯示「%s」的所有自訂變數和它們的用途。每個欄位中的名稱將以總使用次數來排序。", "ScopeX": "%s 範圍", - "Index": "索引", - "Usages": "用途", + "SlotsReportIsGeneratedOverTime": "這份報表的資料將會被補充。可能會花上一到兩天來產生資料,並且花上數周才會有完整準確的報表。", + "ToCreateCustomVarExecute": "要建立新的自訂變數欄位請在 Matomo 安裝中執行以下指令:", "Unused": "未使用", - "CreateNewSlot": "增加自訂變數可用的欄位", "UsageDetails": "自從此網站建立後已有 %1$s 次訪問數和 %2$s 個活動。", - "CurrentAvailableCustomVariables": "目前每個網站最多可以建立 %s 個自訂變數。", - "ToCreateCustomVarExecute": "要建立新的自訂變數欄位請在 Matomo 安裝路徑執行以下指令:", - "SlotsReportIsGeneratedOverTime": "這份報表的資料將會被補充。可能會花上一到兩天來產生資料,並且花上數周才會有完整準確的報表。", - "MetricsAreOnlyAvailableForVisitScope": "注意:%1$s只有自訂變數的範圍有數據%2$s。", - "MetricsNotAvailableForPageScope": "自訂變數範圍 %1$s 中,欄位數據的值為 %2$s。", - "CustomVariablesSubcategoryHelp2": "在線上說明了解更多此主題" + "Usages": "用途" } -} \ No newline at end of file +} diff --git a/files/plugin-CustomVariables-5.0.4/phpcs.xml b/files/plugin-CustomVariables-5.0.4/phpcs.xml new file mode 100644 index 0000000..29a3b9c --- /dev/null +++ b/files/plugin-CustomVariables-5.0.4/phpcs.xml @@ -0,0 +1,36 @@ + + + + Matomo Coding Standard for CustomVariables plugin + + + + . + + tests/javascript/* + */vendor/* + + + + + + + + tests/* + + + + + Updates/* + + + + + tests/* + + + + + tests/* + + \ No newline at end of file diff --git a/files/plugin-CustomVariables-4.1.1/plugin.json b/files/plugin-CustomVariables-5.0.4/plugin.json similarity index 88% rename from files/plugin-CustomVariables-4.1.1/plugin.json rename to files/plugin-CustomVariables-5.0.4/plugin.json index 3353e6c..c5fc70f 100644 --- a/files/plugin-CustomVariables-4.1.1/plugin.json +++ b/files/plugin-CustomVariables-5.0.4/plugin.json @@ -1,12 +1,12 @@ { "name": "CustomVariables", "description": "Categorise your visitors and actions with custom name-value pairs. Segment by these values and get more insights to draw the right conclusions.", - "version": "4.1.1", + "version": "5.0.4", "keywords": ["custom variables"], "license": "GPL v3+", "homepage": "https://matomo.org", "require": { - "matomo": ">=4.10.0-b1,<5.0.0-b1" + "matomo": ">=5.0.0-b4,<6.0.0-b1" }, "support": { "email": "hello@matomo.org", @@ -21,5 +21,6 @@ "email": "hello@matomo.org", "homepage": "https://matomo.org" } - ] + ], + "category": "customisation" } diff --git a/files/plugin-CustomVariables-4.1.1/templates/_actionTooltip.twig b/files/plugin-CustomVariables-5.0.4/templates/_actionTooltip.twig similarity index 100% rename from files/plugin-CustomVariables-4.1.1/templates/_actionTooltip.twig rename to files/plugin-CustomVariables-5.0.4/templates/_actionTooltip.twig diff --git a/files/plugin-CustomVariables-4.1.1/templates/_profileSummary.twig b/files/plugin-CustomVariables-5.0.4/templates/_profileSummary.twig similarity index 100% rename from files/plugin-CustomVariables-4.1.1/templates/_profileSummary.twig rename to files/plugin-CustomVariables-5.0.4/templates/_profileSummary.twig diff --git a/files/plugin-CustomVariables-4.1.1/templates/_visitorDetails.twig b/files/plugin-CustomVariables-5.0.4/templates/_visitorDetails.twig similarity index 100% rename from files/plugin-CustomVariables-4.1.1/templates/_visitorDetails.twig rename to files/plugin-CustomVariables-5.0.4/templates/_visitorDetails.twig diff --git a/files/plugin-CustomVariables-4.1.1/templates/manage.twig b/files/plugin-CustomVariables-5.0.4/templates/manage.twig similarity index 60% rename from files/plugin-CustomVariables-4.1.1/templates/manage.twig rename to files/plugin-CustomVariables-5.0.4/templates/manage.twig index 397e693..60ffb8a 100644 --- a/files/plugin-CustomVariables-4.1.1/templates/manage.twig +++ b/files/plugin-CustomVariables-5.0.4/templates/manage.twig @@ -2,7 +2,11 @@ {% block topcontrols %}
-
+
{% endblock %} diff --git a/files/plugin-CustomVariables-4.1.1/vue/dist/CustomVariables.umd.js b/files/plugin-CustomVariables-5.0.4/vue/dist/CustomVariables.umd.js similarity index 98% rename from files/plugin-CustomVariables-4.1.1/vue/dist/CustomVariables.umd.js rename to files/plugin-CustomVariables-5.0.4/vue/dist/CustomVariables.umd.js index e7c0d43..0cba004 100644 --- a/files/plugin-CustomVariables-4.1.1/vue/dist/CustomVariables.umd.js +++ b/files/plugin-CustomVariables-5.0.4/vue/dist/CustomVariables.umd.js @@ -137,101 +137,11 @@ if (typeof window !== 'undefined') { // Indicate to webpack that this file can be concatenated /* harmony default export */ var setPublicPath = (null); -// EXTERNAL MODULE: external "CoreHome" -var external_CoreHome_ = __webpack_require__("19dc"); - // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CustomVariables/vue/src/ManageCustomVars/ManageCustomVars.vue?vue&type=template&id=ddf373e4 - -var _hoisted_1 = { - class: "manageCustomVars" -}; -var _hoisted_2 = ["innerHTML"]; -var _hoisted_3 = { - class: "index" -}; -var _hoisted_4 = ["title"]; -var _hoisted_5 = { - key: 0 -}; - -var _hoisted_6 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); - -var _hoisted_7 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); - -var _hoisted_8 = ["innerHTML"]; - -var _hoisted_9 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); - -var _hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); - -var _hoisted_11 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); - -var _hoisted_12 = ["textContent"]; -function render(_ctx, _cache, $props, $setup, $data, $options) { - var _component_EnrichedHeadline = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("EnrichedHeadline"); - - var _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); - - var _directive_content_intro = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("content-intro"); - - var _directive_content_table = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("content-table"); - - var _directive_select_on_focus = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("select-on-focus"); - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_EnrichedHeadline, { - "help-url": "https://matomo.org/docs/custom-variables/" - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_CustomVariables')), 1)]; - }), - _: 1 - })]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - innerHTML: _ctx.$sanitize(_ctx.translate('CustomVariables_ManageDescription', _ctx.siteName)) - }, null, 8, _hoisted_2)])], 512), [[_directive_content_intro]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { - class: "alert alert-info" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_SlotsReportIsGeneratedOverTime')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isLoading && _ctx.hasCustomVariablesInGeneral && !_ctx.hasAtLeastOneUsage]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.scopes, function (scope) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - key: scope.name - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ContentBlock, { - "content-title": _ctx.translate('CustomVariables_ScopeX', scope.name) - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("table", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("thead", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_Index')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_Usages')), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tbody", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", { - colspan: "3" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Loading')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.isLoading]])]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.customVariablesByScope[scope.value], function (customVariables, index) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", { - key: index - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(customVariables.index), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: "unused" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_Unused')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], customVariables.usages.length === 0]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.sortUsages(customVariables), function (cvar, cvarIndex) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { - key: cvarIndex - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - title: _ctx.translate('CustomVariables_UsageDetails', cvar.nb_visits ? cvar.nb_visits : 0, cvar.nb_actions ? cvar.nb_actions : 0) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(cvar.name), 9, _hoisted_4), cvarIndex < customVariables.usages.length - 1 ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", _hoisted_5, ", ")) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], customVariables.usages.length]]); - }), 128))])]); - }), 128))])], 512), [[_directive_content_table]])]; - }), - _: 2 - }, 1032, ["content-title"])]); - }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ContentBlock, { - id: "CustomVariablesCreateNewSlot", - "content-title": _ctx.translate('CustomVariables_CreateNewSlot') - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_CreatingCustomVariableTakesTime')) + " ", 1), _hoisted_6, _hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - innerHTML: _ctx.$sanitize(_ctx.currentAvailableCustomVariablesText) - }, null, 8, _hoisted_8), _hoisted_9, _hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_ToCreateCustomVarExecute')) + " ", 1), _hoisted_11]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("pre", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("code", { - textContent: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.setMaxCustomVariablesCmd) - }, null, 8, _hoisted_12)], 512), [[_directive_select_on_focus, {}]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isLoading]])]; - }), - _: 1 - }, 8, ["content-title"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isLoading]])]); -} -// CONCATENATED MODULE: ./plugins/CustomVariables/vue/src/ManageCustomVars/ManageCustomVars.vue?vue&type=template&id=ddf373e4 +// EXTERNAL MODULE: external "CoreHome" +var external_CoreHome_ = __webpack_require__("19dc"); // CONCATENATED MODULE: ./plugins/CustomVariables/vue/src/ManageCustomVars/ManageCustomVars.store.ts function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } @@ -334,6 +244,96 @@ var ManageCustomVars_store_ManageCustomVarsStore = /*#__PURE__*/function () { }(); /* harmony default export */ var ManageCustomVars_store = (new ManageCustomVars_store_ManageCustomVarsStore()); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CustomVariables/vue/src/ManageCustomVars/ManageCustomVars.vue?vue&type=template&id=ddf373e4 + +var _hoisted_1 = { + class: "manageCustomVars" +}; +var _hoisted_2 = ["innerHTML"]; +var _hoisted_3 = { + class: "index" +}; +var _hoisted_4 = ["title"]; +var _hoisted_5 = { + key: 0 +}; + +var _hoisted_6 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var _hoisted_7 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var _hoisted_8 = ["innerHTML"]; + +var _hoisted_9 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var _hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var _hoisted_11 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var _hoisted_12 = ["textContent"]; +function render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_EnrichedHeadline = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("EnrichedHeadline"); + + var _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); + + var _directive_content_intro = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("content-intro"); + + var _directive_content_table = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("content-table"); + + var _directive_select_on_focus = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("select-on-focus"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_EnrichedHeadline, { + "help-url": "https://matomo.org/docs/custom-variables/" + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_CustomVariables')), 1)]; + }), + _: 1 + })]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + innerHTML: _ctx.$sanitize(_ctx.translate('CustomVariables_ManageDescription', _ctx.siteName)) + }, null, 8, _hoisted_2)])], 512), [[_directive_content_intro]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: "alert alert-info" + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_SlotsReportIsGeneratedOverTime')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isLoading && _ctx.hasCustomVariablesInGeneral && !_ctx.hasAtLeastOneUsage]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.scopes, function (scope) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + key: scope.name + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ContentBlock, { + "content-title": _ctx.translate('CustomVariables_ScopeX', scope.name) + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("table", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("thead", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_Index')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_Usages')), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tbody", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", { + colspan: "3" + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Loading')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.isLoading]])]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.customVariablesByScope[scope.value], function (customVariables, index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", { + key: index + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(customVariables.index), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "unused" + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_Unused')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], customVariables.usages.length === 0]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.sortUsages(customVariables), function (cvar, cvarIndex) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { + key: cvarIndex + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + title: _ctx.translate('CustomVariables_UsageDetails', cvar.nb_visits ? cvar.nb_visits : 0, cvar.nb_actions ? cvar.nb_actions : 0) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(cvar.name), 9, _hoisted_4), cvarIndex < customVariables.usages.length - 1 ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", _hoisted_5, ", ")) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], customVariables.usages.length]]); + }), 128))])]); + }), 128))])], 512), [[_directive_content_table]])]; + }), + _: 2 + }, 1032, ["content-title"])]); + }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ContentBlock, { + id: "CustomVariablesCreateNewSlot", + "content-title": _ctx.translate('CustomVariables_CreateNewSlot') + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_CreatingCustomVariableTakesTime')) + " ", 1), _hoisted_6, _hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + innerHTML: _ctx.$sanitize(_ctx.currentAvailableCustomVariablesText) + }, null, 8, _hoisted_8), _hoisted_9, _hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CustomVariables_ToCreateCustomVarExecute')) + " ", 1), _hoisted_11]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("pre", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("code", { + textContent: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.setMaxCustomVariablesCmd) + }, null, 8, _hoisted_12)], 512), [[_directive_select_on_focus, {}]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isLoading]])]; + }), + _: 1 + }, 8, ["content-title"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isLoading]])]); +} +// CONCATENATED MODULE: ./plugins/CustomVariables/vue/src/ManageCustomVars/ManageCustomVars.vue?vue&type=template&id=ddf373e4 + // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CustomVariables/vue/src/ManageCustomVars/ManageCustomVars.vue?vue&type=script&lang=ts function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || ManageCustomVarsvue_type_script_lang_ts_unsupportedIterableToArray(arr) || _nonIterableSpread(); } @@ -425,19 +425,6 @@ function ManageCustomVarsvue_type_script_lang_ts_arrayLikeToArray(arr, len) { if ManageCustomVarsvue_type_script_lang_ts.render = render /* harmony default export */ var ManageCustomVars = (ManageCustomVarsvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CustomVariables/vue/src/ManageCustomVars/ManageCustomVars.adapter.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - -/* harmony default export */ var ManageCustomVars_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ - component: ManageCustomVars, - directiveName: 'piwikManageCustomVars' -})); // CONCATENATED MODULE: ./plugins/CustomVariables/vue/src/index.ts /*! * Matomo - free/libre analytics platform @@ -447,7 +434,6 @@ ManageCustomVarsvue_type_script_lang_ts.render = render */ - // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js diff --git a/files/plugin-CustomVariables-5.0.4/vue/dist/CustomVariables.umd.min.js b/files/plugin-CustomVariables-5.0.4/vue/dist/CustomVariables.umd.min.js new file mode 100644 index 0000000..5834a0c --- /dev/null +++ b/files/plugin-CustomVariables-5.0.4/vue/dist/CustomVariables.umd.min.js @@ -0,0 +1,14 @@ +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["CustomVariables"]=t(require("CoreHome"),require("vue")):e["CustomVariables"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CustomVariables/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ManageCustomVarsStore",(function(){return j})),n.d(t,"ManageCustomVars",(function(){return H})),"undefined"!==typeof window){var r=window.document.currentScript,a=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}var o=n("8bbf"),l=n("19dc");function i(e,t){return m(e)||b(e,t)||s(e,t)||c()}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){if(e){if("string"===typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}))}},{key:"fetchUsages",value:function(){var e=this;return this.privateState.isLoading=!0,Promise.all([this.fetchCustomVariables(),l["AjaxHelper"].fetch({method:"CustomVariables.getUsagesOfSlots",filter_limit:"-1"})]).then((function(t){var n=i(t,2),r=n[1];e.privateState.customVariables=r,r.forEach((function(t){t.index>e.state.value.numSlotsAvailable&&(e.privateState.numSlotsAvailable=t.index),t.usages&&t.usages.length>0&&(e.privateState.hasAtLeastOneUsage=!0)}))})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),j=new O,h={class:"manageCustomVars"},g=["innerHTML"],y={class:"index"},V=["title"],C={key:0},S=Object(o["createElementVNode"])("br",null,null,-1),E=Object(o["createElementVNode"])("br",null,null,-1),N=["innerHTML"],w=Object(o["createElementVNode"])("br",null,null,-1),x=Object(o["createElementVNode"])("br",null,null,-1),_=Object(o["createElementVNode"])("br",null,null,-1),k=["textContent"];function A(e,t,n,r,a,l){var i=Object(o["resolveComponent"])("EnrichedHeadline"),c=Object(o["resolveComponent"])("ContentBlock"),s=Object(o["resolveDirective"])("content-intro"),u=Object(o["resolveDirective"])("content-table"),b=Object(o["resolveDirective"])("select-on-focus");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",h,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("h2",null,[Object(o["createVNode"])(i,{"help-url":"https://matomo.org/docs/custom-variables/"},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("CustomVariables_CustomVariables")),1)]})),_:1})]),Object(o["createElementVNode"])("p",null,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("CustomVariables_ManageDescription",e.siteName))},null,8,g)])],512),[[s]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",{class:"alert alert-info"},Object(o["toDisplayString"])(e.translate("CustomVariables_SlotsReportIsGeneratedOverTime")),513),[[o["vShow"],!e.isLoading&&e.hasCustomVariablesInGeneral&&!e.hasAtLeastOneUsage]]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.scopes,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:t.name},[Object(o["createVNode"])(c,{"content-title":e.translate("CustomVariables_ScopeX",t.name)},{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("table",null,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("CustomVariables_Index")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("CustomVariables_Usages")),1)])]),Object(o["createElementVNode"])("tbody",null,[Object(o["createElementVNode"])("tr",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("td",{colspan:"3"},Object(o["toDisplayString"])(e.translate("General_Loading")),513),[[o["vShow"],e.isLoading]])]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.customVariablesByScope[t.value],(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:n},[Object(o["createElementVNode"])("td",y,Object(o["toDisplayString"])(t.index),1),Object(o["createElementVNode"])("td",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"unused"},Object(o["toDisplayString"])(e.translate("CustomVariables_Unused")),513),[[o["vShow"],0===t.usages.length]]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.sortUsages(t),(function(n,r){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:r},[Object(o["createElementVNode"])("span",{title:e.translate("CustomVariables_UsageDetails",n.nb_visits?n.nb_visits:0,n.nb_actions?n.nb_actions:0)},Object(o["toDisplayString"])(n.name),9,V),re.length)&&(t=e.length);for(var n=0,r=new Array(t);n".concat(this.numSlotsAvailable,""))},setMaxCustomVariablesCmd:function(){return"./console customvariables:set-max-custom-variables ".concat(this.numSlotsAvailable+1)}}});U.render=A;var H=U; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */}})})); +//# sourceMappingURL=CustomVariables.umd.min.js.map \ No newline at end of file diff --git a/files/plugin-CustomVariables-4.1.1/vue/dist/umd.metadata.json b/files/plugin-CustomVariables-5.0.4/vue/dist/umd.metadata.json similarity index 100% rename from files/plugin-CustomVariables-4.1.1/vue/dist/umd.metadata.json rename to files/plugin-CustomVariables-5.0.4/vue/dist/umd.metadata.json diff --git a/files/plugin-CustomVariables-4.1.1/vue/src/ManageCustomVars/ManageCustomVars.less b/files/plugin-CustomVariables-5.0.4/vue/src/ManageCustomVars/ManageCustomVars.less similarity index 100% rename from files/plugin-CustomVariables-4.1.1/vue/src/ManageCustomVars/ManageCustomVars.less rename to files/plugin-CustomVariables-5.0.4/vue/src/ManageCustomVars/ManageCustomVars.less diff --git a/files/plugin-CustomVariables-4.1.1/vue/src/ManageCustomVars/ManageCustomVars.store.ts b/files/plugin-CustomVariables-5.0.4/vue/src/ManageCustomVars/ManageCustomVars.store.ts similarity index 100% rename from files/plugin-CustomVariables-4.1.1/vue/src/ManageCustomVars/ManageCustomVars.store.ts rename to files/plugin-CustomVariables-5.0.4/vue/src/ManageCustomVars/ManageCustomVars.store.ts diff --git a/files/plugin-CustomVariables-4.1.1/vue/src/ManageCustomVars/ManageCustomVars.vue b/files/plugin-CustomVariables-5.0.4/vue/src/ManageCustomVars/ManageCustomVars.vue similarity index 100% rename from files/plugin-CustomVariables-4.1.1/vue/src/ManageCustomVars/ManageCustomVars.vue rename to files/plugin-CustomVariables-5.0.4/vue/src/ManageCustomVars/ManageCustomVars.vue diff --git a/files/plugin-CustomVariables-4.1.1/vue/src/index.ts b/files/plugin-CustomVariables-5.0.4/vue/src/index.ts similarity index 85% rename from files/plugin-CustomVariables-4.1.1/vue/src/index.ts rename to files/plugin-CustomVariables-5.0.4/vue/src/index.ts index 410da49..8fc2198 100644 --- a/files/plugin-CustomVariables-4.1.1/vue/src/index.ts +++ b/files/plugin-CustomVariables-5.0.4/vue/src/index.ts @@ -5,7 +5,5 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -import './ManageCustomVars/ManageCustomVars.adapter'; - export { default as ManageCustomVarsStore } from './ManageCustomVars/ManageCustomVars.store'; export { default as ManageCustomVars } from './ManageCustomVars/ManageCustomVars.vue'; diff --git a/files/plugin-CustomVariables-4.1.1/vue/src/types.ts b/files/plugin-CustomVariables-5.0.4/vue/src/types.ts similarity index 100% rename from files/plugin-CustomVariables-4.1.1/vue/src/types.ts rename to files/plugin-CustomVariables-5.0.4/vue/src/types.ts diff --git a/files/plugin-EnvironmentVariables-4.0.1/CHANGELOG.md b/files/plugin-EnvironmentVariables-4.0.1/CHANGELOG.md deleted file mode 100644 index 2a25e8a..0000000 --- a/files/plugin-EnvironmentVariables-4.0.1/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -## Changelog - -### 4.0.1 -- Compatibility with PHP DI 6 - -### 4.0.0 -- Compatibility with Matomo 4 - -### 3.0.0 - * Initial version diff --git a/files/plugin-EnvironmentVariables-4.0.1/EnvironmentVariables.php b/files/plugin-EnvironmentVariables-4.0.1/EnvironmentVariables.php deleted file mode 100644 index f2a006e..0000000 --- a/files/plugin-EnvironmentVariables-4.0.1/EnvironmentVariables.php +++ /dev/null @@ -1,17 +0,0 @@ - DI\decorate(function ($previous, \Psr\Container\ContainerInterface $c) { - $settings = $c->get(\Piwik\Application\Kernel\GlobalSettingsProvider::class); - - $ini = $settings->getIniFileChain(); - $all = $ini->getAll(); - foreach ($all as $category => $settings) { - $categoryEnvName = 'MATOMO_' . strtoupper($category); - foreach ($settings as $settingName => $value) { - $settingEnvName = $categoryEnvName . '_' .strtoupper($settingName); - - $envValue = getenv($settingEnvName); - if ($envValue !== false) { - $general = $previous->$category; - $general[$settingName] = $envValue; - $previous->$category = $general; - } - } - } - - return $previous; - }), -); \ No newline at end of file diff --git a/files/plugin-EnvironmentVariables-4.0.1/plugin.json b/files/plugin-EnvironmentVariables-4.0.1/plugin.json deleted file mode 100644 index 3913d97..0000000 --- a/files/plugin-EnvironmentVariables-4.0.1/plugin.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "EnvironmentVariables", - "description": "Allows you to specify Matomo config in environment variables instead of the config file.", - "version": "4.0.1", - "theme": false, - "require": { - "matomo": ">=4.0.0-b1,<5.0.0-b1" - }, - "authors": [ - { - "name": "Matomo", - "email": "hello@matomo.org", - "homepage": "https://matomo.org" - } - ], - "support": { - "email": "", - "issues": "https://github.com/matomo-org/plugin-EnvironmentVariables/issues/", - "forum": "https://forum.matomo.org" - }, - "homepage": "https://matomo.org", - "license": "GPL v3+", - "keywords": ["php", "environment", "variables", "configuration"] -} diff --git a/files/plugin-EnvironmentVariables-5.0.0/CHANGELOG.md b/files/plugin-EnvironmentVariables-5.0.0/CHANGELOG.md deleted file mode 100644 index c559e88..0000000 --- a/files/plugin-EnvironmentVariables-5.0.0/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -## Changelog - -### 5.0.0 -- Compatibility with Matomo 5 - -### 4.0.1 -- Compatibility with PHP DI 6 - -### 4.0.0 -- Compatibility with Matomo 4 - -### 3.0.0 - * Initial version diff --git a/files/plugin-EnvironmentVariables-5.0.0/README.md b/files/plugin-EnvironmentVariables-5.0.0/README.md deleted file mode 100644 index 5d7a1ec..0000000 --- a/files/plugin-EnvironmentVariables-5.0.0/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Matomo EnvironmentVariables Plugin - -## Description - -Override any Matomo config with environment variables. To overwrite any setting simply specify an environment variable in the following format: - -``` -MATOMO_$CATEGORY_$SETTING -``` - -For example to overwrite the database username and password which is usually defined in the `config/config.ini.php` like this: - -```ini -[database] -username = "root" -password = "secure" -``` - -using environment variables like this: - -```bash -export MATOMO_DATABASE_USERNAME=root -export MATOMO_DATABASE_PASSWORD=secure -``` - -### Known issues: -* Configuration arrays are currently not supported, for example you cannot define which `Plugins[]` should be loaded. -* At some point your Matomo may save/write the config file, for example when changing certain settings through the UI such as the trusted hosts. In this case, the currently read environment variables will be saved in the config file. -* If this plugin is used with PHP-FPM, for example in combination with NGINX, PHP-FPM will not have access to the environment variables by default. The pool used by PHP-FPM must either explicit define which ENVs should be exposed, or set `clear_env = no` in `/etc/php7/php-fpm.f/.conf`. - diff --git a/files/plugin-EnvironmentVariables-5.0.3/CHANGELOG.md b/files/plugin-EnvironmentVariables-5.0.3/CHANGELOG.md new file mode 100644 index 0000000..f57c866 --- /dev/null +++ b/files/plugin-EnvironmentVariables-5.0.3/CHANGELOG.md @@ -0,0 +1,22 @@ +## Changelog + +### 5.0.3 - 2025-01-20 +- Added missing license file + +### 5.0.2 - 2024-10-21 +- Documentation updated to hard code config + +### 5.0.1 +- Added plugin category for Marketplace + +### 5.0.0 +- Compatibility with Matomo 5 + +### 4.0.1 +- Compatibility with PHP DI 6 + +### 4.0.0 +- Compatibility with Matomo 4 + +### 3.0.0 + * Initial version diff --git a/files/plugin-EnvironmentVariables-5.0.0/EnvironmentVariables.php b/files/plugin-EnvironmentVariables-5.0.3/EnvironmentVariables.php similarity index 98% rename from files/plugin-EnvironmentVariables-5.0.0/EnvironmentVariables.php rename to files/plugin-EnvironmentVariables-5.0.3/EnvironmentVariables.php index 5266b85..dc95723 100644 --- a/files/plugin-EnvironmentVariables-5.0.0/EnvironmentVariables.php +++ b/files/plugin-EnvironmentVariables-5.0.3/EnvironmentVariables.php @@ -5,7 +5,7 @@ * Description: Allows you to specify Matomo config in environment variables instead of the config file. * Author: Matomo * Author URI: https://matomo.org - * Version: 5.0.0 + * Version: 5.0.3 */ ?> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Matomo Copyright (C) 2007-2023 Matomo.org + + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/files/plugin-EnvironmentVariables-4.0.1/README.md b/files/plugin-EnvironmentVariables-5.0.3/README.md similarity index 69% rename from files/plugin-EnvironmentVariables-4.0.1/README.md rename to files/plugin-EnvironmentVariables-5.0.3/README.md index 5d7a1ec..0eea0a4 100644 --- a/files/plugin-EnvironmentVariables-4.0.1/README.md +++ b/files/plugin-EnvironmentVariables-5.0.3/README.md @@ -27,4 +27,17 @@ export MATOMO_DATABASE_PASSWORD=secure * Configuration arrays are currently not supported, for example you cannot define which `Plugins[]` should be loaded. * At some point your Matomo may save/write the config file, for example when changing certain settings through the UI such as the trusted hosts. In this case, the currently read environment variables will be saved in the config file. * If this plugin is used with PHP-FPM, for example in combination with NGINX, PHP-FPM will not have access to the environment variables by default. The pool used by PHP-FPM must either explicit define which ENVs should be exposed, or set `clear_env = no` in `/etc/php7/php-fpm.f/.conf`. +* When defining the database credentials as environment variables, you may have to hard code the configs indicating that this plugin is activated, like the following: +``` +[PluginsInstalled] +PluginsInstalled[] = "EnvironmentVariables" + +[Plugins] +Plugins[] = "EnvironmentVariables" +``` +Another option is to use the following console commands during the deployment process: +``` +./console config:set 'Plugins.Plugins[]="EnvironmentVariables"' +./console config:set 'PluginsInstalled.PluginsInstalled[]="EnvironmentVariables"' +``` diff --git a/files/plugin-EnvironmentVariables-5.0.0/config/config.php b/files/plugin-EnvironmentVariables-5.0.3/config/config.php similarity index 100% rename from files/plugin-EnvironmentVariables-5.0.0/config/config.php rename to files/plugin-EnvironmentVariables-5.0.3/config/config.php diff --git a/files/plugin-EnvironmentVariables-5.0.0/plugin.json b/files/plugin-EnvironmentVariables-5.0.3/plugin.json similarity index 92% rename from files/plugin-EnvironmentVariables-5.0.0/plugin.json rename to files/plugin-EnvironmentVariables-5.0.3/plugin.json index 87aada3..b9b146a 100644 --- a/files/plugin-EnvironmentVariables-5.0.0/plugin.json +++ b/files/plugin-EnvironmentVariables-5.0.3/plugin.json @@ -1,7 +1,7 @@ { "name": "EnvironmentVariables", "description": "Allows you to specify Matomo config in environment variables instead of the config file.", - "version": "5.0.0", + "version": "5.0.3", "theme": false, "require": { "matomo": ">=5.0.0-b1,<6.0.0-b1" @@ -20,5 +20,6 @@ }, "homepage": "https://matomo.org", "license": "GPL v3+", - "keywords": ["php", "environment", "variables", "configuration"] + "keywords": ["php", "environment", "variables", "configuration"], + "category": "database" }