Skip to content

Commit dc7e1a2

Browse files
authored
Merge pull request #28 from DevDavido/development
Bump to v1.1.3
2 parents fa02858 + 890c9da commit dc7e1a2

15 files changed

+92
-41
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
- Added: Support for Matomo 4 🎉
44
- Updated: Bumped the minimum PHP version to 7.2.5 for this new major plugin version, just as Matomo 4 itself
55

6+
## 1.1.3
7+
- Added: Possibility to set extended audit timeout for each site
8+
- Improved: Minor internal refactoring for site settings
9+
- Updated: Bumped `symfony/process` dependency version
10+
611
## 1.1.2
712
- Added: Possibility to enable or disable audit for each site
813
- Improved: Set timeout for installation process to 5 minutes

MeasurableSettings.php

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class MeasurableSettings extends BaseMeasurableSettings
2323
/** @var Setting */
2424
public $isEnabled;
2525

26+
/** @var Setting */
27+
public $hasExtendedTimeout;
28+
2629
/** @var Setting */
2730
public $runCount;
2831

@@ -52,6 +55,7 @@ protected function init()
5255
Piwik::checkUserHasSomeViewAccess();
5356

5457
$this->isEnabled = $this->makeIsEnabledSetting();
58+
$this->hasExtendedTimeout = $this->makeHasExtendedTimeoutSetting();
5559
$this->runCount = $this->makeRunCountSetting();
5660
$this->emulatedDevice = $this->makeEmulatedDeviceSetting();
5761
$this->hasGroupedUrls = $this->makeHasGroupedUrlsSetting();
@@ -75,6 +79,21 @@ private function makeIsEnabledSetting()
7579
});
7680
}
7781

82+
/**
83+
* Create has extended timeout setting.
84+
*
85+
* @return MeasurableSetting
86+
* @throws ValidatorException|Exception
87+
*/
88+
private function makeHasExtendedTimeoutSetting()
89+
{
90+
return $this->makeSetting('has_extended_timeout', false, FieldConfig::TYPE_BOOL, function (FieldConfig $field) {
91+
$field->title = Piwik::translate('PerformanceAudit_Settings_HasExtendedTimeout_Title');
92+
$field->inlineHelp = Piwik::translate('PerformanceAudit_Settings_HasExtendedTimeout_Help');
93+
$field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX;
94+
});
95+
}
96+
7897
/**
7998
* Create run count setting.
8099
*
@@ -180,7 +199,7 @@ private function makeExtraHttpHeaderKeySetting()
180199
'Cookie' => Piwik::translate('PerformanceAudit_Settings_ExtraHttpHeaderKey_Cookie'),
181200
];
182201
$field->validate = function ($value) use ($self, $field) {
183-
if ($self->getSetting('has_extra_http_header')->getValue()) {
202+
if ($self->hasExtraHttpHeader()) {
184203
if (empty($value)) {
185204
throw new ValidatorException(Piwik::translate('General_ValidatorErrorEmptyValue'));
186205
}
@@ -208,7 +227,7 @@ private function makeExtraHttpHeaderValueSetting()
208227
$field->condition = 'is_enabled && has_extra_http_header';
209228
$field->uiControl = FieldConfig::UI_CONTROL_TEXT;
210229
$field->validate = function ($value) use ($self, $field) {
211-
if ($self->getSetting('has_extra_http_header')->getValue()) {
230+
if ($self->hasExtraHttpHeader()) {
212231
if (empty($value)) {
213232
throw new ValidatorException(Piwik::translate('General_ValidatorErrorEmptyValue'));
214233
}
@@ -250,6 +269,16 @@ public function isAuditEnabled()
250269
return $this->getSetting('is_enabled')->getValue();
251270
}
252271

272+
/**
273+
* Returns if site has extended timeout for site audit.
274+
*
275+
* @return bool
276+
*/
277+
public function hasExtendedTimeout()
278+
{
279+
return $this->getSetting('has_extended_timeout')->getValue();
280+
}
281+
253282
/**
254283
* Returns if site has grouped URLs for site.
255284
*
@@ -259,4 +288,14 @@ public function hasGroupedUrls()
259288
{
260289
return $this->getSetting('has_grouped_urls')->getValue();
261290
}
291+
292+
/**
293+
* Returns if site has extra HTTP header for site.
294+
*
295+
* @return bool
296+
*/
297+
public function hasExtraHttpHeader()
298+
{
299+
return $this->getSetting('has_extra_http_header')->getValue();
300+
}
262301
}

