@@ -64,7 +64,9 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function send() |
66 | 66 | { |
67 | - if( !$this->message || !$this->subject || !$this->to )return; |
|
67 | + if( !$this->message || !$this->subject || !$this->to ) { |
|
68 | + return; |
|
69 | + } |
|
68 | 70 | $sent = wp_mail( |
69 | 71 | $this->to, |
70 | 72 | $this->subject, |
@@ -83,7 +85,9 @@ discard block |
||
83 | 85 | */ |
84 | 86 | public function buildPlainTextMessage( $phpmailer ) |
85 | 87 | { |
86 | - if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody ))return; |
|
88 | + if( $phpmailer->ContentType === 'text/plain' || !empty( $phpmailer->AltBody )) { |
|
89 | + return; |
|
90 | + } |
|
87 | 91 | $message = $this->stripHtmlTags( $phpmailer->Body ); |
88 | 92 | $phpmailer->AltBody = apply_filters( 'site-reviews/email/message', $message, 'text', $this ); |
89 | 93 | } |
@@ -74,7 +74,9 @@ discard block |
||
74 | 74 | foreach( $this->rules as $attribute => $rules ) { |
75 | 75 | foreach( $rules as $rule ) { |
76 | 76 | $this->validateAttribute( $attribute, $rule ); |
77 | - if( $this->shouldStopValidating( $attribute ))break; |
|
77 | + if( $this->shouldStopValidating( $attribute )) { |
|
78 | + break; |
|
79 | + } |
|
78 | 80 | } |
79 | 81 | } |
80 | 82 | return $this->errors; |
@@ -90,7 +92,9 @@ discard block |
||
90 | 92 | public function validateAttribute( $attribute, $rule ) |
91 | 93 | { |
92 | 94 | list( $rule, $parameters ) = $this->parseRule( $rule ); |
93 | - if( $rule == '' )return; |
|
95 | + if( $rule == '' ) { |
|
96 | + return; |
|
97 | + } |
|
94 | 98 | $value = $this->getValue( $attribute ); |
95 | 99 | $this->validateRequired( $attribute, $value ) || in_array( $rule, $this->implicitRules ); |
96 | 100 | if( !method_exists( $this, $method = 'validate'.$rule )) { |
@@ -163,7 +167,9 @@ discard block |
||
163 | 167 | */ |
164 | 168 | protected function getRule( $attribute, $rules ) |
165 | 169 | { |
166 | - if( !array_key_exists( $attribute, $this->rules ))return; |
|
170 | + if( !array_key_exists( $attribute, $this->rules )) { |
|
171 | + return; |
|
172 | + } |
|
167 | 173 | $rules = (array) $rules; |
168 | 174 | foreach( $this->rules[$attribute] as $rule ) { |
169 | 175 | list( $rule, $parameters ) = $this->parseRule( $rule ); |
@@ -314,7 +320,9 @@ discard block |
||
314 | 320 | $message = isset( $strings[$key] ) |
315 | 321 | ? $strings[$key] |
316 | 322 | : false; |
317 | - if( !$message )return; |
|
323 | + if( !$message ) { |
|
324 | + return; |
|
325 | + } |
|
318 | 326 | $message = str_replace( ':attribute', $attribute, $message ); |
319 | 327 | if( method_exists( $this, $replacer = 'replace'.$rule )) { |
320 | 328 | $message = $this->$replacer( $message, $parameters ); |
@@ -16,7 +16,9 @@ discard block |
||
16 | 16 | natsort( $routines ); |
17 | 17 | array_walk( $routines, function( $routine ) { |
18 | 18 | $version = str_replace( strtolower( __CLASS__ ).'_', '', $routine ); |
19 | - if( version_compare( glsr()->version, $version, '>=' ))return; |
|
19 | + if( version_compare( glsr()->version, $version, '>=' )) { |
|
20 | + return; |
|
21 | + } |
|
20 | 22 | call_user_func( [$this, $routine] ); |
21 | 23 | }); |
22 | 24 | $this->updateVersion(); |
@@ -37,5 +39,6 @@ discard block |
||
37 | 39 | } |
38 | 40 | |
39 | 41 | protected function upgrade_3_0_0() |
40 | - {} |
|
42 | + { |
|
43 | +} |
|
41 | 44 | } |
@@ -91,7 +91,9 @@ discard block |
||
91 | 91 | ]; |
92 | 92 | if( !isset( $properties[$property] ) |
93 | 93 | || empty( array_filter( [$value], $properties[$property] )) |
94 | - )return; |
|
94 | + ) { |
|
95 | + return; |
|
96 | + } |
|
95 | 97 | $this->$property = $value; |
96 | 98 | } |
97 | 99 | |
@@ -188,7 +190,9 @@ discard block |
||
188 | 190 | */ |
189 | 191 | protected function buildFormLabel() |
190 | 192 | { |
191 | - if( empty( $this->args['label'] ) || $this->args['type'] == 'hidden' )return; |
|
193 | + if( empty( $this->args['label'] ) || $this->args['type'] == 'hidden' ) { |
|
194 | + return; |
|
195 | + } |
|
192 | 196 | return $this->label([ |
193 | 197 | 'for' => $this->args['id'], |
194 | 198 | 'text' => $this->args['label'], |
@@ -190,7 +190,9 @@ |
||
190 | 190 | if( $index === false |
191 | 191 | || !isset( $caller[$index+2]['class'] ) |
192 | 192 | || !isset( $caller[$index+2]['function'] ) |
193 | - )return; |
|
193 | + ) { |
|
194 | + return; |
|
195 | + } |
|
194 | 196 | return sprintf( '[%s()->%s:%s] ', |
195 | 197 | $caller[$index+2]['class'], |
196 | 198 | $caller[$index+2]['function'], |
@@ -161,7 +161,9 @@ discard block |
||
161 | 161 | if( !empty( $sessions )) { |
162 | 162 | $now = time(); |
163 | 163 | foreach( $sessions as $session ) { |
164 | - if( $now <= $session->expiration )continue; |
|
164 | + if( $now <= $session->expiration ) { |
|
165 | + continue; |
|
166 | + } |
|
165 | 167 | $expiredSessions[] = $session->name; |
166 | 168 | $expiredSessions[] = str_replace( '_expires_', '_', $session->name ); |
167 | 169 | } |
@@ -204,7 +206,9 @@ discard block |
||
204 | 206 | */ |
205 | 207 | protected function setCookie() |
206 | 208 | { |
207 | - if( headers_sent() )return; |
|
209 | + if( headers_sent() ) { |
|
210 | + return; |
|
211 | + } |
|
208 | 212 | $cookie = $this->sessionId.'||'.$this->expiryTimestamp.'||'.$this->expiryTimestampReset; |
209 | 213 | $cookiePath = preg_replace( '|https?://[^/]+|i', '', trailingslashit( get_option( 'home' ))); |
210 | 214 | setcookie( static::SESSION_COOKIE, $cookie, $this->expiryTimestamp, $cookiePath ); |
@@ -17,7 +17,9 @@ |
||
17 | 17 | $ipAddresses = array_fill_keys( ['v4', 'v6'], [] ); |
18 | 18 | foreach( array_keys( $ipAddresses ) as $version ) { |
19 | 19 | $response = wp_remote_get( 'https://www.cloudflare.com/ips-'.$version ); |
20 | - if( is_wp_error( $response ))continue; |
|
20 | + if( is_wp_error( $response )) { |
|
21 | + continue; |
|
22 | + } |
|
21 | 23 | $ipAddresses[$version] = array_filter( explode( PHP_EOL, wp_remote_retrieve_body( $response ))); |
22 | 24 | } |
23 | 25 | wp_cache_set( Application::ID, $ipAddresses, '_cloudflare_ips' ); |
@@ -87,7 +87,9 @@ |
||
87 | 87 | */ |
88 | 88 | public function deactivate( $plugin ) |
89 | 89 | { |
90 | - if( static::isValid() )return; |
|
90 | + if( static::isValid() ) { |
|
91 | + return; |
|
92 | + } |
|
91 | 93 | $pluginSlug = plugin_basename( static::$file ); |
92 | 94 | if( $plugin == $pluginSlug ) { |
93 | 95 | $this->redirect(); //exit |