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:
authormattab <matthieu.aubry@gmail.com>2013-07-01 02:50:09 +0400
committermattab <matthieu.aubry@gmail.com>2013-07-01 02:50:09 +0400
commit63559223af3836e047aa5834c5ba130860af88d2 (patch)
treed53d47208237fb2bd3441f9ec0d76e442fd89163 /plugins/SEO
parent05697a618ee6079e71868623c59882893a5cbc17 (diff)
* Fix the SEO widget
Refs #4019
Diffstat (limited to 'plugins/SEO')
-rw-r--r--plugins/SEO/RankChecker.php18
-rw-r--r--plugins/SEO/templates/getRank.twig12
2 files changed, 20 insertions, 10 deletions
diff --git a/plugins/SEO/RankChecker.php b/plugins/SEO/RankChecker.php
index 57512c4e8f..33c1956759 100644
--- a/plugins/SEO/RankChecker.php
+++ b/plugins/SEO/RankChecker.php
@@ -179,8 +179,13 @@ class Piwik_SEO_RankChecker
*/
public function getExternalBacklinkCount()
{
- $majesticInfo = $this->getMajesticInfo();
- return $majesticInfo['backlink_count'];
+ try {
+ $majesticInfo = $this->getMajesticInfo();
+ return $majesticInfo['backlink_count'];
+ } catch(Exception $e) {
+ Piwik::log($e->getMessage());
+ return 0;
+ }
}
/**
@@ -190,8 +195,13 @@ class Piwik_SEO_RankChecker
*/
public function getReferrerDomainCount()
{
- $majesticInfo = $this->getMajesticInfo();
- return $majesticInfo['referrer_domains_count'];
+ try {
+ $majesticInfo = $this->getMajesticInfo();
+ return $majesticInfo['referrer_domains_count'];
+ } catch(Exception $e) {
+ Piwik::log($e->getMessage());
+ return 0;
+ }
}
/**
diff --git a/plugins/SEO/templates/getRank.twig b/plugins/SEO/templates/getRank.twig
index 0a147b4f62..eb1adf1410 100644
--- a/plugins/SEO/templates/getRank.twig
+++ b/plugins/SEO/templates/getRank.twig
@@ -1,5 +1,5 @@
<div id='SeoRanks'>
- <script type="text/javascript" src="plugins/SEO/templates/rank.js"></script>
+ <script type="text/javascript" src="plugins/SEO/javascripts/rank.js"></script>
<form method="post" style="padding: 8px;">
<div align="left" class="mediumtext">
@@ -20,21 +20,21 @@
{% set cleanUrl %}
<a href='http://{{ urlToRank }}' target='_blank'>{{ urlToRank }}</a>
{% endset %}
- {{ 'SEO_SEORankingsFor'|translate(cleanUrl) }}
+ {{ 'SEO_SEORankingsFor'|translate(cleanUrl)|raw }}
<table cellspacing='2' style='margin:auto;line-height:1.5em;padding-top:10px'>
{% for rank in ranks %}
<tr>
{% set seoLink %}{% if rank.logo_link is not empty %}<a class="linkContent" href="?module=Proxy&action=redirect&url={{ rank.logo_link|url_encode }}" target="_blank"
{% if rank.logo_tooltip is not empty %}title="{{ rank.logo_tooltip }}"{% endif %}>{% endif %}{% endset %}
{% set majesticLink %}{{ seoLink }}Majestic</a>{% endset %}
- <td>{% if rank.logo_link is not empty %}{{ seoLink }}{% endif %}<img
+ <td>{% if rank.logo_link is not empty %}{{ seoLink|raw }}{% endif %}<img
style='vertical-align:middle;margin-right:6px;' src='{{ rank.logo }}' border='0'
- alt="{{ rank.label }}">{% if rank.logo_link is not empty %}</a>{% endif %} {{ rank.label|replace({"Majestic": majesticLink}) }}
+ alt="{{ rank.label }}">{% if rank.logo_link is not empty %}</a>{% endif %} {{ rank.label|replace({"Majestic": majesticLink})|raw }}
</td>
<td>
<div style='margin-left:15px'>
- {% if rank.logo_link is not empty }{{ seoLink }}{% endif %}
- {% if rank.rank %}{{ rank.rank }}{% else% }-{% endif %}
+ {% if rank.logo_link is not empty %}{{ seoLink|raw }}{% endif %}
+ {% if rank.rank %}{{ rank.rank }}{% else %}-{% endif %}
{% if rank.id=='pagerank' %} /10
{% elseif rank.id=='google-index' or rank.id=='bing-index' %} {{ 'SEO_Pages'|translate }}
{% endif %}