@@ -140,7 +140,7 @@ discard block |
||
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 |
||
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 | } |
@@ -20,7 +20,7 @@ |
||
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 |
@@ -69,7 +69,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
934 | 934 | } |
935 | 935 | |
936 | 936 | if ( ! $deleted ) { |
937 | - $errors[] = $module_file; |
|
937 | + $errors[ ] = $module_file; |
|
938 | 938 | } |
939 | 939 | } |
940 | 940 |
@@ -28,7 +28,7 @@ |
||
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 |
@@ -64,13 +64,13 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -89,12 +89,12 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -61,7 +61,7 @@ discard block |
||
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 |
||
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&networkwide=1&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&networkwide=1&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&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&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. |
@@ -611,14 +611,14 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | private function verify_request( $action ) { |
317 | 317 | |
318 | 318 | if ( |
319 | - empty( $_POST['nonce'] ) |
|
319 | + empty( $_POST[ 'nonce' ] ) |
|
320 | 320 | || ! wordpoints_verify_nonce( 'nonce', $action, null, 'post' ) |
321 | 321 | ) { |
322 | 322 | wp_send_json_error( |
@@ -334,11 +334,11 @@ discard block |
||
334 | 334 | */ |
335 | 335 | protected function get_reaction_store() { |
336 | 336 | |
337 | - if ( ! isset( $_POST['reaction_store'] ) ) { // WPCS: CSRF OK. |
|
337 | + if ( ! isset( $_POST[ 'reaction_store' ] ) ) { // WPCS: CSRF OK. |
|
338 | 338 | $this->unexpected_error( 'reaction_store' ); |
339 | 339 | } |
340 | 340 | |
341 | - $reactor_slug = sanitize_key( $_POST['reaction_store'] ); // WPCS: CSRF OK. |
|
341 | + $reactor_slug = sanitize_key( $_POST[ 'reaction_store' ] ); // WPCS: CSRF OK. |
|
342 | 342 | |
343 | 343 | $reaction_store = wordpoints_hooks()->get_reaction_store( $reactor_slug ); |
344 | 344 | |
@@ -361,12 +361,12 @@ discard block |
||
361 | 361 | */ |
362 | 362 | protected function get_reaction() { |
363 | 363 | |
364 | - if ( ! isset( $_POST['id'] ) ) { // WPCS: CSRF OK. |
|
364 | + if ( ! isset( $_POST[ 'id' ] ) ) { // WPCS: CSRF OK. |
|
365 | 365 | $this->unexpected_error( 'id' ); |
366 | 366 | } |
367 | 367 | |
368 | 368 | $reaction = $this->reaction_store->get_reaction( |
369 | - wordpoints_int( $_POST['id'] ) // WPCS: CSRF OK. |
|
369 | + wordpoints_int( $_POST[ 'id' ] ) // WPCS: CSRF OK. |
|
370 | 370 | ); |
371 | 371 | |
372 | 372 | if ( ! $reaction ) { |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | |
388 | 388 | $data = wp_unslash( $_POST ); // WPCS: CSRF OK. |
389 | 389 | |
390 | - unset( $data['id'], $data['action'], $data['nonce'], $data['reaction_store'] ); |
|
390 | + unset( $data[ 'id' ], $data[ 'action' ], $data[ 'nonce' ], $data[ 'reaction_store' ] ); |
|
391 | 391 | |
392 | 392 | return $data; |
393 | 393 | } |