| @@ -31,8 +31,9 @@ | ||
| 31 | 31 | use WPDeveloper\BetterDocs\Dependencies\DI\Container; |
| 32 | 32 | use WPDeveloper\BetterDocs\Dependencies\DI\ContainerBuilder; |
| 33 | 33 | use WPDeveloper\BetterDocs\Editors\Editor; |
| 34 | 34 | use WPDeveloper\BetterDocs\FrontEnd\FrontEnd; |
| 35 | +use WPDeveloper\BetterDocs\FrontEnd\PrintTemplate; | |
| 35 | 36 | use WPDeveloper\BetterDocs\FrontEnd\SearchExtender; |
| 36 | 37 | use WPDeveloper\BetterDocs\FrontEnd\TemplateTags; |
| 37 | 38 | use WPDeveloper\BetterDocs\FrontEnd\WooProductFAQ; |
| 38 | 39 | use WPDeveloper\BetterDocs\Abilities\AbilitiesRegistrar; |
| @@ -131,9 +132,9 @@ | ||
| 131 | 132 | /** |
| 132 | 133 | * Plugin Version |
| 133 | 134 | * @var string |
| 134 | 135 | */ |
| 135 | - public $version = '4.9.0'; | |
| 136 | + public $version = '4.9.2'; | |
| 136 | 137 | |
| 137 | 138 | /** |
| 138 | 139 | * WriteWithAI Class |
| 139 | 140 | * @var string |
| @@ -150,9 +151,9 @@ | ||
| 150 | 151 | /** |
| 151 | 152 | * Plugin DB Version |
| 152 | 153 | * @var string |
| 153 | 154 | */ |
| 154 | - public $db_version = '1.0.2'; | |
| 155 | + public $db_version = '1.0.3'; | |
| 155 | 156 | |
| 156 | 157 | public function __construct() { |
| 157 | 158 | $this->define_constants(); |
| 158 | 159 | |
| @@ -318,8 +319,13 @@ | ||
| 318 | 319 | |
| 319 | 320 | $this->container->get( FrontEnd::class ); |
| 320 | 321 | $this->container->get( SearchExtender::class ); |
| 321 | 322 | |
| 323 | + // Running logo header / page footer for the browser's own Print command. | |
| 324 | + // Registered unconditionally: it covers every front-end page, including | |
| 325 | + // the ones that carry no BetterDocs print button. | |
| 326 | + $this->container->get( PrintTemplate::class ); | |
| 327 | + | |
| 322 | 328 | /** |
| 323 | 329 | * Single-product FAQ rendering (WooCommerce). The class itself bails when |
| 324 | 330 | * WooCommerce is inactive or the feature is disabled. |
| 325 | 331 | */ |
| @@ -478,8 +484,63 @@ | ||
| 478 | 484 | public function show_api_docs_teaser() { |
| 479 | 485 | return ! $this->is_pro_active() && ! $this->has_api_docs(); |
| 480 | 486 | } |
| 481 | 487 | |
| 488 | + /** | |
| 489 | + * Whether the real Glossaries screen is available (i.e. Pro is licensing it). | |
| 490 | + * | |
| 491 | + * Glossaries ships in Free's code but is Pro-licensed, so unlike API Docs there | |
| 492 | + * is no separate Pro class to detect — the gate is simply Pro being active. Kept | |
| 493 | + * behind a filter so Pro/add-ons can flip it explicitly, mirroring | |
| 494 | + * `betterdocs_pro_has_api_docs`. | |
| 495 | + * | |
| 496 | + * @return bool | |
| 497 | + */ | |
| 498 | + public function has_glossaries() { | |
| 499 | + return (bool) apply_filters( 'betterdocs_pro_has_glossaries', $this->is_pro_active() ); | |
| 500 | + } | |
| 501 | + | |
| 502 | + /** | |
| 503 | + * Whether Free should show its locked Glossaries teaser. | |
| 504 | + * | |
| 505 | + * Only without Pro — an active Pro either has the feature or has simply left it | |
| 506 | + * disabled in settings; neither case wants an upsell. Mirrors | |
| 507 | + * show_api_docs_teaser(). | |
| 508 | + * | |
| 509 | + * @return bool | |
| 510 | + */ | |
| 511 | + public function show_glossary_teaser() { | |
| 512 | + return ! $this->is_pro_active() && ! $this->has_glossaries(); | |
| 513 | + } | |
| 514 | + | |
| 515 | + /** | |
| 516 | + * Whether Pro provides the real Content Intelligence screen. | |
| 517 | + * | |
| 518 | + * Pro flips this via `betterdocs_pro_has_content_intelligence`; the | |
| 519 | + * class_exists() default keeps the gate correct against a Pro build that | |
| 520 | + * predates that filter. | |
| 521 | + * | |
| 522 | + * @return bool | |
| 523 | + */ | |
| 524 | + public function has_content_intelligence() { | |
| 525 | + return (bool) apply_filters( | |
| 526 | + 'betterdocs_pro_has_content_intelligence', | |
| 527 | + class_exists( '\\WPDeveloper\\BetterDocsPro\\Core\\ContentIntelligenceService' ) | |
| 528 | + ); | |
| 529 | + } | |
| 530 | + | |
| 531 | + /** | |
| 532 | + * Whether Free should show its locked Content Intelligence teaser. | |
| 533 | + * | |
| 534 | + * Only without Pro. An older Pro has already paid, so they get nothing here — | |
| 535 | + * they need a plugin update, not an upsell. | |
| 536 | + * | |
| 537 | + * @return bool | |
| 538 | + */ | |
| 539 | + public function show_content_intelligence_teaser() { | |
| 540 | + return ! $this->is_pro_active() && ! $this->has_content_intelligence(); | |
| 541 | + } | |
| 542 | + | |
| 482 | 543 | public function pro_version() { |
| 483 | 544 | if ( ! $this->is_pro_active() ) { |
| 484 | 545 | return false; |
| 485 | 546 | } |
| @@ -531,8 +592,9 @@ | ||
| 531 | 592 | 'toplevel_page_betterdocs-admin', |
| 532 | 593 | 'admin_page_betterdocs-admin', |
| 533 | 594 | 'betterdocs_page_betterdocs-admin', |
| 534 | 595 | 'betterdocs_page_betterdocs-analytics', |
| 596 | + 'betterdocs_page_betterdocs-content-iq', | |
| 535 | 597 | 'betterdocs_page_betterdocs-settings', |
| 536 | 598 | 'betterdocs_page_betterdocs-mcp', |
| 537 | 599 | 'betterdocs_page_betterdocs-faq', |
| 538 | 600 | 'betterdocs_page_betterdocs-glossaries', |