Skip to content

Commit

Permalink
Merge pull request #612 from matomo-org/develop
Browse files Browse the repository at this point in the history
Update live for upcoming 4.10.0 release
  • Loading branch information
tsteur authored Jun 1, 2022
2 parents 11c9b43 + ca716ca commit a74ab57
Show file tree
Hide file tree
Showing 2,868 changed files with 126,050 additions and 33,292 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
== Changelog ==

= 4.10.0 =
* Update Matomo core to 4.10.0
* Fix a white screen issue in multisite mode
* Add wpstatistics import feature

= 4.6.0 =
* Update Matomo core to 4.6.0
* WooCommerce: Make excluded order status configurable using a constant
Expand Down
2 changes: 1 addition & 1 deletion app/LEGALNOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ THIRD-PARTY CONTENT
Link: https://design.google.com/icons/
License: Apache License Version 2.0

Name: IcoMoon - Free icons ("icon-funnel", "icon-lab", "icon-archive", "icon-rocket", "icon-embed", "icon-page-performance") in plugins/Morpheus/fonts
Name: IcoMoon - Free icons ("icon-funnel", "icon-lab", "icon-archive", "icon-rocket", "icon-embed", "icon-page-performance", "icon-github") in plugins/Morpheus/fonts
Link: https://icomoon.io/#icons-icomoon
License: GPL

Expand Down
2 changes: 1 addition & 1 deletion app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Code Status

