PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / trunk
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel vtrunk
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / src / Scheduling / LicensingManager.php
wp-all-export / src / Scheduling Last commit date
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
LicensingManager.php
71 lines
1 <?php
2
3 namespace Wpae\Scheduling;
4
5
6 class LicensingManager
7 {
8 private $options = false;
9
10 public function checkLicense($licenseKey, $productName)
11 {
12
13 if ($productName !== false) {
14 // data to send in our API request
15 $api_params = array(
16 'edd_action' => 'activate_license',
17 'license' => \PMXE_Plugin::decode($licenseKey),
18 'item_name' => urlencode($productName) // the name of our product in EDD
19 );
20
21 // Call the custom API.
22 $response = wp_remote_get(
23 esc_url_raw(add_query_arg(
24 $api_params,
25 $this->getInfoApiUrl()
26 )),
27 array(
28 'timeout' => 15,
29 'sslverify' => false
30 )
31 );
32
33 // make sure the response came back okay
34 if (is_wp_error($response)){
35 return ['success' => false];
36 }
37
38 $responseData = \json_decode($response['body'], true);
39
40 if(is_null($responseData) || empty($responseData['success'])) {
41 return $responseData ?? ['success' => false];
42 } else {
43 return $responseData;
44 }
45 } else {
46 return ['success' => false];
47 }
48 }
49
50 public function getLicense()
51 {
52 $options = $this->getOptions();
53 return $options['license'];
54 }
55
56 public function getInfoApiUrl()
57 {
58 $options = $this->getOptions();
59 return $options['info_api_url'];
60 }
61
62 private function getOptions()
63 {
64 // Cache the options
65 if(!$this->options) {
66 $this->options = \PMXE_Plugin::getInstance()->getOption();
67 }
68
69 return $this->options;
70 }
71 }