ÇÙåÇÑ ÇÎØÇÁ ÇáææÑÏÈÑíÓ Displaying PHP Errors from admin-ajax.php in Wordpress
How to Reduce admin-ajax.php Server Load in WordPress
Ajax returning 400 Bad Request (xhr), admin-ajax.php returns '0'?
Error http 500 “admin-ajax.php”
error /wp-admin/admin-ajax.php cause xhr




If you want to see the PHP errors when using ajax, open up the wp-includes/load.php file & on line 336, change this line:
ßæÏ:
  if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() ) {
        @ini_set( 'display_errors', 0 );
    }
to
ßæÏ:
  if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() ) {
        @ini_set( 'display_errors', 1 );
    }
You will now be able to see the ajax errors in your browser console. Remember to undo this when finished debugging!

-------------------------------------------------------------------

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
Define the following constants as such. You will be able to see debug.log under wp-content. I usually leave the debug display off too because it causes the headers already sent problem.
EDIT:

So apparently error reporting is turned off for ajax requests in the last of line of the method wp_debug_mode() in wp-includes/load.php
ßæÏ:
if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() ) {
        @ini_set( 'display_errors', 0 );
    }
https://codex.wordpress.org/Debugging_in_WordPress

ÇáãÑÌÚ:
https://stackoverflow.com/questions/...-wordpress-4-9
https://www.hostinger.com/tutorials/...dmin-ajax-file
https://www.cloudways.com/blog/reduc...oad-wordpress/