Skip to content

Module Manager

The Module_Manager class provides a feature flag system for the Terra Framework. It lets you enable or disable optional framework features (like Grammar checking, Lighthouse monitoring, or the Schema Builder) on a per-project basis.


The Module Manager reads a configuration that defines which optional features are active. Framework code checks Module_Manager::is_active('feature_name') before initializing optional classes.

<?php
// Inside functions.php, the Core class checks before instantiating optional modules:
if (Module_Manager::is_active('grammar')) {
new Grammar($config);
}
if (Module_Manager::is_active('lighthouse')) {
new TerraLighthouse($config);
}

Use the static method anywhere in your code:

<?php
if (Module_Manager::is_active('schema_builder')) {
// Schema builder is enabled for this project
}

Module KeyFeature
grammarGrammar and spelling checker (uses OpenAI)
lighthouseLighthouse performance monitoring
schema_builderJSON-LD schema builder
csv_importCSV import functionality
google_search_consoleGSC integration
url_health_checkURL health monitoring

Knowledge Check

Test your understanding of this section

Loading questions...