HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/scorecard.tar
class-scorecard-age.php000064400000004325151547714350011077 0ustar00<?php
/**
 * Class that handles the output for the Age Breakdown scorecard.
 *
 * Class MonsterInsights_SiteInsights_Template_Scorecard_Age
 */
class MonsterInsights_SiteInsights_Template_Scorecard_Age extends MonsterInsights_SiteInsights_Metric_Template {

	protected $metric = 'age';

	protected $type = 'scorecard';

	public function output(){
		$data = $this->get_options();

		if (empty($data)) {
			return false;
		}

		$content = $this->get_table_template(
			$data['headers'],
			$data['rows']
		);

		return sprintf(
			"<div class=\"monsterinsights-table-scorecard with-3-columns\">%s</div>",
			$content
		);
	}

	/**
	 * Returns data needed for this block.
	 *
	 * @return array|false
	 */
	protected function get_options() {
		if (empty($this->data['age'])) {
			return false;
		}

		$primaryColor = $this->attributes['primaryColor'];
		$secondaryColor = $this->attributes['secondaryColor'];

		$data = $this->data['age'];

		$rows = array();

		foreach ($data as $key => $item) {
			$rows[$key] = array(
				$item['age'],
				$item['sessions'],
				$item['percent'] . '%'
			);
		}

		return array(
			'rows' => $rows,
			'headers' => array(
				__( 'Age Range', 'google-analytics-for-wordpress' ),
				__( 'Sessions', 'google-analytics-for-wordpress' ),
				__( 'Percent', 'google-analytics-for-wordpress' )
			),
		);
	}

	private function get_table_template( $headers, $rows ) {
		$headers_output = '';
		$countries_output = '';

		foreach ( $headers as $key => $head ) {
			$headers_output .= sprintf( '<div class="monsterinsights-scorecard-table-head">%s</div>', $head );
		}

		foreach ( $rows as $key => $row ) {
			$items = '';

			foreach ( $row as $i => $column ) {
				$items .= sprintf( '<div class="monsterinsights-scorecard-table-column">%s</div>', $column );
			}

			$countries_output .= sprintf( '<div class="monsterinsights-scorecard-table-row">%s</div>', $items );
		}

		$header = sprintf(
			'<div class="monsterinsights-scorecard-table-header">%s</div>',
			$headers_output
		);

		$content = sprintf(
			'<div class="monsterinsights-scorecard-table-rows">%s</div>',
			$countries_output
		);

		$format = '<div class="monsterinsights-scorecard-table">%s</div>';

		return sprintf(
			$format,
			$header . $content
		);
	}
}class-scorecard-device.php000064400000004477151547714360011613 0ustar00<?php
/**
 * Class that handles the output for the Device Breakdown scorecard.
 *
 * Class MonsterInsights_SiteInsights_Template_Scorecard_Device
 */
class MonsterInsights_SiteInsights_Template_Scorecard_Device extends MonsterInsights_SiteInsights_Metric_Template {

	protected $metric = 'device';

	protected $type = 'scorecard';

	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['devices'])) {
			return false;
		}

		$primaryColor = $this->attributes['primaryColor'];
		$secondaryColor = $this->attributes['secondaryColor'];
		$textColor = $this->attributes['textColor'];
		$title = __( 'Device Breakdown', 'google-analytics-for-wordpress' );

		$data = $this->data['devices'];

		$series = array_values( $data );
		$labels = array_keys( $data );

		$options = array(
			'series' => array(
				array(
					'data' => $series
				)
			),
			'title' => array(
				'text' => $title,
				'style' => array(
					'color' => $textColor,
					'fontSize' => '20px',
				)
			),
			'chart' => array(
				'type' => 'bar',
				'height' => 240,
				'width' => "90%",
				'toolbar' => array(
					'show' => false
				)
			),
			'colors' => array( $primaryColor, $secondaryColor ),
			'tooltip' => array(
				'enabled' => false
			),
			'grid' => array(
				'show' => false
			),
			'plotOptions' => array(
				'bar' => array(
					'borderRadius' => 5,
					'horizontal' => true,
					'columnWidth' => '33%',
					'dataLabels' => array(
						'position' => 'center',
					)
				)
			),
			'dataLabels' => array(
				'style' => array(
					'colors' => array( $textColor )
				),
				'formatter' => array(
					'args' => 'value',
					'body' => 'return value + "%"',
				)
			),
			'xaxis' => array(
				'show' => false,
				'categories' => $labels,
				'axisBorder' => array(
					'show' => false
				),
				'labels' => array(
					'show' => false
				),
				'axisTicks' => array(
					'show' => false
				)
			),
			'yaxis' => array(
				'show' => true,
				'labels' => array(
					'show' => true
				),
				'axisTicks' => array(
					'show' => false
				)
			),
		);

		return $options;
	}
}class-scorecard-gender.php000064400000004347151547714360011614 0ustar00<?php
/**
 * Class that handles the output for the Gender Breakdown scorecard.
 *
 * Class MonsterInsights_SiteInsights_Template_Scorecard_Gender
 */
