@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | function monsterinsights_get_option( $key = '', $default = false ) { |
| 51 | 51 | global $monsterinsights_settings; |
| 52 | - $value = ! empty( $monsterinsights_settings[ $key ] ) ? $monsterinsights_settings[ $key ] : $default; |
|
| 52 | + $value = ! empty( $monsterinsights_settings[$key] ) ? $monsterinsights_settings[$key] : $default; |
|
| 53 | 53 | $value = apply_filters( 'monsterinsights_get_option', $value, $key, $default ); |
| 54 | 54 | |
| 55 | 55 | return apply_filters( 'monsterinsights_get_option_' . $key, $value, $key, $default ); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $value = apply_filters( 'monsterinsights_update_option', $value, $key ); |
| 190 | 190 | |
| 191 | 191 | // Next let's try to update the value |
| 192 | - $settings[ $key ] = $value; |
|
| 192 | + $settings[$key] = $value; |
|
| 193 | 193 | $did_update = false; |
| 194 | 194 | //if ( $update_network_option ) { |
| 195 | 195 | // $did_update = update_site_option( $option_name, $settings ); |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | // If it updated, let's update the global variable |
| 201 | 201 | if ( $did_update ) { |
| 202 | 202 | global $monsterinsights_settings; |
| 203 | - $monsterinsights_settings[ $key ] = $value; |
|
| 203 | + $monsterinsights_settings[$key] = $value; |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | return $did_update; |
@@ -237,8 +237,8 @@ discard block |
||
| 237 | 237 | //} |
| 238 | 238 | |
| 239 | 239 | // Next let's try to remove the key |
| 240 | - if ( isset( $settings[ $key ] ) ) { |
|
| 241 | - unset( $settings[ $key ] ); |
|
| 240 | + if ( isset( $settings[$key] ) ) { |
|
| 241 | + unset( $settings[$key] ); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | $did_update = false; |
@@ -289,8 +289,8 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | // Next let's try to remove the keys |
| 291 | 291 | foreach ( $keys as $key ) { |
| 292 | - if ( isset( $settings[ $key ] ) ) { |
|
| 293 | - unset( $settings[ $key ] ); |
|
| 292 | + if ( isset( $settings[$key] ) ) { |
|
| 293 | + unset( $settings[$key] ); |
|
| 294 | 294 | } |
| 295 | 295 | } |
| 296 | 296 | |
@@ -415,8 +415,8 @@ discard block |
||
| 415 | 415 | ); |
| 416 | 416 | |
| 417 | 417 | foreach ( $exclude as $e ) { |
| 418 | - if ( ! empty( $settings[ $e ] ) ) { |
|
| 419 | - unset( $settings[ $e ] ); |
|
| 418 | + if ( ! empty( $settings[$e] ) ) { |
|
| 419 | + unset( $settings[$e] ); |
|
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | 422 | |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $json_data = $this->get_json_data(); |
| 15 | 15 | |
| 16 | - if (empty($json_data)) { |
|
| 16 | + if ( empty( $json_data ) ) { |
|
| 17 | 17 | return false; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | protected function get_options() { |
| 26 | - if (empty($this->data['devices'])) { |
|
| 26 | + if ( empty( $this->data['devices'] ) ) { |
|
| 27 | 27 | return false; |
| 28 | 28 | } |
| 29 | 29 | |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $json_data = $this->get_json_data(); |
| 15 | 15 | |
| 16 | 16 | if (empty($json_data)) { |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $value = $this->get_options(); |
| 15 | 15 | |
| 16 | - if ( empty($value) ) { |
|
| 16 | + if ( empty( $value ) ) { |
|
| 17 | 17 | return null; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @return array|false |
| 36 | 36 | */ |
| 37 | 37 | protected function get_options() { |
| 38 | - if ( !isset($this->data['scroll']) || empty($this->data['scroll']['average'])) { |
|
| 38 | + if ( ! isset( $this->data['scroll'] ) || empty( $this->data['scroll']['average'] ) ) { |
|
| 39 | 39 | return false; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $value = $this->get_options(); |
| 15 | 15 | |
| 16 | 16 | if ( empty($value) ) { |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $data = $this->get_options(); |
| 15 | 15 | |
| 16 | - if (empty($data)) { |
|
| 16 | + if ( empty( $data ) ) { |
|
| 17 | 17 | return false; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @return array|false |
| 35 | 35 | */ |
| 36 | 36 | protected function get_options() { |
| 37 | - if ( empty($this->data['interest'])) { |
|
| 37 | + if ( empty( $this->data['interest'] ) ) { |
|
| 38 | 38 | return false; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $rows = array(); |
| 47 | 47 | |
| 48 | - foreach ($data as $key => $item) { |
|
| 48 | + foreach ( $data as $key => $item ) { |
|
| 49 | 49 | $rows[$key] = array( |
| 50 | 50 | $item['interest'], |
| 51 | 51 | $item['percent'] . '%' |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $data = $this->get_options(); |
| 15 | 15 | |
| 16 | 16 | if (empty($data)) { |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $data = $this->get_options(); |
| 15 | 15 | |
| 16 | - if (empty($data)) { |
|
| 16 | + if ( empty( $data ) ) { |
|
| 17 | 17 | return false; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @return array|false |
| 35 | 35 | */ |
| 36 | 36 | protected function get_options() { |
| 37 | - if ( empty($this->data['countries'])) { |
|
| 37 | + if ( empty( $this->data['countries'] ) ) { |
|
| 38 | 38 | return false; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $rows = array(); |
| 47 | 47 | |
| 48 | - foreach ($data as $key => $country) { |
|
| 48 | + foreach ( $data as $key => $country ) { |
|
| 49 | 49 | $rows[$key] = array( $country['name'], $country['sessions'] ); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $data = $this->get_options(); |
| 15 | 15 | |
| 16 | 16 | if (empty($data)) { |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $data = $this->get_options(); |
| 15 | 15 | |
| 16 | - if (empty($data)) { |
|
| 16 | + if ( empty( $data ) ) { |
|
| 17 | 17 | return false; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | $left = $this->get_card_template( |
| 26 | 26 | 'left', |
| 27 | - __('Sessions', 'google-analytics-for-wordpress'), |
|
| 27 | + __( 'Sessions', 'google-analytics-for-wordpress' ), |
|
| 28 | 28 | $sessions, |
| 29 | 29 | $prev_sessions, |
| 30 | 30 | __( 'vs. Previous 30 days', 'google-analytics-for-wordpress' ), |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $right = $this->get_card_template( |
| 35 | 35 | 'right', |
| 36 | - __('Pageviews', 'google-analytics-for-wordpress'), |
|
| 36 | + __( 'Pageviews', 'google-analytics-for-wordpress' ), |
|
| 37 | 37 | $pageviews, |
| 38 | 38 | $prev_pageviews, |
| 39 | 39 | __( 'vs. Previous 30 days', 'google-analytics-for-wordpress' ), |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @return array|false |
| 53 | 53 | */ |
| 54 | 54 | protected function get_options() { |
| 55 | - if ( empty($this->data['infobox'])) { |
|
| 55 | + if ( empty( $this->data['infobox'] ) ) { |
|
| 56 | 56 | return false; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $data = $this->get_options(); |
| 15 | 15 | |
| 16 | 16 | if (empty($data)) { |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $json_data = $this->get_json_data(); |
| 15 | 15 | |
| 16 | - if (empty($json_data)) { |
|
| 16 | + if ( empty( $json_data ) ) { |
|
| 17 | 17 | return false; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | protected function get_options() { |
| 26 | - if (empty($this->data['newvsreturn'])) { |
|
| 26 | + if ( empty( $this->data['newvsreturn'] ) ) { |
|
| 27 | 27 | return false; |
| 28 | 28 | } |
| 29 | 29 | |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $json_data = $this->get_json_data(); |
| 15 | 15 | |
| 16 | 16 | if (empty($json_data)) { |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $data = $this->get_options(); |
| 15 | 15 | |
| 16 | - if (empty($data)) { |
|
| 16 | + if ( empty( $data ) ) { |
|
| 17 | 17 | return false; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @return array|false |
| 35 | 35 | */ |
| 36 | 36 | protected function get_options() { |
| 37 | - if (empty($this->data['age'])) { |
|
| 37 | + if ( empty( $this->data['age'] ) ) { |
|
| 38 | 38 | return false; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $rows = array(); |
| 47 | 47 | |
| 48 | - foreach ($data as $key => $item) { |
|
| 48 | + foreach ( $data as $key => $item ) { |
|
| 49 | 49 | $rows[$key] = array( |
| 50 | 50 | $item['age'], |
| 51 | 51 | $item['sessions'], |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $data = $this->get_options(); |
| 15 | 15 | |
| 16 | 16 | if (empty($data)) { |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $data = $this->get_options(); |
| 15 | 15 | |
| 16 | - if (empty($data)) { |
|
| 16 | + if ( empty( $data ) ) { |
|
| 17 | 17 | return false; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | $left = $this->get_card_template( |
| 26 | 26 | 'left', |
| 27 | - __('Avg. Session Duration', 'google-analytics-for-wordpress'), |
|
| 27 | + __( 'Avg. Session Duration', 'google-analytics-for-wordpress' ), |
|
| 28 | 28 | $duration, |
| 29 | 29 | $prev_duration, |
| 30 | 30 | __( 'vs. Previous 30 days', 'google-analytics-for-wordpress' ), |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $right = $this->get_card_template( |
| 35 | 35 | 'right', |
| 36 | - __('Bounce Rate', 'google-analytics-for-wordpress'), |
|
| 36 | + __( 'Bounce Rate', 'google-analytics-for-wordpress' ), |
|
| 37 | 37 | $bounce_rate, |
| 38 | 38 | $prev_bounce_rate, |
| 39 | 39 | __( 'vs. Previous 30 days', 'google-analytics-for-wordpress' ), |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @return array|false |
| 53 | 53 | */ |
| 54 | 54 | protected function get_options() { |
| 55 | - if ( empty($this->data['infobox'])) { |
|
| 55 | + if ( empty( $this->data['infobox'] ) ) { |
|
| 56 | 56 | return false; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | protected $type = 'scorecard'; |
| 12 | 12 | |
| 13 | - public function output(){ |
|
| 13 | + public function output() { |
|
| 14 | 14 | $data = $this->get_options(); |
| 15 | 15 | |
| 16 | 16 | if (empty($data)) { |