# code-profiler/1.7.4/lib/menu_view_diskio.php

Code Profiler – WordPress Performance Profiling and Debugging Made Easy, version 1.7.4. 73 lines.

- Page: https://pluginprobe.com/plugins/code-profiler/1.7.4/code/lib/menu_view_diskio.php
- Raw: https://pluginprobe.com/plugins/code-profiler/1.7.4/raw/lib/menu_view_diskio.php
- Modified: 2025-04-11T06:18:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-profiler/1.7.4/code/lib/menu_view_diskio.php#L10-L20`.

```php
<?php
/*
 +=====================================================================+
 |    ____          _        ____             __ _ _                   |
 |   / ___|___   __| | ___  |  _ \ _ __ ___  / _(_) | ___ _ __         |
 |  | |   / _ \ / _` |/ _ \ | |_) | '__/ _ \| |_| | |/ _ \ '__|        |
 |  | |__| (_) | (_| |  __/ |  __/| | | (_) |  _| | |  __/ |           |
 |   \____\___/ \__,_|\___| |_|   |_|  \___/|_| |_|_|\___|_|           |
 |                                                                     |
 |  (c) Jerome Bruandet ~ https://nintechnet.com/codeprofiler/         |
 +=====================================================================+
*/

if (! defined( 'ABSPATH' ) ) { die( 'Forbidden' ); }

// =====================================================================
// Display File I/O stats.

$buffer = code_profiler_get_profile_data( $profile_path, 'diskio' );
if ( isset( $buffer['error'] ) ) {
	return;
}

// Fetch options
$cp_options = get_option( 'code-profiler' );

// Horizontal vs vertical chart
if ( empty( $cp_options['chart_type'] ) || ! in_array( $cp_options['chart_type'], ['x', 'y' ] ) ) {
	$axis = 'x';
} else {
	$axis = $cp_options['chart_type'];
}

?>
<div style="width:80vw;margin:auto" aria-hidden="true">
	<canvas id="myChart"></canvas>
</div>
<script>
jQuery(document).ready(function() {
	'use strict';
	cpjs_diskio_chart(
		'<?php echo esc_js( $axis ) ?>', [<?php
			echo	"'". 		esc_js( __('I/O Read bytes', 'code-profiler') ) .
					"', '".	esc_js( __('I/O Write bytes', 'code-profiler') ) .
					"'" ?>], [<?php
			echo	"'". 		(int) $buffer[0][1] ."', '". (int) $buffer[1][1] ."'"
		?>]
	);
});
</script>

<!-- Screen-reader only -->
<div class="visually-hidden">
<?php
	echo "<table>\n".
		"\t<tr>\n".
		"\t\t<td>".	esc_html__('I/O Read bytes', 'code-profiler') 		."</td>".
		"<td>".		esc_html__('I/O Write bytes', 'code-profiler') ."</td>\n".
		"\t<tr>\n\t\t<td>". esc_html( number_format( $buffer[0][1] ) ) ."</td>".
		"<td>". esc_html( number_format( $buffer[1][1] ) ) ."</td>\n\t</tr>\n".
		"</table>\n";
?>
</div>
<!-- End of Screen-reader only -->

<?php
// Actions below stats
$save_png   = 1;
$rotate_img = 1;
$type       = 'diskio';
// =====================================================================
// EOF

```