class MonsterInsights_SiteInsights_Template_Scorecard_Gender extends MonsterInsights_SiteInsights_Metric_Template {

	protected $metric = 'gender';

	protected $type = 'scorecard';

	public function output(){
		$data = $this->get_options();

		if (empty($data)) {
			return false;
		}

		$content = $this->get_table_template(
			$data['headers'],
			$data['rows']
		);

		return sprintf(
			"<div class=\"monsterinsights-table-scorecard with-3-columns\">%s</div>",
			$content
		);
	}

	/**
	 * Returns data needed for this block.
	 *
	 * @return array|false
	 */
	protected function get_options() {
		if (empty($this->data['gender'])) {
			return false;
		}

		$primaryColor = $this->attributes['primaryColor'];
		$secondaryColor = $this->attributes['secondaryColor'];

		$data = $this->data['gender'];

		$rows = array();

		foreach ($data as $key => $item) {
			$rows[$key] = array(
				$item['gender'],
				$item['sessions'],
				$item['percent'] . '%'
			);
		}

		return array(
			'rows' => $rows,
			'headers' => array(
				__( 'Gender', 'google-analytics-for-wordpress' ),
				__( 'Sessions', 'google-analytics-for-wordpress' ),
				__( 'Percent', 'google-analytics-for-wordpress' )
			),
		);
	}

	private function get_table_template( $headers, $rows ) {
		$headers_output = '';
		$countries_output = '';

		foreach ( $headers as $key => $head ) {
			$headers_output .= sprintf( '<div class="monsterinsights-scorecard-table-head">%s</div>', $head );
		}

		foreach ( $rows as $key => $row ) {
			$items = '';

			foreach ( $row as $i => $column ) {
				$items .= sprintf( '<div class="monsterinsights-scorecard-table-column">%s</div>', $column );
			}

			$countries_output .= sprintf( '<div class="monsterinsights-scorecard-table-row">%s</div>', $items );
		}

		$header = sprintf(
			'<div class="monsterinsights-scorecard-table-header">%s</div>',
			$headers_output
		);

		$content = sprintf(
			'<div class="monsterinsights-scorecard-table-rows">%s</div>',
			$countries_output
		);

		$format = '<div class="monsterinsights-scorecard-table">%s</div>';

		return sprintf(
			$format,
			$header . $content
		);
	}
}class-scorecard-newvsreturning.php000064400000004726151547714360013451 0ustar00<?php
/**
 * Class that handles the output for the New vs Returning scorecard.
 *
 * Class MonsterInsights_SiteInsights_Template_Scorecard_Newvsreturning
 */
class MonsterInsights_SiteInsights_Template_Scorecard_Newvsreturning extends MonsterInsights_SiteInsights_Metric_Template {

	protected $metric = 'newvsreturning';

	protected $type = 'scorecard';

	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['newvsreturn'])) {
			return false;
		}

		$primaryColor = $this->attributes['primaryColor'];
		$secondaryColor = $this->attributes['secondaryColor'];
		$textColor = $this->attributes['textColor'];
		$title = __( 'New vs Returning', 'google-analytics-for-wordpress' );

		$data = $this->data['newvsreturn'];

		$series = array( $data['returning'], $data['new'] );

		$options = array(
			'series' => array(
				array(
					'data' => $series
				)
			),
			'title' => array(
				'text' => $title,
				'style' => array(
					'color' => $textColor,
					'fontSize' => '20px',
				)
			),
			'chart' => array(
				'type' => 'bar',
				'height' => 160,
				'width' => "90%",
				'toolbar' => array(
					'show' => false
				)
			),
			'colors' => array( $primaryColor, $secondaryColor ),
			'tooltip' => array(
				'enabled' => false
			),
			'grid' => array(
				'show' => false
			),
			'plotOptions' => array(
				'bar' => array(
					'borderRadius' => 5,
					'horizontal' => true,
					'columnWidth' => '50%',
					'dataLabels' => array(
						'position' => 'center',
					)
				)
			),
			'dataLabels' => array(
				'style' => array(
					'colors' => array( $textColor )
				),
				'formatter' => array(
					'args' => 'value',
					'body' => 'return value + "%"',
				)
			),
			'xaxis' => array(
				'show' => false,
				'categories' => array(
					__( 'New Visitors', 'google-analytics-for-wordpress' ),
					__( 'Returning Visitors', 'google-analytics-for-wordpress' )
				),
				'axisBorder' => array(
					'show' => false
				),
				'labels' => array(
					'show' => false
				),
				'axisTicks' => array(
					'show' => false
				)
			),
			'yaxis' => array(
				'show' => true,
				'labels' => array(
					'show' => true
				),
				'axisTicks' => array(
					'show' => false
				)
			),
		);

		return $options;
	}
}class-scorecard-pageviews.php000064400000003325151547714370012336 0ustar00<?php
/**
 * Class that handles the output for the Sessions scorecard.
 *
 * Class MonsterInsights_SiteInsights_Template_Scorecard_Pageviews
 */
class MonsterInsights_SiteInsights_Template_Scorecard_Pageviews extends MonsterInsights_SiteInsights_Template_DuoScorecard {

	protected $metric = 'pageviews';

	protected $type = 'scorecard';

	public function output(){
		$data = $this->get_options();

		if (empty($data)) {
			return false;
		}

		$duration = $data['duration']['value'];
		$prev_duration = $data['duration']['prev'];
		$bounce_rate = $data['bounce_rate']['value'];
		$prev_bounce_rate = $data['bounce_rate']['prev'];

		$left = $this->get_card_template(
			'left',
			__('Avg. Session Duration', 'google-analytics-for-wordpress'),
			$duration,
			$prev_duration,
			__( 'vs. Previous 30 days', 'google-analytics-for-wordpress' ),
			$data['withComparison']
		);

		$right = $this->get_card_template(
			'right',
			__('Bounce Rate', 'google-analytics-for-wordpress'),
			$bounce_rate,
			$prev_bounce_rate,
			__( 'vs. Previous 30 days', 'google-analytics-for-wordpress' ),
			$data['withComparison']
		);

		return sprintf(
			"<div class=\"monsterinsights-duo-scorecard\">%s</div>",
			$left . $right
		);
	}

	/**
	 * Returns data needed for this block.
	 *
	 * @return array|false
	 */
	protected function get_options() {
		if ( empty($this->data['infobox'])) {
			return false;
		}

		$primaryColor = $this->attributes['primaryColor'];
		$secondaryColor = $this->attributes['secondaryColor'];
		$withComparison = $this->attributes['withComparison'];

		$data = $this->data['infobox'];

		return array(
			'duration' => $data['duration'],
			'bounce_rate' => $data['bounce_rate'],
			'withComparison' => $withComparison,
		);
	}
}class-scorecard-scrolldepth.php000064400000002242151547714400012656 0ustar00<?php
/**
 * Class that handles the output for the Scroll Depth scorecard.
 *
 * Class MonsterInsights_SiteInsights_Template_Scorecard_Scrolldepth
 */
class MonsterInsights_SiteInsights_Template_Scorecard_Scrolldepth extends MonsterInsights_SiteInsights_Metric_Template {

	protected $metric = 'scrolldepth';

	protected $type = 'scorecard';

	public function output(){
		$value = $this->get_options();

		if ( empty($value) ) {
			return null;
		}

		$format = '<div class="monsterinsights-scorecard-simple-card">
			<div class="monsterinsights-scorecard-simple-card-value">%2$s</div>
			<div class="monsterinsights-scorecard-simple-card-label">%1$s</div>
		</div>';

		return sprintf(
			$format,
			__( 'Average Scroll Depth', 'google-analytics-for-wordpress' ),
			$value . '%'
		);
	}

	/**
	 * Returns data needed for this block.
	 *
	 * @return array|false
	 */
	protected function get_options() {
		if ( !isset($this->data['scroll']) || empty($this->data['scroll']['average'])) {
			return false;
		}

		$primaryColor = $this->attributes['primaryColor'];
		$secondaryColor = $this->attributes['secondaryColor'];

		$data = $this->data['scroll'];

		return $data['average'];
	}
}class-scorecard-sessions.php000064400000003263151547714420012207 0ustar00<?php
/**
 * Class that handles the output for the Sessions scorecard.
 *
 * Class MonsterInsights_SiteInsights_Template_Scorecard_Sessions
 */
class MonsterInsights_SiteInsights_Template_Scorecard_Sessions extends MonsterInsights_SiteInsights_Template_DuoScorecard {

	protected $metric = 'sessions';

	protected $type = 'scorecard';

	public function output(){
		$data = $this->get_options();

		if (empty($data)) {
			return false;
		}

		$sessions = $data['sessions']['value'];
		$prev_sessions = $data['sessions']['prev'];
		$pageviews = $data['pageviews']['value'];
		$prev_pageviews = $data['pageviews']['prev'];

		$left = $this->get_card_template(
			'left',
			__('Sessions', 'google-analytics-for-wordpress'),
			$sessions,
			$prev_sessions,
			__( 'vs. Previous 30 days', 'google-analytics-for-wordpress' ),
			$data['withComparison']
		);

		$right = $this->get_card_template(
			'right',
			__('Pageviews', 'google-analytics-for-wordpress'),
			$pageviews,
			$prev_pageviews,
			__( 'vs. Previous 30 days', 'google-analytics-for-wordpress' ),
			$data['withComparison']
		);

		return sprintf(
			"<div class=\"monsterinsights-duo-scorecard\">%s</div>",
			$left . $right
		);
	}

	/**
	 * Returns data needed for this block.
	 *
	 * @return array|false
	 */
	protected function get_options() {
		if ( empty($this->data['infobox'])) {
			return false;
		}

		$primaryColor = $this->attributes['primaryColor'];
		$secondaryColor = $this->attributes['secondaryColor'];
		$withComparison = $this->attributes['withComparison'];

		$data = $this->data['infobox'];

		return array(
			'sessions' => $data['sessions'],
			'pageviews' => $data['pageviews'],
			'withComparison' => $withComparison,
		);
	}
}class-scorecard-top10countries.php000064400000004271151547714420013240 0ustar00<?php
/**
 * Class that handles the output for the Top 10 countries scorecard.
 *
 * Class MonsterInsights_SiteInsights_Template_Scorecard_Top10countries
 */
class MonsterInsights_SiteInsights_Template_Scorecard_Top10countries extends MonsterInsights_SiteInsights_Metric_Template {

	protected $metric = 'top10countries';

	protected $type = 'scorecard';

	public function output(){
		$data = $this->get_options();

		if (empty($data)) {
			return false;
		}

		$content = $this->get_table_template(
			$data['headers'],
			$data['rows']
		);

		return sprintf(
			"<div class=\"monsterinsights-table-scorecard with-2-columns\">%s</div>",
			$content
		);
	}

	/**
	 * Returns data needed for this block.
	 *
	 * @return array|false
	 */
	protected function get_options() {
		if ( empty($this->data['countries'])) {
			return false;
		}

		$primaryColor = $this->attributes['primaryColor'];
		$secondaryColor = $this->attributes['secondaryColor'];

		$data = $this->data['countries'];

		$rows = array();

		foreach ($data as $key => $country) {
			$rows[$key] = array( $country['name'], $country['sessions'] );
		}

		return array(
			'rows' => $rows,
			'headers' => array(
				__( 'Top 10 Countries', 'google-analytics-for-wordpress' ),
				__( 'Sessions', 'google-analytics-for-wordpress' )
			),
		);
	}

	private function get_table_template( $headers, $rows ) {
		$headers_output = '';
		$countries_output = '';

		foreach ( $headers as $key => $head ) {
			$headers_output .= sprintf( '<div class="monsterinsights-scorecard-table-head">%s</div>', $head );
		}

		foreach ( $rows as $key => $row ) {
			$items = '';

			foreach ( $row as $i => $column ) {
				$items .= sprintf( '<div class="monsterinsights-scorecard-table-column">%s</div>', $column );
			}

			$countries_output .= sprintf( '<div class="monsterinsights-scorecard-table-row">%s</div>', $items );
		}

		$header = sprintf(
			'<div class="monsterinsights-scorecard-table-header">%s</div>',
			$headers_output
		);

		$content = sprintf(
			'<div class="monsterinsights-scorecard-table-rows">%s</div>',
			$countries_output
		);

		$format = '<div class="monsterinsights-scorecard-table">%s</div>';

		return sprintf(
			$format,
			$header . $content
		);
	}
}class-scorecard-topinterests.php000064400000004270151547714420013103 0ustar00<?php
/**
 * Class that handles the output for the Top Interests scorecard.
 *
 * Class MonsterInsights_SiteInsights_Template_Scorecard_Topinterests
 */
class MonsterInsights_SiteInsights_Template_Scorecard_Topinterests extends MonsterInsights_SiteInsights_Metric_Template {

	protected $metric = 'topinterests';

	protected $type = 'scorecard';

	public function output(){
		$data = $this->get_options();

		if (empty($data)) {
			return false;
		}

		$content = $this->get_table_template(
			$data['headers'],
			$data['rows']
		);

		return sprintf(
			"<div class=\"monsterinsights-table-scorecard with-2-columns\">%s</div>",
			$content
		);
	}

	/**
	 * Returns data needed for this block.
	 *
	 * @return array|false
	 */
	protected function get_options() {
		if ( empty($this->data['interest'])) {
			return false;
		}

		$primaryColor = $this->attributes['primaryColor'];
		$secondaryColor = $this->attributes['secondaryColor'];

		$data = $this->data['interest'];

		$rows = array();

		foreach ($data as $key => $item) {
			$rows[$key] = array(
				$item['interest'],
				$item['percent'] . '%'
			);
		}

		return array(
			'rows' => $rows,
			'headers' => array(
				__( 'Categories', 'google-analytics-for-wordpress' ),
				__( '% of Interest', 'google-analytics-for-wordpress' )
			),
		);
	}

	private function get_table_template( $headers, $rows ) {
		$headers_output = '';
		$countries_output = '';

		foreach ( $headers as $key => $head ) {
			$headers_output .= sprintf( '<div class="monsterinsights-scorecard-table-head">%s</div>', $head );
		}

		foreach ( $rows as $key => $row ) {
			$items = '';

			foreach ( $row as $i => $column ) {
				$items .= sprintf( '<div class="monsterinsights-scorecard-table-column">%s</div>', $column );
			}

			$countries_output .= sprintf( '<div class="monsterinsights-scorecard-table-row">%s</div>', $items );
		}

		$header = sprintf(
			'<div class="monsterinsights-scorecard-table-header">%s</div>',
			$headers_output
		);

		$content = sprintf(
			'<div class="monsterinsights-scorecard-table-rows">%s</div>',
			$countries_output
		);

		$format = '<div class="monsterinsights-scorecard-table">%s</div>';

		return sprintf(
			$format,
			$header . $content
		);
	}
}