Skip to content

Instantly share code, notes, and snippets.

@sc0ttkclark
Created August 15, 2022 19:05
Show Gist options
  • Save sc0ttkclark/7bd3a53599fccb68866dd8b6eb12610c to your computer and use it in GitHub Desktop.
Save sc0ttkclark/7bd3a53599fccb68866dd8b6eb12610c to your computer and use it in GitHub Desktop.
A quick handy debugging file for wp-content/php-error.php to expose critical errors more thoroughly. DO NOT LEAVE THIS ON PROD SITES.
<?php
/**
* A quick handy debugging file for wp-content/php-error.php to expose critical errors more thoroughly.
*
* DO NOT LEAVE THIS ON PROD SITES.
*/
echo '<h1>Site PHP Error</h1>';
echo '<pre>';
var_dump( [
'error type' => $error['type'],
'error message' => $error['message'],
'error file' => $error['file'],
'error line' => $error['line'],
'$handled' => $handled,
] );
echo '</pre>';
echo '<h2>Debug backtrace</h2>';
echo '<pre>';
var_dump( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ) );
echo '</pre>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment