Matomo Analytics – Ethical Stats. Powerful Insights. - Version 4.1.1

Version Description

Download this release

Release Info

Developer matomoteam
Plugin Icon 128x128 Matomo Analytics – Ethical Stats. Powerful Insights.
Version 4.1.1
Comparing to
See all releases

Code changes from version 4.1.0 to 4.1.1

app/core/Updates/4.0.0-b1.php CHANGED
@@ -10,11 +10,9 @@
10
  namespace Piwik\Updates;
11
 
12
  use Piwik\DataAccess\TableMetadata;
13
- use Piwik\Updater\Migration\Custom as CustomMigration;
14
- use Piwik\Db;
15
  use Piwik\DbHelper;
16
  use Piwik\Plugin\Manager;
17
- use Piwik\Plugins\CoreAdminHome\Commands\MigrateTokenAuths;
18
  use Piwik\Plugins\CoreHome\Columns\Profilable;
19
  use Piwik\Plugins\CoreHome\Columns\VisitorSecondsSinceFirst;
20
  use Piwik\Plugins\CoreHome\Columns\VisitorSecondsSinceOrder;
@@ -30,7 +28,6 @@ use Piwik\Common;
30
  use Piwik\Config;
31
  use Piwik\Plugins\UserCountry\LocationProvider;
32
  use Piwik\Plugins\VisitorInterest\Columns\VisitorSecondsSinceLast;
33
- use Piwik\SettingsPiwik;
34
  use Piwik\Updater;
35
  use Piwik\Updates as PiwikUpdates;
36
  use Piwik\Updater\Migration\Factory as MigrationFactory;
@@ -58,12 +55,35 @@ class Updates_4_0_0_b1 extends PiwikUpdates
58
 
59
  $migrations = [];
60
 
61
- $domain = Config::getLocalConfigPath() === Config::getDefaultLocalConfigPath() ? '' : Config::getHostname();
62
- $domainArg = !empty($domain) ? "--matomo-domain=". escapeshellarg($domain) . " " : '';
63
- $toString = sprintf('./console %score:matomo4-migrate-token-auths', $domainArg);
64
- $custom = new CustomMigration(array(MigrateTokenAuths::class, 'migrate'), $toString);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
- $migrations[] = $custom;
67
 
68
  // invalidations table
69
  $migrations[] = $this->migration->db->createTable('archive_invalidations', [
@@ -75,6 +95,7 @@ class Updates_4_0_0_b1 extends PiwikUpdates
75
  'date2' => 'DATE NOT NULL',
76
  'period' => 'TINYINT UNSIGNED NOT NULL',
77
  'ts_invalidated' => 'DATETIME NOT NULL',
 
78
  'status' => 'TINYINT(1) UNSIGNED DEFAULT 0',
79
  'report' => 'VARCHAR(255) NULL',
80
  ], ['idinvalidation']);
@@ -82,41 +103,13 @@ class Updates_4_0_0_b1 extends PiwikUpdates
82
  $migrations[] = $this->migration->db->addIndex('archive_invalidations', ['idsite', 'date1', 'period'], 'index_idsite_dates_period_name');
83
 
84
  $migrations[] = $this->migration->db->dropColumn('user', 'alias');
 
85
 
86
- // prevent possible duplicates when shorting session id
87
- $migrations[] = $this->migration->db->sql('DELETE FROM `' . Common::prefixTable('session') . '` WHERE length(id) > 190');
88
-
89
- $migrations[] = $this->migration->db->changeColumnType('session', 'id', 'VARCHAR(191)');
90
- $migrations[] = $this->migration->db->changeColumnType('site_url', 'url', 'VARCHAR(190)');
91
- $migrations[] = $this->migration->db->changeColumnType('option', 'option_name', 'VARCHAR(191)');
92
 
93
- $migrations[] = $this->migration->db->changeColumnType('log_action', 'name', 'VARCHAR(4096)');
94
- $migrations[] = $this->migration->db->changeColumnType('log_conversion', 'url', 'VARCHAR(4096)');
95
  $migrations[] = $this->migration->db->changeColumn('log_link_visit_action', 'interaction_position', 'pageview_position', 'MEDIUMINT UNSIGNED DEFAULT NULL');
96
 
