| @@ -6,9 +6,9 @@ | ||
| 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 | 14 | if (! defined('ABSPATH') ) { |
| @@ -143,14 +143,8 @@ | ||
| 143 | 143 | </td> |
| 144 | 144 | </tr> |
| 145 | 145 | |
| 146 | 146 | <?php |
| 147 | - // Composer warning | |
| 148 | - if (! empty( $cp_options['warn_composer'] ) ) { | |
| 149 | - $cp_options['warn_composer'] = 1; | |
| 150 | - } else { | |
| 151 | - $cp_options['warn_composer'] = 0; | |
| 152 | - } | |
| 153 | 147 | // WP-CLI integration |
| 154 | 148 | if (! empty( $cp_options['enable_wpcli'] ) ) { |
| 155 | 149 | $cp_options['enable_wpcli'] = 1; |
| 156 | 150 | } else { |
| @@ -188,14 +182,8 @@ | ||
| 188 | 182 | ?> |
| 189 | 183 | <tr> |
| 190 | 184 | <th scope="row"><?php esc_html_e('General Options', 'code-profiler') ?></th> |
| 191 | 185 | <td> |
| 192 | - <p><label><input type="checkbox" name="cp_options[warn_composer]"<?php checked( $cp_options['warn_composer'], '1') ?> /><?php esc_html_e('Show a notice when several plugins are using Composer dependency manager.','code-profiler') ?></label></p> | |
| 193 | - | |
| 194 | - <p class="description"><?php esc_html_e('Consult the FAQ tab for more details about this option.', 'code-profiler') ?></p> | |
| 195 | - | |
| 196 | - <br /> | |
| 197 | - | |
| 198 | 186 | <p><label><input type="checkbox" name="cp_options[enable_wpcli]"<?php checked( $cp_options['enable_wpcli'], '1') ?> /><?php esc_html_e('Enable WP-CLI integration.','code-profiler') ?></label></p> |
| 199 | 187 | <p class="description"><?php printf( esc_html__('Enter %s to display the available command line options.', 'code-profiler'), '<code>wp code-profiler help</code>') ?></p> |
| 200 | 188 | |
| 201 | 189 | <br /> |
| @@ -279,8 +267,24 @@ | ||
| 279 | 267 | ); |
| 280 | 268 | ?></p> |
| 281 | 269 | </td> |
| 282 | 270 | </tr> |
| 271 | + <?php | |
| 272 | + if ( empty( $cp_options['php_error'] ) ) { | |
| 273 | + $cp_options['php_error'] = 0; | |
| 274 | + } else { | |
| 275 | + $cp_options['php_error'] = 1; | |
| 276 | + } | |
| 277 | + ?> | |
| 278 | + <tr> | |
| 279 | + <th scope="row"><?php esc_html_e('PHP Error Logging', 'code-profiler') ?> <span class="code-profiler-tip" data-tip="<?php | |
| 280 | + esc_attr_e('This option will enable PHP error logging when the profiler is running. The log will be saved by default to "/wp-content/debug.log", unless you configured PHP or WordPress to use a different path.', 'code-profiler'); | |
| 281 | + ?>"></span> | |
| 282 | + </th> | |
| 283 | + <td> | |
| 284 | + <p><label><input type="checkbox" name="cp_options[php_error]"<?php checked( $cp_options['php_error'], '1') ?> /><?php esc_html_e('Enable PHP error logging.','code-profiler') ?></label></p> | |
| 285 | + </td> | |
| 286 | + </tr> | |
| 283 | 287 | </table> |
| 284 | 288 | |
| 285 | 289 | <p><input type="submit" name="save-settings" class="button button-primary" value="<?php esc_attr_e('Save Settings', 'code-profiler') ?>" /></p> |
| 286 | 290 | |
| @@ -345,15 +349,8 @@ | ||
| 345 | 349 | } else { |
| 346 | 350 | $cp_options['hide_empty_value'] = 0; |
| 347 | 351 | } |
| 348 | 352 | |
| 349 | - // Composer warning | |
| 350 | - if (! empty( $_POST['cp_options']['warn_composer'] ) ) { | |
| 351 | - $cp_options['warn_composer'] = 1; | |
| 352 | - } else { | |
| 353 | - $cp_options['warn_composer'] = 0; | |
| 354 | - } | |
| 355 | - | |
| 356 | 353 | // WP-CLI integration |
| 357 | 354 | if (! empty( $_POST['cp_options']['enable_wpcli'] ) ) { |
| 358 | 355 | $cp_options['enable_wpcli'] = 1; |
| 359 | 356 | } else { |
| @@ -399,8 +396,17 @@ | ||
| 399 | 396 | } elseif (! preg_match('/^(?:[1-9]|10)$/D', $_POST['cp_options']['buffer'] ) ) { |
| 400 | 397 | $cp_options['buffer'] = 10; |
| 401 | 398 | } else { |
| 402 | 399 | $cp_options['buffer'] = (int) $_POST['cp_options']['buffer']; |
| 400 | + } | |
| 401 | + | |
| 402 | + /** | |
| 403 | + * PHP error logging. | |
| 404 | + */ | |
| 405 | + if (! empty( $_POST['cp_options']['php_error'] ) ) { | |
| 406 | + $cp_options['php_error'] = 1; | |
| 407 | + } else { | |
| 408 | + $cp_options['php_error'] = 0; | |
| 403 | 409 | } |
| 404 | 410 | |
| 405 | 411 | return update_option('code-profiler', $cp_options ); |
| 406 | 412 | |