Title: Persistent 401 errors
Last modified: July 16, 2025

---

# Persistent 401 errors

 *  Resolved [jakethesnake3p0](https://wordpress.org/support/users/jakethesnake3p0/)
 * (@jakethesnake3p0)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/persistent-401-errors/)
 * In the admin dashboard I’m seeing in Query Monitor that there are a couple pairs
   of HEAD and GET requests being made each time I load the page, and both fail 
   with 401 Unauthorized – which makes sense in a way given that my site is behind
   HTTP AUTH (staging site), but also doesn’t make sense given that it’s the page
   that’s making the request… I figured the plugin would give up on the requests
   after some time, but repeated page loads indicate no change in behavior. I think
   at a minimum, this plugin should have an enable/disable setting
 * dfehc_perform_response_measurements() is the calling function with …/wp-json/?
   _dfehc_ts=… as the URL

Viewing 1 replies (of 1 total)

 *  Plugin Support [codeloghin](https://wordpress.org/support/users/codeloghin/)
 * (@codeloghin)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/persistent-401-errors/#post-18558938)
 * Hi there,
 * Thank you for reaching out. I appreciate your feedback.
 * The plugin probes your own site’s REST endpoint to work out a baseline response
   time:
    1. It builds `https://example.com/wp-json/?_dfehc_ts=...`.
    2. It tries **`wp_remote_head()`** first (quick, no body).
    3. If that fails it falls back to **`wp_remote_get()`**.
 * Because your staging site is protected by **HTTP Basic Auth**, WordPress’s HTTP
   API sends the probe **without** any `Authorization:` header, so Apache/Nginx 
   responds with **401**.
   From WordPress’s point of view this looks like a broken
   request, but the plugin simply notes the failure and falls back to the default
   response time. Nothing on the front end breaks, you just get extra noise in Query
   Monitor.To mitigate this on your staging setup, you can integrate the following
   filters either at the end of the heartbeat-controller.php file in the main plugin
   directory or your main functions.php file:
 * add_filter( ‘dfehc_request_pause_us’, 0 );
   add_filter( ‘dfehc_num_requests’, 
   1 );
 * If you have any other questions or if you still experience any issues, feel free
   to reach out.
   Best regards,

Viewing 1 replies (of 1 total)

The topic ‘Persistent 401 errors’ is closed to new replies.

 * ![](https://ps.w.org/dynamic-front-end-heartbeat-control/assets/icon-256x256.
   gif?rev=3322232)
 * [Dynamic Front-End Heartbeat Control](https://wordpress.org/plugins/dynamic-front-end-heartbeat-control/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dynamic-front-end-heartbeat-control/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dynamic-front-end-heartbeat-control/)
 * [Active Topics](https://wordpress.org/support/plugin/dynamic-front-end-heartbeat-control/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dynamic-front-end-heartbeat-control/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dynamic-front-end-heartbeat-control/reviews/)

## Tags

 * [unauthorized](https://wordpress.org/support/topic-tag/unauthorized/)

 * 1 reply
 * 2 participants
 * Last reply from: [codeloghin](https://wordpress.org/support/users/codeloghin/)
 * Last activity: [10 months, 2 weeks ago](https://wordpress.org/support/topic/persistent-401-errors/#post-18558938)
 * Status: resolved