97
- $customTrackerPluginActive = false;
98
- if (in_array('CustomPiwikJs', Config::getInstance()->Plugins['Plugins'])) {
99
- $customTrackerPluginActive = true;
100
- }
101
-
102
- $migrations[] = $this->migration->plugin->activate('BulkTracking');
103
- $migrations[] = $this->migration->plugin->deactivate('CustomPiwikJs');
104
- $migrations[] = $this->migration->plugin->uninstall('CustomPiwikJs');
105
-
106
- if ($customTrackerPluginActive) {
107
- $migrations[] = $this->migration->plugin->activate('CustomJsTracker');
108
- }
109
-
110
- // Prepare all installed tables for utf8mb4 conversions. e.g. make some indexed fields smaller so they don't exceed the maximum key length
111
- $allTables = DbHelper::getTablesInstalled();
112
-
113
- foreach ($allTables as $table) {
114
- if (preg_match('/archive_/', $table) == 1) {
115
- $tableNameUnprefixed = Common::unprefixTable($table);
116
- $migrations[] = $this->migration->db->changeColumnType($tableNameUnprefixed, 'name', 'VARCHAR(190)');
117
- }
118
- }
119
-
120
  // Move the site search fields of log_visit out of custom variables into their own fields
121
  $columnsToAdd['log_link_visit_action']['search_cat'] = 'VARCHAR(200) NULL';
122
  $columnsToAdd['log_link_visit_action']['search_count'] = 'INTEGER(10) UNSIGNED NULL';
@@ -159,19 +152,6 @@ class Updates_4_0_0_b1 extends PiwikUpdates
159
  }
160
  }
161
 
162
- if (Manager::getInstance()->isPluginInstalled('CustomVariables')) {
163
- $visitActionTable = Common::prefixTable('log_link_visit_action');
164
- $migrations[] = $this->migration->db->sql("UPDATE $visitActionTable SET search_cat = if(custom_var_k4 = '_pk_scat', custom_var_v4, search_cat), search_count = if(custom_var_k5 = '_pk_scount', custom_var_v5, search_count) WHERE custom_var_k4 = '_pk_scat' or custom_var_k5 = '_pk_scount'");
165
- }
166
-
167
- if ($this->usesGeoIpLegacyLocationProvider()) {
168
- // activate GeoIp2 plugin for users still using GeoIp2 Legacy (others might have it disabled on purpose)
169
- $migrations[] = $this->migration->plugin->activate('GeoIp2');
170
- }
171
-
172
- // remove old options
173
- $migrations[] = $this->migration->db->sql('DELETE FROM `' . Common::prefixTable('option') . '` WHERE option_name IN ("geoip.updater_period", "geoip.loc_db_url", "geoip.isp_db_url", "geoip.org_db_url")');
174
-
175
  // init seconds_to_... columns
176
  $logVisitColumns = $tableMetadata->getColumns(Common::prefixTable('log_visit'));
177
  $hasDaysColumnInVisit = in_array('visitor_days_since_first', $logVisitColumns);
@@ -192,6 +172,11 @@ class Updates_4_0_0_b1 extends PiwikUpdates
192
  visitor_seconds_since_order = visitor_days_since_order * 86400");
193
  }
194
 
 
 
 
 
 
195
  // remove old days_to_... columns
196
  $migrations[] = $this->migration->db->dropColumns('log_visit', [
197
  'config_gears',
@@ -211,9 +196,6 @@ class Updates_4_0_0_b1 extends PiwikUpdates
211
  $migrations[] = $this->migration->config->set('mail', 'type', 'Cram-md5');
212
  }
213
 
214
- // keep piwik_ignore for existing installs
215
- $migrations[] = $this->migration->config->set('Tracker', 'ignore_visits_cookie_name', 'piwik_ignore');
216
-
217
  $migrations[] = $this->migration->plugin->activate('PagePerformance');
218
  if (!Manager::getInstance()->isPluginActivated('CustomDimensions')) {
219
  $migrations[] = $this->migration->plugin->activate('CustomDimensions');
@@ -229,76 +211,18 @@ class Updates_4_0_0_b1 extends PiwikUpdates
229
  $migrations[] = $this->migration->config->set('General', 'datatable_archiving_maximum_rows_subtable_custom_dimensions', $configSubTableLimit);
230
  }
231
 
 
 
 
 
 
 
232
  return $migrations;
233
  }
234
 
