@@ -212,7 +212,9 @@ discard block |
||
| 212 | 212 | $newParents = $parents; |
| 213 | 213 | foreach( $parents as $parent ) { |
| 214 | 214 | $parentClass = glsr( Helper::class )->buildClassName( $parent, __NAMESPACE__ ); |
| 215 | - if( !class_exists( $parentClass ))continue; |
|
| 215 | + if( !class_exists( $parentClass )) { |
|
| 216 | + continue; |
|
| 217 | + } |
|
| 216 | 218 | $newParents = array_merge( $newParents, $this->getParents( (new $parentClass)->parents )); |
| 217 | 219 | } |
| 218 | 220 | return array_values( array_unique( $newParents )); |
@@ -226,7 +228,9 @@ discard block |
||
| 226 | 228 | $parents = $this->getParents(); |
| 227 | 229 | foreach( $parents as $parent ) { |
| 228 | 230 | $parentClass = glsr( Helper::class )->buildClassName( $parent, __NAMESPACE__ ); |
| 229 | - if( !class_exists( $parentClass ))continue; |
|
| 231 | + if( !class_exists( $parentClass )) { |
|
| 232 | + continue; |
|
| 233 | + } |
|
| 230 | 234 | $this->allowed = array_values( array_unique( array_merge( (new $parentClass)->allowed, $this->allowed ))); |
| 231 | 235 | } |
| 232 | 236 | } |
@@ -91,7 +91,9 @@ discard block |
||
| 91 | 91 | get_mu_plugins(), |
| 92 | 92 | get_plugins( '/../'.basename( WPMU_PLUGIN_DIR )) |
| 93 | 93 | ); |
| 94 | - if( empty( $plugins ))return; |
|
| 94 | + if( empty( $plugins )) { |
|
| 95 | + return; |
|
| 96 | + } |
|
| 95 | 97 | return $this->normalizePluginList( $plugins ); |
| 96 | 98 | } |
| 97 | 99 | |
@@ -100,7 +102,9 @@ discard block |
||
| 100 | 102 | */ |
| 101 | 103 | public function getMultisitePluginDetails() |
| 102 | 104 | { |
| 103 | - if( !is_multisite() || empty( get_site_option( 'active_sitewide_plugins', [] )))return; |
|
| 105 | + if( !is_multisite() || empty( get_site_option( 'active_sitewide_plugins', [] ))) { |
|
| 106 | + return; |
|
| 107 | + } |
|
| 104 | 108 | return $this->normalizePluginList( wp_get_active_network_plugins() ); |
| 105 | 109 | } |
| 106 | 110 | |
@@ -157,7 +161,9 @@ discard block |
||
| 157 | 161 | ksort( $settings ); |
| 158 | 162 | $details = []; |
| 159 | 163 | foreach( $settings as $key => $value ) { |
| 160 | - if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key ))continue; |
|
| 164 | + if( $helper->startsWith( 'strings', $key ) && $helper->endsWith( 'id', $key )) { |
|
| 165 | + continue; |
|
| 166 | + } |
|
| 161 | 167 | $value = htmlspecialchars( trim( preg_replace('/\s\s+/', '\\n', $value )), ENT_QUOTES, 'UTF-8' ); |
| 162 | 168 | $details[$key] = $value; |
| 163 | 169 | } |
@@ -230,7 +236,9 @@ discard block |
||
| 230 | 236 | 'WPE_APIKEY' => 'WP Engine', |
| 231 | 237 | ]; |
| 232 | 238 | foreach( $checks as $key => $value ) { |
| 233 | - if( !$this->isWebhostCheckValid( $key ))continue; |
|
| 239 | + if( !$this->isWebhostCheckValid( $key )) { |
|
| 240 | + continue; |
|
| 241 | + } |
|
| 234 | 242 | return $value; |
| 235 | 243 | } |
| 236 | 244 | return implode( ',', array_filter( [DB_HOST, filter_input( INPUT_SERVER, 'SERVER_NAME' )] )); |
@@ -311,7 +319,9 @@ discard block |
||
| 311 | 319 | ]; |
| 312 | 320 | array_walk( $settings, function( &$value, $setting ) use( $keys ) { |
| 313 | 321 | foreach( $keys as $key ) { |
| 314 | - if( !glsr( Helper::class )->startsWith( $key, $setting ) || empty( $value ))continue; |
|
| 322 | + if( !glsr( Helper::class )->startsWith( $key, $setting ) || empty( $value )) { |
|
| 323 | + continue; |
|
| 324 | + } |
|
| 315 | 325 | $value = str_repeat( '•', 13 ); |
| 316 | 326 | return; |
| 317 | 327 | } |
@@ -15,14 +15,20 @@ |
||
| 15 | 15 | <span class="glsr-addon-link button button-secondary" disabled> |
| 16 | 16 | <?= __( 'Installed', 'site-reviews' ); ?> |
| 17 | 17 | </span> |
| 18 | - <?php else: ?> |
|
| 19 | - <a href="<?= wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin='.$plugin ), 'activate-plugin_'.$plugin );?>" class="glsr-addon-link button button-secondary"> |
|
| 18 | + <?php else { |
|
| 19 | + : ?> |
|
| 20 | + <a href="<?= wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin='.$plugin ), 'activate-plugin_'.$plugin ); |
|
| 21 | +} |
|
| 22 | +?>" class="glsr-addon-link button button-secondary"> |
|
| 20 | 23 | <?= __( 'Activate', 'site-reviews' ); ?> |
| 21 | 24 | </a> |
| 22 | 25 | <?php endif; ?> |
| 23 | - <?php else: ?> |
|
| 26 | + <?php else { |
|
| 27 | + : ?> |
|
| 24 | 28 | <a href="{{ link }}" class="glsr-addon-link glsr-external button button-secondary"> |
| 25 | - <?= __( 'More Info', 'site-reviews' ); ?> |
|
| 29 | + <?= __( 'More Info', 'site-reviews' ); |
|
| 30 | +} |
|
| 31 | +?> |
|
| 26 | 32 | </a> |
| 27 | 33 | <?php endif; ?> |
| 28 | 34 | </div> |
@@ -46,9 +46,12 @@ |
||
| 46 | 46 | <option value="<?= $slug; ?>" class="hide-if-no-js"><?= $details['name']; ?></option> |
| 47 | 47 | <?php endforeach; ?> |
| 48 | 48 | </select> |
| 49 | - <?php else: ?> |
|
| 49 | + <?php else { |
|
| 50 | + : ?> |
|
| 50 | 51 | <?php foreach( $sites as $slug => $details ) : ?> |
| 51 | - <input type="hidden" name="{{ id }}[site]" value="<?= $slug; ?>"> |
|
| 52 | + <input type="hidden" name="{{ id }}[site]" value="<?= $slug; |
|
| 53 | +} |
|
| 54 | +?>"> |
|
| 52 | 55 | <?php endforeach; ?> |
| 53 | 56 | <?php endif; ?> |
| 54 | 57 | <input type="hidden" name="{{ id }}[action]" value="sync-reviews"> |
@@ -60,7 +60,9 @@ |
||
| 60 | 60 | */ |
| 61 | 61 | public function deactivate( $plugin ) |
| 62 | 62 | { |
| 63 | - if( $this->isValid() )return; |
|
| 63 | + if( $this->isValid() ) { |
|
| 64 | + return; |
|
| 65 | + } |
|
| 64 | 66 | $pluginSlug = plugin_basename( $this->file ); |
| 65 | 67 | if( $plugin == $pluginSlug ) { |
| 66 | 68 | $this->redirect(); //exit |
@@ -3,7 +3,9 @@ |
||
| 3 | 3 | defined( 'WP_UNINSTALL_PLUGIN' ) || die; |
| 4 | 4 | |
| 5 | 5 | require_once __DIR__.'/site-reviews.php'; |
| 6 | -if( !(new GL_Plugin_Check_v3( __FILE__ ))->isValid() )return; |
|
| 6 | +if( !(new GL_Plugin_Check_v3( __FILE__ ))->isValid() ) { |
|
| 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_v3' )) { |
| 22 | 22 | require_once __DIR__.'/activate.php'; |
| 23 | 23 | } |
| 24 | -if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() )return; |
|
| 24 | +if( !(new GL_Plugin_Check_v3( __FILE__ ))->canProceed() ) { |
|
| 25 | + return; |
|
| 26 | +} |
|
| 25 | 27 | require_once __DIR__.'/autoload.php'; |
| 26 | 28 | require_once __DIR__.'/compatibility.php'; |
| 27 | 29 | require_once __DIR__.'/helpers.php'; |
@@ -83,7 +83,9 @@ discard block |
||
| 83 | 83 | $reviewValues = []; |
| 84 | 84 | foreach( $review as $key => $value ) { |
| 85 | 85 | $method = glsr( Helper::class )->buildMethodName( $key, 'buildOption' ); |
| 86 | - if( !method_exists( $this, $method ))continue; |
|
| 86 | + if( !method_exists( $this, $method )) { |
|
| 87 | + continue; |
|
| 88 | + } |
|
| 87 | 89 | $reviewValues[$key] = $this->$method( $key, $value ); |
| 88 | 90 | } |
| 89 | 91 | $reviewValues = apply_filters( 'site-reviews/review/build/after', $reviewValues ); |
@@ -97,9 +99,13 @@ discard block |
||
| 97 | 99 | */ |
| 98 | 100 | protected function buildOptionAssignedTo( $key, $value ) |
| 99 | 101 | { |
| 100 | - if( $this->isHiddenOrEmpty( $key, 'settings.reviews.assigned_links.enabled' ))return; |
|
| 102 | + if( $this->isHiddenOrEmpty( $key, 'settings.reviews.assigned_links.enabled' )) { |
|
| 103 | + return; |
|
| 104 | + } |
|
| 101 | 105 | $post = get_post( intval( $value )); |
| 102 | - if( !( $post instanceof WP_Post ))return; |
|
| 106 | + if( !( $post instanceof WP_Post )) { |
|
| 107 | + return; |
|
| 108 | + } |
|
| 103 | 109 | $permalink = glsr( Builder::class )->a( get_the_title( $post->ID ), [ |
| 104 | 110 | 'href' => get_the_permalink( $post->ID ), |
| 105 | 111 | ]); |
@@ -114,7 +120,9 @@ discard block |
||
| 114 | 120 | */ |
| 115 | 121 | protected function buildOptionAuthor( $key, $value ) |
| 116 | 122 | { |
| 117 | - if( $this->isHidden( $key ))return; |
|
| 123 | + if( $this->isHidden( $key )) { |
|
| 124 | + return; |
|
| 125 | + } |
|
| 118 | 126 | $prefix = !$this->isOptionEnabled( 'settings.reviews.avatars.enabled' ) |
| 119 | 127 | ? apply_filters( 'site-reviews/review/author/prefix', '—' ) |
| 120 | 128 | : ''; |
@@ -128,7 +136,9 @@ discard block |
||
| 128 | 136 | */ |
| 129 | 137 | protected function buildOptionAvatar( $key, $value ) |
| 130 | 138 | { |
| 131 | - if( $this->isHidden( $key, 'settings.reviews.avatars.enabled' ))return; |
|
| 139 | + if( $this->isHidden( $key, 'settings.reviews.avatars.enabled' )) { |
|
| 140 | + return; |
|
| 141 | + } |
|
| 132 | 142 | $size = $this->getOption( 'settings.reviews.avatars.size', 40 ); |
| 133 | 143 | return $this->wrap( $key, glsr( Builder::class )->img([ |
| 134 | 144 | 'src' => $this->generateAvatar( $value ), |
@@ -145,7 +155,9 @@ discard block |
||
| 145 | 155 | protected function buildOptionContent( $key, $value ) |
| 146 | 156 | { |
| 147 | 157 | $text = $this->normalizeText( $value ); |
| 148 | - if( $this->isHiddenOrEmpty( $key, $text ))return; |
|
| 158 | + if( $this->isHiddenOrEmpty( $key, $text )) { |
|
| 159 | + return; |
|
| 160 | + } |
|
| 149 | 161 | return $this->wrap( $key, '<p>'.$text.'</p>' ); |
| 150 | 162 | } |
| 151 | 163 | |
@@ -156,7 +168,9 @@ discard block |
||
| 156 | 168 | */ |
| 157 | 169 | protected function buildOptionDate( $key, $value ) |
| 158 | 170 | { |
| 159 | - if( $this->isHidden( $key ))return; |
|
| 171 | + if( $this->isHidden( $key )) { |
|
| 172 | + return; |
|
| 173 | + } |
|
| 160 | 174 | $dateFormat = $this->getOption( 'settings.reviews.date.format', 'default' ); |
| 161 | 175 | if( $dateFormat == 'relative' ) { |
| 162 | 176 | $date = glsr( Date::class )->relative( $value ); |
@@ -177,7 +191,9 @@ discard block |
||
| 177 | 191 | */ |
| 178 | 192 | protected function buildOptionRating( $key, $value ) |
| 179 | 193 | { |
| 180 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
| 194 | + if( $this->isHiddenOrEmpty( $key, $value )) { |
|
| 195 | + return; |
|
| 196 | + } |
|
| 181 | 197 | $rating = glsr( Html::class )->buildPartial( 'star-rating', [ |
| 182 | 198 | 'rating' => $value, |
| 183 | 199 | ]); |
@@ -191,7 +207,9 @@ discard block |
||
| 191 | 207 | */ |
| 192 | 208 | protected function buildOptionResponse( $key, $value ) |
| 193 | 209 | { |
| 194 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
| 210 | + if( $this->isHiddenOrEmpty( $key, $value )) { |
|
| 211 | + return; |
|
| 212 | + } |
|
| 195 | 213 | $title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' )); |
| 196 | 214 | $text = $this->normalizeText( $value ); |
| 197 | 215 | $text = '<p><strong>'.$title.'</strong></p><p>'.$text.'</p>'; |
@@ -208,7 +226,9 @@ discard block |
||
| 208 | 226 | */ |
| 209 | 227 | protected function buildOptionTitle( $key, $value ) |
| 210 | 228 | { |
| 211 | - if( $this->isHidden( $key ))return; |
|
| 229 | + if( $this->isHidden( $key )) { |
|
| 230 | + return; |
|
| 231 | + } |
|
| 212 | 232 | if( empty( $value )) { |
| 213 | 233 | $value = __( 'No Title', 'site-reviews' ); |
| 214 | 234 | } |
@@ -238,7 +258,9 @@ discard block |
||
| 238 | 258 | */ |
| 239 | 259 | protected function generateSchema() |
| 240 | 260 | { |
| 241 | - if( !wp_validate_boolean( $this->args['schema'] ))return; |
|
| 261 | + if( !wp_validate_boolean( $this->args['schema'] )) { |
|
| 262 | + return; |
|
| 263 | + } |
|
| 242 | 264 | glsr( Schema::class )->store( |
| 243 | 265 | glsr( Schema::class )->build( $this->args ) |
| 244 | 266 | ); |
@@ -289,9 +311,13 @@ discard block |
||
| 289 | 311 | $words->setText( $text ); |
| 290 | 312 | $count = 0; |
| 291 | 313 | foreach( $words as $offset ){ |
| 292 | - if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE )continue; |
|
| 314 | + if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE ) { |
|
| 315 | + continue; |
|
| 316 | + } |
|
| 293 | 317 | $count++; |
| 294 | - if( $count != $limit )continue; |
|
| 318 | + if( $count != $limit ) { |
|
| 319 | + continue; |
|
| 320 | + } |
|
| 295 | 321 | return $offset; |
| 296 | 322 | } |
| 297 | 323 | return strlen( $text ); |
@@ -34,7 +34,9 @@ discard block |
||
| 34 | 34 | foreach( glsr( ReviewManager::class )->get( $this->args )->results as $review ) { |
| 35 | 35 | // Only include critic reviews that have been directly produced by your site, not reviews from third- party sites or syndicated reviews. |
| 36 | 36 | // @see https://developers.google.com/search/docs/data-types/review |
| 37 | - if( $review->review_type != 'local' )continue; |
|
| 37 | + if( $review->review_type != 'local' ) { |
|
| 38 | + continue; |
|
| 39 | + } |
|
| 38 | 40 | $reviews[] = $this->buildReview( $review ); |
| 39 | 41 | } |
| 40 | 42 | if( !empty( $reviews )) { |
@@ -79,7 +81,9 @@ discard block |
||
| 79 | 81 | */ |
| 80 | 82 | public function render() |
| 81 | 83 | { |
| 82 | - if( is_null( glsr()->schemas ))return; |
|
| 84 | + if( is_null( glsr()->schemas )) { |
|
| 85 | + return; |
|
| 86 | + } |
|
| 83 | 87 | printf( '<script type="application/ld+json">%s</script>', json_encode( |
| 84 | 88 | apply_filters( 'site-reviews/schema/all', glsr()->schemas ), |
| 85 | 89 | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES |
@@ -131,7 +135,9 @@ discard block |
||
| 131 | 135 | { |
| 132 | 136 | foreach( $values as $value ) { |
| 133 | 137 | $option = $this->getSchemaOptionValue( $value ); |
| 134 | - if( empty( $option ))continue; |
|
| 138 | + if( empty( $option )) { |
|
| 139 | + continue; |
|
| 140 | + } |
|
| 135 | 141 | $schema->$value( $option ); |
| 136 | 142 | } |
| 137 | 143 | return $schema; |
@@ -237,7 +243,9 @@ discard block |
||
| 237 | 243 | if( $value != $fallback ) { |
| 238 | 244 | return $value; |
| 239 | 245 | } |
| 240 | - if( !is_single() && !is_page() )return; |
|
| 246 | + if( !is_single() && !is_page() ) { |
|
| 247 | + return; |
|
| 248 | + } |
|
| 241 | 249 | $method = glsr( Helper::class )->buildMethodName( $option, 'getThing' ); |
| 242 | 250 | if( method_exists( $this, $method )) { |
| 243 | 251 | return $this->$method(); |