File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/graph.tar
class-graph-age.php 0000644 00000004022 15154771440 0010221 0 ustar 00 <?php
/**
* Class that handles the output for the Age Breakdown graph.
*
* Class MonsterInsights_SiteInsights_Template_Graph_Age
*/
class MonsterInsights_SiteInsights_Template_Graph_Age extends MonsterInsights_SiteInsights_Metric_Template {
protected $metric = 'age';
protected $type = 'graph';
public function output(){
$json_data = $this->get_json_data();
if (empty($json_data)) {
return false;
}
return "<div class='monsterinsights-graph-item monsterinsights-graph-{$this->metric}'>
<script type='application/json'>{$json_data}</script>
</div>";
}
protected function get_options() {
if (empty($this->data['age'])) {
return false;
}
$primaryColor = $this->attributes['primaryColor'];
$secondaryColor = $this->attributes['secondaryColor'];
$textColor = $this->attributes['textColor'];
$data = $this->data['age'];
$title = __( 'Age Breakdown', 'google-analytics-for-wordpress' );
$series = array();
$percentages = array();
$labels = array();
foreach ($data as $key => $country) {
$series[$key] = (int) $country['sessions'];
$labels[$key] = $country['age'];
$percentages[$key] = $country['percent'];
}
$options = array(
'series' => array(
array(
'name' => $title,
'data' => $series,
)
),
'chart' => array(
'height' => 430,
'type' => 'bar',
'zoom' => array( 'enabled' => false ),
'toolbar' => array( 'show' => false )
),
'colors' => array( $primaryColor, $secondaryColor ),
'title' => array(
'text' => $title,
'align' => 'left',
'style' => array(
'color' => $textColor
)
),
'plotOptions' => array(
'bar' => array(
'borderRadius' => 5,
'borderRadiusApplication' => 'end',
'dataLabels' => array(
'position' => 'top'
)
)
),
'dataLabels' => array(
'enabled' => true,
'offsetY' => -20,
'style' => array(
'fontSize' => '12px',
'colors' => array( $primaryColor )
),
),
'xaxis' => array(
'categories' => $labels
)
);
return $options;
}
} class-graph-device.php 0000644 00000004414 15154771441 0010732 0 ustar 00 <?php
/**
* Class that handles the output for the Device graph.
*
* Class MonsterInsights_SiteInsights_Template_Graph_Device
*/
class MonsterInsights_SiteInsights_Template_Graph_Device extends MonsterInsights_SiteInsights_Metric_Template {
protected $metric = 'device';
protected $type = 'graph';
public function output(){
$json_data = $this->get_json_data();
if (empty($json_data)) {
return false;
}
return "<div class='monsterinsights-graph-item monsterinsights-donut-chart monsterinsights-graph-{$this->metric}'>
<script type='application/json'>{$json_data}</script>
</div>";
}
protected function get_options() {
if (empty($this->data['devices'])) {
return false;
}
$primaryColor = $this->attributes['primaryColor'];
$secondaryColor = $this->attributes['secondaryColor'];
$textColor = $this->attributes['textColor'];
$data = $this->data['devices'];
$labels = array();
$series = array_values($data);
foreach ($data as $key => $value){
$labels[] = ucfirst($key);
}
$title = __( 'Device Breakdown', 'google-analytics-for-wordpress' );
$options = array(
'series' => $series,
'chart' => array(
'width' => "100%",
'height' => 'auto',
'type' => 'donut',
),
'colors' => array( $primaryColor, $secondaryColor ),
'title' => array(
'text' => $title,
'align' => 'left',
'style' => array(
'color' => $this->get_color_value($textColor),
'fontSize' => '20px'
)
),
'plotOptions' => array(
'plotOptions' => array(
'pie' => array(
'donut' => array( 'size' => '75%' )
)
)
),
'legend' => array(
'position' => 'right',
'horizontalAlign' => 'center',
'floating' => false,
'fontSize' => '17px',
'height' => '100%',
'markers' => array(
'width' => 30,
'height' => 30,
'radius' => 30
),
'formatter' => array(
'args' => 'seriesName, opts',
'body' => 'return [seriesName, "<strong> " + opts.w.globals.series[opts.seriesIndex] + "%</strong>"]'
)
),
'dataLabels' => array(
'enabled' => false
),
'labels' => $labels,
'responsive' => array(
0 => array(
'breakpoint' => 767,
'options' => array(
'legend' => array(
'show' => false
)
)
)
)
);
return $options;
}
} class-graph-gender.php 0000644 00000004102 15154771442 0010732 0 ustar 00 <?php
/**
* Class that handles the output for the New vs Returning graph.
*
* Class MonsterInsights_SiteInsights_Template_Graph_Gender
*/
class MonsterInsights_SiteInsights_Template_Graph_Gender extends MonsterInsights_SiteInsights_Metric_Template {
protected $metric = 'gender';
protected $type = 'graph';
public function output(){
$json_data = $this->get_json_data();
if (empty($json_data)) {
return false;
}
return "<div class='monsterinsights-graph-item monsterinsights-donut-chart monsterinsights-graph-{$this->metric}'>
<script type='application/json'>{$json_data}</script>
</div>";
}
protected function get_options() {
if (empty($this->data['gender'])) {
return false;
}
$primaryColor = $this->attributes['primaryColor'];
$secondaryColor = $this->attributes['secondaryColor'];
$textColor = $this->attributes['textColor'];
$title = __( 'Gender Breakdown', 'google-analytics-for-wordpress' );
$data = $this->data['gender'];
$series = array_column($data, 'percent');
$labels = array_column($data, 'gender');
$options = array(
'series' => $series,
'chart' => array(
'height' => 'auto',
'type' => 'donut',
),
'colors' => array( '#ebebeb', $primaryColor, $secondaryColor ),
'title' => array(
'text' => $title,
'align' => 'left',
'style' => array(
'color' => $textColor,
'fontSize' => '20px'
)
),
'labels' => $labels,
'legend' => array(
'position' => 'right',
'horizontalAlign' => 'center',
'floating' => false,
'fontSize' => '17px',
'height' => '100%',
'markers' => array(
'width' => 30,
'height' => 30,
'radius' => 30,
),
'formatter' => array(
'args' => 'seriesName, opts',
'body' => 'return [seriesName, "<strong> " + opts.w.globals.series[opts.seriesIndex] + "%</strong>"];'
)
),
'dataLabels' => array(
'enabled' => false
),
'responsive' => array(
0 => array(
'breakpoint' => 767,
'options' => array(
'legend' => array(
'show' => false
)
)
)
)
);
return $options;
}
} class-graph-newvsreturning.php 0000644 00000004546 15154771442 0012602 0 ustar 00 <?php
/**
* Class that handles the output for the New vs Returning graph.
*
* Class MonsterInsights_SiteInsights_Template_Graph_Newvsreturning
*/
class MonsterInsights_SiteInsights_Template_Graph_Newvsreturning extends MonsterInsights_SiteInsights_Metric_Template {
protected $metric = 'newvsreturning';
protected $type = 'graph';
public function output(){
$json_data = $this->get_json_data();
if (empty($json_data)) {
return false;
}
return "<div class='monsterinsights-graph-item monsterinsights-donut-chart monsterinsights-graph-{$this->metric}'>
<script type='application/json'>{$json_data}</script>
</div>";
}
protected function get_options() {
if (empty($this->data['newvsreturn'])) {
return false;
}
$primaryColor = $this->attributes['primaryColor'];
$secondaryColor = $this->attributes['secondaryColor'];
$textColor = $this->attributes['textColor'];
$data = $this->data['newvsreturn'];
$title = __( 'New vs Returning', 'google-analytics-for-wordpress' );
$options = array(
'series' => array(
$data['new'],
$data['returning'],
),
'chart' => array(
'width' => "100%",
'height' => 'auto',
'type' => 'donut',
),
'colors' => array( $primaryColor, $secondaryColor ),
'title' => array(
'text' => $title,
'align' => 'left',
'style' => array(
'color' => $this->get_color_value($textColor),
'fontSize' => '20px'
)
),
'labels' => array(
__( 'New Visitors', 'google-analytics-for-wordpress' ),
__( 'Returning Visitors', 'google-analytics-for-wordpress' ),
),
'plotOptions' => array(
'plotOptions' => array(
'pie' => array(
'donut' => array( 'size' => '65%' )
)
)
),
'legend' => array(
'position' => 'right',
'horizontalAlign' => 'center',
'floating' => false,
'fontSize' => '17px',
'height' => '100%',
'markers' => array(
'width' => 30,
'height' => 30,
'radius' => 30,
),
'formatter' => array(
'args' => 'seriesName, opts',
'body' => 'return [seriesName, "<strong> " + opts.w.globals.series[opts.seriesIndex] + "%</strong>"];'
)
),
'dataLabels' => array(
'enabled' => false
),
'responsive' => array(
array(
'breakpoint' => 767,
'options' => array(
'legend' => array(
'show' => false
)
)
)
)
);
return $options;
}
} class-graph-pageviews.php 0000644 00000004367 15154771442 0011475 0 ustar 00 <?php
/**
* Class that handles the output for the pageviews graph.
*
* Class MonsterInsights_SiteInsights_Template_Graph_Pageviews
*/
class MonsterInsights_SiteInsights_Template_Graph_Pageviews extends MonsterInsights_SiteInsights_Metric_Template {
protected $metric = 'pageviews';
protected $type = 'graph';
public function output(){
$json_data = $this->get_json_data();
if (empty($json_data)) {
return false;
}
return "<div class='monsterinsights-graph-item monsterinsights-graph-{$this->metric}'>
<script type='application/json'>{$json_data}</script>
</div>";
}
protected function get_options() {
if (empty($this->data['overviewgraph'])) {
return false;
}
$primaryColor = $this->attributes['primaryColor'];
$textColor = $this->attributes['textColor'];
$secondaryColor = $this->attributes['secondaryColor'];
$data = $this->data['overviewgraph'];
$title = __( 'Page views', 'google-analytics-for-wordpress' );
$options = array(
'series' => array(
array(
'name' => $title,
'data' => $data['pageviews']['datapoints']
)
),
'chart' => array(
'height' => 450,
'type' => 'area',
'zoom' => array( 'enabled' => false ),
'toolbar' => array( 'show' => false )
),
'dataLabels' => array( 'enabled' => false ),
'stroke' => array(
'curve' => 'straight',
'width' => 4,
'colors' => array( $primaryColor )
),
'fill' => array( 'type' => 'solid' ),
'colors' => array( $secondaryColor ),
'markers' => array(
'style' => 'hollow',
'size' => 5,
'colors' => array( '#ffffff' ),
'strokeColors' => $primaryColor
),
'title' => array(
'text' => $title,
'align' => 'left',
'style' => array(
'color' => $textColor,
'fontSize' => '17px',
'fontWeight' => 'bold',
)
),
'grid' => array(
'show' => true,
'borderColor' => 'rgba(58, 147, 221, 0.15)',
'xaxis' => array(
'lines' => array( 'show' => true )
),
'yaxis' => array(
'lines' => array( 'show' => true )
),
'padding' => array(
'top' => 10,
'right' => 10,
'bottom' => 10,
'left' => 10,
)
),
'xaxis' => array( 'categories' => $data['labels'] ),
'yaxis' => array( 'type' => 'numeric' ),
);
return $options;
}
} class-graph-scrolldepth.php 0000644 00000002443 15154771442 0012017 0 ustar 00 <?php
/**
* Class that handles the output for the Scroll Depth graph.
*
* Class MonsterInsights_SiteInsights_Template_Graph_Scrolldepth
*/
class MonsterInsights_SiteInsights_Template_Graph_Scrolldepth extends MonsterInsights_SiteInsights_Metric_Template {
protected $metric = 'scrolldepth';
protected $type = 'graph';
public function output(){
$json_data = $this->get_json_data();
if (empty($json_data)) {
return false;
}
return "<div class='monsterinsights-graph-item monsterinsights-graph-{$this->metric}'>
<script type='application/json'>{$json_data}</script>
</div>";
}
protected function get_options() {
if (!isset($this->data['scroll']) || empty($this->data['scroll']['average'])) {
return false;
}
$primaryColor = $this->attributes['primaryColor'];
$secondaryColor = $this->attributes['secondaryColor'];
$value = $this->data['scroll']['average'];
$title = __( 'Average Scroll Depth', 'google-analytics-for-wordpress' );
$options = array(
'series' => array( $value ),
'chart' => array(
'height' => 350,
'type' => 'radialBar',
),
'plotOptions' => array(
'radialBar' => array(
'size' => $value . '%',
)
),
'colors' => array( $primaryColor, $secondaryColor ),
'labels' => array( $title ),
);
return $options;
}
} class-graph-sessions.php 0000644 00000004332 15154771442 0011341 0 ustar 00 <?php
/**
* Class that handles the output for the sessions graph.
*
* Class MonsterInsights_SiteInsights_Template_Graph_Session
*/
class MonsterInsights_SiteInsights_Template_Graph_Sessions extends MonsterInsights_SiteInsights_Metric_Template {
protected $metric = 'sessions';
protected $type = 'graph';
public function output(){
$json_data = $this->get_json_data();
if (empty($json_data)) {
return false;
}
return "<div class='monsterinsights-graph-item monsterinsights-graph-{$this->metric}'>
<script type='application/json'>{$json_data}</script>
</div>";
}
protected function get_options() {
if (empty($this->data['overviewgraph'])) {
return false;
}
$primaryColor = $this->attributes['primaryColor'];
$secondaryColor = $this->attributes['secondaryColor'];
$textColor = $this->attributes['textColor'];
$data = $this->data['overviewgraph'];
$title = __( 'Sessions', 'google-analytics-for-wordpress' );
$options = array(
'series' => array(
array(
'name' => $title,
'data' => $data['sessions']['datapoints']
)
),
'chart' => array(
'type' => 'area',
'zoom' => array( 'enabled' => false ),
'toolbar' => array( 'show' => false )
),
'dataLabels' => array( 'enabled' => false ),
'stroke' => array(
'curve' => 'straight',
'width' => 4,
'colors' => array( $primaryColor )
),
'fill' => array( 'type' => 'solid' ),
'colors' => array( $secondaryColor ),
'markers' => array(
'style' => 'hollow',
'size' => 5,
'colors' => array( '#ffffff' ),
'strokeColors' => $primaryColor
),
'title' => array(
'text' => $title,
'align' => 'left',
'style' => array(
'color' => $textColor,
'fontSize' => '17px',
'fontWeight' => 'bold',
)
),
'grid' => array(
'show' => true,
'borderColor' => 'rgba(58, 147, 221, 0.15)',
'xaxis' => array(
'lines' => array( 'show' => true )
),
'yaxis' => array(
'lines' => array( 'show' => true )
),
'padding' => array(
'top' => 10,
'right' => 10,
'bottom' => 10,
'left' => 10,
)
),
'xaxis' => array( 'categories' => $data['labels'] ),
'yaxis' => array( 'type' => 'numeric' ),
);
return $options;
}
} class-graph-top10countries.php 0000644 00000004016 15154771442 0012371 0 ustar 00 <?php
/**
* Class that handles the output for the Top 10 Countries graph.
*
* Class MonsterInsights_SiteInsights_Template_Graph_Top10countries
*/
class MonsterInsights_SiteInsights_Template_Graph_Top10countries extends MonsterInsights_SiteInsights_Metric_Template {
protected $metric = 'top10countries';
protected $type = 'graph';
public function output(){
$json_data = $this->get_json_data();
if (empty($json_data)) {
return false;
}
return "<div class='monsterinsights-graph-item monsterinsights-graph-{$this->metric}'>
<script type='application/json'>{$json_data}</script>
</div>";
}
protected function get_options() {
if (empty($this->data['countries'])) {
return false;
}
$primaryColor = $this->attributes['primaryColor'];
$secondaryColor = $this->attributes['secondaryColor'];
$textColor = $this->attributes['textColor'];
$data = $this->data['countries'];
$title = __( 'Top 10 countries', 'google-analytics-for-wordpress' );
$series = array();
$labels = array_column($data, 'name');
foreach ($data as $key => $country) {
$series[$key] = (int) $country['sessions'];
}
$options = array(
'series' => array(
array(
'name' => $title,
'data' => $series,
)
),
'chart' => array(
'height' => 430,
'type' => 'bar',
'zoom' => array( 'enabled' => false ),
'toolbar' => array( 'show' => false )
),
'dataLabels' => array(
'enabled' => true,
'style' => array(
'fontSize' => '12px',
'colors' => array( $textColor )
)
),
'colors' => array( $primaryColor, $secondaryColor ),
'title' => array(
'text' => $title,
'align' => 'left',
'style' => array(
'color' => $textColor,
'fontSize' => '20px'
)
),
'plotOptions' => array(
'bar' => array(
'horizontal' => true,
'borderRadius' => 5,
'borderRadiusApplication' => 'end',
'dataLabels' => array(
'position' => 'center',
)
)
),
'xaxis' => array(
'categories' => $labels,
)
);
return $options;
}
} class-graph-topinterests.php 0000644 00000004120 15154771442 0012231 0 ustar 00 <?php
/**
* Class that handles the output for the Top Interests graph.
*
* Class MonsterInsights_SiteInsights_Template_Graph_Topinterests
*/
class MonsterInsights_SiteInsights_Template_Graph_Topinterests extends MonsterInsights_SiteInsights_Metric_Template {
protected $metric = 'topinterests';
protected $type = 'graph';
public function output(){
$json_data = $this->get_json_data();
if (empty($json_data)) {
return false;
}
return "<div class='monsterinsights-graph-item monsterinsights-graph-{$this->metric}'>
<script type='application/json'>{$json_data}</script>
</div>";
}
protected function get_options() {
if (empty($this->data['interest'])) {
return false;
}
$primaryColor = $this->attributes['primaryColor'];
$secondaryColor = $this->attributes['secondaryColor'];
$textColor = $this->attributes['textColor'];
$data = $this->data['interest'];
$title = __( 'Top Interests', 'google-analytics-for-wordpress' );
$series = array();
$percentages = array();
$labels = array_column($data, 'interest');
foreach ($data as $key => $country) {
$series[$key] = (int) $country['sessions'];
$percentages[$key] = (int) $country['percent'];
}
$options = array(
'series' => array(
array(
'name' => $title,
'data' => $series,
)
),
'chart' => array(
'height' => 430,
'type' => 'bar',
'zoom' => array( 'enabled' => false ),
'toolbar' => array( 'show' => false )
),
'dataLabels' => array(
'enabled' => true,
'style' => array(
'fontSize' => '12px',
'colors' => array( $textColor )
)
),
'colors' => array( $primaryColor, $secondaryColor ),
'title' => array(
'text' => $title,
'align' => 'left',
'style' => array(
'color' => $textColor,
'fontSize' => '20px'
)
),
'plotOptions' => array(
'bar' => array(
'horizontal' => true,
'borderRadius' => 5,
'borderRadiusApplication' => 'end',
'dataLabels' => array(
'position' => 'center'
)
)
),
'xaxis' => array(
'categories' => $labels
)
);
return $options;
}
}