Ejemplo n.º 1
0
 public static function updateStatistics($eventCategory, $eventAction, $timeBand)
 {
     $globalSettings = get_option("wpXSG_global", new globalSettings());
     if ($globalSettings->sendStats) {
         global $wp_version;
         $postCountLabel = dataAccess::getPostCountBand();
         $postData = array('v' => 1, 'tid' => 'UA-679276-7', 'cid' => get_option('wpXSG_MapId'), 't' => 'event', 'ec' => $eventCategory, 'ea' => $eventAction, 'ev' => 1, 'cd1' => get_bloginfo('url'), 'cd2' => $wp_version, 'cd3' => self::pluginVersion(), 'cd4' => PHP_VERSION, 'cd5' => $postCountLabel, 'cd6' => $timeBand);
         $url = 'https://ssl.google-analytics.com/collect';
         try {
             $response = wp_remote_post($url, array('method' => 'POST', 'body' => $postData));
         } catch (Exception $e) {
             statusUpdate("sendStats : " . $e->getMessage());
         }
     }
 }