1 | <?php namespace EmailLog\Addon\API; |
||
15 | class EDDUpdater extends \EDD_SL_Plugin_Updater { |
||
16 | |||
17 | /** |
||
18 | * The name part of the add-on file without .php extension. |
||
19 | * |
||
20 | * The base class already has a slug property but it is private. |
||
21 | * So we have to create a duplicate to handle that. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $addon_slug; |
||
26 | |||
27 | /** |
||
28 | * Directory and filename of the add-on. |
||
29 | * |
||
30 | * The base class already has a slug property but it is private. |
||
31 | * So we have to create a duplicate to handle that. |
||
32 | * |
||
33 | * @since 2.2.4 |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $addon_name; |
||
38 | |||
39 | /** |
||
40 | * Extract add-on slug alone and then pass everything to parent. |
||
41 | * |
||
42 | * @param string $_api_url The URL pointing to the custom API endpoint. |
||
43 | * @param string $_plugin_file Path to the plugin file. |
||
44 | * @param array|null $_api_data Optional data to send with API calls. |
||
45 | */ |
||
46 | public function __construct( $_api_url, $_plugin_file, $_api_data = null ) { |
||
52 | |||
53 | /** |
||
54 | * Overridden to disable `check_update` on the add-ons that are not installed. |
||
55 | * |
||
56 | * @inheritdoc |
||
57 | * |
||
58 | * @since 2.2.0 |
||
59 | */ |
||
60 | public function init() { |
||
71 | |||
72 | /** |
||
73 | * Get add-on slug. |
||
74 | * |
||
75 | * The name part of the add-on file without .php extension. |
||
76 | * |
||
77 | * @return string Add-on slug. |
||
78 | */ |
||
79 | public function get_slug() { |
||
82 | |||
83 | /** |
||
84 | * Get the add-on name. |
||
85 | * |
||
86 | * Directory and filename of the add-on. |
||
87 | * |
||
88 | * @since 2.2.4 |
||
89 | * |
||
90 | * @return string Add-on name. |
||
91 | */ |
||
92 | public function get_name() { |
||
95 | |||
96 | /** |
||
97 | * Get Download URL. |
||
98 | * |
||
99 | * We can't call `api_request` method directly since it is declared as private in parent class. |
||
100 | * So we call the `plugins_api_filter` method instead. |
||
101 | * |
||
102 | * @return string Download url. |
||
103 | */ |
||
104 | public function get_download_url() { |
||
116 | } |
||
117 |