-
Notifications
You must be signed in to change notification settings - Fork 101
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
Account for plugin dependencies when storing relevant plugin info #1613
Account for plugin dependencies when storing relevant plugin info #1613
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
bd14a92
to
f385a43
Compare
@@ -19,7 +19,7 @@ | |||
* @return array{name: string, slug: string, short_description: string, requires: string|false, requires_php: string|false, requires_plugins: string[], download_link: string, version: string}|WP_Error Array of plugin data or WP_Error if failed. | |||
*/ | |||
function perflab_query_plugin_info( string $plugin_slug ) { | |||
$transient_key = 'perflab_plugins_info'; | |||
$transient_key = 'perflab_plugins_info-v2'; |
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.
The transient key needs to be bumped since sites may already have downloaded bad plugin data with the old key.
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.
Seems like we should include a hash of the plugin version or something so that this type of bump would be unnecessary
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.
Oh, additionally, we should probably update the logic below so that if a slug is not found in the cache, it tries to request it from the API instead of returning a WP_Error
right away.
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.
We could, but this is analogous to the $wp_db_version
in core which doesn't necessarily need to change with each plugin release.
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.
Oh, additionally, we should probably update the logic below so that if a slug is not found in the cache, it tries to request it from the API instead of returning a
WP_Error
right away.
Yeah, that's a good idea too.
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.
Filed in #1617
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: swissspidy <[email protected]>
Updated build for testing: performance-lab.zip |
Post 3.5.0 release merge
… fix/storing-standalone-plugin-info
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.
Looks good, fixes the issue in my testing
Pending release diffs from 3.5.0:
|
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.
Thanks @westonruter and everyone involved in fixing this so promptly in a hotfix!
While I understand how this resolves the problem, I wonder why optimization-detective
is not part of the perflab_get_standalone_plugin_data()
list in the first place. Did we not want to include it only because it's an infrastructure plugin?
$standalone_plugins = array_flip( perflab_get_standalone_plugins() ); | ||
$standalone_plugins = array_merge( | ||
array_flip( perflab_get_standalone_plugins() ), | ||
array( 'optimization-detective' => array() ) // TODO: Programmatically discover the plugin dependencies and add them here. |
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.
Is there an issue already for this?
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.
Yes: #1616
@felixarntz I recall it was to avoid having Optimization Detective as a separate feature listed on the Performance screen since it doesn't provide features on its own. |
This is a follow-up hotfix to #1573 which broke the ability to install the Image Prioritizer plugin from the Performance features screen since the fetched plugin info did not include plugin dependencies, specifically Optimization Detective.
This also bumps the plugin version to 3.5.1.