PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.3.1
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.3.1
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
← All changes | includes/Core/Util/ApiResponse.php +12 -1 3.1.43.3.1 View file →
@@ -19,11 +19,22 @@
19 19 * @return bool
20 20 */
21 21 public function apiResponse($logID, $integrationId, $apiType, $responseType, $apiResponse, $entryDetails = [])
22 22 {
23 - if (!$apiType || !$apiResponse) {
23 + if (!$apiType) {
24 24 return false;
25 25 }
26 +
27 + // An empty response means a failed HTTP call; log it or the failure leaves no trace.
28 + if (is_wp_error($apiResponse)) {
29 + $apiResponse = [
30 + 'error_code' => $apiResponse->get_error_code(),
31 + 'description' => $apiResponse->get_error_message(),
32 + ];
33 + } elseif (!$apiResponse && !is_array($apiResponse)) {
34 + $apiResponse = ['description' => __('Empty response received from the API.', 'bit-form')];
35 + }
36 +
26 37 $apiType = wp_json_encode($apiType);
27 38 $apiResponse = wp_json_encode($apiResponse);
28 39
29 40 $ipTool = new IpTool();