PluginProbe
Route ‑ Shipping Protection / 2.2.4
Route ‑ Shipping Protection v2.2.4
2.4.17 2.4.16 2.4.15 2.4.14 2.4.13 2.4.12 2.4.11 2.4.10 2.4.9 2.4.8 2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.2.4 2.2.5 2.2.6 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 All 151 releases
routeapp / includes / class-routeapp-api-compatibility.php

class-routeapp-api-compatibility.php in Route ‑ Shipping Protection 2.2.4, at includes/class-routeapp-api-compatibility.php

57 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WooCommerce Routeapp API Client Class
4 *
5 * @link https://route.com/
6 * @since 1.0.0
7 *
8 * @package Routeapp
9 * @subpackage Routeapp/includes
10 */
11
12 class Routeapp_API_Compatibility extends Routeapp_API_Client
13 {
14
15 const API_ENDPOINT = 'partner-integration/plugin-status';
16 const HTTP_SUCCESS_CODE = 200;
17
18 /**
19 * Send compatibility report
20 *
21 * @param $data
22 * @return mixed
23 */
24 public function send($data)
25 {
26 try {
27
28 $response = $this->_make_private_api_call(self::API_ENDPOINT, $data, 'POST');
29
30 if (is_wp_error($response)) {
31 throw new Exception("Compatibility endpoint has failed: " . $response->get_error_message());
32 }
33
34 if (wp_remote_retrieve_response_code($response) != self::HTTP_SUCCESS_CODE) {
35 throw new Exception("Compatibility endpoint returned an expected error code: " . wp_remote_retrieve_response_code($response));
36 }
37
38 Route_Setup::set_setup_check_widget(Route_Setup::SETUP_CHECK_WIDGET_API_CALL);
39
40 } catch (Exception $exception) {
41 $routeapp_public = self::get_route_public_instance();
42 $routeapp_public->routeapp_log($exception, $this->_extraData);
43 }
44
45 }
46
47 protected function isStorable()
48 {
49 return false;
50 }
51
52 protected function enqueueOperation()
53 {
54 return false;
55 }
56 }
57