@@ -33,7 +33,9 @@ discard block |
||
| 33 | 33 | foreach( glsr( Database::class )->getReviews( $this->args )->results as $review ) { |
| 34 | 34 | // Only include critic reviews that have been directly produced by your site, not reviews from third- party sites or syndicated reviews. |
| 35 | 35 | // @see https://developers.google.com/search/docs/data-types/review |
| 36 | - if( $review->review_type != 'local' )continue; |
|
| 36 | + if( $review->review_type != 'local' ) { |
|
| 37 | + continue; |
|
| 38 | + } |
|
| 37 | 39 | $reviews[] = $this->buildReview( $review ); |
| 38 | 40 | } |
| 39 | 41 | if( !empty( $reviews )) { |
@@ -78,7 +80,9 @@ discard block |
||
| 78 | 80 | */ |
| 79 | 81 | public function render() |
| 80 | 82 | { |
| 81 | - if( is_null( glsr()->schemas ))return; |
|
| 83 | + if( is_null( glsr()->schemas )) { |
|
| 84 | + return; |
|
| 85 | + } |
|
| 82 | 86 | printf( '<script type="application/ld+json">%s</script>', json_encode( |
| 83 | 87 | apply_filters( 'site-reviews/schema/all', glsr()->schemas ), |
| 84 | 88 | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES |
@@ -129,7 +133,9 @@ discard block |
||
| 129 | 133 | { |
| 130 | 134 | foreach( $values as $value ) { |
| 131 | 135 | $option = $this->getSchemaOptionValue( $value ); |
| 132 | - if( empty( $option ))continue; |
|
| 136 | + if( empty( $option )) { |
|
| 137 | + continue; |
|
| 138 | + } |
|
| 133 | 139 | $schema->$value( $option ); |
| 134 | 140 | } |
| 135 | 141 | return $schema; |
@@ -242,7 +248,9 @@ discard block |
||
| 242 | 248 | if( $value != $fallback ) { |
| 243 | 249 | return $value; |
| 244 | 250 | } |
| 245 | - if( !is_single() && !is_page() )return; |
|
| 251 | + if( !is_single() && !is_page() ) { |
|
| 252 | + return; |
|
| 253 | + } |
|
| 246 | 254 | $method = glsr( Helper::class )->buildMethodName( $option, 'getThing' ); |
| 247 | 255 | if( method_exists( $this, $method )) { |
| 248 | 256 | return $this->$method(); |
@@ -16,7 +16,9 @@ discard block |
||
| 16 | 16 | public function routeAdminPostRequest() |
| 17 | 17 | { |
| 18 | 18 | $request = $this->getRequest(); |
| 19 | - if( !$this->isValidPostRequest( $request ))return; |
|
| 19 | + if( !$this->isValidPostRequest( $request )) { |
|
| 20 | + return; |
|
| 21 | + } |
|
| 20 | 22 | $this->checkAdminNonce( $request['action'] ); |
| 21 | 23 | $this->routeRequest( 'admin', $request['action'], $request ); |
| 22 | 24 | } |
@@ -44,10 +46,16 @@ discard block |
||
| 44 | 46 | */ |
| 45 | 47 | public function routePublicPostRequest() |
| 46 | 48 | { |
| 47 | - if( is_admin() )return; |
|
| 49 | + if( is_admin() ) { |
|
| 50 | + return; |
|
| 51 | + } |
|
| 48 | 52 | $request = $this->getRequest(); |
| 49 | - if( !$this->isValidPostRequest( $request ))return; |
|
| 50 | - if( !$this->isValidPublicNonce( $request ))return; |
|
| 53 | + if( !$this->isValidPostRequest( $request )) { |
|
| 54 | + return; |
|
| 55 | + } |
|
| 56 | + if( !$this->isValidPublicNonce( $request )) { |
|
| 57 | + return; |
|
| 58 | + } |
|
| 51 | 59 | $this->routeRequest( 'public', $request['action'], $request ); |
| 52 | 60 | } |
| 53 | 61 | |
@@ -57,7 +65,9 @@ discard block |
||
| 57 | 65 | public function routeWebhookRequest() |
| 58 | 66 | { |
| 59 | 67 | $request = filter_input( INPUT_GET, Application::PREFIX.'hook' ); |
| 60 | - if( !$request )return; |
|
| 68 | + if( !$request ) { |
|
| 69 | + return; |
|
| 70 | + } |
|
| 61 | 71 | // @todo manage webhook here |
| 62 | 72 | } |
| 63 | 73 | |
@@ -80,7 +90,9 @@ discard block |
||
| 80 | 90 | */ |
| 81 | 91 | protected function checkAjaxNonce( array $request ) |
| 82 | 92 | { |
| 83 | - if( !is_user_logged_in() )return; |
|
| 93 | + if( !is_user_logged_in() ) { |
|
| 94 | + return; |
|
| 95 | + } |
|
| 84 | 96 | if( !isset( $request['nonce'] )) { |
| 85 | 97 | glsr_log()->error( 'The AJAX request must include a nonce' )->info( $request ); |
| 86 | 98 | wp_die(); |
@@ -98,7 +110,9 @@ discard block |
||
| 98 | 110 | { |
| 99 | 111 | foreach( ['request', Application::ID] as $key ) { |
| 100 | 112 | $request = glsr( Helper::class )->filterInputArray( $key ); |
| 101 | - if( !empty( $request ))break; |
|
| 113 | + if( !empty( $request )) { |
|
| 114 | + break; |
|
| 115 | + } |
|
| 102 | 116 | } |
| 103 | 117 | return $this->normalizeRequest( $request ); |
| 104 | 118 | } |
@@ -3,7 +3,9 @@ |
||
| 3 | 3 | defined( 'WP_UNINSTALL_PLUGIN' ) || die; |
| 4 | 4 | |
| 5 | 5 | require_once __DIR__.'/site-reviews.php'; |
| 6 | -if( !GL_Plugin_Check_v2::isValid( array( 'wordpress' => '4.7.0' )))return; |
|
| 6 | +if( !GL_Plugin_Check_v2::isValid( array( 'wordpress' => '4.7.0' ))) { |
|
| 7 | + return; |
|
| 8 | +} |
|
| 7 | 9 | |
| 8 | 10 | delete_option( GeminiLabs\SiteReviews\Database\OptionManager::databaseKey() ); |
| 9 | 11 | delete_option( 'widget_'.glsr()->id.'_site-reviews' ); |
@@ -21,7 +21,9 @@ |
||
| 21 | 21 | if( !class_exists( 'GL_Plugin_Check_v2' )) { |
| 22 | 22 | require_once __DIR__.'/activate.php'; |
| 23 | 23 | } |
| 24 | -if( GL_Plugin_Check_v2::shouldDeactivate( __FILE__, array( 'wordpress' => '4.7.0' )))return; |
|
| 24 | +if( GL_Plugin_Check_v2::shouldDeactivate( __FILE__, array( 'wordpress' => '4.7.0' ))) { |
|
| 25 | + return; |
|
| 26 | +} |
|
| 25 | 27 | require_once __DIR__.'/autoload.php'; |
| 26 | 28 | require_once __DIR__.'/helpers.php'; |
| 27 | 29 | |