Test Failed
Pull Request — develop (#755)
by
unknown
03:56
created
src/components/ranks/classes/rank/type.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -222,8 +222,11 @@
 block discarded – undo
222 222
 						name="<?php echo esc_attr( $name ); ?>"
223 223
 						<?php if ( $args['placeholders'] && 'hidden' !== $field['type'] ) : ?>
224 224
 						value="<% if ( typeof <?php echo preg_replace( '/[^a-z0-9_]/i', '', $name ); /* WPCS XSS OK. */ ?> !== "undefined" ) { print( <?php echo preg_replace( '/[^a-z0-9_]/i', '', $name ); /* WPCS XSS OK. */ ?> ); } %>"
225
-						<?php else : ?>
226
-						value="<?php echo esc_attr( $value ); ?>"
225
+						<?php else {
226
+	: ?>
227
+						value="<?php echo esc_attr( $value );
228
+}
229
+?>"
227 230
 						<?php endif; ?>
228 231
 						class="widefat"
229 232
 					/>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -199,8 +199,8 @@  discard block
 block discarded – undo
199 199
 				$value = $field['default'];
200 200
 
201 201
 				// If the value is set use that instead.
202
-				if ( isset( $meta[ $name ] ) ) {
203
-					$value = $meta[ $name ];
202
+				if ( isset( $meta[$name] ) ) {
203
+					$value = $meta[$name];
204 204
 				}
205 205
 			}
206 206
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 					continue;
333 333
 				}
334 334
 
335
-				$user_ranks[ $user_id ] = $new_rank->ID;
335
+				$user_ranks[$user_id] = $new_rank->ID;
336 336
 			}
337 337
 		}
338 338
 
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 					continue;
426 426
 				}
427 427
 
428
-				$user_ranks[ $user_id ] = $new_rank->ID;
428
+				$user_ranks[$user_id] = $new_rank->ID;
429 429
 			}
430 430
 		}
431 431
 
Please login to merge, or discard this patch.
src/admin/includes/functions.php 2 patches
Braces   +22 added lines, -10 removed lines patch added patch discarded remove patch
@@ -925,7 +925,8 @@  discard block
 block discarded – undo
925 925
 
926 926
 	$tab = '';
927 927
 
928
-	if ( isset( $_GET['tab'] ) ) { // WPCS: CSRF OK.
928
+	if ( isset( $_GET['tab'] ) ) {
929
+// WPCS: CSRF OK.
929 930
 
930 931
 		$tab = sanitize_key( $_GET['tab'] ); // WPCS: CSRF OK.
931 932
 	}
@@ -964,7 +965,8 @@  discard block
 block discarded – undo
964 965
 
965 966
 	$page = '';
966 967
 
967
-	if ( isset( $_GET['page'] ) ) { // WPCS: CSRF OK.
968
+	if ( isset( $_GET['page'] ) ) {
969
+// WPCS: CSRF OK.
968 970
 		$page = sanitize_key( $_GET['page'] ); // WPCS: CSRF OK.
969 971
 	}
970 972
 
@@ -1360,9 +1362,12 @@  discard block
 block discarded – undo
1360 1362
 							>
1361 1363
 								<?php esc_html_e( 'Update now', 'wordpoints' ); ?>
1362 1364
 							</a>
1363
-						<?php else : ?>
1365
+						<?php else {
1366
+	: ?>
1364 1367
 							<em>
1365
-								<?php esc_html_e( 'Automatic update is unavailable for this extension.', 'wordpoints' ); ?>
1368
+								<?php esc_html_e( 'Automatic update is unavailable for this extension.', 'wordpoints' );
1369
+}
1370
+?>
1366 1371
 							</em>
1367 1372
 						<?php endif; ?>
1368 1373
 					<?php endif; ?>
@@ -1711,8 +1716,11 @@  discard block
 block discarded – undo
1711 1716
 									?>
1712 1717
 									<a href="<?php echo esc_url( $license->get_renewal_url() ); ?>" aria-label="<?php echo esc_attr( sprintf( $aria_label, $extension['name'] ) ); ?>"><?php esc_html_e( 'Renew License', 'wordpoints' ); ?></a>
1713 1718
 								<?php endif; ?>
1714
-							<?php else : ?>
1715
-								<?php esc_html_e( 'This license key is expired.', 'wordpoints' ); ?>
1719
+							<?php else {
1720
+	: ?>
1721
+								<?php esc_html_e( 'This license key is expired.', 'wordpoints' );
1722
+}
1723
+?>
1716 1724
 							<?php endif; ?>
1717 1725
 						<?php endif; ?>
1718 1726
 					<?php endif; ?>
@@ -1738,7 +1746,8 @@  discard block
 block discarded – undo
1738 1746
 		wp_die( esc_html__( 'Sorry, you are not allowed to update WordPoints extensions for this site.', 'wordpoints' ), 403 );
1739 1747
 	}
1740 1748
 
1741
-	if ( empty( $_GET['extension'] ) ) { // WPCS: CSRF OK.
1749
+	if ( empty( $_GET['extension'] ) ) {
1750
+// WPCS: CSRF OK.
1742 1751
 		wp_die( esc_html__( 'No extension supplied.', 'wordpoints' ), 200 );
1743 1752
 	}
1744 1753
 
@@ -2265,7 +2274,8 @@  discard block
 block discarded – undo
2265 2274
  */
2266 2275
 function wordpoints_admin_ajax_breaking_module_check() {
2267 2276
 
2268
-	if ( ! isset( $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK.
2277
+	if ( ! isset( $_GET['wordpoints_module_check'] ) ) {
2278
+// WPCS: CSRF OK.
2269 2279
 		wp_die( '', 400 );
2270 2280
 	}
2271 2281
 
@@ -2275,7 +2285,8 @@  discard block
 block discarded – undo
2275 2285
 		$nonce = get_option( 'wordpoints_module_check_nonce' );
2276 2286
 	}
2277 2287
 
2278
-	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK.
2288
+	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) {
2289
+// WPCS: CSRF OK.
2279 2290
 		wp_die( '', 403 );
2280 2291
 	}
2281 2292
 
@@ -2571,7 +2582,8 @@  discard block
 block discarded – undo
2571 2582
 
2572 2583
 	// Don't show them on the extensions screen, because they would be shown before
2573 2584
 	// license activation notices, etc.
2574
-	if ( isset( $_GET['page'] ) && 'wordpoints_extensions' === $_GET['page'] ) { // WPCS: CSRF OK.
2585
+	if ( isset( $_GET['page'] ) && 'wordpoints_extensions' === $_GET['page'] ) {
2586
+// WPCS: CSRF OK.
2575 2587
 		return;
2576 2588
 	}
2577 2589
 
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 		'wordpoints_modules'            => true,
174 174
 	);
175 175
 
176
-	if ( $plugin_page && isset( $hidden_submenus[ $plugin_page ] ) ) {
176
+	if ( $plugin_page && isset( $hidden_submenus[$plugin_page] ) ) {
177 177
 		$submenu_file = 'wordpoints_extensions';
178 178
 	}
179 179
 
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 	foreach ( $objects as $slug => $object ) {
681 681
 
682 682
 		if ( $object instanceof WordPoints_Hook_UI_Script_Data_ProviderI ) {
683
-			$data[ $slug ] = $object->get_ui_script_data();
683
+			$data[$slug] = $object->get_ui_script_data();
684 684
 		}
685 685
 
686 686
 		if ( wp_script_is( "wordpoints-hooks-{$type}-{$slug}", 'registered' ) ) {
@@ -715,21 +715,21 @@  discard block
 block discarded – undo
715 715
 		/** @var WordPoints_EntityishI $child */
716 716
 		foreach ( $entity_children->get_children( $slug ) as $child_slug => $child ) {
717 717
 
718
-			$child_data[ $child_slug ] = array(
718
+			$child_data[$child_slug] = array(
719 719
 				'slug'  => $child_slug,
720 720
 				'title' => $child->get_title(),
721 721
 			);
722 722
 
723 723
 			if ( $child instanceof WordPoints_Entity_Attr ) {
724 724
 
725
-				$child_data[ $child_slug ]['_type']     = 'attr';
726
-				$child_data[ $child_slug ]['data_type'] = $child->get_data_type();
725
+				$child_data[$child_slug]['_type']     = 'attr';
726
+				$child_data[$child_slug]['data_type'] = $child->get_data_type();
727 727
 
728 728
 			} elseif ( $child instanceof WordPoints_Entity_Relationship ) {
729 729
 
730
-				$child_data[ $child_slug ]['_type']     = 'relationship';
731
-				$child_data[ $child_slug ]['primary']   = $child->get_primary_entity_slug();
732
-				$child_data[ $child_slug ]['secondary'] = $child->get_related_entity_slug();
730
+				$child_data[$child_slug]['_type']     = 'relationship';
731
+				$child_data[$child_slug]['primary']   = $child->get_primary_entity_slug();
732
+				$child_data[$child_slug]['secondary'] = $child->get_related_entity_slug();
733 733
 			}
734 734
 
735 735
 			/**
@@ -740,14 +740,14 @@  discard block
 block discarded – undo
740 740
 			 * @param array                $data  The data for the entity child.
741 741
 			 * @param WordPoints_Entityish $child The child's object.
742 742
 			 */
743
-			$child_data[ $child_slug ] = apply_filters(
743
+			$child_data[$child_slug] = apply_filters(
744 744
 				'wordpoints_hooks_ui_data_entity_child'
745
-				, $child_data[ $child_slug ]
745
+				, $child_data[$child_slug]
746 746
 				, $child
747 747
 			);
748 748
 		}
749 749
 
750
-		$entities_data[ $slug ] = array(
750
+		$entities_data[$slug] = array(
751 751
 			'slug'     => $slug,
752 752
 			'title'    => $entity->get_title(),
753 753
 			'children' => $child_data,
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
 				}
769 769
 			}
770 770
 
771
-			$entities_data[ $slug ]['values'] = $values;
771
+			$entities_data[$slug]['values'] = $values;
772 772
 		}
773 773
 
774 774
 		/**
@@ -777,9 +777,9 @@  discard block
 block discarded – undo
777 777
 		 * @param array             $data   The data for the entity.
778 778
 		 * @param WordPoints_Entity $entity The entity object.
779 779
 		 */
780
-		$entities_data[ $slug ] = apply_filters(
780
+		$entities_data[$slug] = apply_filters(
781 781
 			'wordpoints_hooks_ui_data_entity'
782
-			, $entities_data[ $slug ]
782
+			, $entities_data[$slug]
783 783
 			, $entity
784 784
 		);
785 785
 
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 	// this, so that we have the action types indexed by event slug.
813 813
 	foreach ( $event_index as $action_type => $events ) {
814 814
 		foreach ( $events as $event => $unused ) {
815
-			$event_action_types[ $event ][ $action_type ] = true;
815
+			$event_action_types[$event][$action_type] = true;
816 816
 		}
817 817
 	}
818 818
 
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 		$tab = sanitize_key( $_GET['tab'] ); // WPCS: CSRF OK.
970 970
 	}
971 971
 
972
-	if ( isset( $tabs ) && ! isset( $tabs[ $tab ] ) ) {
972
+	if ( isset( $tabs ) && ! isset( $tabs[$tab] ) ) {
973 973
 
974 974
 		reset( $tabs );
975 975
 		$tab = key( $tabs );
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
 	if ( $show_heading ) {
997 997
 
998 998
 		// translators: Current tab name.
999
-		echo '<h1>', esc_html( sprintf( __( 'WordPoints — %s', 'wordpoints' ), $tabs[ $current ] ) ), '</h1>';
999
+		echo '<h1>', esc_html( sprintf( __( 'WordPoints — %s', 'wordpoints' ), $tabs[$current] ) ), '</h1>';
1000 1000
 	}
1001 1001
 
1002 1002
 	echo '<h2 class="nav-tab-wrapper">';
@@ -1470,20 +1470,20 @@  discard block
 block discarded – undo
1470 1470
 
1471 1471
 		$url = sanitize_title_with_dashes( $server->get_slug() );
1472 1472
 
1473
-		if ( ! isset( $_POST[ "license_key-{$url}-{$extension['ID']}" ] ) ) {
1473
+		if ( ! isset( $_POST["license_key-{$url}-{$extension['ID']}"] ) ) {
1474 1474
 			continue;
1475 1475
 		}
1476 1476
 
1477 1477
 		$license_key = sanitize_key(
1478
-			$_POST[ "license_key-{$url}-{$extension['ID']}" ]
1478
+			$_POST["license_key-{$url}-{$extension['ID']}"]
1479 1479
 		);
1480 1480
 
1481 1481
 		$license = $api->get_extension_license_object( $extension_data, $license_key );
1482 1482
 
1483 1483
 		if (
1484 1484
 			isset(
1485
-				$_POST[ "activate-license-{$extension['ID']}" ]
1486
-				, $_POST[ "wordpoints_activate_license_key-{$extension['ID']}" ]
1485
+				$_POST["activate-license-{$extension['ID']}"]
1486
+				, $_POST["wordpoints_activate_license_key-{$extension['ID']}"]
1487 1487
 			)
1488 1488
 			&& wordpoints_verify_nonce(
1489 1489
 				"wordpoints_activate_license_key-{$extension['ID']}"
@@ -1529,8 +1529,8 @@  discard block
 block discarded – undo
1529 1529
 
1530 1530
 		} elseif (
1531 1531
 			isset(
1532
-				$_POST[ "deactivate-license-{$extension['ID']}" ]
1533
-				, $_POST[ "wordpoints_deactivate_license_key-{$extension['ID']}" ]
1532
+				$_POST["deactivate-license-{$extension['ID']}"]
1533
+				, $_POST["wordpoints_deactivate_license_key-{$extension['ID']}"]
1534 1534
 			)
1535 1535
 			&& wordpoints_verify_nonce(
1536 1536
 				"wordpoints_deactivate_license_key-{$extension['ID']}"
@@ -1786,11 +1786,11 @@  discard block
 block discarded – undo
1786 1786
 
1787 1787
 	$extensions = wordpoints_get_modules();
1788 1788
 
1789
-	if ( ! isset( $extensions[ $extension_file ] ) ) {
1789
+	if ( ! isset( $extensions[$extension_file] ) ) {
1790 1790
 		wp_die( esc_html__( 'That extension does not exist.', 'wordpoints' ), 200 );
1791 1791
 	}
1792 1792
 
1793
-	$server = wordpoints_get_server_for_extension( $extensions[ $extension_file ] );
1793
+	$server = wordpoints_get_server_for_extension( $extensions[$extension_file] );
1794 1794
 
1795 1795
 	if ( ! $server ) {
1796 1796
 		wp_die( esc_html__( 'There is no server specified for this extension.', 'wordpoints' ), 200 );
@@ -1803,7 +1803,7 @@  discard block
 block discarded – undo
1803 1803
 	}
1804 1804
 
1805 1805
 	$extension_data = new WordPoints_Extension_Server_API_Extension_Data(
1806
-		$extensions[ $extension_file ]['ID']
1806
+		$extensions[$extension_file]['ID']
1807 1807
 		, $server
1808 1808
 	);
1809 1809
 
@@ -2180,7 +2180,7 @@  discard block
 block discarded – undo
2180 2180
 
2181 2181
 			foreach ( $merged_extensions as $i => $extension ) {
2182 2182
 				if ( true !== wordpoints_validate_module( $extension ) ) {
2183
-					unset( $merged_extensions[ $i ] );
2183
+					unset( $merged_extensions[$i] );
2184 2184
 				}
2185 2185
 			}
2186 2186
 
@@ -2358,11 +2358,11 @@  discard block
 block discarded – undo
2358 2358
 	// this transient.
2359 2359
 	$updates = get_site_transient( 'update_plugins' );
2360 2360
 
2361
-	if ( ! isset( $updates->response[ $plugin_basename ] ) ) {
2361
+	if ( ! isset( $updates->response[$plugin_basename] ) ) {
2362 2362
 		return false;
2363 2363
 	}
2364 2364
 
2365
-	if ( ! isset( $updates->response[ $plugin_basename ]->wordpoints_required_php ) ) {
2365
+	if ( ! isset( $updates->response[$plugin_basename]->wordpoints_required_php ) ) {
2366 2366
 
2367 2367
 		/**
2368 2368
 		 * The plugin install functions.
@@ -2397,13 +2397,13 @@  discard block
 block discarded – undo
2397 2397
 			$version = $matches[1];
2398 2398
 		}
2399 2399
 
2400
-		$updates->response[ $plugin_basename ]->wordpoints_required_php = $version;
2400
+		$updates->response[$plugin_basename]->wordpoints_required_php = $version;
2401 2401
 
2402 2402
 		set_site_transient( 'update_plugins', $updates );
2403 2403
 
2404 2404
 	} // End if ( PHP requirements not in cache ).
2405 2405
 
2406
-	return $updates->response[ $plugin_basename ]->wordpoints_required_php;
2406
+	return $updates->response[$plugin_basename]->wordpoints_required_php;
2407 2407
 }
2408 2408
 
2409 2409
 /**
@@ -2485,11 +2485,11 @@  discard block
 block discarded – undo
2485 2485
 	// First check that there is actually an update available.
2486 2486
 	$updates = get_site_transient( 'update_plugins' );
2487 2487
 
2488
-	if ( ! isset( $updates->response[ $file ] ) ) {
2488
+	if ( ! isset( $updates->response[$file] ) ) {
2489 2489
 		return;
2490 2490
 	}
2491 2491
 
2492
-	$response = $updates->response[ $file ];
2492
+	$response = $updates->response[$file];
2493 2493
 
2494 2494
 	$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
2495 2495
 
@@ -2618,8 +2618,8 @@  discard block
 block discarded – undo
2618 2618
 
2619 2619
 	$plugin_basename = plugin_basename( WORDPOINTS_DIR . '/wordpoints.php' );
2620 2620
 
2621
-	if ( isset( $data->response[ $plugin_basename ] ) ) {
2622
-		unset( $data->response[ $plugin_basename ] );
2621
+	if ( isset( $data->response[$plugin_basename] ) ) {
2622
+		unset( $data->response[$plugin_basename] );
2623 2623
 	}
2624 2624
 
2625 2625
 	return $data;
Please login to merge, or discard this patch.
src/classes/db/query.php 2 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 
488 488
 		$fields = implode( ', ', array_map( 'wordpoints_escape_mysql_identifier', $fields ) );
489 489
 
490
-		$this->select = "SELECT {$fields}";
490
+		$this->select = "select {$fields}";
491 491
 	}
492 492
 
493 493
 	/**
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 		}
778 778
 
779 779
 		if ( $this->args['limit'] > 0 && $this->args['offset'] >= 0 ) {
780
-			$this->limit = "LIMIT {$this->args['offset']}, {$this->args['limit']}";
780
+			$this->limit = "limit {$this->args['offset']}, {$this->args['limit']}";
781 781
 		}
782 782
 	}
783 783
 
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 		}
244 244
 
245 245
 		foreach ( $this->deprecated_args as $arg => $data ) {
246
-			if ( isset( $args[ $arg ] ) ) {
246
+			if ( isset( $args[$arg] ) ) {
247 247
 
248 248
 				_deprecated_argument(
249 249
 					esc_html( "{$data['class']}::__construct" )
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
 					, esc_html( "{$arg} is deprecated, use {$data['replacement']} instead" )
252 252
 				);
253 253
 
254
-				$args[ $data['replacement'] ] = $args[ $arg ];
254
+				$args[$data['replacement']] = $args[$arg];
255 255
 
256
-				unset( $args[ $arg ] );
256
+				unset( $args[$arg] );
257 257
 			}
258 258
 		}
259 259
 
@@ -271,19 +271,19 @@  discard block
 block discarded – undo
271 271
 	 */
272 272
 	public function get_arg( $arg ) {
273 273
 
274
-		if ( isset( $this->deprecated_args[ $arg ] ) ) {
274
+		if ( isset( $this->deprecated_args[$arg] ) ) {
275 275
 
276 276
 			_deprecated_argument(
277
-				esc_html( "{$this->deprecated_args[ $arg ]['class']}::get_arg" )
278
-				, esc_html( $this->deprecated_args[ $arg ]['version'] )
279
-				, esc_html( "{$arg} is deprecated, use {$this->deprecated_args[ $arg ]['replacement']} instead" )
277
+				esc_html( "{$this->deprecated_args[$arg]['class']}::get_arg" )
278
+				, esc_html( $this->deprecated_args[$arg]['version'] )
279
+				, esc_html( "{$arg} is deprecated, use {$this->deprecated_args[$arg]['replacement']} instead" )
280 280
 			);
281 281
 
282
-			$arg = $this->deprecated_args[ $arg ]['replacement'];
282
+			$arg = $this->deprecated_args[$arg]['replacement'];
283 283
 		}
284 284
 
285
-		if ( isset( $this->args[ $arg ] ) ) {
286
-			return $this->args[ $arg ];
285
+		if ( isset( $this->args[$arg] ) ) {
286
+			return $this->args[$arg];
287 287
 		} else {
288 288
 			return null;
289 289
 		}
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 	public function set_args( array $args ) {
305 305
 
306 306
 		foreach ( $this->deprecated_args as $arg => $data ) {
307
-			if ( isset( $args[ $arg ] ) ) {
307
+			if ( isset( $args[$arg] ) ) {
308 308
 
309 309
 				_deprecated_argument(
310 310
 					esc_html( "{$data['class']}::set_args" )
@@ -312,9 +312,9 @@  discard block
 block discarded – undo
312 312
 					, esc_html( "{$arg} is deprecated, use {$data['replacement']} instead" )
313 313
 				);
314 314
 
315
-				$args[ $data['replacement'] ] = $args[ $arg ];
315
+				$args[$data['replacement']] = $args[$arg];
316 316
 
317
-				unset( $args[ $arg ] );
317
+				unset( $args[$arg] );
318 318
 			}
319 319
 		}
320 320
 
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 			$value = $this->validate_value( $value, $validators );
532 532
 
533 533
 			if ( false === $value ) {
534
-				unset( $values[ $index ] );
534
+				unset( $values[$index] );
535 535
 			}
536 536
 		}
537 537
 
@@ -595,11 +595,11 @@  discard block
 block discarded – undo
595 595
 	protected function prepare_column_where( $column, $data ) {
596 596
 
597 597
 		// If a single value has been supplied for the column, it takes precedence.
598
-		if ( isset( $this->args[ $column ] ) ) {
598
+		if ( isset( $this->args[$column] ) ) {
599 599
 			$this->prepare_column( $column, $data );
600
-		} elseif ( isset( $this->args[ "{$column}__in" ] ) ) {
600
+		} elseif ( isset( $this->args["{$column}__in"] ) ) {
601 601
 			$this->prepare_column__in( $column, $data );
602
-		} elseif ( isset( $this->args[ "{$column}__not_in" ] ) ) {
602
+		} elseif ( isset( $this->args["{$column}__not_in"] ) ) {
603 603
 			$this->prepare_column__in( $column, $data, 'NOT IN' );
604 604
 		}
605 605
 	}
@@ -618,13 +618,13 @@  discard block
 block discarded – undo
618 618
 
619 619
 		if (
620 620
 			isset( $data['values'] )
621
-			&& ! in_array( $this->args[ $column ], $data['values'], true )
621
+			&& ! in_array( $this->args[$column], $data['values'], true )
622 622
 		) {
623 623
 			return;
624 624
 		}
625 625
 
626 626
 		$value = $this->validate_value(
627
-			$this->args[ $column ]
627
+			$this->args[$column]
628 628
 			, $this->get_validators_for_column( $data )
629 629
 		);
630 630
 
@@ -665,10 +665,10 @@  discard block
 block discarded – undo
665 665
 		$comparator = '=';
666 666
 
667 667
 		if (
668
-			isset( $this->args[ "{$column}__compare" ] )
669
-			&& in_array( $this->args[ "{$column}__compare" ], $comparisons, true )
668
+			isset( $this->args["{$column}__compare"] )
669
+			&& in_array( $this->args["{$column}__compare"], $comparisons, true )
670 670
 		) {
671
-			$comparator = $this->args[ "{$column}__compare" ];
671
+			$comparator = $this->args["{$column}__compare"];
672 672
 		}
673 673
 
674 674
 		return $comparator;
@@ -687,11 +687,11 @@  discard block
 block discarded – undo
687 687
 
688 688
 		$key = "{$column}__" . strtolower( str_replace( ' ', '_', $type ) );
689 689
 
690
-		if ( empty( $this->args[ $key ] ) || ! is_array( $this->args[ $key ] ) ) {
690
+		if ( empty( $this->args[$key] ) || ! is_array( $this->args[$key] ) ) {
691 691
 			return;
692 692
 		}
693 693
 
694
-		$values = $this->args[ $key ];
694
+		$values = $this->args[$key];
695 695
 
696 696
 		if ( isset( $data['values'] ) ) {
697 697
 			$values = array_intersect( $values, $data['values'] );
@@ -758,9 +758,9 @@  discard block
 block discarded – undo
758 758
 		foreach ( array( 'limit', 'offset' ) as $key ) {
759 759
 
760 760
 			// Save a backup of the arg value since wordpoints_int() is by reference.
761
-			$arg = $this->args[ $key ];
761
+			$arg = $this->args[$key];
762 762
 
763
-			if ( false === wordpoints_int( $this->args[ $key ] ) ) {
763
+			if ( false === wordpoints_int( $this->args[$key] ) ) {
764 764
 
765 765
 				_doing_it_wrong(
766 766
 					__METHOD__
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 					, '1.0.0'
773 773
 				);
774 774
 
775
-				$this->args[ $key ] = 0;
775
+				$this->args[$key] = 0;
776 776
 			}
777 777
 		}
778 778
 
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
 				$order_by = "{$meta_table_name}.meta_value";
821 821
 			}
822 822
 
823
-		} elseif ( isset( $this->columns[ $order_by ] ) ) {
823
+		} elseif ( isset( $this->columns[$order_by] ) ) {
824 824
 
825 825
 			$order_by = wordpoints_escape_mysql_identifier( $order_by );
826 826
 
@@ -843,15 +843,15 @@  discard block
 block discarded – undo
843 843
 	protected function prepare_date_where( $column ) {
844 844
 
845 845
 		if (
846
-			empty( $this->args[ "{$column}_query" ] )
847
-			|| ! is_array( $this->args[ "{$column}_query" ] )
846
+			empty( $this->args["{$column}_query"] )
847
+			|| ! is_array( $this->args["{$column}_query"] )
848 848
 		) {
849 849
 			return;
850 850
 		}
851 851
 
852 852
 		add_filter( 'date_query_valid_columns', array( $this, 'date_query_valid_columns_filter' ) );
853 853
 
854
-		$date_query = new WP_Date_Query( $this->args[ "{$column}_query" ], $column );
854
+		$date_query = new WP_Date_Query( $this->args["{$column}_query"], $column );
855 855
 		$date_query = $date_query->get_sql();
856 856
 
857 857
 		if ( ! empty( $date_query ) ) {
Please login to merge, or discard this patch.
src/includes/filters.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@
 block discarded – undo
39 39
 add_action( 'wordpoints_extensions_loaded', 'wordpoints_installables_maybe_update', 5 );
40 40
 add_action( 'wpmu_new_blog', 'wordpoints_installables_install_on_new_site' );
41 41
 
42
-if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK.
42
+if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) {
43
+// WPCS: CSRF OK.
43 44
 
44 45
 	add_action( 'shutdown', 'wordpoints_maintenance_shutdown_print_rand_str' );
45 46
 
Please login to merge, or discard this patch.
src/admin/classes/list/table/extensions.php 2 patches
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -76,11 +76,13 @@  discard block
 block discarded – undo
76 76
 		 */
77 77
 		$module_statuses = apply_filters( 'wordpoints_module_statuses', $module_statuses );
78 78
 
79
-		if ( isset( $_REQUEST['module_status'] ) && in_array( wp_unslash( $_REQUEST['module_status'] ), $module_statuses, true ) ) { // WPCS: CSRF OK.
79
+		if ( isset( $_REQUEST['module_status'] ) && in_array( wp_unslash( $_REQUEST['module_status'] ), $module_statuses, true ) ) {
80
+// WPCS: CSRF OK.
80 81
 			$status = sanitize_key( $_REQUEST['module_status'] ); // WPCS: CSRF OK.
81 82
 		}
82 83
 
83
-		if ( isset( $_REQUEST['s'] ) ) { // WPCS: CSRF OK.
84
+		if ( isset( $_REQUEST['s'] ) ) {
85
+// WPCS: CSRF OK.
84 86
 			$_SERVER['REQUEST_URI'] = add_query_arg( 's', sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) ); // WPCS: CSRF OK.
85 87
 		}
86 88
 
@@ -342,7 +344,8 @@  discard block
 block discarded – undo
342 344
 
343 345
 		static $term;
344 346
 
345
-		if ( is_null( $term ) && isset( $_REQUEST['s'] ) ) { // WPCS: CSRF OK.
347
+		if ( is_null( $term ) && isset( $_REQUEST['s'] ) ) {
348
+// WPCS: CSRF OK.
346 349
 			$term = sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ); // WPCS: CSRF OK.
347 350
 		}
348 351
 
@@ -802,9 +805,12 @@  discard block
 block discarded – undo
802 805
 				<p>
803 806
 					<?php if ( ! empty( $module_data['description'] ) ) : ?>
804 807
 						<?php echo wp_kses( $module_data['description'], 'wordpoints_module_description' ); ?>
805
-					<?php else : ?>
808
+					<?php else {
809
+	: ?>
806 810
 						&nbsp;
807
-					<?php endif; ?>
811
+					<?php endif;
812
+}
813
+?>
808 814
 				</p>
809 815
 			</div>
810 816
 			<div class="<?php echo esc_attr( $class ); ?> second module-version-author-uri">
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 			foreach ( $recently_activated as $key => $time ) {
174 174
 
175 175
 				if ( $time + WEEK_IN_SECONDS < time() ) {
176
-					unset( $recently_activated[ $key ] );
176
+					unset( $recently_activated[$key] );
177 177
 				}
178 178
 			}
179 179
 
@@ -212,9 +212,9 @@  discard block
 block discarded – undo
212 212
 			) {
213 213
 
214 214
 				if ( $show_network_active ) {
215
-					$modules['inactive'][ $module_file ] = $module_data; // WPCS: prefix OK.
215
+					$modules['inactive'][$module_file] = $module_data; // WPCS: prefix OK.
216 216
 				} else {
217
-					unset( $modules['all'][ $module_file ] );
217
+					unset( $modules['all'][$module_file] );
218 218
 				}
219 219
 
220 220
 			} elseif (
@@ -223,9 +223,9 @@  discard block
 block discarded – undo
223 223
 			) {
224 224
 
225 225
 				if ( $show_network_active ) {
226
-					$modules['active'][ $module_file ] = $module_data; // WPCS: prefix OK.
226
+					$modules['active'][$module_file] = $module_data; // WPCS: prefix OK.
227 227
 				} else {
228
-					unset( $modules['all'][ $module_file ] );
228
+					unset( $modules['all'][$module_file] );
229 229
 				}
230 230
 
231 231
 			} elseif (
@@ -238,16 +238,16 @@  discard block
 block discarded – undo
238 238
 				)
239 239
 			) {
240 240
 
241
-				$modules['active'][ $module_file ] = $module_data; // WPCS: prefix OK.
241
+				$modules['active'][$module_file] = $module_data; // WPCS: prefix OK.
242 242
 
243 243
 			} else {
244 244
 
245 245
 				// Was the module recently activated?
246
-				if ( ! $this->screen->in_admin( 'network' ) && isset( $recently_activated[ $module_file ] ) ) {
247
-					$modules['recently_activated'][ $module_file ] = $module_data; // WPCS: prefix OK.
246
+				if ( ! $this->screen->in_admin( 'network' ) && isset( $recently_activated[$module_file] ) ) {
247
+					$modules['recently_activated'][$module_file] = $module_data; // WPCS: prefix OK.
248 248
 				}
249 249
 
250
-				$modules['inactive'][ $module_file ] = $module_data; // WPCS: prefix OK.
250
+				$modules['inactive'][$module_file] = $module_data; // WPCS: prefix OK.
251 251
 
252 252
 			} // End if ().
253 253
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 			 * for modules that have an available update.
257 257
 			 */
258 258
 			if ( $user_can_update && $updates->has_update( $module_file ) ) {
259
-				$modules['upgrade'][ $module_file ] = $modules['all'][ $module_file ]; // WPCS: prefix OK.
259
+				$modules['upgrade'][$module_file] = $modules['all'][$module_file]; // WPCS: prefix OK.
260 260
 			}
261 261
 
262 262
 		} // End foreach ( modules ).
@@ -289,21 +289,21 @@  discard block
 block discarded – undo
289 289
 		$totals = array();
290 290
 
291 291
 		foreach ( $modules as $type => $list ) {
292
-			$totals[ $type ] = count( $list );
292
+			$totals[$type] = count( $list );
293 293
 		}
294 294
 
295
-		if ( empty( $modules[ $status ] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) {
295
+		if ( empty( $modules[$status] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) {
296 296
 			$status = 'all';
297 297
 		}
298 298
 
299 299
 		$this->items = array();
300 300
 
301
-		foreach ( $modules[ $status ] as $module_file => $module_data ) {
301
+		foreach ( $modules[$status] as $module_file => $module_data ) {
302 302
 
303
-			$this->items[ $module_file ] = wordpoints_get_module_data( wordpoints_extensions_dir() . '/' . $module_file, false );
303
+			$this->items[$module_file] = wordpoints_get_module_data( wordpoints_extensions_dir() . '/' . $module_file, false );
304 304
 		}
305 305
 
306
-		$total_this_page = $totals[ $status ];
306
+		$total_this_page = $totals[$status];
307 307
 
308 308
 		if ( ! $orderby ) {
309 309
 			$orderby = 'name';
@@ -372,8 +372,8 @@  discard block
 block discarded – undo
372 372
 
373 373
 		global $orderby, $order;
374 374
 
375
-		$a = $module_a[ $orderby ];
376
-		$b = $module_b[ $orderby ];
375
+		$a = $module_a[$orderby];
376
+		$b = $module_b[$orderby];
377 377
 
378 378
 		if ( $a === $b ) {
379 379
 			return 0;
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 				 */
481 481
 				$text = apply_filters( "wordpoints_modules_status_link_text-{$type}", $text, $count );
482 482
 
483
-				$status_links[ $type ] = sprintf(
483
+				$status_links[$type] = sprintf(
484 484
 					"<a href='%s' %s>%s</a>"
485 485
 					, esc_url( add_query_arg( 'module_status', $type, self_admin_url( 'admin.php?page=wordpoints_extensions' ) ) )
486 486
 					, ( $type === $status ) ? ' class="current"' : ''
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 		$module_data['extra']['restricted_network_active'] = $restricted_network_active;
701 701
 		$module_data['extra']['restricted_network_only']   = $restricted_network_only;
702 702
 
703
-		list( $columns, $hidden, , $primary ) = $this->get_column_info();
703
+		list( $columns, $hidden,, $primary ) = $this->get_column_info();
704 704
 
705 705
 		foreach ( $columns as $column_name => $column_display_name ) {
706 706
 
Please login to merge, or discard this patch.
src/components/points/admin/screens/hooks-no-js-load.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 	$points_types_hooks = WordPoints_Points_Hooks::get_defaults();
40 40
 }
41 41
 
42
-if ( isset( $points_types_hooks[ $points_type_id ] ) ) {
43
-	$points_type_hooks = $points_types_hooks[ $points_type_id ];
42
+if ( isset( $points_types_hooks[$points_type_id] ) ) {
43
+	$points_type_hooks = $points_types_hooks[$points_type_id];
44 44
 } else {
45 45
 	$points_type_hooks = array();
46 46
 }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	}
60 60
 
61 61
 	// Remove the hook from this points type.
62
-	$points_types_hooks[ $points_type_id ] = array_diff( $points_type_hooks, array( $hook_id ) );
62
+	$points_types_hooks[$points_type_id] = array_diff( $points_type_hooks, array( $hook_id ) );
63 63
 
64 64
 	$hook->delete_callback( $hook_id );
65 65
 
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
 
84 84
 	} else {
85 85
 
86
-		if ( isset( $_POST[ 'hook-' . $id_base ] ) && is_array( $_POST[ 'hook-' . $id_base ] ) ) {
87
-			$new_instance = wp_unslash( reset( $_POST[ 'hook-' . $id_base ] ) ); // WPCS sanitization OK.
86
+		if ( isset( $_POST['hook-' . $id_base] ) && is_array( $_POST['hook-' . $id_base] ) ) {
87
+			$new_instance = wp_unslash( reset( $_POST['hook-' . $id_base] ) ); // WPCS sanitization OK.
88 88
 		}
89 89
 
90 90
 		$number = $hook->get_number_by_id( $hook_id );
@@ -102,15 +102,15 @@  discard block
 block discarded – undo
102 102
 	if ( ! in_array( $hook_id, $points_type_hooks, true ) ) {
103 103
 
104 104
 		$points_type_hooks[] = $hook_id;
105
-		$points_types_hooks[ $points_type_id ] = $points_type_hooks;
105
+		$points_types_hooks[$points_type_id] = $points_type_hooks;
106 106
 	}
107 107
 
108 108
 	// Remove from old points type if it has changed.
109 109
 	$old_points_type = WordPoints_Points_Hooks::get_points_type( $hook_id );
110 110
 
111
-	if ( $old_points_type && $old_points_type !== $points_type_id && is_array( $points_types_hooks[ $old_points_type ] ) ) {
111
+	if ( $old_points_type && $old_points_type !== $points_type_id && is_array( $points_types_hooks[$old_points_type] ) ) {
112 112
 
113
-		$points_types_hooks[ $old_points_type ] = array_diff( $points_types_hooks[ $old_points_type ], array( $hook_id ) );
113
+		$points_types_hooks[$old_points_type] = array_diff( $points_types_hooks[$old_points_type], array( $hook_id ) );
114 114
 	}
115 115
 
116 116
 } else {
Please login to merge, or discard this patch.
src/components/points/admin/screens/logs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
 
48 48
 		foreach ( $points_types as $slug => $settings ) {
49 49
 
50
-			$tabs[ $slug ] = $settings['name'];
50
+			$tabs[$slug] = $settings['name'];
51 51
 		}
52 52
 
53 53
 		wordpoints_admin_show_tabs( $tabs, false );
Please login to merge, or discard this patch.
src/components/points/admin/includes/ajax.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 
47 47
 	foreach ( array_keys( wordpoints_get_points_types() ) as $points_type ) {
48 48
 
49
-		if ( empty( $_POST['points_types'][ $points_type ] ) ) {
49
+		if ( empty( $_POST['points_types'][$points_type] ) ) {
50 50
 			continue;
51 51
 		}
52 52
 
53
-		$hooks = sanitize_text_field( wp_unslash( $_POST['points_types'][ $points_type ] ) );
53
+		$hooks = sanitize_text_field( wp_unslash( $_POST['points_types'][$points_type] ) );
54 54
 
55 55
 		$points_type_hooks = array();
56 56
 
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
 				continue;
63 63
 			}
64 64
 
65
-			$points_type_hooks[ $order ] = substr( $hook_id, strpos( $hook_id, '_' ) + 1 );
65
+			$points_type_hooks[$order] = substr( $hook_id, strpos( $hook_id, '_' ) + 1 );
66 66
 		}
67 67
 
68
-		$points_types_hooks[ $points_type ] = $points_type_hooks;
68
+		$points_types_hooks[$points_type] = $points_type_hooks;
69 69
 	}
70 70
 
71 71
 	WordPoints_Points_Hooks::save_points_types_hooks( $points_types_hooks );
@@ -189,14 +189,14 @@  discard block
 block discarded – undo
189 189
 
190 190
 		$settings = false;
191 191
 
192
-		if ( isset( $_POST[ 'hook-' . $id_base ] ) && is_array( $_POST[ 'hook-' . $id_base ] ) ) {
193
-			$settings = wp_unslash( $_POST[ 'hook-' . $id_base ] ); // WPCS: sanitization OK.
192
+		if ( isset( $_POST['hook-' . $id_base] ) && is_array( $_POST['hook-' . $id_base] ) ) {
193
+			$settings = wp_unslash( $_POST['hook-' . $id_base] ); // WPCS: sanitization OK.
194 194
 		}
195 195
 
196 196
 		$points_types_hooks = WordPoints_Points_Hooks::get_points_types_hooks();
197 197
 
198 198
 		// Get the hooks for this points type.
199
-		$points_type_hooks = ( isset( $points_types_hooks[ $points_type_id ] ) ) ? $points_types_hooks[ $points_type_id ] : array();
199
+		$points_type_hooks = ( isset( $points_types_hooks[$points_type_id] ) ) ? $points_types_hooks[$points_type_id] : array();
200 200
 
201 201
 		if ( ! empty( $_POST['delete_hook'] ) ) {
202 202
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 			$hook->delete_callback( $number );
210 210
 
211 211
 			// Remove this instance of the hook, and reset the positions (keys).
212
-			$points_types_hooks[ $points_type_id ] = array_diff( $points_type_hooks, array( $hook_id ) );
212
+			$points_types_hooks[$points_type_id] = array_diff( $points_type_hooks, array( $hook_id ) );
213 213
 
214 214
 			WordPoints_Points_Hooks::save_points_types_hooks( $points_types_hooks );
215 215
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 
231 231
 			// Save the points types-hooks associations.
232 232
 			$points_type_hooks[] = $hook->get_id( $number );
233
-			$points_types_hooks[ $points_type_id ] = $points_type_hooks;
233
+			$points_types_hooks[$points_type_id] = $points_type_hooks;
234 234
 			WordPoints_Points_Hooks::save_points_types_hooks( $points_types_hooks );
235 235
 
236 236
 		} else {
Please login to merge, or discard this patch.
src/components/points/classes/hook/extension/legacy/reversals.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	protected function get_points_logs_to_be_reversed( WordPoints_Hook_Fire $fire ) {
67 67
 
68
-		if ( isset( $fire->data[ $this->slug ]['points_logs'] ) ) {
69
-			return $fire->data[ $this->slug ]['points_logs'];
68
+		if ( isset( $fire->data[$this->slug]['points_logs'] ) ) {
69
+			return $fire->data[$this->slug]['points_logs'];
70 70
 		}
71 71
 
72 72
 		$meta_queries = array(
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			$entities = $fire->event_args->get_signature_args();
86 86
 
87 87
 			if ( ! $entities ) {
88
-				$fire->data[ $this->slug ]['points_logs'] = array();
88
+				$fire->data[$this->slug]['points_logs'] = array();
89 89
 				return array();
90 90
 			}
91 91
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 			$logs = array();
118 118
 		}
119 119
 
120
-		$fire->data[ $this->slug ]['points_logs'] = $logs;
120
+		$fire->data[$this->slug]['points_logs'] = $logs;
121 121
 
122 122
 		return $logs;
123 123
 	}
Please login to merge, or discard this patch.