@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $factories = parent::get_update_routine_factories(); |
64 | 64 | |
65 | 65 | // v2.0.0. |
66 | - $factories[] = new WordPoints_Updater_Factory( |
|
66 | + $factories[ ] = new WordPoints_Updater_Factory( |
|
67 | 67 | '2.0.0' |
68 | 68 | , array( |
69 | 69 | 'global' => array( |
@@ -83,12 +83,12 @@ discard block |
||
83 | 83 | ); |
84 | 84 | |
85 | 85 | // v2.4.0-alpha-4. |
86 | - $factories[] = new WordPoints_Updater_Factory( |
|
86 | + $factories[ ] = new WordPoints_Updater_Factory( |
|
87 | 87 | '2.4.0-alpha-4' |
88 | 88 | , array( 'global' => array( 'WordPoints_Ranks_Updater_2_4_0_Tables' ) ) |
89 | 89 | ); |
90 | 90 | |
91 | - $factories[] = new WordPoints_Updater_Factory( |
|
91 | + $factories[ ] = new WordPoints_Updater_Factory( |
|
92 | 92 | '2.4.0-alpha-4' |
93 | 93 | , array( |
94 | 94 | 'local' => array( 'WordPoints_Ranks_Updater_2_4_0_User_Ranks' ), |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $factories = parent::get_uninstall_routine_factories(); |
109 | 109 | |
110 | - $factories[] = new WordPoints_Uninstaller_Factory_Options( |
|
110 | + $factories[ ] = new WordPoints_Uninstaller_Factory_Options( |
|
111 | 111 | array( |
112 | 112 | 'local' => array( |
113 | 113 | 'wordpoints_filled_base_ranks', |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function __construct( array $args ) { |
79 | 79 | |
80 | - $this->slug = $args['slug']; |
|
80 | + $this->slug = $args[ 'slug' ]; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | // |
@@ -193,10 +193,10 @@ discard block |
||
193 | 193 | |
194 | 194 | // If we aren't using placeholders, calculate the value. Hidden fields |
195 | 195 | // never use placeholders. |
196 | - if ( ! $args['placeholders'] || 'hidden' === $field['type'] ) { |
|
196 | + if ( ! $args[ 'placeholders' ] || 'hidden' === $field[ 'type' ] ) { |
|
197 | 197 | |
198 | 198 | // Default to the default value. |
199 | - $value = $field['default']; |
|
199 | + $value = $field[ 'default' ]; |
|
200 | 200 | |
201 | 201 | // If the value is set use that instead. |
202 | 202 | if ( isset( $meta[ $name ] ) ) { |
@@ -204,23 +204,23 @@ discard block |
||
204 | 204 | } |
205 | 205 | } |
206 | 206 | |
207 | - switch ( $field['type'] ) { |
|
207 | + switch ( $field[ 'type' ] ) { |
|
208 | 208 | |
209 | 209 | case 'hidden': |
210 | 210 | case 'number': |
211 | 211 | case 'text': |
212 | - if ( isset( $field['label'] ) ) { |
|
212 | + if ( isset( $field[ 'label' ] ) ) { |
|
213 | 213 | ?> |
214 | 214 | <p class="description description-thin"><label> |
215 | 215 | <?php |
216 | - echo esc_html( $field['label'] ); |
|
216 | + echo esc_html( $field[ 'label' ] ); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | ?> |
220 | 220 | <input |
221 | - type="<?php echo esc_attr( $field['type'] ); ?>" |
|
221 | + type="<?php echo esc_attr( $field[ 'type' ] ); ?>" |
|
222 | 222 | name="<?php echo esc_attr( $name ); ?>" |
223 | - <?php if ( $args['placeholders'] && 'hidden' !== $field['type'] ) : ?> |
|
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 | 225 | <?php else : ?> |
226 | 226 | value="<?php echo esc_attr( $value ); ?>" |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | /> |
230 | 230 | <?php |
231 | 231 | |
232 | - if ( isset( $field['label'] ) ) { |
|
232 | + if ( isset( $field[ 'label' ] ) ) { |
|
233 | 233 | ?> |
234 | 234 | </label></p> |
235 | 235 | <?php |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | __METHOD__ |
242 | 242 | , sprintf( |
243 | 243 | 'WordPoints Error: Unknown field type "%s".' |
244 | - , esc_html( $field['type'] ) |
|
244 | + , esc_html( $field[ 'type' ] ) |
|
245 | 245 | ) |
246 | 246 | , '1.7.0' |
247 | 247 | ); |
@@ -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 | /> |
@@ -60,7 +60,7 @@ |
||
60 | 60 | return false; |
61 | 61 | } |
62 | 62 | |
63 | - $args['slug'] = $type; |
|
63 | + $args[ 'slug' ] = $type; |
|
64 | 64 | |
65 | 65 | self::$types[ $type ] = new $class( $args ); |
66 | 66 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $result .= $headings; |
41 | 41 | $result .= '</thead>'; |
42 | 42 | |
43 | - $group = WordPoints_Rank_Groups::get_group( $this->atts['rank_group'] ); |
|
43 | + $group = WordPoints_Rank_Groups::get_group( $this->atts[ 'rank_group' ] ); |
|
44 | 44 | |
45 | 45 | foreach ( $group->get_ranks() as $rank_id ) { |
46 | 46 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $this->name = _x( 'Points', 'rank type', 'wordpoints' ); |
49 | 49 | |
50 | - if ( ! isset( $args['points_type'] ) ) { |
|
50 | + if ( ! isset( $args[ 'points_type' ] ) ) { |
|
51 | 51 | _doing_it_wrong( |
52 | 52 | __METHOD__ |
53 | 53 | , 'WordPoints Error: The "points_type" argument is required.' |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | return; |
57 | 57 | } |
58 | 58 | |
59 | - $this->meta_fields['points']['label'] = _x( 'Points', 'form label', 'wordpoints' ); |
|
60 | - $this->meta_fields['points_type']['default'] = $args['points_type']; |
|
59 | + $this->meta_fields[ 'points' ][ 'label' ] = _x( 'Points', 'form label', 'wordpoints' ); |
|
60 | + $this->meta_fields[ 'points_type' ][ 'default' ] = $args[ 'points_type' ]; |
|
61 | 61 | |
62 | 62 | add_action( 'wordpoints_points_altered', array( $this, 'hook' ), 10, 3 ); |
63 | 63 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function hook( $user_id, $points, $points_type ) { |
85 | 85 | |
86 | - if ( $points_type !== $this->meta_fields['points_type']['default'] ) { |
|
86 | + if ( $points_type !== $this->meta_fields[ 'points_type' ][ 'default' ] ) { |
|
87 | 87 | return; |
88 | 88 | } |
89 | 89 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function validate_rank_meta( array $meta ) { |
97 | 97 | |
98 | - if ( ! isset( $meta['points'] ) || false === wordpoints_int( $meta['points'] ) ) { |
|
98 | + if ( ! isset( $meta[ 'points' ] ) || false === wordpoints_int( $meta[ 'points' ] ) ) { |
|
99 | 99 | return new WP_Error( |
100 | 100 | 'wordpoints_points_rank_type_invalid_points' |
101 | 101 | , __( 'The amount of points is required, and must be a valid number.', 'wordpoints' ) |
@@ -104,22 +104,22 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | if ( |
107 | - ! isset( $meta['points_type'] ) |
|
108 | - || ! wordpoints_is_points_type( $meta['points_type'] ) |
|
107 | + ! isset( $meta[ 'points_type' ] ) |
|
108 | + || ! wordpoints_is_points_type( $meta[ 'points_type' ] ) |
|
109 | 109 | ) { |
110 | 110 | return false; |
111 | 111 | } |
112 | 112 | |
113 | - $minimum = wordpoints_get_points_minimum( $meta['points_type'] ); |
|
113 | + $minimum = wordpoints_get_points_minimum( $meta[ 'points_type' ] ); |
|
114 | 114 | |
115 | - if ( $meta['points'] < $minimum ) { |
|
115 | + if ( $meta[ 'points' ] < $minimum ) { |
|
116 | 116 | |
117 | 117 | return new WP_Error( |
118 | 118 | 'wordpoints_points_rank_type_points_less_than_minimum' |
119 | 119 | , sprintf( |
120 | 120 | // translators: Minimum number of points. |
121 | 121 | __( 'The number of points must be more than the minimum (%s).', 'wordpoints' ) |
122 | - , wordpoints_format_points( $minimum, $meta['points_type'], 'points_rank_error' ) |
|
122 | + , wordpoints_format_points( $minimum, $meta[ 'points_type' ], 'points_rank_error' ) |
|
123 | 123 | ) |
124 | 124 | , array( 'field' => 'points' ) |
125 | 125 | ); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function can_transition_user_ranks( array $user_ids, WordPoints_Rank $rank, array $args ) { |
135 | 135 | |
136 | - if ( $rank->points_type !== $this->meta_fields['points_type']['default'] ) { |
|
136 | + if ( $rank->points_type !== $this->meta_fields[ 'points_type' ][ 'default' ] ) { |
|
137 | 137 | return array(); |
138 | 138 | } |
139 | 139 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | */ |
186 | 186 | protected function can_transition_user_rank( $user_id, $rank, array $args ) { |
187 | 187 | |
188 | - if ( $rank->points_type !== $this->meta_fields['points_type']['default'] ) { |
|
188 | + if ( $rank->points_type !== $this->meta_fields[ 'points_type' ][ 'default' ] ) { |
|
189 | 189 | return false; |
190 | 190 | } |
191 | 191 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | $rank = wordpoints_get_formatted_user_rank( |
22 | 22 | get_current_user_id() |
23 | - , "points_type-{$instance['points_type']}" |
|
23 | + , "points_type-{$instance[ 'points_type' ]}" |
|
24 | 24 | , 'my-points-widget' |
25 | 25 | , array( 'widget_settings' => $instance ) |
26 | 26 | ); |
@@ -89,18 +89,18 @@ discard block |
||
89 | 89 | */ |
90 | 90 | function wordpoints_user_rank_shortcode_points_type_attr( $out, $pairs, $atts ) { |
91 | 91 | |
92 | - if ( empty( $out['rank_group'] ) ) { |
|
92 | + if ( empty( $out[ 'rank_group' ] ) ) { |
|
93 | 93 | |
94 | - if ( isset( $atts['points_type'] ) ) { |
|
94 | + if ( isset( $atts[ 'points_type' ] ) ) { |
|
95 | 95 | |
96 | - $out['rank_group'] = "points_type-{$atts['points_type']}"; |
|
96 | + $out[ 'rank_group' ] = "points_type-{$atts[ 'points_type' ]}"; |
|
97 | 97 | |
98 | 98 | } else { |
99 | 99 | |
100 | 100 | $points_type = wordpoints_get_default_points_type(); |
101 | 101 | |
102 | 102 | if ( $points_type ) { |
103 | - $out['rank_group'] = "points_type-{$points_type}"; |
|
103 | + $out[ 'rank_group' ] = "points_type-{$points_type}"; |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 | } |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | WordPoints_Rank_Groups::register_group( |
123 | 123 | "points_type-{$slug}" |
124 | 124 | , array( |
125 | - 'name' => $points_type['name'], |
|
125 | + 'name' => $points_type[ 'name' ], |
|
126 | 126 | 'description' => sprintf( |
127 | 127 | // translators: Points type name. |
128 | 128 | __( 'This rank group is associated with the “%s” points type.', 'wordpoints' ) |
129 | - , $points_type['name'] |
|
129 | + , $points_type[ 'name' ] |
|
130 | 130 | ), |
131 | 131 | ) |
132 | 132 | ); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | ?> |
185 | 185 | |
186 | - <a href="<?php echo esc_url( self_admin_url( 'admin.php?page=wordpoints_ranks&tab=points_type-' . $points_type['slug'] ) ); ?>"> |
|
186 | + <a href="<?php echo esc_url( self_admin_url( 'admin.php?page=wordpoints_ranks&tab=points_type-' . $points_type[ 'slug' ] ) ); ?>"> |
|
187 | 187 | <?php esc_html_e( 'Go to the ranks for this points type.', 'wordpoints' ); ?> |
188 | 188 | </a> |
189 | 189 |
@@ -25,22 +25,22 @@ discard block |
||
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
28 | -if ( isset( $_GET['error'] ) ) { |
|
28 | +if ( isset( $_GET[ 'error' ] ) ) { |
|
29 | 29 | |
30 | - if ( isset( $_GET['main'] ) ) { |
|
30 | + if ( isset( $_GET[ 'main' ] ) ) { |
|
31 | 31 | |
32 | 32 | wordpoints_show_admin_error( |
33 | 33 | esc_html__( 'You cannot delete an extension while it is active on the main site.', 'wordpoints' ) |
34 | 34 | , array( 'dismissible' => true ) |
35 | 35 | ); |
36 | 36 | |
37 | - } elseif ( isset( $_GET['charsout'] ) ) { |
|
37 | + } elseif ( isset( $_GET[ 'charsout' ] ) ) { |
|
38 | 38 | |
39 | 39 | wordpoints_show_admin_message( |
40 | 40 | sprintf( |
41 | 41 | // translators: Number of characters. |
42 | 42 | __( 'The extension generated %d characters of <strong>unexpected output</strong> during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this extension.', 'wordpoints' ) |
43 | - , (int) $_GET['charsout'] // WPCS: CSRF OK. |
|
43 | + , (int) $_GET[ 'charsout' ] // WPCS: CSRF OK. |
|
44 | 44 | ) |
45 | 45 | , 'warning' |
46 | 46 | , array( 'dismissible' => true ) |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | $error_message = __( 'Extension could not be activated because it triggered a <strong>fatal error</strong>.', 'wordpoints' ); |
52 | 52 | |
53 | 53 | if ( |
54 | - isset( $_GET['_error_nonce'], $_GET['module'] ) |
|
54 | + isset( $_GET[ '_error_nonce' ], $_GET[ 'module' ] ) |
|
55 | 55 | && wordpoints_verify_nonce( '_error_nonce', 'module-activation-error_%s', array( 'module' ) ) |
56 | 56 | ) { |
57 | 57 | |
58 | 58 | $url = self_admin_url( |
59 | 59 | 'admin.php?page=wordpoints_extensions&action=error_scrape&module=' |
60 | - . sanitize_text_field( wp_unslash( $_GET['module'] ) ) |
|
61 | - . '&_wpnonce=' . sanitize_key( $_GET['_error_nonce'] ) |
|
60 | + . sanitize_text_field( wp_unslash( $_GET[ 'module' ] ) ) |
|
61 | + . '&_wpnonce=' . sanitize_key( $_GET[ '_error_nonce' ] ) |
|
62 | 62 | ); |
63 | 63 | |
64 | 64 | ?> |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | } // End if ( main error ) elseif ( unexpected output error ) else. |
84 | 84 | |
85 | -} elseif ( isset( $_GET['deleted'] ) ) { |
|
85 | +} elseif ( isset( $_GET[ 'deleted' ] ) ) { |
|
86 | 86 | |
87 | 87 | $user_id = get_current_user_id(); |
88 | 88 | $delete_result = get_transient( 'wordpoints_modules_delete_result_' . $user_id ); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ); |
111 | 111 | } |
112 | 112 | |
113 | -} elseif ( isset( $_GET['activate'] ) ) { |
|
113 | +} elseif ( isset( $_GET[ 'activate' ] ) ) { |
|
114 | 114 | |
115 | 115 | wordpoints_show_admin_message( |
116 | 116 | __( 'Extension <strong>activated</strong>.', 'wordpoints' ) |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | , array( 'dismissible' => true ) |
119 | 119 | ); |
120 | 120 | |
121 | -} elseif ( isset( $_GET['activate-multi'] ) ) { |
|
121 | +} elseif ( isset( $_GET[ 'activate-multi' ] ) ) { |
|
122 | 122 | |
123 | 123 | wordpoints_show_admin_message( |
124 | 124 | __( 'Selected extensions <strong>activated</strong>.', 'wordpoints' ) |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | , array( 'dismissible' => true ) |
127 | 127 | ); |
128 | 128 | |
129 | -} elseif ( isset( $_GET['deactivate'] ) ) { |
|
129 | +} elseif ( isset( $_GET[ 'deactivate' ] ) ) { |
|
130 | 130 | |
131 | 131 | wordpoints_show_admin_message( |
132 | 132 | __( 'Extension <strong>deactivated</strong>.', 'wordpoints' ) |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | , array( 'dismissible' => true ) |
135 | 135 | ); |
136 | 136 | |
137 | -} elseif ( isset( $_GET['deactivate-multi'] ) ) { |
|
137 | +} elseif ( isset( $_GET[ 'deactivate-multi' ] ) ) { |
|
138 | 138 | |
139 | 139 | wordpoints_show_admin_message( |
140 | 140 | __( 'Selected extensions <strong>deactivated</strong>.', 'wordpoints' ) |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | , array( 'dismissible' => true ) |
143 | 143 | ); |
144 | 144 | |
145 | -} elseif ( isset( $_REQUEST['action'] ) && 'update-selected' === sanitize_key( $_REQUEST['action'] ) ) { |
|
145 | +} elseif ( isset( $_REQUEST[ 'action' ] ) && 'update-selected' === sanitize_key( $_REQUEST[ 'action' ] ) ) { |
|
146 | 146 | |
147 | 147 | wordpoints_show_admin_message( |
148 | 148 | esc_html__( 'No out of date extensions were selected.', 'wordpoints' ) |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | <a href="<?php echo esc_url( self_admin_url( 'admin.php?page=wordpoints_install_extensions' ) ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'extension', 'wordpoints' ); ?></a> |
163 | 163 | <?php endif; ?> |
164 | 164 | |
165 | - <?php if ( ! empty( $_REQUEST['s'] ) ) : ?> |
|
165 | + <?php if ( ! empty( $_REQUEST[ 's' ] ) ) : ?> |
|
166 | 166 | <span class="subtitle"> |
167 | 167 | <?php |
168 | 168 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | sprintf( |
171 | 171 | // translators: Search term. |
172 | 172 | __( 'Search results for “%s”', 'wordpoints' ) |
173 | - , sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) |
|
173 | + , sanitize_text_field( wp_unslash( $_REQUEST[ 's' ] ) ) |
|
174 | 174 | ) |
175 | 175 | ); |
176 | 176 |
@@ -683,14 +683,14 @@ discard block |
||
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 | /** |
@@ -722,14 +722,14 @@ discard block |
||
722 | 722 | |
723 | 723 | foreach ( $entity->get_enumerated_values() as $value ) { |
724 | 724 | if ( $entity->set_the_value( $value ) ) { |
725 | - $values[] = array( |
|
725 | + $values[ ] = array( |
|
726 | 726 | 'value' => $entity->get_the_id(), |
727 | 727 | 'label' => $entity->get_the_human_id(), |
728 | 728 | ); |
729 | 729 | } |
730 | 730 | } |
731 | 731 | |
732 | - $entities_data[ $slug ]['values'] = $values; |
|
732 | + $entities_data[ $slug ][ 'values' ] = $values; |
|
733 | 733 | } |
734 | 734 | |
735 | 735 | /** |
@@ -861,9 +861,9 @@ discard block |
||
861 | 861 | |
862 | 862 | $args = array_merge( $defaults, $args ); |
863 | 863 | |
864 | - if ( isset( $args['dismissable'] ) ) { |
|
864 | + if ( isset( $args[ 'dismissable' ] ) ) { |
|
865 | 865 | |
866 | - $args['dismissible'] = $args['dismissable']; |
|
866 | + $args[ 'dismissible' ] = $args[ 'dismissable' ]; |
|
867 | 867 | |
868 | 868 | _deprecated_argument( |
869 | 869 | __FUNCTION__ |
@@ -883,26 +883,26 @@ discard block |
||
883 | 883 | ); |
884 | 884 | } |
885 | 885 | |
886 | - if ( $args['dismissible'] && $args['option'] ) { |
|
886 | + if ( $args[ 'dismissible' ] && $args[ 'option' ] ) { |
|
887 | 887 | wp_enqueue_script( 'wordpoints-admin-dismiss-notice' ); |
888 | 888 | } |
889 | 889 | |
890 | 890 | ?> |
891 | 891 | |
892 | 892 | <div |
893 | - class="notice notice-<?php echo sanitize_html_class( $type, 'success' ); ?><?php echo ( $args['dismissible'] ) ? ' is-dismissible' : ''; ?>" |
|
894 | - <?php if ( $args['dismissible'] && $args['option'] ) : ?> |
|
895 | - data-nonce="<?php echo esc_attr( wp_create_nonce( "wordpoints_dismiss_notice-{$args['option']}" ) ); ?>" |
|
896 | - data-option="<?php echo esc_attr( $args['option'] ); ?>" |
|
893 | + class="notice notice-<?php echo sanitize_html_class( $type, 'success' ); ?><?php echo ( $args[ 'dismissible' ] ) ? ' is-dismissible' : ''; ?>" |
|
894 | + <?php if ( $args[ 'dismissible' ] && $args[ 'option' ] ) : ?> |
|
895 | + data-nonce="<?php echo esc_attr( wp_create_nonce( "wordpoints_dismiss_notice-{$args[ 'option' ]}" ) ); ?>" |
|
896 | + data-option="<?php echo esc_attr( $args[ 'option' ] ); ?>" |
|
897 | 897 | <?php endif; ?> |
898 | 898 | > |
899 | 899 | <p> |
900 | 900 | <?php echo wp_kses( $message, 'wordpoints_admin_message' ); ?> |
901 | 901 | </p> |
902 | - <?php if ( $args['dismissible'] && $args['option'] ) : ?> |
|
902 | + <?php if ( $args[ 'dismissible' ] && $args[ 'option' ] ) : ?> |
|
903 | 903 | <form method="post" class="wordpoints-notice-dismiss-form" style="padding-bottom: 5px;"> |
904 | - <input type="hidden" name="wordpoints_notice" value="<?php echo esc_html( $args['option'] ); ?>" /> |
|
905 | - <?php wp_nonce_field( "wordpoints_dismiss_notice-{$args['option']}" ); ?> |
|
904 | + <input type="hidden" name="wordpoints_notice" value="<?php echo esc_html( $args[ 'option' ] ); ?>" /> |
|
905 | + <?php wp_nonce_field( "wordpoints_dismiss_notice-{$args[ 'option' ]}" ); ?> |
|
906 | 906 | <?php submit_button( __( 'Hide This Notice', 'wordpoints' ), 'secondary', 'wordpoints_dismiss_notice', false ); ?> |
907 | 907 | </form> |
908 | 908 | <?php endif; ?> |
@@ -925,9 +925,9 @@ discard block |
||
925 | 925 | |
926 | 926 | $tab = ''; |
927 | 927 | |
928 | - if ( isset( $_GET['tab'] ) ) { // WPCS: CSRF OK. |
|
928 | + if ( isset( $_GET[ 'tab' ] ) ) { // WPCS: CSRF OK. |
|
929 | 929 | |
930 | - $tab = sanitize_key( $_GET['tab'] ); // WPCS: CSRF OK. |
|
930 | + $tab = sanitize_key( $_GET[ 'tab' ] ); // WPCS: CSRF OK. |
|
931 | 931 | } |
932 | 932 | |
933 | 933 | if ( isset( $tabs ) && ! isset( $tabs[ $tab ] ) ) { |
@@ -964,8 +964,8 @@ discard block |
||
964 | 964 | |
965 | 965 | $page = ''; |
966 | 966 | |
967 | - if ( isset( $_GET['page'] ) ) { // WPCS: CSRF OK. |
|
968 | - $page = sanitize_key( $_GET['page'] ); // WPCS: CSRF OK. |
|
967 | + if ( isset( $_GET[ 'page' ] ) ) { // WPCS: CSRF OK. |
|
968 | + $page = sanitize_key( $_GET[ 'page' ] ); // WPCS: CSRF OK. |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | foreach ( $tabs as $tab => $name ) { |
@@ -1069,8 +1069,8 @@ discard block |
||
1069 | 1069 | wp_die( esc_html__( 'Sorry, you are not allowed to update WordPoints extensions for this site.', 'wordpoints' ), 403 ); |
1070 | 1070 | } |
1071 | 1071 | |
1072 | - $extension = ( isset( $_REQUEST['extension'] ) ) |
|
1073 | - ? sanitize_text_field( wp_unslash( $_REQUEST['extension'] ) ) // WPCS: CSRF OK. |
|
1072 | + $extension = ( isset( $_REQUEST[ 'extension' ] ) ) |
|
1073 | + ? sanitize_text_field( wp_unslash( $_REQUEST[ 'extension' ] ) ) // WPCS: CSRF OK. |
|
1074 | 1074 | : ''; |
1075 | 1075 | |
1076 | 1076 | check_admin_referer( 'upgrade-extension_' . $extension ); |
@@ -1109,20 +1109,20 @@ discard block |
||
1109 | 1109 | wp_die( esc_html__( 'Sorry, you are not allowed to update WordPoints extensions for this site.', 'wordpoints' ), 403 ); |
1110 | 1110 | } |
1111 | 1111 | |
1112 | - $extension = ( isset( $_REQUEST['extension'] ) ) |
|
1113 | - ? sanitize_text_field( wp_unslash( $_REQUEST['extension'] ) ) // WPCS: CSRF OK. |
|
1112 | + $extension = ( isset( $_REQUEST[ 'extension' ] ) ) |
|
1113 | + ? sanitize_text_field( wp_unslash( $_REQUEST[ 'extension' ] ) ) // WPCS: CSRF OK. |
|
1114 | 1114 | : ''; |
1115 | 1115 | |
1116 | 1116 | check_admin_referer( 'reactivate-extension_' . $extension ); |
1117 | 1117 | |
1118 | 1118 | // First, activate the extension. |
1119 | - if ( ! isset( $_GET['failure'] ) && ! isset( $_GET['success'] ) ) { |
|
1119 | + if ( ! isset( $_GET[ 'failure' ] ) && ! isset( $_GET[ 'success' ] ) ) { |
|
1120 | 1120 | |
1121 | - $nonce = sanitize_key( $_GET['_wpnonce'] ); // @codingStandardsIgnoreLine |
|
1121 | + $nonce = sanitize_key( $_GET[ '_wpnonce' ] ); // @codingStandardsIgnoreLine |
|
1122 | 1122 | $url = admin_url( 'update.php?action=wordpoints-reactivate-extension&extension=' . rawurlencode( $extension ) . '&_wpnonce=' . $nonce ); |
1123 | 1123 | |
1124 | 1124 | wp_safe_redirect( $url . '&failure=true' ); |
1125 | - wordpoints_activate_module( $extension, '', ! empty( $_GET['network_wide'] ), true ); |
|
1125 | + wordpoints_activate_module( $extension, '', ! empty( $_GET[ 'network_wide' ] ), true ); |
|
1126 | 1126 | wp_safe_redirect( $url . '&success=true' ); |
1127 | 1127 | |
1128 | 1128 | die(); |
@@ -1131,11 +1131,11 @@ discard block |
||
1131 | 1131 | // Then we redirect back here to display the success or error message. |
1132 | 1132 | iframe_header( __( 'WordPoints Extension Reactivation', 'wordpoints' ) ); |
1133 | 1133 | |
1134 | - if ( isset( $_GET['success'] ) ) { |
|
1134 | + if ( isset( $_GET[ 'success' ] ) ) { |
|
1135 | 1135 | |
1136 | 1136 | echo '<p>' . esc_html__( 'Extension reactivated successfully.', 'wordpoints' ) . '</p>'; |
1137 | 1137 | |
1138 | - } elseif ( isset( $_GET['failure'] ) ) { |
|
1138 | + } elseif ( isset( $_GET[ 'failure' ] ) ) { |
|
1139 | 1139 | |
1140 | 1140 | echo '<p>' . esc_html__( 'Extension failed to reactivate due to a fatal error.', 'wordpoints' ) . '</p>'; |
1141 | 1141 | |
@@ -1168,10 +1168,10 @@ discard block |
||
1168 | 1168 | |
1169 | 1169 | check_admin_referer( 'bulk-wordpoints-extensions', 'nonce' ); |
1170 | 1170 | |
1171 | - if ( isset( $_GET['extensions'] ) ) { |
|
1172 | - $extensions = explode( ',', sanitize_text_field( wp_unslash( $_GET['extensions'] ) ) ); |
|
1173 | - } elseif ( isset( $_POST['checked'] ) ) { |
|
1174 | - $extensions = array_map( 'sanitize_text_field', wp_unslash( (array) $_POST['checked'] ) ); |
|
1171 | + if ( isset( $_GET[ 'extensions' ] ) ) { |
|
1172 | + $extensions = explode( ',', sanitize_text_field( wp_unslash( $_GET[ 'extensions' ] ) ) ); |
|
1173 | + } elseif ( isset( $_POST[ 'checked' ] ) ) { |
|
1174 | + $extensions = array_map( 'sanitize_text_field', wp_unslash( (array) $_POST[ 'checked' ] ) ); |
|
1175 | 1175 | } else { |
1176 | 1176 | $extensions = array(); |
1177 | 1177 | } |
@@ -1213,8 +1213,8 @@ discard block |
||
1213 | 1213 | |
1214 | 1214 | $extensions = array(); |
1215 | 1215 | |
1216 | - if ( isset( $_GET['extensions'] ) ) { |
|
1217 | - $extensions = explode( ',', sanitize_text_field( wp_unslash( $_GET['extensions'] ) ) ); |
|
1216 | + if ( isset( $_GET[ 'extensions' ] ) ) { |
|
1217 | + $extensions = explode( ',', sanitize_text_field( wp_unslash( $_GET[ 'extensions' ] ) ) ); |
|
1218 | 1218 | } |
1219 | 1219 | |
1220 | 1220 | $extensions = array_map( 'rawurldecode', $extensions ); |
@@ -1288,7 +1288,7 @@ discard block |
||
1288 | 1288 | $new_version = $updates->get_new_version( $file ); |
1289 | 1289 | |
1290 | 1290 | $extension_name = wp_kses( |
1291 | - $extension_data['name'] |
|
1291 | + $extension_data[ 'name' ] |
|
1292 | 1292 | , array( |
1293 | 1293 | 'a' => array( 'href' => array(), 'title' => array() ), |
1294 | 1294 | 'abbr' => array( 'title' => array() ), |
@@ -1406,9 +1406,9 @@ discard block |
||
1406 | 1406 | return $extensions; |
1407 | 1407 | } |
1408 | 1408 | |
1409 | - foreach ( $extensions['all'] as $extension ) { |
|
1409 | + foreach ( $extensions[ 'all' ] as $extension ) { |
|
1410 | 1410 | |
1411 | - if ( empty( $extension['ID'] ) ) { |
|
1411 | + if ( empty( $extension[ 'ID' ] ) ) { |
|
1412 | 1412 | continue; |
1413 | 1413 | } |
1414 | 1414 | |
@@ -1425,30 +1425,30 @@ discard block |
||
1425 | 1425 | } |
1426 | 1426 | |
1427 | 1427 | $extension_data = new WordPoints_Extension_Server_API_Extension_Data( |
1428 | - $extension['ID'] |
|
1428 | + $extension[ 'ID' ] |
|
1429 | 1429 | , $server |
1430 | 1430 | ); |
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 | - "wordpoints_activate_license_key-{$extension['ID']}" |
|
1451 | - , "wordpoints_activate_license_key-{$extension['ID']}" |
|
1450 | + "wordpoints_activate_license_key-{$extension[ 'ID' ]}" |
|
1451 | + , "wordpoints_activate_license_key-{$extension[ 'ID' ]}" |
|
1452 | 1452 | , null |
1453 | 1453 | , 'post' |
1454 | 1454 | ) |
@@ -1489,12 +1489,12 @@ 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 | - "wordpoints_deactivate_license_key-{$extension['ID']}" |
|
1497 | - , "wordpoints_deactivate_license_key-{$extension['ID']}" |
|
1496 | + "wordpoints_deactivate_license_key-{$extension[ 'ID' ]}" |
|
1497 | + , "wordpoints_deactivate_license_key-{$extension[ 'ID' ]}" |
|
1498 | 1498 | , null |
1499 | 1499 | , 'post' |
1500 | 1500 | ) |
@@ -1538,7 +1538,7 @@ discard block |
||
1538 | 1538 | function wordpoints_extension_list_row_license_classes( $classes, $extension_file, $extension_data ) { |
1539 | 1539 | |
1540 | 1540 | // Add license information if this user is allowed to see it. |
1541 | - if ( empty( $extension_data['ID'] ) || ! current_user_can( 'update_wordpoints_extensions' ) ) { |
|
1541 | + if ( empty( $extension_data[ 'ID' ] ) || ! current_user_can( 'update_wordpoints_extensions' ) ) { |
|
1542 | 1542 | return $classes; |
1543 | 1543 | } |
1544 | 1544 | |
@@ -1555,7 +1555,7 @@ discard block |
||
1555 | 1555 | } |
1556 | 1556 | |
1557 | 1557 | $extension_data = new WordPoints_Extension_Server_API_Extension_Data( |
1558 | - $extension_data['ID'], |
|
1558 | + $extension_data[ 'ID' ], |
|
1559 | 1559 | $server |
1560 | 1560 | ); |
1561 | 1561 | |
@@ -1603,7 +1603,7 @@ discard block |
||
1603 | 1603 | */ |
1604 | 1604 | function wordpoints_extension_license_row( $extension_file, $extension ) { |
1605 | 1605 | |
1606 | - if ( empty( $extension['ID'] ) || ! current_user_can( 'update_wordpoints_extensions' ) ) { |
|
1606 | + if ( empty( $extension[ 'ID' ] ) || ! current_user_can( 'update_wordpoints_extensions' ) ) { |
|
1607 | 1607 | return; |
1608 | 1608 | } |
1609 | 1609 | |
@@ -1619,7 +1619,7 @@ discard block |
||
1619 | 1619 | return; |
1620 | 1620 | } |
1621 | 1621 | |
1622 | - $extension_id = $extension['ID']; |
|
1622 | + $extension_id = $extension[ 'ID' ]; |
|
1623 | 1623 | |
1624 | 1624 | $extension_data = new WordPoints_Extension_Server_API_Extension_Data( |
1625 | 1625 | $extension_id |
@@ -1662,7 +1662,7 @@ discard block |
||
1662 | 1662 | <td colspan="<?php echo (int) WordPoints_Admin_List_Table_Extensions::instance()->get_column_count(); ?>" class="colspanchange"> |
1663 | 1663 | <div class="wordpoints-license-box notice inline notice-alt notice-<?php echo esc_attr( $notice_type ); ?>"> |
1664 | 1664 | <p> |
1665 | - <label class="description" for="license_key-<?php echo esc_attr( $server_url ); ?>-<?php echo esc_attr( $extension_id ); ?>" aria-label="<?php echo esc_attr( sprintf( $aria_label, $extension['name'] ) ); ?>"> |
|
1665 | + <label class="description" for="license_key-<?php echo esc_attr( $server_url ); ?>-<?php echo esc_attr( $extension_id ); ?>" aria-label="<?php echo esc_attr( sprintf( $aria_label, $extension[ 'name' ] ) ); ?>"> |
|
1666 | 1666 | <?php esc_html_e( 'License key:', 'wordpoints' ); ?> |
1667 | 1667 | </label> |
1668 | 1668 | <input |
@@ -1684,7 +1684,7 @@ discard block |
||
1684 | 1684 | $aria_label = __( 'Deactivate License for %s', 'wordpoints' ); |
1685 | 1685 | |
1686 | 1686 | ?> |
1687 | - <input type="submit" name="deactivate-license-<?php echo esc_attr( $extension_id ); ?>" class="button-secondary" value="<?php esc_attr_e( 'Deactivate License', 'wordpoints' ); ?>" aria-label="<?php echo esc_attr( sprintf( $aria_label, $extension['name'] ) ); ?>" /> |
|
1687 | + <input type="submit" name="deactivate-license-<?php echo esc_attr( $extension_id ); ?>" class="button-secondary" value="<?php esc_attr_e( 'Deactivate License', 'wordpoints' ); ?>" aria-label="<?php echo esc_attr( sprintf( $aria_label, $extension[ 'name' ] ) ); ?>" /> |
|
1688 | 1688 | <?php endif; ?> |
1689 | 1689 | <?php elseif ( empty( $license_key ) || $license->is_activatable() ) : ?> |
1690 | 1690 | <?php |
@@ -1695,7 +1695,7 @@ discard block |
||
1695 | 1695 | $aria_label = __( 'Activate License for %s', 'wordpoints' ); |
1696 | 1696 | |
1697 | 1697 | ?> |
1698 | - <input type="submit" name="activate-license-<?php echo esc_attr( $extension_id ); ?>" class="button-secondary" value="<?php esc_attr_e( 'Activate License', 'wordpoints' ); ?>" aria-label="<?php echo esc_attr( sprintf( $aria_label, $extension['name'] ) ); ?>" /> |
|
1698 | + <input type="submit" name="activate-license-<?php echo esc_attr( $extension_id ); ?>" class="button-secondary" value="<?php esc_attr_e( 'Activate License', 'wordpoints' ); ?>" aria-label="<?php echo esc_attr( sprintf( $aria_label, $extension[ 'name' ] ) ); ?>" /> |
|
1699 | 1699 | <?php endif; ?> |
1700 | 1700 | <?php endif; ?> |
1701 | 1701 | <?php if ( $license instanceof WordPoints_Extension_Server_API_Extension_License_ExpirableI ) : ?> |
@@ -1709,7 +1709,7 @@ discard block |
||
1709 | 1709 | $aria_label = __( 'Renew License for %s', 'wordpoints' ); |
1710 | 1710 | |
1711 | 1711 | ?> |
1712 | - <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> |
|
1712 | + <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 | 1713 | <?php endif; ?> |
1714 | 1714 | <?php else : ?> |
1715 | 1715 | <?php esc_html_e( 'This license key is expired.', 'wordpoints' ); ?> |
@@ -1738,11 +1738,11 @@ discard block |
||
1738 | 1738 | wp_die( esc_html__( 'Sorry, you are not allowed to update WordPoints extensions for this site.', 'wordpoints' ), 403 ); |
1739 | 1739 | } |
1740 | 1740 | |
1741 | - if ( empty( $_GET['extension'] ) ) { // WPCS: CSRF OK. |
|
1741 | + if ( empty( $_GET[ 'extension' ] ) ) { // WPCS: CSRF OK. |
|
1742 | 1742 | wp_die( esc_html__( 'No extension supplied.', 'wordpoints' ), 200 ); |
1743 | 1743 | } |
1744 | 1744 | |
1745 | - $extension_file = sanitize_text_field( rawurldecode( wp_unslash( $_GET['extension'] ) ) ); // WPCS: CSRF, sanitization OK. |
|
1745 | + $extension_file = sanitize_text_field( rawurldecode( wp_unslash( $_GET[ 'extension' ] ) ) ); // WPCS: CSRF, sanitization OK. |
|
1746 | 1746 | |
1747 | 1747 | $extensions = wordpoints_get_modules(); |
1748 | 1748 | |
@@ -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 | |
@@ -1869,7 +1869,7 @@ discard block |
||
1869 | 1869 | sprintf( |
1870 | 1870 | // translators: Extension name. |
1871 | 1871 | __( 'Select %s', 'wordpoints' ) |
1872 | - , $extension_data['name'] |
|
1872 | + , $extension_data[ 'name' ] |
|
1873 | 1873 | ) |
1874 | 1874 | ); |
1875 | 1875 | |
@@ -1878,7 +1878,7 @@ discard block |
||
1878 | 1878 | </th> |
1879 | 1879 | <td> |
1880 | 1880 | <p> |
1881 | - <strong><?php echo esc_html( $extension_data['name'] ); ?></strong> |
|
1881 | + <strong><?php echo esc_html( $extension_data[ 'name' ] ); ?></strong> |
|
1882 | 1882 | <br /> |
1883 | 1883 | <?php |
1884 | 1884 | |
@@ -1886,13 +1886,13 @@ discard block |
||
1886 | 1886 | sprintf( |
1887 | 1887 | // translators: 1. Installed version number; 2. Update version number. |
1888 | 1888 | __( 'You have version %1$s installed. Update to %2$s.', 'wordpoints' ) |
1889 | - , $extension_data['version'] |
|
1889 | + , $extension_data[ 'version' ] |
|
1890 | 1890 | , $new_version |
1891 | 1891 | ) |
1892 | 1892 | ); |
1893 | 1893 | |
1894 | 1894 | ?> |
1895 | - <a href="<?php echo esc_url( self_admin_url( 'update.php?action=wordpoints-iframe-extension-changelog&extension=' . rawurlencode( $extension_file ) . '&TB_iframe=true&width=640&height=662' ) ); ?>" class="thickbox" title="<?php echo esc_attr( $extension_data['name'] ); ?>"> |
|
1895 | + <a href="<?php echo esc_url( self_admin_url( 'update.php?action=wordpoints-iframe-extension-changelog&extension=' . rawurlencode( $extension_file ) . '&TB_iframe=true&width=640&height=662' ) ); ?>" class="thickbox" title="<?php echo esc_attr( $extension_data[ 'name' ] ); ?>"> |
|
1896 | 1896 | <?php |
1897 | 1897 | |
1898 | 1898 | echo esc_html( |
@@ -1980,7 +1980,7 @@ discard block |
||
1980 | 1980 | |
1981 | 1981 | $info = wordpoints_get_module_data( $file, false, false ); |
1982 | 1982 | |
1983 | - if ( ! empty( $info['name'] ) ) { |
|
1983 | + if ( ! empty( $info[ 'name' ] ) ) { |
|
1984 | 1984 | $source = new WP_Error( |
1985 | 1985 | 'wordpoints_module_archive_not_plugin' |
1986 | 1986 | , $source->get_error_message() |
@@ -2129,8 +2129,8 @@ discard block |
||
2129 | 2129 | if ( |
2130 | 2130 | current_user_can( 'delete_wordpoints_extensions' ) |
2131 | 2131 | && ( |
2132 | - ! isset( $_REQUEST['action'] ) // WPCS: CSRF OK. |
|
2133 | - || 'delete-selected' !== $_REQUEST['action'] // WPCS: CSRF OK. |
|
2132 | + ! isset( $_REQUEST[ 'action' ] ) // WPCS: CSRF OK. |
|
2133 | + || 'delete-selected' !== $_REQUEST[ 'action' ] // WPCS: CSRF OK. |
|
2134 | 2134 | ) |
2135 | 2135 | ) { |
2136 | 2136 | |
@@ -2208,9 +2208,9 @@ discard block |
||
2208 | 2208 | , 'post' |
2209 | 2209 | ); |
2210 | 2210 | |
2211 | - if ( $is_notice_dismissed && isset( $_POST['wordpoints_notice'] ) ) { |
|
2211 | + if ( $is_notice_dismissed && isset( $_POST[ 'wordpoints_notice' ] ) ) { |
|
2212 | 2212 | |
2213 | - $option = sanitize_key( $_POST['wordpoints_notice'] ); |
|
2213 | + $option = sanitize_key( $_POST[ 'wordpoints_notice' ] ); |
|
2214 | 2214 | |
2215 | 2215 | if ( ! is_network_admin() && 'wordpoints_incompatible_modules' === $option ) { |
2216 | 2216 | delete_option( $option ); |
@@ -2265,7 +2265,7 @@ discard block |
||
2265 | 2265 | */ |
2266 | 2266 | function wordpoints_admin_ajax_breaking_module_check() { |
2267 | 2267 | |
2268 | - if ( ! isset( $_GET['wordpoints_module_check'] ) ) { // WPCS: CSRF OK. |
|
2268 | + if ( ! isset( $_GET[ 'wordpoints_module_check' ] ) ) { // WPCS: CSRF OK. |
|
2269 | 2269 | wp_die( '', 400 ); |
2270 | 2270 | } |
2271 | 2271 | |
@@ -2275,12 +2275,12 @@ discard block |
||
2275 | 2275 | $nonce = get_option( 'wordpoints_module_check_nonce' ); |
2276 | 2276 | } |
2277 | 2277 | |
2278 | - if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET['wordpoints_module_check'] ) ) ) { // WPCS: CSRF OK. |
|
2278 | + if ( ! $nonce || ! hash_equals( $nonce, sanitize_key( $_GET[ 'wordpoints_module_check' ] ) ) ) { // WPCS: CSRF OK. |
|
2279 | 2279 | wp_die( '', 403 ); |
2280 | 2280 | } |
2281 | 2281 | |
2282 | 2282 | // The list table constructor calls WP_Screen::get(), which expects this. |
2283 | - $GLOBALS['hook_suffix'] = null; |
|
2283 | + $GLOBALS[ 'hook_suffix' ] = null; |
|
2284 | 2284 | |
2285 | 2285 | wordpoints_admin_screen_modules(); |
2286 | 2286 | |
@@ -2347,14 +2347,14 @@ discard block |
||
2347 | 2347 | |
2348 | 2348 | preg_match( |
2349 | 2349 | '/requires php (\d+\.\d+(?:\.\d)?)/i' |
2350 | - , $info->sections['description'] |
|
2350 | + , $info->sections[ 'description' ] |
|
2351 | 2351 | , $matches |
2352 | 2352 | ); |
2353 | 2353 | |
2354 | 2354 | $version = false; |
2355 | 2355 | |
2356 | - if ( ! empty( $matches[1] ) ) { |
|
2357 | - $version = $matches[1]; |
|
2356 | + if ( ! empty( $matches[ 1 ] ) ) { |
|
2357 | + $version = $matches[ 1 ]; |
|
2358 | 2358 | } |
2359 | 2359 | |
2360 | 2360 | $updates->response[ $plugin_basename ]->wordpoints_required_php = $version; |
@@ -2495,7 +2495,7 @@ discard block |
||
2495 | 2495 | |
2496 | 2496 | // JavaScript to disable the bulk upgrade checkbox. |
2497 | 2497 | // See WP_Plugins_List_Table::single_row(). |
2498 | - $checkbox_id = 'checkbox_' . md5( $plugin_data['Name'] ); |
|
2498 | + $checkbox_id = 'checkbox_' . md5( $plugin_data[ 'Name' ] ); |
|
2499 | 2499 | |
2500 | 2500 | ?> |
2501 | 2501 | |
@@ -2571,7 +2571,7 @@ discard block |
||
2571 | 2571 | |
2572 | 2572 | // Don't show them on the extensions screen, because they would be shown before |
2573 | 2573 | // license activation notices, etc. |
2574 | - if ( isset( $_GET['page'] ) && 'wordpoints_extensions' === $_GET['page'] ) { // WPCS: CSRF OK. |
|
2574 | + if ( isset( $_GET[ 'page' ] ) && 'wordpoints_extensions' === $_GET[ 'page' ] ) { // WPCS: CSRF OK. |
|
2575 | 2575 | return; |
2576 | 2576 | } |
2577 | 2577 | |
@@ -2581,7 +2581,7 @@ discard block |
||
2581 | 2581 | |
2582 | 2582 | foreach ( wordpoints_get_modules() as $extension ) { |
2583 | 2583 | |
2584 | - if ( empty( $extension['ID'] ) ) { |
|
2584 | + if ( empty( $extension[ 'ID' ] ) ) { |
|
2585 | 2585 | continue; |
2586 | 2586 | } |
2587 | 2587 | |
@@ -2598,7 +2598,7 @@ discard block |
||
2598 | 2598 | } |
2599 | 2599 | |
2600 | 2600 | $extension_data = new WordPoints_Extension_Server_API_Extension_Data( |
2601 | - $extension['ID'] |
|
2601 | + $extension[ 'ID' ] |
|
2602 | 2602 | , $server |
2603 | 2603 | ); |
2604 | 2604 | |
@@ -2614,7 +2614,7 @@ discard block |
||
2614 | 2614 | sprintf( |
2615 | 2615 | // translators: Extension name. |
2616 | 2616 | esc_html__( 'Please fill in your license key for the %s extension for WordPoints, so that you can receive updates.', 'wordpoints' ) |
2617 | - , $extension['name'] |
|
2617 | + , $extension[ 'name' ] |
|
2618 | 2618 | ) |
2619 | 2619 | . ' <a href="' . esc_url( self_admin_url( 'admin.php?page=wordpoints_extensions' ) ) . '">' . esc_html__( 'WordPoints Extensions screen »', 'wordpoints' ) . '</a>' |
2620 | 2620 | ); |
@@ -2630,7 +2630,7 @@ discard block |
||
2630 | 2630 | sprintf( |
2631 | 2631 | // translators: Extension name. |
2632 | 2632 | esc_html__( 'Your license key for the %s extension for WordPoints appears to be invalid. Please enter a valid license key so that you can receive updates.', 'wordpoints' ) |
2633 | - , $extension['name'] |
|
2633 | + , $extension[ 'name' ] |
|
2634 | 2634 | ) |
2635 | 2635 | . ' <a href="' . esc_url( self_admin_url( 'admin.php?page=wordpoints_extensions' ) ) . '">' . esc_html__( 'WordPoints Extensions screen »', 'wordpoints' ) . '</a>' |
2636 | 2636 | ); |
@@ -2645,7 +2645,7 @@ discard block |
||
2645 | 2645 | sprintf( |
2646 | 2646 | // translators: Extension name. |
2647 | 2647 | esc_html__( 'Your license key for the %s extension for WordPoints is expired. Please renew your license key so that you can receive updates.', 'wordpoints' ) |
2648 | - , $extension['name'] |
|
2648 | + , $extension[ 'name' ] |
|
2649 | 2649 | ) |
2650 | 2650 | . ' <a href="' . esc_url( $license->get_renewal_url() ) . '">' . esc_html__( 'Renew License', 'wordpoints' ) . '</a>' |
2651 | 2651 | ); |
@@ -2656,7 +2656,7 @@ discard block |
||
2656 | 2656 | sprintf( |
2657 | 2657 | // translators: Extension name. |
2658 | 2658 | esc_html__( 'Your license key for the %s extension for WordPoints is expired. Please renew your license key so that you can receive updates.', 'wordpoints' ) |
2659 | - , $extension['name'] |
|
2659 | + , $extension[ 'name' ] |
|
2660 | 2660 | ) |
2661 | 2661 | . ' <a href="' . esc_url( self_admin_url( 'admin.php?page=wordpoints_extensions' ) ) . '">' . esc_html__( 'WordPoints Extensions screen »', 'wordpoints' ) . '</a>' |
2662 | 2662 | ); |
@@ -2668,7 +2668,7 @@ discard block |
||
2668 | 2668 | sprintf( |
2669 | 2669 | // translators: Extension name. |
2670 | 2670 | esc_html__( 'Your license key for the %s extension for WordPoints is expired. Please enter a valid license key so that you can receive updates.', 'wordpoints' ) |
2671 | - , $extension['name'] |
|
2671 | + , $extension[ 'name' ] |
|
2672 | 2672 | ) |
2673 | 2673 | . ' <a href="' . esc_url( self_admin_url( 'admin.php?page=wordpoints_extensions' ) ) . '">' . esc_html__( 'WordPoints Extensions screen »', 'wordpoints' ) . '</a>' |
2674 | 2674 | ); |
@@ -2676,7 +2676,7 @@ discard block |
||
2676 | 2676 | |
2677 | 2677 | } elseif ( $license instanceof WordPoints_Extension_Server_API_Extension_License_ActivatableI && $license->is_activatable() && ! $license->is_active() ) { |
2678 | 2678 | |
2679 | - $extension_id = $extension['ID']; |
|
2679 | + $extension_id = $extension[ 'ID' ]; |
|
2680 | 2680 | $server_url = sanitize_title_with_dashes( $server->get_slug() ); |
2681 | 2681 | |
2682 | 2682 | // translators: Extension name. |
@@ -2691,7 +2691,7 @@ discard block |
||
2691 | 2691 | sprintf( |
2692 | 2692 | // translators: Extension name. |
2693 | 2693 | __( 'Your license key for the %s extension for WordPoints is not active. Please activate it so that you can receive updates.', 'wordpoints' ) |
2694 | - , $extension['name'] |
|
2694 | + , $extension[ 'name' ] |
|
2695 | 2695 | ) |
2696 | 2696 | ); |
2697 | 2697 | |
@@ -2713,7 +2713,7 @@ discard block |
||
2713 | 2713 | name="activate-license-<?php echo esc_attr( $extension_id ); ?>" |
2714 | 2714 | class="button-secondary" |
2715 | 2715 | value="<?php esc_attr_e( 'Activate License', 'wordpoints' ); ?>" |
2716 | - aria-label="<?php echo esc_attr( sprintf( $aria_label, $extension_data['name'] ) ); ?>" |
|
2716 | + aria-label="<?php echo esc_attr( sprintf( $aria_label, $extension_data[ 'name' ] ) ); ?>" |
|
2717 | 2717 | /> |
2718 | 2718 | </p> |
2719 | 2719 | </form> |
@@ -2786,7 +2786,7 @@ discard block |
||
2786 | 2786 | // of the slug, but this is such an edge case to start with that I |
2787 | 2787 | // decided not to. Also of note: the version is only used in the |
2788 | 2788 | // update message. |
2789 | - $messages[] = esc_html( |
|
2789 | + $messages[ ] = esc_html( |
|
2790 | 2790 | sprintf( |
2791 | 2791 | $message_template |
2792 | 2792 | , $slug |
@@ -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 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | |
51 | 51 | $install_routines = parent::get_install_routines(); |
52 | 52 | |
53 | - $install_routines['site'] = new WordPoints_Installer_Site_Legacy( |
|
53 | + $install_routines[ 'site' ] = new WordPoints_Installer_Site_Legacy( |
|
54 | 54 | WordPoints_Installables::get_installer( $this->type, $this->slug ) |
55 | 55 | ); |
56 | 56 |