Skip to content

Instantly share code, notes, and snippets.

@nextgenthemes
nextgenthemes / debug-http-request.php
Created March 26, 2024 21:15 — forked from maheshwaghmare/debug-http-request.php
Debug the HTTP requests in WordPress wp_remote_post() or wp_remote_get() with the help of `http_api_debug` hook.
<?php
/**
* Debug HTTP requests in WordPress
*
* Fires after an HTTP API response is received and before the response is returned.
*
* Output in `wp-content\debug.log` file:
*
* [24-Apr-2019 06:50:16 UTC] ------------------------------
* [24-Apr-2019 06:50:16 UTC] https://downloads.wordpress.org/plugin/elementor.2.5.14.zip