| 1 |
<?php |
| 2 |
/** |
| 3 |
* LicenseController — stub (licensing system removed). |
| 4 |
* |
| 5 |
* Pro is unlocked for everyone. These endpoints are kept so the Vue admin |
| 6 |
* UI doesn't 404, and they always report an active Pro plan. |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace Upress\EzCache\Rest; |
| 10 |
|
| 11 |
use Upress\EzCache\LicenseApi; |
| 12 |
|
| 13 |
class LicenseController { |
| 14 |
|
| 15 |
/** |
| 16 |
* GET /license — Show license status |
| 17 |
*/ |
| 18 |
public function show() { |
| 19 |
$manager = new LicenseApi(); |
| 20 |
$status = $manager->get_status(); |
| 21 |
|
| 22 |
return [ |
| 23 |
'success' => true, |
| 24 |
'data' => [ |
| 25 |
'key' => '', |
| 26 |
'type' => $status['type'], |
| 27 |
'status' => $status['status'], |
| 28 |
'expires_at' => $status['expires_at'], |
| 29 |
'conversions_left' => $status['conversions_left'], |
| 30 |
'plan' => isset( $status['plan'] ) ? $status['plan'] : '', |
| 31 |
'freemius' => false, |
| 32 |
'account_url' => '', |
| 33 |
], |
| 34 |
]; |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* PATCH /license — Activate license (no-op). |
| 39 |
*/ |
| 40 |
public function update( $request ) { |
| 41 |
return [ |
| 42 |
'success' => true, |
| 43 |
'data' => [ |
| 44 |
'message' => __( 'Pro is already unlocked.', 'ezcache' ), |
| 45 |
'freemius' => false, |
| 46 |
'account_url' => '', |
| 47 |
], |
| 48 |
]; |
| 49 |
} |
| 50 |
|
| 51 |
/** |
| 52 |
* DELETE /license — Deactivate license (no-op). |
| 53 |
*/ |
| 54 |
public function destroy() { |
| 55 |
return [ |
| 56 |
'success' => true, |
| 57 |
'data' => [ |
| 58 |
'message' => __( 'Pro is unlocked for everyone; nothing to deactivate.', 'ezcache' ), |
| 59 |
'freemius' => false, |
| 60 |
'account_url' => '', |
| 61 |
], |
| 62 |
]; |
| 63 |
} |
| 64 |
} |
| 65 |
|