| @@ -132,9 +132,9 @@ | ||
| 132 | 132 | /** |
| 133 | 133 | * Plugin Version |
| 134 | 134 | * @var string |
| 135 | 135 | */ |
| 136 | - public $version = '4.9.2'; | |
| 136 | + public $version = '4.9.3'; | |
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | 139 | * WriteWithAI Class |
| 140 | 140 | * @var string |
| @@ -485,32 +485,64 @@ | ||
| 485 | 485 | return ! $this->is_pro_active() && ! $this->has_api_docs(); |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | /** |
| 489 | - * Whether the real Glossaries screen is available (i.e. Pro is licensing it). | |
| 489 | + * Whether the real Glossaries screen is available (i.e. Pro is providing it). | |
| 490 | 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`. | |
| 491 | + * Glossaries now lives in Pro (moved out of Free), so — like Content | |
| 492 | + * Intelligence and API Docs — there is a concrete Pro class to detect. The | |
| 493 | + * class_exists() default keeps the gate correct against a Pro build that | |
| 494 | + * predates the move (that Pro is active but does NOT ship the manager, so | |
| 495 | + * this must be false, not simply `is_pro_active()`); the filter lets Pro/add-ons | |
| 496 | + * flip it explicitly. | |
| 495 | 497 | * |
| 496 | 498 | * @return bool |
| 497 | 499 | */ |
| 498 | 500 | public function has_glossaries() { |
| 499 | - return (bool) apply_filters( 'betterdocs_pro_has_glossaries', $this->is_pro_active() ); | |
| 501 | + return (bool) apply_filters( | |
| 502 | + 'betterdocs_pro_has_glossaries', | |
| 503 | + class_exists( '\\WPDeveloper\\BetterDocsPro\\Core\\GlossaryTaxonomy' ) | |
| 504 | + ); | |
| 500 | 505 | } |
| 501 | 506 | |
| 502 | 507 | /** |
| 503 | - * Whether Free should show its locked Glossaries teaser. | |
| 508 | + * Whether Free should render its locked Glossaries screen instead of the real | |
| 509 | + * manager. | |
| 504 | 510 | * |
| 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(). | |
| 511 | + * True whenever the Pro manager is not available — i.e. Pro is off (a genuine | |
| 512 | + * upsell) OR an older Pro that predates the glossaries move is active (it can no | |
| 513 | + * longer provide the manager, so the slot must not be left blank). Only a Pro new | |
| 514 | + * enough to ship GlossaryTaxonomy hides this and takes over the route. | |
| 508 | 515 | * |
| 509 | 516 | * @return bool |
| 510 | 517 | */ |
| 511 | 518 | public function show_glossary_teaser() { |
| 512 | - return ! $this->is_pro_active() && ! $this->has_glossaries(); | |
| 519 | + return ! $this->has_glossaries(); | |
| 520 | + } | |
| 521 | + | |
| 522 | + /** | |
| 523 | + * Whether the locked Glossaries screen is showing because an *outdated* Pro | |
| 524 | + * is active (as opposed to no Pro at all). | |
| 525 | + * | |
| 526 | + * Glossaries moved into Pro, so a Pro that predates the move is active but no | |
| 527 | + * longer provides the manager. That user already owns Pro, so the locked | |
| 528 | + * screen must ask them to UPDATE Pro rather than upsell "get Pro". Mirrors the | |
| 529 | + * has_glossaries() capability check. | |
| 530 | + * | |
| 531 | + * @return bool | |
| 532 | + */ | |
| 533 | + public function glossaries_needs_pro_update() { | |
| 534 | + return $this->is_pro_active() && ! $this->has_glossaries(); | |
| 535 | + } | |
| 536 | + | |
| 537 | + /** | |
| 538 | + * The BetterDocs Pro version that first ships the Glossaries manager, shown in | |
| 539 | + * the "please update Pro" copy. Filterable so the target can move with Pro. | |
| 540 | + * | |
| 541 | + * @return string | |
| 542 | + */ | |
| 543 | + public function glossaries_min_pro_version() { | |
| 544 | + return (string) apply_filters( 'betterdocs_glossaries_min_pro_version', '4.3.1' ); | |
| 513 | 545 | } |
| 514 | 546 | |
| 515 | 547 | /** |
| 516 | 548 | * Whether Pro provides the real Content Intelligence screen. |