Loading class.ga-page-stats.php +4 −3 Original line number Diff line number Diff line Loading @@ -67,17 +67,18 @@ class GAPageStats { $reports = $ga->analytics->reports->batchGet($body); if (count($reports) == 0) return [0, 0]; return array('pageViews' => 0, 'users' => 0); $report = $reports[0]; $rows = $report->getData()->getRows(); if (count($rows) == 0) return [0, 0]; return array('pageViews' => 0, 'users' => 0); $row = $rows[0]; $metrics = $row->getMetrics(); $values = $metrics[0]->getValues(); return [ $values[0], $values[1] ]; return array('pageViews' => $values[0], 'users' => $values[1]); } } google-analytics-page-stats.php +4 −4 Original line number Diff line number Diff line Loading @@ -28,10 +28,10 @@ function ga_page_stats_content_filter($content) { !current_user_can('administrator')) return $content; $r = GAPageStats::getPageStats($_SERVER['REQUEST_URI']); $spv = number_format($r[0]); $su = number_format($r[1]); return $content . '<span style="font-size:small;"><em>Vistas: ' . $spv . '</em> | <em>Usuarios: ' . $su . '</em> | </span>'; $pv = number_format($r['pageViews']); $u = number_format($r['users']); return $content . '<span style="font-size:small;"><em>Vistas: ' . $pv . '</em> | <em>Usuarios: ' . $u . '</em> | </span>'; } register_activation_hook(__FILE__, 'ga_page_stats_activation'); Loading Loading
class.ga-page-stats.php +4 −3 Original line number Diff line number Diff line Loading @@ -67,17 +67,18 @@ class GAPageStats { $reports = $ga->analytics->reports->batchGet($body); if (count($reports) == 0) return [0, 0]; return array('pageViews' => 0, 'users' => 0); $report = $reports[0]; $rows = $report->getData()->getRows(); if (count($rows) == 0) return [0, 0]; return array('pageViews' => 0, 'users' => 0); $row = $rows[0]; $metrics = $row->getMetrics(); $values = $metrics[0]->getValues(); return [ $values[0], $values[1] ]; return array('pageViews' => $values[0], 'users' => $values[1]); } }
google-analytics-page-stats.php +4 −4 Original line number Diff line number Diff line Loading @@ -28,10 +28,10 @@ function ga_page_stats_content_filter($content) { !current_user_can('administrator')) return $content; $r = GAPageStats::getPageStats($_SERVER['REQUEST_URI']); $spv = number_format($r[0]); $su = number_format($r[1]); return $content . '<span style="font-size:small;"><em>Vistas: ' . $spv . '</em> | <em>Usuarios: ' . $su . '</em> | </span>'; $pv = number_format($r['pageViews']); $u = number_format($r['users']); return $content . '<span style="font-size:small;"><em>Vistas: ' . $pv . '</em> | <em>Usuarios: ' . $u . '</em> | </span>'; } register_activation_hook(__FILE__, 'ga_page_stats_activation'); Loading