235
  public function doUpdate(Updater $updater)
236
  {
237
- $salt = SettingsPiwik::getSalt();
238
- $sessions = Db::fetchAll('SELECT id from ' . Common::prefixTable('session'));
239
-
240
- foreach ($sessions as $session) {
241
- if (!empty($session['id']) && Common::mb_strlen($session['id']) != 128) {
242
- $bind = [ hash('sha512', $session['id'] . $salt), $session['id'] ];
243
- try {
244
- Db::query(sprintf('UPDATE %s SET id = ? WHERE id = ?', Common::prefixTable('session')), $bind);
245
- } catch (\Exception $e) {
246
- // ignore possible duplicate key errors
247
- }
248
- }
249
- }
250
-
251
  $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
252
-
253
- if ($this->usesGeoIpLegacyLocationProvider()) {
254
- // switch to default provider if GeoIp Legacy was still in use
255
- LocationProvider::setCurrentProvider(LocationProvider\DefaultProvider::ID);
256
- }
257
-
258
- // eg the case when not updating from most recent Matomo 3.X and when not using the UI updater
259
- // afterwards the should receive a notification that the plugins are outdated
260
- self::ensureCorePluginsThatWereMovedToMarketplaceCanBeUpdated();
261
- ServerFilesGenerator::createFilesForSecurity();
262
- }
263
-
264
- public static function ensureCorePluginsThatWereMovedToMarketplaceCanBeUpdated()
265
- {
266
- $plugins = ['Provider', 'CustomVariables'];
267
- $pluginManager = Manager::getInstance();
268
- foreach ($plugins as $plugin) {
269
- if ($pluginManager->isPluginThirdPartyAndBogus($plugin)) {
270
- $pluginDir = Manager::getPluginDirectory($plugin);
271
-
272
- if (is_dir($pluginDir) &&
273
- file_exists($pluginDir . '/' . $plugin . '.php')
274
- && !file_exists($pluginDir . '/plugin.json')
275
- && is_writable($pluginDir)) {
276
- file_put_contents($pluginDir . '/plugin.json', '{
277
- "name": "'.$plugin.'",
278
- "description": "'.$plugin.'",
279
- "version": "3.14.1",
280
- "theme": false,
281
- "require": {
282
- "piwik": ">=3.0.0,<4.0.0-b1"
283
- },
284
- "authors": [
285
- {
286
- "name": "Matomo",
287
- "email": "hello@matomo.org",
288
- "homepage": "https:\/\/matomo.org"
289
- }
290
- ],
291
- "homepage": "https:\/\/matomo.org",
292
- "license": "GPL v3+",
293
- "keywords": ["'.$plugin.'"]
294
- }');
295
- // otherwise cached information might be used and it won't be loaded otherwise within same request
296
- $pluginObj = $pluginManager->loadPlugin($plugin);
297
- $pluginObj->reloadPluginInformation();
298
- $pluginManager->unloadPlugin($pluginObj); // prevent any events being posted to it somehow
299
- }
300
- }
301
- }
302
  }
303
 
304
  protected function usesGeoIpLegacyLocationProvider()
10
  namespace Piwik\Updates;
11
 
12
  use Piwik\DataAccess\TableMetadata;
13
+ use Piwik\Date;
 
14
  use Piwik\DbHelper;
15
  use Piwik\Plugin\Manager;
 
16
  use Piwik\Plugins\CoreHome\Columns\Profilable;
17
  use Piwik\Plugins\CoreHome\Columns\VisitorSecondsSinceFirst;
18
  use Piwik\Plugins\CoreHome\Columns\VisitorSecondsSinceOrder;
28
  use Piwik\Config;
29
  use Piwik\Plugins\UserCountry\LocationProvider;
30
  use Piwik\Plugins\VisitorInterest\Columns\VisitorSecondsSinceLast;
 
31
  use Piwik\Updater;
32
  use Piwik\Updates as PiwikUpdates;
33
  use Piwik\Updater\Migration\Factory as MigrationFactory;
55
 
56
  $migrations = [];
57
 
