PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 3.1.0
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v3.1.0
4.9.2 4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / libs / license / license-route.php
shopengine / libs / license Last commit date
helper.php 3 years ago license-route.php 3 years ago
license-route.php
84 lines
1 <?php
2
3 namespace ShopEngine\Libs\License;
4
5
6 class License_Route extends \ShopEngine\Base\Api {
7
8 public function config() {
9
10 $this->prefix = 'license';
11 $this->param = "";
12 }
13
14
15 /**
16 * /shopengine-builder/v1/license/deactive
17 *
18 * http://localhost/shopengine/pro/wp-json/shopengine-builder/v1/license/post_deactive
19 */
20 public function post_deactive() {
21
22 $res = Helper::instance()->deactivate();
23
24 //wp_redirect('https://account.wpmet.com/?wpmet-screen=products'); exit;
25
26 return [
27 'success' => 'ok',
28 'msg' => esc_html__('Successfully deactivated', 'shopengine'),
29 ];
30 }
31
32 /**
33 * /shopengine-builder/v1/license/activate
34 *
35 * http://localhost/shopengine/pro/wp-json/shopengine-builder/v1/license/activate
36 */
37 public function post_activate() {
38
39 $data = json_decode($this->request->get_body(), true);
40
41 if(empty($data['license_key'])) {
42
43 return [
44 'success' => 'danger',
45 'dt' => $data,
46 'msg' => esc_html__('License key is empty', 'shopengine'),
47 ];
48 }
49
50 $res = Helper::instance()->activate($data['license_key']);
51
52 if(!empty($res->is_activated)) {
53
54 return [
55 'success' => 'ok',
56 'dt' => $res,
57 'msg' => esc_html__('Successfully activated', 'shopengine'),
58 ];
59 }
60
61 if(!empty($res->error)) {
62 return [
63 'success' => 'danger',
64 'msg' => $res->message,
65 ];
66 }
67
68 return [
69 'success' => 'danger',
70 'msg' => esc_html__('Unsupported pro version', 'shopengine'),
71 ];
72 }
73
74 /**
75 * /shopengine-builder/v1/license/test
76 *
77 * http://localhost/shopengine/pro/wp-json/shopengine-builder/v1/license/test
78 */
79 public function get_test() {
80
81 echo 'hello....';
82 }
83 }
84