@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | add_filter( 'monsterinsights_maybe_authenticate_siteurl', array( $this, 'before_redirect' ) ); |
43 | 43 | } |
44 | 44 | |
45 | - public function get_tt(){ |
|
45 | + public function get_tt() { |
|
46 | 46 | $tt = is_network_admin() ? get_site_option( 'monsterinsights_network_tt', '' ) : get_option( 'monsterinsights_site_tt', '' ); |
47 | 47 | if ( empty( $tt ) ) { |
48 | 48 | // if TT is empty, generate a new one, save it and then return it |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | return $tt; |
53 | 53 | } |
54 | 54 | |
55 | - public function rotate_tt(){ |
|
55 | + public function rotate_tt() { |
|
56 | 56 | $tt = $this->generate_tt(); |
57 | 57 | is_network_admin() ? update_site_option( 'monsterinsights_network_tt', $tt ) : update_option( 'monsterinsights_site_tt', $tt ); |
58 | 58 | } |
59 | 59 | |
60 | - public function generate_tt(){ |
|
60 | + public function generate_tt() { |
|
61 | 61 | return hash( 'sha512', wp_generate_password( 128, true, true ) . AUTH_SALT . uniqid( "", true ) ); |
62 | 62 | } |
63 | 63 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | ); |
76 | 76 | } |
77 | 77 | |
78 | - public function maybe_authenticate(){ |
|
78 | + public function maybe_authenticate() { |
|
79 | 79 | |
80 | 80 | // Check nonce |
81 | 81 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | wp_send_json_success(); |
161 | 161 | } |
162 | 162 | |
163 | - public function authenticate_listener(){ |
|
163 | + public function authenticate_listener() { |
|
164 | 164 | // Make sure it's for us |
165 | 165 | if ( empty( $_REQUEST['mi-oauth-action'] ) || $_REQUEST['mi-oauth-action'] !== 'auth' ) { |
166 | 166 | return; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | exit; |
229 | 229 | } |
230 | 230 | |
231 | - public function maybe_reauthenticate(){ |
|
231 | + public function maybe_reauthenticate() { |
|
232 | 232 | |
233 | 233 | // Check nonce |
234 | 234 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | wp_send_json_success( array( 'redirect' => $siteurl ) ); |
279 | 279 | } |
280 | 280 | |
281 | - public function reauthenticate_listener(){ |
|
281 | + public function reauthenticate_listener() { |
|
282 | 282 | // Make sure it's for us |
283 | 283 | if ( empty( $_REQUEST['mi-oauth-action'] ) || $_REQUEST['mi-oauth-action'] !== 'reauth' ) { |
284 | 284 | return; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | exit; |
348 | 348 | } |
349 | 349 | |
350 | - public function maybe_verify(){ |
|
350 | + public function maybe_verify() { |
|
351 | 351 | |
352 | 352 | // Check nonce |
353 | 353 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | } |
382 | 382 | } |
383 | 383 | |
384 | - public function verify_auth( $credentials = array() ){ |
|
384 | + public function verify_auth( $credentials = array() ) { |
|
385 | 385 | $creds = ! empty( $credentials ) ? $credentials : ( $this->is_network_admin() ? MonsterInsights()->auth->get_network_analytics_profile( true ) : MonsterInsights()->auth->get_analytics_profile( true ) ); |
386 | 386 | |
387 | 387 | if ( empty( $creds['key'] ) ) { |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | } |
401 | 401 | } |
402 | 402 | |
403 | - public function maybe_delete(){ |
|
403 | + public function maybe_delete() { |
|
404 | 404 | |
405 | 405 | // Check nonce |
406 | 406 | check_ajax_referer( 'mi-admin-nonce', 'nonce' ); |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | } |
441 | 441 | } |
442 | 442 | |
443 | - public function delete_auth( $force = false ){ |
|
443 | + public function delete_auth( $force = false ) { |
|
444 | 444 | if ( $this->is_network_admin() && ! MonsterInsights()->auth->is_network_authed() ) { |
445 | 445 | return false; |
446 | 446 | } else if ( ! $this->is_network_admin() && ! MonsterInsights()->auth->is_authed() ) { |
@@ -40,7 +40,8 @@ |
||
40 | 40 | // Load the Upgrade functions. |
41 | 41 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'lite/includes/admin/upgrade.php'; |
42 | 42 | |
43 | - if ( isset( $_GET['page'] ) && 'monsterinsights-onboarding' === $_GET['page'] ) { // WPCS: CSRF ok, input var ok. |
|
43 | + if ( isset( $_GET['page'] ) && 'monsterinsights-onboarding' === $_GET['page'] ) { |
|
44 | +// WPCS: CSRF ok, input var ok. |
|
44 | 45 | // Only load the Onboarding wizard if the required parameter is present. |
45 | 46 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'lite/includes/admin/onboarding-wizard.php'; |
46 | 47 | } |