diff --git a/core/Common.php b/core/Common.php
index 26dec8e25e097e28dd127aef838fd4ee5a52706d..3312a83569df09185c39f2a4fd386a49c73fc58d 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -749,6 +749,21 @@ class Common
         return $searchEngines;
     }
 
+    /**
+     * Returns list of social networks by URL
+     *
+     * @see core/DataFiles/Socials.php
+     *
+     * @return array  Array of ( URL => Social Network Name )
+     */
+    public static function getSocialUrls()
+    {
+        require_once PIWIK_INCLUDE_PATH . '/core/DataFiles/Socials.php';
+
+        $searchEngines = $GLOBALS['Piwik_socialUrl'];
+        return $searchEngines;
+    }
+
     /**
      * Returns list of provider names
      *
diff --git a/plugins/Referrers/API.php b/plugins/Referrers/API.php
index 11975517eaf7836b8d912fed9182d7ea4bae2374..fe8248fc89b54297ff2976a0cff2a59b3cecc2bb 100644
--- a/plugins/Referrers/API.php
+++ b/plugins/Referrers/API.php
@@ -316,8 +316,6 @@ class API extends \Piwik\Plugin\API
      */
     public function getSocials($idSite, $period, $date, $segment = false, $expanded = false)
     {
-        require PIWIK_INCLUDE_PATH . '/core/DataFiles/Socials.php';
-
         $dataTable = $this->getDataTable(Archiver::WEBSITES_RECORD_NAME, $idSite, $period, $date, $segment, $expanded);
 
         $dataTable->filter('ColumnCallbackDeleteRow', array('label', function ($url) { return !isSocialUrl($url); }));
@@ -349,21 +347,21 @@ class API extends \Piwik\Plugin\API
      */
     public function getUrlsForSocial($idSite, $period, $date, $segment = false, $idSubtable = false)
     {
-        require PIWIK_INCLUDE_PATH . '/core/DataFiles/Socials.php';
-
         $dataTable = $this->getDataTable(Archiver::WEBSITES_RECORD_NAME, $idSite, $period, $date, $segment, $expanded = true);
 
         // get the social network domain referred to by $idSubtable
+        $socialNetworks = Common::getSocialUrls();
+
         $social = false;
         if ($idSubtable !== false) {
             --$idSubtable;
 
-            reset($GLOBALS['Piwik_socialUrl']);
+            reset($socialNetworks);
             for ($i = 0; $i != (int)$idSubtable; ++$i) {
-                next($GLOBALS['Piwik_socialUrl']);
+                next($socialNetworks);
             }
 
-            $social = current($GLOBALS['Piwik_socialUrl']);
+            $social = current($socialNetworks);
         }
 
         // filter out everything but social network indicated by $idSubtable
@@ -457,7 +455,7 @@ class API extends \Piwik\Plugin\API
                 $socialName = $row->getColumn('label');
 
                 $i = 1; // start at one because idSubtable=0 is equivalent to idSubtable=false
-                foreach ($GLOBALS['Piwik_socialUrl'] as $domain => $name) {
+                foreach (Common::getSocialUrls() as $domain => $name) {
                     if ($name == $socialName) {
                         $row->c[Row::DATATABLE_ASSOCIATED] = $i;
                         break;
diff --git a/plugins/Referrers/functions.php b/plugins/Referrers/functions.php
index 96c231b8b3379977b9ea907e4cbe2874d78869e6..12a175fbbd0bd05d253e715063f3d04896276d51 100644
--- a/plugins/Referrers/functions.php
+++ b/plugins/Referrers/functions.php
@@ -37,7 +37,7 @@ function getPathFromUrl($url)
  */
 function getSocialNetworkFromDomain($url)
 {
-    foreach ($GLOBALS['Piwik_socialUrl'] AS $domain => $name) {
+    foreach (Common::getSocialUrls() AS $domain => $name) {
 
         if(preg_match('/(^|[\.\/])'.$domain.'([\.\/]|$)/', $url)) {
 
@@ -58,7 +58,7 @@ function getSocialNetworkFromDomain($url)
  */
 function isSocialUrl($url, $socialName = false)
 {
-    foreach ($GLOBALS['Piwik_socialUrl'] AS $domain => $name) {
+    foreach (Common::getSocialUrls() AS $domain => $name) {
 
         if (preg_match('/(^|[\.\/])'.$domain.'([\.\/]|$)/', $url) && ($socialName === false || $name == $socialName)) {
 
@@ -79,11 +79,12 @@ function isSocialUrl($url, $socialName = false)
 function getSocialsLogoFromUrl($domain)
 {
     $social = getSocialNetworkFromDomain($domain);
+    $socialNetworks = Common::getSocialUrls();
 
     $filePattern = 'plugins/Referrers/images/socials/%s.png';
 
-    foreach ($GLOBALS['Piwik_socialUrl'] as $domainKey => $name) {
-        if ($social == $GLOBALS['Piwik_socialUrl'][$domainKey] && file_exists(PIWIK_DOCUMENT_ROOT . '/' . sprintf($filePattern, $domainKey))) {
+    foreach ($socialNetworks as $domainKey => $name) {
+        if ($social == $socialNetworks[$domainKey] && file_exists(PIWIK_DOCUMENT_ROOT . '/' . sprintf($filePattern, $domainKey))) {
             return sprintf($filePattern, $domainKey);
         }
     }