<?php
/*
 * Copyright (c) 2025 AltumCode (https://altumcode.com/)
 *
 * This software is licensed exclusively by AltumCode and is sold only via https://altumcode.com/.
 * Unauthorized distribution, modification, or use of this software without a valid license is not permitted and may be subject to applicable legal actions.
 *
 *  View all other existing AltumCode projects via https://altumcode.com/
 *  Get in touch for support or general queries via https://altumcode.com/contact
 *  Download the latest version via https://altumcode.com/downloads
 *
 *  X/Twitter: https://x.com/AltumCode
 *  Facebook: https://facebook.com/altumcode
 *  Instagram: https://instagram.com/altumcode
 */

defined('ALTUMCODE') || die();

$features = [];

/* Plan-related features */
$features = array_merge($features, [
    'stores_limit',
    'menus_limit',
    'categories_limit',
    'items_limit',
]);

/* Domains */
if(settings()->stores->domains_is_enabled) {
    $features[] = 'domains_limit';
}

if(settings()->stores->additional_domains_is_enabled) {
    $features[] = 'additional_domains';
}

/* Plugin: Teams */
if(\Altum\Plugin::is_active('teams')) {
    $features[] = 'teams_limit';
}

/* Plugin: Affiliate */
if(\Altum\Plugin::is_active('affiliate') && settings()->affiliate->is_enabled) {
    $features[] = 'affiliate_commission_percentage';
}

/* Statistics retention */
$features[] = 'statistics_retention';

/* Ordering, analytics, QR */
$features[] = 'ordering_is_enabled';
$features[] = 'analytics_is_enabled';
$features[] = 'qr_is_enabled';

/* Security & customization */
$features[] = 'password_protection_is_enabled';
$features[] = 'removable_branding_is_enabled';
$features[] = 'custom_url_is_enabled';

/* Plugin: PWA */
if(\Altum\Plugin::is_active('pwa') && settings()->pwa->is_enabled) {
    $features[] = 'custom_pwa_is_enabled';
}

/* SEO */
$features[] = 'search_engine_block_is_enabled';

/* Design customization */
$features[] = 'custom_css_is_enabled';
$features[] = 'custom_js_is_enabled';

/* Email reports */
if(settings()->stores->email_reports_is_enabled) {
    $features[] = 'email_reports_is_enabled';
}

/* Online payments */
$features[] = 'online_payments_is_enabled';

/* Global settings */
if(settings()->main->api_is_enabled) {
    $features[] = 'api_is_enabled';
}

if(settings()->main->white_labeling_is_enabled) {
    $features[] = 'white_labeling_is_enabled';
}

/* Export features */
$features[] = sprintf(l('global.plan_settings.export'), '');

/* Ads */
$features[] = 'no_ads';

return $features;