58
+ /** APP SPECIFIC TOKEN START */
59
+ $migrations[] = $this->migration->db->createTable('user_token_auth', array(
60
+ 'idusertokenauth' => 'BIGINT UNSIGNED NOT NULL AUTO_INCREMENT',
61
+ 'login' => 'VARCHAR(100) NOT NULL',
62
+ 'description' => 'VARCHAR('.Model::MAX_LENGTH_TOKEN_DESCRIPTION.') NOT NULL',
63
+ 'password' => 'VARCHAR(191) NOT NULL',
64
+ 'system_token' => 'TINYINT(1) NOT NULL DEFAULT 0',
65
+ 'hash_algo' => 'VARCHAR(30) NOT NULL',
66
+ 'last_used' => 'DATETIME NULL',
67
+ 'date_created' => ' DATETIME NOT NULL',
68
+ 'date_expired' => ' DATETIME NULL',
69
+ ), 'idusertokenauth');
70
+ $migrations[] = $this->migration->db->addUniqueKey('user_token_auth', 'password', 'uniq_password');
71
+
72
+ $migrations[] = $this->migration->db->dropIndex('user', 'uniq_keytoken');
73
+
74
+ $userModel = new Model();
75
+ foreach ($userModel->getUsers(array()) as $user) {
76
+ if (!empty($user['token_auth'])) {
77
+ $migrations[] = $this->migration->db->insert('user_token_auth', array(
78
+ 'login' => $user['login'],
79
+ 'description' => 'Created by Matomo 4 migration',
80
+ 'password' => $userModel->hashTokenAuth($user['token_auth']),
81
+ 'date_created' => Date::now()->getDatetime()
82
+ ));
83
+ }
84
+ }
85
 
86
+ /** APP SPECIFIC TOKEN END */
87
 
88
  // invalidations table
89
  $migrations[] = $this->migration->db->createTable('archive_invalidations', [
95
  'date2' => 'DATE NOT NULL',
96
  'period' => 'TINYINT UNSIGNED NOT NULL',
97
  'ts_invalidated' => 'DATETIME NOT NULL',
98
+ 'ts_started' => 'DATETIME NULL',
99
  'status' => 'TINYINT(1) UNSIGNED DEFAULT 0',
100
  'report' => 'VARCHAR(255) NULL',
101
  ], ['idinvalidation']);
103
  $migrations[] = $this->migration->db->addIndex('archive_invalidations', ['idsite', 'date1', 'period'], 'index_idsite_dates_period_name');
104
 
105
  $migrations[] = $this->migration->db->dropColumn('user', 'alias');
106
+ $migrations[] = $this->migration->db->dropColumn('user', 'token_auth');
107
 
108
+ // keep piwik_ignore for existing installs
109
+ $migrations[] = $this->migration->config->set('Tracker', 'ignore_visits_cookie_name', 'piwik_ignore');
 
 
 
 
110
 
 
 
111
  $migrations[] = $this->migration->db->changeColumn('log_link_visit_action', 'interaction_position', 'pageview_position', 'MEDIUMINT UNSIGNED DEFAULT NULL');
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  // Move the site search fields of log_visit out of custom variables into their own fields
114
  $columnsToAdd['log_link_visit_action']['search_cat'] = 'VARCHAR(200) NULL';
115
  $columnsToAdd['log_link_visit_action']['search_count'] = 'INTEGER(10) UNSIGNED NULL';
152
  }
153
  }
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  // init seconds_to_... columns
156
  $logVisitColumns = $tableMetadata->getColumns(Common::prefixTable('log_visit'));
157
  $hasDaysColumnInVisit = in_array('visitor_days_since_first', $logVisitColumns);
172
  visitor_seconds_since_order = visitor_days_since_order * 86400");
173
  }
174
 
175
+ if (Manager::getInstance()->isPluginInstalled('CustomVariables')) {
176
+ $visitActionTable = Common::prefixTable('log_link_visit_action');
177
+ $migrations[] = $this->migration->db->sql("UPDATE $visitActionTable SET search_cat = if(custom_var_k4 = '_pk_scat', custom_var_v4, search_cat), search_count = if(custom_var_k5 = '_pk_scount', custom_var_v5, search_count) WHERE custom_var_k4 = '_pk_scat' or custom_var_k5 = '_pk_scount'");
178
+ }
179
+
180
  // remove old days_to_... columns
