AddonService.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Wpae\App\Service\Addons; |
| 4 | |
| 5 | |
| 6 | class AddonService |
| 7 | { |
| 8 | public function isUserAddonActive() { |
| 9 | return defined('PMUE_EDITION'); |
| 10 | } |
| 11 | |
| 12 | public function isUserAddonActiveAndIsUserExport() |
| 13 | { |
| 14 | return $this->isUserAddonActive() && \XmlExportUser::$is_active; |
| 15 | } |
| 16 | |
| 17 | public function userExportsExistAndAddonNotInstalled() |
| 18 | { |
| 19 | |
| 20 | $exports = new \PMXE_Export_List(); |
| 21 | $exports->getBy('parent_id', 0)->convertRecords(); |
| 22 | |
| 23 | foreach ($exports as $item) { |
| 24 | |
| 25 | if ( |
| 26 | ((in_array('users', $item['options']['cpt']) || in_array('shop_customer', $item['options']['cpt'])) && !$this->isUserAddonActive()) || |
| 27 | ($item['options']['export_type'] == 'advanced' && $item['options']['wp_query_selector'] == 'wp_user_query' && !$this->isUserAddonActive()) |
| 28 | ) { |
| 29 | return true; |
| 30 | } |
| 31 | |
| 32 | } |
| 33 | |
| 34 | return false; |
| 35 | } |
| 36 | |
| 37 | } |