Skip to content

Remove any functions, classes, constants etc. from module load.php files #667

@felixarntz

Description

@felixarntz

Feature Description

As part of #656, the milestone 1 will temporarily result in certain features being available as plugins and as modules. While the Performance Lab plugin will do all it can to ensure that a module doesn't load if the similar plugin is already loaded (see #666), this approach is not and cannot be 100% reliable: For example, when you already use one of the modules, and then activate the corresponding standalone plugin, it will throw an exception during activation as it would effectively redeclare the functions from the module. This is only relevant during activation, since at that point the plugin would be loaded after the module (while normally it is the other way around).

For that reason, and as a general good practice, we should reduce each module's load.php file to just that: A file that loads other files. Additionally, we should add a clause to each load.php file to not load the files if e.g. a function or constant from that feature is already defined (e.g. in the equivalent Performance Lab module or standalone plugin).

Requirements

  • All functions, classes, constants, etc. that are declared in a module's load.php file should be moved to other more specific files.
  • Each module's load.php file should include a check for whether a certain key function or constant or class that is part of the module is already loaded. If so, the file should return early.
  • Otherwise, all that the module load.php files should do going forward is load the other files.

Metadata

Metadata

Assignees

Labels

InfrastructureIssues for the overall performance plugin infrastructure[Plugin] Performance LabIssue relates to work in the Performance Lab Plugin only[Type] EnhancementA suggestion for improvement of an existing feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions