| @@ -13,8 +13,20 @@ | ||
| 13 | 13 | { |
| 14 | 14 | return 'imagify'; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | + public static function isEligible(): bool | |
| 18 | + { | |
| 19 | + // A key from IMAGIFY_API_KEY or the network option reaches only their accessor. | |
| 20 | + if (function_exists('get_imagify_option')) { | |
| 21 | + return empty(\get_imagify_option('api_key')); | |
| 22 | + } | |
| 23 | + | |
| 24 | + $settings = (array) \get_option('imagify_settings', []); | |
| 25 | + | |
| 26 | + return empty($settings['api_key']); | |
| 27 | + } | |
| 28 | + | |
| 17 | 29 | protected static function saveKey(array $data) |
| 18 | 30 | { |
| 19 | 31 | $key = $data['api_key'] ?? null; |
| 20 | 32 | |