Tasks.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,10 @@ private static function getLighthouse(int $idSite)
276276
Audit::enableEachLighthouseAudit(self::$lighthouse[$idSite]);
277277

278278
$siteSettings = new MeasurableSettings($idSite);
279-
if ($siteSettings->getSetting('has_extra_http_header')->getValue()) {
279+
if ($siteSettings->hasExtendedTimeout()) {
280+
self::$lighthouse[$idSite]->setTimeout(300);
281+
}
282+
if ($siteSettings->hasExtraHttpHeader()) {
280283
self::$lighthouse[$idSite]->setHeaders([
281284
$siteSettings->getSetting('extra_http_header_key')->getValue() => $siteSettings->getSetting('extra_http_header_value')->getValue()
282285
]);

lang/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
"Metrics_Tooltip_OutOfRange": "%s%s is out of range of all classification groups.",
6666
"Settings_IsEnabled_Title": "Perform performance audit for this site",
6767
"Settings_IsEnabled_Help": "You can decide on a per-website basis if website performance audits are performed after all.",
68+
"Settings_HasExtendedTimeout_Title": "Increase timeout for performance audits",
69+
"Settings_HasExtendedTimeout_Help": "You can decide on a per-website basis if website performance audit timeouts should be extended to 5 minutes instead of the default 1 minute. Extending the timeout is only recommended if you encounter regular timeouts, e.g. if your server is not fast enough to perform the audits within 1 minute.",
6870
"Settings_RunCount_Title": "Number of performance audit iterations",
6971
"Settings_RunCount_Help": "Set how many times the audit should be performed on each page for stable results. Any number between 1 and 5 is possible. 5 iterations are twice as stable, but prolongs the processing time the most. Just use such high values like 5 iterations only if enough server resources are generally available. 3 iterations are usually the best balance between reproducibility and resource consumption.",
7072
"Settings_EmulatedDevice_Title": "Performance simulation environment",

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "PerformanceAudit",
33
"description": "Daily performance audits of all your sites in Matomo.",
4-
"version": "1.1.2",
4+
"version": "1.1.3",
55
"theme": false,
66
"require": {
77
"php": ">=7.1.3",

vendor/composer/InstalledVersions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class InstalledVersions
1919
'aliases' =>
2020
array (
2121
),
22-
'reference' => '674a5e8d09a059e62bda1ab8ad1cdadb3b2603a0',
22+
'reference' => 'fa02858d47f977e486689baf845e3df5367ed647',
2323
'name' => 'devdavido/performance-audit-plugin',
2424
),
2525
'versions' =>
@@ -31,7 +31,7 @@ class InstalledVersions
3131
'aliases' =>
3232
array (
3333
),
34-
'reference' => '674a5e8d09a059e62bda1ab8ad1cdadb3b2603a0',
34+
'reference' => 'fa02858d47f977e486689baf845e3df5367ed647',
3535
),
3636
'ducks-project/spl-types' =>
3737
array (
@@ -62,12 +62,12 @@ class InstalledVersions
6262
),
6363
'symfony/process' =>
6464
array (
65-
'pretty_version' => 'v4.4.13',
66-
'version' => '4.4.13.0',
65+
'pretty_version' => 'v4.4.15',
66+
'version' => '4.4.15.0',
6767
'aliases' =>
6868
array (
6969
),
70-
'reference' => '65e70bab62f3da7089a8d4591fb23fbacacb3479',
70+
'reference' => '9b887acc522935f77555ae8813495958c7771ba7',
7171
),
7272
),
7373
);

vendor/composer/autoload_classmap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
'Piwik\\Plugins\\PerformanceAudit\\Columns\\Metrics\\MinPercent' => $baseDir . '/Columns/Metrics/MinPercent.php',
3636
'Piwik\\Plugins\\PerformanceAudit\\Columns\\Metrics\\MinSeconds' => $baseDir . '/Columns/Metrics/MinSeconds.php',
3737
'Piwik\\Plugins\\PerformanceAudit\\Columns\\PageUrl' => $baseDir . '/Columns/PageUrl.php',
38+
'Piwik\\Plugins\\PerformanceAudit\\Commands\\ClearTaskRunningFlag' => $baseDir . '/Commands/ClearTaskRunningFlag.php',
3839
'Piwik\\Plugins\\PerformanceAudit\\Controller' => $baseDir . '/Controller.php',
3940
'Piwik\\Plugins\\PerformanceAudit\\EmulatedDevice' => $baseDir . '/EmulatedDevice.php',
4041
'Piwik\\Plugins\\PerformanceAudit\\Exceptions\\AuditFailedAuthoriseRefusedException' => $baseDir . '/Exceptions/AuditFailedAuthoriseRefusedException.php',

