Passed
Push — master ( 4a454f...b92003 )
by Paul
03:35
created
plugin/Modules/Upgrader/Upgrade_3_0_0.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -74,9 +74,13 @@  discard block
 block discarded – undo
74 74
 	{
75 75
 		$this->newSettings = $this->getNewSettings();
76 76
 		$this->oldSettings = $this->getOldSettings();
77
-		if( empty( $this->oldSettings ))return;
77
+		if( empty( $this->oldSettings )) {
78
+			return;
79
+		}
78 80
 		foreach( static::MAPPED_SETTINGS as $old => $new ) {
79
-			if( empty( $this->oldSettings[$old] ))continue;
81
+			if( empty( $this->oldSettings[$old] )) {
82
+				continue;
83
+			}
80 84
 			$this->newSettings[$new] = $this->oldSettings[$old];
81 85
 		}
82 86
 		$this->migrateNotificationSettings();
@@ -136,7 +140,9 @@  discard block
 block discarded – undo
136 140
 		];
137 141
 		$this->newSettings['settings.general.notifications'] = [];
138 142
 		foreach( $notifications as $old => $new ) {
139
-			if( $this->oldSettings['settings.general.notification'] != $old )continue;
143
+			if( $this->oldSettings['settings.general.notification'] != $old ) {
144
+				continue;
145
+			}
140 146
 			$this->newSettings['settings.general.notifications'][] = $new;
141 147
 		}
142 148
 	}
Please login to merge, or discard this patch.
plugin/Modules/Validator/ValidateReview.php 1 patch
Braces   +30 added lines, -10 removed lines patch added patch discarded remove patch
@@ -175,8 +175,12 @@  discard block
 block discarded – undo
175 175
 	 */
176 176
 	protected function validateAkismet()
177 177
 	{
178
-		if( !empty( $this->error ))return;
179
-		if( !glsr( Akismet::class )->isSpam( $this->request ))return;
178
+		if( !empty( $this->error )) {
179
+			return;
180
+		}
181
+		if( !glsr( Akismet::class )->isSpam( $this->request )) {
182
+			return;
183
+		}
180 184
 		$this->setSessionValues( 'errors', [], 'Akismet caught a spam submission:' );
181 185
 		$this->error = __( 'Your review cannot be submitted at this time. Please try again later.', 'site-reviews' );
182 186
 	}
@@ -186,8 +190,12 @@  discard block
 block discarded – undo
186 190
 	 */
187 191
 	protected function validateBlacklist()
188 192
 	{
189
-		if( !empty( $this->error ))return;
190
-		if( !glsr( Blacklist::class )->isBlacklisted( $this->request ))return;
193
+		if( !empty( $this->error )) {
194
+			return;
195
+		}
196
+		if( !glsr( Blacklist::class )->isBlacklisted( $this->request )) {
197
+			return;
198
+		}
191 199
 		$blacklistAction = $this->getOption( 'settings.submissions.blacklist.action' );
192 200
 		if( $blacklistAction == 'reject' ) {
193 201
 			$this->setSessionValues( 'errors', [], 'Blacklisted submission detected:' );
@@ -202,9 +210,13 @@  discard block
 block discarded – undo
202 210
 	 */
203 211
 	protected function validateCustom()
204 212
 	{
205
-		if( !empty( $this->error ))return;
213
+		if( !empty( $this->error )) {
214
+			return;
215
+		}
206 216
 		$validated = apply_filters( 'site-reviews/validate/custom', true, $this->request );
207
-		if( $validated === true )return;
217
+		if( $validated === true ) {
218
+			return;
219
+		}
208 220
 		$this->setSessionValues( 'errors', [] );
209 221
 		$this->setSessionValues( 'values', $this->request );
210 222
 		$this->error = is_string( $validated )
@@ -217,8 +229,12 @@  discard block
 block discarded – undo
217 229
 	 */
218 230
 	protected function validateHoneyPot()
219 231
 	{
220
-		if( !empty( $this->error ))return;
221
-		if( empty( $this->request['gotcha'] ))return;
232
+		if( !empty( $this->error )) {
233
+			return;
234
+		}
235
+		if( empty( $this->request['gotcha'] )) {
236
+			return;
237
+		}
222 238
 		$this->setSessionValues( 'errors', [], 'The Honeypot caught a bad submission:' );
223 239
 		$this->error = __( 'The review submission failed. Please notify the site administrator.', 'site-reviews' );
224 240
 	}
@@ -228,9 +244,13 @@  discard block
 block discarded – undo
228 244
 	 */
229 245
 	protected function validateRecaptcha()
230 246
 	{
231
-		if( !empty( $this->error ))return;
247
+		if( !empty( $this->error )) {
248
+			return;
249
+		}
232 250
 		$status = $this->getRecaptchaStatus();
233
-		if( in_array( $status, [static::RECAPTCHA_DISABLED, static::RECAPTCHA_VALID] ))return;
251
+		if( in_array( $status, [static::RECAPTCHA_DISABLED, static::RECAPTCHA_VALID] )) {
252
+			return;
253
+		}
234 254
 		if( $status == static::RECAPTCHA_EMPTY ) {
235 255
 			$this->setSessionValues( 'recaptcha', 'unset' );
236 256
 			$this->recaptchaIsUnset = true;
Please login to merge, or discard this patch.
plugin/Helper.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -261,7 +261,9 @@  discard block
 block discarded – undo
261 261
 	{
262 262
 		$result = [];
263 263
 		foreach( $array as $key => $value ) {
264
-			if( !$value )continue;
264
+			if( !$value ) {
265
+				continue;
266
+			}
265 267
 			$result[$key] = is_array( $value )
266 268
 				? $this->removeEmptyArrayValues( $value )
267 269
 				: $value;
@@ -274,7 +276,8 @@  discard block
 block discarded – undo
274 276
 	 * @param string $text
275 277
 	 * @return string
276 278
 	 */
277
-	public function removePrefix( $prefix, $text ) {
279
+	public function removePrefix( $prefix, $text )
280
+	{
278 281
 		return 0 === strpos( $text, $prefix )
279 282
 			? substr( $text, strlen( $prefix ))
280 283
 			: $text;
Please login to merge, or discard this patch.
plugin/Modules/Style.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,9 @@  discard block
 block discarded – undo
55 55
 		}
56 56
 		$views = $this->generatePossibleViews( $view );
57 57
 		foreach( $views as $possibleView ) {
58
-			if( !file_exists( glsr()->path( $possibleView.'.php' )))continue;
58
+			if( !file_exists( glsr()->path( $possibleView.'.php' ))) {
59
+				continue;
60
+			}
59 61
 			return glsr( Helper::class )->removePrefix( 'views/', $possibleView );
60 62
 		}
61 63
 		return $view;
@@ -88,7 +90,9 @@  discard block
 block discarded – undo
88 90
 	 */
89 91
 	public function modifyField( Builder $instance )
90 92
 	{
91
-		if( !$this->isPublicInstance( $instance ) || empty( array_filter( $this->fields )))return;
93
+		if( !$this->isPublicInstance( $instance ) || empty( array_filter( $this->fields ))) {
94
+			return;
95
+		}
92 96
 		call_user_func_array( [$this, 'customize'], [&$instance] );
93 97
 	}
94 98
 
Please login to merge, or discard this patch.
plugin/Application.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,9 @@  discard block
 block discarded – undo
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
 
@@ -204,7 +206,9 @@  discard block
 block discarded – undo
204 206
 	 */
205 207
 	public function scheduleCronJob()
206 208
 	{
207
-		if( wp_next_scheduled( static::CRON_EVENT ))return;
209
+		if( wp_next_scheduled( static::CRON_EVENT )) {
210
+			return;
211
+		}
208 212
 		wp_schedule_event( time(), 'twicedaily', static::CRON_EVENT );
209 213
 	}
210 214
 
@@ -244,7 +248,9 @@  discard block
 block discarded – undo
244 248
 			|| !in_array( plugin_basename( $this->file ), $data['plugins'] )
245 249
 			|| $data['action'] != 'update'
246 250
 			|| $data['type'] != 'plugin'
247
-		)return;
251
+		) {
252
+			return;
253
+		}
248 254
 		$this->upgrade();
249 255
 	}
250 256
 
Please login to merge, or discard this patch.
plugin/Handlers/EnqueuePublicAssets.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,9 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function enqueuePolyfillService()
57 57
 	{
58
-		if( !apply_filters( 'site-reviews/assets/polyfill', true ))return;
58
+		if( !apply_filters( 'site-reviews/assets/polyfill', true )) {
59
+			return;
60
+		}
59 61
 		wp_enqueue_script( Application::ID.'/polyfill', add_query_arg([
60 62
 			'features' => 'CustomEvent,Element.prototype.closest,Element.prototype.dataset,Event,MutationObserver',
61 63
 			'flags' => 'gated',
@@ -70,7 +72,9 @@  discard block
 block discarded – undo
70 72
 		// wpforms-recaptcha
71 73
 		// google-recaptcha
72 74
 		// nf-google-recaptcha
73
-		if( !glsr( OptionManager::class )->isRecaptchaEnabled() )return;
75
+		if( !glsr( OptionManager::class )->isRecaptchaEnabled() ) {
76
+			return;
77
+		}
74 78
 		$language = apply_filters( 'site-reviews/recaptcha/language', get_locale() );
75 79
 		wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg([
76 80
 			'hl' => $language,
@@ -84,7 +88,9 @@  discard block
 block discarded – undo
84 88
 	public function inlineStyles()
85 89
 	{
86 90
 		$inlineStylesheetPath = glsr()->path( 'assets/styles/inline-styles.css' );
87
-		if( !apply_filters( 'site-reviews/assets/css', true ))return;
91
+		if( !apply_filters( 'site-reviews/assets/css', true )) {
92
+			return;
93
+		}
88 94
 		if( !file_exists( $inlineStylesheetPath )) {
89 95
 			glsr_log()->error( 'Inline stylesheet is missing: '.$inlineStylesheetPath );
90 96
 			return;
Please login to merge, or discard this patch.
plugin/Router.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,7 +17,9 @@  discard block
 block discarded – undo
17 17
 	public function routeAdminPostRequest()
18 18
 	{
19 19
 		$request = $this->getRequest();
20
-		if( !$this->isValidPostRequest( $request ))return;
20
+		if( !$this->isValidPostRequest( $request )) {
21
+			return;
22
+		}
21 23
 		check_admin_referer( $request['_action'] );
22 24
 		$this->routeRequest( 'admin', $request['_action'], $request );
23 25
 	}
@@ -39,10 +41,16 @@  discard block
 block discarded – undo
39 41
 	 */
40 42
 	public function routePublicPostRequest()
41 43
 	{
42
-		if( is_admin() )return;
44
+		if( is_admin() ) {
45
+			return;
46
+		}
43 47
 		$request = $this->getRequest();
44
-		if( !$this->isValidPostRequest( $request ))return;
45
-		if( !$this->isValidPublicNonce( $request ))return;
48
+		if( !$this->isValidPostRequest( $request )) {
49
+			return;
50
+		}
51
+		if( !$this->isValidPublicNonce( $request )) {
52
+			return;
53
+		}
46 54
 		$this->routeRequest( 'public', $request['_action'], $request );
47 55
 	}
48 56
 
@@ -51,7 +59,9 @@  discard block
 block discarded – undo
51 59
 	 */
52 60
 	protected function checkAjaxNonce( array $request )
53 61
 	{
54
-		if( !is_user_logged_in() )return;
62
+		if( !is_user_logged_in() ) {
63
+			return;
64
+		}
55 65
 		if( !isset( $request['_nonce'] )) {
56 66
 			$this->sendAjaxError( 'request is missing a nonce', $request );
57 67
 		}
Please login to merge, or discard this patch.
plugin/Modules/Html/Partials/SiteReviewsForm.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -85,7 +85,9 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	protected function buildRecaptcha()
87 87
 	{
88
-		if( !glsr( OptionManager::class )->isRecaptchaEnabled() )return;
88
+		if( !glsr( OptionManager::class )->isRecaptchaEnabled() ) {
89
+			return;
90
+		}
89 91
 		return glsr( Builder::class )->div([
90 92
 			'class' => 'glsr-recaptcha-holder',
91 93
 			'data-badge' => glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.position' ),
@@ -144,7 +146,9 @@  discard block
 block discarded – undo
144 146
 		}, $hiddenFields );
145 147
 		foreach( $fields as $field ) {
146 148
 			$index = array_search( $field->field['path'], $paths );
147
-			if( $index === false )continue;
149
+			if( $index === false ) {
150
+				continue;
151
+			}
148 152
 			unset( $hiddenFields[$index] );
149 153
 		}
150 154
 		return array_merge( $hiddenFields, $fields );
@@ -167,7 +171,9 @@  discard block
 block discarded – undo
167 171
 	 */
168 172
 	protected function getRegisterText()
169 173
 	{
170
-		if( !get_option( 'users_can_register' ) || glsr( OptionManager::class )->get( 'settings.general.require.login' ) != 'yes' )return;
174
+		if( !get_option( 'users_can_register' ) || glsr( OptionManager::class )->get( 'settings.general.require.login' ) != 'yes' ) {
175
+			return;
176
+		}
171 177
 		$registerLink = glsr( Builder::class )->a([
172 178
 			'href' => wp_registration_url(),
173 179
 			'text' => __( 'register', 'site-reviews' ),
@@ -228,7 +234,9 @@  discard block
 block discarded – undo
228 234
 	 */
229 235
 	protected function normalizeFieldId( Field &$field )
230 236
 	{
231
-		if( empty( $this->args['id'] ) || empty( $field->field['id'] ))return;
237
+		if( empty( $this->args['id'] ) || empty( $field->field['id'] )) {
238
+			return;
239
+		}
232 240
 		$field->field['id'].= '-'.$this->args['id'];
233 241
 	}
234 242
 
@@ -248,7 +256,9 @@  discard block
 block discarded – undo
248 256
 	 */
249 257
 	protected function normalizeFieldErrors( Field &$field )
250 258
 	{
251
-		if( !array_key_exists( $field->field['path'], $this->errors ))return;
259
+		if( !array_key_exists( $field->field['path'], $this->errors )) {
260
+			return;
261
+		}
252 262
 		$field->field['errors'] = $this->errors[$field->field['path']];
253 263
 	}
254 264
 
@@ -257,7 +267,9 @@  discard block
 block discarded – undo
257 267
 	 */
258 268
 	protected function normalizeFieldRequired( Field &$field )
259 269
 	{
260
-		if( !in_array( $field->field['path'], $this->required ))return;
270
+		if( !in_array( $field->field['path'], $this->required )) {
271
+			return;
272
+		}
261 273
 		$field->field['required'] = true;
262 274
 	}
263 275
 
@@ -268,7 +280,9 @@  discard block
 block discarded – undo
268 280
 	{
269 281
 		$normalizedFields = [];
270 282
 		foreach( $fields as $field ) {
271
-			if( in_array( $field->field['path'], $this->args['hide'] ))continue;
283
+			if( in_array( $field->field['path'], $this->args['hide'] )) {
284
+				continue;
285
+			}
272 286
 			$field->field['is_public'] = true;
273 287
 			$this->normalizeFieldClass( $field );
274 288
 			$this->normalizeFieldErrors( $field );
@@ -285,7 +299,9 @@  discard block
 block discarded – undo
285 299
 	 */
286 300
 	protected function normalizeFieldValue( Field &$field )
287 301
 	{
288
-		if( !array_key_exists( $field->field['path'], $this->values ))return;
302
+		if( !array_key_exists( $field->field['path'], $this->values )) {
303
+			return;
304
+		}
289 305
 		if( in_array( $field->field['type'], ['radio', 'checkbox'] )) {
290 306
 			$field->field['checked'] = $field->field['value'] == $this->values[$field->field['path']];
291 307
 		}
Please login to merge, or discard this patch.
plugin/Controllers/EditorController/Customization.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,9 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function removeAutosave()
41 41
 	{
42
-		if( !$this->isReviewEditor() || $this->isReviewEditable() )return;
42
+		if( !$this->isReviewEditor() || $this->isReviewEditable() ) {
43
+			return;
44
+		}
43 45
 		wp_deregister_script( 'autosave' );
44 46
 	}
45 47
 
@@ -56,7 +58,9 @@  discard block
 block discarded – undo
56 58
 	 */
57 59
 	public function removePostTypeSupport()
58 60
 	{
59
-		if( !$this->isReviewEditor() || $this->isReviewEditable() )return;
61
+		if( !$this->isReviewEditor() || $this->isReviewEditable() ) {
62
+			return;
63
+		}
60 64
 		remove_post_type_support( Application::POST_TYPE, 'title' );
61 65
 		remove_post_type_support( Application::POST_TYPE, 'editor' );
62 66
 	}
Please login to merge, or discard this patch.