| 1 |
<?php |
| 2 |
/* |
| 3 |
* SOFTWARE LICENSE INFORMATION |
| 4 |
* |
| 5 |
* Copyright (c) 2017 Buttonizer, all rights reserved. |
| 6 |
* |
| 7 |
* This file is part of Buttonizer |
| 8 |
* |
| 9 |
* For detailed information regarding to the licensing of |
| 10 |
* this software, please review the license.txt or visit: |
| 11 |
* https://buttonizer.pro/license/ |
| 12 |
*/ |
| 13 |
|
| 14 |
namespace Buttonizer\Api; |
| 15 |
|
| 16 |
use Buttonizer\Core\Api\BaseApi; |
| 17 |
|
| 18 |
class Api extends BaseApi |
| 19 |
{ |
| 20 |
/** |
| 21 |
* Register API endpoints. |
| 22 |
* |
| 23 |
* Shared routes are registered by BaseApi. |
| 24 |
* Legacy routes are plugin-specific. |
| 25 |
*/ |
| 26 |
public function __construct() |
| 27 |
{ |
| 28 |
// Register shared routes (Connect, Disconnect, Sync, Settings, Editor, Analytics) |
| 29 |
parent::__construct(); |
| 30 |
|
| 31 |
// Legacy (plugin-specific) |
| 32 |
// We can't call the Freemius split conditional here to remove these routes because we don't have the Freemius |
| 33 |
// object available outside Legacy folder. |
| 34 |
(new Utils\DeleteLegacyBackup())->registerRoute(); |
| 35 |
|
| 36 |
// The way back to an absorbed plugin's old system |
| 37 |
(new Utils\UseLegacyModule())->registerRoute(); |
| 38 |
} |
| 39 |
|
| 40 |
/** |
| 41 |
* Return error, need Buttonizer pro |
| 42 |
*/ |
| 43 |
public static function needButtonizerPremium() |
| 44 |
{ |
| 45 |
return new \WP_Error('missing_premium_license', 'You do not have Buttonizer Pro.', [ |
| 46 |
'status' => 403 |
| 47 |
]); |
| 48 |
} |
| 49 |
} |
| 50 |
|