| 1 |
<?php |
| 2 |
/* |
| 3 |
+=====================================================================+ |
| 4 |
| ____ _ ____ __ _ _ | |
| 5 |
| / ___|___ __| | ___ | _ \ _ __ ___ / _(_) | ___ _ __ | |
| 6 |
| | | / _ \ / _` |/ _ \ | |_) | '__/ _ \| |_| | |/ _ \ '__| | |
| 7 |
| | |__| (_) | (_| | __/ | __/| | | (_) | _| | | __/ | | |
| 8 |
| \____\___/ \__,_|\___| |_| |_| \___/|_| |_|_|\___|_| | |
| 9 |
| | |
| 10 |
| (c) Jerome Bruandet ~ https://code-profiler.com/ | |
| 11 |
+=====================================================================+ |
| 12 |
*/ |
| 13 |
|
| 14 |
if (! defined( 'ABSPATH' ) ) { die( 'Forbidden' ); } |
| 15 |
|
| 16 |
// ===================================================================== |
| 17 |
// Display contextual help below each chart and table. |
| 18 |
|
| 19 |
if ( $type == 'slugs' ) { |
| 20 |
|
| 21 |
?> |
| 22 |
<table class="widefat"> |
| 23 |
<tr> |
| 24 |
<td><h4><?php echo esc_html( $section_list[ $section ] ) ?></h4> |
| 25 |
<p> |
| 26 |
<?php esc_html_e('This chart shows the execution time of all activated plugins and the current theme, in seconds and percentage, for the current profile.', 'code-profiler' ) ?> |
| 27 |
</p> |
| 28 |
</td> |
| 29 |
</tr> |
| 30 |
</table> |
| 31 |
<?php |
| 32 |
|
| 33 |
} elseif ( $type == 'iostats' ) { |
| 34 |
|
| 35 |
?> |
| 36 |
<table class="widefat"> |
| 37 |
<tr> |
| 38 |
<td><h4><?php echo esc_html( $section_list[ $section ] ) ?></h4> |
| 39 |
<p><?php esc_html_e('The chart displays all file I/O operations that occurred while your website was loading. The following operations are monitored by Code Profiler:', 'code-profiler' ) ?></p> |
| 40 |
<table class="widefat" style="border:none;box-shadow:none"> |
| 41 |
<tr> |
| 42 |
<td style="width:50%"> |
| 43 |
<code>cast</code>: <?php esc_html_e('Retrieve the underlaying resource (stream_select).', 'code-profiler' ) ?> |
| 44 |
</td> |
| 45 |
<td style="width:50%"> |
| 46 |
<code>chgrp</code>: <?php esc_html_e('Change file group.', 'code-profiler' ) ?> |
| 47 |
</td> |
| 48 |
</tr> |
| 49 |
<tr> |
| 50 |
<td> |
| 51 |
<code>chmod</code>: <?php esc_html_e('Change file mode.', 'code-profiler' ) ?> |
| 52 |
</td> |
| 53 |
<td> |
| 54 |
<code>chown</code>: <?php esc_html_e('Change file owner.', 'code-profiler' ) ?> |
| 55 |
</td> |
| 56 |
</tr> |
| 57 |
<tr> |
| 58 |
<td> |
| 59 |
<code>close</code>: <?php esc_html_e('Close a resource (fclose).', 'code-profiler' ) ?> |
| 60 |
</td> |
| 61 |
<td> |
| 62 |
<code>closedir</code>: <?php esc_html_e('Close directory handle.', 'code-profiler' ) ?> |
| 63 |
</td> |
| 64 |
</tr> |
| 65 |
<tr> |
| 66 |
<td> |
| 67 |
<code>eof</code>: <?php esc_html_e('Test for end-of-file on a file pointer (feof).', 'code-profiler' ) ?> |
| 68 |
</td> |
| 69 |
<td> |
| 70 |
<code>flush</code>: <?php esc_html_e('Flush the output (fflush).', 'code-profiler' ) ?> |
| 71 |
</td> |
| 72 |
</tr> |
| 73 |
<tr> |
| 74 |
<td> |
| 75 |
<code>lock</code>: <?php esc_html_e('Advisory file locking (flock).', 'code-profiler' ) ?> |
| 76 |
</td> |
| 77 |
<td> |
| 78 |
<code>mkdir</code>: <?php esc_html_e('Create a directory.', 'code-profiler' ) ?> |
| 79 |
</td> |
| 80 |
</tr> |
| 81 |
<tr> |
| 82 |
<td> |
| 83 |
<code>open</code>: <?php esc_html_e('Open file (e.g., fopen, file_get_contents).', 'code-profiler' ) ?> |
| 84 |
</td> |
| 85 |
<td> |
| 86 |
<code>opendir</code>: <?php esc_html_e('Open directory handle.', 'code-profiler' ) ?> |
| 87 |
</td> |
| 88 |
</tr> |
| 89 |
<tr> |
| 90 |
<td> |
| 91 |
<code>read</code>: <?php esc_html_e('Read from stream (e.g., fread, fgets).', 'code-profiler' ) ?> |
| 92 |
</td> |
| 93 |
<td> |
| 94 |
<code>readdir</code>: <?php esc_html_e('Read entry from directory handle.', 'code-profiler' ) ?> |
| 95 |
</td> |
| 96 |
<tr> |
| 97 |
<tr> |
| 98 |
<td> |
| 99 |
<code>rename</code>: <?php esc_html_e('Rename a file or directory.', 'code-profiler' ) ?> |
| 100 |
</td> |
| 101 |
<td> |
| 102 |
<code>rewinddir</code>: <?php esc_html_e('Rewind directory handle.', 'code-profiler' ) ?> |
| 103 |
</td> |
| 104 |
</tr> |
| 105 |
<tr> |
| 106 |
<td> |
| 107 |
<code>rmdir</code>: <?php esc_html_e('Remove a directory.', 'code-profiler' ) ?> |
| 108 |
</td> |
| 109 |
<td> |
| 110 |
<code>seek</code>: <?php esc_html_e('Seek to specific location in a stream (fseek).', 'code-profiler' ) ?> |
| 111 |
</td> |
| 112 |
</tr> |
| 113 |
<tr> |
| 114 |
<td> |
| 115 |
<code>set_option</code>: <?php esc_html_e('Change stream options.', 'code-profiler' ) ?> |
| 116 |
</td><td> |
| 117 |
<code>stat</code>: <?php esc_html_e('Retrieve information about a file resource (fstat).', 'code-profiler' ) ?> |
| 118 |
</td> |
| 119 |
</tr> |
| 120 |
<tr> |
| 121 |
<td> |
| 122 |
<code>tell</code>: <?php esc_html_e('Retrieve the current position of a stream. (fseek).', 'code-profiler' ) ?> |
| 123 |
</td><td> |
| 124 |
<code>truncate</code>: <?php esc_html_e('Truncate stream (ftruncate).', 'code-profiler' ) ?> |
| 125 |
</td> |
| 126 |
</tr> |
| 127 |
<tr> |
| 128 |
<td> |
| 129 |
<code>touch</code>: <?php esc_html_e('Set access and modification time of file.', 'code-profiler' ) ?> |
| 130 |
</td> |
| 131 |
<td> |
| 132 |
<code>unlink</code>: <?php esc_html_e('Delete a file.', 'code-profiler' ) ?> |
| 133 |
</td> |
| 134 |
</tr> |
| 135 |
<tr> |
| 136 |
<td> |
| 137 |
<code>url_stat</code>: <?php esc_html_e('Retrieve information about a file. This method is called in response to all stat related functions, such as copy, filesize, filetype, is_dir, is_file, file_exists etc.', 'code-profiler' ) ?> |
| 138 |
</td> |
| 139 |
<td> |
| 140 |
<code>write</code>: <?php esc_html_e('Write to stream (fwrite).', 'code-profiler' ) ?> |
| 141 |
</td> |
| 142 |
</tr> |
| 143 |
</table> |
| 144 |
</td> |
| 145 |
</tr> |
| 146 |
</table> |
| 147 |
<?php |
| 148 |
|
| 149 |
} elseif ( $type == 'diskio' ) { |
| 150 |
|
| 151 |
?> |
| 152 |
<table class="widefat"> |
| 153 |
<tr> |
| 154 |
<td><h4><?php echo esc_html( $section_list[ $section ] ) ?></h4> |
| 155 |
<p><?php esc_html_e('The chart shows the total amount of disk I/O read and write data, in bytes, that occurred while your website was loading. It includes all activated plugins, the current theme and also WordPress.', 'code-profiler' ) ?></p> |
| 156 |
|
| 157 |
</td> |
| 158 |
</tr> |
| 159 |
</table> |
| 160 |
<?php |
| 161 |
|
| 162 |
// Profiles list |
| 163 |
} elseif ( $type == 'profiles_list' ) { |
| 164 |
|
| 165 |
?> |
| 166 |
<table class="widefat"> |
| 167 |
<tr> |
| 168 |
<td><h4><?php esc_html_e('Profiles List', 'code-profiler') ?></h4> |
| 169 |
<p><?php esc_html_e('This page shows all saved profiles with sortable columns:', 'code-profiler') ?></p> |
| 170 |
<ul class="license-help-view" style="font-size:15px;"> |
| 171 |
<li><?php esc_html_e('Profile: name of the saved profile.', 'code-profiler') ?></li> |
| 172 |
<li><?php esc_html_e('Date: creation date of the profile.', 'code-profiler') ?></li> |
| 173 |
<li><?php esc_html_e('Items: number of plugins + the current theme.', 'code-profiler') ?></li> |
| 174 |
<li><?php esc_html_e('Time: execution time in second.', 'code-profiler') ?></li> |
| 175 |
<li><?php esc_html_e('Memory: peak memory in megabytes.', 'code-profiler') ?></li> |
| 176 |
<li><?php esc_html_e('File I/O: sum of all file I/O operations.', 'code-profiler') ?></li> |
| 177 |
<li><?php esc_html_e('SQL: sum of database queries (WordPress, all plugins and the theme).', 'code-profiler') ?></li> |
| 178 |
</ul> |
| 179 |
</td> |
| 180 |
</tr> |
| 181 |
</table> |
| 182 |
<?php |
| 183 |
} |
| 184 |
// ===================================================================== |
| 185 |
// EOF |
| 186 |
|