394 | | // Remove accordion for Directories and Sizes if in Multisite. |
395 | | if ( ! $is_multisite ) { |
396 | | $loading = __( 'Loading…' ); |
| 392 | if ( $is_multisite && get_site_option( 'upload_space_check_disabled' ) ) { |
| 393 | $uploads_quota = __( 'Unlimited' ); |
| 394 | } elseif ( $is_multisite && is_main_site() ) { |
| 395 | $uploads_quota = sprintf( |
| 396 | // Translators: 1: The value of Site upload space. |
| 397 | __( '%s MB' ), |
| 398 | get_site_option( 'blog_upload_space', 100 ) |
| 399 | ); |
| 400 | } elseif ( $is_multisite ) { |
| 401 | $uploads_quota = sprintf( |
| 402 | // Translators: 1: The value of Site upload space. |
| 403 | __( '%s MB' ), |
| 404 | get_space_allowed() |
| 405 | ); |
| 406 | } |
| 407 | |
| 408 | if ( $is_multisite ) { |
| 409 | $max_upload_file_size = sprintf( |
| 410 | // Translators: 1: The value of Max upload file size. |
| 411 | __( '%s KB' ), |
| 412 | get_site_option( 'fileupload_maxk', 1500 ) |
| 413 | ); |
| 414 | } |
| 416 | $loading = __( 'Loading…' ); |
| 417 | |
| 418 | if ( ! $is_multisite ) { |
| 419 | $info['wp-paths-sizes']['fields'] = array( |
| 420 | 'wordpress_path' => array( |
| 421 | 'label' => __( 'WordPress directory location' ), |
| 422 | 'value' => untrailingslashit( ABSPATH ), |
| 423 | ), |
| 424 | 'wordpress_size' => array( |
| 425 | 'label' => __( 'WordPress directory size' ), |
| 426 | 'value' => $loading, |
| 427 | 'debug' => 'loading...', |
| 428 | ), |
| 429 | 'uploads_path' => array( |
| 430 | 'label' => __( 'Uploads directory location' ), |
| 431 | 'value' => $upload_dir['basedir'], |
| 432 | ), |
| 433 | 'uploads_size' => array( |
| 434 | 'label' => __( 'Uploads directory size' ), |
| 435 | 'value' => $loading, |
| 436 | 'debug' => 'loading...', |
| 437 | ), |
| 438 | 'themes_path' => array( |
| 439 | 'label' => __( 'Themes directory location' ), |
| 440 | 'value' => get_theme_root(), |
| 441 | ), |
| 442 | 'themes_size' => array( |
| 443 | 'label' => __( 'Themes directory size' ), |
| 444 | 'value' => $loading, |
| 445 | 'debug' => 'loading...', |
| 446 | ), |
| 447 | 'plugins_path' => array( |
| 448 | 'label' => __( 'Plugins directory location' ), |
| 449 | 'value' => WP_PLUGIN_DIR, |
| 450 | ), |
| 451 | 'plugins_size' => array( |
| 452 | 'label' => __( 'Plugins directory size' ), |
| 453 | 'value' => $loading, |
| 454 | 'debug' => 'loading...', |
| 455 | ), |
| 456 | 'database_size' => array( |
| 457 | 'label' => __( 'Database size' ), |
| 458 | 'value' => $loading, |
| 459 | 'debug' => 'loading...', |
| 460 | ), |
| 461 | 'total_size' => array( |
| 462 | 'label' => __( 'Total installation size' ), |
| 463 | 'value' => $loading, |
| 464 | 'debug' => 'loading...', |
| 465 | ), |
| 466 | ); |
| 467 | } elseif ( $is_multisite && is_main_site() ) { |
| 524 | } else { |
| 525 | $info['wp-paths-sizes']['fields'] = array( |
| 526 | 'uploads_path' => array( |
| 527 | 'label' => __( 'Uploads directory location' ), |
| 528 | 'value' => $upload_dir['basedir'], |
| 529 | ), |
| 530 | 'uploads_size' => array( |
| 531 | 'label' => __( 'Uploads directory size' ), |
| 532 | 'value' => $loading, |
| 533 | 'debug' => 'loading...', |
| 534 | ), |
| 535 | 'uploads_quota' => array( |
| 536 | 'label' => __( 'Site upload space' ), |
| 537 | 'value' => $uploads_quota, |
| 538 | ), |
| 539 | 'uploads_max_file_size' => array( |
| 540 | 'label' => __( 'Max upload file size' ), |
| 541 | 'value' => $max_upload_file_size, |
| 542 | ), |
| 543 | ); |
1146 | | $paths = array( |
1147 | | 'wordpress_size' => untrailingslashit( ABSPATH ), |
1148 | | 'themes_size' => get_theme_root(), |
1149 | | 'plugins_size' => WP_PLUGIN_DIR, |
1150 | | 'uploads_size' => $upload_dir['basedir'], |
1151 | | ); |
| 1247 | if ( ! is_multisite() || is_multisite() && is_main_site() ) { |
| 1248 | $paths = array( |
| 1249 | 'wordpress_size' => untrailingslashit( ABSPATH ), |
| 1250 | 'themes_size' => get_theme_root(), |
| 1251 | 'plugins_size' => WP_PLUGIN_DIR, |
| 1252 | 'uploads_size' => $upload_dir['basedir'], |
| 1253 | ); |
| 1254 | } else { |
| 1255 | $paths = array( |
| 1256 | 'uploads_size' => $upload_dir['basedir'], |
| 1257 | ); |
| 1258 | } |
1206 | | $all_sizes['database_size'] = array( |
1207 | | 'raw' => $size_db, |
1208 | | 'size' => $database_size, |
1209 | | 'debug' => $database_size . " ({$size_db} bytes)", |
1210 | | ); |
1211 | | } else { |
1212 | | $all_sizes['database_size'] = array( |
1213 | | 'size' => __( 'Not available' ), |
1214 | | 'debug' => 'not available', |
1215 | | ); |
1216 | | } |
| 1314 | $all_sizes['database_size'] = array( |
| 1315 | 'raw' => $size_db, |
| 1316 | 'size' => $database_size, |
| 1317 | 'debug' => $database_size . " ({$size_db} bytes)", |
| 1318 | ); |
| 1319 | } else { |
| 1320 | $all_sizes['database_size'] = array( |
| 1321 | 'size' => __( 'Not available' ), |
| 1322 | 'debug' => 'not available', |
| 1323 | ); |
| 1324 | } |
1222 | | $all_sizes['total_size'] = array( |
1223 | | 'raw' => $total_size, |
1224 | | 'size' => $total_size_mb, |
1225 | | 'debug' => $total_size_mb . " ({$total_size} bytes)", |
1226 | | ); |
1227 | | } else { |
1228 | | $all_sizes['total_size'] = array( |
1229 | | 'size' => __( 'Total size is not available. Some errors were encountered when determining the size of your installation.' ), |
1230 | | 'debug' => 'not available', |
1231 | | ); |
| 1330 | $all_sizes['total_size'] = array( |
| 1331 | 'raw' => $total_size, |
| 1332 | 'size' => $total_size_mb, |
| 1333 | 'debug' => $total_size_mb . " ({$total_size} bytes)", |
| 1334 | ); |
| 1335 | } else { |
| 1336 | $all_sizes['total_size'] = array( |
| 1337 | 'size' => __( 'Total size is not available. Some errors were encountered when determining the size of your installation.' ), |
| 1338 | 'debug' => 'not available', |
| 1339 | ); |
| 1340 | } |