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

New parameter in CLI to specify the correct slug #644

Closed
davidperezgar opened this issue Sep 18, 2024 · 4 comments · Fixed by #650
Closed

New parameter in CLI to specify the correct slug #644

davidperezgar opened this issue Sep 18, 2024 · 4 comments · Fixed by #650
Assignees
Labels
[Team] Plugin Review Issues owned by Plugin Review Team
Milestone

Comments

@davidperezgar
Copy link
Member

davidperezgar commented Sep 18, 2024

As @dd32 said in #441 comment, we need to specify the correct slug in the wp cli command, so we could compare with the ones that we have in the plugin.

It's related with PR #441

@davidperezgar davidperezgar self-assigned this Sep 18, 2024
@davidperezgar davidperezgar added the [Team] Plugin Review Issues owned by Plugin Review Team label Sep 18, 2024
@davidperezgar davidperezgar added this to the 1.2.0 milestone Sep 18, 2024
@swissspidy
Copy link
Member

Makes sense.

This should only work when specifying a ZIP file or URL, not when trying to check an existing plugin on the site.

@davidperezgar
Copy link
Member Author

davidperezgar commented Sep 18, 2024

I think it could be in any case.

@davidperezgar davidperezgar linked a pull request Sep 18, 2024 that will close this issue
@dd32
Copy link
Member

dd32 commented Sep 19, 2024

This should only work when specifying a ZIP file or URL, not when trying to check an existing plugin on the site.

I disagree, the folder something is installed in isn't necessarily the slug. WordPress installs it into the slug folder by default, but a git checkout might exist in my-plugin.git or my-plugin-trunk alongside the currently released version.

The slug should really be sourced from the API when the explicit slug is not provided:

$plugin_basename = 'plugin-check/plugin.php';
$transient       = get_site_transient( 'update_plugins' );
$plugin_slug     = $transient->response[ $plugin_basename ]->slug ?? ( $transient->no_update[ $plugin_basename ]->slug ?? basename( $plugin_basename ) );

@davidperezgar
Copy link
Member Author

Ok @dd32, @ernilambar is working on the PR #650 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Team] Plugin Review Issues owned by Plugin Review Team
Projects
None yet
3 participants