@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | $args = array_merge( $defaults, $args ); |
| 110 | 110 | |
| 111 | - $parent = $args['parent']; |
|
| 111 | + $parent = $args[ 'parent' ]; |
|
| 112 | 112 | |
| 113 | 113 | // The extensions screen is the top-level screen on each site when |
| 114 | 114 | // network installed. |
@@ -124,19 +124,19 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | // Each user can hide specific columns of the table. |
| 126 | 126 | if ( 'network' === $context ) { |
| 127 | - $meta_keys[] = "manage{$parent}_page_{$screen_id}-networkcolumnshidden"; |
|
| 127 | + $meta_keys[ ] = "manage{$parent}_page_{$screen_id}-networkcolumnshidden"; |
|
| 128 | 128 | } else { |
| 129 | - $meta_keys[] = "manage{$parent}_page_{$screen_id}columnshidden"; |
|
| 129 | + $meta_keys[ ] = "manage{$parent}_page_{$screen_id}columnshidden"; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | // Loop through each of the other options provided by this list table. |
| 133 | - foreach ( $args['options'] as $option ) { |
|
| 133 | + foreach ( $args[ 'options' ] as $option ) { |
|
| 134 | 134 | |
| 135 | 135 | // Each user gets to set the options to their liking. |
| 136 | 136 | if ( 'network' === $context ) { |
| 137 | - $meta_keys[] = "{$parent}_page_{$screen_id}_network_{$option}"; |
|
| 137 | + $meta_keys[ ] = "{$parent}_page_{$screen_id}_network_{$option}"; |
|
| 138 | 138 | } else { |
| 139 | - $meta_keys[] = "{$parent}_page_{$screen_id}_{$option}"; |
|
| 139 | + $meta_keys[ ] = "{$parent}_page_{$screen_id}_{$option}"; |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | } |
@@ -110,18 +110,18 @@ |
||
| 110 | 110 | foreach ( $this->screens[ $context ] as $screen_id => $args ) { |
| 111 | 111 | |
| 112 | 112 | $args = array_merge( $defaults, $args ); |
| 113 | - $args['options'] = array_merge( $options, $args['options'] ); |
|
| 113 | + $args[ 'options' ] = array_merge( $options, $args[ 'options' ] ); |
|
| 114 | 114 | |
| 115 | 115 | // Each user gets to set the options to their liking. |
| 116 | - foreach ( $args['options'] as $option ) { |
|
| 116 | + foreach ( $args[ 'options' ] as $option ) { |
|
| 117 | 117 | |
| 118 | - $meta_key = "{$option}_{$args['parent']}_page_{$screen_id}"; |
|
| 118 | + $meta_key = "{$option}_{$args[ 'parent' ]}_page_{$screen_id}"; |
|
| 119 | 119 | |
| 120 | 120 | if ( 'network' === $context ) { |
| 121 | 121 | $meta_key .= '-network'; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - $meta_keys[] = $meta_key; |
|
| 124 | + $meta_keys[ ] = $meta_key; |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | $routines = array(); |
| 72 | 72 | |
| 73 | 73 | if ( ! empty( $this->db_tables[ $context ] ) ) { |
| 74 | - $routines[] = new WordPoints_Uninstaller_DB_Tables( |
|
| 74 | + $routines[ ] = new WordPoints_Uninstaller_DB_Tables( |
|
| 75 | 75 | $this->db_tables[ $context ] |
| 76 | 76 | , 'site' === $context ? 'site' : 'base' |
| 77 | 77 | ); |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | $routines = array(); |
| 72 | 72 | |
| 73 | 73 | if ( isset( $this->transients[ $context ] ) ) { |
| 74 | - $routines[] = new WordPoints_Uninstaller_Callback( |
|
| 74 | + $routines[ ] = new WordPoints_Uninstaller_Callback( |
|
| 75 | 75 | 'network' === $context ? 'delete_site_transient' : 'delete_transient' |
| 76 | 76 | , $this->transients[ $context ] |
| 77 | 77 | ); |
@@ -76,15 +76,15 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | if ( is_multisite() ) { |
| 78 | 78 | |
| 79 | - $routines['network'] = $this->get_routines( |
|
| 79 | + $routines[ 'network' ] = $this->get_routines( |
|
| 80 | 80 | 'network' |
| 81 | 81 | , $this->get_network_db_version_installable() |
| 82 | 82 | ); |
| 83 | 83 | |
| 84 | - $routines['site'] = $this->get_routines( 'site', $db_version ); |
|
| 84 | + $routines[ 'site' ] = $this->get_routines( 'site', $db_version ); |
|
| 85 | 85 | |
| 86 | 86 | } else { |
| 87 | - $routines['single'] = $this->get_routines( 'single', $db_version ); |
|
| 87 | + $routines[ 'single' ] = $this->get_routines( 'single', $db_version ); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | unset( $this->update_factories ); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | protected function run_for_sites() { |
| 214 | 214 | |
| 215 | - if ( empty( $this->updates['site'] ) ) { |
|
| 215 | + if ( empty( $this->updates[ 'site' ] ) ) { |
|
| 216 | 216 | return; |
| 217 | 217 | } |
| 218 | 218 | |
@@ -241,8 +241,8 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | protected function run_for_network() { |
| 243 | 243 | |
| 244 | - if ( ! empty( $this->updates['network'] ) ) { |
|
| 245 | - $this->run_routines( $this->updates['network'] ); |
|
| 244 | + if ( ! empty( $this->updates[ 'network' ] ) ) { |
|
| 245 | + $this->run_routines( $this->updates[ 'network' ] ); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | $this->installable->set_db_version( null, true ); |
@@ -253,8 +253,8 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | protected function run_for_site() { |
| 255 | 255 | |
| 256 | - if ( ! empty( $this->updates['site'] ) ) { |
|
| 257 | - $this->run_routines( $this->updates['site'] ); |
|
| 256 | + if ( ! empty( $this->updates[ 'site' ] ) ) { |
|
| 257 | + $this->run_routines( $this->updates[ 'site' ] ); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | if ( ! $this->network_wide ) { |
@@ -268,8 +268,8 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | protected function run_for_single() { |
| 270 | 270 | |
| 271 | - if ( ! empty( $this->updates['single'] ) ) { |
|
| 272 | - $this->run_routines( $this->updates['single'] ); |
|
| 271 | + if ( ! empty( $this->updates[ 'single' ] ) ) { |
|
| 272 | + $this->run_routines( $this->updates[ 'single' ] ); |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | $this->installable->set_db_version(); |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | add_action( 'wordpoints_extensions_loaded', 'wordpoints_installables_maybe_update', 5 ); |
| 40 | 40 | add_action( 'wpmu_new_blog', 'wordpoints_installables_install_on_new_site' ); |
| 41 | 41 | |
| 42 | -if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK. |
|
| 42 | +if ( isset( $_GET[ 'wordpoints_module_check' ], $_GET[ 'check_module' ] ) ) { // WPCS: CSRF OK. |
|
| 43 | 43 | |
| 44 | 44 | add_action( 'shutdown', 'wordpoints_maintenance_shutdown_print_rand_str' ); |
| 45 | 45 | |
@@ -39,7 +39,8 @@ |
||
| 39 | 39 | add_action( 'wordpoints_extensions_loaded', 'wordpoints_installables_maybe_update', 5 ); |
| 40 | 40 | add_action( 'wpmu_new_blog', 'wordpoints_installables_install_on_new_site' ); |
| 41 | 41 | |
| 42 | -if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { // WPCS: CSRF OK. |
|
| 42 | +if ( isset( $_GET['wordpoints_module_check'], $_GET['check_module'] ) ) { |
|
| 43 | +// WPCS: CSRF OK. |
|
| 43 | 44 | |
| 44 | 45 | add_action( 'shutdown', 'wordpoints_maintenance_shutdown_print_rand_str' ); |
| 45 | 46 | |
@@ -27,24 +27,24 @@ |
||
| 27 | 27 | // Uninstall the components. |
| 28 | 28 | foreach ( $components->get() as $component => $data ) { |
| 29 | 29 | |
| 30 | - if ( isset( $data['installable'] ) ) { |
|
| 30 | + if ( isset( $data[ 'installable' ] ) ) { |
|
| 31 | 31 | |
| 32 | 32 | WordPoints_Class_Autoloader::register_dir( |
| 33 | 33 | WORDPOINTS_DIR . "components/{$component}/classes" |
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | - $installable = $data['installable']; |
|
| 36 | + $installable = $data[ 'installable' ]; |
|
| 37 | 37 | |
| 38 | 38 | $installer = new WordPoints_Uninstaller( new $installable( $component ) ); |
| 39 | 39 | $installer->run(); |
| 40 | 40 | |
| 41 | - } elseif ( isset( $data['un_installer'] ) ) { |
|
| 41 | + } elseif ( isset( $data[ 'un_installer' ] ) ) { |
|
| 42 | 42 | |
| 43 | 43 | WordPoints_Installables::get_installer( |
| 44 | 44 | 'component' |
| 45 | 45 | , $component |
| 46 | 46 | , 'uninstall' // Required, but not used. |
| 47 | - , $data['un_installer'] |
|
| 47 | + , $data[ 'un_installer' ] |
|
| 48 | 48 | ) |
| 49 | 49 | ->uninstall(); |
| 50 | 50 | } |
@@ -100,11 +100,11 @@ |
||
| 100 | 100 | $class = $data; |
| 101 | 101 | $args = array(); |
| 102 | 102 | } else { |
| 103 | - $class = $data['class']; |
|
| 104 | - $args = $data['args']; |
|
| 103 | + $class = $data[ 'class' ]; |
|
| 104 | + $args = $data[ 'args' ]; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - $routines[] = wordpoints_construct_class_with_args( $class, $args ); |
|
| 107 | + $routines[ ] = wordpoints_construct_class_with_args( $class, $args ); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | return $routines; |
@@ -138,22 +138,22 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | foreach ( $this->get() as $component ) { |
| 140 | 140 | |
| 141 | - if ( ! $this->is_active( $component['slug'] ) ) { |
|
| 141 | + if ( ! $this->is_active( $component[ 'slug' ] ) ) { |
|
| 142 | 142 | continue; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - if ( isset( $component['installable'] ) ) { |
|
| 145 | + if ( isset( $component[ 'installable' ] ) ) { |
|
| 146 | 146 | |
| 147 | 147 | $installables->register( |
| 148 | 148 | 'component' |
| 149 | - , $component['slug'] |
|
| 150 | - , $component['installable'] |
|
| 151 | - , $component['version'] |
|
| 149 | + , $component[ 'slug' ] |
|
| 150 | + , $component[ 'installable' ] |
|
| 151 | + , $component[ 'version' ] |
|
| 152 | 152 | , is_wordpoints_network_active() |
| 153 | 153 | ); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - include_once $component['file']; |
|
| 156 | + include_once $component[ 'file' ]; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /** |
@@ -276,27 +276,27 @@ discard block |
||
| 276 | 276 | $component = array_merge( $defaults, $args ); |
| 277 | 277 | |
| 278 | 278 | if ( |
| 279 | - empty( $component['name'] ) |
|
| 280 | - || empty( $component['file'] ) |
|
| 281 | - || empty( $component['slug'] ) |
|
| 282 | - || $this->is_registered( $component['slug'] ) |
|
| 279 | + empty( $component[ 'name' ] ) |
|
| 280 | + || empty( $component[ 'file' ] ) |
|
| 281 | + || empty( $component[ 'slug' ] ) |
|
| 282 | + || $this->is_registered( $component[ 'slug' ] ) |
|
| 283 | 283 | ) { |
| 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 | - ! isset( $component['installable'] ) |
|
| 291 | - && isset( $component['un_installer'] ) |
|
| 290 | + ! isset( $component[ 'installable' ] ) |
|
| 291 | + && isset( $component[ 'un_installer' ] ) |
|
| 292 | 292 | ) { |
| 293 | 293 | |
| 294 | 294 | WordPoints_Installables::register( |
| 295 | 295 | 'component' |
| 296 | - , $component['slug'] |
|
| 296 | + , $component[ 'slug' ] |
|
| 297 | 297 | , array( |
| 298 | - 'version' => $component['version'], |
|
| 299 | - 'un_installer' => $component['un_installer'], |
|
| 298 | + 'version' => $component[ 'version' ], |
|
| 299 | + 'un_installer' => $component[ 'un_installer' ], |
|
| 300 | 300 | ) |
| 301 | 301 | ); |
| 302 | 302 | } |
@@ -362,11 +362,11 @@ discard block |
||
| 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 | } |