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