@@ -102,7 +102,9 @@ discard block |
||
| 102 | 102 | $field = method_exists( $this, $method ) |
| 103 | 103 | ? $this->$method( $key, $value ) |
| 104 | 104 | : apply_filters( 'site-reviews/review/build/'.$key, false, $value, $this, $review ); |
| 105 | - if( $field === false )continue; |
|
| 105 | + if( $field === false ) { |
|
| 106 | + continue; |
|
| 107 | + } |
|
| 106 | 108 | $renderedFields[$key] = $field; |
| 107 | 109 | } |
| 108 | 110 | $this->wrap( $renderedFields, $review ); |
@@ -117,9 +119,13 @@ discard block |
||
| 117 | 119 | */ |
| 118 | 120 | protected function buildOptionAssignedTo( $key, $value ) |
| 119 | 121 | { |
| 120 | - if( $this->isHidden( $key, 'settings.reviews.assigned_links' ))return; |
|
| 122 | + if( $this->isHidden( $key, 'settings.reviews.assigned_links' )) { |
|
| 123 | + return; |
|
| 124 | + } |
|
| 121 | 125 | $post = glsr( Polylang::class )->getPost( $value ); |
| 122 | - if( !( $post instanceof WP_Post ))return; |
|
| 126 | + if( !( $post instanceof WP_Post )) { |
|
| 127 | + return; |
|
| 128 | + } |
|
| 123 | 129 | $permalink = glsr( Builder::class )->a( get_the_title( $post->ID ), [ |
| 124 | 130 | 'href' => get_the_permalink( $post->ID ), |
| 125 | 131 | ]); |
@@ -134,7 +140,9 @@ discard block |
||
| 134 | 140 | */ |
| 135 | 141 | protected function buildOptionAuthor( $key, $value ) |
| 136 | 142 | { |
| 137 | - if( $this->isHidden( $key ))return; |
|
| 143 | + if( $this->isHidden( $key )) { |
|
| 144 | + return; |
|
| 145 | + } |
|
| 138 | 146 | return '<span>'.$value.'</span>'; |
| 139 | 147 | } |
| 140 | 148 | |
@@ -145,7 +153,9 @@ discard block |
||
| 145 | 153 | */ |
| 146 | 154 | protected function buildOptionAvatar( $key, $value ) |
| 147 | 155 | { |
| 148 | - if( $this->isHidden( $key, 'settings.reviews.avatars' ))return; |
|
| 156 | + if( $this->isHidden( $key, 'settings.reviews.avatars' )) { |
|
| 157 | + return; |
|
| 158 | + } |
|
| 149 | 159 | $size = $this->getOption( 'settings.reviews.avatars_size', 40 ); |
| 150 | 160 | return glsr( Builder::class )->img([ |
| 151 | 161 | 'height' => $size, |
@@ -163,7 +173,9 @@ discard block |
||
| 163 | 173 | protected function buildOptionContent( $key, $value ) |
| 164 | 174 | { |
| 165 | 175 | $text = $this->normalizeText( $value ); |
| 166 | - if( $this->isHiddenOrEmpty( $key, $text ))return; |
|
| 176 | + if( $this->isHiddenOrEmpty( $key, $text )) { |
|
| 177 | + return; |
|
| 178 | + } |
|
| 167 | 179 | return '<p>'.$text.'</p>'; |
| 168 | 180 | } |
| 169 | 181 | |
@@ -174,7 +186,9 @@ discard block |
||
| 174 | 186 | */ |
| 175 | 187 | protected function buildOptionDate( $key, $value ) |
| 176 | 188 | { |
| 177 | - if( $this->isHidden( $key ))return; |
|
| 189 | + if( $this->isHidden( $key )) { |
|
| 190 | + return; |
|
| 191 | + } |
|
| 178 | 192 | $dateFormat = $this->getOption( 'settings.reviews.date.format', 'default' ); |
| 179 | 193 | if( $dateFormat == 'relative' ) { |
| 180 | 194 | $date = glsr( Date::class )->relative( $value ); |
@@ -195,7 +209,9 @@ discard block |
||
| 195 | 209 | */ |
| 196 | 210 | protected function buildOptionRating( $key, $value ) |
| 197 | 211 | { |
| 198 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
| 212 | + if( $this->isHiddenOrEmpty( $key, $value )) { |
|
| 213 | + return; |
|
| 214 | + } |
|
| 199 | 215 | return glsr( Partial::class )->build( 'star-rating', [ |
| 200 | 216 | 'rating' => $value, |
| 201 | 217 | ]); |
@@ -208,7 +224,9 @@ discard block |
||
| 208 | 224 | */ |
| 209 | 225 | protected function buildOptionResponse( $key, $value ) |
| 210 | 226 | { |
| 211 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
| 227 | + if( $this->isHiddenOrEmpty( $key, $value )) { |
|
| 228 | + return; |
|
| 229 | + } |
|
| 212 | 230 | $title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' )); |
| 213 | 231 | $text = $this->normalizeText( $value ); |
| 214 | 232 | $text = '<p><strong>'.$title.'</strong></p><p>'.$text.'</p>'; |
@@ -224,7 +242,9 @@ discard block |
||
| 224 | 242 | */ |
| 225 | 243 | protected function buildOptionTitle( $key, $value ) |
| 226 | 244 | { |
| 227 | - if( $this->isHidden( $key ))return; |
|
| 245 | + if( $this->isHidden( $key )) { |
|
| 246 | + return; |
|
| 247 | + } |
|
| 228 | 248 | if( empty( $value )) { |
| 229 | 249 | $value = __( 'No Title', 'site-reviews' ); |
| 230 | 250 | } |
@@ -256,7 +276,9 @@ discard block |
||
| 256 | 276 | */ |
| 257 | 277 | protected function generateSchema() |
| 258 | 278 | { |
| 259 | - if( !wp_validate_boolean( $this->args['schema'] ))return; |
|
| 279 | + if( !wp_validate_boolean( $this->args['schema'] )) { |
|
| 280 | + return; |
|
| 281 | + } |
|
| 260 | 282 | glsr( Schema::class )->store( |
| 261 | 283 | glsr( Schema::class )->build( $this->args ) |
| 262 | 284 | ); |
@@ -306,9 +328,13 @@ discard block |
||
| 306 | 328 | $words->setText( $text ); |
| 307 | 329 | $count = 0; |
| 308 | 330 | foreach( $words as $offset ){ |
| 309 | - if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE )continue; |
|
| 331 | + if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE ) { |
|
| 332 | + continue; |
|
| 333 | + } |
|
| 310 | 334 | $count++; |
| 311 | - if( $count != $limit )continue; |
|
| 335 | + if( $count != $limit ) { |
|
| 336 | + continue; |
|
| 337 | + } |
|
| 312 | 338 | return $offset; |
| 313 | 339 | } |
| 314 | 340 | return strlen( $text ); |
@@ -384,7 +410,9 @@ discard block |
||
| 384 | 410 | $renderedFields = apply_filters( 'site-reviews/review/wrap', $renderedFields, $review ); |
| 385 | 411 | array_walk( $renderedFields, function( &$value, $key ) use( $review ) { |
| 386 | 412 | $value = apply_filters( 'site-reviews/review/wrap/'.$key, $value, $review ); |
| 387 | - if( empty( $value ))return; |
|
| 413 | + if( empty( $value )) { |
|
| 414 | + return; |
|
| 415 | + } |
|
| 388 | 416 | $value = glsr( Builder::class )->div( $value, [ |
| 389 | 417 | 'class' => 'glsr-review-'.$key, |
| 390 | 418 | ]); |
@@ -60,7 +60,9 @@ discard block |
||
| 60 | 60 | public function catchFatalError() |
| 61 | 61 | { |
| 62 | 62 | $error = error_get_last(); |
| 63 | - if( $error['type'] !== E_ERROR || strpos( $error['message'], $this->path() ) === false )return; |
|
| 63 | + if( $error['type'] !== E_ERROR || strpos( $error['message'], $this->path() ) === false ) { |
|
| 64 | + return; |
|
| 65 | + } |
|
| 64 | 66 | glsr_log()->error( $error['message'] ); |
| 65 | 67 | } |
| 66 | 68 | |
@@ -111,7 +113,9 @@ discard block |
||
| 111 | 113 | $filePaths[] = $this->path( $view ); |
| 112 | 114 | $filePaths[] = $this->path( 'views/'.$view ); |
| 113 | 115 | foreach( $filePaths as $file ) { |
| 114 | - if( !file_exists( $file ))continue; |
|
| 116 | + if( !file_exists( $file )) { |
|
| 117 | + continue; |
|
| 118 | + } |
|
| 115 | 119 | return $file; |
| 116 | 120 | } |
| 117 | 121 | } |
@@ -215,7 +219,9 @@ discard block |
||
| 215 | 219 | */ |
| 216 | 220 | public function scheduleCronJob() |
| 217 | 221 | { |
| 218 | - if( wp_next_scheduled( static::CRON_EVENT ))return; |
|
| 222 | + if( wp_next_scheduled( static::CRON_EVENT )) { |
|
| 223 | + return; |
|
| 224 | + } |
|
| 219 | 225 | wp_schedule_event( time(), 'twicedaily', static::CRON_EVENT ); |
| 220 | 226 | } |
| 221 | 227 | |
@@ -255,7 +261,9 @@ discard block |
||
| 255 | 261 | || !in_array( plugin_basename( $this->file ), $data['plugins'] ) |
| 256 | 262 | || $data['action'] != 'update' |
| 257 | 263 | || $data['type'] != 'plugin' |
| 258 | - )return; |
|
| 264 | + ) { |
|
| 265 | + return; |
|
| 266 | + } |
|
| 259 | 267 | $this->upgrade(); |
| 260 | 268 | } |
| 261 | 269 | |