-
Notifications
You must be signed in to change notification settings - Fork 102
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
Install and activate Optimization Detective when the Embed Optimizer feature is activated from the Performance screen #1644
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,14 +83,15 @@ function perflab_render_generator(): void { | |
* | ||
* @since 3.0.0 | ||
* | ||
* @return array<string, array{'constant': string, 'experimental'?: bool}> Associative array of $plugin_slug => $plugin_data pairs. | ||
* @return array<string, array{'constant': string, 'experimental'?: bool, 'suggest'?: string[]}> Associative array of $plugin_slug => $plugin_data pairs. | ||
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. I'm not sure we want to establish this as something we may want to do more, given that this is not a thing that WordPress Core supports. Therefore instead of introducing a "schema" change here, I think we should for now hard-code this in |
||
*/ | ||
function perflab_get_standalone_plugin_data(): array { | ||
/* | ||
* Alphabetically sorted list of plugin slugs and their data. | ||
* Supported keys per plugin are: | ||
* - 'constant' (string, required) | ||
* - 'experimental' (boolean, optional) | ||
* - 'suggest' (string[], optional) | ||
*/ | ||
return array( | ||
'auto-sizes' => array( | ||
|
@@ -103,6 +104,7 @@ function perflab_get_standalone_plugin_data(): array { | |
'embed-optimizer' => array( | ||
'constant' => 'EMBED_OPTIMIZER_VERSION', | ||
'experimental' => true, | ||
'suggest' => array( 'optimization-detective' ), | ||
), | ||
'image-prioritizer' => array( | ||
'constant' => 'IMAGE_PRIORITIZER_VERSION', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my other comment: For those reasons, I think we should simply hard-code here: If
embed-optimizer
, addoptimization-detective
torequires_plugins
.