@@ -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 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $this->get_slug() |
29 | 29 | ); |
30 | 30 | |
31 | - return $component['version']; |
|
31 | + return $component[ 'version' ]; |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | |
93 | 93 | $core = new WordPoints_Installer_Core(); |
94 | 94 | |
95 | - $install_routines['single'][] = $core; |
|
96 | - $install_routines['network'][] = $core; |
|
95 | + $install_routines[ 'single' ][ ] = $core; |
|
96 | + $install_routines[ 'network' ][ ] = $core; |
|
97 | 97 | |
98 | 98 | return $install_routines; |
99 | 99 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $factories = parent::get_update_routine_factories(); |
107 | 107 | |
108 | 108 | // v1.10.3. |
109 | - $factories[] = new WordPoints_Updater_Factory( |
|
109 | + $factories[ ] = new WordPoints_Updater_Factory( |
|
110 | 110 | '1.10.3' |
111 | 111 | , array( 'global' => array( 'WordPoints_Updater_Core_1_10_3_Extensions_Index_Create' ) ) |
112 | 112 | ); |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | // 2.1.0-alpha-3. |
115 | 115 | $db_tables = $this->get_db_tables(); |
116 | 116 | |
117 | - $factories[] = new WordPoints_Updater_Factory( |
|
117 | + $factories[ ] = new WordPoints_Updater_Factory( |
|
118 | 118 | '2.1.0-alpha-3' |
119 | 119 | , array( |
120 | 120 | 'global' => array( |
121 | 121 | array( |
122 | 122 | 'class' => 'WordPoints_Installer_DB_Tables', |
123 | - 'args' => array( $db_tables['global'], 'base' ), |
|
123 | + 'args' => array( $db_tables[ 'global' ], 'base' ), |
|
124 | 124 | ), |
125 | 125 | ), |
126 | 126 | ) |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | // We don't need to update the table if the new schema has just been used to |
133 | 133 | // install it. |
134 | - $factories[] = new WordPoints_Updater_Factory( |
|
134 | + $factories[ ] = new WordPoints_Updater_Factory( |
|
135 | 135 | '2.3.0-alpha-2' |
136 | 136 | , array( |
137 | 137 | 'global' => array( |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | // 2.4.0-alpha-2. |
154 | - $factories[] = new WordPoints_Updater_Factory( |
|
154 | + $factories[ ] = new WordPoints_Updater_Factory( |
|
155 | 155 | '2.4.0-alpha-2' |
156 | 156 | , array( |
157 | 157 | 'global' => array( |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | ); |
174 | 174 | |
175 | 175 | // 2.4.0-alpha-3. |
176 | - $factories[] = new WordPoints_Updater_Factory( |
|
176 | + $factories[ ] = new WordPoints_Updater_Factory( |
|
177 | 177 | '2.4.0-alpha-3' |
178 | 178 | , array( |
179 | 179 | 'global' => array( |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | $entity_slugs = array( 'user' ); |
193 | 193 | |
194 | 194 | foreach ( wordpoints_get_post_types_for_auto_integration() as $post_type ) { |
195 | - $entity_slugs[] = "post\\{$post_type}"; |
|
196 | - $entity_slugs[] = "comment\\{$post_type}"; |
|
195 | + $entity_slugs[ ] = "post\\{$post_type}"; |
|
196 | + $entity_slugs[ ] = "comment\\{$post_type}"; |
|
197 | 197 | } |
198 | 198 | |
199 | - $factories[] = new WordPoints_Updater_Factory( |
|
199 | + $factories[ ] = new WordPoints_Updater_Factory( |
|
200 | 200 | '2.4.0-alpha-5' |
201 | 201 | , array( |
202 | 202 | 'global' => array( |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | $factories = parent::get_uninstall_routine_factories(); |
246 | 246 | |
247 | - $factories[] = new WordPoints_Uninstaller_Factory_Options( |
|
247 | + $factories[ ] = new WordPoints_Uninstaller_Factory_Options( |
|
248 | 248 | array( |
249 | 249 | 'network' => array( |
250 | 250 | 'wordpoints_sitewide_active_modules', |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | ) |
280 | 280 | ); |
281 | 281 | |
282 | - $factories[] = new WordPoints_Uninstaller_Factory_Transients( |
|
282 | + $factories[ ] = new WordPoints_Uninstaller_Factory_Transients( |
|
283 | 283 | array( |
284 | 284 | 'global' => array( |
285 | 285 | 'wordpoints_extension_updates', |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | ) |
290 | 290 | ); |
291 | 291 | |
292 | - $factories[] = new WordPoints_Uninstaller_Factory_Admin_Screens_With_List_Tables( |
|
292 | + $factories[ ] = new WordPoints_Uninstaller_Factory_Admin_Screens_With_List_Tables( |
|
293 | 293 | array( |
294 | 294 | 'universal' => array( |
295 | 295 | 'wordpoints_extensions' => array(), |
@@ -119,12 +119,12 @@ discard block |
||
119 | 119 | |
120 | 120 | $this->settings = $settings; |
121 | 121 | |
122 | - if ( isset( $this->settings['event'] ) ) { |
|
123 | - $this->event_slug = $this->settings['event']; |
|
122 | + if ( isset( $this->settings[ 'event' ] ) ) { |
|
123 | + $this->event_slug = $this->settings[ 'event' ]; |
|
124 | 124 | } |
125 | 125 | |
126 | - if ( isset( $this->settings['reactor'] ) ) { |
|
127 | - $this->reactor_slug = $this->settings['reactor']; |
|
126 | + if ( isset( $this->settings[ 'reactor' ] ) ) { |
|
127 | + $this->reactor_slug = $this->settings[ 'reactor' ]; |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | } |
@@ -229,10 +229,10 @@ discard block |
||
229 | 229 | $field_stack = $this->field_stack; |
230 | 230 | |
231 | 231 | if ( null !== $field ) { |
232 | - $field_stack[] = $field; |
|
232 | + $field_stack[ ] = $field; |
|
233 | 233 | } |
234 | 234 | |
235 | - $this->errors[] = array( 'message' => $message, 'field' => $field_stack ); |
|
235 | + $this->errors[ ] = array( 'message' => $message, 'field' => $field_stack ); |
|
236 | 236 | |
237 | 237 | if ( $this->fail_fast ) { |
238 | 238 | throw new WordPoints_Hook_Validator_Exception(); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * @param string $field The field. |
270 | 270 | */ |
271 | 271 | public function push_field( $field ) { |
272 | - $this->field_stack[] = $field; |
|
272 | + $this->field_stack[ ] = $field; |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | /** |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | $period_units = array( |
42 | 42 | 1 => __( 'Seconds', 'wordpoints' ), |
43 | 43 | MINUTE_IN_SECONDS => __( 'Minutes', 'wordpoints' ), |
44 | - HOUR_IN_SECONDS => __( 'Hours', 'wordpoints' ), |
|
45 | - DAY_IN_SECONDS => __( 'Days', 'wordpoints' ), |
|
46 | - WEEK_IN_SECONDS => __( 'Weeks', 'wordpoints' ), |
|
47 | - 30 * DAY_IN_SECONDS => __( 'Months', 'wordpoints' ), |
|
44 | + HOUR_IN_SECONDS => __( 'Hours', 'wordpoints' ), |
|
45 | + DAY_IN_SECONDS => __( 'Days', 'wordpoints' ), |
|
46 | + WEEK_IN_SECONDS => __( 'Weeks', 'wordpoints' ), |
|
47 | + 30 * DAY_IN_SECONDS => __( 'Months', 'wordpoints' ), |
|
48 | 48 | ); |
49 | 49 | |
50 | 50 | /** |
@@ -122,17 +122,17 @@ discard block |
||
122 | 122 | return false; |
123 | 123 | } |
124 | 124 | |
125 | - if ( isset( $period['args'] ) ) { |
|
126 | - $this->validate_period_args( $period['args'] ); |
|
125 | + if ( isset( $period[ 'args' ] ) ) { |
|
126 | + $this->validate_period_args( $period[ 'args' ] ); |
|
127 | 127 | } |
128 | 128 | |
129 | - if ( ! isset( $period['length'] ) ) { |
|
129 | + if ( ! isset( $period[ 'length' ] ) ) { |
|
130 | 130 | |
131 | 131 | $this->validator->add_error( |
132 | 132 | __( 'Period length setting is missing.', 'wordpoints' ) |
133 | 133 | ); |
134 | 134 | |
135 | - } elseif ( false === wordpoints_posint( $period['length'] ) ) { |
|
135 | + } elseif ( false === wordpoints_posint( $period[ 'length' ] ) ) { |
|
136 | 136 | |
137 | 137 | $this->validator->add_error( |
138 | 138 | __( 'Period length must be a positive integer.', 'wordpoints' ) |
@@ -237,17 +237,17 @@ discard block |
||
237 | 237 | $now = current_time( 'timestamp', true ); |
238 | 238 | $hit_time = strtotime( $period->date, $now ); |
239 | 239 | |
240 | - if ( ! empty( $settings['relative'] ) ) { |
|
240 | + if ( ! empty( $settings[ 'relative' ] ) ) { |
|
241 | 241 | |
242 | - return ( $now > $hit_time + $settings['length'] ); |
|
242 | + return ( $now > $hit_time + $settings[ 'length' ] ); |
|
243 | 243 | |
244 | 244 | } else { |
245 | 245 | |
246 | 246 | $offset = get_option( 'gmt_offset' ) * HOUR_IN_SECONDS; |
247 | 247 | |
248 | 248 | return ( |
249 | - (int) ( ( $hit_time + $offset ) / $settings['length'] ) |
|
250 | - < (int) ( ( $now + $offset ) / $settings['length'] ) |
|
249 | + (int) ( ( $hit_time + $offset ) / $settings[ 'length' ] ) |
|
250 | + < (int) ( ( $now + $offset ) / $settings[ 'length' ] ) |
|
251 | 251 | ); |
252 | 252 | } |
253 | 253 | } |
@@ -371,10 +371,10 @@ discard block |
||
371 | 371 | LIMIT 1 |
372 | 372 | " |
373 | 373 | , $signature |
374 | - , $reaction_guid['mode'] |
|
375 | - , $reaction_guid['store'] |
|
376 | - , wp_json_encode( $reaction_guid['context_id'] ) |
|
377 | - , $reaction_guid['id'] |
|
374 | + , $reaction_guid[ 'mode' ] |
|
375 | + , $reaction_guid[ 'store' ] |
|
376 | + , wp_json_encode( $reaction_guid[ 'context_id' ] ) |
|
377 | + , $reaction_guid[ 'id' ] |
|
378 | 378 | , $this->action_type |
379 | 379 | ) |
380 | 380 | ); |
@@ -431,8 +431,8 @@ discard block |
||
431 | 431 | WordPoints_Hook_ReactionI $reaction |
432 | 432 | ) { |
433 | 433 | |
434 | - if ( isset( $settings['args'] ) ) { |
|
435 | - $period_args = $settings['args']; |
|
434 | + if ( isset( $settings[ 'args' ] ) ) { |
|
435 | + $period_args = $settings[ 'args' ]; |
|
436 | 436 | } else { |
437 | 437 | $period_args = array( $reaction->get_meta( 'target' ) ); |
438 | 438 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | protected function validate_condition( $settings ) { |
160 | 160 | |
161 | - if ( ! isset( $settings['type'] ) ) { |
|
161 | + if ( ! isset( $settings[ 'type' ] ) ) { |
|
162 | 162 | $this->validator->add_error( __( 'Condition type is missing.', 'wordpoints' ) ); |
163 | 163 | return false; |
164 | 164 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | return false; |
176 | 176 | } |
177 | 177 | |
178 | - $condition = $this->conditions->get( $data_type, $settings['type'] ); |
|
178 | + $condition = $this->conditions->get( $data_type, $settings[ 'type' ] ); |
|
179 | 179 | |
180 | 180 | if ( ! $condition ) { |
181 | 181 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | sprintf( |
184 | 184 | // translators: Condition type slug. |
185 | 185 | __( 'Unknown condition type “%s”.', 'wordpoints' ) |
186 | - , $settings['type'] |
|
186 | + , $settings[ 'type' ] |
|
187 | 187 | ) |
188 | 188 | , 'type' |
189 | 189 | ); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | return false; |
192 | 192 | } |
193 | 193 | |
194 | - if ( ! isset( $settings['settings'] ) ) { |
|
194 | + if ( ! isset( $settings[ 'settings' ] ) ) { |
|
195 | 195 | $this->validator->add_error( __( 'Condition settings are missing.', 'wordpoints' ) ); |
196 | 196 | return false; |
197 | 197 | } |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | // reset, so we need to back up their values and then restore them below. |
204 | 204 | $backup = array( $this->validator, $this->event_args ); |
205 | 205 | |
206 | - $settings['settings'] = $condition->validate_settings( |
|
206 | + $settings[ 'settings' ] = $condition->validate_settings( |
|
207 | 207 | $arg |
208 | - , $settings['settings'] |
|
208 | + , $settings[ 'settings' ] |
|
209 | 209 | , $this->validator |
210 | 210 | ); |
211 | 211 | |
@@ -249,16 +249,16 @@ discard block |
||
249 | 249 | |
250 | 250 | $event_args->descend( $arg_slug ); |
251 | 251 | |
252 | - if ( isset( $sub_args['_conditions'] ) ) { |
|
252 | + if ( isset( $sub_args[ '_conditions' ] ) ) { |
|
253 | 253 | |
254 | - foreach ( $sub_args['_conditions'] as $settings ) { |
|
254 | + foreach ( $sub_args[ '_conditions' ] as $settings ) { |
|
255 | 255 | |
256 | 256 | $condition = $this->conditions->get( |
257 | 257 | $this->get_data_type( $event_args->get_current() ) |
258 | - , $settings['type'] |
|
258 | + , $settings[ 'type' ] |
|
259 | 259 | ); |
260 | 260 | |
261 | - $is_met = $condition->is_met( $settings['settings'], $event_args ); |
|
261 | + $is_met = $condition->is_met( $settings[ 'settings' ], $event_args ); |
|
262 | 262 | |
263 | 263 | if ( ! $is_met ) { |
264 | 264 | $event_args->ascend(); |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | } |
267 | 267 | } |
268 | 268 | |
269 | - unset( $sub_args['_conditions'] ); |
|
269 | + unset( $sub_args[ '_conditions' ] ); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | $are_met = true; |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | $this->slug = $slug; |
89 | 89 | $this->args = $action_args; |
90 | 90 | |
91 | - if ( isset( $args['requirements'] ) ) { |
|
92 | - $this->requirements = $args['requirements']; |
|
91 | + if ( isset( $args[ 'requirements' ] ) ) { |
|
92 | + $this->requirements = $args[ 'requirements' ]; |
|
93 | 93 | } |
94 | 94 | |
95 | - if ( isset( $args['arg_index'] ) ) { |
|
96 | - $this->arg_index = $args['arg_index']; |
|
95 | + if ( isset( $args[ 'arg_index' ] ) ) { |
|
96 | + $this->arg_index = $args[ 'arg_index' ]; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | |
114 | 114 | $comparator = '='; |
115 | 115 | |
116 | - if ( is_array( $value ) && isset( $value['comparator'], $value['value'] ) ) { |
|
117 | - $comparator = $value['comparator']; |
|
118 | - $value = $value['value']; |
|
116 | + if ( is_array( $value ) && isset( $value[ 'comparator' ], $value[ 'value' ] ) ) { |
|
117 | + $comparator = $value[ 'comparator' ]; |
|
118 | + $value = $value[ 'value' ]; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | switch ( $comparator ) { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | $this->validate_count(); |
94 | 94 | |
95 | - if ( isset( $settings['conditions'] ) ) { |
|
95 | + if ( isset( $settings[ 'conditions' ] ) ) { |
|
96 | 96 | $this->validate_conditions( $arg ); |
97 | 97 | } |
98 | 98 | |
@@ -106,20 +106,20 @@ discard block |
||
106 | 106 | */ |
107 | 107 | protected function validate_count() { |
108 | 108 | |
109 | - if ( isset( $this->settings['max'] ) ) { |
|
109 | + if ( isset( $this->settings[ 'max' ] ) ) { |
|
110 | 110 | |
111 | 111 | if ( |
112 | - '0' === $this->settings['max'] |
|
113 | - || 0 === $this->settings['max'] |
|
112 | + '0' === $this->settings[ 'max' ] |
|
113 | + || 0 === $this->settings[ 'max' ] |
|
114 | 114 | ) { |
115 | 115 | |
116 | - $this->settings['max'] = 0; |
|
116 | + $this->settings[ 'max' ] = 0; |
|
117 | 117 | |
118 | - } elseif ( empty( $this->settings['max'] ) ) { |
|
118 | + } elseif ( empty( $this->settings[ 'max' ] ) ) { |
|
119 | 119 | |
120 | - unset( $this->settings['max'] ); |
|
120 | + unset( $this->settings[ 'max' ] ); |
|
121 | 121 | |
122 | - } elseif ( ! wordpoints_posint( $this->settings['max'] ) ) { |
|
122 | + } elseif ( ! wordpoints_posint( $this->settings[ 'max' ] ) ) { |
|
123 | 123 | |
124 | 124 | $this->validator->add_error( |
125 | 125 | __( 'The maximum must be a non-negative integer.', 'wordpoints' ) |
@@ -128,20 +128,20 @@ discard block |
||
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
131 | - if ( isset( $this->settings['min'] ) ) { |
|
131 | + if ( isset( $this->settings[ 'min' ] ) ) { |
|
132 | 132 | |
133 | 133 | if ( |
134 | - '0' === $this->settings['min'] |
|
135 | - || 0 === $this->settings['min'] |
|
134 | + '0' === $this->settings[ 'min' ] |
|
135 | + || 0 === $this->settings[ 'min' ] |
|
136 | 136 | ) { |
137 | 137 | |
138 | - $this->settings['min'] = 0; |
|
138 | + $this->settings[ 'min' ] = 0; |
|
139 | 139 | |
140 | - } elseif ( empty( $this->settings['min'] ) ) { |
|
140 | + } elseif ( empty( $this->settings[ 'min' ] ) ) { |
|
141 | 141 | |
142 | - unset( $this->settings['min'] ); |
|
142 | + unset( $this->settings[ 'min' ] ); |
|
143 | 143 | |
144 | - } elseif ( ! wordpoints_posint( $this->settings['min'] ) ) { |
|
144 | + } elseif ( ! wordpoints_posint( $this->settings[ 'min' ] ) ) { |
|
145 | 145 | |
146 | 146 | $this->validator->add_error( |
147 | 147 | __( 'The minimum must be a non-negative integer.', 'wordpoints' ) |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | ); |
150 | 150 | |
151 | 151 | } elseif ( |
152 | - isset( $this->settings['max'] ) |
|
153 | - && $this->settings['max'] < $this->settings['min'] |
|
152 | + isset( $this->settings[ 'max' ] ) |
|
153 | + && $this->settings[ 'max' ] < $this->settings[ 'min' ] |
|
154 | 154 | ) { |
155 | 155 | |
156 | 156 | $this->validator->add_error( |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | |
188 | 188 | $this->validator->push_field( 'conditions' ); |
189 | 189 | |
190 | - $this->settings['conditions'] = $this->conditions_extension->validate_conditions( |
|
191 | - $this->settings['conditions'] |
|
190 | + $this->settings[ 'conditions' ] = $this->conditions_extension->validate_conditions( |
|
191 | + $this->settings[ 'conditions' ] |
|
192 | 192 | , $args |
193 | 193 | ); |
194 | 194 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | $entities = $arg->get_the_entities(); |
212 | 212 | |
213 | - if ( isset( $this->settings['conditions'] ) ) { |
|
213 | + if ( isset( $this->settings[ 'conditions' ] ) ) { |
|
214 | 214 | $entities = $this->filter_entities( $entities ); |
215 | 215 | } |
216 | 216 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $event_args->add_entity( $entity ); |
236 | 236 | |
237 | 237 | $matches = $this->conditions_extension->conditions_are_met( |
238 | - $this->settings['conditions'] |
|
238 | + $this->settings[ 'conditions' ] |
|
239 | 239 | , $event_args |
240 | 240 | ); |
241 | 241 | |
@@ -258,11 +258,11 @@ discard block |
||
258 | 258 | */ |
259 | 259 | protected function check_count( $count ) { |
260 | 260 | |
261 | - if ( isset( $this->settings['max'] ) && $count > $this->settings['max'] ) { |
|
261 | + if ( isset( $this->settings[ 'max' ] ) && $count > $this->settings[ 'max' ] ) { |
|
262 | 262 | return false; |
263 | 263 | } |
264 | 264 | |
265 | - if ( isset( $this->settings['min'] ) && $count < $this->settings['min'] ) { |
|
265 | + if ( isset( $this->settings[ 'min' ] ) && $count < $this->settings[ 'min' ] ) { |
|
266 | 266 | return false; |
267 | 267 | } |
268 | 268 |
@@ -114,20 +114,20 @@ discard block |
||
114 | 114 | return $response; |
115 | 115 | } |
116 | 116 | |
117 | - if ( ! isset( $response['license'] ) ) { |
|
117 | + if ( ! isset( $response[ 'license' ] ) ) { |
|
118 | 118 | return false; |
119 | 119 | } |
120 | 120 | |
121 | 121 | // The 'license' key actually holds the license's status. |
122 | - $status = $response['license']; |
|
122 | + $status = $response[ 'license' ]; |
|
123 | 123 | |
124 | - if ( isset( $response['error'] ) && 'expired' === $response['error'] ) { |
|
124 | + if ( isset( $response[ 'error' ] ) && 'expired' === $response[ 'error' ] ) { |
|
125 | 125 | $status = 'expired'; |
126 | 126 | } |
127 | 127 | |
128 | 128 | $this->extension_data->set( 'license_status', $status ); |
129 | 129 | |
130 | - if ( 'valid' !== $response['license'] ) { |
|
130 | + if ( 'valid' !== $response[ 'license' ] ) { |
|
131 | 131 | return false; |
132 | 132 | } |
133 | 133 | |
@@ -161,13 +161,13 @@ discard block |
||
161 | 161 | return $response; |
162 | 162 | } |
163 | 163 | |
164 | - if ( ! isset( $response['license'] ) ) { |
|
164 | + if ( ! isset( $response[ 'license' ] ) ) { |
|
165 | 165 | return false; |
166 | 166 | } |
167 | 167 | |
168 | 168 | // This 'license' key holds either 'deactivated' or 'failed'. |
169 | 169 | // The status of the license is not returned. |
170 | - if ( 'deactivated' !== $response['license'] ) { |
|
170 | + if ( 'deactivated' !== $response[ 'license' ] ) { |
|
171 | 171 | $this->extension_data->delete( 'license_status' ); |
172 | 172 | return ( 'inactive' === $this->get_info( 'license_status' ) ); |
173 | 173 | } |
@@ -280,12 +280,12 @@ discard block |
||
280 | 280 | return $response; |
281 | 281 | } |
282 | 282 | |
283 | - if ( isset( $response['license'] ) ) { |
|
284 | - $this->extension_data->set( 'license_status', $response['license'] ); |
|
283 | + if ( isset( $response[ 'license' ] ) ) { |
|
284 | + $this->extension_data->set( 'license_status', $response[ 'license' ] ); |
|
285 | 285 | } |
286 | 286 | |
287 | - if ( isset( $response['expires'] ) ) { |
|
288 | - $this->extension_data->set( 'license_expiration', $response['expires'] ); |
|
287 | + if ( isset( $response[ 'expires' ] ) ) { |
|
288 | + $this->extension_data->set( 'license_expiration', $response[ 'expires' ] ); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | return $response; |