@@ -7,15 +7,15 @@ discard block |
||
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! isset( $_GET['edithook'] ) ) { // WPCS: CSRF OK. |
|
10 | +if ( ! isset( $_GET[ 'edithook' ] ) ) { // WPCS: CSRF OK. |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | |
14 | -$hook_id = sanitize_key( $_GET['edithook'] ); |
|
14 | +$hook_id = sanitize_key( $_GET[ 'edithook' ] ); |
|
15 | 15 | |
16 | 16 | $points_types = wordpoints_get_points_types(); |
17 | 17 | |
18 | -if ( isset( $_GET['addnew'] ) ) { // WPCS: CSRF OK. |
|
18 | +if ( isset( $_GET[ 'addnew' ] ) ) { // WPCS: CSRF OK. |
|
19 | 19 | |
20 | 20 | // - We are adding a new points hook. |
21 | 21 | |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | return; |
34 | 34 | } |
35 | 35 | |
36 | - if ( isset( $_GET['base'], $_GET['num'] ) ) { // WPCS: CSRF OK. |
|
36 | + if ( isset( $_GET[ 'base' ], $_GET[ 'num' ] ) ) { // WPCS: CSRF OK. |
|
37 | 37 | |
38 | 38 | // Copy minimal info from an existing instance of this hook to a new instance. |
39 | 39 | $hook = WordPoints_Points_Hooks::get_handler_by_id_base( |
40 | - sanitize_key( $_GET['base'] ) // WPCS: CSRF OK. |
|
40 | + sanitize_key( $_GET[ 'base' ] ) // WPCS: CSRF OK. |
|
41 | 41 | ); |
42 | 42 | |
43 | 43 | if ( ! $hook ) { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
53 | - $multi_number = (int) $_GET['num']; |
|
53 | + $multi_number = (int) $_GET[ 'num' ]; |
|
54 | 54 | $number = 0; |
55 | 55 | $hook_id = $hook->get_id( $multi_number ); |
56 | 56 | $_hook = $hook; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | // We are editing an existing points hook. |
72 | 72 | |
73 | - $points_type = isset( $_GET['points_type'] ) ? sanitize_key( $_GET['points_type'] ) : '_inactive_hooks'; // WPCS: CSRF OK. |
|
73 | + $points_type = isset( $_GET[ 'points_type' ] ) ? sanitize_key( $_GET[ 'points_type' ] ) : '_inactive_hooks'; // WPCS: CSRF OK. |
|
74 | 74 | |
75 | 75 | $hook = WordPoints_Points_Hooks::get_handler( $hook_id ); |
76 | 76 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | </div> |
125 | 125 | <br /> |
126 | 126 | <div class="hook-control-actions"> |
127 | - <?php if ( isset( $_GET['addnew'] ) ) : // WPCS: CSRF OK. ?> |
|
127 | + <?php if ( isset( $_GET[ 'addnew' ] ) ) : // WPCS: CSRF OK. ?> |
|
128 | 128 | <a href="<?php echo esc_url( self_admin_url( 'admin.php?page=wordpoints_points_hooks' ) ); ?>" class="button alignleft"><?php esc_html_e( 'Cancel', 'wordpoints' ); ?></a> |
129 | 129 | <?php else : |
130 | 130 | submit_button( _x( 'Delete', 'points hook', 'wordpoints' ), 'button alignleft', 'removehook', false ); |
@@ -7,7 +7,8 @@ discard block |
||
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | 9 | |
10 | -if ( ! isset( $_GET['edithook'] ) ) { // WPCS: CSRF OK. |
|
10 | +if ( ! isset( $_GET['edithook'] ) ) { |
|
11 | +// WPCS: CSRF OK. |
|
11 | 12 | return; |
12 | 13 | } |
13 | 14 | |
@@ -15,7 +16,8 @@ discard block |
||
15 | 16 | |
16 | 17 | $points_types = wordpoints_get_points_types(); |
17 | 18 | |
18 | -if ( isset( $_GET['addnew'] ) ) { // WPCS: CSRF OK. |
|
19 | +if ( isset( $_GET['addnew'] ) ) { |
|
20 | +// WPCS: CSRF OK. |
|
19 | 21 | |
20 | 22 | // - We are adding a new points hook. |
21 | 23 | |
@@ -33,7 +35,8 @@ discard block |
||
33 | 35 | return; |
34 | 36 | } |
35 | 37 | |
36 | - if ( isset( $_GET['base'], $_GET['num'] ) ) { // WPCS: CSRF OK. |
|
38 | + if ( isset( $_GET['base'], $_GET['num'] ) ) { |
|
39 | +// WPCS: CSRF OK. |
|
37 | 40 | |
38 | 41 | // Copy minimal info from an existing instance of this hook to a new instance. |
39 | 42 | $hook = WordPoints_Points_Hooks::get_handler_by_id_base( |
@@ -126,8 +129,10 @@ discard block |
||
126 | 129 | <div class="hook-control-actions"> |
127 | 130 | <?php if ( isset( $_GET['addnew'] ) ) : // WPCS: CSRF OK. ?> |
128 | 131 | <a href="<?php echo esc_url( self_admin_url( 'admin.php?page=wordpoints_points_hooks' ) ); ?>" class="button alignleft"><?php esc_html_e( 'Cancel', 'wordpoints' ); ?></a> |
129 | - <?php else : |
|
132 | + <?php else { |
|
133 | + : |
|
130 | 134 | submit_button( _x( 'Delete', 'points hook', 'wordpoints' ), 'button alignleft', 'removehook', false ); |
135 | +} |
|
131 | 136 | endif; |
132 | 137 | |
133 | 138 | submit_button( __( 'Save Hook', 'wordpoints' ), 'button-primary alignright', 'savehook', false ); |
@@ -43,18 +43,18 @@ discard block |
||
43 | 43 | return; |
44 | 44 | } |
45 | 45 | |
46 | - if ( isset( $_GET['message'] ) && isset( $messages[ (int) $_GET['message'] ] ) ) { // WPCS: CSRF OK. |
|
46 | + if ( isset( $_GET[ 'message' ] ) && isset( $messages[ (int) $_GET[ 'message' ] ] ) ) { // WPCS: CSRF OK. |
|
47 | 47 | |
48 | 48 | wordpoints_show_admin_message( |
49 | - esc_html( $messages[ (int) $_GET['message'] ] ) // WPCS: CSRF OK. |
|
49 | + esc_html( $messages[ (int) $_GET[ 'message' ] ] ) // WPCS: CSRF OK. |
|
50 | 50 | , 'success' |
51 | 51 | , array( 'dismissible' => true ) |
52 | 52 | ); |
53 | 53 | |
54 | - } elseif ( isset( $_GET['error'] ) && isset( $errors[ (int) $_GET['error'] ] ) ) { // WPCS: CSRF OK. |
|
54 | + } elseif ( isset( $_GET[ 'error' ] ) && isset( $errors[ (int) $_GET[ 'error' ] ] ) ) { // WPCS: CSRF OK. |
|
55 | 55 | |
56 | 56 | wordpoints_show_admin_error( |
57 | - esc_html( $errors[ (int) $_GET['error'] ] ) // WPCS: CSRF OK. |
|
57 | + esc_html( $errors[ (int) $_GET[ 'error' ] ] ) // WPCS: CSRF OK. |
|
58 | 58 | , array( 'dismissible' => true ) |
59 | 59 | ); |
60 | 60 | } |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | foreach ( $points_types as $slug => $points_type ) { |
125 | 125 | |
126 | 126 | $wrap_class = 'hooks-holder-wrap'; |
127 | - if ( ! empty( $points_type['class'] ) ) { |
|
128 | - $wrap_class .= ' points-type-' . $points_type['class']; |
|
127 | + if ( ! empty( $points_type[ 'class' ] ) ) { |
|
128 | + $wrap_class .= ' points-type-' . $points_type[ 'class' ]; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | if ( $i ) { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | <div class="<?php echo esc_attr( $wrap_class ); ?>"> |
138 | 138 | <div class="points-type-name"> |
139 | 139 | <div class="points-type-name-arrow"><br /></div> |
140 | - <h2><?php echo esc_html( $points_type['name'] ); ?><span class="spinner"></span></h2> |
|
140 | + <h2><?php echo esc_html( $points_type[ 'name' ] ); ?><span class="spinner"></span></h2> |
|
141 | 141 | </div> |
142 | 142 | <div id="<?php echo esc_attr( $slug ); ?>" class="hooks-sortables"> |
143 | 143 |
@@ -43,7 +43,8 @@ discard block |
||
43 | 43 | return; |
44 | 44 | } |
45 | 45 | |
46 | - if ( isset( $_GET['message'] ) && isset( $messages[ (int) $_GET['message'] ] ) ) { // WPCS: CSRF OK. |
|
46 | + if ( isset( $_GET['message'] ) && isset( $messages[ (int) $_GET['message'] ] ) ) { |
|
47 | +// WPCS: CSRF OK. |
|
47 | 48 | |
48 | 49 | wordpoints_show_admin_message( |
49 | 50 | esc_html( $messages[ (int) $_GET['message'] ] ) // WPCS: CSRF OK. |
@@ -51,7 +52,8 @@ discard block |
||
51 | 52 | , array( 'dismissible' => true ) |
52 | 53 | ); |
53 | 54 | |
54 | - } elseif ( isset( $_GET['error'] ) && isset( $errors[ (int) $_GET['error'] ] ) ) { // WPCS: CSRF OK. |
|
55 | + } elseif ( isset( $_GET['error'] ) && isset( $errors[ (int) $_GET['error'] ] ) ) { |
|
56 | +// WPCS: CSRF OK. |
|
55 | 57 | |
56 | 58 | wordpoints_show_admin_error( |
57 | 59 | esc_html( $errors[ (int) $_GET['error'] ] ) // WPCS: CSRF OK. |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | protected function verify_atts() { |
24 | 24 | |
25 | - if ( isset( $this->pairs['points_type'] ) ) { |
|
25 | + if ( isset( $this->pairs[ 'points_type' ] ) ) { |
|
26 | 26 | |
27 | 27 | $points_type = $this->get_points_type(); |
28 | 28 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | return $points_type; |
31 | 31 | } |
32 | 32 | |
33 | - $this->atts['points_type'] = $points_type; |
|
33 | + $this->atts[ 'points_type' ] = $points_type; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | return parent::verify_atts(); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | protected function get_points_type() { |
52 | 52 | |
53 | - $points_type = $this->atts['points_type']; |
|
53 | + $points_type = $this->atts[ 'points_type' ]; |
|
54 | 54 | |
55 | 55 | if ( ! wordpoints_is_points_type( $points_type ) ) { |
56 | 56 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | protected function verify_atts() { |
42 | 42 | |
43 | - if ( ! wordpoints_is_points_logs_query( $this->atts['query'] ) ) { |
|
43 | + if ( ! wordpoints_is_points_logs_query( $this->atts[ 'query' ] ) ) { |
|
44 | 44 | return sprintf( |
45 | 45 | // translators: 1. Attribute name; 2. Shortcode name; 3. Example of proper usage. |
46 | 46 | __( 'The “%1$s” attribute of the %2$s shortcode must be the slug of a registered points log query. Example: %3$s.', 'wordpoints' ) |
@@ -50,17 +50,17 @@ discard block |
||
50 | 50 | ); |
51 | 51 | } |
52 | 52 | |
53 | - if ( false === wordpoints_int( $this->atts['paginate'] ) ) { |
|
54 | - $this->atts['paginate'] = 1; |
|
53 | + if ( false === wordpoints_int( $this->atts[ 'paginate' ] ) ) { |
|
54 | + $this->atts[ 'paginate' ] = 1; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | // Back-compat. Needs to stay here "forever" for legacy installs. |
58 | - if ( isset( $this->atts['datatables'] ) ) { |
|
59 | - $this->atts['paginate'] = wordpoints_int( $this->atts['datatables'] ); |
|
58 | + if ( isset( $this->atts[ 'datatables' ] ) ) { |
|
59 | + $this->atts[ 'paginate' ] = wordpoints_int( $this->atts[ 'datatables' ] ); |
|
60 | 60 | } |
61 | 61 | |
62 | - if ( false === wordpoints_int( $this->atts['show_users'] ) ) { |
|
63 | - $this->atts['show_users'] = 1; |
|
62 | + if ( false === wordpoints_int( $this->atts[ 'show_users' ] ) ) { |
|
63 | + $this->atts[ 'show_users' ] = 1; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | return parent::verify_atts(); |
@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | |
75 | 75 | ob_start(); |
76 | 76 | wordpoints_show_points_logs_query( |
77 | - $this->atts['points_type'] |
|
78 | - , $this->atts['query'] |
|
77 | + $this->atts[ 'points_type' ] |
|
78 | + , $this->atts[ 'query' ] |
|
79 | 79 | , array( |
80 | - 'paginate' => $this->atts['paginate'], |
|
81 | - 'show_users' => $this->atts['show_users'], |
|
82 | - 'searchable' => $this->atts['searchable'], |
|
80 | + 'paginate' => $this->atts[ 'paginate' ], |
|
81 | + 'show_users' => $this->atts[ 'show_users' ], |
|
82 | + 'searchable' => $this->atts[ 'searchable' ], |
|
83 | 83 | ) |
84 | 84 | ); |
85 | 85 |
@@ -37,8 +37,8 @@ |
||
37 | 37 | protected function generate() { |
38 | 38 | |
39 | 39 | return wordpoints_get_formatted_points( |
40 | - $this->atts['user_id'] |
|
41 | - , $this->atts['points_type'] |
|
40 | + $this->atts[ 'user_id' ] |
|
41 | + , $this->atts[ 'points_type' ] |
|
42 | 42 | , 'points-shortcode' |
43 | 43 | ); |
44 | 44 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | protected function verify_atts() { |
38 | 38 | |
39 | - if ( ! wordpoints_posint( $this->atts['users'] ) ) { |
|
39 | + if ( ! wordpoints_posint( $this->atts[ 'users' ] ) ) { |
|
40 | 40 | return sprintf( |
41 | 41 | // translators: 1. Attribute name; 2. Shortcode name; 3. Example of proper usage. |
42 | 42 | __( 'The “%1$s” attribute of the %2$s shortcode must be a positive integer. Example: %3$s.', 'wordpoints' ) |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | |
58 | 58 | ob_start(); |
59 | 59 | wordpoints_points_show_top_users( |
60 | - $this->atts['users'] |
|
61 | - , $this->atts['points_type'] |
|
60 | + $this->atts[ 'users' ] |
|
61 | + , $this->atts[ 'points_type' ] |
|
62 | 62 | , 'shortcode' |
63 | 63 | ); |
64 | 64 |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | protected function get_logs() { |
147 | 147 | |
148 | - if ( $this->args['searchable'] ) { |
|
148 | + if ( $this->args[ 'searchable' ] ) { |
|
149 | 149 | |
150 | 150 | $search_term = $this->get_search_term(); |
151 | 151 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | } |
162 | 162 | } |
163 | 163 | |
164 | - if ( $this->args['paginate'] ) { |
|
164 | + if ( $this->args[ 'paginate' ] ) { |
|
165 | 165 | |
166 | 166 | $page = $this->get_page_number(); |
167 | 167 | $per_page = $this->get_per_page(); |
@@ -57,7 +57,7 @@ |
||
57 | 57 | continue; |
58 | 58 | } |
59 | 59 | |
60 | - $this->restrictions[] = $restriction; |
|
60 | + $this->restrictions[ ] = $restriction; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 |
@@ -109,7 +109,7 @@ |
||
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | |
112 | - $descriptions[] = sprintf( $string, $entity->get_title() ); |
|
112 | + $descriptions[ ] = sprintf( $string, $entity->get_title() ); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | return $descriptions; |