Support » Localhost Installs » 500 POST error http://127.0.0.1/wordpress/wp-admin/admin-ajax.php 5 when making

  • I checked on the internet several ways but none of the sending worked. Any suggestion?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator bcworkz

    (@bcworkz)

    Have you confirmed ajaxurl is assigned the proper URL to admin-ajax.php, and requests are not blocked by any security measure?

    Check the server’s error log for further clues. Either the callback has an error, or it wasn’t properly added to the related action hook.

    Thread Starter eufalo

    (@eufalo)

    [05-Nov-2021 17:06:26 UTC] PHP Stack trace:
    [05-Nov-2021 17:06:26 UTC] PHP 1. {main}() C:\wamp64\www\wordpress\wp-cron.php:0
    [05-Nov-2021 17:06:26 UTC] PHP 2. require_once() C:\wamp64\www\wordpress\wp-cron.php:44
    [05-Nov-2021 17:06:26 UTC] PHP 3. require_once() C:\wamp64\www\wordpress\wp-load.php:50
    [05-Nov-2021 17:06:26 UTC] PHP 4. require_once() C:\wamp64\www\wordpress\wp-config.php:102
    [05-Nov-2021 17:06:26 UTC] PHP 5. include_once() C:\wamp64\www\wordpress\wp-settings.php:409
    [05-Nov-2021 17:06:26 UTC] PHP 6. wp_register_script() C:\wamp64\www\wordpress\wp-content\plugins\master\woocommerce-guru.php:26
    [05-Nov-2021 17:06:26 UTC] PHP 7. _wp_scripts_maybe_doing_it_wrong() C:\wamp64\www\wordpress\wp-includes\functions.wp-scripts.php:174
    [05-Nov-2021 17:06:26 UTC] PHP 8. _doing_it_wrong() C:\wamp64\www\wordpress\wp-includes\functions.wp-scripts.php:67
    [05-Nov-2021 17:06:26 UTC] PHP 9. trigger_error() C:\wamp64\www\wordpress\wp-includes\functions.php:5663
    [05-Nov-2021 17:06:26 UTC] PHP Notice: wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mask_plugin_js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in C:\wamp64\www\wordpress\wp-includes\functions.php on line 5663

    Thread Starter eufalo

    (@eufalo)

    The mistakes are always these

    Moderator bcworkz

    (@bcworkz)

    Whatever plugin belongs to \master\woocommerce-guru.php is trying to register its script too early. To confirm, deactivate the plugin and the errors should cease. Once confirmed, contact the plugin author for suggestions on how to patch their plugin until they can update their code.

    However, I don’t think this is the cause of your 500 Ajax error. If there are no PHP errors logged related to the Ajax call, and if my previous ajaxurl question checked out, then you’re doing something server side that WP doesn’t like even if it doesn’t trigger a PHP error. Review how server side Ajax in WP is supposed to work:
    https://developer.wordpress.org/plugins/javascript/enqueuing/#ajax-action

    Thread Starter eufalo

    (@eufalo)

    I understand, so the problem will be mine because the plugin comes from the company. But it already worked here and stopped overnight. Yes, I will review his ajax, but I find it difficult to understand the reason, even more so if it stopped overnight without any modification.

    Moderator bcworkz

    (@bcworkz)

    Well, something changed overnight. Software update, file corruption, IDK? Unfortunately a 500 status doesn’t tell us much. Narrow down where the problem is in the PHP Ajax handler. Insert debug code that echoes a message and exits at different steps. Modify the jQuery to alert a response when there is no OK status so you can see the debug message.

    If you add debug code as the very first handler code and still get 500 status, then the Ajax handler wasn’t properly added as an action callback. Usually because the action hook is incorrect as it relates to the “action” value sent from the jQuery script.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.