Repository navigation
Implement support for annotating certain plugins as experimental #1111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
felixarntz
merged 5 commits into
release/3.0.0
from
add/1045-experimental-plugin-annotations
Apr 4, 2024
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7a46d3f
Implement support for annotating certain plugins as experimental.
6c51a4b
Merge branch 'release/3.0.0' into add/1045-experimental-plugin-annota…
felixarntz d814c85
Merge branch 'release/3.0.0' into add/1045-experimental-plugin-annota…
b272cf8
Remove potentially misleading doc annotation (not all of these plugin…
ed36185
Enhance return value annotation.
felixarntz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,29 +79,56 @@ function perflab_render_generator() { | |
| add_action( 'wp_head', 'perflab_render_generator' ); | ||
|
|
||
| /** | ||
| * Gets the standalone plugin constants used for each available standalone plugin. | ||
| * Gets the standalone plugins and their data. | ||
| * | ||
| * @since 2.9.0 | ||
| * @since n.e.x.t The $source parameter was removed. | ||
| * @since n.e.x.t | ||
| * | ||
| * @return array<string, string> Map of plugin slug and the version constant used. | ||
| * @return array Associative array of $plugin_slug => $plugin_data pairs. | ||
| */ | ||
| function perflab_get_standalone_plugin_version_constants() { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note for reviewers: This function is simply moved down (see bottom of the file), it's not being replaced as potentially the diff here may suggest. |
||
| function perflab_get_standalone_plugin_data() { | ||
| /* | ||
| * This list includes all standalone plugins that are part of the Performance Lab project, | ||
| * as `$plugin_slug => $version_constant` pairs. | ||
| * Alphabetically sorted list of plugin slugs and their data. | ||
| * Supported keys per plugin are: | ||
| * - 'constant' (string, required) | ||
| * - 'experimental' (boolean, optional) | ||
| */ | ||
| return array( | ||
| 'webp-uploads' => 'WEBP_UPLOADS_VERSION', | ||
| 'dominant-color-images' => 'DOMINANT_COLOR_IMAGES_VERSION', | ||
| 'embed-optimizer' => 'EMBED_OPTIMIZER_VERSION', | ||
| 'auto-sizes' => array( | ||
| 'constant' => 'IMAGE_AUTO_SIZES_VERSION', | ||
| 'experimental' => true, | ||
| ), | ||
| 'dominant-color-images' => array( | ||
| 'constant' => 'DOMINANT_COLOR_IMAGES_VERSION', | ||
| ), | ||
| 'embed-optimizer' => array( | ||
| 'constant' => 'EMBED_OPTIMIZER_VERSION', | ||
| 'experimental' => true, | ||
| ), | ||
| // TODO: Add image loading optimization plugin, dependent of Optimization Detective, once ready for end users. | ||
| 'performant-translations' => 'PERFORMANT_TRANSLATIONS_VERSION', | ||
| 'auto-sizes' => 'IMAGE_AUTO_SIZES_VERSION', | ||
| 'speculation-rules' => 'SPECULATION_RULES_VERSION', | ||
| 'performant-translations' => array( | ||
| 'constant' => 'PERFORMANT_TRANSLATIONS_VERSION', | ||
| ), | ||
| 'speculation-rules' => array( | ||
| 'constant' => 'SPECULATION_RULES_VERSION', | ||
| ), | ||
| 'webp-uploads' => array( | ||
| 'constant' => 'WEBP_UPLOADS_VERSION', | ||
| ), | ||
| ); | ||
| } | ||
|
|
||
| /** | ||
| * Gets the standalone plugin constants used for each available standalone plugin. | ||
| * | ||
| * @since 2.9.0 | ||
| * @since n.e.x.t The $source parameter was removed. | ||
| * | ||
| * @return array<string, string> Map of plugin slug and the version constant used. | ||
| */ | ||
| function perflab_get_standalone_plugin_version_constants() { | ||
| return wp_list_pluck( perflab_get_standalone_plugin_data(), 'constant' ); | ||
| } | ||
|
|
||
| /** | ||
| * Places the Performance Lab's object cache drop-in in the drop-ins folder. | ||
| * | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.