| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
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 props-bot label. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. Co-authored-by: westonruter <westonruter@git.wordpress.org> Co-authored-by: swissspidy <swissspidy@git.wordpress.org> Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org> To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This first came up in #1168 (comment).
I felt it was strange that perflab_install_activate_plugin_callback() was relying on both a slug and a file query var to be passed, with when the latter is absent then the plugin is installed. It assumes that if file is absent, then the plugin is not installed. But it could be that someone installed the plugin in another session while that screen is open, meaning that the file query var check would result in a plugin attempting to be installed when it is actually already installed.
So this PR gets rid of the file query var in favor of exclusively sending the slug query var. Then in the perflab_install_activate_plugin_callback() function it takes the plugin slug and checks among all the installed plugins whether one of them (via the plugin file) to see if it is installed. If not, then it goes ahead and installs it.
This also improves the variable terminology to use $plugin_file rather than $plugin_basename which seems misleading as it could refer to just the file in the plugin's directory, when in fact it should be something like $slug/load.php.
Lastly, the submitted slug is better validated by checking if it is among any of the actual PL plugin slugs.