'', 'media_category' => 'shared-storage', 'max_upload_size' => 1073741824, // 1GB default )); // Get total storage usage global $wpdb; $table_name = $wpdb->prefix . QDR_TSS_PLUGIN_TABLE; $total_size = $wpdb->get_var("SELECT SUM(file_size) FROM $table_name"); $total_size = $total_size ? intval($total_size) : 0; $max_size = isset($settings['max_upload_size']) ? intval($settings['max_upload_size']) : 1073741824; $usage_percent = ($max_size > 0) ? min(100, ($total_size / $max_size) * 100) : 0; ?>
/ (%)