• Hi,

    I am using this function:

    if ( wp_doing_ajax() ){
    
    //  $ajax_action = $_REQUEST['action'];
    // get actions and timestamp --> store it to a json or txt file
    
    }

    That way I can trace or count how many ajax actions is calling in my website.

    Questions:

    1.) What are other functions or hooks other that wp_doing_ajax to track performance issues?

    2.) wp_doing_ajax and $ajax_action = $_REQUEST[‘action’] <– Is there a way to check how long is that specific action took place? Example: action called ‘heartbeat’ took 0.5 second.

    3.) Is there a way to know which plugin or theme calling those actions?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I would use my browser’s developer tools to evaluate Ajax request performance. I usually use the “network” tab. “Performance” tab is the obvious choice, but I’ve not used it.

    With the network tab, you can see the request’s “action” value. It’s used to construct the action hooked to in PHP. If you can find the code (through grep or similar) that hooks that action (using add_action()), you’ve found the module responsible for the call.

Viewing 1 replies (of 1 total)
  • The topic ‘Hooks or functions to trace performance issues.’ is closed to new replies.