Exception
8 years ago
Interval
8 years ago
Timezone
7 years ago
views
3 weeks ago
Config.php
8 years ago
Connection.php
8 years ago
Export.php
3 weeks ago
LicensingManager.php
1 year ago
Scheduling.php
1 year ago
SchedulingApi.php
3 years ago
Connection.php
29 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Wpae\Scheduling; |
| 4 | |
| 5 | |
| 6 | class Connection |
| 7 | { |
| 8 | public function checkConnection() |
| 9 | { |
| 10 | $response = wp_remote_request( |
| 11 | |
| 12 | $this->getApiUrl('connection'), |
| 13 | array( |
| 14 | 'method' => 'GET', |
| 15 | 'body' => \json_encode(array(get_site_url())) |
| 16 | ) |
| 17 | ); |
| 18 | |
| 19 | if($response instanceof \WP_Error) { |
| 20 | return false; |
| 21 | } |
| 22 | |
| 23 | if ($response['response']['code'] == 200) { |
| 24 | return true; |
| 25 | } else { |
| 26 | return false; |
| 27 | } |
| 28 | } |
| 29 | } |