From 6f5eabe302883122d47e4fc766b78afa42af8964 Mon Sep 17 00:00:00 2001 From: pebosi Date: Sun, 9 Apr 2017 18:50:26 +0200 Subject: Remove dmoz entries, as dmoz is offline (#11597) * Delete Dmoz.php * Remove dmoz entries, as dmoz is offline * Remove dmoz entries, as dmoz is offline * Remove dmoz entries, as dmoz is offline --- plugins/SEO/API.php | 2 +- plugins/SEO/Metric/Aggregator.php | 1 - plugins/SEO/Metric/Dmoz.php | 62 --------------------------------------- plugins/SEO/lang/en.json | 3 +- 4 files changed, 2 insertions(+), 66 deletions(-) delete mode 100644 plugins/SEO/Metric/Dmoz.php (limited to 'plugins/SEO') diff --git a/plugins/SEO/API.php b/plugins/SEO/API.php index fdadbf518f..879df5940e 100644 --- a/plugins/SEO/API.php +++ b/plugins/SEO/API.php @@ -23,7 +23,7 @@ require_once PIWIK_INCLUDE_PATH . '/plugins/Referrers/functions.php'; /** * The SEO API lets you access a list of SEO metrics for the specified URL: Google PageRank, Google/Bing indexed pages - * Alexa Rank, age of the Domain name and count of DMOZ entries. + * Alexa Ranka and age of the Domain name. * * @method static API getInstance() */ diff --git a/plugins/SEO/Metric/Aggregator.php b/plugins/SEO/Metric/Aggregator.php index ef3c93e606..6b81744087 100644 --- a/plugins/SEO/Metric/Aggregator.php +++ b/plugins/SEO/Metric/Aggregator.php @@ -50,7 +50,6 @@ class Aggregator implements MetricsProvider $container->get('Piwik\Plugins\SEO\Metric\Bing'), $container->get('Piwik\Plugins\SEO\Metric\Alexa'), $container->get('Piwik\Plugins\SEO\Metric\DomainAge'), - $container->get('Piwik\Plugins\SEO\Metric\Dmoz'), ); /** diff --git a/plugins/SEO/Metric/Dmoz.php b/plugins/SEO/Metric/Dmoz.php deleted file mode 100644 index c14792aa31..0000000000 --- a/plugins/SEO/Metric/Dmoz.php +++ /dev/null @@ -1,62 +0,0 @@ -logger = $logger; - } - - public function getMetrics($domain) - { - try { - $response = Http::sendHttpRequest(self::URL . urlencode($domain), $timeout = 10, @$_SERVER['HTTP_USER_AGENT']); - - preg_match('#[0-9] - [0-9]+ of ([0-9]+)#', $response, $p); - if (!empty($p[1])) { - $value = NumberFormatter::getInstance()->formatNumber((int)$p[1]); - } else { - $value = 0; - } - - // Add DMOZ only if > 0 entries found - if ($value == 0) { - return array(); - } - } catch (\Exception $e) { - $this->logger->warning('Error while getting Dmoz SEO stats: {message}', array('message' => $e->getMessage())); - $value = null; - } - - $logo = "plugins/Morpheus/icons/dist/SEO/dmoz.org.png"; - - return array( - new Metric('dmoz', 'SEO_Dmoz', $value, $logo) - ); - } -} diff --git a/plugins/SEO/lang/en.json b/plugins/SEO/lang/en.json index 7007ad48f2..589d445fd2 100644 --- a/plugins/SEO/lang/en.json +++ b/plugins/SEO/lang/en.json @@ -3,11 +3,10 @@ "PluginDescription": "This Plugin extracts and displays SEO metrics: Alexa web ranking, Google Pagerank, number of Indexed pages and backlinks of the currently selected website.", "AlexaRank": "Alexa Rank", "Bing_IndexedPages": "Bing indexed pages", - "Dmoz": "DMOZ entries", "DomainAge": "Domain Age", "Google_IndexedPages": "Google indexed pages", "Rank": "Rank", "SeoRankings": "SEO Rankings", "SEORankingsFor": "SEO Rankings for %s" } -} \ No newline at end of file +} -- cgit v1.2.3