@@ -222,8 +222,11 @@ |
||
222 | 222 | name="<?php echo esc_attr( $name ); ?>" |
223 | 223 | <?php if ( $args['placeholders'] && 'hidden' !== $field['type'] ) : ?> |
224 | 224 | value="<% if ( typeof <?php echo preg_replace( '/[^a-z0-9_]/i', '', $name ); /* WPCS XSS OK. */ ?> !== "undefined" ) { print( <?php echo preg_replace( '/[^a-z0-9_]/i', '', $name ); /* WPCS XSS OK. */ ?> ); } %>" |
225 | - <?php else : ?> |
|
226 | - value="<?php echo esc_attr( $value ); ?>" |
|
225 | + <?php else { |
|
226 | + : ?> |
|
227 | + value="<?php echo esc_attr( $value ); |
|
228 | +} |
|
229 | +?>" |
|
227 | 230 | <?php endif; ?> |
228 | 231 | class="widefat" |
229 | 232 | /> |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | $value = $field['default']; |
200 | 200 | |
201 | 201 | // If the value is set use that instead. |
202 | - if ( isset( $meta[ $name ] ) ) { |
|
203 | - $value = $meta[ $name ]; |
|
202 | + if ( isset( $meta[$name] ) ) { |
|
203 | + $value = $meta[$name]; |
|
204 | 204 | } |
205 | 205 | } |
206 | 206 | |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | continue; |
333 | 333 | } |
334 | 334 | |
335 | - $user_ranks[ $user_id ] = $new_rank->ID; |
|
335 | + $user_ranks[$user_id] = $new_rank->ID; |
|
336 | 336 | } |
337 | 337 | } |
338 | 338 | |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | continue; |
426 | 426 | } |
427 | 427 | |
428 | - $user_ranks[ $user_id ] = $new_rank->ID; |
|
428 | + $user_ranks[$user_id] = $new_rank->ID; |
|
429 | 429 | } |
430 | 430 | } |
431 | 431 |
@@ -925,7 +925,8 @@ discard block |
||
925 | 925 | |
926 | 926 | $tab = ''; |
927 | 927 | |
928 | - if ( isset( $_GET['tab'] ) ) { // WPCS: CSRF OK. |
|
928 | + if ( isset( $_GET['tab'] ) ) { |
|
929 | +// WPCS: CSRF OK. |
|
929 | 930 | |
930 | 931 | $tab = sanitize_key( $_GET['tab'] ); // WPCS: CSRF OK. |
931 | 932 | } |
@@ -964,7 +965,8 @@ discard block |
||
964 | 965 | |
965 | 966 | $page = ''; |
966 | 967 | |
967 | - if ( isset( $_GET['page'] ) ) { // WPCS: CSRF OK. |
|
968 | + if ( isset( $_GET['page'] ) ) { |
|
969 | +// WPCS: CSRF OK. |
|
968 | 970 | $page = sanitize_key( $_GET['page'] ); // WPCS: CSRF OK. |
969 | 971 | } |
970 | 972 | |
@@ -1360,9 +1362,12 @@ discard block |
||
1360 | 1362 | > |
1361 | 1363 | <?php esc_html_e( 'Update now', 'wordpoints' ); ?> |
1362 | 1364 | </a> |
1363 | - <?php else : ?> |
|
1365 | + <?php else { |
|
1366 | + : ?> |
|
1364 | 1367 | <em> |
1365 | - <?php esc_html_e( 'Automatic update is unavailable for this extension.', 'wordpoints' ); ?> |
|
1368 | + <?php esc_html_e( 'Automatic update is unavailable for this extension.', 'wordpoints' ); |
|
1369 | +} |
|
1370 | +?> |
|
1366 | 1371 | </em> |
1367 | 1372 | <?php endif; ?> |
1368 | 1373 | <?php endif; ?> |
@@ -1711,8 +1716,11 @@ discard block |
||
1711 | 1716 | ?> |
1712 | 1717 | <a href="<?php echo esc_url( $license->get_renewal_url() ); ?>" aria-label="<?php echo esc_attr( sprintf( $aria_label, $extension['name'] ) ); ?>"><?php esc_html_e( 'Renew License', 'wordpoints' ); ?></a> |
1713 | 1718 | <?php endif; ?> |
1714 | - <?php else : ?> |
|
1715 | - <?php esc_html_e( 'This license key is expired.', 'wordpoints' ); ?> |
|
1719 | + <?php else { |
|
1720 | + : ?> |
|
1721 | + <?php esc_html_e( 'This license key is expired.', 'wordpoints' ); |
|
1722 | +} |
|
1723 | +?> |
|
1716 | 1724 | <?php endif; ?> |
1717 | 1725 | <?php endif; ?> |
1718 | 1726 | <?php endif; ?> |
@@ -1738,7 +1746,8 @@ discard block |
||
1738 | 1746 | wp_die( esc_html__( 'Sorry, you are not allowed to update WordPoints extensions for this site.', 'wordpoints' ), 403 ); |
1739 | 1747 | } |
1740 | 1748 | |
1741 | - if ( empty( $_GET['extension'] ) ) { // WPCS: CSRF OK. |
|
1749 | + if ( empty( $_GET['extension'] ) ) { |
|
1750 | +// WPCS: CSRF OK. |
|
1742 | 1751 | wp_die( esc_html__( 'No extension supplied.', 'wordpoints' ), 200 ); |
1743 | 1752 | } |
1744 | 1753 | |
@@ -2265,7 +2274,8 @@ discard block |
||
2265 | 2274 | */ |
2266 | 2275 | function wordpoints_admin_ajax_breaking_module_check() { |
2267 | 2276 | |
2268 | - if ( ! isset( $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK. |
|
2277 | + if ( ! isset( $_GET['wordpoints_module_check'] ) ) { |
|
2278 | +// WPCS: CSRF OK. |
|
2269 | 2279 | wp_die( '', 400 ); |
2270 | 2280 | } |
2271 | 2281 | |
@@ -2275,7 +2285,8 @@ discard block |
||
2275 | 2285 | $nonce = get_option( 'wordpoints_module_check_nonce' ); |
2276 | 2286 | } |
2277 | 2287 | |
2278 | - if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK. |
|
2288 | + if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { |
|
2289 | +// WPCS: CSRF OK. |
|
2279 | 2290 | wp_die( '', 403 ); |
2280 | 2291 | } |
2281 | 2292 | |
@@ -2571,7 +2582,8 @@ discard block |
||
2571 | 2582 | |
2572 | 2583 | // Don't show them on the extensions screen, because they would be shown before |
2573 | 2584 | // license activation notices, etc. |
2574 | - if ( isset( $_GET['page'] ) && 'wordpoints_extensions' === $_GET['page'] ) { // WPCS: CSRF OK. |
|
2585 | + if ( isset( $_GET['page'] ) && 'wordpoints_extensions' === $_GET['page'] ) { |
|
2586 | +// WPCS: CSRF OK. |
|
2575 | 2587 | return; |
2576 | 2588 | } |
2577 | 2589 |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | foreach ( $objects as $slug => $object ) { |
642 | 642 | |
643 | 643 | if ( $object instanceof WordPoints_Hook_UI_Script_Data_ProviderI ) { |
644 | - $data[ $slug ] = $object->get_ui_script_data(); |
|
644 | + $data[$slug] = $object->get_ui_script_data(); |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | if ( wp_script_is( "wordpoints-hooks-{$type}-{$slug}", 'registered' ) ) { |
@@ -676,21 +676,21 @@ discard block |
||
676 | 676 | /** @var WordPoints_EntityishI $child */ |
677 | 677 | foreach ( $entity_children->get_children( $slug ) as $child_slug => $child ) { |
678 | 678 | |
679 | - $child_data[ $child_slug ] = array( |
|
679 | + $child_data[$child_slug] = array( |
|
680 | 680 | 'slug' => $child_slug, |
681 | 681 | 'title' => $child->get_title(), |
682 | 682 | ); |
683 | 683 | |
684 | 684 | if ( $child instanceof WordPoints_Entity_Attr ) { |
685 | 685 | |
686 | - $child_data[ $child_slug ]['_type'] = 'attr'; |
|
687 | - $child_data[ $child_slug ]['data_type'] = $child->get_data_type(); |
|
686 | + $child_data[$child_slug]['_type'] = 'attr'; |
|
687 | + $child_data[$child_slug]['data_type'] = $child->get_data_type(); |
|
688 | 688 | |
689 | 689 | } elseif ( $child instanceof WordPoints_Entity_Relationship ) { |
690 | 690 | |
691 | - $child_data[ $child_slug ]['_type'] = 'relationship'; |
|
692 | - $child_data[ $child_slug ]['primary'] = $child->get_primary_entity_slug(); |
|
693 | - $child_data[ $child_slug ]['secondary'] = $child->get_related_entity_slug(); |
|
691 | + $child_data[$child_slug]['_type'] = 'relationship'; |
|
692 | + $child_data[$child_slug]['primary'] = $child->get_primary_entity_slug(); |
|
693 | + $child_data[$child_slug]['secondary'] = $child->get_related_entity_slug(); |
|
694 | 694 | } |
695 | 695 | |
696 | 696 | /** |
@@ -701,14 +701,14 @@ discard block |
||
701 | 701 | * @param array $data The data for the entity child. |
702 | 702 | * @param WordPoints_Entityish $child The child's object. |
703 | 703 | */ |
704 | - $child_data[ $child_slug ] = apply_filters( |
|
704 | + $child_data[$child_slug] = apply_filters( |
|
705 | 705 | 'wordpoints_hooks_ui_data_entity_child' |
706 | - , $child_data[ $child_slug ] |
|
706 | + , $child_data[$child_slug] |
|
707 | 707 | , $child |
708 | 708 | ); |
709 | 709 | } |
710 | 710 | |
711 | - $entities_data[ $slug ] = array( |
|
711 | + $entities_data[$slug] = array( |
|
712 | 712 | 'slug' => $slug, |
713 | 713 | 'title' => $entity->get_title(), |
714 | 714 | 'children' => $child_data, |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | } |
730 | 730 | } |
731 | 731 | |
732 | - $entities_data[ $slug ]['values'] = $values; |
|
732 | + $entities_data[$slug]['values'] = $values; |
|
733 | 733 | } |
734 | 734 | |
735 | 735 | /** |
@@ -738,9 +738,9 @@ discard block |
||
738 | 738 | * @param array $data The data for the entity. |
739 | 739 | * @param WordPoints_Entity $entity The entity object. |
740 | 740 | */ |
741 | - $entities_data[ $slug ] = apply_filters( |
|
741 | + $entities_data[$slug] = apply_filters( |
|
742 | 742 | 'wordpoints_hooks_ui_data_entity' |
743 | - , $entities_data[ $slug ] |
|
743 | + , $entities_data[$slug] |
|
744 | 744 | , $entity |
745 | 745 | ); |
746 | 746 | |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | // this, so that we have the action types indexed by event slug. |
774 | 774 | foreach ( $event_index as $action_type => $events ) { |
775 | 775 | foreach ( $events as $event => $unused ) { |
776 | - $event_action_types[ $event ][ $action_type ] = true; |
|
776 | + $event_action_types[$event][$action_type] = true; |
|
777 | 777 | } |
778 | 778 | } |
779 | 779 | |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | $tab = sanitize_key( $_GET['tab'] ); // WPCS: CSRF OK. |
931 | 931 | } |
932 | 932 | |
933 | - if ( isset( $tabs ) && ! isset( $tabs[ $tab ] ) ) { |
|
933 | + if ( isset( $tabs ) && ! isset( $tabs[$tab] ) ) { |
|
934 | 934 | |
935 | 935 | reset( $tabs ); |
936 | 936 | $tab = key( $tabs ); |
@@ -957,7 +957,7 @@ discard block |
||
957 | 957 | if ( $show_heading ) { |
958 | 958 | |
959 | 959 | // translators: Current tab name. |
960 | - echo '<h1>', esc_html( sprintf( __( 'WordPoints — %s', 'wordpoints' ), $tabs[ $current ] ) ), '</h1>'; |
|
960 | + echo '<h1>', esc_html( sprintf( __( 'WordPoints — %s', 'wordpoints' ), $tabs[$current] ) ), '</h1>'; |
|
961 | 961 | } |
962 | 962 | |
963 | 963 | echo '<h2 class="nav-tab-wrapper">'; |
@@ -1431,20 +1431,20 @@ discard block |
||
1431 | 1431 | |
1432 | 1432 | $url = sanitize_title_with_dashes( $server->get_slug() ); |
1433 | 1433 | |
1434 | - if ( ! isset( $_POST[ "license_key-{$url}-{$extension['ID']}" ] ) ) { |
|
1434 | + if ( ! isset( $_POST["license_key-{$url}-{$extension['ID']}"] ) ) { |
|
1435 | 1435 | continue; |
1436 | 1436 | } |
1437 | 1437 | |
1438 | 1438 | $license_key = sanitize_key( |
1439 | - $_POST[ "license_key-{$url}-{$extension['ID']}" ] |
|
1439 | + $_POST["license_key-{$url}-{$extension['ID']}"] |
|
1440 | 1440 | ); |
1441 | 1441 | |
1442 | 1442 | $license = $api->get_extension_license_object( $extension_data, $license_key ); |
1443 | 1443 | |
1444 | 1444 | if ( |
1445 | 1445 | isset( |
1446 | - $_POST[ "activate-license-{$extension['ID']}" ] |
|
1447 | - , $_POST[ "wordpoints_activate_license_key-{$extension['ID']}" ] |
|
1446 | + $_POST["activate-license-{$extension['ID']}"] |
|
1447 | + , $_POST["wordpoints_activate_license_key-{$extension['ID']}"] |
|
1448 | 1448 | ) |
1449 | 1449 | && wordpoints_verify_nonce( |
1450 | 1450 | "wordpoints_activate_license_key-{$extension['ID']}" |
@@ -1489,8 +1489,8 @@ discard block |
||
1489 | 1489 | |
1490 | 1490 | } elseif ( |
1491 | 1491 | isset( |
1492 | - $_POST[ "deactivate-license-{$extension['ID']}" ] |
|
1493 | - , $_POST[ "wordpoints_deactivate_license_key-{$extension['ID']}" ] |
|
1492 | + $_POST["deactivate-license-{$extension['ID']}"] |
|
1493 | + , $_POST["wordpoints_deactivate_license_key-{$extension['ID']}"] |
|
1494 | 1494 | ) |
1495 | 1495 | && wordpoints_verify_nonce( |
1496 | 1496 | "wordpoints_deactivate_license_key-{$extension['ID']}" |
@@ -1746,11 +1746,11 @@ discard block |
||
1746 | 1746 | |
1747 | 1747 | $extensions = wordpoints_get_modules(); |
1748 | 1748 | |
1749 | - if ( ! isset( $extensions[ $extension_file ] ) ) { |
|
1749 | + if ( ! isset( $extensions[$extension_file] ) ) { |
|
1750 | 1750 | wp_die( esc_html__( 'That extension does not exist.', 'wordpoints' ), 200 ); |
1751 | 1751 | } |
1752 | 1752 | |
1753 | - $server = wordpoints_get_server_for_extension( $extensions[ $extension_file ] ); |
|
1753 | + $server = wordpoints_get_server_for_extension( $extensions[$extension_file] ); |
|
1754 | 1754 | |
1755 | 1755 | if ( ! $server ) { |
1756 | 1756 | wp_die( esc_html__( 'There is no server specified for this extension.', 'wordpoints' ), 200 ); |
@@ -1763,7 +1763,7 @@ discard block |
||
1763 | 1763 | } |
1764 | 1764 | |
1765 | 1765 | $extension_data = new WordPoints_Extension_Server_API_Extension_Data( |
1766 | - $extensions[ $extension_file ]['ID'] |
|
1766 | + $extensions[$extension_file]['ID'] |
|
1767 | 1767 | , $server |
1768 | 1768 | ); |
1769 | 1769 | |
@@ -2140,7 +2140,7 @@ discard block |
||
2140 | 2140 | |
2141 | 2141 | foreach ( $merged_extensions as $i => $extension ) { |
2142 | 2142 | if ( true !== wordpoints_validate_module( $extension ) ) { |
2143 | - unset( $merged_extensions[ $i ] ); |
|
2143 | + unset( $merged_extensions[$i] ); |
|
2144 | 2144 | } |
2145 | 2145 | } |
2146 | 2146 | |
@@ -2318,11 +2318,11 @@ discard block |
||
2318 | 2318 | // this transient. |
2319 | 2319 | $updates = get_site_transient( 'update_plugins' ); |
2320 | 2320 | |
2321 | - if ( ! isset( $updates->response[ $plugin_basename ] ) ) { |
|
2321 | + if ( ! isset( $updates->response[$plugin_basename] ) ) { |
|
2322 | 2322 | return false; |
2323 | 2323 | } |
2324 | 2324 | |
2325 | - if ( ! isset( $updates->response[ $plugin_basename ]->wordpoints_required_php ) ) { |
|
2325 | + if ( ! isset( $updates->response[$plugin_basename]->wordpoints_required_php ) ) { |
|
2326 | 2326 | |
2327 | 2327 | /** |
2328 | 2328 | * The plugin install functions. |
@@ -2357,13 +2357,13 @@ discard block |
||
2357 | 2357 | $version = $matches[1]; |
2358 | 2358 | } |
2359 | 2359 | |
2360 | - $updates->response[ $plugin_basename ]->wordpoints_required_php = $version; |
|
2360 | + $updates->response[$plugin_basename]->wordpoints_required_php = $version; |
|
2361 | 2361 | |
2362 | 2362 | set_site_transient( 'update_plugins', $updates ); |
2363 | 2363 | |
2364 | 2364 | } // End if ( PHP requirements not in cache ). |
2365 | 2365 | |
2366 | - return $updates->response[ $plugin_basename ]->wordpoints_required_php; |
|
2366 | + return $updates->response[$plugin_basename]->wordpoints_required_php; |
|
2367 | 2367 | } |
2368 | 2368 | |
2369 | 2369 | /** |
@@ -2445,11 +2445,11 @@ discard block |
||
2445 | 2445 | // First check that there is actually an update available. |
2446 | 2446 | $updates = get_site_transient( 'update_plugins' ); |
2447 | 2447 | |
2448 | - if ( ! isset( $updates->response[ $file ] ) ) { |
|
2448 | + if ( ! isset( $updates->response[$file] ) ) { |
|
2449 | 2449 | return; |
2450 | 2450 | } |
2451 | 2451 | |
2452 | - $response = $updates->response[ $file ]; |
|
2452 | + $response = $updates->response[$file]; |
|
2453 | 2453 | |
2454 | 2454 | $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); |
2455 | 2455 | |
@@ -2553,8 +2553,8 @@ discard block |
||
2553 | 2553 | |
2554 | 2554 | $plugin_basename = plugin_basename( WORDPOINTS_DIR . '/wordpoints.php' ); |
2555 | 2555 | |
2556 | - if ( isset( $data->response[ $plugin_basename ] ) ) { |
|
2557 | - unset( $data->response[ $plugin_basename ] ); |
|
2556 | + if ( isset( $data->response[$plugin_basename] ) ) { |
|
2557 | + unset( $data->response[$plugin_basename] ); |
|
2558 | 2558 | } |
2559 | 2559 | |
2560 | 2560 | return $data; |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | |
488 | 488 | $fields = implode( ', ', array_map( 'wordpoints_escape_mysql_identifier', $fields ) ); |
489 | 489 | |
490 | - $this->select = "SELECT {$fields}"; |
|
490 | + $this->select = "select {$fields}"; |
|
491 | 491 | } |
492 | 492 | |
493 | 493 | /** |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | } |
778 | 778 | |
779 | 779 | if ( $this->args['limit'] > 0 && $this->args['offset'] >= 0 ) { |
780 | - $this->limit = "LIMIT {$this->args['offset']}, {$this->args['limit']}"; |
|
780 | + $this->limit = "limit {$this->args['offset']}, {$this->args['limit']}"; |
|
781 | 781 | } |
782 | 782 | } |
783 | 783 |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | foreach ( $this->deprecated_args as $arg => $data ) { |
246 | - if ( isset( $args[ $arg ] ) ) { |
|
246 | + if ( isset( $args[$arg] ) ) { |
|
247 | 247 | |
248 | 248 | _deprecated_argument( |
249 | 249 | esc_html( "{$data['class']}::__construct" ) |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | , esc_html( "{$arg} is deprecated, use {$data['replacement']} instead" ) |
252 | 252 | ); |
253 | 253 | |
254 | - $args[ $data['replacement'] ] = $args[ $arg ]; |
|
254 | + $args[$data['replacement']] = $args[$arg]; |
|
255 | 255 | |
256 | - unset( $args[ $arg ] ); |
|
256 | + unset( $args[$arg] ); |
|
257 | 257 | } |
258 | 258 | } |
259 | 259 | |
@@ -271,19 +271,19 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function get_arg( $arg ) { |
273 | 273 | |
274 | - if ( isset( $this->deprecated_args[ $arg ] ) ) { |
|
274 | + if ( isset( $this->deprecated_args[$arg] ) ) { |
|
275 | 275 | |
276 | 276 | _deprecated_argument( |
277 | - esc_html( "{$this->deprecated_args[ $arg ]['class']}::get_arg" ) |
|
278 | - , esc_html( $this->deprecated_args[ $arg ]['version'] ) |
|
279 | - , esc_html( "{$arg} is deprecated, use {$this->deprecated_args[ $arg ]['replacement']} instead" ) |
|
277 | + esc_html( "{$this->deprecated_args[$arg]['class']}::get_arg" ) |
|
278 | + , esc_html( $this->deprecated_args[$arg]['version'] ) |
|
279 | + , esc_html( "{$arg} is deprecated, use {$this->deprecated_args[$arg]['replacement']} instead" ) |
|
280 | 280 | ); |
281 | 281 | |
282 | - $arg = $this->deprecated_args[ $arg ]['replacement']; |
|
282 | + $arg = $this->deprecated_args[$arg]['replacement']; |
|
283 | 283 | } |
284 | 284 | |
285 | - if ( isset( $this->args[ $arg ] ) ) { |
|
286 | - return $this->args[ $arg ]; |
|
285 | + if ( isset( $this->args[$arg] ) ) { |
|
286 | + return $this->args[$arg]; |
|
287 | 287 | } else { |
288 | 288 | return null; |
289 | 289 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | public function set_args( array $args ) { |
305 | 305 | |
306 | 306 | foreach ( $this->deprecated_args as $arg => $data ) { |
307 | - if ( isset( $args[ $arg ] ) ) { |
|
307 | + if ( isset( $args[$arg] ) ) { |
|
308 | 308 | |
309 | 309 | _deprecated_argument( |
310 | 310 | esc_html( "{$data['class']}::set_args" ) |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | , esc_html( "{$arg} is deprecated, use {$data['replacement']} instead" ) |
313 | 313 | ); |
314 | 314 | |
315 | - $args[ $data['replacement'] ] = $args[ $arg ]; |
|
315 | + $args[$data['replacement']] = $args[$arg]; |
|
316 | 316 | |
317 | - unset( $args[ $arg ] ); |
|
317 | + unset( $args[$arg] ); |
|
318 | 318 | } |
319 | 319 | } |
320 | 320 | |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | $value = $this->validate_value( $value, $validators ); |
532 | 532 | |
533 | 533 | if ( false === $value ) { |
534 | - unset( $values[ $index ] ); |
|
534 | + unset( $values[$index] ); |
|
535 | 535 | } |
536 | 536 | } |
537 | 537 | |
@@ -595,11 +595,11 @@ discard block |
||
595 | 595 | protected function prepare_column_where( $column, $data ) { |
596 | 596 | |
597 | 597 | // If a single value has been supplied for the column, it takes precedence. |
598 | - if ( isset( $this->args[ $column ] ) ) { |
|
598 | + if ( isset( $this->args[$column] ) ) { |
|
599 | 599 | $this->prepare_column( $column, $data ); |
600 | - } elseif ( isset( $this->args[ "{$column}__in" ] ) ) { |
|
600 | + } elseif ( isset( $this->args["{$column}__in"] ) ) { |
|
601 | 601 | $this->prepare_column__in( $column, $data ); |
602 | - } elseif ( isset( $this->args[ "{$column}__not_in" ] ) ) { |
|
602 | + } elseif ( isset( $this->args["{$column}__not_in"] ) ) { |
|
603 | 603 | $this->prepare_column__in( $column, $data, 'NOT IN' ); |
604 | 604 | } |
605 | 605 | } |
@@ -618,13 +618,13 @@ discard block |
||
618 | 618 | |
619 | 619 | if ( |
620 | 620 | isset( $data['values'] ) |
621 | - && ! in_array( $this->args[ $column ], $data['values'], true ) |
|
621 | + && ! in_array( $this->args[$column], $data['values'], true ) |
|
622 | 622 | ) { |
623 | 623 | return; |
624 | 624 | } |
625 | 625 | |
626 | 626 | $value = $this->validate_value( |
627 | - $this->args[ $column ] |
|
627 | + $this->args[$column] |
|
628 | 628 | , $this->get_validators_for_column( $data ) |
629 | 629 | ); |
630 | 630 | |
@@ -665,10 +665,10 @@ discard block |
||
665 | 665 | $comparator = '='; |
666 | 666 | |
667 | 667 | if ( |
668 | - isset( $this->args[ "{$column}__compare" ] ) |
|
669 | - && in_array( $this->args[ "{$column}__compare" ], $comparisons, true ) |
|
668 | + isset( $this->args["{$column}__compare"] ) |
|
669 | + && in_array( $this->args["{$column}__compare"], $comparisons, true ) |
|
670 | 670 | ) { |
671 | - $comparator = $this->args[ "{$column}__compare" ]; |
|
671 | + $comparator = $this->args["{$column}__compare"]; |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | return $comparator; |
@@ -687,11 +687,11 @@ discard block |
||
687 | 687 | |
688 | 688 | $key = "{$column}__" . strtolower( str_replace( ' ', '_', $type ) ); |
689 | 689 | |
690 | - if ( empty( $this->args[ $key ] ) || ! is_array( $this->args[ $key ] ) ) { |
|
690 | + if ( empty( $this->args[$key] ) || ! is_array( $this->args[$key] ) ) { |
|
691 | 691 | return; |
692 | 692 | } |
693 | 693 | |
694 | - $values = $this->args[ $key ]; |
|
694 | + $values = $this->args[$key]; |
|
695 | 695 | |
696 | 696 | if ( isset( $data['values'] ) ) { |
697 | 697 | $values = array_intersect( $values, $data['values'] ); |
@@ -758,9 +758,9 @@ discard block |
||
758 | 758 | foreach ( array( 'limit', 'offset' ) as $key ) { |
759 | 759 | |
760 | 760 | // Save a backup of the arg value since wordpoints_int() is by reference. |
761 | - $arg = $this->args[ $key ]; |
|
761 | + $arg = $this->args[$key]; |
|
762 | 762 | |
763 | - if ( false === wordpoints_int( $this->args[ $key ] ) ) { |
|
763 | + if ( false === wordpoints_int( $this->args[$key] ) ) { |
|
764 | 764 | |
765 | 765 | _doing_it_wrong( |
766 | 766 | __METHOD__ |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | , '1.0.0' |
773 | 773 | ); |
774 | 774 | |
775 | - $this->args[ $key ] = 0; |
|
775 | + $this->args[$key] = 0; |
|
776 | 776 | } |
777 | 777 | } |
778 | 778 | |
@@ -820,7 +820,7 @@ discard block |
||
820 | 820 | $order_by = "{$meta_table_name}.meta_value"; |
821 | 821 | } |
822 | 822 | |
823 | - } elseif ( isset( $this->columns[ $order_by ] ) ) { |
|
823 | + } elseif ( isset( $this->columns[$order_by] ) ) { |
|
824 | 824 | |
825 | 825 | $order_by = wordpoints_escape_mysql_identifier( $order_by ); |
826 | 826 | |
@@ -843,15 +843,15 @@ discard block |
||
843 | 843 | protected function prepare_date_where( $column ) { |
844 | 844 | |
845 | 845 | if ( |
846 | - empty( $this->args[ "{$column}_query" ] ) |
|
847 | - || ! is_array( $this->args[ "{$column}_query" ] ) |
|
846 | + empty( $this->args["{$column}_query"] ) |
|
847 | + || ! is_array( $this->args["{$column}_query"] ) |
|
848 | 848 | ) { |
849 | 849 | return; |
850 | 850 | } |
851 | 851 | |
852 | 852 | add_filter( 'date_query_valid_columns', array( $this, 'date_query_valid_columns_filter' ) ); |
853 | 853 | |
854 | - $date_query = new WP_Date_Query( $this->args[ "{$column}_query" ], $column ); |
|
854 | + $date_query = new WP_Date_Query( $this->args["{$column}_query"], $column ); |
|
855 | 855 | $date_query = $date_query->get_sql(); |
856 | 856 | |
857 | 857 | if ( ! empty( $date_query ) ) { |
@@ -39,7 +39,8 @@ |
||
39 | 39 | add_action( 'wordpoints_extensions_loaded', 'wordpoints_installables_maybe_update', 5 ); |
40 | 40 | add_action( 'wpmu_new_blog', 'wordpoints_installables_install_on_new_site' ); |
41 | 41 | |
42 | -if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK. |
|
42 | +if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { |
|
43 | +// WPCS: CSRF OK. |
|
43 | 44 | |
44 | 45 | add_action( 'shutdown', 'wordpoints_maintenance_shutdown_print_rand_str' ); |
45 | 46 |
@@ -76,11 +76,13 @@ discard block |
||
76 | 76 | */ |
77 | 77 | $module_statuses = apply_filters( 'wordpoints_module_statuses', $module_statuses ); |
78 | 78 | |
79 | - if ( isset( $_REQUEST['module_status'] ) && in_array( wp_unslash( $_REQUEST['module_status'] ), $module_statuses, true ) ) { // WPCS: CSRF OK. |
|
79 | + if ( isset( $_REQUEST['module_status'] ) && in_array( wp_unslash( $_REQUEST['module_status'] ), $module_statuses, true ) ) { |
|
80 | +// WPCS: CSRF OK. |
|
80 | 81 | $status = sanitize_key( $_REQUEST['module_status'] ); // WPCS: CSRF OK. |
81 | 82 | } |
82 | 83 | |
83 | - if ( isset( $_REQUEST['s'] ) ) { // WPCS: CSRF OK. |
|
84 | + if ( isset( $_REQUEST['s'] ) ) { |
|
85 | +// WPCS: CSRF OK. |
|
84 | 86 | $_SERVER['REQUEST_URI'] = add_query_arg( 's', sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) ); // WPCS: CSRF OK. |
85 | 87 | } |
86 | 88 | |
@@ -342,7 +344,8 @@ discard block |
||
342 | 344 | |
343 | 345 | static $term; |
344 | 346 | |
345 | - if ( is_null( $term ) && isset( $_REQUEST['s'] ) ) { // WPCS: CSRF OK. |
|
347 | + if ( is_null( $term ) && isset( $_REQUEST['s'] ) ) { |
|
348 | +// WPCS: CSRF OK. |
|
346 | 349 | $term = sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ); // WPCS: CSRF OK. |
347 | 350 | } |
348 | 351 | |
@@ -802,9 +805,12 @@ discard block |
||
802 | 805 | <p> |
803 | 806 | <?php if ( ! empty( $module_data['description'] ) ) : ?> |
804 | 807 | <?php echo wp_kses( $module_data['description'], 'wordpoints_module_description' ); ?> |
805 | - <?php else : ?> |
|
808 | + <?php else { |
|
809 | + : ?> |
|
806 | 810 | |
807 | - <?php endif; ?> |
|
811 | + <?php endif; |
|
812 | +} |
|
813 | +?> |
|
808 | 814 | </p> |
809 | 815 | </div> |
810 | 816 | <div class="<?php echo esc_attr( $class ); ?> second module-version-author-uri"> |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | foreach ( $recently_activated as $key => $time ) { |
174 | 174 | |
175 | 175 | if ( $time + WEEK_IN_SECONDS < time() ) { |
176 | - unset( $recently_activated[ $key ] ); |
|
176 | + unset( $recently_activated[$key] ); |
|
177 | 177 | } |
178 | 178 | } |
179 | 179 | |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | ) { |
213 | 213 | |
214 | 214 | if ( $show_network_active ) { |
215 | - $modules['inactive'][ $module_file ] = $module_data; // WPCS: prefix OK. |
|
215 | + $modules['inactive'][$module_file] = $module_data; // WPCS: prefix OK. |
|
216 | 216 | } else { |
217 | - unset( $modules['all'][ $module_file ] ); |
|
217 | + unset( $modules['all'][$module_file] ); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | } elseif ( |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | ) { |
224 | 224 | |
225 | 225 | if ( $show_network_active ) { |
226 | - $modules['active'][ $module_file ] = $module_data; // WPCS: prefix OK. |
|
226 | + $modules['active'][$module_file] = $module_data; // WPCS: prefix OK. |
|
227 | 227 | } else { |
228 | - unset( $modules['all'][ $module_file ] ); |
|
228 | + unset( $modules['all'][$module_file] ); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | } elseif ( |
@@ -238,16 +238,16 @@ discard block |
||
238 | 238 | ) |
239 | 239 | ) { |
240 | 240 | |
241 | - $modules['active'][ $module_file ] = $module_data; // WPCS: prefix OK. |
|
241 | + $modules['active'][$module_file] = $module_data; // WPCS: prefix OK. |
|
242 | 242 | |
243 | 243 | } else { |
244 | 244 | |
245 | 245 | // Was the module recently activated? |
246 | - if ( ! $this->screen->in_admin( 'network' ) && isset( $recently_activated[ $module_file ] ) ) { |
|
247 | - $modules['recently_activated'][ $module_file ] = $module_data; // WPCS: prefix OK. |
|
246 | + if ( ! $this->screen->in_admin( 'network' ) && isset( $recently_activated[$module_file] ) ) { |
|
247 | + $modules['recently_activated'][$module_file] = $module_data; // WPCS: prefix OK. |
|
248 | 248 | } |
249 | 249 | |
250 | - $modules['inactive'][ $module_file ] = $module_data; // WPCS: prefix OK. |
|
250 | + $modules['inactive'][$module_file] = $module_data; // WPCS: prefix OK. |
|
251 | 251 | |
252 | 252 | } // End if (). |
253 | 253 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | * for modules that have an available update. |
257 | 257 | */ |
258 | 258 | if ( $user_can_update && $updates->has_update( $module_file ) ) { |
259 | - $modules['upgrade'][ $module_file ] = $modules['all'][ $module_file ]; // WPCS: prefix OK. |
|
259 | + $modules['upgrade'][$module_file] = $modules['all'][$module_file]; // WPCS: prefix OK. |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | } // End foreach ( modules ). |
@@ -289,21 +289,21 @@ discard block |
||
289 | 289 | $totals = array(); |
290 | 290 | |
291 | 291 | foreach ( $modules as $type => $list ) { |
292 | - $totals[ $type ] = count( $list ); |
|
292 | + $totals[$type] = count( $list ); |
|
293 | 293 | } |
294 | 294 | |
295 | - if ( empty( $modules[ $status ] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) { |
|
295 | + if ( empty( $modules[$status] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) { |
|
296 | 296 | $status = 'all'; |
297 | 297 | } |
298 | 298 | |
299 | 299 | $this->items = array(); |
300 | 300 | |
301 | - foreach ( $modules[ $status ] as $module_file => $module_data ) { |
|
301 | + foreach ( $modules[$status] as $module_file => $module_data ) { |
|
302 | 302 | |
303 | - $this->items[ $module_file ] = wordpoints_get_module_data( wordpoints_extensions_dir() . '/' . $module_file, false ); |
|
303 | + $this->items[$module_file] = wordpoints_get_module_data( wordpoints_extensions_dir() . '/' . $module_file, false ); |
|
304 | 304 | } |
305 | 305 | |
306 | - $total_this_page = $totals[ $status ]; |
|
306 | + $total_this_page = $totals[$status]; |
|
307 | 307 | |
308 | 308 | if ( ! $orderby ) { |
309 | 309 | $orderby = 'name'; |
@@ -372,8 +372,8 @@ discard block |
||
372 | 372 | |
373 | 373 | global $orderby, $order; |
374 | 374 | |
375 | - $a = $module_a[ $orderby ]; |
|
376 | - $b = $module_b[ $orderby ]; |
|
375 | + $a = $module_a[$orderby]; |
|
376 | + $b = $module_b[$orderby]; |
|
377 | 377 | |
378 | 378 | if ( $a === $b ) { |
379 | 379 | return 0; |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | */ |
481 | 481 | $text = apply_filters( "wordpoints_modules_status_link_text-{$type}", $text, $count ); |
482 | 482 | |
483 | - $status_links[ $type ] = sprintf( |
|
483 | + $status_links[$type] = sprintf( |
|
484 | 484 | "<a href='%s' %s>%s</a>" |
485 | 485 | , esc_url( add_query_arg( 'module_status', $type, self_admin_url( 'admin.php?page=wordpoints_extensions' ) ) ) |
486 | 486 | , ( $type === $status ) ? ' class="current"' : '' |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | $module_data['extra']['restricted_network_active'] = $restricted_network_active; |
701 | 701 | $module_data['extra']['restricted_network_only'] = $restricted_network_only; |
702 | 702 | |
703 | - list( $columns, $hidden, , $primary ) = $this->get_column_info(); |
|
703 | + list( $columns, $hidden,, $primary ) = $this->get_column_info(); |
|
704 | 704 | |
705 | 705 | foreach ( $columns as $column_name => $column_display_name ) { |
706 | 706 |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | $points_types_hooks = WordPoints_Points_Hooks::get_defaults(); |
40 | 40 | } |
41 | 41 | |
42 | -if ( isset( $points_types_hooks[ $points_type_id ] ) ) { |
|
43 | - $points_type_hooks = $points_types_hooks[ $points_type_id ]; |
|
42 | +if ( isset( $points_types_hooks[$points_type_id] ) ) { |
|
43 | + $points_type_hooks = $points_types_hooks[$points_type_id]; |
|
44 | 44 | } else { |
45 | 45 | $points_type_hooks = array(); |
46 | 46 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | // Remove the hook from this points type. |
62 | - $points_types_hooks[ $points_type_id ] = array_diff( $points_type_hooks, array( $hook_id ) ); |
|
62 | + $points_types_hooks[$points_type_id] = array_diff( $points_type_hooks, array( $hook_id ) ); |
|
63 | 63 | |
64 | 64 | $hook->delete_callback( $hook_id ); |
65 | 65 | |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | |
84 | 84 | } else { |
85 | 85 | |
86 | - if ( isset( $_POST[ 'hook-' . $id_base ] ) && is_array( $_POST[ 'hook-' . $id_base ] ) ) { |
|
87 | - $new_instance = wp_unslash( reset( $_POST[ 'hook-' . $id_base ] ) ); // WPCS sanitization OK. |
|
86 | + if ( isset( $_POST['hook-' . $id_base] ) && is_array( $_POST['hook-' . $id_base] ) ) { |
|
87 | + $new_instance = wp_unslash( reset( $_POST['hook-' . $id_base] ) ); // WPCS sanitization OK. |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $number = $hook->get_number_by_id( $hook_id ); |
@@ -102,15 +102,15 @@ discard block |
||
102 | 102 | if ( ! in_array( $hook_id, $points_type_hooks, true ) ) { |
103 | 103 | |
104 | 104 | $points_type_hooks[] = $hook_id; |
105 | - $points_types_hooks[ $points_type_id ] = $points_type_hooks; |
|
105 | + $points_types_hooks[$points_type_id] = $points_type_hooks; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | // Remove from old points type if it has changed. |
109 | 109 | $old_points_type = WordPoints_Points_Hooks::get_points_type( $hook_id ); |
110 | 110 | |
111 | - if ( $old_points_type && $old_points_type !== $points_type_id && is_array( $points_types_hooks[ $old_points_type ] ) ) { |
|
111 | + if ( $old_points_type && $old_points_type !== $points_type_id && is_array( $points_types_hooks[$old_points_type] ) ) { |
|
112 | 112 | |
113 | - $points_types_hooks[ $old_points_type ] = array_diff( $points_types_hooks[ $old_points_type ], array( $hook_id ) ); |
|
113 | + $points_types_hooks[$old_points_type] = array_diff( $points_types_hooks[$old_points_type], array( $hook_id ) ); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | } else { |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | foreach ( $points_types as $slug => $settings ) { |
49 | 49 | |
50 | - $tabs[ $slug ] = $settings['name']; |
|
50 | + $tabs[$slug] = $settings['name']; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | wordpoints_admin_show_tabs( $tabs, false ); |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | |
47 | 47 | foreach ( array_keys( wordpoints_get_points_types() ) as $points_type ) { |
48 | 48 | |
49 | - if ( empty( $_POST['points_types'][ $points_type ] ) ) { |
|
49 | + if ( empty( $_POST['points_types'][$points_type] ) ) { |
|
50 | 50 | continue; |
51 | 51 | } |
52 | 52 | |
53 | - $hooks = sanitize_text_field( wp_unslash( $_POST['points_types'][ $points_type ] ) ); |
|
53 | + $hooks = sanitize_text_field( wp_unslash( $_POST['points_types'][$points_type] ) ); |
|
54 | 54 | |
55 | 55 | $points_type_hooks = array(); |
56 | 56 | |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | continue; |
63 | 63 | } |
64 | 64 | |
65 | - $points_type_hooks[ $order ] = substr( $hook_id, strpos( $hook_id, '_' ) + 1 ); |
|
65 | + $points_type_hooks[$order] = substr( $hook_id, strpos( $hook_id, '_' ) + 1 ); |
|
66 | 66 | } |
67 | 67 | |
68 | - $points_types_hooks[ $points_type ] = $points_type_hooks; |
|
68 | + $points_types_hooks[$points_type] = $points_type_hooks; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | WordPoints_Points_Hooks::save_points_types_hooks( $points_types_hooks ); |
@@ -189,14 +189,14 @@ discard block |
||
189 | 189 | |
190 | 190 | $settings = false; |
191 | 191 | |
192 | - if ( isset( $_POST[ 'hook-' . $id_base ] ) && is_array( $_POST[ 'hook-' . $id_base ] ) ) { |
|
193 | - $settings = wp_unslash( $_POST[ 'hook-' . $id_base ] ); // WPCS: sanitization OK. |
|
192 | + if ( isset( $_POST['hook-' . $id_base] ) && is_array( $_POST['hook-' . $id_base] ) ) { |
|
193 | + $settings = wp_unslash( $_POST['hook-' . $id_base] ); // WPCS: sanitization OK. |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | $points_types_hooks = WordPoints_Points_Hooks::get_points_types_hooks(); |
197 | 197 | |
198 | 198 | // Get the hooks for this points type. |
199 | - $points_type_hooks = ( isset( $points_types_hooks[ $points_type_id ] ) ) ? $points_types_hooks[ $points_type_id ] : array(); |
|
199 | + $points_type_hooks = ( isset( $points_types_hooks[$points_type_id] ) ) ? $points_types_hooks[$points_type_id] : array(); |
|
200 | 200 | |
201 | 201 | if ( ! empty( $_POST['delete_hook'] ) ) { |
202 | 202 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $hook->delete_callback( $number ); |
210 | 210 | |
211 | 211 | // Remove this instance of the hook, and reset the positions (keys). |
212 | - $points_types_hooks[ $points_type_id ] = array_diff( $points_type_hooks, array( $hook_id ) ); |
|
212 | + $points_types_hooks[$points_type_id] = array_diff( $points_type_hooks, array( $hook_id ) ); |
|
213 | 213 | |
214 | 214 | WordPoints_Points_Hooks::save_points_types_hooks( $points_types_hooks ); |
215 | 215 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | // Save the points types-hooks associations. |
232 | 232 | $points_type_hooks[] = $hook->get_id( $number ); |
233 | - $points_types_hooks[ $points_type_id ] = $points_type_hooks; |
|
233 | + $points_types_hooks[$points_type_id] = $points_type_hooks; |
|
234 | 234 | WordPoints_Points_Hooks::save_points_types_hooks( $points_types_hooks ); |
235 | 235 | |
236 | 236 | } else { |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | */ |
66 | 66 | protected function get_points_logs_to_be_reversed( WordPoints_Hook_Fire $fire ) { |
67 | 67 | |
68 | - if ( isset( $fire->data[ $this->slug ]['points_logs'] ) ) { |
|
69 | - return $fire->data[ $this->slug ]['points_logs']; |
|
68 | + if ( isset( $fire->data[$this->slug]['points_logs'] ) ) { |
|
69 | + return $fire->data[$this->slug]['points_logs']; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $meta_queries = array( |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $entities = $fire->event_args->get_signature_args(); |
86 | 86 | |
87 | 87 | if ( ! $entities ) { |
88 | - $fire->data[ $this->slug ]['points_logs'] = array(); |
|
88 | + $fire->data[$this->slug]['points_logs'] = array(); |
|
89 | 89 | return array(); |
90 | 90 | } |
91 | 91 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $logs = array(); |
118 | 118 | } |
119 | 119 | |
120 | - $fire->data[ $this->slug ]['points_logs'] = $logs; |
|
120 | + $fire->data[$this->slug]['points_logs'] = $logs; |
|
121 | 121 | |
122 | 122 | return $logs; |
123 | 123 | } |