vendor/composer/autoload_static.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class ComposerStaticInit98dde460e8a16c8877d8f8d8a8e6921c
7373
'Piwik\\Plugins\\PerformanceAudit\\Columns\\Metrics\\MinPercent' => __DIR__ . '/../..' . '/Columns/Metrics/MinPercent.php',
7474
'Piwik\\Plugins\\PerformanceAudit\\Columns\\Metrics\\MinSeconds' => __DIR__ . '/../..' . '/Columns/Metrics/MinSeconds.php',
7575
'Piwik\\Plugins\\PerformanceAudit\\Columns\\PageUrl' => __DIR__ . '/../..' . '/Columns/PageUrl.php',
76+
'Piwik\\Plugins\\PerformanceAudit\\Commands\\ClearTaskRunningFlag' => __DIR__ . '/../..' . '/Commands/ClearTaskRunningFlag.php',
7677
'Piwik\\Plugins\\PerformanceAudit\\Controller' => __DIR__ . '/../..' . '/Controller.php',
7778
'Piwik\\Plugins\\PerformanceAudit\\EmulatedDevice' => __DIR__ . '/../..' . '/EmulatedDevice.php',
7879
'Piwik\\Plugins\\PerformanceAudit\\Exceptions\\AuditFailedAuthoriseRefusedException' => __DIR__ . '/../..' . '/Exceptions/AuditFailedAuthoriseRefusedException.php',

vendor/composer/installed.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,23 +195,23 @@
195195
},
196196
{
197197
"name": "symfony/process",
198-
"version": "v4.4.13",
199-
"version_normalized": "4.4.13.0",
198+
"version": "v4.4.15",
199+
"version_normalized": "4.4.15.0",
200200
"source": {
201201
"type": "git",
202202
"url": "https://github.com/symfony/process.git",
203-
"reference": "65e70bab62f3da7089a8d4591fb23fbacacb3479"
203+
"reference": "9b887acc522935f77555ae8813495958c7771ba7"
204204
},
205205
"dist": {
206206
"type": "zip",
207-
"url": "https://api.github.com/repos/symfony/process/zipball/65e70bab62f3da7089a8d4591fb23fbacacb3479",
208-
"reference": "65e70bab62f3da7089a8d4591fb23fbacacb3479",
207+
"url": "https://api.github.com/repos/symfony/process/zipball/9b887acc522935f77555ae8813495958c7771ba7",
208+
"reference": "9b887acc522935f77555ae8813495958c7771ba7",
209209
"shasum": ""
210210
},
211211
"require": {
212212
"php": ">=7.1.3"
213213
},
214-
"time": "2020-07-23T08:31:43+00:00",
214+
"time": "2020-09-02T16:08:58+00:00",
215215
"type": "library",
216216
"extra": {
217217
"branch-alias": {
@@ -244,7 +244,7 @@
244244
"description": "Symfony Process Component",
245245
"homepage": "https://symfony.com",
246246
"support": {
247-
"source": "https://github.com/symfony/process/tree/v4.4.12"
247+
"source": "https://github.com/symfony/process/tree/4.4"
248248
},
249249
"funding": [
250250
{

vendor/composer/installed.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'aliases' =>
77
array (
88
),
9-
'reference' => '674a5e8d09a059e62bda1ab8ad1cdadb3b2603a0',
9+
'reference' => 'fa02858d47f977e486689baf845e3df5367ed647',
1010
'name' => 'devdavido/performance-audit-plugin',
1111
),
1212
'versions' =>
@@ -18,7 +18,7 @@
1818
'aliases' =>
1919
array (
2020
),
21-
'reference' => '674a5e8d09a059e62bda1ab8ad1cdadb3b2603a0',
21+
'reference' => 'fa02858d47f977e486689baf845e3df5367ed647',
2222
),
2323
'ducks-project/spl-types' =>
2424
array (
@@ -49,12 +49,12 @@
4949
),
5050
'symfony/process' =>
5151
array (
52-
'pretty_version' => 'v4.4.13',
53-
'version' => '4.4.13.0',
52+
'pretty_version' => 'v4.4.15',
53+
'version' => '4.4.15.0',
5454
'aliases' =>
5555
array (
5656
),
57-
'reference' => '65e70bab62f3da7089a8d4591fb23fbacacb3479',
57+
'reference' => '9b887acc522935f77555ae8813495958c7771ba7',
5858
),
5959
),
6060
);

0 commit comments

Comments
 (0)