Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2020-12-10 05:22:03 +0300
committerGitHub <noreply@github.com>2020-12-10 05:22:03 +0300
commit61ce1800657a50b966ec2a284147bc4a023a477a (patch)
treefaeee78b68b2df195e859b8d95292e7262184838 /plugins/SEO
parentd71e44c7195373a3a3f4d215a2b8b78dc82a02e6 (diff)
Avoid warning while loading seo metrics (#16808)
Diffstat (limited to 'plugins/SEO')
-rw-r--r--plugins/SEO/Metric/Alexa.php4
-rw-r--r--plugins/SEO/Metric/Bing.php5
-rw-r--r--plugins/SEO/Metric/DomainAge.php2
-rw-r--r--plugins/SEO/Metric/Google.php5
4 files changed, 10 insertions, 6 deletions
diff --git a/plugins/SEO/Metric/Alexa.php b/plugins/SEO/Metric/Alexa.php
index 8dc3e439d2..e4fded5688 100644
--- a/plugins/SEO/Metric/Alexa.php
+++ b/plugins/SEO/Metric/Alexa.php
@@ -10,6 +10,7 @@ namespace Piwik\Plugins\SEO\Metric;
use Piwik\Http;
use Piwik\NumberFormatter;
+use Piwik\Piwik;
use Psr\Log\LoggerInterface;
/**
@@ -43,7 +44,8 @@ class Alexa implements MetricsProvider
$value = NumberFormatter::getInstance()->formatNumber($globalRanking);
}
} catch (\Exception $e) {
- $this->logger->warning('Error while getting Alexa SEO stats via fallback method: {message}', array('message' => $e->getMessage()));
+ $this->logger->info('Error while getting Alexa SEO stats: {message}', array('message' => $e->getMessage()));
+ $value = Piwik::translate('General_Error');
}
$logo = "plugins/Morpheus/icons/dist/SEO/alexa.com.png";
diff --git a/plugins/SEO/Metric/Bing.php b/plugins/SEO/Metric/Bing.php
index df86cccf1c..ab7b1bce88 100644
--- a/plugins/SEO/Metric/Bing.php
+++ b/plugins/SEO/Metric/Bing.php
@@ -10,6 +10,7 @@ namespace Piwik\Plugins\SEO\Metric;
use Piwik\Http;
use Piwik\NumberFormatter;
+use Piwik\Piwik;
use Psr\Log\LoggerInterface;
/**
@@ -43,8 +44,8 @@ class Bing implements MetricsProvider
$pageCount = 0;
}
} catch (\Exception $e) {
- $this->logger->warning('Error while getting Bing SEO stats: {message}', array('message' => $e->getMessage()));
- $pageCount = null;
+ $this->logger->info('Error while getting Bing SEO stats: {message}', array('message' => $e->getMessage()));
+ $pageCount = Piwik::translate('General_Error');
}
$logo = "plugins/Morpheus/icons/dist/SEO/bing.com.png";
diff --git a/plugins/SEO/Metric/DomainAge.php b/plugins/SEO/Metric/DomainAge.php
index c94858a5ba..8d5d4bc4b8 100644
--- a/plugins/SEO/Metric/DomainAge.php
+++ b/plugins/SEO/Metric/DomainAge.php
@@ -127,7 +127,7 @@ class DomainAge implements MetricsProvider
try {
return $this->getHttpResponse($url);
} catch (\Exception $e) {
- $this->logger->warning('Error while getting SEO stats (domain age): {message}', array('message' => $e->getMessage()));
+ $this->logger->info('Error while getting SEO stats (domain age): {message}', array('message' => $e->getMessage()));
return '';
}
}
diff --git a/plugins/SEO/Metric/Google.php b/plugins/SEO/Metric/Google.php
index f096ebbcab..2edf5afc23 100644
--- a/plugins/SEO/Metric/Google.php
+++ b/plugins/SEO/Metric/Google.php
@@ -10,6 +10,7 @@ namespace Piwik\Plugins\SEO\Metric;
use Piwik\Http;
use Piwik\NumberFormatter;
+use Piwik\Piwik;
use Psr\Log\LoggerInterface;
/**
@@ -56,8 +57,8 @@ class Google implements MetricsProvider
return 0;
}
} catch (\Exception $e) {
- $this->logger->warning('Error while getting Google search SEO stats: {message}', array('message' => $e->getMessage()));
- return null;
+ $this->logger->info('Error while getting Google search SEO stats: {message}', array('message' => $e->getMessage()));
+ return Piwik::translate('General_Error');
}
}