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__('Show up to four extra global attributes directly on product cards.', 'facetcore') . ' '; $this->link(); echo '
' . esc_html__('Match each Finder to your store design with its own CSS.', 'facetcore') . ' '; $this->link(); echo '
' . esc_html__('Customers or managers can send a ready-made product selection with filters, search and page preserved.', 'facetcore') . ' '; $this->link(); 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__('Add comparison tables, extra card attributes, custom styling and selection links while keeping the same search engine and product index.', 'facetcore') . '
| ' . esc_html__('Feature', 'facetcore') . ' | Lite | Pro |
|---|---|---|
| ' . 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__('The Pro purchase URL has not been configured.', 'facetcore'); } echo '