mirror of
https://github.com/Findus23/matomo-DiagnosticsExtended.git
synced 2024-09-19 16:03:46 +02:00
commit
3fea6e4905
1 changed files with 6 additions and 6 deletions
|
@ -68,8 +68,8 @@ class MatomoJsCheck implements Diagnostic
|
||||||
if (
|
if (
|
||||||
$status != 200
|
$status != 200
|
||||||
|| strpos($data, "c80d50af7d3db9be66a4d0a86db0286e4fd33292") === false
|
|| strpos($data, "c80d50af7d3db9be66a4d0a86db0286e4fd33292") === false
|
||||||
|| empty($headers["content-type"])
|
|| empty($headers["Content-Type"])
|
||||||
|| empty($headers["content-encoding"])
|
|| empty($headers["Vary"])
|
||||||
) {
|
) {
|
||||||
$result = new DiagnosticResult($this->label);
|
$result = new DiagnosticResult($this->label);
|
||||||
$result->addItem(new DiagnosticResultItem(
|
$result->addItem(new DiagnosticResultItem(
|
||||||
|
@ -82,8 +82,8 @@ class MatomoJsCheck implements Diagnostic
|
||||||
return [$result];
|
return [$result];
|
||||||
}
|
}
|
||||||
$results = new DiagnosticResult($this->label);
|
$results = new DiagnosticResult($this->label);
|
||||||
$contentType = $headers["content-type"];
|
$contentType = $headers["Content-Type"];
|
||||||
if ($contentType !== "application/javascript") {
|
if (strpos($contentType, "application/javascript") !== 0) {
|
||||||
$results->addItem(new DiagnosticResultItem(
|
$results->addItem(new DiagnosticResultItem(
|
||||||
DiagnosticResult::STATUS_WARNING,
|
DiagnosticResult::STATUS_WARNING,
|
||||||
Piwik::translate("DiagnosticsExtended_MatomoJSCheckMIMEError",
|
Piwik::translate("DiagnosticsExtended_MatomoJSCheckMIMEError",
|
||||||
|
@ -91,8 +91,8 @@ class MatomoJsCheck implements Diagnostic
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
$contentEncoding = $headers["content-encoding"];
|
$vary = strtolower($headers["Vary"]);
|
||||||
if ($contentEncoding === "gzip" || $contentEncoding === "br") {
|
if (strpos($vary, 'accept-encoding') !== false) {
|
||||||
$results->addItem(new DiagnosticResultItem(
|
$results->addItem(new DiagnosticResultItem(
|
||||||
DiagnosticResult::STATUS_OK,
|
DiagnosticResult::STATUS_OK,
|
||||||
Piwik::translate("DiagnosticsExtended_MatomoJSCheckGzipped")
|
Piwik::translate("DiagnosticsExtended_MatomoJSCheckGzipped")
|
||||||
|
|
Loading…
Reference in a new issue