181
  $migrations[] = $this->migration->db->dropColumns('log_visit', [
182
  'config_gears',
196
  $migrations[] = $this->migration->config->set('mail', 'type', 'Cram-md5');
197
  }
198
 
 
 
 
199
  $migrations[] = $this->migration->plugin->activate('PagePerformance');
200
  if (!Manager::getInstance()->isPluginActivated('CustomDimensions')) {
201
  $migrations[] = $this->migration->plugin->activate('CustomDimensions');
211
  $migrations[] = $this->migration->config->set('General', 'datatable_archiving_maximum_rows_subtable_custom_dimensions', $configSubTableLimit);
212
  }
213
 
214
+ $migrations[] = $this->migration->db->changeColumnType('session', 'id', 'VARCHAR(191)');
215
+ $migrations[] = $this->migration->db->changeColumnType('site_url', 'url', 'VARCHAR(190)');
216
+ $migrations[] = $this->migration->db->changeColumnType('option', 'option_name', 'VARCHAR(191)');
217
+
218
+ $migrations[] = $this->migration->db->changeColumnType('log_action', 'name', 'VARCHAR(4096)');
219
+ $migrations[] = $this->migration->db->changeColumnType('log_conversion', 'url', 'VARCHAR(4096)');
220
  return $migrations;
221
  }
222
 
223
  public function doUpdate(Updater $updater)
224
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  }
227
 
228
  protected function usesGeoIpLegacyLocationProvider()
