@@ -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> |
@@ -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' ); |
@@ -54,7 +54,9 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | $postTypeColumns = glsr()->postTypeColumns[Application::POST_TYPE]; |
| 56 | 56 | foreach( $postTypeColumns as $key => &$value ) { |
| 57 | - if( !array_key_exists( $key, $columns ) || !empty( $value ))continue; |
|
| 57 | + if( !array_key_exists( $key, $columns ) || !empty( $value )) { |
|
| 58 | + continue; |
|
| 59 | + } |
|
| 58 | 60 | $value = $columns[$key]; |
| 59 | 61 | } |
| 60 | 62 | if( count( glsr( Database::class )->getReviewsMeta( 'review_type' )) < 2 ) { |
@@ -92,7 +94,8 @@ discard block |
||
| 92 | 94 | * @return array |
| 93 | 95 | * @filter display_post_states |
| 94 | 96 | */ |
| 95 | - public function filterPostStates( array $postStates, WP_Post $post ) { |
|
| 97 | + public function filterPostStates( array $postStates, WP_Post $post ) |
|
| 98 | + { |
|
| 96 | 99 | if( $post->post_type == Application::POST_TYPE |
| 97 | 100 | && array_key_exists( 'pending', $postStates )) { |
| 98 | 101 | $postStates['pending'] = __( 'Unapproved', 'site-reviews' ); |
@@ -137,7 +140,9 @@ discard block |
||
| 137 | 140 | $postTypeColumns = glsr()->postTypeColumns[Application::POST_TYPE]; |
| 138 | 141 | unset( $postTypeColumns['cb'] ); |
| 139 | 142 | foreach( $postTypeColumns as $key => $value ) { |
| 140 | - if( glsr( Helper::class )->startsWith( 'taxonomy', $key ))continue; |
|
| 143 | + if( glsr( Helper::class )->startsWith( 'taxonomy', $key )) { |
|
| 144 | + continue; |
|
| 145 | + } |
|
| 141 | 146 | $columns[$key] = $key; |
| 142 | 147 | } |
| 143 | 148 | return $columns; |
@@ -161,7 +166,9 @@ discard block |
||
| 161 | 166 | 'Pending' => __( 'Unapproved', 'site-reviews' ), |
| 162 | 167 | ]; |
| 163 | 168 | foreach( $strings as $search => $replace ) { |
| 164 | - if( strpos( $single, $search ) === false )continue; |
|
| 169 | + if( strpos( $single, $search ) === false ) { |
|
| 170 | + continue; |
|
| 171 | + } |
|
| 165 | 172 | $translation = $this->getTranslation([ |
| 166 | 173 | 'number' => $number, |
| 167 | 174 | 'plural' => str_replace( $search, $replace, $plural ), |
@@ -213,7 +220,9 @@ discard block |
||
| 213 | 220 | */ |
| 214 | 221 | public function saveBulkEditFields( $postId ) |
| 215 | 222 | { |
| 216 | - if( !current_user_can( 'edit_posts' ))return; |
|
| 223 | + if( !current_user_can( 'edit_posts' )) { |
|
| 224 | + return; |
|
| 225 | + } |
|
| 217 | 226 | $assignedTo = filter_input( INPUT_GET, 'assigned_to' ); |
| 218 | 227 | if( $assignedTo && get_post( $assignedTo )) { |
| 219 | 228 | update_post_meta( $postId, 'assigned_to', $assignedTo ); |
@@ -226,7 +235,9 @@ discard block |
||
| 226 | 235 | */ |
| 227 | 236 | public function setQueryForColumn( WP_Query $query ) |
| 228 | 237 | { |
| 229 | - if( !$this->hasPermission( $query ))return; |
|
| 238 | + if( !$this->hasPermission( $query )) { |
|
| 239 | + return; |
|
| 240 | + } |
|
| 230 | 241 | $this->setMetaQuery( $query, [ |
| 231 | 242 | 'rating', 'review_type', |
| 232 | 243 | ]); |
@@ -298,7 +309,9 @@ discard block |
||
| 298 | 309 | protected function setMetaQuery( WP_Query $query, array $metaKeys ) |
| 299 | 310 | { |
| 300 | 311 | foreach( $metaKeys as $key ) { |
| 301 | - if( !( $value = filter_input( INPUT_GET, $key )))continue; |
|
| 312 | + if( !( $value = filter_input( INPUT_GET, $key ))) { |
|
| 313 | + continue; |
|
| 314 | + } |
|
| 302 | 315 | $metaQuery = (array)$query->get( 'meta_query' ); |
| 303 | 316 | $metaQuery[] = [ |
| 304 | 317 | 'key' => $key, |
@@ -90,7 +90,9 @@ |
||
| 90 | 90 | { |
| 91 | 91 | $total = array_sum( $ratingCounts ); |
| 92 | 92 | foreach( $ratingCounts as $index => $count ) { |
| 93 | - if( empty( $count ))continue; |
|
| 93 | + if( empty( $count )) { |
|
| 94 | + continue; |
|
| 95 | + } |
|
| 94 | 96 | $ratingCounts[$index] = $count / $total * 100; |
| 95 | 97 | } |
| 96 | 98 | return $this->getRoundedPercentages( $ratingCounts ); |
@@ -81,7 +81,9 @@ discard block |
||
| 81 | 81 | ]; |
| 82 | 82 | if( !isset( $properties[$property] ) |
| 83 | 83 | || empty( array_filter( [$value], $properties[$property] )) |
| 84 | - )return; |
|
| 84 | + ) { |
|
| 85 | + return; |
|
| 86 | + } |
|
| 85 | 87 | $this->$property = $value; |
| 86 | 88 | } |
| 87 | 89 | |
@@ -90,7 +92,9 @@ discard block |
||
| 90 | 92 | */ |
| 91 | 93 | public function getClosingTag() |
| 92 | 94 | { |
| 93 | - if( empty( $this->tag ))return; |
|
| 95 | + if( empty( $this->tag )) { |
|
| 96 | + return; |
|
| 97 | + } |
|
| 94 | 98 | return '</'.$this->tag.'>'; |
| 95 | 99 | } |
| 96 | 100 | |
@@ -99,7 +103,9 @@ discard block |
||
| 99 | 103 | */ |
| 100 | 104 | public function getOpeningTag() |
| 101 | 105 | { |
| 102 | - if( empty( $this->tag ))return; |
|
| 106 | + if( empty( $this->tag )) { |
|
| 107 | + return; |
|
| 108 | + } |
|
| 103 | 109 | $attributes = glsr( Attributes::class )->{$this->tag}( $this->args )->toString(); |
| 104 | 110 | return '<'.trim( $this->tag.' '.$attributes ).'>'; |
| 105 | 111 | } |
@@ -141,7 +147,9 @@ discard block |
||
| 141 | 147 | */ |
| 142 | 148 | protected function buildFieldDescription() |
| 143 | 149 | { |
| 144 | - if( empty( $this->args['description'] ))return; |
|
| 150 | + if( empty( $this->args['description'] )) { |
|
| 151 | + return; |
|
| 152 | + } |
|
| 145 | 153 | if( $this->args['is_widget'] ) { |
| 146 | 154 | return $this->small( $this->args['description'] ); |
| 147 | 155 | } |
@@ -207,7 +215,9 @@ discard block |
||
| 207 | 215 | */ |
| 208 | 216 | protected function buildFormLabel( array $customArgs = [] ) |
| 209 | 217 | { |
| 210 | - if( empty( $this->args['label'] ) || $this->args['type'] == 'hidden' )return; |
|
| 218 | + if( empty( $this->args['label'] ) || $this->args['type'] == 'hidden' ) { |
|
| 219 | + return; |
|
| 220 | + } |
|
| 211 | 221 | return $this->label( wp_parse_args( $customArgs, [ |
| 212 | 222 | 'for' => $this->args['id'], |
| 213 | 223 | 'is_public' => $this->args['is_public'], |
@@ -13,7 +13,9 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function saveAssignedToMetabox( $postId ) |
| 15 | 15 | { |
| 16 | - if( !wp_verify_nonce( glsr( Helper::class )->filterInput( '_nonce-assigned-to' ), 'assigned_to' ))return; |
|
| 16 | + if( !wp_verify_nonce( glsr( Helper::class )->filterInput( '_nonce-assigned-to' ), 'assigned_to' )) { |
|
| 17 | + return; |
|
| 18 | + } |
|
| 17 | 19 | $assignedTo = strval( glsr( Helper::class )->filterInput( 'assigned_to' )); |
| 18 | 20 | if( get_post_meta( $postId, 'assigned_to', true ) != $assignedTo ) { |
| 19 | 21 | $review = glsr( ReviewManager::class )->single( get_post( $postId )); |
@@ -28,7 +30,9 @@ discard block |
||
| 28 | 30 | */ |
| 29 | 31 | public function saveResponseMetabox( $postId ) |
| 30 | 32 | { |
| 31 | - if( !wp_verify_nonce( glsr( Helper::class )->filterInput( '_nonce-response' ), 'response' ))return; |
|
| 33 | + if( !wp_verify_nonce( glsr( Helper::class )->filterInput( '_nonce-response' ), 'response' )) { |
|
| 34 | + return; |
|
| 35 | + } |
|
| 32 | 36 | $response = strval( glsr( Helper::class )->filterInput( 'response' )); |
| 33 | 37 | update_post_meta( $postId, 'response', trim( wp_kses( $response, [ |
| 34 | 38 | 'a' => ['href' => [], 'title' => []], |
@@ -93,7 +93,9 @@ discard block |
||
| 93 | 93 | foreach( $this->rules as $attribute => $rules ) { |
| 94 | 94 | foreach( $rules as $rule ) { |
| 95 | 95 | $this->validateAttribute( $attribute, $rule ); |
| 96 | - if( $this->shouldStopValidating( $attribute ))break; |
|
| 96 | + if( $this->shouldStopValidating( $attribute )) { |
|
| 97 | + break; |
|
| 98 | + } |
|
| 97 | 99 | } |
| 98 | 100 | } |
| 99 | 101 | return $this->errors; |
@@ -109,7 +111,9 @@ discard block |
||
| 109 | 111 | public function validateAttribute( $attribute, $rule ) |
| 110 | 112 | { |
| 111 | 113 | list( $rule, $parameters ) = $this->parseRule( $rule ); |
| 112 | - if( $rule == '' )return; |
|
| 114 | + if( $rule == '' ) { |
|
| 115 | + return; |
|
| 116 | + } |
|
| 113 | 117 | $value = $this->getValue( $attribute ); |
| 114 | 118 | if( !method_exists( $this, $method = 'validate'.$rule )) { |
| 115 | 119 | throw new BadMethodCallException( "Method [$method] does not exist." ); |
@@ -178,7 +182,9 @@ discard block |
||
| 178 | 182 | */ |
| 179 | 183 | protected function getRule( $attribute, $rules ) |
| 180 | 184 | { |
| 181 | - if( !array_key_exists( $attribute, $this->rules ))return; |
|
| 185 | + if( !array_key_exists( $attribute, $this->rules )) { |
|
| 186 | + return; |
|
| 187 | + } |
|
| 182 | 188 | $rules = (array)$rules; |
| 183 | 189 | foreach( $this->rules[$attribute] as $rule ) { |
| 184 | 190 | list( $rule, $parameters ) = $this->parseRule( $rule ); |