mirror of
https://gh.wpcy.net/https://github.com/szepeviktor/wordpress-website-lifecycle.git
synced 2026-04-24 05:09:10 +08:00
25 lines
665 B
PHP
25 lines
665 B
PHP
<?php
|
|
|
|
/*
|
|
* Plugin Name: Log outbound HTTP requests (DBG)
|
|
* Plugin URI: https://github.com/szepeviktor/wordpress-website-lifecycle
|
|
*/
|
|
|
|
add_action(
|
|
'http_api_debug',
|
|
static function ($response, $context, $class, $parsedArgs, $url) {
|
|
if ($context !== 'response' || $class !== 'WpOrg\Requests\Requests' || is_wp_error($response)) {
|
|
return;
|
|
}
|
|
error_log(
|
|
sprintf(
|
|
'%s: %s (%s)',
|
|
'WordPress outbound HTTP request',
|
|
$url,
|
|
wp_json_encode($parsedArgs, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)
|
|
)
|
|
);
|
|
},
|
|
100,
|
|
5
|
|
);
|