@@ -37,7 +37,9 @@ |
||
| 37 | 37 | $lines = explode( "\n", $blacklist ); |
| 38 | 38 | foreach( (array) $lines as $line ) { |
| 39 | 39 | $line = trim( $line ); |
| 40 | - if( empty( $line ) || 256 < strlen( $line ))continue; |
|
| 40 | + if( empty( $line ) || 256 < strlen( $line )) { |
|
| 41 | + continue; |
|
| 42 | + } |
|
| 41 | 43 | $pattern = sprintf( '#%s#i', preg_quote( $line, '#' )); |
| 42 | 44 | if( preg_match( $pattern, $target )) { |
| 43 | 45 | return true; |
@@ -15,7 +15,9 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | public function add( $type, $message, array $args = [] ) |
| 17 | 17 | { |
| 18 | - if( empty( array_filter( [$message, $type] )))return; |
|
| 18 | + if( empty( array_filter( [$message, $type] ))) { |
|
| 19 | + return; |
|
| 20 | + } |
|
| 19 | 21 | $args['message'] = $message; |
| 20 | 22 | $args['type'] = $type; |
| 21 | 23 | add_settings_error( Application::ID, '', json_encode( $this->normalize( $args ))); |
@@ -56,7 +58,9 @@ discard block |
||
| 56 | 58 | $notices = array_map( 'unserialize', |
| 57 | 59 | array_unique( array_map( 'serialize', get_settings_errors( Application::ID ))) |
| 58 | 60 | ); |
| 59 | - if( empty( $notices ))return; |
|
| 61 | + if( empty( $notices )) { |
|
| 62 | + return; |
|
| 63 | + } |
|
| 60 | 64 | return array_reduce( $notices, function( $carry, $notice ) { |
| 61 | 65 | return $carry.$this->buildNotice( json_decode( $notice['message'], true )); |
| 62 | 66 | }); |
@@ -30,7 +30,9 @@ discard block |
||
| 30 | 30 | // 'is_test' => 1, |
| 31 | 31 | ]; |
| 32 | 32 | foreach( $_SERVER as $key => $value ) { |
| 33 | - if( is_array( $value ) || in_array( $key, ['HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW'] ))continue; |
|
| 33 | + if( is_array( $value ) || in_array( $key, ['HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW'] )) { |
|
| 34 | + continue; |
|
| 35 | + } |
|
| 34 | 36 | $submission[$key] = $value; |
| 35 | 37 | } |
| 36 | 38 | return $this->check( apply_filters( 'site-reviews/akismet/submission', $submission, $review )); |
@@ -56,12 +58,16 @@ discard block |
||
| 56 | 58 | { |
| 57 | 59 | $query = []; |
| 58 | 60 | foreach( $data as $key => $value ) { |
| 59 | - if( is_array( $value ) || is_object( $value ))continue; |
|
| 61 | + if( is_array( $value ) || is_object( $value )) { |
|
| 62 | + continue; |
|
| 63 | + } |
|
| 60 | 64 | if( $value === false ) { |
| 61 | 65 | $value = '0'; |
| 62 | 66 | } |
| 63 | 67 | $value = trim( $value ); |
| 64 | - if( !strlen( $value ))continue; |
|
| 68 | + if( !strlen( $value )) { |
|
| 69 | + continue; |
|
| 70 | + } |
|
| 65 | 71 | $query[] = urlencode( $key ).'='.urlencode( $value ); |
| 66 | 72 | } |
| 67 | 73 | return implode( '&', $query ); |
@@ -63,7 +63,9 @@ discard block |
||
| 63 | 63 | $counts = array_fill_keys( [5,4,3,2,1], [] ); |
| 64 | 64 | array_walk( $counts, function( &$count, $key ) use( $reviews ) { |
| 65 | 65 | $count = count( array_filter( $reviews, function( $review ) use( $key ) { |
| 66 | - if( !isset( $review->rating ))return; |
|
| 66 | + if( !isset( $review->rating )) { |
|
| 67 | + return; |
|
| 68 | + } |
|
| 67 | 69 | return $review->rating == $key; |
| 68 | 70 | })); |
| 69 | 71 | }); |
@@ -83,7 +85,9 @@ discard block |
||
| 83 | 85 | public function getLowerBound( array $upDownRatings, $confidencePercentage = 95 ) |
| 84 | 86 | { |
| 85 | 87 | $numRatings = count( $upDownRatings ); |
| 86 | - if( !$numRatings )return 0; |
|
| 88 | + if( !$numRatings ) { |
|
| 89 | + return 0; |
|
| 90 | + } |
|
| 87 | 91 | $positiveRatings = count( array_filter( $upDownRatings, function( $value ) { |
| 88 | 92 | return $value > 0; |
| 89 | 93 | })); |
@@ -16,9 +16,13 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | $queries = []; |
| 18 | 18 | foreach( $keys as $key ) { |
| 19 | - if( !array_key_exists( $key, $values ))continue; |
|
| 19 | + if( !array_key_exists( $key, $values )) { |
|
| 20 | + continue; |
|
| 21 | + } |
|
| 20 | 22 | $methodName = glsr( Helper::class )->buildMethodName( $key, $prefix = __METHOD__ ); |
| 21 | - if( !method_exists( $this, $methodName ))continue; |
|
| 23 | + if( !method_exists( $this, $methodName )) { |
|
| 24 | + continue; |
|
| 25 | + } |
|
| 22 | 26 | $query = call_user_func( [$this, $methodName], $values[$key] ); |
| 23 | 27 | if( is_array( $query )) { |
| 24 | 28 | $queries[] = $query; |
@@ -90,7 +94,9 @@ discard block |
||
| 90 | 94 | */ |
| 91 | 95 | protected function buildQueryAssignedTo( $value ) |
| 92 | 96 | { |
| 93 | - if( empty( $value ))return; |
|
| 97 | + if( empty( $value )) { |
|
| 98 | + return; |
|
| 99 | + } |
|
| 94 | 100 | return [ |
| 95 | 101 | 'compare' => 'IN', |
| 96 | 102 | 'key' => 'assigned_to', |
@@ -104,7 +110,9 @@ discard block |
||
| 104 | 110 | */ |
| 105 | 111 | protected function buildQueryCategory( $value ) |
| 106 | 112 | { |
| 107 | - if( empty( $value ))return; |
|
| 113 | + if( empty( $value )) { |
|
| 114 | + return; |
|
| 115 | + } |
|
| 108 | 116 | return [ |
| 109 | 117 | 'field' => 'term_id', |
| 110 | 118 | 'taxonomy' => Application::TAXONOMY, |
@@ -118,7 +126,9 @@ discard block |
||
| 118 | 126 | */ |
| 119 | 127 | protected function buildQueryRating( $value ) |
| 120 | 128 | { |
| 121 | - if( !is_numeric( $value ) || !in_array( intval( $value ), range( 1, 5 )))return; |
|
| 129 | + if( !is_numeric( $value ) || !in_array( intval( $value ), range( 1, 5 ))) { |
|
| 130 | + return; |
|
| 131 | + } |
|
| 122 | 132 | return [ |
| 123 | 133 | 'compare' => '>=', |
| 124 | 134 | 'key' => 'rating', |
@@ -132,7 +142,9 @@ discard block |
||
| 132 | 142 | */ |
| 133 | 143 | protected function buildQueryType( $value ) |
| 134 | 144 | { |
| 135 | - if( in_array( $value, ['','all'] ))return; |
|
| 145 | + if( in_array( $value, ['','all'] )) { |
|
| 146 | + return; |
|
| 147 | + } |
|
| 136 | 148 | return [ |
| 137 | 149 | 'key' => 'review_type', |
| 138 | 150 | 'value' => $value, |
@@ -15,7 +15,9 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function download( $filename, $content ) |
| 17 | 17 | { |
| 18 | - if( !current_user_can( Application::CAPABILITY ))return; |
|
| 18 | + if( !current_user_can( Application::CAPABILITY )) { |
|
| 19 | + return; |
|
| 20 | + } |
|
| 19 | 21 | nocache_headers(); |
| 20 | 22 | header( 'Content-Type: text/plain' ); |
| 21 | 23 | header( 'Content-Disposition: attachment; filename="'.$filename.'"' ); |
@@ -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 | } |
@@ -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'], |
@@ -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 |