WordPress / performance

Performance plugin from the WordPress Performance Group, which is a collection of standalone performance modules.
https://wordpress.org/plugins/performance-lab/
GNU General Public License v2.0
355 stars 97 forks source link

Define basic module specification #2

Closed felixarntz closed 2 years ago

felixarntz commented 2 years ago

Before starting to write code for any modules, we will need to define exactly what a module should look like. Some ideas for this were already mentioned in the plugin proposal doc, so let's use this issue to expand on those.

The performance plugin should eventually include a settings page that lists all available modules, where the user can individually toggle them on/off.

The proposal is the following:

Here's a sample module header based on the above:

/**
 * Module Name: My Performance Module
 * Module Description: Optimizes x by doing y.
 * Module Focus: images
 * Experimental: No
 */

Let's discuss here. Once we've decided on the approach, a good takeaway from this issue would be to create a PR where we put the resulting specification into either README.md or another (documentation) markdown file in the repository.

tillkruss commented 2 years ago

Should we add GitHub and WP.org usernames maybe as well to indicate code ownership?

felixarntz commented 2 years ago

@tillkruss Maybe, although to my knowledge this isn't an established approach for WordPress and may seem somewhat "gatekeeper-ish". But I agree it would be useful for example to have certain folks automatically be assigned as PR reviewers. With all that said, I think this would be better off in its own issue, to go into some sort of CODEOWNERS file rather than the module header. Would you mind opening an issue for that?

ThierryA commented 2 years ago

Proposed module specification LGTM. Perhaps we should have a skeleton example as starting point for new modules.

felixarntz commented 2 years ago

I just opened #26 with documentation defining this. It follows what I outlined in the issue description above and includes a skeleton example.

The only change I made compared to the description above is renaming/shortening the module header fields Module Description to Description and Module Focus to Focus. The prefix here is unnecessary, and not having it is in line with plugins, which only use the Plugin ... prefix for the Plugin Name field, but not others.