-
Notifications
You must be signed in to change notification settings - Fork 82
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
Support 'wporg_status' and 'wporg_last_updated' as optional wp plugin list
fields
#382
Conversation
@janw-me the API-specific stuff should be included in the |
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.
Great start!
I'd like to standardize on wporg_status
and wporg_last_updated
as the key names.
src/Plugin_Command.php
Outdated
protected function get_wporg_data( $plugin_name ) { | ||
$data = [ | ||
'status' => 'no_wp_org', | ||
'last_updated' => '-', |
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.
'last_updated' => '-', | |
'last_updated' => '', |
We can leave this empty when it's not present.
src/Plugin_Command.php
Outdated
*/ | ||
protected function get_wporg_data( $plugin_name ) { | ||
$data = [ | ||
'status' => 'no_wp_org', |
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.
'status' => 'no_wp_org', | |
'status' => '', |
We can leave this empty when it's not present.
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.
I was not happy about the label itself.
But personally I prefer when a check like this tells "something". Empty can feel like an unknown failure.
Are there other places where we leave fields empty?
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.
// Just because the plugin is not in the api, does not mean it was never on .org. | ||
} | ||
|
||
$request = wp_remote_get( "https://plugins.trac.wordpress.org/log/{$plugin_name}/?limit=1&mode=stop_on_copy&format=rss" ); |
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.
Should we only make this request if we're checking for the date?
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.
I made a better check in d7ec274
The answer is, not always,
When the call to api.wp is not succesfull, we need to check the SVN to distinguish between closed and never on .org.
Relabeling done in: fd9a235 |
src/Plugin_Command.php
Outdated
'auto_update' => false, | ||
'author' => $item_data['Author'], | ||
'wporg_status' => 'no_wp_org', | ||
'wporg_last_updated' => '-', |
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.
As per another comment, let's leave this empty per default instead
'wporg_last_updated' => '-', | |
'wporg_last_updated' => '', |
@janw-me Note: The I'll see how we can adapt it so it does not unnecessarily do the full request. |
@janw-me Once your PR is ready, can you also update the PR description with details on how the new feature works? Thanks! |
wp plugin list
fields
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.
Fixes idea#36
Extends
wp plugin list
with the fields:wp_org
which will get the wp.org status (active, closed or empty)wp_org_updated
which will get the last svn commit date if it's a wp.org plugin.These fields will take a look at the status of the plugin on wordpress.org and if it ever was a .org plugin it can display the last commit date.
Related wp-cli/wp-cli#5859