From 410afb75542909fb9838fbb87465071667669f02 Mon Sep 17 00:00:00 2001 From: Justin Foell <630830+jrfoell@users.noreply.github.com> Date: Fri, 26 Nov 2021 09:47:16 -0600 Subject: [PATCH] Added API post debugging --- src/WPStrava/API.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/WPStrava/API.php b/src/WPStrava/API.php index e756e8d..6e632c5 100755 --- a/src/WPStrava/API.php +++ b/src/WPStrava/API.php @@ -45,6 +45,21 @@ class WPStrava_API { $response = wp_remote_post( $url . $uri, $args ); + if ( WPSTRAVA_DEBUG ) { + // phpcs:disable WordPress.PHP.DevelopmentFunctions -- Debug output. + error_log( + print_r( + array( + 'url' => $url . $uri, + 'args' => $args, + 'response' => $response, + ), + true + ) + ); + // phpcs:enable + } + if ( is_wp_error( $response ) ) { throw WPStrava_Exception::from_wp_error( $response ); }