title = __( 'Overview', 'google-analytics-for-wordpress' ); parent::__construct(); } // Outputs the report. protected function get_report_html( $data = array() ) { ob_start(); $this->get_overview_top( $data ); if ( ! empty( $data['newvsreturn'] ) && ! empty( $data['devices'] ) ) { ?>
get_newvsreturn( $data ); ?>
get_devices( $data ); ?>
get_countries( $data ); ?>
get_referrals( $data ); ?>
get_toppages( $data ); $html = ob_get_clean(); return $html; } public function get_overview_report_js( $class = 'sessions', $data ) { $up = MONSTERINSIGHTS_PLUGIN_URL . 'assets/images/up.png'; $up2x = MONSTERINSIGHTS_PLUGIN_URL . 'assets/images/up@2x.png'; $down = MONSTERINSIGHTS_PLUGIN_URL . 'assets/images/down.png'; $down2x = MONSTERINSIGHTS_PLUGIN_URL . 'assets/images/down@2x.png'; $uplabel = esc_attr__( 'UP', 'google-analytics-for-wordpress' ); $downlabel = esc_attr__( 'DOWN', 'google-analytics-for-wordpress' ); $descriptor = 'sessions' === $class ? esc_js( __( 'Unique', 'google-analytics-for-wordpress' ) ) . '
' . esc_js( __( 'Sessions', 'google-analytics-for-wordpress' ) ) : esc_js( __( 'Unique', 'google-analytics-for-wordpress' ) ) . '
' . esc_js( __( 'Pageviews', 'google-analytics-for-wordpress' ) ); $descriptor = "'" . $descriptor . "'"; $labels = array(); foreach ( $data['timestamps'] as $timestamp ) { $labels[] = "'" . esc_js( date_i18n( 'j M', $timestamp ) ) . "'"; } $datapoints = array(); foreach ( $data[ $class ]['datapoints'] as $datapoint ) { $datapoints[] = esc_js( $datapoint ); } $trendpoints = array(); foreach ( $data[ $class ]['trendpoints'] as $trendpoint ) { $trendpoints[] = esc_js( $trendpoint ); } ob_start(); ?>
get_overviewgraph( $data ); $this->get_infobox( $data ); } public function get_overviewgraph( $data ) { if ( ! empty( $data['overviewgraph']['count'] ) && $data['overviewgraph']['count'] > 0 ) { ?>
get_overview_report_js( 'sessions', $data['overviewgraph'] ); ?>
get_overview_report_js( 'pageviews', $data['overviewgraph'] ); ?>
0 ) { ?>
<?php echo $uplabel; ?>
<?php echo $downlabel; ?>
0 ) { ?>
<?php echo $uplabel; ?>
<?php echo $downlabel; ?>
0 ) { ?>
<?php echo $uplabel; ?>
<?php echo $downlabel; ?>
0 ) { ?>
<?php echo $uplabel; ?>
<?php echo $downlabel; ?>
auth->get_referral_url() . $this->get_ga_report_range( $data ); ?>
">
auth->get_referral_url() . $this->get_ga_report_range( $data ); ?>
auth->get_referral_url() . $this->get_ga_report_range( $data ); ?>