@@ -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 |
@@ -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. |
@@ -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 | } |
@@ -13,15 +13,15 @@ |
||
13 | 13 | |
14 | 14 | if ( |
15 | 15 | 'components' !== wordpoints_admin_get_current_tab() |
16 | - || ! isset( $_POST['wordpoints_component'], $_POST['wordpoints_component_action'], $_POST['_wpnonce'] ) |
|
16 | + || ! isset( $_POST[ 'wordpoints_component' ], $_POST[ 'wordpoints_component_action' ], $_POST[ '_wpnonce' ] ) |
|
17 | 17 | ) { |
18 | 18 | return; |
19 | 19 | } |
20 | 20 | |
21 | 21 | $components = WordPoints_Components::instance(); |
22 | -$component = sanitize_key( $_POST['wordpoints_component'] ); |
|
22 | +$component = sanitize_key( $_POST[ 'wordpoints_component' ] ); |
|
23 | 23 | |
24 | -$action = sanitize_key( $_POST['wordpoints_component_action'] ); |
|
24 | +$action = sanitize_key( $_POST[ 'wordpoints_component_action' ] ); |
|
25 | 25 | |
26 | 26 | check_admin_referer( "wordpoints_{$action}_component-{$component}" ); |
27 | 27 |
@@ -12,13 +12,13 @@ |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | if ( |
15 | - isset( $_POST['wordpoints_settings_nonce'], $_POST['excluded_users'] ) |
|
15 | + isset( $_POST[ 'wordpoints_settings_nonce' ], $_POST[ 'excluded_users' ] ) |
|
16 | 16 | && wordpoints_verify_nonce( 'wordpoints_settings_nonce', 'wordpoints_settings_submit', null, 'post' ) |
17 | 17 | ) { |
18 | 18 | |
19 | 19 | // - The form has been submitted. |
20 | 20 | |
21 | - $excluded_users = preg_replace( '/\s/', '', sanitize_text_field( wp_unslash( $_POST['excluded_users'] ) ) ); |
|
21 | + $excluded_users = preg_replace( '/\s/', '', sanitize_text_field( wp_unslash( $_POST[ 'excluded_users' ] ) ) ); |
|
22 | 22 | |
23 | 23 | if ( ! empty( $excluded_users ) ) { |
24 | 24 |