Based on the settings screen from #27 which allows to toggle individual modules on/off via UI, it should alternatively be possible to programmatically control which modules should be enabled. This can be useful for advanced users or environments which would like to use certain modules from the plugin without confronting end users with control over them.
Suggested approach:
- Introduce a filter
perflab_active_modules that filters the return value of the perflab_get_active_modules() function.
- Skip adding the plugin's settings screen (see
perflab_add_modules_page()) if the above filter is being used (check via WP core's has_filter() function).
Based on the settings screen from #27 which allows to toggle individual modules on/off via UI, it should alternatively be possible to programmatically control which modules should be enabled. This can be useful for advanced users or environments which would like to use certain modules from the plugin without confronting end users with control over them.
Suggested approach:
perflab_active_modulesthat filters the return value of theperflab_get_active_modules()function.perflab_add_modules_page()) if the above filter is being used (check via WP core'shas_filter()function).