key !== $key) continue; return self::filteredEnabled($module->enabled($config), $key, $config); } if (in_array($key, self::proOnlyKeys(), true)) return self::filteredEnabled(false, $key, $config); return self::filteredEnabled(isset($config[$key]) && (bool) $config[$key], $key, $config); } /** * @param array $config */ private static function filteredEnabled(bool $enabled, string $key, array $config): bool { return (bool) apply_filters('DayTidy/F__DayTidy/Modules__enabled/enabled', $enabled, $key, $config); } /** * @return string[] */ private static function proOnlyKeys(): array { return [ 'booking/coupons', 'booking/online-payments', 'booking/online-refunds', 'booking/admin-calendar', 'booking/advanced-reports', 'booking/advanced-operations', 'notifications/operations', ]; } }