Repository navigation
Description
Summary
Knowledge Base needs a Features tab and central Feature Manager following the established pattern in Better Search, Contextual Related Posts, and Top 10.
Reference implementations:
Those plugins map optional modules to settings, treat missing settings as enabled for upgrade compatibility, and gate module construction using the manager. The Features tab groups controls by API integrations, editor/display components, and other modules.
Modules to cover
- Blocks, including Free and Pro blocks through the shared block registry.
- Block patterns, separately from blocks.
- Classic widgets, including Free and Pro widgets.
- REST API endpoints under
/wzkb/v1/. Keep REST cache invalidation hooks active when routes are disabled. - WordPress Abilities API, including Free, Pro, GitHub, and Ask the Docs abilities.
- GitHub integration, including API access, import/export screens, webhooks, and push handlers.
- Ask the Docs, including its settings tab, REST endpoint, frontend integration, question log and cleanup cron, answer cache, Content gaps report, and ability.
Keep the existing ai_enabled setting. It controls whether answers run when Ask the Docs is loaded. The Features switch should control whether the whole AI module loads.
Existing functional settings
Do not add duplicate Features switches for Live Search, inline/floating TOCs, related articles, feed inclusion, rating, Help Widget, Docs layout, KB homepage mode, term thumbnails, or Multi-Product Mode. Those already have functional settings.
Requirements
- Add the Features settings section and checkboxes in the Pro source repository, then sync shared code to Free.
- Treat missing feature settings as enabled so existing sites retain their current behavior.
- Preserve settings and data when a module is disabled. Re-enabling should restore configured behavior.
- When Ask the Docs is disabled, omit its settings tab while retaining its saved settings.
- Keep necessary shared maintenance behavior, especially REST cache invalidation.
- Document disabled-module effects, including existing block content.
- Verify enabled and disabled paths, upgrade defaults, PHP compatibility, PHPCS, PHPStan, and the distribution package.
The full audit and implementation outline is in dev-helpers/plans/features-tab-audit.md in the repository workspace.
Activity