@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | return; |
191 | 191 | } |
192 | 192 | |
193 | - $plugin_notifications = $this->get_plugin_notifications( - 1, array( |
|
193 | + $plugin_notifications = $this->get_plugin_notifications( -1, array( |
|
194 | 194 | 'post_status' => 'all', |
195 | 195 | 'meta_key' => 'viewed', |
196 | 196 | 'meta_value' => '0', |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } |
250 | 250 | |
251 | 251 | if ( ! $continue ) { |
252 | - unset( $plugin_notifications[ $key ] ); |
|
252 | + unset( $plugin_notifications[$key] ); |
|
253 | 253 | } |
254 | 254 | } |
255 | 255 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | } |
265 | 265 | |
266 | 266 | if ( ! $continue ) { |
267 | - unset( $plugin_notifications[ $key ] ); |
|
267 | + unset( $plugin_notifications[$key] ); |
|
268 | 268 | } |
269 | 269 | } |
270 | 270 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $continue = (string) wp_get_theme() === $theme; |
274 | 274 | |
275 | 275 | if ( ! empty( $theme ) && ! $continue ) { |
276 | - unset( $plugin_notifications[ $key ] ); |
|
276 | + unset( $plugin_notifications[$key] ); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | // Version validation. |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | if ( ! $continue ) { |
288 | - unset( $plugin_notifications[ $key ] ); |
|
288 | + unset( $plugin_notifications[$key] ); |
|
289 | 289 | } |
290 | 290 | } |
291 | 291 | |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | } |
299 | 299 | |
300 | 300 | if ( ! $continue ) { |
301 | - unset( $plugin_notifications[ $key ] ); |
|
301 | + unset( $plugin_notifications[$key] ); |
|
302 | 302 | } |
303 | 303 | } |
304 | 304 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | } |
313 | 313 | |
314 | 314 | if ( ! $continue ) { |
315 | - unset( $plugin_notifications[ $key ] ); |
|
315 | + unset( $plugin_notifications[$key] ); |
|
316 | 316 | } |
317 | 317 | } |
318 | 318 | } |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | public function revoke_notifications( $ids ) { |
445 | 445 | // Loop through each of the IDs and find the post that has it as meta. |
446 | 446 | foreach ( (array) $ids as $id ) { |
447 | - $notifications = $this->get_plugin_notifications( - 1, array( 'post_status' => 'all', 'meta_key' => 'notification_id', 'meta_value' => $id ) ); |
|
447 | + $notifications = $this->get_plugin_notifications( -1, array( 'post_status' => 'all', 'meta_key' => 'notification_id', 'meta_value' => $id ) ); |
|
448 | 448 | if ( $notifications ) { |
449 | 449 | foreach ( $notifications as $notification ) { |
450 | 450 | update_post_meta( $notification->ID, 'viewed', 1 ); |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
198 | - * Helper method for deleting a setting's value. |
|
199 | - * |
|
200 | - * @since 6.0.0 |
|
201 | - * @access public |
|
202 | - * |
|
203 | - * @param string $key The setting key. |
|
204 | - * @return boolean True if removed, false if not. |
|
205 | - */ |
|
198 | + * Helper method for deleting a setting's value. |
|
199 | + * |
|
200 | + * @since 6.0.0 |
|
201 | + * @access public |
|
202 | + * |
|
203 | + * @param string $key The setting key. |
|
204 | + * @return boolean True if removed, false if not. |
|
205 | + */ |
|
206 | 206 | function monsterinsights_delete_option( $key = '' ) { |
207 | 207 | // If no key, exit |
208 | 208 | if ( empty( $key ) ){ |
@@ -245,14 +245,14 @@ discard block |
||
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
248 | - * Helper method for deleting multiple settings value. |
|
249 | - * |
|
250 | - * @since 6.0.0 |
|
251 | - * @access public |
|
252 | - * |
|
253 | - * @param string $key The setting key. |
|
254 | - * @return boolean True if removed, false if not. |
|
255 | - */ |
|
248 | + * Helper method for deleting multiple settings value. |
|
249 | + * |
|
250 | + * @since 6.0.0 |
|
251 | + * @access public |
|
252 | + * |
|
253 | + * @param string $key The setting key. |
|
254 | + * @return boolean True if removed, false if not. |
|
255 | + */ |
|
256 | 256 | function monsterinsights_delete_options( $keys = array() ) { |
257 | 257 | // If no keys, exit |
258 | 258 | if ( empty( $keys ) || ! is_array( $keys ) ){ |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | function monsterinsights_get_option( $key = '', $default = false ) { |
49 | 49 | global $monsterinsights_settings; |
50 | - $value = ! empty( $monsterinsights_settings[ $key ] ) ? $monsterinsights_settings[ $key ] : $default; |
|
50 | + $value = ! empty( $monsterinsights_settings[$key] ) ? $monsterinsights_settings[$key] : $default; |
|
51 | 51 | $value = apply_filters( 'monsterinsights_get_option', $value, $key, $default ); |
52 | 52 | return apply_filters( 'monsterinsights_get_option_' . $key, $value, $key, $default ); |
53 | 53 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | function monsterinsights_update_option( $key = '', $value = false ) { |
147 | 147 | |
148 | 148 | // If no key, exit |
149 | - if ( empty( $key ) ){ |
|
149 | + if ( empty( $key ) ) { |
|
150 | 150 | return false; |
151 | 151 | } |
152 | 152 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $value = apply_filters( 'monsterinsights_update_option', $value, $key ); |
178 | 178 | |
179 | 179 | // Next let's try to update the value |
180 | - $settings[ $key ] = $value; |
|
180 | + $settings[$key] = $value; |
|
181 | 181 | $did_update = false; |
182 | 182 | //if ( $update_network_option ) { |
183 | 183 | // $did_update = update_site_option( $option_name, $settings ); |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | //} |
187 | 187 | |
188 | 188 | // If it updated, let's update the global variable |
189 | - if ( $did_update ){ |
|
189 | + if ( $did_update ) { |
|
190 | 190 | global $monsterinsights_settings; |
191 | - $monsterinsights_settings[ $key ] = $value; |
|
191 | + $monsterinsights_settings[$key] = $value; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | return $did_update; |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | function monsterinsights_delete_option( $key = '' ) { |
207 | 207 | // If no key, exit |
208 | - if ( empty( $key ) ){ |
|
208 | + if ( empty( $key ) ) { |
|
209 | 209 | return false; |
210 | 210 | } |
211 | 211 | |
@@ -224,8 +224,8 @@ discard block |
||
224 | 224 | //} |
225 | 225 | |
226 | 226 | // Next let's try to remove the key |
227 | - if( isset( $settings[ $key ] ) ) { |
|
228 | - unset( $settings[ $key ] ); |
|
227 | + if ( isset( $settings[$key] ) ) { |
|
228 | + unset( $settings[$key] ); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | $did_update = false; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | //} |
237 | 237 | |
238 | 238 | // If it updated, let's update the global variable |
239 | - if ( $did_update ){ |
|
239 | + if ( $did_update ) { |
|
240 | 240 | global $monsterinsights_settings; |
241 | 241 | $monsterinsights_settings = $settings; |
242 | 242 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | function monsterinsights_delete_options( $keys = array() ) { |
257 | 257 | // If no keys, exit |
258 | - if ( empty( $keys ) || ! is_array( $keys ) ){ |
|
258 | + if ( empty( $keys ) || ! is_array( $keys ) ) { |
|
259 | 259 | return false; |
260 | 260 | } |
261 | 261 | |
@@ -275,8 +275,8 @@ discard block |
||
275 | 275 | |
276 | 276 | // Next let's try to remove the keys |
277 | 277 | foreach ( $keys as $key ) { |
278 | - if( isset( $settings[ $key ] ) ) { |
|
279 | - unset( $settings[ $key ] ); |
|
278 | + if ( isset( $settings[$key] ) ) { |
|
279 | + unset( $settings[$key] ); |
|
280 | 280 | } |
281 | 281 | } |
282 | 282 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | //} |
289 | 289 | |
290 | 290 | // If it updated, let's update the global variable |
291 | - if ( $did_update ){ |
|
291 | + if ( $did_update ) { |
|
292 | 292 | global $monsterinsights_settings; |
293 | 293 | $monsterinsights_settings = $settings; |
294 | 294 | } |
@@ -379,8 +379,8 @@ discard block |
||
379 | 379 | ); |
380 | 380 | |
381 | 381 | foreach ( $exclude as $e ) { |
382 | - if ( ! empty( $settings[ $e ] ) ) { |
|
383 | - unset( $settings[ $e ] ); |
|
382 | + if ( ! empty( $settings[$e] ) ) { |
|
383 | + unset( $settings[$e] ); |
|
384 | 384 | } |
385 | 385 | } |
386 | 386 | return wp_json_encode( $settings ); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | function monsterinsights_update_option( $key = '', $value = false ) { |
147 | 147 | |
148 | 148 | // If no key, exit |
149 | - if ( empty( $key ) ){ |
|
149 | + if ( empty( $key ) ) { |
|
150 | 150 | return false; |
151 | 151 | } |
152 | 152 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | //} |
187 | 187 | |
188 | 188 | // If it updated, let's update the global variable |
189 | - if ( $did_update ){ |
|
189 | + if ( $did_update ) { |
|
190 | 190 | global $monsterinsights_settings; |
191 | 191 | $monsterinsights_settings[ $key ] = $value; |
192 | 192 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | function monsterinsights_delete_option( $key = '' ) { |
207 | 207 | // If no key, exit |
208 | - if ( empty( $key ) ){ |
|
208 | + if ( empty( $key ) ) { |
|
209 | 209 | return false; |
210 | 210 | } |
211 | 211 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | //} |
237 | 237 | |
238 | 238 | // If it updated, let's update the global variable |
239 | - if ( $did_update ){ |
|
239 | + if ( $did_update ) { |
|
240 | 240 | global $monsterinsights_settings; |
241 | 241 | $monsterinsights_settings = $settings; |
242 | 242 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | function monsterinsights_delete_options( $keys = array() ) { |
257 | 257 | // If no keys, exit |
258 | - if ( empty( $keys ) || ! is_array( $keys ) ){ |
|
258 | + if ( empty( $keys ) || ! is_array( $keys ) ) { |
|
259 | 259 | return false; |
260 | 260 | } |
261 | 261 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | //} |
289 | 289 | |
290 | 290 | // If it updated, let's update the global variable |
291 | - if ( $did_update ){ |
|
291 | + if ( $did_update ) { |
|
292 | 292 | global $monsterinsights_settings; |
293 | 293 | $monsterinsights_settings = $settings; |
294 | 294 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | if ( ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) || monsterinsights_is_debug_mode() ) { |
125 | 125 | $message = empty( $message ) ? '' : ' ' . $message; |
126 | - trigger_error( sprintf( esc_html__( '%1$s is %3$sdeprecated%4$s since MonsterInsights version %2$s!', 'google-analytics-for-wordpress' ), $hook, $version, '<strong>', '</strong>' ) . esc_html ( $message ) ); |
|
126 | + trigger_error( sprintf( esc_html__( '%1$s is %3$sdeprecated%4$s since MonsterInsights version %2$s!', 'google-analytics-for-wordpress' ), $hook, $version, '<strong>', '</strong>' ) . esc_html( $message ) ); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | if ( ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) || monsterinsights_is_debug_mode() ) { |
179 | 179 | trigger_error( sprintf( esc_html__( '%1$s is %3$sdeprecated%4$s since MonsterInsights version %2$s.', 'google-analytics-for-wordpress' ), $function, $version, '<strong>', '</strong>' ) ); |
180 | - trigger_error( print_r( $backtrace, 1 ) );// Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine. |
|
180 | + trigger_error( print_r( $backtrace, 1 ) ); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine. |
|
181 | 181 | // Alternatively we could dump this to a file. |
182 | 182 | } |
183 | 183 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return array Array of the options to use. |
59 | 59 | */ |
60 | 60 | public function frontend_tracking_options( ) { |
61 | - return array(); |
|
61 | + return array(); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -74,6 +74,6 @@ discard block |
||
74 | 74 | * @return string Javascript to output. |
75 | 75 | */ |
76 | 76 | public function frontend_output( ) { |
77 | - return "<!-- MonsterInsights Abstract Tracking class -->"; |
|
77 | + return "<!-- MonsterInsights Abstract Tracking class -->"; |
|
78 | 78 | } |
79 | 79 | } |
80 | 80 | \ No newline at end of file |
@@ -35,54 +35,54 @@ |
||
35 | 35 | function monsterinsights_add_capabilities( $caps, $cap, $user_id, $args ) { |
36 | 36 | |
37 | 37 | switch( $cap ) { |
38 | - case 'monsterinsights_view_dashboard' : |
|
39 | - $roles = monsterinsights_get_option( 'view_reports', array() ); |
|
38 | + case 'monsterinsights_view_dashboard' : |
|
39 | + $roles = monsterinsights_get_option( 'view_reports', array() ); |
|
40 | 40 | |
41 | - $user_can_via_settings = false; |
|
42 | - if ( ! empty( $roles ) && is_array( $roles ) ) { |
|
43 | - foreach ( $roles as $role ) { |
|
44 | - if ( is_string( $role ) ) { |
|
45 | - if ( user_can( $user_id, $role ) ) { |
|
46 | - $user_can_via_settings = true; |
|
47 | - break; |
|
48 | - } |
|
49 | - } |
|
50 | - } |
|
51 | - } else if ( ! empty( $roles ) && is_string( $roles ) ) { |
|
52 | - if ( user_can( $user_id, $roles ) ) { |
|
53 | - $user_can_via_settings = true; |
|
54 | - } |
|
55 | - } |
|
41 | + $user_can_via_settings = false; |
|
42 | + if ( ! empty( $roles ) && is_array( $roles ) ) { |
|
43 | + foreach ( $roles as $role ) { |
|
44 | + if ( is_string( $role ) ) { |
|
45 | + if ( user_can( $user_id, $role ) ) { |
|
46 | + $user_can_via_settings = true; |
|
47 | + break; |
|
48 | + } |
|
49 | + } |
|
50 | + } |
|
51 | + } else if ( ! empty( $roles ) && is_string( $roles ) ) { |
|
52 | + if ( user_can( $user_id, $roles ) ) { |
|
53 | + $user_can_via_settings = true; |
|
54 | + } |
|
55 | + } |
|
56 | 56 | |
57 | - if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) { |
|
58 | - $caps = array(); |
|
59 | - } |
|
57 | + if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) { |
|
58 | + $caps = array(); |
|
59 | + } |
|
60 | 60 | |
61 | - break; |
|
62 | - case 'monsterinsights_save_settings' : |
|
63 | - $roles = monsterinsights_get_option( 'save_settings', array() ); |
|
61 | + break; |
|
62 | + case 'monsterinsights_save_settings' : |
|
63 | + $roles = monsterinsights_get_option( 'save_settings', array() ); |
|
64 | 64 | |
65 | - $user_can_via_settings = false; |
|
66 | - if ( ! empty( $roles ) && is_array( $roles ) ) { |
|
67 | - foreach ( $roles as $role ) { |
|
68 | - if ( is_string( $role ) ) { |
|
69 | - if ( user_can( $user_id, $role ) ) { |
|
70 | - $user_can_via_settings = true; |
|
71 | - break; |
|
72 | - } |
|
73 | - } |
|
74 | - } |
|
75 | - } else if ( ! empty( $roles ) && is_string( $roles ) ) { |
|
76 | - if ( user_can( $user_id, $roles ) ) { |
|
77 | - $user_can_via_settings = true; |
|
78 | - } |
|
79 | - } |
|
65 | + $user_can_via_settings = false; |
|
66 | + if ( ! empty( $roles ) && is_array( $roles ) ) { |
|
67 | + foreach ( $roles as $role ) { |
|
68 | + if ( is_string( $role ) ) { |
|
69 | + if ( user_can( $user_id, $role ) ) { |
|
70 | + $user_can_via_settings = true; |
|
71 | + break; |
|
72 | + } |
|
73 | + } |
|
74 | + } |
|
75 | + } else if ( ! empty( $roles ) && is_string( $roles ) ) { |
|
76 | + if ( user_can( $user_id, $roles ) ) { |
|
77 | + $user_can_via_settings = true; |
|
78 | + } |
|
79 | + } |
|
80 | 80 | |
81 | - if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) { |
|
82 | - $caps = array(); |
|
83 | - } |
|
81 | + if ( user_can( $user_id, 'manage_options' ) || $user_can_via_settings ) { |
|
82 | + $caps = array(); |
|
83 | + } |
|
84 | 84 | |
85 | - break; |
|
85 | + break; |
|
86 | 86 | } |
87 | 87 | return $caps; |
88 | 88 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | function monsterinsights_add_capabilities( $caps, $cap, $user_id, $args ) { |
36 | 36 | |
37 | - switch( $cap ) { |
|
37 | + switch ( $cap ) { |
|
38 | 38 | case 'monsterinsights_view_dashboard' : |
39 | 39 | $roles = monsterinsights_get_option( 'view_reports', array() ); |
40 | 40 | |
@@ -86,4 +86,4 @@ discard block |
||
86 | 86 | } |
87 | 87 | return $caps; |
88 | 88 | } |
89 | -add_filter( 'map_meta_cap','monsterinsights_add_capabilities', 10, 4 ); |
|
90 | 89 | \ No newline at end of file |
90 | +add_filter( 'map_meta_cap', 'monsterinsights_add_capabilities', 10, 4 ); |
|
91 | 91 | \ No newline at end of file |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | } |
26 | 26 | |
27 | - public function add_report( $report = false ){ |
|
27 | + public function add_report( $report = false ) { |
|
28 | 28 | if ( empty( $report ) || ! is_object( $report ) ) { |
29 | 29 | return; |
30 | 30 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | } |
26 | 26 | |
27 | - public function add_report( $report = false ){ |
|
27 | + public function add_report( $report = false ) { |
|
28 | 28 | if ( empty( $report ) || ! is_object( $report ) ) { |
29 | 29 | return; |
30 | 30 | } |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | // Let's get the HTML to output for a particular report. This is not the AJAX endpoint. Args can hold things (generally start/end date range) |
37 | - protected function get_report_html( $args = array() ) { |
|
37 | + protected function get_report_html( $args = array() ) { |
|
38 | 38 | /* Defined in the report class */ |
39 | 39 | // For ajax, args start, end, and data will be set with the data to use. Else call $this->get_data( array( 'default' => true ) ) |
40 | 40 | return ''; |
41 | 41 | } |
42 | 42 | |
43 | - public function additional_data(){ |
|
43 | + public function additional_data() { |
|
44 | 44 | return array(); |
45 | 45 | } |
46 | 46 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | return monsterinsights_get_message( 'error', esc_html__( 'Access denied' , 'google-analytics-for-wordpress' ) ); |
55 | 55 | } |
56 | 56 | |
57 | - if ( monsterinsights_get_option( 'dashboard_disabled', false ) ) { |
|
57 | + if ( monsterinsights_get_option( 'dashboard_disabled', false ) ) { |
|
58 | 58 | if ( current_user_can( 'monsterinsights_save_settings' ) ) { |
59 | 59 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_settings' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
60 | 60 | return monsterinsights_get_message( 'error', |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - if ( monsterinsights_is_pro_version() ){ |
|
72 | + if ( monsterinsights_is_pro_version() ) { |
|
73 | 73 | if ( ! MonsterInsights()->license->has_license() ) { |
74 | 74 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_settings' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
75 | 75 | return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ),'<a href="' . $url . '">','</a>' ); |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | if ( ! class_exists( 'MonsterInsightsDateTime' ) ) { |
352 | 352 | class MonsterInsightsDateTime extends DateTime { |
353 | 353 | public static function createFromFormat( $format, $time, $timezone = null ) { |
354 | - if ( ! $timezone ) { |
|
354 | + if ( ! $timezone ) { |
|
355 | 355 | $timezone = new DateTimeZone( date_default_timezone_get() ); |
356 | 356 | } |
357 | 357 | if ( version_compare( PHP_VERSION, '5.3', '>=' ) ) { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @since 6.0.0 |
31 | 31 | */ |
32 | 32 | public function __construct() { |
33 | - add_filter( 'monsterinsights_reports_abstract_get_data_pre_cache', array( $this, 'requirements' ), 10 , 3 ); |
|
33 | + add_filter( 'monsterinsights_reports_abstract_get_data_pre_cache', array( $this, 'requirements' ), 10, 3 ); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Let's get the HTML to output for a particular report. This is not the AJAX endpoint. Args can hold things (generally start/end date range) |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | return ''; |
41 | 41 | } |
42 | 42 | |
43 | - public function additional_data(){ |
|
43 | + public function additional_data() { |
|
44 | 44 | return array(); |
45 | 45 | } |
46 | 46 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function show_report( $args = array() ) { |
52 | 52 | |
53 | 53 | if ( ! current_user_can( 'monsterinsights_view_dashboard' ) ) { |
54 | - return monsterinsights_get_message( 'error', esc_html__( 'Access denied' , 'google-analytics-for-wordpress' ) ); |
|
54 | + return monsterinsights_get_message( 'error', esc_html__( 'Access denied', 'google-analytics-for-wordpress' ) ); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | if ( monsterinsights_get_option( 'dashboard_disabled', false ) ) { |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - if ( monsterinsights_is_pro_version() ){ |
|
72 | + if ( monsterinsights_is_pro_version() ) { |
|
73 | 73 | if ( ! MonsterInsights()->license->has_license() ) { |
74 | 74 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_settings' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
75 | - return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ),'<a href="' . $url . '">','</a>' ); |
|
75 | + return monsterinsights_get_message( 'error', esc_html__( 'You do not have an active license. Please %1$scheck your license configuration.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . $url . '">', '</a>' ); |
|
76 | 76 | } else if ( MonsterInsights()->license->license_has_error() ) { |
77 | 77 | return monsterinsights_get_message( 'error', $this->get_license_error() ); |
78 | 78 | } |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | return monsterinsights_get_message( 'error', $args['error'] ); |
108 | 108 | } |
109 | 109 | |
110 | - if ( empty( $args['data' ] ) || ! is_array( $args['data' ] ) ) { |
|
110 | + if ( empty( $args['data'] ) || ! is_array( $args['data'] ) ) { |
|
111 | 111 | if ( monsterinsights_is_pro_version() ) { |
112 | 112 | return ''; |
113 | 113 | } else { |
114 | 114 | // Try to get default data. |
115 | 115 | $args = $this->get_data( array( 'default' => true ) ); |
116 | - if ( empty( $args['data'] ) || is_array( $args['data' ] ) ) { |
|
116 | + if ( empty( $args['data'] ) || is_array( $args['data'] ) ) { |
|
117 | 117 | return monsterinsights_get_message( 'error', __( 'No data found', 'google-analytics-for-wordpress' ) ); |
118 | 118 | } |
119 | 119 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | $start = ! empty( $args['start'] ) && $this->is_valid_date( $args['start'] ) ? $args['start'] : ''; |
150 | - $end = ! empty( $args['end'] ) && $this->is_valid_date( $args['end'] ) ? $args['end'] : ''; |
|
150 | + $end = ! empty( $args['end'] ) && $this->is_valid_date( $args['end'] ) ? $args['end'] : ''; |
|
151 | 151 | |
152 | 152 | if ( ! MonsterInsights()->license->license_can( $this->level ) ) { |
153 | 153 | return array( |
@@ -204,11 +204,11 @@ discard block |
||
204 | 204 | $data = ! $site_auth && $ms_auth ? get_site_transient( $transient ) : get_transient( $transient ); |
205 | 205 | } |
206 | 206 | |
207 | - if ( ! empty( $data ) && |
|
208 | - ! empty( $data['expires'] ) && |
|
207 | + if ( ! empty( $data ) && |
|
208 | + ! empty( $data['expires'] ) && |
|
209 | 209 | $data['expires'] >= time() && |
210 | - ! empty( $data['data'] ) && |
|
211 | - ! empty( $data['p'] ) && |
|
210 | + ! empty( $data['data'] ) && |
|
211 | + ! empty( $data['p'] ) && |
|
212 | 212 | $data['p'] === $p |
213 | 213 | ) { |
214 | 214 | return array( |
@@ -218,12 +218,12 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | // Nothing in cache, either not saved before, expired or mismatch. Let's grab from API |
221 | - $api_options = array( 'start' => $start, 'end' => $end); |
|
221 | + $api_options = array( 'start' => $start, 'end' => $end ); |
|
222 | 222 | if ( ! $site_auth && $ms_auth ) { |
223 | 223 | $api_options['network'] = true; |
224 | 224 | } |
225 | 225 | |
226 | - $api = new MonsterInsights_API_Request( 'analytics/reports/' . $this->name . '/', $api_options, 'GET' ); |
|
226 | + $api = new MonsterInsights_API_Request( 'analytics/reports/' . $this->name . '/', $api_options, 'GET' ); |
|
227 | 227 | |
228 | 228 | $additional_data = $this->additional_data(); |
229 | 229 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $api->set_additional_data( $additional_data ); |
232 | 232 | } |
233 | 233 | |
234 | - $ret = $api->request(); |
|
234 | + $ret = $api->request(); |
|
235 | 235 | |
236 | 236 | if ( is_wp_error( $ret ) ) { |
237 | 237 | return array( |
@@ -291,44 +291,44 @@ discard block |
||
291 | 291 | // Is a valid date value |
292 | 292 | public function is_valid_date( $date = '' ) { |
293 | 293 | $d = MonsterInsightsDateTime::createFromFormat( 'Y-m-d', $date ); |
294 | - return $d && $d->format('Y-m-d') === $date; |
|
294 | + return $d && $d->format( 'Y-m-d' ) === $date; |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | /** |
298 | 298 | * Do not use the functions below this. They are unused and are just here so people |
299 | 299 | * with out of date MonsterInsights addons won't get fatal errors. |
300 | 300 | */ |
301 | - protected function get_api_max_limit() {return 300;} |
|
302 | - protected function get_date_range() {return array();} |
|
301 | + protected function get_api_max_limit() {return 300; } |
|
302 | + protected function get_date_range() {return array(); } |
|
303 | 303 | |
304 | 304 | public function get_upsell_notice() { |
305 | 305 | $has_level = MonsterInsights()->license->get_license_type(); |
306 | 306 | $has_level = $has_level ? $has_level : 'lite'; |
307 | 307 | $message = sprintf( __( 'You currently have a %s level license, but this report requires at least a %s level license to view the %s. Please upgrade to view this report.', 'google-analytics-for-wordpress' ), $has_level, $this->level, $this->title ); |
308 | - ob_start();?> |
|
309 | - <div class="monsterinsights-upsell-report-container monsterinsights-upsell-report-<?php echo $this->name;?>-bg"> |
|
308 | + ob_start(); ?> |
|
309 | + <div class="monsterinsights-upsell-report-container monsterinsights-upsell-report-<?php echo $this->name; ?>-bg"> |
|
310 | 310 | <div class="monsterinsights-upsell-container"> |
311 | 311 | <div class="row justify-content-center"> |
312 | 312 | <div class="col-lg-10 col-lg-offset-1 align-self-center"> |
313 | 313 | <div class="monsterinsights-upsell-card"> |
314 | - <img class="monsterinsights-upgrade-mascot" src="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL );?>assets/css/images/mascot.png" srcset="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL );?>assets/css/images/[email protected] 2x" alt=""> |
|
314 | + <img class="monsterinsights-upgrade-mascot" src="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ); ?>assets/css/images/mascot.png" srcset="<?php echo trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ); ?>assets/css/images/[email protected] 2x" alt=""> |
|
315 | 315 | <div class="monsterinsights-upsell-card-card-content"> |
316 | - <span class="monsterinsights-upsell-card-title"><?php esc_html_e( 'Ready to Get Analytics Super-Powers?', 'google-analytics-for-wordpress' );?></span> |
|
317 | - <p class="monsterinsights-upsell-card-subtitle"><strong><?php esc_html_e( '(And Crush Your Competition?)', 'google-analytics-for-wordpress' );?></strong></p> |
|
316 | + <span class="monsterinsights-upsell-card-title"><?php esc_html_e( 'Ready to Get Analytics Super-Powers?', 'google-analytics-for-wordpress' ); ?></span> |
|
317 | + <p class="monsterinsights-upsell-card-subtitle"><strong><?php esc_html_e( '(And Crush Your Competition?)', 'google-analytics-for-wordpress' ); ?></strong></p> |
|
318 | 318 | <?php if ( monsterinsights_is_pro_version() ) { ?> |
319 | 319 | <p ><?php echo sprintf( esc_html__( "Hey there! It looks like you've got the %s license installed on your site. |
320 | - That's awesome! %s",'google-analytics-for-wordpress'), $has_level, '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
320 | + That's awesome! %s",'google-analytics-for-wordpress' ), $has_level, '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
321 | 321 | |
322 | - <p><?php echo sprintf( esc_html__( "Do you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with the %s level%s of our paid packages. You'll need to upgrade your license to get instant access.",'google-analytics-for-wordpress'), '<strong>' . $this->title, '</strong>','<strong><a href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) .'">' . $this->level,'</a></strong>' ); ?></p> |
|
323 | - <p><?php echo sprintf( esc_html__( "It's easy! To upgrade, navigate to %sMy Account%s on MonsterInsights.com, go to the licenses tab, and click upgrade. We also have a %sstep by step guide%s with pictures of this process.",'google-analytics-for-wordpress'), '<a href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) .'"><strong>','</strong></a>', '<a href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://www.monsterinsights.com/docs/upgrade-monsterinsights-license/' ) .'" style="text-decoration:underline !important">', '</a>' ); ?></p> |
|
324 | - <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress');?></p> |
|
322 | + <p><?php echo sprintf( esc_html__( "Do you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with the %s level%s of our paid packages. You'll need to upgrade your license to get instant access.", 'google-analytics-for-wordpress' ), '<strong>' . $this->title, '</strong>', '<strong><a href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) . '">' . $this->level, '</a></strong>' ); ?></p> |
|
323 | + <p><?php echo sprintf( esc_html__( "It's easy! To upgrade, navigate to %sMy Account%s on MonsterInsights.com, go to the licenses tab, and click upgrade. We also have a %sstep by step guide%s with pictures of this process.", 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://monsterinsights.com/my-account/' ) . '"><strong>', '</strong></a>', '<a href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-upsell-license-link', 'https://www.monsterinsights.com/docs/upgrade-monsterinsights-license/' ) . '" style="text-decoration:underline !important">', '</a>' ); ?></p> |
|
324 | + <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress' ); ?></p> |
|
325 | 325 | <?php } else { ?> |
326 | 326 | <p><?php echo sprintf( esc_html__( "Hey there! %s It looks like you've got the free version of MonsterInsights installed on your site. |
327 | - That's awesome!",'google-analytics-for-wordpress'), '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
327 | + That's awesome!",'google-analytics-for-wordpress' ), '<span class="dashicons dashicons-smiley"></span>' ); ?></p> |
|
328 | 328 | |
329 | - <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. To get instant access, you'll want to buy a MonsterInsights license, which also gives you access to powerful addons, expanded reporting (including the ability to use custom date ranges), comprehensive tracking features (like UserID tracking) and access to our world-class support team.",'google-analytics-for-wordpress'), '<strong>' . $this->title, '</strong>','<a href="'. monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) .'">' . $this->level,'</a>' ); ?></p> |
|
330 | - <p><?php echo sprintf( esc_html__( "Upgrading is easy! To upgrade, navigate to %sour pricing page%s, purchase the required license, and then follow the %sinstructions in the email receipt%s to upgrade. It only takes a few minutes to unlock the most powerful, yet easy to use analytics tracking system for WordPress.",'google-analytics-for-wordpress'), '<a href="'. monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) .'"><strong>', '</strong></a>','<a style="text-decoration:underline !important" href="'. monsterinsights_get_url( 'reports-page', $this->name . '-report-go-lite-pro-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) .'">', '</a>' ); ?></p> |
|
331 | - <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress');?></p> |
|
329 | + <p><?php echo sprintf( esc_html__( "Do you you want to access to %s reporting right now%s in your WordPress Dashboard? That comes with %s level%s of our paid packages. To get instant access, you'll want to buy a MonsterInsights license, which also gives you access to powerful addons, expanded reporting (including the ability to use custom date ranges), comprehensive tracking features (like UserID tracking) and access to our world-class support team.", 'google-analytics-for-wordpress' ), '<strong>' . $this->title, '</strong>', '<a href="' . monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) . '">' . $this->level, '</a>' ); ?></p> |
|
330 | + <p><?php echo sprintf( esc_html__( "Upgrading is easy! To upgrade, navigate to %sour pricing page%s, purchase the required license, and then follow the %sinstructions in the email receipt%s to upgrade. It only takes a few minutes to unlock the most powerful, yet easy to use analytics tracking system for WordPress.", 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_upgrade_link( 'reports-page', $this->name . '-report-upsell-license-link' ) . '"><strong>', '</strong></a>', '<a style="text-decoration:underline !important" href="' . monsterinsights_get_url( 'reports-page', $this->name . '-report-go-lite-pro-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) . '">', '</a>' ); ?></p> |
|
331 | + <p><?php esc_html_e( "If you have any questions, don't hesitate to reach out. We're here to help.", 'google-analytics-for-wordpress' ); ?></p> |
|
332 | 332 | <?php } ?> |
333 | 333 | </div> |
334 | 334 | <div class="monsterinsights-upsell-card-action"> |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | * @return string |
367 | 367 | */ |
368 | 368 | public function get_addons_page_link() { |
369 | - $addons_url = add_query_arg( 'page', 'monsterinsights_addons', admin_url( 'admin.php' ) ); |
|
369 | + $addons_url = add_query_arg( 'page', 'monsterinsights_addons', admin_url( 'admin.php' ) ); |
|
370 | 370 | return sprintf( '<a href="%1$s">%2$s</a>', $addons_url, esc_html__( 'Visit addons page', 'google-analytics-for-wordpress' ) ); |
371 | 371 | } |
372 | 372 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | final class MonsterInsights_Auth { |
20 | 20 | |
21 | - private $profile = array(); |
|
21 | + private $profile = array(); |
|
22 | 22 | private $network = array(); |
23 | 23 | |
24 | 24 | /** |
@@ -67,17 +67,17 @@ discard block |
||
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | - public function set_analytics_profile( $data = array() ){ |
|
70 | + public function set_analytics_profile( $data = array() ) { |
|
71 | 71 | update_option( 'monsterinsights_site_profile', $data ); |
72 | - $this->profile = $data; |
|
72 | + $this->profile = $data; |
|
73 | 73 | } |
74 | 74 | |
75 | - public function set_network_analytics_profile( $data = array() ){ |
|
75 | + public function set_network_analytics_profile( $data = array() ) { |
|
76 | 76 | update_site_option( 'monsterinsights_network_profile', $data ); |
77 | - $this->network = $data; |
|
77 | + $this->network = $data; |
|
78 | 78 | } |
79 | 79 | |
80 | - public function delete_analytics_profile( $migrate = true ){ |
|
80 | + public function delete_analytics_profile( $migrate = true ) { |
|
81 | 81 | if ( $migrate ) { |
82 | 82 | $newdata = array(); |
83 | 83 | if ( isset( $this->profile['ua'] ) ) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - public function delete_network_analytics_profile( $migrate = true ){ |
|
94 | + public function delete_network_analytics_profile( $migrate = true ) { |
|
95 | 95 | if ( $migrate ) { |
96 | 96 | $newdata = array(); |
97 | 97 | if ( isset( $this->network['ua'] ) ) { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | do_action( 'monsterinsights_reports_delete_aggregate_data' ); |
126 | 126 | |
127 | - $this->profile = $data; |
|
127 | + $this->profile = $data; |
|
128 | 128 | $this->set_analytics_profile( $data ); |
129 | 129 | } |
130 | 130 | |
@@ -181,55 +181,55 @@ discard block |
||
181 | 181 | return ! empty( $this->network['ua'] ) ? monsterinsights_is_valid_ua( $this->network['ua'] ) : ''; |
182 | 182 | } |
183 | 183 | |
184 | - public function get_viewname(){ |
|
184 | + public function get_viewname() { |
|
185 | 185 | return ! empty( $this->profile['viewname'] ) ? $this->profile['viewname'] : ''; |
186 | 186 | } |
187 | 187 | |
188 | - public function get_network_viewname(){ |
|
188 | + public function get_network_viewname() { |
|
189 | 189 | return ! empty( $this->network['viewname'] ) ? $this->network['viewname'] : ''; |
190 | 190 | } |
191 | 191 | |
192 | - public function get_accountid(){ |
|
192 | + public function get_accountid() { |
|
193 | 193 | return ! empty( $this->profile['a'] ) ? $this->profile['a'] : ''; |
194 | 194 | } |
195 | 195 | |
196 | - public function get_network_accountid(){ |
|
196 | + public function get_network_accountid() { |
|
197 | 197 | return ! empty( $this->network['a'] ) ? $this->network['a'] : ''; |
198 | 198 | } |
199 | 199 | |
200 | - public function get_propertyid(){ |
|
200 | + public function get_propertyid() { |
|
201 | 201 | return ! empty( $this->profile['w'] ) ? $this->profile['w'] : ''; |
202 | 202 | } |
203 | 203 | |
204 | - public function get_network_propertyid(){ |
|
204 | + public function get_network_propertyid() { |
|
205 | 205 | return ! empty( $this->network['w'] ) ? $this->network['w'] : ''; |
206 | 206 | } |
207 | 207 | |
208 | - public function get_viewid(){ // also known as profileID |
|
208 | + public function get_viewid() { // also known as profileID |
|
209 | 209 | return ! empty( $this->profile['p'] ) ? $this->profile['p'] : ''; |
210 | 210 | } |
211 | 211 | |
212 | - public function get_network_viewid(){ // also known as profileID |
|
212 | + public function get_network_viewid() { // also known as profileID |
|
213 | 213 | return ! empty( $this->network['p'] ) ? $this->network['p'] : ''; |
214 | 214 | } |
215 | 215 | |
216 | - public function get_key(){ |
|
216 | + public function get_key() { |
|
217 | 217 | return ! empty( $this->profile['key'] ) ? $this->profile['key'] : ''; |
218 | 218 | } |
219 | 219 | |
220 | - public function get_network_key(){ |
|
220 | + public function get_network_key() { |
|
221 | 221 | return ! empty( $this->network['key'] ) ? $this->network['key'] : ''; |
222 | 222 | } |
223 | 223 | |
224 | - public function get_token(){ |
|
224 | + public function get_token() { |
|
225 | 225 | return ! empty( $this->profile['token'] ) ? $this->profile['token'] : ''; |
226 | 226 | } |
227 | 227 | |
228 | - public function get_network_token(){ |
|
228 | + public function get_network_token() { |
|
229 | 229 | return ! empty( $this->network['token'] ) ? $this->network['token'] : ''; |
230 | 230 | } |
231 | 231 | |
232 | - public function get_referral_url(){ |
|
232 | + public function get_referral_url() { |
|
233 | 233 | $url = ''; |
234 | 234 | |
235 | 235 | if ( $this->is_authed() ) { |
@@ -67,17 +67,17 @@ discard block |
||
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | - public function set_analytics_profile( $data = array() ){ |
|
70 | + public function set_analytics_profile( $data = array() ) { |
|
71 | 71 | update_option( 'monsterinsights_site_profile', $data ); |
72 | 72 | $this->profile = $data; |
73 | 73 | } |
74 | 74 | |
75 | - public function set_network_analytics_profile( $data = array() ){ |
|
75 | + public function set_network_analytics_profile( $data = array() ) { |
|
76 | 76 | update_site_option( 'monsterinsights_network_profile', $data ); |
77 | 77 | $this->network = $data; |
78 | 78 | } |
79 | 79 | |
80 | - public function delete_analytics_profile( $migrate = true ){ |
|
80 | + public function delete_analytics_profile( $migrate = true ) { |
|
81 | 81 | if ( $migrate ) { |
82 | 82 | $newdata = array(); |
83 | 83 | if ( isset( $this->profile['ua'] ) ) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - public function delete_network_analytics_profile( $migrate = true ){ |
|
94 | + public function delete_network_analytics_profile( $migrate = true ) { |
|
95 | 95 | if ( $migrate ) { |
96 | 96 | $newdata = array(); |
97 | 97 | if ( isset( $this->network['ua'] ) ) { |
@@ -181,55 +181,57 @@ discard block |
||
181 | 181 | return ! empty( $this->network['ua'] ) ? monsterinsights_is_valid_ua( $this->network['ua'] ) : ''; |
182 | 182 | } |
183 | 183 | |
184 | - public function get_viewname(){ |
|
184 | + public function get_viewname() { |
|
185 | 185 | return ! empty( $this->profile['viewname'] ) ? $this->profile['viewname'] : ''; |
186 | 186 | } |
187 | 187 | |
188 | - public function get_network_viewname(){ |
|
188 | + public function get_network_viewname() { |
|
189 | 189 | return ! empty( $this->network['viewname'] ) ? $this->network['viewname'] : ''; |
190 | 190 | } |
191 | 191 | |
192 | - public function get_accountid(){ |
|
192 | + public function get_accountid() { |
|
193 | 193 | return ! empty( $this->profile['a'] ) ? $this->profile['a'] : ''; |
194 | 194 | } |
195 | 195 | |
196 | - public function get_network_accountid(){ |
|
196 | + public function get_network_accountid() { |
|
197 | 197 | return ! empty( $this->network['a'] ) ? $this->network['a'] : ''; |
198 | 198 | } |
199 | 199 | |
200 | - public function get_propertyid(){ |
|
200 | + public function get_propertyid() { |
|
201 | 201 | return ! empty( $this->profile['w'] ) ? $this->profile['w'] : ''; |
202 | 202 | } |
203 | 203 | |
204 | - public function get_network_propertyid(){ |
|
204 | + public function get_network_propertyid() { |
|
205 | 205 | return ! empty( $this->network['w'] ) ? $this->network['w'] : ''; |
206 | 206 | } |
207 | 207 | |
208 | - public function get_viewid(){ // also known as profileID |
|
208 | + public function get_viewid() { |
|
209 | +// also known as profileID |
|
209 | 210 | return ! empty( $this->profile['p'] ) ? $this->profile['p'] : ''; |
210 | 211 | } |
211 | 212 | |
212 | - public function get_network_viewid(){ // also known as profileID |
|
213 | + public function get_network_viewid() { |
|
214 | +// also known as profileID |
|
213 | 215 | return ! empty( $this->network['p'] ) ? $this->network['p'] : ''; |
214 | 216 | } |
215 | 217 | |
216 | - public function get_key(){ |
|
218 | + public function get_key() { |
|
217 | 219 | return ! empty( $this->profile['key'] ) ? $this->profile['key'] : ''; |
218 | 220 | } |
219 | 221 | |
220 | - public function get_network_key(){ |
|
222 | + public function get_network_key() { |
|
221 | 223 | return ! empty( $this->network['key'] ) ? $this->network['key'] : ''; |
222 | 224 | } |
223 | 225 | |
224 | - public function get_token(){ |
|
226 | + public function get_token() { |
|
225 | 227 | return ! empty( $this->profile['token'] ) ? $this->profile['token'] : ''; |
226 | 228 | } |
227 | 229 | |
228 | - public function get_network_token(){ |
|
230 | + public function get_network_token() { |
|
229 | 231 | return ! empty( $this->network['token'] ) ? $this->network['token'] : ''; |
230 | 232 | } |
231 | 233 | |
232 | - public function get_referral_url(){ |
|
234 | + public function get_referral_url() { |
|
233 | 235 | $url = ''; |
234 | 236 | |
235 | 237 | if ( $this->is_authed() ) { |
@@ -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 | } |
30 | 30 | \ No newline at end of file |
@@ -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 | } |
30 | 30 | \ No newline at end of file |