PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.7.2
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.7.2
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 4 years ago license-route.php 3 years ago
license-route.php
85 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 $this->only_admin = true;
13 }
14
15
16 /**
17 * /shopengine-builder/v1/license/deactive
18 *
19 * http://localhost/shopengine/pro/wp-json/shopengine-builder/v1/license/post_deactive
20 */
21 public function post_deactive() {
22
23 $res = Helper::instance()->deactivate();
24
25 //wp_redirect('https://account.wpmet.com/?wpmet-screen=products'); exit;
26
27 return [
28 'success' => 'ok',
29 'msg' => esc_html__('Successfully deactivated', 'shopengine'),
30 ];
31 }
32
33 /**
34 * /shopengine-builder/v1/license/activate
35 *
36 * http://localhost/shopengine/pro/wp-json/shopengine-builder/v1/license/activate
37 */
38 public function post_activate() {
39
40 $data = json_decode($this->request->get_body(), true);
41
42 if(empty($data['license_key'])) {
43
44 return [
45 'success' => 'danger',
46 'dt' => $data,
47 'msg' => esc_html__('License key is empty', 'shopengine'),
48 ];
49 }
50
51 $res = Helper::instance()->activate($data['license_key']);
52
53 if(!empty($res->is_activated)) {
54
55 return [
56 'success' => 'ok',
57 'dt' => $res,
58 'msg' => esc_html__('Successfully activated', 'shopengine'),
59 ];
60 }
61
62 if(!empty($res->error)) {
63 return [
64 'success' => 'danger',
65 'msg' => $res->message,
66 ];
67 }
68
69 return [
70 'success' => 'danger',
71 'msg' => esc_html__('Unsupported pro version', 'shopengine'),
72 ];
73 }
74
75 /**
76 * /shopengine-builder/v1/license/test
77 *
78 * http://localhost/shopengine/pro/wp-json/shopengine-builder/v1/license/test
79 */
80 public function get_test() {
81
82 echo 'hello....';
83 }
84 }
85