post_type === TableConfiguration::TYPE) { return true; } foreach (['facetcore-pro', 'facetcore-index', 'facetcore-help'] as $page) { if ($screen->id === get_plugin_page_hookname($page, 'edit.php?post_type=' . TableConfiguration::TYPE)) { return true; } } return false; } private function visible(): bool { return !Features::has('table') && current_user_can('manage_woocommerce') && $this->onPluginScreen(); } public static function url(): string { $configured = (string) get_option('facetcore_pro_url', ''); return esc_url_raw((string) apply_filters('facetcore_pro_url', $configured ?: 'https://facetcore.skyrix.app/'), ['https', 'http']); } private function link(): void { echo '' . esc_html__('Learn more about Pro', 'facetcore') . ''; } public function menu(): void { if (Features::has('table')) { return; } add_submenu_page('edit.php?post_type=' . TableConfiguration::TYPE, __('FacetCore Pro', 'facetcore'), __('FacetCore Pro', 'facetcore'), 'manage_woocommerce', 'facetcore-pro', [$this, 'page']); } public function layout(): void { if (!$this->visible()) { return; } echo '

' . esc_html__('Grid', 'facetcore') . '

' . esc_html__('Table ยท Table / Grid switching', 'facetcore') . ' Pro

' . esc_html__('Compare specifications in configurable columns and let visitors choose their view.', 'facetcore') . ' '; $this->link(); echo '

'; } public function advanced(): void { if (!$this->visible()) { return; } echo '

' . esc_html__('Additional card attributes', 'facetcore') . ' Pro

' . esc_html__('Show up to four extra global attributes directly on product cards.', 'facetcore') . ' '; $this->link(); echo '

' . esc_html__('Custom CSS', 'facetcore') . ' Pro

' . esc_html__('Match each Finder to your store design with its own CSS.', 'facetcore') . ' '; $this->link(); echo '

' . esc_html__('Selection links', 'facetcore') . ' Pro

' . esc_html__('Customers or managers can send a ready-made product selection with filters, search and page preserved.', 'facetcore') . ' '; $this->link(); echo '

'; } public function siteLink(): void { if (!current_user_can('manage_woocommerce') || !$this->onPluginScreen()) { return; } echo '

' . esc_html__('FacetCore website', 'facetcore') . '

'; } public function page(): void { if (!current_user_can('manage_woocommerce')) { wp_die(esc_html__('Forbidden', 'facetcore')); } if (Features::has('table')) { echo '

' . esc_html__('FacetCore Pro is active', 'facetcore') . '

'; return; } echo '

' . esc_html__('FacetCore Pro', 'facetcore') . '

' . esc_html__('Add comparison tables, extra card attributes, custom styling and selection links while keeping the same search engine and product index.', 'facetcore') . '

'; foreach ([ [__('Published Finders', 'facetcore'), __('Multiple', 'facetcore'), __('Multiple', 'facetcore')], [__('Grid, global attribute filters, name/SKU search, categories', 'facetcore'), __('Included', 'facetcore'), __('Included', 'facetcore')], [__('Counts, pagination and shortcode', 'facetcore'), __('Included', 'facetcore'), __('Included', 'facetcore')], [__('Automatic indexing', 'facetcore'), __('Included', 'facetcore'), __('Included', 'facetcore')], [__('Manual index rebuild', 'facetcore'), __('Included', 'facetcore'), __('Included', 'facetcore')], [__('Selection links: send a ready-made product selection', 'facetcore'), 'โ€”', __('Included', 'facetcore')], [__('Table with configurable columns and Table / Grid switching', 'facetcore'), 'โ€”', __('Included', 'facetcore')], [__('Additional card attributes and Custom CSS', 'facetcore'), 'โ€”', __('Included', 'facetcore')], ] as $row) { echo ''; } echo '
' . esc_html__('Feature', 'facetcore') . 'LitePro
' . esc_html($row[0]) . '' . esc_html($row[1]) . '' . esc_html($row[2]) . '

'; $url = self::url(); if ($url) { echo '' . esc_html__('Get FacetCore Pro', 'facetcore') . ''; } else { echo '' . esc_html__('Get FacetCore Pro', 'facetcore') . ' ' . esc_html__('The Pro purchase URL has not been configured.', 'facetcore'); } echo '

'; } }