@@ -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 | /** |
@@ -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; |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | return $response; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - $extension_data->set( 'is_free', ! empty( $response['is_free'] ) ); |
|
| 75 | + $extension_data->set( 'is_free', ! empty( $response[ 'is_free' ] ) ); |
|
| 76 | 76 | |
| 77 | 77 | return $response; |
| 78 | 78 | } |
@@ -164,8 +164,8 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | // If the license key wasn't valid, update its status. |
| 166 | 166 | if ( |
| 167 | - isset( $response['msg'] ) |
|
| 168 | - && empty( $response['new_version'] ) |
|
| 167 | + isset( $response[ 'msg' ] ) |
|
| 168 | + && empty( $response[ 'new_version' ] ) |
|
| 169 | 169 | && $extension_data->get( 'license_status' ) |
| 170 | 170 | ) { |
| 171 | 171 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | } elseif ( |
| 186 | 186 | $license_key |
| 187 | - && isset( $response['new_version'] ) |
|
| 187 | + && isset( $response[ 'new_version' ] ) |
|
| 188 | 188 | && 'valid' !== $extension_data->get( 'license_status' ) |
| 189 | 189 | && false === $extension_data->get( 'is_free' ) |
| 190 | 190 | ) { |
@@ -201,20 +201,20 @@ discard block |
||
| 201 | 201 | $license->is_valid(); |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - if ( isset( $response['new_version'] ) ) { |
|
| 205 | - $extension_data->set( 'latest_version', $response['new_version'] ); |
|
| 204 | + if ( isset( $response[ 'new_version' ] ) ) { |
|
| 205 | + $extension_data->set( 'latest_version', $response[ 'new_version' ] ); |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - if ( isset( $response['package'] ) ) { |
|
| 209 | - $extension_data->set( 'package', $response['package'] ); |
|
| 208 | + if ( isset( $response[ 'package' ] ) ) { |
|
| 209 | + $extension_data->set( 'package', $response[ 'package' ] ); |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | - if ( isset( $response['homepage'] ) ) { |
|
| 213 | - $extension_data->set( 'homepage', $response['homepage'] ); |
|
| 212 | + if ( isset( $response[ 'homepage' ] ) ) { |
|
| 213 | + $extension_data->set( 'homepage', $response[ 'homepage' ] ); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - if ( isset( $response['sections']['changelog'] ) ) { |
|
| 217 | - $extension_data->set( 'changelog', $response['sections']['changelog'] ); |
|
| 216 | + if ( isset( $response[ 'sections' ][ 'changelog' ] ) ) { |
|
| 217 | + $extension_data->set( 'changelog', $response[ 'sections' ][ 'changelog' ] ); |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | return $response; |
@@ -260,12 +260,12 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | if ( |
| 262 | 262 | $response |
| 263 | - && isset( $response['sections'] ) |
|
| 264 | - && is_string( $response['sections'] ) |
|
| 265 | - && 1 !== preg_match( '~O:\d~', $response['sections'] ) // No object injection. |
|
| 263 | + && isset( $response[ 'sections' ] ) |
|
| 264 | + && is_string( $response[ 'sections' ] ) |
|
| 265 | + && 1 !== preg_match( '~O:\d~', $response[ 'sections' ] ) // No object injection. |
|
| 266 | 266 | ) { |
| 267 | 267 | // @codingStandardsIgnoreStart |
| 268 | - $response['sections'] = maybe_unserialize( $response['sections'] ); |
|
| 268 | + $response[ 'sections' ] = maybe_unserialize( $response[ 'sections' ] ); |
|
| 269 | 269 | // @codingStandardsIgnoreEnd |
| 270 | 270 | } |
| 271 | 271 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $extension_data = new WordPoints_Extension_Server_API_Extension_Data( |
| 109 | - $extension['ID'] |
|
| 109 | + $extension[ 'ID' ] |
|
| 110 | 110 | , $server |
| 111 | 111 | ); |
| 112 | 112 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | if ( |
| 118 | 118 | false === $latest_version |
| 119 | - || ! version_compare( $latest_version, $extension['version'], '>' ) |
|
| 119 | + || ! version_compare( $latest_version, $extension[ 'version' ], '>' ) |
|
| 120 | 120 | ) { |
| 121 | 121 | continue; |
| 122 | 122 | } |