Skip to content

Add settings page #27

@ThierryA

Description

@ThierryA

The plugin should provide a simple UI (filterable) to enable/disable modules broken down by focus area.

Requirements

  • The plugin's settings screen (slug already defined in PERFLAB_MODULES_SCREEN constant) should be implemented, with a dynamic list of all modules and a checkbox to toggle each one on/off.
  • It should be an ordinary WordPress settings screen called "Performance Modules", under "Settings".
  • All available modules should be dynamically included in the UI, grouped by their Focus definition (see Define basic module specification #2).
  • Whether a module is enabled or not should be stored in the plugin's setting already defined as PERFLAB_MODULES_SETTING.

Specification Details

  • A function should be implemented that iterates through the modules directory and gathers all available module information from each module's load.php file header. This can largely be copied from the WordPress core function get_plugins() which includes all necessary parsing logic.
  • The screen should be registered with title "Performance Modules" and capability manage_options via add_options_page().
  • The screen should be a regular settings page using the WordPress Settings API.
    • Settings sections should be registered for the initial focus areas images, javascript, site-health, measurement, and object-caching, as well as a generic other section.
    • Settings fields should be registered for every available module's enabled sub-setting, associated with the settings section specified in the module's Focus header field.
    • Any settings sections that don't include any modules / settings fields (yet) should not be displayed.
    • Every module's name and description should be displayed with the checkbox to toggle it on/off.
    • When submitting the HTML form on the screen, the configuration for which modules are enabled should be saved in the plugin's existing PERFLAB_MODULES_SETTING option.
  • PHPUnit test coverage should be added.

This issue depends on #2 for finalizing the module specification and on #28 for completing the PHPUnit infrastructure necessary to validate that the changes included here work correctly.

Metadata

Metadata

Assignees

Labels

InfrastructureIssues for the overall performance plugin infrastructure[Type] FeatureA new feature within an existing module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions