Completed
Push — master ( dce43d...f66823 )
by J.D.
04:19
created
src/includes/class-un-installer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 		parent::before_update();
141 141
 
142 142
 		if ( $this->network_wide ) {
143
-			unset( $this->updates['1_8_0'] );
143
+			unset( $this->updates[ '1_8_0' ] );
144 144
 		}
145 145
 	}
146 146
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 			// Make sure the version is set properly even if the data is already
169 169
 			// there, in case the plugin is being reactivated and things had been
170 170
 			// corrupted somehow.
171
-			$data['version'] = WORDPOINTS_VERSION;
171
+			$data[ 'version' ] = WORDPOINTS_VERSION;
172 172
 
173 173
 			wordpoints_update_maybe_network_option( 'wordpoints_data', $data );
174 174
 		}
Please login to merge, or discard this patch.
src/includes/maintenance.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 }
21 21
 
22 22
 // If we're not running a module check, let the maintenance message show.
23
-if ( ! isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK.
23
+if ( ! isset( $_GET[ 'wordpoints_module_check' ], $_GET[ 'check_module' ] ) ) { // WPCS: CSRF OK.
24 24
 	return;
25 25
 }
26 26
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@
 block discarded – undo
20 20
 }
21 21
 
22 22
 // If we're not running a module check, let the maintenance message show.
23
-if ( ! isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK.
23
+if ( ! isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) {
24
+// WPCS: CSRF OK.
24 25
 	return;
25 26
 }
26 27
 
Please login to merge, or discard this patch.
src/includes/modules.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 	$module_data = wordpoints_get_module_data( wordpoints_modules_dir() . '/' . $module );
71 71
 
72
-	return $module_data['network'];
72
+	return $module_data[ 'network' ];
73 73
 }
74 74
 
75 75
 /**
@@ -257,17 +257,17 @@  discard block
 block discarded – undo
257 257
 
258 258
 	$module_data = WordPoints_Modules::get_data( $module_file );
259 259
 
260
-	if ( $module_data && wp_normalize_path( $module_file ) === $module_data['raw_file'] ) {
261
-		unset( $module_data['raw'], $module_data['raw_file'] );
260
+	if ( $module_data && wp_normalize_path( $module_file ) === $module_data[ 'raw_file' ] ) {
261
+		unset( $module_data[ 'raw' ], $module_data[ 'raw_file' ] );
262 262
 	} else {
263 263
 		$module_data = get_file_data( $module_file, $default_headers, 'wordpoints_module' );
264 264
 	}
265 265
 
266
-	if ( ! empty( $module_data['update_api'] ) ) {
266
+	if ( ! empty( $module_data[ 'update_api' ] ) ) {
267 267
 		_deprecated_argument( __FUNCTION__, '1.10.0', 'The "Update API" module header has been deprecated in favor of "Channel".' );
268 268
 	}
269 269
 
270
-	$module_data['network'] = ( 'true' === strtolower( $module_data['network'] ) );
270
+	$module_data[ 'network' ] = ( 'true' === strtolower( $module_data[ 'network' ] ) );
271 271
 
272 272
 	if ( $markup || $translate ) {
273 273
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 		// Translate fields
278 278
 		if ( $translate ) {
279 279
 
280
-			$textdomain = $module_data['text_domain'];
280
+			$textdomain = $module_data[ 'text_domain' ];
281 281
 
282 282
 			if ( $textdomain ) {
283 283
 
@@ -285,8 +285,8 @@  discard block
 block discarded – undo
285 285
 
286 286
 					$domain_path = dirname( $module_file );
287 287
 
288
-					if ( $module_data['domain_path'] ) {
289
-						$domain_path .= $module_data['domain_path'];
288
+					if ( $module_data[ 'domain_path' ] ) {
289
+						$domain_path .= $module_data[ 'domain_path' ];
290 290
 					}
291 291
 
292 292
 					wordpoints_load_module_textdomain( $textdomain, $domain_path );
@@ -309,48 +309,48 @@  discard block
 block discarded – undo
309 309
 		);
310 310
 
311 311
 		$allowed_tags = $allowed_tags_in_links;
312
-		$allowed_tags['a'] = array( 'href' => true, 'title' => true );
312
+		$allowed_tags[ 'a' ] = array( 'href' => true, 'title' => true );
313 313
 
314 314
 		// Name and author ar marked up inside <a> tags. Don't allow these.
315
-		$module_data['name']   = wp_kses( $module_data['name'],   $allowed_tags_in_links );
316
-		$module_data['author'] = wp_kses( $module_data['author'], $allowed_tags_in_links );
315
+		$module_data[ 'name' ]   = wp_kses( $module_data[ 'name' ], $allowed_tags_in_links );
316
+		$module_data[ 'author' ] = wp_kses( $module_data[ 'author' ], $allowed_tags_in_links );
317 317
 
318
-		$module_data['description'] = wp_kses( $module_data['description'], $allowed_tags );
319
-		$module_data['version']     = wp_kses( $module_data['version'],     $allowed_tags );
318
+		$module_data[ 'description' ] = wp_kses( $module_data[ 'description' ], $allowed_tags );
319
+		$module_data[ 'version' ]     = wp_kses( $module_data[ 'version' ], $allowed_tags );
320 320
 
321
-		$module_data['module_uri'] = esc_url( $module_data['module_uri'] );
322
-		$module_data['author_uri'] = esc_url( $module_data['author_uri'] );
321
+		$module_data[ 'module_uri' ] = esc_url( $module_data[ 'module_uri' ] );
322
+		$module_data[ 'author_uri' ] = esc_url( $module_data[ 'author_uri' ] );
323 323
 
324
-		$module_data['title']       = $module_data['name'];
325
-		$module_data['author_name'] = $module_data['author'];
324
+		$module_data[ 'title' ]       = $module_data[ 'name' ];
325
+		$module_data[ 'author_name' ] = $module_data[ 'author' ];
326 326
 
327 327
 		// Apply markup.
328 328
 		if ( $markup ) {
329 329
 
330
-			if ( $module_data['module_uri'] && $module_data['name'] ) {
331
-				$module_data['title'] = '<a href="' . $module_data['module_uri']
332
-					. '">' . $module_data['name'] . '</a>';
330
+			if ( $module_data[ 'module_uri' ] && $module_data[ 'name' ] ) {
331
+				$module_data[ 'title' ] = '<a href="' . $module_data[ 'module_uri' ]
332
+					. '">' . $module_data[ 'name' ] . '</a>';
333 333
 			}
334 334
 
335
-			if ( $module_data['author_uri'] && $module_data['author'] ) {
336
-				$module_data['author'] = '<a href="' . $module_data['author_uri']
337
-					. '">' . $module_data['author'] . '</a>';
335
+			if ( $module_data[ 'author_uri' ] && $module_data[ 'author' ] ) {
336
+				$module_data[ 'author' ] = '<a href="' . $module_data[ 'author_uri' ]
337
+					. '">' . $module_data[ 'author' ] . '</a>';
338 338
 			}
339 339
 
340
-			$module_data['description'] = wptexturize( $module_data['description'] );
340
+			$module_data[ 'description' ] = wptexturize( $module_data[ 'description' ] );
341 341
 
342
-			if ( $module_data['author'] ) {
343
-				$module_data['description'] .= ' <cite>'
342
+			if ( $module_data[ 'author' ] ) {
343
+				$module_data[ 'description' ] .= ' <cite>'
344 344
 					// translators: Author name.
345
-					. sprintf( __( 'By %s.', 'wordpoints' ), $module_data['author'] )
345
+					. sprintf( __( 'By %s.', 'wordpoints' ), $module_data[ 'author' ] )
346 346
 					. '</cite>';
347 347
 			}
348 348
 		}
349 349
 
350 350
 	} else {
351 351
 
352
-		$module_data['title']       = $module_data['name'];
353
-		$module_data['author_name'] = $module_data['author'];
352
+		$module_data[ 'title' ]       = $module_data[ 'name' ];
353
+		$module_data[ 'author_name' ] = $module_data[ 'author' ];
354 354
 
355 355
 	} // End if ( $markup || $translate ) else.
356 356
 
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
 
475 475
 		$module_data = wordpoints_get_module_data( $module_file, $markup, $translate );
476 476
 
477
-		if ( empty( $module_data['name'] ) ) {
477
+		if ( empty( $module_data[ 'name' ] ) ) {
478 478
 			continue;
479 479
 		}
480 480
 
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
  */
