Skip to content
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

Accept plugin zip URL in check command #546

Closed
wants to merge 2 commits into from

Conversation

ernilambar
Copy link
Member

  • Zip is downloaded and kept in temp folder
  • Check will run from the temp folder

@ernilambar ernilambar changed the title Accept plugin URL in check command Accept plugin zip URL in check command Jul 24, 2024
@ernilambar ernilambar marked this pull request as ready for review July 24, 2024 10:37
Copy link

github-actions bot commented Jul 24, 2024

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: ernilambar <[email protected]>
Co-authored-by: swissspidy <[email protected]>
Co-authored-by: mukeshpanchal27 <[email protected]>
Co-authored-by: davidperezgar <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

includes/Utilities/Plugin_Request_Utility.php Outdated Show resolved Hide resolved
* @return string|bool The plugin basename if the plugin is downloaded successfully, false otherwise.
*/
public static function download_plugin( $plugin_url ) {
$response = wp_remote_get( $plugin_url );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happen if someone add zip that is not plugin? For example theme zip?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I have not checked. This PR uses #490 arbitrary path approach. I will create follow-up issue for that PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue - #547

@davidperezgar
Copy link
Member

Why don't we make it in one PR?

@ernilambar
Copy link
Member Author

I tested this PR few more times with different use cases. It has few issues:

  • If URL is invalid, hello.php is being checked. (May be due to the reason that is the file in the main plugins folder)
  • Once I run command with valid URL like https://downloads.wordpress.org/plugin/debug-bar.1.1.6.zip and again run command with another URL but with same plugin slug like https://downloads.wordpress.org/plugin/debug-bar.1.1.6111.zip, it still checks the plugin files from earlier run.

This warrants more investigation. Closing this for now.

@ernilambar ernilambar closed this Jul 25, 2024
@ernilambar ernilambar deleted the accept-plugin-url branch August 15, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants