PluginProbe ʕ •ᴥ•ʔ
ShareThis Dashboard for Google Analytics / 2.2.5
ShareThis Dashboard for Google Analytics v2.2.5
3.3.2 trunk 1.0.7 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.5 2.3.5 2.3.6 2.3.7 2.3.8 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.0.0 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3.0 3.3.1
googleanalytics / class / controller / Ga_Frontend_Controller.php
googleanalytics / class / controller Last commit date
Ga_Admin_Controller.php 9 years ago Ga_Frontend_Controller.php 6 years ago
Ga_Frontend_Controller.php
35 lines
1 <?php
2
3 /**
4 * Created by PhpStorm.
5 * User: mdn
6 * Date: 2017-02-01
7 * Time: 09:46
8 */
9 class Ga_Frontend_Controller extends Ga_Controller_Core {
10
11 public static function googleanalytics_get_script() {
12 if ( !empty( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) && strtolower( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) == 'xmlhttprequest' ) {
13 $web_property_id = Ga_Frontend::get_web_property_id();
14 $optimize = get_option( 'googleanalytics_optimize_code' );
15 $anonymization = get_option( 'googleanalytics_ip_anonymization' );
16
17 if ( Ga_Helper::should_load_ga_javascript( $web_property_id ) ) {
18 $javascript = Ga_View_Core::load( 'ga_code', array(
19 'data' => array(
20 Ga_Admin::GA_WEB_PROPERTY_ID_OPTION_NAME => $web_property_id,
21 'optimize' => $optimize,
22 'anonymization' => $anonymization,
23 ),
24 ),
25 true );
26 echo strip_tags( $javascript );
27 }
28 } else {
29 wp_redirect( home_url() );
30 }
31 exit();
32 }
33
34 }
35