574 574
 function _wordpoints_sort_uname_callback( $a, $b ) {
575 575
 
576
-	return strnatcasecmp( $a['name'], $b['name'] );
576
+	return strnatcasecmp( $a[ 'name' ], $b[ 'name' ] );
577 577
 }
578 578
 
579 579
 /**
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
 
692 692
 	} else {
693 693
 
694
-		$current[] = $module;
694
+		$current[ ] = $module;
695 695
 		sort( $current );
696 696
 		update_option( 'wordpoints_active_modules', $current );
697 697
 	}
@@ -857,7 +857,7 @@  discard block
 block discarded – undo
857 857
 	$checked = array();
858 858
 
859 859
 	foreach ( $modules as $module ) {
860
-		$checked[] = 'checked[]=' . $module;
860
+		$checked[ ] = 'checked[]=' . $module;
861 861
 	}
862 862
 
863 863
 	ob_start();
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
 		}
935 935
 
936 936
 		if ( ! $deleted ) {
937
-			$errors[] = $module_file;
937
+			$errors[ ] = $module_file;
938 938
 		}
939 939
 	}
940 940
 
Please login to merge, or discard this patch.
src/includes/filters.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 add_action( 'admin_notices', 'WordPoints_Installables::admin_notices' );
29 29
 add_action( 'wpmu_new_blog', 'WordPoints_Installables::wpmu_new_blog' );
30 30
 
31
-if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK.
31
+if ( isset( $_GET[ 'wordpoints_module_check' ], $_GET[ 'check_module' ] ) ) { // WPCS: CSRF OK.
32 32
 
33 33
 	add_action( 'shutdown', 'wordpoints_maintenance_shutdown_print_rand_str' );
34 34
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@
 block discarded – undo
28 28
 add_action( 'admin_notices', 'WordPoints_Installables::admin_notices' );
29 29
 add_action( 'wpmu_new_blog', 'WordPoints_Installables::wpmu_new_blog' );
30 30
 
31
-if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK.
31
+if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) {
32
+// WPCS: CSRF OK.
32 33
 
33 34
 	add_action( 'shutdown', 'wordpoints_maintenance_shutdown_print_rand_str' );
34 35
 
Please login to merge, or discard this patch.
src/includes/functions.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
 
65 65
 	// Normally this should never happen, because the plugins_loaded action won't
66 66
 	// run until the next request after WordPoints is activated and installs itself.
67
-	if ( empty( $wordpoints_data['version'] ) ) {
67
+	if ( empty( $wordpoints_data[ 'version' ] ) ) {
68 68
 		return;
69 69
 	}
70 70
 
71 71
 	// The major version is determined by the first number, so we can just cast to
72 72
 	// an integer. IF the major versions are equal, we don't need to do anything.
73
-	if ( (int) WORDPOINTS_VERSION === (int) $wordpoints_data['version'] ) {
73
+	if ( (int) WORDPOINTS_VERSION === (int) $wordpoints_data[ 'version' ] ) {
74 74
 		return;
75 75
 	}
76 76
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
  */
89 89
 function wordpoints_maintenance_shutdown_print_rand_str() {
90 90
 
91
-	if ( ! isset( $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK.
91
+	if ( ! isset( $_GET[ 'wordpoints_module_check' ] ) ) { // WPCS: CSRF OK.
92 92
 		return;
93 93
 	}
94 94
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 		$nonce = get_option( 'wordpoints_module_check_nonce' );
99 99
 	}
100 100
 
101
-	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK.
101
+	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET[ 'wordpoints_module_check' ] ) ) ) { // WPCS: CSRF OK.
102 102
 		return;
103 103
 	}
104 104
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
  */
129 129
 function wordpoints_maintenance_filter_modules( $modules ) {
130 130
 
131
-	if ( ! isset( $_GET['check_module'], $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK.
131
+	if ( ! isset( $_GET[ 'check_module' ], $_GET[ 'wordpoints_module_check' ] ) ) { // WPCS: CSRF OK.
132 132
 		return $modules;
133 133
 	}
134 134
 
@@ -138,13 +138,13 @@  discard block
 block discarded – undo
138 138
 		$nonce = get_option( 'wordpoints_module_check_nonce' );
139 139
 	}
140 140
 
141
-	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK.
141
+	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET[ 'wordpoints_module_check' ] ) ) ) { // WPCS: CSRF OK.
142 142
 		return $modules;
143 143
 	}
144 144
 
145 145
 	$modules = explode(
146 146
 		','
147
-		, sanitize_text_field( wp_unslash( $_GET['check_module'] ) ) // WPCS: CSRF OK.
147
+		, sanitize_text_field( wp_unslash( $_GET[ 'check_module' ] ) ) // WPCS: CSRF OK.
148 148
 	);
149 149
 
150 150
 	if ( 'pre_site_option_wordpoints_sitewide_active_modules' === current_filter() ) {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 				return false;
305 305
 			}
306 306
 
307
-			$values[] = $request[ $value ];
307
+			$values[ ] = $request[ $value ];
308 308
 		}
309 309
 
310 310
 		$action_format = vsprintf( $action_format, $values );
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
 
347 347
 	$error_data = $error->error_data;
348 348
 
