| | 359 | $info['wp-uploads'] = array( |
| | 360 | 'label' => __( 'File upload settings' ), |
| | 361 | 'description' => __( 'Shows whether file uploads are enabled and restrictions imposed.' ), |
| | 362 | 'fields' => array(), |
| | 363 | ); |
| | 364 | if ( ! function_exists( 'ini_get' ) ) { |
| | 365 | $info['wp-uploads']['fields']['ini_get'] = array( |
| | 366 | 'label' => __( 'File upload settings' ), |
| | 367 | 'value' => sprintf( |
| | 368 | /* translators: %s: ini_get() */ |
| | 369 | __( 'Unable to determine some settings, as the %s function has been disabled.' ), |
| | 370 | 'ini_get()' |
| | 371 | ), |
| | 372 | 'debug' => 'ini_get() is disabled', |
| | 373 | ); |
| | 374 | } else { |
| | 375 | $post_max_size = static::parseIniSize( ini_get( 'post_max_size' ) ); |
| | 376 | $upload_max_size = static::parseIniSize( ini_get( 'upload_max_filesize' ) ); |
| | 377 | $max_file_uploads = (int) ini_get( 'max_file_uploads' ); |
| | 378 | $effective = min( $post_max_size, $upload_max_size ); |
| | 379 | |
| | 380 | $info['wp-uploads']['fields']['file_uploads'] = array( |
| | 381 | 'label' => __( 'File uploads' ), |
| | 382 | 'value' => ini_get( 'file_uploads' ) === '1' ? __( 'Enabled' ) : __( 'Disabled' ), |
| | 383 | 'debug' => 'ini_get() is disabled', |
| | 384 | ); |
| | 385 | $info['wp-uploads']['fields']['post_max_size'] = array( |
| | 386 | 'label' => __( 'Max size of post data allowed' ), |
| | 387 | 'value' => size_format( $post_max_size ), |
| | 388 | ); |
| | 389 | $info['wp-uploads']['fields']['upload_max_filesize'] = array( |
| | 390 | 'label' => __( 'Max size of an uploaded file' ), |
| | 391 | 'value' => size_format( $upload_max_size ), |
| | 392 | ); |
| | 393 | $info['wp-uploads']['fields']['upload_max'] = array( |
| | 394 | 'label' => __( 'Maximum effective file size' ), |
| | 395 | 'value' => size_format( $effective ), |
| | 396 | ); |
| | 397 | $info['wp-uploads']['fields']['max_file_uploads'] = array( |
| | 398 | 'label' => __( 'Maximum number of files allowed' ), |
| | 399 | 'value' => number_format( $max_file_uploads ), |
| | 400 | ); |
| | 401 | } |
| | 402 | |