[![Build Status](https://travis-ci.com/matomo-org/matomo.svg?branch=4.x-dev)](https://travis-ci.com/matomo-org/matomo/branches)
[![Build Status](https://travis-ci.com/matomo-org/matomo.svg?branch=4.x-dev)](https://app.travis-ci.com/matomo-org/matomo/branches)
[![Percentage of issues still open](http://isitmaintained.com/badge/open/matomo-org/matomo.svg)](http://isitmaintained.com/project/matomo-org/matomo "Percentage of issues still open")

## Description
Expand Down
2 changes: 1 addition & 1 deletion app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function matomo_log_message_no_display($message)

if ( !is_plugin_active('matomo/matomo.php')
&& (!defined( 'MATOMO_PHPUNIT_TEST' ) || !MATOMO_PHPUNIT_TEST) ) { // during tests the plugin may temporarily not be active
exit;
exit;
}

if ( $GLOBALS['MATOMO_LOADED_DIRECTLY'] ) {
Expand Down
16 changes: 14 additions & 2 deletions app/config/global.ini.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,11 @@
; This feature will not work with the MYSQLI extension.
archiving_query_max_execution_time = 7200


; Allows you to disable archiving segments for selected plugins. For more details please see https://matomo.org/faq/how-to-disable-archiving-the-segment-reports-for-specific-plugins
; Here you can specify the comma separated list eg: "plugin1,plugin2"
disable_archiving_segment_for_plugins = ""

; By default Matomo runs OPTIMIZE TABLE SQL queries to free spaces after deleting some data.
; If your Matomo tracks millions of pages, the OPTIMIZE TABLE queries might run for hours (seen in "SHOW FULL PROCESSLIST \g")
; so you can disable these special queries here:
Expand Down Expand Up @@ -634,6 +639,7 @@
; By enabling this flag we will for example not allow the installation of a plugin via the UI as a plugin would be only
; installed on one server or a config one change would be only made on one server instead of all servers.
; This flag doesn't need to be enabled when the config file is on a shared filesystem such as NFS or EFS.
; When enabled, Matomo will return the response code 200 instead of 503 in maintenance mode.
multi_server_environment = 0

; List of proxy headers for client IP addresses
Expand Down Expand Up @@ -676,7 +682,8 @@
enable_trusted_host_check = 1

; List of trusted hosts (eg domain or subdomain names) when generating absolute URLs.
;
; This only needs to be set for any hostnames that the Matomo UI will be accessed from. It is not necessary to set this
; for other additional hostnames (For example tracking, API, etc.)
; Examples:
;trusted_hosts[] = example.com
;trusted_hosts[] = stats.example.com
Expand Down Expand Up @@ -922,6 +929,11 @@
; By default, Matomo will remove the most common parameters which are known to change often (eg. session ID parameters)
url_query_parameter_to_exclude_from_url = "gclid,fbclid,fb_xd_fragment,fb_comment_id,phpsessid,jsessionid,sessionid,aspsessionid,doing_wp_cron,sid,pk_vid"

; If set to 1, Matomo will use the default provider if no other provider is configured.
; In addition the default provider will be used as a fallback when the configure provider does not return any results.
; If set to 0, the default provider will be unavailable. Instead the "disabled" provider will be used as default and fallback instead.
enable_default_location_provider = 1

; if set to 1, Matomo attempts a "best guess" at the visitor's country of
; origin when the preferred language tag omits region information.
; The mapping is defined in core/DataFiles/LanguageToCountry.php,
Expand Down Expand Up @@ -1229,4 +1241,4 @@
SDK_batch_size = 10
SDK_interval_value = 30

; NOTE: do not directly edit this file! See notice at the top
; NOTE: do not directly edit this file! See notice at the top
51 changes: 30 additions & 21 deletions app/config/global.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Matomo\Cache\Eager;
use Piwik\SettingsServer;

return array(
return [

'path.root' => PIWIK_DOCUMENT_ROOT,

Expand Down Expand Up @@ -35,6 +35,8 @@

'view.clearcompiledtemplates.enable' => true,

'twig.cache' => DI\string('{path.tmp.templates}'),

'Matomo\Cache\Eager' => function (ContainerInterface $c) {
$backend = $c->get('Matomo\Cache\Backend');
$cacheId = $c->get('cache.eager.cache_id');
Expand All @@ -58,7 +60,7 @@
// If Piwik is not installed yet, it's possible the tmp/ folder is not writable
// we prevent failing with an unclear message eg. coming from doctrine-cache
// by forcing to use a cache backend which always works ie. array
if(!\Piwik\SettingsPiwik::isMatomoInstalled()) {
if (!\Piwik\SettingsPiwik::isMatomoInstalled()) {
$backend = 'array';
} else {
try {
Expand All @@ -71,10 +73,10 @@
return \Piwik\Cache::buildBackend($backend);
},
'cache.eager.cache_id' => function () {
return 'eagercache-' . str_replace(array('.', '-'), '', \Piwik\Version::VERSION) . '-';
return 'eagercache-' . str_replace(['.', '-'], '', \Piwik\Version::VERSION) . '-';
},

'entities.idNames' => DI\add(array('idGoal', 'idDimension')),
'entities.idNames' => DI\add(['idGoal', 'idDimension']),

'Psr\Log\LoggerInterface' => DI\create('Psr\Log\NullLogger'),

Expand All @@ -83,19 +85,20 @@

'DeviceDetector\Cache\Cache' => DI\autowire('Piwik\DeviceDetector\DeviceDetectorCache')->constructor(86400),

'observers.global' => array(),
'observers.global' => [],

/**
* By setting this option to false, the check that the DB schema version matches the version of the source code will be no longer performed.
* Thus it allows you to execute for example a newer version of Matomo with an older Matomo database version. Please note
* disabling this setting is not recommended because often an older DB version is not compatible with newer source code.
* If you disable this setting, make sure to execute the updates after updating the source code. The setting can be useful if
* you want to update Matomo without any outage when you know the current source code update will still run fine for a short time
* while in the background the database updates are running.
* By setting this option to false, the check that the DB schema version matches the version of the source code will
* be no longer performed. Thus it allows you to execute for example a newer version of Matomo with an older Matomo
* database version. Please note disabling this setting is not recommended because often an older DB version is not
* compatible with newer source code.
* If you disable this setting, make sure to execute the updates after updating the source code. The setting can be
* useful if you want to update Matomo without any outage when you know the current source code update will still
* run fine for a short time while in the background the database updates are running.
*/
'EnableDbVersionCheck' => true,

'fileintegrity.ignore' => DI\add(array(
'fileintegrity.ignore' => DI\add([
'*.htaccess',
'*web.config',
'bootstrap.php',
Expand Down Expand Up @@ -146,7 +149,7 @@
'*.gitattributes',
'*.bower.json',
'*.travis.yml',
)),
]),

'Piwik\EventDispatcher' => DI\autowire()->constructorParameter('observers', DI\get('observers.global')),

Expand All @@ -155,15 +158,15 @@
$config = $c->get('Piwik\Config');
$general = $config->General;

$ips = array();
$ips = [];
if (!empty($general['login_allowlist_ip']) && is_array($general['login_allowlist_ip'])) {
$ips = $general['login_allowlist_ip'];
} elseif (!empty($general['login_whitelist_ip']) && is_array($general['login_whitelist_ip'])) {
// for BC
$ips = $general['login_whitelist_ip'];
}

$ipsResolved = array();
$ipsResolved = [];

foreach ($ips as $ip) {
$ip = trim($ip);
Expand All @@ -186,8 +189,10 @@
if (function_exists('dns_get_record')) {
$entry = @dns_get_record($ip, DNS_AAAA);

if (!empty($entry['0']['ipv6'])
&& filter_var($entry['0']['ipv6'], FILTER_VALIDATE_IP)) {
if (
!empty($entry['0']['ipv6'])
&& filter_var($entry['0']['ipv6'], FILTER_VALIDATE_IP)
) {
$resolvedIps[] = $entry['0']['ipv6'];
}
}
Expand Down Expand Up @@ -216,15 +221,19 @@
->constructorParameter('lookbackNSecondsCustom', DI\get('ini.Tracker.window_look_back_for_visitor')),

'Piwik\Tracker\Settings' => DI\autowire()
->constructorParameter('isSameFingerprintsAcrossWebsites', DI\get('ini.Tracker.enable_fingerprinting_across_websites')),
->constructorParameter(
'isSameFingerprintsAcrossWebsites',
DI\get('ini.Tracker.enable_fingerprinting_across_websites')
),

'archiving.performance.logger' => null,

\Piwik\CronArchive\Performance\Logger::class => DI\autowire()->constructorParameter('logger', DI\get('archiving.performance.logger')),
\Piwik\CronArchive\Performance\Logger::class => DI\autowire()
->constructorParameter('logger', DI\get('archiving.performance.logger')),

\Piwik\Concurrency\LockBackend::class => \DI\get(\Piwik\Concurrency\LockBackend\MySqlLockBackend::class),

\Piwik\Segment\SegmentsList::class => function(){
\Piwik\Segment\SegmentsList::class => function () {
return \Piwik\Segment\SegmentsList::get();
}
);
];
2 changes: 1 addition & 1 deletion app/core/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ public function checkUserHasCapability($idSites, $capability)

foreach ($idSites as $idsite) {
if (!in_array($idsite, $idSitesAccessible)) {
$this->throwNoAccessException(Piwik::translate('ExceptionCapabilityAccessWebsite', array("'" . $capability ."'", $idsite)));
$this->throwNoAccessException(Piwik::translate('General_ExceptionCapabilityAccessWebsite', array("'" . $capability ."'", $idsite)));
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/core/Access/RolesProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function checkValidRole(string $roleId): void
{
if (!$this->isValidRole($roleId)) {
$roles = $this->getAllRoleIds();
throw new Exception(Piwik::translate("UsersManager_ExceptionAccessValues", implode(", ", $roles)));
throw new Exception(Piwik::translate("UsersManager_ExceptionAccessValues", [implode(", ", $roles), $roleId]));
}
}

Expand Down
Loading

0 comments on commit a74ab57

Please sign in to comment.