349
-	if ( isset( $error_data[ $code ]['title'] ) ) {
349
+	if ( isset( $error_data[ $code ][ 'title' ] ) ) {
350 350
 
351
-		$error_data[ $code ]['title'] = wp_kses(
352
-			$error->error_data[ $code ]['title']
351
+		$error_data[ $code ][ 'title' ] = wp_kses(
352
+			$error->error_data[ $code ][ 'title' ]
353 353
 			, 'wordpoints_sanitize_wp_error_title'
354 354
 		);
355 355
 
@@ -750,16 +750,16 @@  discard block
 block discarded – undo
750 750
 
751 751
 	$options = array_merge( $defaults, $options );
752 752
 
753
-	echo '<select class="' . esc_attr( $options['class'] ) . '" name="' . esc_attr( $options['name'] ) . '" id="' . esc_attr( $options['id'] ) . '">';
754
-	echo '<option value="ALL"' . selected( $options['selected'], 'ALL', false ) . '>' . esc_html_x( 'Any', 'post type', 'wordpoints' ) . '</option>';
753
+	echo '<select class="' . esc_attr( $options[ 'class' ] ) . '" name="' . esc_attr( $options[ 'name' ] ) . '" id="' . esc_attr( $options[ 'id' ] ) . '">';
754
+	echo '<option value="ALL"' . selected( $options[ 'selected' ], 'ALL', false ) . '>' . esc_html_x( 'Any', 'post type', 'wordpoints' ) . '</option>';
755 755
 
756 756
 	foreach ( get_post_types( $args, 'objects' ) as $post_type ) {
757 757
 
758
-		if ( isset( $options['filter'] ) && ! call_user_func( $options['filter'], $post_type ) ) {
758
+		if ( isset( $options[ 'filter' ] ) && ! call_user_func( $options[ 'filter' ], $post_type ) ) {
759 759
 			continue;
760 760
 		}
761 761
 
762
-		echo '<option value="' . esc_attr( $post_type->name ) . '"' . selected( $options['selected'], $post_type->name, false ) . '>' . esc_html( $post_type->label ) . '</option>';
762
+		echo '<option value="' . esc_attr( $post_type->name ) . '"' . selected( $options[ 'selected' ], $post_type->name, false ) . '>' . esc_html( $post_type->label ) . '</option>';
763 763
 	}
764 764
 
765 765
 	echo '</select>';
@@ -936,11 +936,11 @@  discard block
 block discarded – undo
936 936
 	switch ( $cap ) {
937 937
 		case 'install_wordpoints_modules':
938 938
 			if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) {
939
-				$caps[] = 'do_not_allow';
939
+				$caps[ ] = 'do_not_allow';
940 940
 			} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
941
-				$caps[] = 'do_not_allow';
941
+				$caps[ ] = 'do_not_allow';
942 942
 			} else {
943
-				$caps[] = $cap;
943
+				$caps[ ] = $cap;
944 944
 			}
945 945
 		break;
946 946
 	}
@@ -1116,13 +1116,13 @@  discard block
 block discarded – undo
1116 1116
 		case 0:
1117 1117
 			return new $class_name();
1118 1118
 		case 1:
1119
-			return new $class_name( $args[0] );
1119
+			return new $class_name( $args[ 0 ] );
1120 1120
 		case 2:
1121
-			return new $class_name( $args[0], $args[1] );
1121
+			return new $class_name( $args[ 0 ], $args[ 1 ] );
1122 1122
 		case 3:
1123
-			return new $class_name( $args[0], $args[1], $args[2] );
1123
+			return new $class_name( $args[ 0 ], $args[ 1 ], $args[ 2 ] );
1124 1124
 		case 4:
1125
-			return new $class_name( $args[0], $args[1], $args[2], $args[3] );
1125
+			return new $class_name( $args[ 0 ], $args[ 1 ], $args[ 2 ], $args[ 3 ] );
1126 1126
 		default:
1127 1127
 			return false;
1128 1128
 	}
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -88,7 +88,8 @@  discard block
 block discarded – undo
88 88
  */
89 89
 function wordpoints_maintenance_shutdown_print_rand_str() {
90 90
 
91
-	if ( ! isset( $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK.
91
+	if ( ! isset( $_GET['wordpoints_module_check'] ) ) {
92
+// WPCS: CSRF OK.
92 93
 		return;
93 94
 	}
94 95
 
@@ -98,7 +99,8 @@  discard block
 block discarded – undo
98 99
 		$nonce = get_option( 'wordpoints_module_check_nonce' );
99 100
 	}
100 101
 
101
-	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK.
102
+	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) {
103
+// WPCS: CSRF OK.
102 104
 		return;
103 105
 	}
104 106
 
@@ -128,7 +130,8 @@  discard block
 block discarded – undo
128 130
  */
129 131
 function wordpoints_maintenance_filter_modules( $modules ) {
130 132
 
131
-	if ( ! isset( $_GET['check_module'], $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK.
133
+	if ( ! isset( $_GET['check_module'], $_GET['wordpoints_module_check'] ) ) {
134
+// WPCS: CSRF OK.
132 135
 		return $modules;
133 136
 	}
134 137
 
@@ -138,7 +141,8 @@  discard block
 block discarded – undo
138 141
 		$nonce = get_option( 'wordpoints_module_check_nonce' );
139 142
 	}
140 143
 
141
-	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK.
144
+	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) {
145
+// WPCS: CSRF OK.
142 146
 		return $modules;
143 147
 	}
144 148
 
Please login to merge, or discard this patch.
src/admin/includes/class-wordpoints-module-installer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
 			if ( $wp_filesystem->mkdir( $modules_dir, FS_CHMOD_DIR ) ) {
90 90
 				$wp_filesystem->put_contents( $modules_dir . '/index.php', '<?php // Gold is silent.' );
91 91
 			} else {
92
-				return new WP_Error( 'mkdir_failed_modules', $this->strings['mkdir_failed_modules'], $modules_dir );
92
+				return new WP_Error( 'mkdir_failed_modules', $this->strings[ 'mkdir_failed_modules' ], $modules_dir );
93 93
 			}
94 94
 		}
95 95
 
96 96
 		$module_dir = wordpoints_modules_dir();
97
-		$wp_theme_directories[] = $module_dir;
97
+		$wp_theme_directories[ ] = $module_dir;
98 98
 
99 99
 		$result = parent::install_package( $args );
100 100
 
@@ -188,14 +188,14 @@  discard block
 block discarded – undo
188 188
 
189 189
 			$module_data = wordpoints_get_module_data( $file, false, false );
190 190
 
191
-			if ( ! empty( $module_data['name'] ) ) {
191
+			if ( ! empty( $module_data[ 'name' ] ) ) {
192 192
 				$modules_found = true;
193 193
 				break;
194 194
 			}
195 195
 		}
196 196
 
197 197
 		if ( ! $modules_found ) {
198
-			return new WP_Error( 'incompatible_archive_no_modules', $this->strings['incompatible_archive'], esc_html__( 'No valid modules were found.', 'wordpoints' ) );
198
+			return new WP_Error( 'incompatible_archive_no_modules', $this->strings[ 'incompatible_archive' ], esc_html__( 'No valid modules were found.', 'wordpoints' ) );
199 199
 		}
200 200
 
201 201
 		return $source;
@@ -212,11 +212,11 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	public function module_info() {
214 214
 
215
-		if ( ! is_array( $this->result ) || empty( $this->result['destination_name'] ) ) {
215
+		if ( ! is_array( $this->result ) || empty( $this->result[ 'destination_name' ] ) ) {
216 216
 			return false;
217 217
 		}
218 218
 
219
-		$module = wordpoints_get_modules( '/' . $this->result['destination_name'] );
219
+		$module = wordpoints_get_modules( '/' . $this->result[ 'destination_name' ] );
220 220
 
221 221
 		if ( empty( $module ) ) {
222 222
 			return false;
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 		// Assume the requested module is the first in the list.
226 226
 		$module_files = array_keys( $module );
227 227
 
228
-		return $this->result['destination_name'] . '/' . $module_files[0];
228
+		return $this->result[ 'destination_name' ] . '/' . $module_files[ 0 ];
229 229
 	}
230 230
 
231 231
 } // class WordPoints_Module_Installer
Please login to merge, or discard this patch.
src/admin/includes/class-wordpoints-module-installer-skin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 		$args = array_merge( $defaults, $args );
63 63
 
64
-		$this->type = $args['type'];
64
+		$this->type = $args[ 'type' ];
65 65
 
66 66
 		parent::__construct( $args );
67 67
 	}
@@ -85,16 +85,16 @@  discard block
 block discarded – undo
85 85
 
86 86
 			if ( is_multisite() && current_user_can( 'manage_network_wordpoints_modules' ) ) {
87 87
 
88
-				$install_actions['network_activate'] = '<a class="button button-primary" href="' . wp_nonce_url( self_admin_url( 'admin.php?page=wordpoints_modules&action=activate&amp;networkwide=1&amp;module=' . rawurlencode( $module_file ) ), "activate-module_{$module_file}" ) . '" target="_parent">' . esc_html__( 'Network Activate', 'wordpoints' ) . '</a>';
88
+				$install_actions[ 'network_activate' ] = '<a class="button button-primary" href="' . wp_nonce_url( self_admin_url( 'admin.php?page=wordpoints_modules&action=activate&amp;networkwide=1&amp;module=' . rawurlencode( $module_file ) ), "activate-module_{$module_file}" ) . '" target="_parent">' . esc_html__( 'Network Activate', 'wordpoints' ) . '</a>';
89 89
 
90 90
 			} elseif ( current_user_can( 'activate_wordpoints_modules' ) ) {
91 91
 
92
-				$install_actions['activate_module'] = '<a class="button button-primary" href="' . wp_nonce_url( self_admin_url( 'admin.php?page=wordpoints_modules&action=activate&amp;module=' . rawurlencode( $module_file ) ), "activate-module_{$module_file}" ) . '" target="_parent">' . esc_html__( 'Activate Module', 'wordpoints' ) . '</a>';
92
+				$install_actions[ 'activate_module' ] = '<a class="button button-primary" href="' . wp_nonce_url( self_admin_url( 'admin.php?page=wordpoints_modules&action=activate&amp;module=' . rawurlencode( $module_file ) ), "activate-module_{$module_file}" ) . '" target="_parent">' . esc_html__( 'Activate Module', 'wordpoints' ) . '</a>';
93 93
 			}
94 94
 		}
95 95
 
96
-		$install_actions['modules_page'] = '<a href="' . esc_url( self_admin_url( 'admin.php?page=wordpoints_modules' ) ) . '" target="_parent">' . esc_html__( 'Return to Modules page', 'wordpoints' ) . '</a>';
97
-		$install_actions['install_page'] = '<a href="' . esc_url( self_admin_url( 'admin.php?page=wordpoints_install_modules' ) ) . '" target="_parent">' . esc_html__( 'Return to Module Installer', 'wordpoints' ) . '</a>';
96
+		$install_actions[ 'modules_page' ] = '<a href="' . esc_url( self_admin_url( 'admin.php?page=wordpoints_modules' ) ) . '" target="_parent">' . esc_html__( 'Return to Modules page', 'wordpoints' ) . '</a>';
97
+		$install_actions[ 'install_page' ] = '<a href="' . esc_url( self_admin_url( 'admin.php?page=wordpoints_install_modules' ) ) . '" target="_parent">' . esc_html__( 'Return to Module Installer', 'wordpoints' ) . '</a>';
98 98
 
99 99
 		/**
100 100
 		 * The install module action links.
Please login to merge, or discard this patch.
src/admin/includes/class-wordpoints-modules-list-table.php 2 patches
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		parent::__construct(
49 49
 			array(
50 50
 				'plural' => 'modules',
51
-				'screen' => ( isset( $args['screen'] ) ) ? $args['screen'] : null,
51
+				'screen' => ( isset( $args[ 'screen' ] ) ) ? $args[ 'screen' ] : null,
52 52
 			)
53 53
 		);
54 54
 
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
 		 */
69 69
 		$module_statuses = apply_filters( 'wordpoints_module_statuses', $module_statuses );
70 70
 
71
-		if ( isset( $_REQUEST['module_status'] ) && in_array( wp_unslash( $_REQUEST['module_status'] ), $module_statuses, true ) ) { // WPCS: CSRF OK.
72
-			$status = sanitize_key( $_REQUEST['module_status'] ); // WPCS: CSRF OK.
71
+		if ( isset( $_REQUEST[ 'module_status' ] ) && in_array( wp_unslash( $_REQUEST[ 'module_status' ] ), $module_statuses, true ) ) { // WPCS: CSRF OK.
72
+			$status = sanitize_key( $_REQUEST[ 'module_status' ] ); // WPCS: CSRF OK.
73 73
 		}
74 74
 
75
-		if ( isset( $_REQUEST['s'] ) ) { // WPCS: CSRF OK.
76
-			$_SERVER['REQUEST_URI'] = add_query_arg( 's', sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) ); // WPCS: CSRF OK.
75
+		if ( isset( $_REQUEST[ 's' ] ) ) { // WPCS: CSRF OK.
76
+			$_SERVER[ 'REQUEST_URI' ] = add_query_arg( 's', sanitize_text_field( wp_unslash( $_REQUEST[ 's' ] ) ) ); // WPCS: CSRF OK.
77 77
 		}
78 78
 
79 79
 		$page = $this->get_pagenum();
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function get_table_classes() {
90 90
 
91
-		return array( 'widefat', $this->_args['plural'], 'plugins' );
91
+		return array( 'widefat', $this->_args[ 'plural' ], 'plugins' );
92 92
 	}
93 93
 
94 94
 	/**
@@ -148,16 +148,16 @@  discard block
 block discarded – undo
148 148
 			update_option( 'wordpoints_recently_activated_modules', $recently_activated );
149 149
 		}
150 150
 
151
-		foreach ( (array) $modules['all'] as $module_file => $module_data ) {
151
+		foreach ( (array) $modules[ 'all' ] as $module_file => $module_data ) {
152 152
 
153 153
 			// Filter into individual sections.
154 154
 			if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && is_network_only_wordpoints_module( $module_file ) ) {
155 155
 
156
-				unset( $modules['all'][ $module_file ] );
156
+				unset( $modules[ 'all' ][ $module_file ] );
157 157
 
158 158
 			} elseif ( ! $this->screen->in_admin( 'network' ) && is_wordpoints_module_active_for_network( $module_file ) ) {
159 159
 
160
-				unset( $modules['all'][ $module_file ] );
160
+				unset( $modules[ 'all' ][ $module_file ] );
161 161
 
162 162
 			} elseif (
163 163
 				(
@@ -169,23 +169,23 @@  discard block
 block discarded – undo
169 169
 				)
170 170
 			) {
171 171
 
172
-				$modules['active'][ $module_file ] = $module_data;
172
+				$modules[ 'active' ][ $module_file ] = $module_data;
173 173
 
174 174
 			} else {
175 175
 
176 176
 				// Was the module recently activated?
177 177
 				if ( ! $this->screen->in_admin( 'network' ) && isset( $recently_activated[ $module_file ] ) ) {
178
-					$modules['recently_activated'][ $module_file ] = $module_data;
178
+					$modules[ 'recently_activated' ][ $module_file ] = $module_data;
179 179
 				}
180 180
 
181
-				$modules['inactive'][ $module_file ] = $module_data;
181
+				$modules[ 'inactive' ][ $module_file ] = $module_data;
182 182
 			}
183 183
 		}
184 184
 
185 185
 		if ( $s ) {
186 186
 
187 187
 			$status = 'search';
188
-			$modules['search'] = array_filter( $modules['all'], array( $this, '_search_callback' ) );
188
+			$modules[ 'search' ] = array_filter( $modules[ 'all' ], array( $this, '_search_callback' ) );
189 189
 		}
190 190
 
191 191
 		/**
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
 
263 263
 		static $term;
264 264
 
265
-		if ( is_null( $term ) && isset( $_REQUEST['s'] ) ) { // WPCS: CSRF OK.
266
-			$term = sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ); // WPCS: CSRF OK.
265
+		if ( is_null( $term ) && isset( $_REQUEST[ 's' ] ) ) { // WPCS: CSRF OK.
266
+			$term = sanitize_text_field( wp_unslash( $_REQUEST[ 's' ] ) ); // WPCS: CSRF OK.
267 267
 		}
268 268
 
269 269
 		foreach ( $module_data as $value ) {
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 
316 316
 		global $modules;
317 317
 
318
-		if ( ! empty( $modules['all'] ) ) {
318
+		if ( ! empty( $modules[ 'all' ] ) ) {
319 319
 			esc_html_e( 'No modules found.', 'wordpoints' );
320 320
 		} else {
321 321
 			esc_html_e( 'There are not any modules installed.', 'wordpoints' );
@@ -429,11 +429,11 @@  discard block
 block discarded – undo
429 429
 		$actions = array();
430 430
 
431 431
 		if ( 'active' !== $status ) {
432
-			$actions['activate-selected'] = ( $this->screen->in_admin( 'network' ) ) ? esc_html__( 'Network Activate', 'wordpoints' ) : esc_html__( 'Activate', 'wordpoints' );
432
+			$actions[ 'activate-selected' ] = ( $this->screen->in_admin( 'network' ) ) ? esc_html__( 'Network Activate', 'wordpoints' ) : esc_html__( 'Activate', 'wordpoints' );
433 433
 		}
434 434
 
435 435
 		if ( 'inactive' !== $status && 'recent' !== $status ) {
436
-			$actions['deactivate-selected'] = ( $this->screen->in_admin( 'network' ) ) ? esc_html__( 'Network Deactivate', 'wordpoints' ) : esc_html__( 'Deactivate', 'wordpoints' );
436
+			$actions[ 'deactivate-selected' ] = ( $this->screen->in_admin( 'network' ) ) ? esc_html__( 'Network Deactivate', 'wordpoints' ) : esc_html__( 'Deactivate', 'wordpoints' );
437 437
 		}
438 438
 
439 439
 		if (
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 			&& current_user_can( 'delete_wordpoints_modules' )
442 442
 			&& 'active' !== $status
443 443
 		) {
444
-			$actions['delete-selected'] = esc_html__( 'Delete', 'wordpoints' );
444
+			$actions[ 'delete-selected' ] = esc_html__( 'Delete', 'wordpoints' );
445 445
 		}
446 446
 
447 447
 		/**
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 		$class = apply_filters( 'wordpoints_module_list_row_class', $class, $module_file, $module_data, $context );
530 530
 
531 531
 		?>
532
-		<tr id="<?php echo esc_attr( sanitize_title( $module_data['name'] ) ); ?>" class="<?php echo esc_attr( $class ); ?>">
532
+		<tr id="<?php echo esc_attr( sanitize_title( $module_data[ 'name' ] ) ); ?>" class="<?php echo esc_attr( $class ); ?>">
533 533
 			<?php
534 534
 
535 535
 			list( $columns, $hidden ) = $this->get_column_info();
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 									sprintf(
553 553
 										// translators: Module name.
554 554
 										__( 'Select %s', 'wordpoints' )
555
-										, $module_data['name']
555
+										, $module_data[ 'name' ]
556 556
 									)
557 557
 								);
558 558
 
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 					case 'name':
567 567
 						?>
568 568
 						<td class="module-title<?php echo ( $is_hidden ) ? ' hidden' : ''; ?>">
569
-							<strong><?php echo esc_html( $module_data['name'] ); ?></strong>
569
+							<strong><?php echo esc_html( $module_data[ 'name' ] ); ?></strong>
570 570
 							<?php echo $this->row_actions( $this->get_module_row_actions( $module_file, $module_data, $is_active ), true ); // XSS OK WPCS ?>
571 571
 						</td>
572 572
 						<?php
@@ -577,8 +577,8 @@  discard block
 block discarded – undo
577 577
 						<td class="column-description desc<?php echo ( $is_hidden ) ? ' hidden' : ''; ?>">
578 578
 							<div class="module-description">
579 579
 								<p>
580
-									<?php if ( ! empty( $module_data['description'] ) ) : ?>
581
-										<?php echo wp_kses( $module_data['description'] , 'wordpoints_module_description' ); ?>
580
+									<?php if ( ! empty( $module_data[ 'description' ] ) ) : ?>
581
+										<?php echo wp_kses( $module_data[ 'description' ], 'wordpoints_module_description' ); ?>
582 582
 									<?php else : ?>
583 583
 										&nbsp;
584 584
 									<?php endif; ?>
@@ -589,25 +589,25 @@  discard block
 block discarded – undo
589 589
 
590 590
 								$module_meta = array();
591 591
 
592
-								if ( ! empty( $module_data['version'] ) ) {
592
+								if ( ! empty( $module_data[ 'version' ] ) ) {
593 593
 									// translators: Module version.
594
-									$module_meta[] = sprintf( esc_html__( 'Version %s', 'wordpoints' ), $module_data['version'] );
594
+									$module_meta[ ] = sprintf( esc_html__( 'Version %s', 'wordpoints' ), $module_data[ 'version' ] );
595 595
 								}
596 596
 
597
-								if ( ! empty( $module_data['author'] ) ) {
597
+								if ( ! empty( $module_data[ 'author' ] ) ) {
598 598
 
599
-									$author = $module_data['author'];
599
+									$author = $module_data[ 'author' ];
600 600
 
601
-									if ( ! empty( $module_data['author_uri'] ) ) {
602
-										$author = '<a href="' . esc_url( $module_data['author_uri'] ) . '">' . esc_html( $module_data['author'] ) . '</a>';
601
+									if ( ! empty( $module_data[ 'author_uri' ] ) ) {
602
+										$author = '<a href="' . esc_url( $module_data[ 'author_uri' ] ) . '">' . esc_html( $module_data[ 'author' ] ) . '</a>';
603 603
 									}
604 604
 
605 605
 									// translators: Author name.
606
-									$module_meta[] = sprintf( __( 'By %s', 'wordpoints' ), $author );
606
+									$module_meta[ ] = sprintf( __( 'By %s', 'wordpoints' ), $author );
607 607
 								}
608 608
 
609
-								if ( ! empty( $module_data['module_uri'] ) ) {
610
-									$module_meta[] = '<a href="' . esc_url( $module_data['module_uri'] ) . '">' . esc_html__( 'Visit module site', 'wordpoints' ) . '</a>';
609
+								if ( ! empty( $module_data[ 'module_uri' ] ) ) {
610
+									$module_meta[ ] = '<a href="' . esc_url( $module_data[ 'module_uri' ] ) . '">' . esc_html__( 'Visit module site', 'wordpoints' ) . '</a>';
611 611
 								}
612 612
 
613 613
 								/**
@@ -713,19 +713,19 @@  discard block
 block discarded – undo
713 713
 
714 714
 				if ( current_user_can( 'manage_network_wordpoints_modules' ) ) {
715 715
 					// translators: Module name.
716
-					$actions['deactivate'] = '<a href="' . wp_nonce_url( add_query_arg( 'action', 'deactivate', $url ), "deactivate-module_{$module_file}" ) . '" aria-label="' . esc_attr( sprintf( __( 'Network deactivate %s', 'wordpoints' ), $module_data['name'] ) ) . '">' . esc_html__( 'Network Deactivate', 'wordpoints' ) . '</a>';
716
+					$actions[ 'deactivate' ] = '<a href="' . wp_nonce_url( add_query_arg( 'action', 'deactivate', $url ), "deactivate-module_{$module_file}" ) . '" aria-label="' . esc_attr( sprintf( __( 'Network deactivate %s', 'wordpoints' ), $module_data[ 'name' ] ) ) . '">' . esc_html__( 'Network Deactivate', 'wordpoints' ) . '</a>';
717 717
 				}
718 718
 
719 719
 			} else {
720 720
 
721 721
 				if ( current_user_can( 'manage_network_wordpoints_modules' ) ) {
722 722
 					// translators: Module name.
723
-					$actions['activate'] = '<a href="' . wp_nonce_url( add_query_arg( 'action', 'activate', $url ), "activate-module_{$module_file}" ) . '" aria-label="' . esc_attr( sprintf( __( 'Network activate %s', 'wordpoints' ), $module_data['name'] ) ) . '" class="edit">' . esc_html__( 'Network Activate', 'wordpoints' ) . '</a>';
723
+					$actions[ 'activate' ] = '<a href="' . wp_nonce_url( add_query_arg( 'action', 'activate', $url ), "activate-module_{$module_file}" ) . '" aria-label="' . esc_attr( sprintf( __( 'Network activate %s', 'wordpoints' ), $module_data[ 'name' ] ) ) . '" class="edit">' . esc_html__( 'Network Activate', 'wordpoints' ) . '</a>';
724 724
 				}
725 725
 
726 726
 				if ( current_user_can( 'delete_wordpoints_modules' ) && ! is_wordpoints_module_active( $module_file ) ) {
727 727
 					// translators: Module name.
728
-					$actions['delete'] = '<a href="' . wp_nonce_url( self_admin_url( 'admin.php?page=wordpoints_modules&action=delete-selected&amp;checked[]=' . $module_file . '&amp;module_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s ), 'bulk-modules' ) . '" aria-label="' . esc_attr( sprintf( __( 'Delete %s', 'wordpoints' ), $module_data['name'] ) ) . '" class="delete">' . esc_html__( 'Delete', 'wordpoints' ) . '</a>';
728
+					$actions[ 'delete' ] = '<a href="' . wp_nonce_url( self_admin_url( 'admin.php?page=wordpoints_modules&action=delete-selected&amp;checked[]=' . $module_file . '&amp;module_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s ), 'bulk-modules' ) . '" aria-label="' . esc_attr( sprintf( __( 'Delete %s', 'wordpoints' ), $module_data[ 'name' ] ) ) . '" class="delete">' . esc_html__( 'Delete', 'wordpoints' ) . '</a>';
729 729
 				}
730 730
 			}
731 731
 
@@ -734,16 +734,16 @@  discard block
 block discarded – undo
734 734
 			if ( $is_active ) {
735 735
 
736 736
 				// translators: Module name.
737
-				$actions['deactivate'] = '<a href="' . wp_nonce_url( add_query_arg( 'action', 'deactivate', $url ), "deactivate-module_{$module_file}" ) . '" aria-label="' . esc_attr( sprintf( __( 'Deactivate %s', 'wordpoints' ), $module_data['name'] ) ) . '">' . esc_html__( 'Deactivate', 'wordpoints' ) . '</a>';
737
+				$actions[ 'deactivate' ] = '<a href="' . wp_nonce_url( add_query_arg( 'action', 'deactivate', $url ), "deactivate-module_{$module_file}" ) . '" aria-label="' . esc_attr( sprintf( __( 'Deactivate %s', 'wordpoints' ), $module_data[ 'name' ] ) ) . '">' . esc_html__( 'Deactivate', 'wordpoints' ) . '</a>';
738 738
 
739 739
 			} else {
740 740
 
741 741
 				// translators: Module name.
742
-				$actions['activate'] = '<a href="' . wp_nonce_url( add_query_arg( 'action', 'activate', $url ), "activate-module_{$module_file}" ) . '" aria-label="' . esc_attr( sprintf( __( 'Activate %s', 'wordpoints' ), $module_data['name'] ) ) . '" class="edit">' . esc_html__( 'Activate', 'wordpoints' ) . '</a>';
742
+				$actions[ 'activate' ] = '<a href="' . wp_nonce_url( add_query_arg( 'action', 'activate', $url ), "activate-module_{$module_file}" ) . '" aria-label="' . esc_attr( sprintf( __( 'Activate %s', 'wordpoints' ), $module_data[ 'name' ] ) ) . '" class="edit">' . esc_html__( 'Activate', 'wordpoints' ) . '</a>';
743 743
 
744 744
 				if ( ! is_multisite() && current_user_can( 'delete_wordpoints_modules' ) ) {
745 745
 					// translators: Module name.
746
-					$actions['delete'] = '<a href="' . wp_nonce_url( self_admin_url( 'admin.php?page=wordpoints_modules&action=delete-selected&amp;checked[]=' . $module_file . '&amp;module_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s ), 'bulk-modules' ) . '" aria-label="' . esc_attr( sprintf( __( 'Delete %s', 'wordpoints' ), $module_data['name'] ) ) . '" class="delete">' . esc_html__( 'Delete', 'wordpoints' ) . '</a>';
746
+					$actions[ 'delete' ] = '<a href="' . wp_nonce_url( self_admin_url( 'admin.php?page=wordpoints_modules&action=delete-selected&amp;checked[]=' . $module_file . '&amp;module_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s ), 'bulk-modules' ) . '" aria-label="' . esc_attr( sprintf( __( 'Delete %s', 'wordpoints' ), $module_data[ 'name' ] ) ) . '" class="delete">' . esc_html__( 'Delete', 'wordpoints' ) . '</a>';
747 747
 				}
748 748
 			}
749 749
 
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,11 +68,13 @@  discard block
 block discarded – undo
68 68
 		 */
69 69
 		$module_statuses = apply_filters( 'wordpoints_module_statuses', $module_statuses );
70 70
 
71
-		if ( isset( $_REQUEST['module_status'] ) && in_array( wp_unslash( $_REQUEST['module_status'] ), $module_statuses, true ) ) { // WPCS: CSRF OK.
71
+		if ( isset( $_REQUEST['module_status'] ) && in_array( wp_unslash( $_REQUEST['module_status'] ), $module_statuses, true ) ) {
72
+// WPCS: CSRF OK.
72 73
 			$status = sanitize_key( $_REQUEST['module_status'] ); // WPCS: CSRF OK.
73 74
 		}
74 75
 
75
-		if ( isset( $_REQUEST['s'] ) ) { // WPCS: CSRF OK.
76
+		if ( isset( $_REQUEST['s'] ) ) {
77
+// WPCS: CSRF OK.
76 78
 			$_SERVER['REQUEST_URI'] = add_query_arg( 's', sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) ); // WPCS: CSRF OK.
77 79
 		}
78 80
 
@@ -262,7 +264,8 @@  discard block
 block discarded – undo
262 264
 
263 265
 		static $term;
264 266
 
265
-		if ( is_null( $term ) && isset( $_REQUEST['s'] ) ) { // WPCS: CSRF OK.
267
+		if ( is_null( $term ) && isset( $_REQUEST['s'] ) ) {
268
+// WPCS: CSRF OK.
266 269
 			$term = sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ); // WPCS: CSRF OK.
267 270
 		}
268 271
 
@@ -579,9 +582,12 @@  discard block
 block discarded – undo
579 582
 								<p>
580 583
 									<?php if ( ! empty( $module_data['description'] ) ) : ?>
581 584
 										<?php echo wp_kses( $module_data['description'] , 'wordpoints_module_description' ); ?>
582
-									<?php else : ?>
585
+									<?php else {
586
+	: ?>
583 587
 										&nbsp;
584
-									<?php endif; ?>
588
+									<?php endif;
589
+}
590
+?>
585 591
 								</p>
586 592
 							</div>
587 593
 							<div class="<?php echo esc_attr( $class ); ?> second module-version-author-uri">
Please login to merge, or discard this patch.
src/admin/includes/functions.php 2 patches
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -611,14 +611,14 @@  discard block
 block discarded – undo
611 611
 
612 612
 			if ( $child instanceof WordPoints_Entity_Attr ) {
613 613
 
614
-				$child_data[ $child_slug ]['_type']     = 'attr';
615
-				$child_data[ $child_slug ]['data_type'] = $child->get_data_type();
614
+				$child_data[ $child_slug ][ '_type' ]     = 'attr';
615
+				$child_data[ $child_slug ][ 'data_type' ] = $child->get_data_type();
616 616
 
617 617
 			} elseif ( $child instanceof WordPoints_Entity_Relationship ) {
618 618
 
619
-				$child_data[ $child_slug ]['_type']     = 'relationship';
620
-				$child_data[ $child_slug ]['primary']   = $child->get_primary_entity_slug();
621
-				$child_data[ $child_slug ]['secondary'] = $child->get_related_entity_slug();
619
+				$child_data[ $child_slug ][ '_type' ]     = 'relationship';
620
+				$child_data[ $child_slug ][ 'primary' ]   = $child->get_primary_entity_slug();
621
+				$child_data[ $child_slug ][ 'secondary' ] = $child->get_related_entity_slug();
622 622
 			}
623 623
 
624 624
 			/**
@@ -650,14 +650,14 @@  discard block
 block discarded – undo
650 650
 
651 651
 			foreach ( $entity->get_enumerated_values() as $value ) {
652 652
 				if ( $entity->set_the_value( $value ) ) {
653
-					$values[] = array(
653
+					$values[ ] = array(
654 654
 						'value' => $entity->get_the_id(),
655 655
 						'label' => $entity->get_the_human_id(),
656 656
 					);
657 657
 				}
658 658
 			}
659 659
 
660
-			$entities_data[ $slug ]['values'] = $values;
660
+			$entities_data[ $slug ][ 'values' ] = $values;
661 661
 		}
662 662
 
663 663
 		/**
@@ -789,9 +789,9 @@  discard block
 block discarded – undo
789 789
 
790 790
 	$args = array_merge( $defaults, $args );
791 791
 
792
-	if ( isset( $args['dismissable'] ) ) {
792
+	if ( isset( $args[ 'dismissable' ] ) ) {
793 793
 
794
-		$args['dismissible'] = $args['dismissable'];
794
+		$args[ 'dismissible' ] = $args[ 'dismissable' ];
795 795
 
796 796
 		_deprecated_argument(
797 797
 			__FUNCTION__
@@ -811,26 +811,26 @@  discard block
 block discarded – undo
811 811
 		);
812 812
 	}
813 813
 
814
-	if ( $args['dismissible'] && $args['option'] ) {
814
+	if ( $args[ 'dismissible' ] && $args[ 'option' ] ) {
815 815
 		wp_enqueue_script( 'wordpoints-admin-dismiss-notice' );
816 816
 	}
817 817
 
818 818
 	?>
819 819
 
820 820
 	<div
821
-		class="notice notice-<?php echo sanitize_html_class( $type, 'success' ); ?><?php echo ( $args['dismissible'] ) ? ' is-dismissible' : ''; ?>"
822
-		<?php if ( $args['dismissible'] && $args['option'] ) : ?>
823
-			data-nonce="<?php echo esc_attr( wp_create_nonce( "wordpoints_dismiss_notice-{$args['option']}" ) ); ?>"
824
-			data-option="<?php echo esc_attr( $args['option'] ); ?>"
821
+		class="notice notice-<?php echo sanitize_html_class( $type, 'success' ); ?><?php echo ( $args[ 'dismissible' ] ) ? ' is-dismissible' : ''; ?>"
822
+		<?php if ( $args[ 'dismissible' ] && $args[ 'option' ] ) : ?>
823
+			data-nonce="<?php echo esc_attr( wp_create_nonce( "wordpoints_dismiss_notice-{$args[ 'option' ]}" ) ); ?>"
824
+			data-option="<?php echo esc_attr( $args[ 'option' ] ); ?>"
825 825
 		<?php endif; ?>
826 826
 		>
827 827
 		<p>
828 828
 			<?php echo wp_kses( $message, 'wordpoints_admin_message' ); ?>
829 829
 		</p>
830
-		<?php if ( $args['dismissible'] && $args['option'] ) : ?>
830
+		<?php if ( $args[ 'dismissible' ] && $args[ 'option' ] ) : ?>
831 831
 			<form method="post" class="wordpoints-notice-dismiss-form" style="padding-bottom: 5px;">
832
-				<input type="hidden" name="wordpoints_notice" value="<?php echo esc_html( $args['option'] ); ?>" />
833
-				<?php wp_nonce_field( "wordpoints_dismiss_notice-{$args['option']}" ); ?>
832
+				<input type="hidden" name="wordpoints_notice" value="<?php echo esc_html( $args[ 'option' ] ); ?>" />
833
+				<?php wp_nonce_field( "wordpoints_dismiss_notice-{$args[ 'option' ]}" ); ?>
834 834
 				<?php submit_button( __( 'Hide This Notice', 'wordpoints' ), 'secondary', 'wordpoints_dismiss_notice', false ); ?>
835 835
 			</form>
836 836
 		<?php endif; ?>
@@ -853,9 +853,9 @@  discard block
 block discarded – undo
853 853
 
854 854
 	$tab = '';
855 855
 
856
-	if ( isset( $_GET['tab'] ) ) { // WPCS: CSRF OK.
856
+	if ( isset( $_GET[ 'tab' ] ) ) { // WPCS: CSRF OK.
857 857
 
858
-		$tab = sanitize_key( $_GET['tab'] ); // WPCS: CSRF OK.
858
+		$tab = sanitize_key( $_GET[ 'tab' ] ); // WPCS: CSRF OK.
859 859
 	}
860 860
 
861 861
 	if ( isset( $tabs ) && ! isset( $tabs[ $tab ] ) ) {
@@ -892,8 +892,8 @@  discard block
 block discarded – undo
892 892
 
893 893
 	$page = '';
894 894
 
895
-	if ( isset( $_GET['page'] ) ) { // WPCS: CSRF OK.
896
-		$page = sanitize_key( $_GET['page'] ); // WPCS: CSRF OK.
895
+	if ( isset( $_GET[ 'page' ] ) ) { // WPCS: CSRF OK.
896
+		$page = sanitize_key( $_GET[ 'page' ] ); // WPCS: CSRF OK.
897 897
 	}
898 898
 
899 899
 	foreach ( $tabs as $tab => $name ) {
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
 
1035 1035
 						$info = wordpoints_get_module_data( $file, false, false );
1036 1036
 
1037
-						if ( ! empty( $info['name'] ) ) {
1037
+						if ( ! empty( $info[ 'name' ] ) ) {
1038 1038
 							$source = new WP_Error(
1039 1039
 								'wordpoints_module_archive_not_plugin'
1040 1040
 								, $source->get_error_message()
@@ -1174,9 +1174,9 @@  discard block
 block discarded – undo
1174 1174
 		, 'post'
1175 1175
 	);
1176 1176
 
1177
-	if ( $is_notice_dismissed && isset( $_POST['wordpoints_notice'] ) ) {
1177
+	if ( $is_notice_dismissed && isset( $_POST[ 'wordpoints_notice' ] ) ) {
1178 1178
 
1179
-		$option = sanitize_key( $_POST['wordpoints_notice'] );
1179
+		$option = sanitize_key( $_POST[ 'wordpoints_notice' ] );
1180 1180
 
1181 1181
 		if ( ! is_network_admin() && 'wordpoints_incompatible_modules' === $option ) {
1182 1182
 			delete_option( $option );
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
  */
1232 1232
 function wordpoints_admin_ajax_breaking_module_check() {
1233 1233
 
1234
-	if ( ! isset( $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK.
1234
+	if ( ! isset( $_GET[ 'wordpoints_module_check' ] ) ) { // WPCS: CSRF OK.
1235 1235
 		wp_die( '', 400 );
1236 1236
 	}
1237 1237
 
@@ -1241,12 +1241,12 @@  discard block
 block discarded – undo
1241 1241
 		$nonce = get_option( 'wordpoints_module_check_nonce' );
1242 1242
 	}
1243 1243
 
1244
-	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK.
1244
+	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET[ 'wordpoints_module_check' ] ) ) ) { // WPCS: CSRF OK.
1245 1245
 		wp_die( '', 403 );
1246 1246
 	}
1247 1247
 
1248 1248
 	// The list table constructor calls WP_Screen::get(), which expects this.
1249
-	$GLOBALS['hook_suffix'] = null;
1249
+	$GLOBALS[ 'hook_suffix' ] = null;
1250 1250
 
1251 1251
 	wordpoints_admin_screen_modules();
1252 1252
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -853,7 +853,8 @@  discard block
 block discarded – undo
853 853
 
854 854
 	$tab = '';
855 855
 
856
-	if ( isset( $_GET['tab'] ) ) { // WPCS: CSRF OK.
856
+	if ( isset( $_GET['tab'] ) ) {
857
+// WPCS: CSRF OK.
857 858
 
858 859
 		$tab = sanitize_key( $_GET['tab'] ); // WPCS: CSRF OK.
859 860
 	}
@@ -892,7 +893,8 @@  discard block
 block discarded – undo
892 893
 
893 894
 	$page = '';
894 895
 
895
-	if ( isset( $_GET['page'] ) ) { // WPCS: CSRF OK.
896
+	if ( isset( $_GET['page'] ) ) {
897
+// WPCS: CSRF OK.
896 898
 		$page = sanitize_key( $_GET['page'] ); // WPCS: CSRF OK.
897 899
 	}
898 900
 
@@ -1231,7 +1233,8 @@  discard block
 block discarded – undo
1231 1233
  */
1232 1234
 function wordpoints_admin_ajax_breaking_module_check() {
1233 1235
 
1234
-	if ( ! isset( $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK.
1236
+	if ( ! isset( $_GET['wordpoints_module_check'] ) ) {
1237
+// WPCS: CSRF OK.
1235 1238
 		wp_die( '', 400 );
1236 1239
 	}
1237 1240
 
@@ -1241,7 +1244,8 @@  discard block
 block discarded – undo
1241 1244
 		$nonce = get_option( 'wordpoints_module_check_nonce' );
1242 1245
 	}
1243 1246
 
1244
-	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK.
1247
+	if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) {
1248
+// WPCS: CSRF OK.
1245 1249
 		wp_die( '', 403 );
1246 1250
 	}
1247 1251
 
Please login to merge, or discard this patch.