diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-10-02 18:31:30 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-10-08 13:22:27 +0300 |
commit | dbf1b48b12b80580a42fb22c9b1156b3c909cedf (patch) | |
tree | 04a2a72db17a1d7eec460e98984a58c7b700c573 | |
parent | 31462876a0490dd263194ee258c3bb7e4b44ef76 (diff) |
Plugin to track usage of Piwik
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | config/global.ini.php | 5 | ||||
-rw-r--r-- | core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php | 2 | ||||
-rw-r--r-- | core/Plugin/Controller.php | 3 | ||||
-rw-r--r-- | core/Updates/2.15.0-b14.php | 48 | ||||
m--------- | plugins/AnonymousPiwikUsageMeasurement | 0 | ||||
-rw-r--r-- | plugins/CoreHome/stylesheets/coreHome.less | 8 | ||||
-rw-r--r-- | plugins/Morpheus/templates/_piwikTag.twig | 30 | ||||
-rw-r--r-- | plugins/Morpheus/templates/layout.twig | 1 | ||||
-rw-r--r-- | plugins/Morpheus/templates/settingsMacros.twig | 2 |
11 files changed, 62 insertions, 41 deletions
diff --git a/.gitmodules b/.gitmodules index d209a1bd03..2d7ad3acde 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,3 +49,6 @@ path = misc/log-analytics url = https://github.com/piwik/piwik-log-analytics.git branch = master +[submodule "plugins/AnonymousPiwikUsageMeasurement"] + path = plugins/AnonymousPiwikUsageMeasurement + url = https://github.com/piwik/plugin-AnonymousPiwikUsageMeasurement.git diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b29af62ec..fabc84c44e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API' * We fixed a bug where the API method `Sites.getPatternMatchSites` only returned a very limited number of websites by default. We now return all websites by default unless a limit is specified specifically. * Handling of localized date, time and range formats has been changed. Patterns no longer contain placeholders like %shortDay%, but work with CLDR pattern instead. You can use one of the predefined format constants in Date class for using getLocalized(). * As we are now using CLDR formats for all languages, some time formats were even changed in english. Attributes like prettyDate in API responses might so have been changed slightly. +* The config `enable_measure_piwik_usage_in_idsite` which is used to track the Piwik usage with Piwik was removed and replaced by a new plugin `AnonymousPiwikUsageMeasurement` ### Deprecations * The HTTP API method `SitesManager.getSitesIdWithVisits` has been deprecated and will be removed in Piwik 3.0 diff --git a/config/global.ini.php b/config/global.ini.php index cb49709b37..bdf4b3dbd4 100644 --- a/config/global.ini.php +++ b/config/global.ini.php @@ -107,11 +107,6 @@ always_archive_data_range = 0; ; NOTE: you must also set [log] log_writers[] = "screen" to enable the profiler to print on screen enable_sql_profiler = 0 -; if set to > 0, a Piwik tracking code will be included in the Piwik UI footer and will track visits, pages, etc. -; data will be stored for idSite = enable_measure_piwik_usage_in_idsite -; this is useful for Piwik developers as an easy way to create data in their local Piwik -enable_measure_piwik_usage_in_idsite = 0 - ; If set to 1, all requests to piwik.php will be forced to be 'new visitors' tracker_always_new_visitor = 0 diff --git a/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php b/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php index d8ec05ca53..aed319253f 100644 --- a/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php +++ b/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php @@ -72,6 +72,8 @@ class JScriptUIAssetFetcher extends UIAssetFetcher 'libs/bower_components/jquery-ui/ui/minified/jquery-ui.min.js', 'libs/jquery/jquery.browser.js', 'libs/', + 'js/', + 'piwik.js', 'plugins/CoreHome/javascripts/require.js', 'plugins/Morpheus/javascripts/piwikHelper.js', 'plugins/Morpheus/javascripts/jquery.icheck.min.js', diff --git a/core/Plugin/Controller.php b/core/Plugin/Controller.php index df56b4a8da..be874c6224 100644 --- a/core/Plugin/Controller.php +++ b/core/Plugin/Controller.php @@ -665,8 +665,6 @@ abstract class Controller * * The following variables assigned: * - * **enableMeasurePiwikForSiteId** - The value of the `[Debug] enable_measure_piwik_usage_in_idsite` - * INI config option. * **isSuperUser** - True if the current user is the Super User, false if otherwise. * **hasSomeAdminAccess** - True if the current user has admin access to at least one site, * false if otherwise. @@ -686,7 +684,6 @@ abstract class Controller protected function setBasicVariablesView($view) { $view->clientSideConfig = PiwikConfig::getInstance()->getClientSideOptions(); - $view->enableMeasurePiwikForSiteId = PiwikConfig::getInstance()->Debug['enable_measure_piwik_usage_in_idsite']; $view->isSuperUser = Access::getInstance()->hasSuperUserAccess(); $view->hasSomeAdminAccess = Piwik::isUserHasSomeAdminAccess(); $view->hasSomeViewAccess = Piwik::isUserHasSomeViewAccess(); diff --git a/core/Updates/2.15.0-b14.php b/core/Updates/2.15.0-b14.php new file mode 100644 index 0000000000..3da7704e9c --- /dev/null +++ b/core/Updates/2.15.0-b14.php @@ -0,0 +1,48 @@ +<?php +/** + * Piwik - free/libre analytics platform + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ + +namespace Piwik\Updates; + +use Piwik\Config; +use Piwik\Updater; +use Piwik\Updates; + +/** + * Update for version 2.15.0-b14. + */ +class Updates_2_15_0_b14 extends Updates +{ + public function getMigrationQueries(Updater $updater) + { + } + + /** + * Perform the incremental version update. + * + * This method should preform all updating logic. If you define queries in an overridden `getMigrationQueries()` + * method, you must call {@link Updater::executeMigrationQueries()} here. + * + * See {@link Updates} for an example. + * + * @param Updater $updater + */ + public function doUpdate(Updater $updater) + { + $this->removeDeprecatedDebugConfig('enable_measure_piwik_usage_in_idsite'); + } + + private function removeDeprecatedDebugConfig($name) + { + $config = Config::getInstance(); + $debug = $config->Debug; + unset($debug[$name]); + $config->Debug = $debug; + $config->forceSave(); + } +} diff --git a/plugins/AnonymousPiwikUsageMeasurement b/plugins/AnonymousPiwikUsageMeasurement new file mode 160000 +Subproject 9d6cc7e256fae61001c3a0b5959e0255bb967fa diff --git a/plugins/CoreHome/stylesheets/coreHome.less b/plugins/CoreHome/stylesheets/coreHome.less index 2e0277acf9..1813f0ebde 100644 --- a/plugins/CoreHome/stylesheets/coreHome.less +++ b/plugins/CoreHome/stylesheets/coreHome.less @@ -223,4 +223,10 @@ a.Piwik_Popover_Error_Back { border-bottom: 0 none; margin:0; font-size:18px; -}
\ No newline at end of file +} + +#pluginSettings { + .settingIntroduction { + font-weight: bold; + } +} diff --git a/plugins/Morpheus/templates/_piwikTag.twig b/plugins/Morpheus/templates/_piwikTag.twig deleted file mode 100644 index 101cb5dca7..0000000000 --- a/plugins/Morpheus/templates/_piwikTag.twig +++ /dev/null @@ -1,30 +0,0 @@ -{# Disabled by default, tracks activity of this Piwik instance #} - -{% if (piwikUrl == 'http://demo.piwik.org/' or enableMeasurePiwikForSiteId) %} - <div class="clear"></div> - <!-- Piwik --> - <script type="text/javascript"> - var _paq = _paq || []; - _paq.push(['setTrackerUrl', 'piwik.php']); - _paq.push(['setSiteId', {{ enableMeasurePiwikForSiteId }}]); - _paq.push(['setCookieDomain', '*.piwik.org']); - // set the domain the visitor landed on, in the Custom Variable - _paq.push([function () { - if (!this.getCustomVariable(1)) { - this.setCustomVariable(1, "Domain landed", document.domain); - } - }]); - // Set the selected Piwik language in a custom var - _paq.push(['setCustomVariable', 2, "Demo language", piwik.languageName]); - _paq.push(['setDocumentTitle', document.domain + "/" + document.title]); - _paq.push(['trackPageView']); - _paq.push(['enableLinkTracking', true]); - _paq.push(['enableJSErrorTracking']); - - (function() { - var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; - g.type='text/javascript'; g.async=true; g.defer=true; g.src='js/piwik.js'; s.parentNode.insertBefore(g,s); - })(); - </script> - <!-- End Piwik Code --> -{% endif %} diff --git a/plugins/Morpheus/templates/layout.twig b/plugins/Morpheus/templates/layout.twig index 1e9f1f0d5c..88695bcd9f 100644 --- a/plugins/Morpheus/templates/layout.twig +++ b/plugins/Morpheus/templates/layout.twig @@ -22,7 +22,6 @@ {% include "@CoreHome/_favicon.twig" %} {% include "_jsGlobalVariables.twig" %} - {% include "_piwikTag.twig" %} {% include "_jsCssIncludes.twig" %} <!--[if IE]> diff --git a/plugins/Morpheus/templates/settingsMacros.twig b/plugins/Morpheus/templates/settingsMacros.twig index cbb410f4a5..19a88bfa28 100644 --- a/plugins/Morpheus/templates/settingsMacros.twig +++ b/plugins/Morpheus/templates/settingsMacros.twig @@ -5,7 +5,7 @@ <div class="form-group"> {% if setting.introduction %} - <p>{{ setting.introduction }}</p> + <p class="settingIntroduction">{{ setting.introduction }}</p> {% endif %} {{ _self.field(setting, index) }} |