app/core/Updates/4.0.0-b3.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
- /**
3
- * Matomo - free/libre analytics platform
4
- *
5
- * @link https://matomo.org
6
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
7
- *
8
- */
9
-
10
- namespace Piwik\Updates;
11
-
12
- use Piwik\Config;
13
- use Piwik\Updater;
14
- use Piwik\Updates as PiwikUpdates;
15
- use Piwik\Updater\Migration\Factory as MigrationFactory;
16
-
17
- /**
18
- * Update for version 4.0.0-b3.
19
- */
20
- class Updates_4_0_0_b3 extends PiwikUpdates
21
- {
22
- /**
23
- * @var MigrationFactory
24
- */
25
- private $migration;
26
-
27
- public function __construct(MigrationFactory $factory)
28
- {
29
- $this->migration = $factory;
30
- }
31
-
32
- public function getMigrations(Updater $updater)
33
- {
34
- $migrations = [];
35
-
36
- $config = Config::getInstance();
37
- $general = $config->General;
38
- if (empty($general['login_whitelist_apply_to_reporting_api_requests'])) {
39
- $migrations[] = $this->migration->config->set('General', 'login_allowlist_apply_to_reporting_api_requests', '0');
40
- }
41
-
42
- return $migrations;
43
- }
44
-
45
- public function doUpdate(Updater $updater)
46
- {
47
- $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
48
-
49
- $config = Config::getInstance();
50
- $general = $config->General;
51
- if (!empty($general['login_whitelist_ip'])) {
52
- // the migration->config->set does not support arrays yet so we do it here.
53
- $general['login_allowlist_ip'] = $general['login_whitelist_ip'];
54
- $config->General = $general;
55
- $config->forceSave();
56
- }
57
-
58
- }
59
-
60
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/core/Updates/4.0.0-rc3.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- /**
3
- * Matomo - free/libre analytics platform
4
- *
5
- * @link https://matomo.org
6
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
7
- *
8
- */
9
-
10
- namespace Piwik\Updates;
11
-
12
- use Piwik\Config;
13
- use Piwik\Updater;
14
- use Piwik\Updates as PiwikUpdates;
15
- use Piwik\Updater\Migration\Factory as MigrationFactory;
16
-
17
- /**
18
- * Update for version 4.0.0-b3.
19
- */
20
- class Updates_4_0_0_rc3 extends PiwikUpdates
21
- {
22
- /**
23
- * @var MigrationFactory
24
- */
25
- private $migration;
26
-
27
- public function __construct(MigrationFactory $factory)
28
- {
29
- $this->migration = $factory;
30
- }
31
-
32
- public function getMigrations(Updater $updater)
33
- {
34
- $migrations = [];
35
- $migrations[] = $this->migration->db->addColumn('archive_invalidations', 'ts_started', 'DATETIME NULL');
36
- return $migrations;
37
- }
38
-
39
- public function doUpdate(Updater $updater)
40
- {
41
- $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
42
- }
43
-
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/core/Updates/4.0.0-rc4.php DELETED
@@ -1,68 +0,0 @@
1
- <?php
2
- /**
3
- * Matomo - free/libre analytics platform
4
- *
5
- * @link https://matomo.org
6
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
7
- *
8
- */
9
-
10
- namespace Piwik\Updates;
11
-
12
- use Piwik\Config;
13
- use Piwik\Container\StaticContainer;
14
- use Piwik\DataAccess\ArchiveTableCreator;
15
- use Piwik\Date;
16
- use Piwik\DbHelper;
17
- use Piwik\Plugin\ReleaseChannels;
18
- use Piwik\Updater;
19
- use Piwik\Updates as PiwikUpdates;
20
- use Piwik\Updater\Migration\Factory as MigrationFactory;
21
-
22
- /**
23
- * Update for version 4.0.0-rc4.
24
- */
25
- class Updates_4_0_0_rc4 extends PiwikUpdates
26
- {
27
- /**
28
- * @var MigrationFactory
29
- */
30
- private $migration;
31
-
32
- public function __construct(MigrationFactory $factory)
33
- {
34
- $this->migration = $factory;
35
- }
36
-
37
- public function getMigrations(Updater $updater)
38
- {
39
- $migrations = [];
40
-
41
- $migrations[] = $this->migration->plugin->deactivate('ExampleTheme');
42
-
43
- $channel = StaticContainer::get(ReleaseChannels::class)->getActiveReleaseChannel()->getId();
44
- $isBeta = stripos($channel, 'beta') !== false;
45
-
46
- if ($isBeta) {
47
- $dates = ['2020-01-01', '2020-11-01', '2020-10-01'];
48
- foreach ($dates as $date) {
49
- $date = Date::factory($date);
50
- $numericTable = ArchiveTableCreator::getBlobTable($date);
51
- $blobTable = ArchiveTableCreator::getNumericTable($date);
52
-
53
- if (DbHelper::tableExists($blobTable) && DbHelper::tableExists($numericTable)) {
54
- $migrations[] = $this->migration->db->sql(
55
- "DELETE FROM `$blobTable` WHERE idarchive NOT IN (SELECT idarchive FROM `$numericTable`)", []);
56
- }
57
- }
58
- }
59
-
60
- return $migrations;
61
- }
62
-
63
- public function doUpdate(Updater $updater)
64
- {
65
- $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
66
- }
67
-
68
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/core/Updates/4.0.1-b1.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
- /**
3
- * Matomo - free/libre analytics platform
4
- *
5
- * @link https://matomo.org
6
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
7
- *
8
- */
9
-
10
- namespace Piwik\Updates;
11
-
12
- use Piwik\Common;
13
- use Piwik\Config;
14
- use Piwik\Container\StaticContainer;
15
- use Piwik\DataAccess\ArchiveTableCreator;
16
- use Piwik\Date;
17
- use Piwik\DbHelper;
18
- use Piwik\Plugin\ReleaseChannels;
19
- use Piwik\SettingsPiwik;
20
- use Piwik\Updater;
21
- use Piwik\Updates as PiwikUpdates;
22
- use Piwik\Updater\Migration\Factory as MigrationFactory;
23
-
24
- class Updates_4_0_1_b1 extends PiwikUpdates
25
- {
26
- /**
27
- * @var MigrationFactory
28
- */
29
- private $migration;
30
-
31
- public function __construct(MigrationFactory $factory)
32
- {
33
- $this->migration = $factory;
34
- }
35
-
36
- public function getMigrations(Updater $updater)
37
- {
38
- $migrations = [];
39
-
40
- $table = Common::prefixTable('user_token_auth');
41
- $migrations[] = $this->migration->db->sql('UPDATE ' . $table . ' SET hash_algo = "sha512" where hash_algo is null or hash_algo = "" ');
42
-
43
- if (SettingsPiwik::isGitDeployment()) {
44
- return $migrations;
45
- }
46
-
47
- $migrations[] = $this->migration->plugin->uninstall('ExampleTheme');
48
- return $migrations;
49
- }
50
-
51
- public function doUpdate(Updater $updater)
52
- {
53
- $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
54
- }
55
-
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/core/Updates/4.0.4-b1.php DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
- /**
3
- * Matomo - free/libre analytics platform
4
- *
5
- * @link https://matomo.org
6
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
7
- *
8
- */
9
-
10
- namespace Piwik\Updates;
11
-
12
- use Piwik\SettingsPiwik;
13
- use Piwik\Updater;
14
- use Piwik\Updates as PiwikUpdates;
15
- use Piwik\Updater\Migration\Factory as MigrationFactory;
16
-
17
- class Updates_4_0_4_b1 extends PiwikUpdates
18
- {
19
- /**
20
- * @var MigrationFactory
21
- */
22
- private $migration;
23
-
24
- public function __construct(MigrationFactory $factory)
25
- {
26
- $this->migration = $factory;
27
- }
28
-
29
- public function getMigrations(Updater $updater)
30
- {
31
- $migrations = [];
32
-
33
- if (SettingsPiwik::isGitDeployment()) {
34
- return $migrations;
35
- }
36
-
37
- $migrations[] = $this->migration->plugin->deactivate('ExamplePlugin');
38
- $migrations[] = $this->migration->plugin->deactivate('ExampleLogTables');
39
- $migrations[] = $this->migration->plugin->deactivate('ExampleUI');
40
- $migrations[] = $this->migration->plugin->deactivate('ExampleReport');
41
- $migrations[] = $this->migration->plugin->deactivate('ExampleAPI');
42
- $migrations[] = $this->migration->plugin->deactivate('ExampleCommand');
43
- $migrations[] = $this->migration->plugin->deactivate('ExampleSettingsPlugin');
44
- $migrations[] = $this->migration->plugin->deactivate('ExampleTracker');
45
- $migrations[] = $this->migration->plugin->deactivate('ExampleVisualization');
46
-
47
- $migrations[] = $this->migration->plugin->uninstall('ExamplePlugin');
48
- $migrations[] = $this->migration->plugin->uninstall('ExampleLogTables');
49
- $migrations[] = $this->migration->plugin->uninstall('ExampleUI');
50
- $migrations[] = $this->migration->plugin->uninstall('ExampleReport');
51
- $migrations[] = $this->migration->plugin->uninstall('ExampleAPI');
52
- $migrations[] = $this->migration->plugin->uninstall('ExampleCommand');
53
- $migrations[] = $this->migration->plugin->uninstall('ExampleSettingsPlugin');
54
- $migrations[] = $this->migration->plugin->uninstall('ExampleTracker');
55
- $migrations[] = $this->migration->plugin->uninstall('ExampleVisualization');
56
- return $migrations;
57
- }
58
-
59
- public function doUpdate(Updater $updater)
60
- {
61
- $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
62
- }
63
-
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/WpMatomo.php CHANGED
@@ -160,7 +160,7 @@ class WpMatomo {
160
  private static function get_active_plugins()
161
  {
162
  $plugins = [];
163
- if (is_multisite()) {
164
  $muplugins = get_site_option( 'active_sitewide_plugins' );
165
  $plugins = array_keys($muplugins);
166
  }
160
  private static function get_active_plugins()
161
  {
162
  $plugins = [];
163
+ if (function_exists('is_multisite') && is_multisite()) {
164
  $muplugins = get_site_option( 'active_sitewide_plugins' );
165
  $plugins = array_keys($muplugins);
166
  }
matomo.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: The #1 Google Analytics alternative that gives you full control over your data and protects the privacy for your users. Free, secure and open.
5
  * Author: Matomo
6
  * Author URI: https://matomo.org
7
- * Version: 4.1.0
8
  * Domain Path: /languages
9
  * WC requires at least: 2.4.0
10
  * WC tested up to: 4.8.0
4
  * Description: The #1 Google Analytics alternative that gives you full control over your data and protects the privacy for your users. Free, secure and open.
5
  * Author: Matomo
6
  * Author URI: https://matomo.org
7
+ * Version: 4.1.1
8
  * Domain Path: /languages
9
  * WC requires at least: 2.4.0
10
  * WC tested up to: 4.8.0
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: matomo,piwik,analytics,statistics,stats,tracking,ecommerce
5
  Requires at least: 4.8
6
  Tested up to: 5.6
7
- Stable tag: 4.1.0
8
  Requires PHP: 7.2.5
9
  License: GPLv3 or later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
4
  Tags: matomo,piwik,analytics,statistics,stats,tracking,ecommerce
5
  Requires at least: 4.8
6
  Tested up to: 5.6
7
+ Stable tag: 4.1.1
8
  Requires PHP: 7.2.5
9
  License: GPLv3 or later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html