Passed
Push — master ( 8161cf...b8b7ed )
by Chris
04:50
created
includes/admin/api-auth.php 1 patch
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 		add_action( 'wp_ajax_nopriv_monsterinsights_rauthenticate',   array( $this, 'authenticate' ) );
41 41
 	}
42 42
 
43
-	public function get_tt(){
43
+	public function get_tt() {
44 44
 		$tt = is_network_admin() ? get_site_option( 'monsterinsights_network_tt', '' ) : get_option( 'monsterinsights_site_tt', '' );
45 45
 		if ( empty( $tt ) ) {
46 46
 			// if TT is empty, generate a new one, save it and then return it
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 		return $tt;
51 51
 	}
52 52
 
53
-	public function rotate_tt(){
53
+	public function rotate_tt() {
54 54
 		$tt = $this->generate_tt();
55 55
 		is_network_admin() ? update_site_option( 'monsterinsights_network_tt', $tt ) : update_option( 'monsterinsights_site_tt', $tt );
56 56
 	}
57 57
 
58
-	public function generate_tt(){
58
+	public function generate_tt() {
59 59
 		return hash( 'sha512', wp_generate_password( 128, true, true ) . AUTH_SALT . uniqid( "", true ) );
60 60
 	}
61 61
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 		);
74 74
 	}
75 75
 
76
-	public function maybe_authenticate(){
76
+	public function maybe_authenticate() {
77 77
 
78 78
 		// Check nonce
79 79
 		check_ajax_referer( 'mi-admin-nonce', 'nonce' );
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 		wp_send_json_success();
205 205
 	}
206 206
 
207
-	public function authenticate_listener(){
207
+	public function authenticate_listener() {
208 208
 		// Make sure it's for us
209 209
 		if ( empty( $_REQUEST['mi-oauth-action'] ) || $_REQUEST['mi-oauth-action'] !== 'auth' ) {
210 210
 			return;
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 		exit;
275 275
 	}
276 276
 
277
-	public function maybe_reauthenticate(){
277
+	public function maybe_reauthenticate() {
278 278
 
279 279
 		// Check nonce
280 280
 		check_ajax_referer( 'mi-admin-nonce', 'nonce' );
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		wp_send_json_success( array( 'redirect' => $siteurl ) );
324 324
 	}
325 325
 
326
-	public function reauthenticate_listener(){
326
+	public function reauthenticate_listener() {
327 327
 		// Make sure it's for us
328 328
 		if ( empty( $_REQUEST['mi-oauth-action'] ) || $_REQUEST['mi-oauth-action'] !== 'reauth' ) {
329 329
 			return;
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 		exit;
394 394
 	}
395 395
 
396
-	public function maybe_verify(){
396
+	public function maybe_verify() {
397 397
 
398 398
 		// Check nonce
399 399
 		check_ajax_referer( 'mi-admin-nonce', 'nonce' );
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 		}
428 428
 	}
429 429
 
430
-	public function verify_auth( $credentials = array() ){
430
+	public function verify_auth( $credentials = array() ) {
431 431
 		$creds = ! empty( $credentials ) ? $credentials : ( $this->is_network_admin() ? MonsterInsights()->auth->get_network_analytics_profile( true ) : MonsterInsights()->auth->get_analytics_profile( true ) );
432 432
 
433 433
 		if ( empty( $creds['key'] ) ) {
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 		}
445 445
 	}
446 446
 
447
-	public function maybe_delete(){
447
+	public function maybe_delete() {
448 448
 
449 449
 		// Check nonce
450 450
 		check_ajax_referer( 'mi-admin-nonce', 'nonce' );
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 		}
485 485
 	}
486 486
 
487
-	public function delete_auth( $force = false ){
487
+	public function delete_auth( $force = false ) {
488 488
 		if ( $this->is_network_admin() && ! MonsterInsights()->auth->is_network_authed() ) {
489 489
 			return false;
490 490
 		} else if ( ! $this->is_network_admin() && ! MonsterInsights()->auth->is_authed() ) {
Please login to merge, or discard this patch.