PluginProbe
Code Profiler – WordPress Performance Profiling and Debugging Made Easy / 1.7.4
Code Profiler – WordPress Performance Profiling and Debugging Made Easy v1.7.4
1.9.5 1.9.4 1.9.3 trunk 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.6 1.6.1 1.6.10 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 All 40 releases
← All changes | lib/menu_settings.php +40 -17 1.6.41.7.4 View file →
@@ -6,13 +6,15 @@
6 6 | | | / _ \ / _` |/ _ \ | |_) | '__/ _ \| |_| | |/ _ \ '__| |
7 7 | | |__| (_) | (_| | __/ | __/| | | (_) | _| | | __/ | |
8 8 | \____\___/ \__,_|\___| |_| |_| \___/|_| |_|_|\___|_| |
9 9 | |
10 - | (c) Jerome Bruandet ~ https://code-profiler.com/ |
10 + | (c) Jerome Bruandet ~ https://nintechnet.com/codeprofiler/ |
11 11 +=====================================================================+
12 12 */
13 13
14 -if (! defined('ABSPATH') ) { die('Forbidden'); }
14 +if (! defined('ABSPATH') ) {
15 + die('Forbidden');
16 +}
15 17
16 18 // =====================================================================
17 19 // Display Summary tab.
18 20
@@ -20,17 +22,25 @@
20 22
21 23 // Save settings?
22 24 if (! empty( $_POST['save-settings'] ) ) {
23 25 // Make sure we have security nonce
24 - if ( empty( $_POST['cp-save-settings'] ) || ! wp_verify_nonce($_POST['cp-save-settings'], 'cp_settings') ) {
26 + if ( empty( $_POST['cp-save-settings'] ) ||
27 + ! wp_verify_nonce($_POST['cp-save-settings'], 'cp_settings') ) {
28 +
25 29 wp_nonce_ays('cp_settings');
26 30 }
27 31 $res = code_profiler_save_settings();
28 32 if ( $res === true ) {
29 - printf( CODE_PROFILER_UPDATE_NOTICE, esc_html__('Your changes have been saved.', 'code-profiler') );
33 + printf(
34 + CODE_PROFILER_UPDATE_NOTICE,
35 + esc_html__('Your changes have been saved.', 'code-profiler')
36 + );
30 37 }
31 38 else {
32 - printf( CODE_PROFILER_ERROR_NOTICE, esc_html__('No changes were detected.', 'code-profiler') );
39 + printf(
40 + CODE_PROFILER_ERROR_NOTICE,
41 + esc_html__('No changes were detected.', 'code-profiler')
42 + );
33 43 }
34 44 }
35 45
36 46 // Fetch current options
@@ -42,9 +52,11 @@
42 52 <table class="form-table">
43 53 <?php
44 54
45 55 // Paths
46 - if ( empty( $cp_options['show_paths'] ) || ! in_array( $cp_options['show_paths'], ['absolute', 'relative' ] ) ) {
56 + if ( empty( $cp_options['show_paths'] ) ||
57 + ! in_array( $cp_options['show_paths'], ['absolute', 'relative' ] ) ) {
58 +
47 59 $cp_options['show_paths'] = 'relative';
48 60 }
49 61 ?>
50 62 <tr>
@@ -56,13 +68,17 @@
56 68 </tr>
57 69
58 70 <?php
59 71 // Name vs slug
60 - if ( empty( $cp_options['display_name'] ) || ! in_array( $cp_options['display_name'], ['full', 'slug' ] ) ) {
72 + if ( empty( $cp_options['display_name'] ) ||
73 + ! in_array( $cp_options['display_name'], ['full', 'slug' ] ) ) {
74 +
61 75 $cp_options['display_name'] = 'full';
62 76 }
63 77 // Truncate names
64 - if ( empty( $cp_options['truncate_name'] ) || ! preg_match('/^\d+$/', ( $cp_options['truncate_name'] ) ) ) {
78 + if ( empty( $cp_options['truncate_name'] ) ||
79 + ! preg_match('/^\d+$/', ( $cp_options['truncate_name'] ) ) ) {
80 +
65 81 $cp_options['truncate_name'] = 30;
66 82 }
67 83 ?>
68 84 <tr>
@@ -82,13 +98,17 @@
82 98 </tr>
83 99
84 100 <?php
85 101 // chart type
86 - if ( empty( $cp_options['chart_type'] ) || ! in_array( $cp_options['chart_type'], ['x', 'y' ] ) ) {
102 + if ( empty( $cp_options['chart_type'] ) ||
103 + ! in_array( $cp_options['chart_type'], ['x', 'y' ] ) ) {
104 +
87 105 $cp_options['chart_type'] = 'x';
88 106 }
89 107 // Max plugins to display
90 - if ( empty( $cp_options['chart_max_plugins'] ) || ! preg_match('/^\d+$/', ( $cp_options['chart_max_plugins'] ) ) ) {
108 + if ( empty( $cp_options['chart_max_plugins'] ) ||
109 + ! preg_match('/^\d+$/', ( $cp_options['chart_max_plugins'] ) ) ) {
110 +
91 111 $cp_options['chart_max_plugins'] = 25;
92 112 }
93 113 // Empty values
94 114 if (! empty( $cp_options['hide_empty_value'] ) ) {
@@ -191,20 +211,23 @@
191 211 <p><label><input type="checkbox" name="cp_options[http_response_400]" value="1"<?php checked( $http_response_400, '1') ?> /><?php esc_html_e('4xx client errors (400 Bad Request, 403 Forbidden, 404 Not Found etc)','code-profiler') ?></label></p>
192 212 <p><label><input type="checkbox" name="cp_options[http_response_500]" value="1"<?php checked( $http_response_500, '1') ?> /><?php esc_html_e('5xx server errors (500 Internal Server Error, 503 Service Unavailable etc)','code-profiler') ?></label></p>
193 213 </td>
194 214 </tr>
215 + </table>
216 +
217 + <h3><?php esc_html_e('Profiler','code-profiler') ?></h3>
218 + <table class="form-table">
195 219 <?php
196 220 // Accuracy
197 - if ( empty( $cp_options['accuracy'] ) || ! preg_match('/^(?:1|5|10|15|20)$/D', $cp_options['accuracy'] ) ) {
221 + if ( empty( $cp_options['accuracy'] ) ||
222 + ! preg_match('/^(?:1|5|10|15|20)$/D', $cp_options['accuracy'] ) ) {
223 +
198 224 $cp_options['accuracy'] = 1;
199 225 }
200 226 ?>
201 227 <tr>
202 228 <th scope="row"><?php esc_html_e('Accuracy & Precision', 'code-profiler') ?> <span class="code-profiler-tip" data-tip="<?php
203 - printf(
204 - esc_attr__('When accuracy is set to the highest level, Code Profiler runs as a %s Tracing profiler %s, and when accuracy is set to a lower level, it runs as a %s Sampling profiler %s.', 'code-profiler'),
205 - '<em>', '</em>','<em>', '</em>'
206 - );
229 + esc_attr_e('When accuracy is set to the highest level, Code Profiler runs as a "tracing profiler", and when accuracy is set to a lower level, it runs as a "sampling profiler".', 'code-profiler');
207 230 echo '<br />';
208 231 esc_attr_e('Selecting a high accuracy level is preferred and will work on most sites, but the profiling process will take longer to execute as opposed to choosing a lower accuracy level. If you have a slow WordPress site with a lot of plugins installed and your server or reverse proxy is timing out when Code Profiler is running (e.g., "503 Service Unavailable" or "504 Gateway Timeout" error), try to lower the accuracy level in order to speed up the profiling process and avoid the server timeout.', 'code-profiler');
209 232 ?>"></span></th>
210 233 <td>
@@ -226,9 +249,9 @@
226 249 }
227 250 ?>
228 251 <tr>
229 252 <th scope="row"><?php esc_html_e('Buffer size', 'code-profiler') ?> <span class="code-profiler-tip" data-tip="<?php
230 - esc_attr_e('When running, the profiler collects data and saves it to a memory buffer. When the buffer is full, the data is written to disk. If your site uses too much memory and throws a PHP memory error, you can try to lower that value.', 'code-profiler');
253 + esc_attr_e('When running, the profiler collects data and saves it to a memory buffer. When the buffer is full, the data is written to disk. If your site uses too much memory and PHP throws a memory error, you can try to lower that value.', 'code-profiler');
231 254 ?>"></span></th>
232 255 <td>
233 256 <p>
234 257 <label>
@@ -258,9 +281,9 @@
258 281 </td>
259 282 </tr>
260 283 </table>
261 284
262 - <p><input type="submit" name="save-settings" class="button-primary" value="<?php esc_attr_e('Save Settings', 'code-profiler') ?>" /></p>
285 + <p><input type="submit" name="save-settings" class="button button-primary" value="<?php esc_attr_e('Save Settings', 'code-profiler') ?>" /></p>
263 286
264 287 </form>
265 288 <?php
266 289