| @@ -264,8 +264,21 @@ | ||
| 264 | 264 | */ |
| 265 | 265 | protected function ai() { |
| 266 | 266 | $settings = betterdocs()->settings; |
| 267 | 267 | |
| 268 | + // `show_glossary_suggestions` defaults to true and has no settings-UI field, so | |
| 269 | + // reporting it raw would mark every Free-only site as "using" a feature it can | |
| 270 | + // never run. Mirror the runtime gate in Core\WriteWithAI: the glossaries taxonomy | |
| 271 | + // is registered for Pro only, so the "Suggest glossaries" offer is reachable only | |
| 272 | + // when the glossary feature is on AND Pro is active. Do NOT "simplify" this back | |
| 273 | + // to a bare setting read. ($has_glossary_terms from the runtime gate is | |
| 274 | + // deliberately excluded — that is per-request content state, not config posture.) | |
| 275 | + $glossary_suggestions = (int) ( | |
| 276 | + (bool) $settings->get( 'enable_glossaries', false ) | |
| 277 | + && (bool) $settings->get( 'show_glossary_suggestions', true ) | |
| 278 | + && betterdocs()->is_pro_active() | |
| 279 | + ); | |
| 280 | + | |
| 268 | 281 | return [ |
| 269 | 282 | 'write_with_ai' => (int) (bool) $settings->get( 'enable_write_with_ai', false ), |
| 270 | 283 | 'article_summary' => (int) (bool) $settings->get( 'enable_article_summary', false ), |
| 271 | 284 | 'chatbot' => (int) (bool) $settings->get( 'enable_ai_chatbot', false ), |
| @@ -272,8 +285,12 @@ | ||
| 272 | 285 | 'autowrite_key_set' => (int) ! empty( $settings->get( 'ai_autowrite_api_key', '' ) ), |
| 273 | 286 | 'chatbot_key_set' => (int) ! empty( $settings->get( 'ai_chatbot_api_key', '' ) ), |
| 274 | 287 | 'write_with_ai_model' => (string) $settings->get( 'write_with_ai_model', '' ), |
| 275 | 288 | 'article_summary_model' => (string) $settings->get( 'article_summary_model', '' ), |
| 289 | + // AI adoption toggles introduced with the 4.6.3 AI surfaces. | |
| 290 | + 'sample_docs' => (int) (bool) $settings->get( 'enable_ai_sample_docs', true ), | |
| 291 | + 'docs_ai_suite' => (int) (bool) $settings->get( 'enable_docs_ai_suite', true ), | |
| 292 | + 'glossary_suggestions' => $glossary_suggestions, | |
| 276 | 293 | // Per-feature usage counts (how many times each AI action ran). All keys |
| 277 | 294 | // always present (default 0); see Utils\AIUsage for the recording side. |
| 278 | 295 | 'usage' => \WPDeveloper\BetterDocs\Utils\AIUsage::snapshot(), |
| 279 | 296 | ]; |
| @@ -290,7 +307,11 @@ | ||
| 290 | 307 | 'permalink_structure' => (string) $settings->get( 'permalink_structure', '' ), |
| 291 | 308 | 'reporting_frequency' => (string) $settings->get( 'reporting_frequency', '' ), |
| 292 | 309 | 'posts_number' => (int) $settings->get( 'posts_number', 0 ), |
| 293 | 310 | 'column_number' => (int) $settings->get( 'column_number', 0 ), |
| 311 | + // Analytics Overview (4.6.3) posture — key-set booleans only, never secrets. | |
| 312 | + 'ga4_configured' => (int) ! empty( $settings->get( 'ga4_api_secret', '' ) ), | |
| 313 | + 'geoip_configured' => (int) ! empty( $settings->get( 'maxmind_license_key', '' ) ), | |
| 314 | + 'dark_mode' => (int) (bool) $settings->get( 'dark_mode', false ), | |
| 294 | 315 | ]; |
| 295 | 316 | } |
| 296 | 317 | } |