@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - protected function get_report_html( $data = array() ){ |
|
| 26 | + protected function get_report_html( $data = array() ) { |
|
| 27 | 27 | return $this->get_upsell_notice(); |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -146,20 +146,20 @@ discard block |
||
| 146 | 146 | $this->network = is_network_admin() || ! empty( $args['network'] ); |
| 147 | 147 | |
| 148 | 148 | $default_token = $this->network ? MonsterInsights()->auth->get_network_token() : MonsterInsights()->auth->get_token(); |
| 149 | - $default_key = $this->network ? MonsterInsights()->auth->get_network_key() : MonsterInsights()->auth->get_key(); |
|
| 149 | + $default_key = $this->network ? MonsterInsights()->auth->get_network_key() : MonsterInsights()->auth->get_key(); |
|
| 150 | 150 | |
| 151 | - $this->token = ! empty( $args['token'] ) ? $args['token'] : $default_token; |
|
| 152 | - $this->key = ! empty( $args['key'] ) ? $args['key'] : $default_key; |
|
| 153 | - $this->tt = ! empty( $args['tt'] ) ? $args['tt'] : ''; |
|
| 154 | - $this->return = ! empty( $args['return'] ) ? $args['return'] : ''; |
|
| 155 | - $this->start = ! empty( $args['start'] ) ? $args['start'] : ''; |
|
| 156 | - $this->end = ! empty( $args['end'] ) ? $args['end'] : ''; |
|
| 151 | + $this->token = ! empty( $args['token'] ) ? $args['token'] : $default_token; |
|
| 152 | + $this->key = ! empty( $args['key'] ) ? $args['key'] : $default_key; |
|
| 153 | + $this->tt = ! empty( $args['tt'] ) ? $args['tt'] : ''; |
|
| 154 | + $this->return = ! empty( $args['return'] ) ? $args['return'] : ''; |
|
| 155 | + $this->start = ! empty( $args['start'] ) ? $args['start'] : ''; |
|
| 156 | + $this->end = ! empty( $args['end'] ) ? $args['end'] : ''; |
|
| 157 | 157 | |
| 158 | 158 | // We need to do this hack so that the network panel + the site_url of the main site are distinct |
| 159 | 159 | $this->site_url = is_network_admin() ? network_admin_url() : site_url(); |
| 160 | 160 | |
| 161 | 161 | if ( monsterinsights_is_pro_version() ) { |
| 162 | - $this->license = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key(); |
|
| 162 | + $this->license = $this->network ? MonsterInsights()->license->get_network_license_key() : MonsterInsights()->license->get_site_license_key(); |
|
| 163 | 163 | } |
| 164 | 164 | $this->plugin = MonsterInsights()->plugin_slug; |
| 165 | 165 | $this->miversion = MONSTERINSIGHTS_VERSION; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | public function request() { |
| 177 | 177 | // Make sure we're not blocked |
| 178 | 178 | $blocked = $this->is_blocked( $this->url ); |
| 179 | - if ( $blocked || is_wp_error( $blocked ) ) { |
|
| 179 | + if ( $blocked || is_wp_error( $blocked ) ) { |
|
| 180 | 180 | if ( is_wp_error( $blocked ) ) { |
| 181 | 181 | return new WP_Error( 'api-error', sprintf( __( 'The firewall of your server is blocking outbound calls. Please contact your hosting provider to fix this issue. %s', 'google-analytics-for-wordpress' ), $blocked->get_error_message() ) ); |
| 182 | 182 | } else { |
@@ -233,14 +233,14 @@ discard block |
||
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | if ( 'GET' == $this->method ) { |
| 236 | - $body['time'] = time(); // just to avoid caching |
|
| 236 | + $body['time'] = time(); // just to avoid caching |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | - $body['timezone'] = date('e'); |
|
| 239 | + $body['timezone'] = date( 'e' ); |
|
| 240 | 240 | |
| 241 | 241 | $body['network'] = $this->network ? 'network' : 'site'; |
| 242 | 242 | |
| 243 | - $body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : ''; |
|
| 243 | + $body['ip'] = ! empty( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : ''; |
|
| 244 | 244 | |
| 245 | 245 | // This filter will be removed in the future. |
| 246 | 246 | $body = apply_filters( 'monsterinsights_api_request_body', $body ); |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | // If not a 200 status header, send back error. |
| 286 | 286 | if ( 200 != $response_code ) { |
| 287 | - $type = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error'; |
|
| 287 | + $type = ! empty( $response_body['type'] ) ? $response_body['type'] : 'api-error'; |
|
| 288 | 288 | |
| 289 | 289 | if ( empty( $response_code ) ) { |
| 290 | 290 | return new WP_Error( $type, __( 'The API was unreachable.', 'google-analytics-for-wordpress' ) ); |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | 'body' => '' |
| 390 | 390 | ); |
| 391 | 391 | $response = wp_remote_get( $testurl, $params ); |
| 392 | - if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 392 | + if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 393 | 393 | return false; |
| 394 | 394 | } else { |
| 395 | 395 | if ( is_wp_error( $response ) ) { |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | ); |
| 412 | 412 | $response = wp_remote_get( $testurl, $params ); |
| 413 | 413 | |
| 414 | - if( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 414 | + if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
| 415 | 415 | return false; |
| 416 | 416 | } else { |
| 417 | 417 | if ( is_wp_error( $response ) ) { |
@@ -34,13 +34,13 @@ |
||
| 34 | 34 | $track_user = monsterinsights_track_user(); |
| 35 | 35 | |
| 36 | 36 | if ( $track_user && ( $events_mode === 'js' || $events_mode === 'php' ) ) { |
| 37 | - require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/events/class-analytics-events.php'; |
|
| 38 | - new MonsterInsights_Analytics_Events(); |
|
| 37 | + require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/events/class-analytics-events.php'; |
|
| 38 | + new MonsterInsights_Analytics_Events(); |
|
| 39 | 39 | |
| 40 | - // Let's run form tracking if we find it |
|
| 41 | - if ( function_exists( 'monsterinsights_forms_output_after_script' ) ) { |
|
| 42 | - monsterinsights_forms_output_after_script( array() ); |
|
| 43 | - } |
|
| 40 | + // Let's run form tracking if we find it |
|
| 41 | + if ( function_exists( 'monsterinsights_forms_output_after_script' ) ) { |
|
| 42 | + monsterinsights_forms_output_after_script( array() ); |
|
| 43 | + } |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | add_action( 'seedprod_monsterinsights_output_tracking', 'monsterinsights_seedprod_tracking', 6, 1 ); |
| 47 | 47 | \ No newline at end of file |