| 1 |
<?php |
| 2 |
|
| 3 |
namespace Bookit\Classes\Base; |
| 4 |
|
| 5 |
/** |
| 6 |
* Class Addon |
| 7 |
* base addon functions here |
| 8 |
*/ |
| 9 |
abstract class Addon { |
| 10 |
|
| 11 |
public static $addon_slug; |
| 12 |
/** |
| 13 |
* Possible values for $settingTab, if self showed as separate tab on setting page |
| 14 |
* |
| 15 |
* @var string[] |
| 16 |
*/ |
| 17 |
public static $settingTabs = array( |
| 18 |
'general', |
| 19 |
'currency', |
| 20 |
'payments', |
| 21 |
'emailTemplates', |
| 22 |
'self', |
| 23 |
); |
| 24 |
|
| 25 |
/** |
| 26 |
* Addon title. |
| 27 |
* |
| 28 |
* @string |
| 29 |
*/ |
| 30 |
protected static $title; |
| 31 |
|
| 32 |
/** |
| 33 |
* Addon Version. |
| 34 |
* |
| 35 |
* @string |
| 36 |
*/ |
| 37 |
protected static $version; |
| 38 |
|
| 39 |
/** |
| 40 |
* Is Addon active. |
| 41 |
* |
| 42 |
* @string |
| 43 |
*/ |
| 44 |
protected static $active = false; |
| 45 |
|
| 46 |
/** |
| 47 |
* Is Addon installed. |
| 48 |
* |
| 49 |
* @string |
| 50 |
*/ |
| 51 |
protected static $installed = false; |
| 52 |
|
| 53 |
/** |
| 54 |
* Addon link. |
| 55 |
* |
| 56 |
* @string |
| 57 |
*/ |
| 58 |
protected static $link; |
| 59 |
|
| 60 |
/** |
| 61 |
* Addon base setting key ( wp_options ) . |
| 62 |
* |
| 63 |
* @staticvar string |
| 64 |
*/ |
| 65 |
protected static $settingsKey; |
| 66 |
|
| 67 |
/** |
| 68 |
* Addon base settings. |
| 69 |
* |
| 70 |
* @staticvar array |
| 71 |
*/ |
| 72 |
protected static $settings; |
| 73 |
|
| 74 |
/** |
| 75 |
* Addon appearance settings on plugin settings page ( which tab to use ). |
| 76 |
* |
| 77 |
* @staticvar string |
| 78 |
*/ |
| 79 |
protected static $settingTab; |
| 80 |
|
| 81 |
/** |
| 82 |
* Addon order, jf separate tab for settings. |
| 83 |
* |
| 84 |
* @staticvar string |
| 85 |
*/ |
| 86 |
protected static $order; |
| 87 |
|
| 88 |
/** |
| 89 |
* Freemius activation link |
| 90 |
* |
| 91 |
* @staticvar string |
| 92 |
*/ |
| 93 |
protected static $activationLink = ''; |
| 94 |
|
| 95 |
/** |
| 96 |
* Is need freemius license |
| 97 |
* |
| 98 |
* @staticvar boolean |
| 99 |
*/ |
| 100 |
protected static $is_premium = true; // by default always true |
| 101 |
|
| 102 |
/** |
| 103 |
* Is have freemius license |
| 104 |
* |
| 105 |
* @staticvar boolean |
| 106 |
*/ |
| 107 |
protected static $is_paying = false; |
| 108 |
|
| 109 |
|
| 110 |
/** |
| 111 |
* Run addon. |
| 112 |
*/ |
| 113 |
public static function run() { |
| 114 |
// register hooks WP hooks. |
| 115 |
// add actions |
| 116 |
// check for updates |
| 117 |
} |
| 118 |
|
| 119 |
/** |
| 120 |
* Activate Addon. |
| 121 |
*/ |
| 122 |
public static function activate() { |
| 123 |
} |
| 124 |
|
| 125 |
/** |
| 126 |
* Deactivate Addon. |
| 127 |
*/ |
| 128 |
public static function deactivate() { |
| 129 |
} |
| 130 |
|
| 131 |
/** |
| 132 |
* Uninstall Addon. |
| 133 |
*/ |
| 134 |
public static function uninstall() { |
| 135 |
} |
| 136 |
|
| 137 |
/** |
| 138 |
* Init freemius |
| 139 |
* set values to: |
| 140 |
* $is_paying |
| 141 |
* $is_premium |
| 142 |
* $activationLink |
| 143 |
*/ |
| 144 |
private static function initFreemius() { |
| 145 |
} |
| 146 |
} |
| 147 |
|