diff --git a/mu-plugins/utilities/class-helpscout.php b/mu-plugins/utilities/class-helpscout.php index 244f77b2..502cfb4c 100644 --- a/mu-plugins/utilities/class-helpscout.php +++ b/mu-plugins/utilities/class-helpscout.php @@ -15,13 +15,15 @@ class HelpScout { * * @var int */ - public $timeout = 15; + public $timeout = 30; public $name = ''; protected $app_id = ''; protected $app_secret = ''; protected $webhook_secret = ''; + public $last_api_request = false; + /** * Fetch an instance of the HelpScout API. */ @@ -42,11 +44,6 @@ protected function __construct( $app_id, $secret = false, $webhook_secret = fals $app_id = HELPSCOUT_APP_ID; $secret = HELPSCOUT_APP_SECRET; $webhook_secret = HELPSCOUT_WEBHOOK_SECRET_KEY; - } elseif ( 'foundation' === $app_id && defined( 'HELPSCOUT_FOUNDATION_APP_ID' ) ) { - $name = 'foundation'; - $app_id = HELPSCOUT_FOUNDATION_APP_ID; - $secret = HELPSCOUT_FOUNDATION_APP_SECRET; - $webhook_secret = HELPSCOUT_FOUNDATION_WEBHOOK_SECRET_KEY; } $this->name = $name; @@ -178,7 +175,7 @@ public function api( $url, $args = null, $method = 'GET' ) { $body = wp_json_encode( $args ); } - $request = wp_remote_request( + $this->last_api_request = wp_remote_request( $url, array( 'method' => $method, @@ -188,7 +185,7 @@ public function api( $url, $args = null, $method = 'GET' ) { ) ); - return json_decode( wp_remote_retrieve_body( $request ) ); + return json_decode( wp_remote_retrieve_body( $this->last_api_request ) ); } /**