@@ -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 | } |
@@ -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 |
@@ -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 | } |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | $data['usagetracking'] = get_option( 'monsterinsights_usage_tracking_config', false ); |
95 | 95 | $data['usercount'] = function_exists( 'get_user_count' ) ? get_user_count() : 'Not Set'; |
96 | 96 | $data['usesauth'] = $usesauth; |
97 | - $data['timezoneoffset']= date('P'); |
|
98 | - $data['installed_lite']= get_option( 'monsterinsights_installed_lite', array() ); |
|
97 | + $data['timezoneoffset'] = date( 'P' ); |
|
98 | + $data['installed_lite'] = get_option( 'monsterinsights_installed_lite', array() ); |
|
99 | 99 | $data['installed_pro'] = get_option( 'monsterinsights_installed_pro', array() ); |
100 | 100 | |
101 | 101 | |
102 | 102 | |
103 | 103 | // Retrieve current plugin information |
104 | - if( ! function_exists( 'get_plugins' ) ) { |
|
104 | + if ( ! function_exists( 'get_plugins' ) ) { |
|
105 | 105 | include ABSPATH . '/wp-admin/includes/plugin.php'; |
106 | 106 | } |
107 | 107 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | foreach ( $plugins as $key => $plugin ) { |
112 | 112 | if ( in_array( $plugin, $active_plugins ) ) { |
113 | 113 | // Remove active plugins from list so we can show active and inactive separately |
114 | - unset( $plugins[ $key ] ); |
|
114 | + unset( $plugins[$key] ); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | |
132 | - if( ! $this->tracking_allowed() && ! $override ) { |
|
132 | + if ( ! $this->tracking_allowed() && ! $override ) { |
|
133 | 133 | return false; |
134 | 134 | } |
135 | 135 | |
@@ -161,15 +161,15 @@ discard block |
||
161 | 161 | public function schedule_send() { |
162 | 162 | if ( ! wp_next_scheduled( 'monsterinsights_usage_tracking_cron' ) ) { |
163 | 163 | $tracking = array(); |
164 | - $tracking['day'] = rand( 0, 6 ); |
|
164 | + $tracking['day'] = rand( 0, 6 ); |
|
165 | 165 | $tracking['hour'] = rand( 0, 23 ); |
166 | 166 | $tracking['minute'] = rand( 0, 59 ); |
167 | 167 | $tracking['second'] = rand( 0, 59 ); |
168 | - $tracking['offset'] = ( $tracking['day'] * DAY_IN_SECONDS ) + |
|
169 | - ( $tracking['hour'] * HOUR_IN_SECONDS ) + |
|
168 | + $tracking['offset'] = ( $tracking['day'] * DAY_IN_SECONDS ) + |
|
169 | + ( $tracking['hour'] * HOUR_IN_SECONDS ) + |
|
170 | 170 | ( $tracking['minute'] * MINUTE_IN_SECONDS ) + |
171 | 171 | $tracking['second']; |
172 | - $tracking['initsend'] = strtotime("next sunday") + $tracking['offset']; |
|
172 | + $tracking['initsend'] = strtotime( "next sunday" ) + $tracking['offset']; |
|
173 | 173 | |
174 | 174 | wp_schedule_event( $tracking['initsend'], 'weekly', 'monsterinsights_usage_tracking_cron' ); |
175 | 175 | update_option( 'monsterinsights_usage_tracking_config', $tracking ); |
@@ -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 | } |
@@ -52,7 +52,8 @@ |
||
52 | 52 | // Check for wizard-specific parameter |
53 | 53 | // Allow plugins to disable the onboarding wizard |
54 | 54 | // Check if current user is allowed to save settings. |
55 | - if ( ! ( isset( $_GET['page'] ) || 'monsterinsights-onboarding' !== $_GET['page'] || apply_filters( 'monsterinsights_enable_onboarding_wizard', true ) || ! current_user_can( 'monsterinsights_save_settings' ) ) ) { // WPCS: CSRF ok, input var ok. |
|
55 | + if ( ! ( isset( $_GET['page'] ) || 'monsterinsights-onboarding' !== $_GET['page'] || apply_filters( 'monsterinsights_enable_onboarding_wizard', true ) || ! current_user_can( 'monsterinsights_save_settings' ) ) ) { |
|
56 | +// WPCS: CSRF ok, input var ok. |
|
56 | 57 | return; |
57 | 58 | } |
58 | 59 |