@@ -76,11 +76,11 @@ |
||
| 76 | 76 | |
| 77 | 77 | $routines = array(); |
| 78 | 78 | |
| 79 | - if ( empty( $this->uninstallers[ $context ] ) ) { |
|
| 79 | + if ( empty( $this->uninstallers[$context] ) ) { |
|
| 80 | 80 | return $routines; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - foreach ( $this->uninstallers[ $context ] as $data ) { |
|
| 83 | + foreach ( $this->uninstallers[$context] as $data ) { |
|
| 84 | 84 | |
| 85 | 85 | if ( is_string( $data ) ) { |
| 86 | 86 | $class = $data; |
@@ -137,7 +137,7 @@ |
||
| 137 | 137 | // So we get all of the per-site versions. |
| 138 | 138 | foreach ( $this->installable->get_installed_site_ids() as $site_id ) { |
| 139 | 139 | switch_to_blog( $site_id ); |
| 140 | - $versions[ $site_id ] = $this->installable->get_db_version(); |
|
| 140 | + $versions[$site_id] = $this->installable->get_db_version(); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $ms_switched_state->restore(); |
@@ -194,11 +194,11 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public function get_component( $slug ) { |
| 196 | 196 | |
| 197 | - if ( ! isset( $this->registered[ $slug ] ) ) { |
|
| 197 | + if ( ! isset( $this->registered[$slug] ) ) { |
|
| 198 | 198 | return false; |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - return $this->registered[ $slug ]; |
|
| 201 | + return $this->registered[$slug]; |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | /** |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | public function is_registered( $slug ) { |
| 230 | 230 | |
| 231 | - return isset( $this->registered[ $slug ] ); |
|
| 231 | + return isset( $this->registered[$slug] ); |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /** |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | return false; |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | - $this->registered[ $component['slug'] ] = array_intersect_key( $component, $defaults ); |
|
| 287 | + $this->registered[$component['slug']] = array_intersect_key( $component, $defaults ); |
|
| 288 | 288 | |
| 289 | 289 | if ( |
| 290 | 290 | ! isset( $component['installable'] ) |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | */ |
| 316 | 316 | public function deregister( $slug ) { |
| 317 | 317 | |
| 318 | - if ( isset( $this->registered[ $slug ] ) ) { |
|
| 318 | + if ( isset( $this->registered[$slug] ) ) { |
|
| 319 | 319 | |
| 320 | 320 | /** |
| 321 | 321 | * Component being deregistered. |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | do_action( "wordpoints_component_deregister-{$slug}" ); |
| 326 | 326 | |
| 327 | - unset( $this->registered[ $slug ] ); |
|
| 327 | + unset( $this->registered[$slug] ); |
|
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | return true; |
@@ -356,17 +356,17 @@ discard block |
||
| 356 | 356 | // If this component isn't already active, activate it. |
| 357 | 357 | if ( ! $this->is_active( $slug ) ) { |
| 358 | 358 | |
| 359 | - $this->active[ $slug ] = 1; |
|
| 359 | + $this->active[$slug] = 1; |
|
| 360 | 360 | |
| 361 | 361 | if ( ! wordpoints_update_maybe_network_option( 'wordpoints_active_components', $this->active ) ) { |
| 362 | 362 | return false; |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - require_once $this->registered[ $slug ]['file']; |
|
| 365 | + require_once $this->registered[$slug]['file']; |
|
| 366 | 366 | |
| 367 | - if ( isset( $this->registered[ $slug ]['installable'] ) ) { |
|
| 367 | + if ( isset( $this->registered[$slug]['installable'] ) ) { |
|
| 368 | 368 | |
| 369 | - $installable = $this->registered[ $slug ]['installable']; |
|
| 369 | + $installable = $this->registered[$slug]['installable']; |
|
| 370 | 370 | $installable = new $installable( $slug ); |
| 371 | 371 | |
| 372 | 372 | $installer = new WordPoints_Installer( |
@@ -381,8 +381,8 @@ discard block |
||
| 381 | 381 | WordPoints_Installables::get_installer( |
| 382 | 382 | 'component' |
| 383 | 383 | , $slug |
| 384 | - , $this->registered[ $slug ]['version'] |
|
| 385 | - , $this->registered[ $slug ]['un_installer'] |
|
| 384 | + , $this->registered[$slug]['version'] |
|
| 385 | + , $this->registered[$slug]['un_installer'] |
|
| 386 | 386 | ) |
| 387 | 387 | ->install( is_wordpoints_network_active() ); |
| 388 | 388 | } |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | if ( $this->is_active( $slug ) ) { |
| 422 | 422 | |
| 423 | - unset( $this->active[ $slug ] ); |
|
| 423 | + unset( $this->active[$slug] ); |
|
| 424 | 424 | |
| 425 | 425 | if ( ! wordpoints_update_maybe_network_option( 'wordpoints_active_components', $this->active ) ) { |
| 426 | 426 | return false; |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | |
| 454 | 454 | $this->get_active(); |
| 455 | 455 | |
| 456 | - $is_active = isset( $this->active[ $slug ] ); |
|
| 456 | + $is_active = isset( $this->active[$slug] ); |
|
| 457 | 457 | |
| 458 | 458 | /** |
| 459 | 459 | * Is a component active? |
@@ -602,7 +602,7 @@ |
||
| 602 | 602 | return false; |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | - $current_context[ $slug ] = $id; |
|
| 605 | + $current_context[$slug] = $id; |
|
| 606 | 606 | |
| 607 | 607 | $slug = $context->get_parent_slug(); |
| 608 | 608 | } |
@@ -454,7 +454,7 @@ |
||
| 454 | 454 | $the_guid = $entity->get_the_guid(); |
| 455 | 455 | |
| 456 | 456 | if ( $the_guid ) { |
| 457 | - $the_guids[ $arg_slug ] = $the_guid; |
|
| 457 | + $the_guids[$arg_slug] = $the_guid; |
|
| 458 | 458 | } |
| 459 | 459 | } |
| 460 | 460 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $modules = wordpoints_get_array_option( 'wordpoints_sitewide_active_modules', 'site' ); |
| 64 | 64 | |
| 65 | - if ( isset( $modules[ $module ] ) ) { |
|
| 65 | + if ( isset( $modules[$module] ) ) { |
|
| 66 | 66 | return true; |
| 67 | 67 | } |
| 68 | 68 | |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | |
| 497 | 497 | foreach ( array( 'name', 'uri', 'module_uri', 'description', 'author', 'author_uri', 'version' ) as $field ) { |
| 498 | 498 | |
| 499 | - $module_data[ $field ] = translate( $module_data[ $field ], $textdomain ); // @codingStandardsIgnoreLine |
|
| 499 | + $module_data[$field] = translate( $module_data[$field], $textdomain ); // @codingStandardsIgnoreLine |
|
| 500 | 500 | } |
| 501 | 501 | } |
| 502 | 502 | } |
@@ -514,11 +514,11 @@ discard block |
||
| 514 | 514 | $allowed_tags['a'] = array( 'href' => true, 'title' => true ); |
| 515 | 515 | |
| 516 | 516 | // Name and author ar marked up inside <a> tags. Don't allow these. |
| 517 | - $module_data['name'] = wp_kses( $module_data['name'] , $allowed_tags_in_links ); |
|
| 517 | + $module_data['name'] = wp_kses( $module_data['name'], $allowed_tags_in_links ); |
|
| 518 | 518 | $module_data['author'] = wp_kses( $module_data['author'], $allowed_tags_in_links ); |
| 519 | 519 | |
| 520 | 520 | $module_data['description'] = wp_kses( $module_data['description'], $allowed_tags ); |
| 521 | - $module_data['version'] = wp_kses( $module_data['version'] , $allowed_tags ); |
|
| 521 | + $module_data['version'] = wp_kses( $module_data['version'], $allowed_tags ); |
|
| 522 | 522 | |
| 523 | 523 | $module_data['uri'] = esc_url( $module_data['uri'] ); |
| 524 | 524 | $module_data['module_uri'] = esc_url( $module_data['module_uri'] ); |
@@ -683,8 +683,8 @@ discard block |
||
| 683 | 683 | $cache_modules = array(); |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | - if ( isset( $cache_modules[ $module_folder ] ) ) { |
|
| 687 | - return $cache_modules[ $module_folder ]; |
|
| 686 | + if ( isset( $cache_modules[$module_folder] ) ) { |
|
| 687 | + return $cache_modules[$module_folder]; |
|
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | $modules = array(); |
@@ -738,12 +738,12 @@ discard block |
||
| 738 | 738 | $module_file = basename( $module_file ); |
| 739 | 739 | } |
| 740 | 740 | |
| 741 | - $modules[ $module_file ] = $module_data; |
|
| 741 | + $modules[$module_file] = $module_data; |
|
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 744 | uasort( $modules, '_wordpoints_sort_uname_callback' ); |
| 745 | 745 | |
| 746 | - $cache_modules[ $module_folder ] = $modules; |
|
| 746 | + $cache_modules[$module_folder] = $modules; |
|
| 747 | 747 | wp_cache_set( 'wordpoints_modules', $cache_modules, 'wordpoints_modules' ); |
| 748 | 748 | |
| 749 | 749 | return $modules; |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | |
| 771 | 771 | $installed_modules = wordpoints_get_modules(); |
| 772 | 772 | |
| 773 | - if ( ! isset( $installed_modules[ $module ] ) ) { |
|
| 773 | + if ( ! isset( $installed_modules[$module] ) ) { |
|
| 774 | 774 | return new WP_Error( 'no_module_header', __( 'The extension does not have a valid header.', 'wordpoints' ) ); |
| 775 | 775 | } |
| 776 | 776 | |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | $result = wordpoints_validate_module( $module ); |
| 808 | 808 | |
| 809 | 809 | if ( is_wp_error( $result ) ) { |
| 810 | - $invalid[ $module ] = $result; |
|
| 810 | + $invalid[$module] = $result; |
|
| 811 | 811 | wordpoints_deactivate_modules( $module, true ); |
| 812 | 812 | } |
| 813 | 813 | } |
@@ -946,7 +946,7 @@ discard block |
||
| 946 | 946 | |
| 947 | 947 | if ( $network_wide ) { |
| 948 | 948 | |
| 949 | - $network_current[ $module ] = time(); |
|
| 949 | + $network_current[$module] = time(); |
|
| 950 | 950 | update_site_option( 'wordpoints_sitewide_active_modules', $network_current ); |
| 951 | 951 | |
| 952 | 952 | } else { |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | if ( is_wordpoints_module_active_for_network( $module ) ) { |
| 1036 | 1036 | |
| 1037 | 1037 | $do_network = true; |
| 1038 | - unset( $network_current[ $module ] ); |
|
| 1038 | + unset( $network_current[$module] ); |
|
| 1039 | 1039 | |
| 1040 | 1040 | } elseif ( $network_wide ) { |
| 1041 | 1041 | |
@@ -1050,7 +1050,7 @@ discard block |
||
| 1050 | 1050 | if ( false !== $key ) { |
| 1051 | 1051 | |
| 1052 | 1052 | $do_blog = true; |
| 1053 | - unset( $current[ $key ] ); |
|
| 1053 | + unset( $current[$key] ); |
|
| 1054 | 1054 | } |
| 1055 | 1055 | } |
| 1056 | 1056 | |
@@ -1616,10 +1616,10 @@ discard block |
||
| 1616 | 1616 | if ( |
| 1617 | 1617 | empty( $data['ID'] ) |
| 1618 | 1618 | && ( 'J.D. Grimes' === $data['author'] || 'WordPoints' === $data['author'] ) |
| 1619 | - && isset( $missing_headers[ $data['name'] ] ) |
|
| 1619 | + && isset( $missing_headers[$data['name']] ) |
|
| 1620 | 1620 | ) { |
| 1621 | 1621 | $data['server'] = 'wordpoints.org'; |
| 1622 | - $data['ID'] = $missing_headers[ $data['name'] ]; |
|
| 1622 | + $data['ID'] = $missing_headers[$data['name']]; |
|
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | 1625 | return $data; |
@@ -90,11 +90,11 @@ |
||
| 90 | 90 | |
| 91 | 91 | $routines = array(); |
| 92 | 92 | |
| 93 | - if ( empty( $this->updates[ $context ] ) ) { |
|
| 93 | + if ( empty( $this->updates[$context] ) ) { |
|
| 94 | 94 | return $routines; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - foreach ( $this->updates[ $context ] as $data ) { |
|
| 97 | + foreach ( $this->updates[$context] as $data ) { |
|
| 98 | 98 | |
| 99 | 99 | if ( $data instanceof WordPoints_RoutineI ) { |
| 100 | 100 | $routines[] = $data; |