Skip to content

Add V1.2 Plugin Endpoints#7843

Merged
oskosk merged 9 commits intomasterfrom
update/plugins-api-endpoints-v1.2
Oct 18, 2017
Merged

Add V1.2 Plugin Endpoints#7843
oskosk merged 9 commits intomasterfrom
update/plugins-api-endpoints-v1.2

Conversation

@enejb
Copy link
Copy Markdown
Member

@enejb enejb commented Sep 23, 2017

V1.2 of the api

  • returns no errors if the action state is set to what was expected already
  • Updated the attributes, removes id, and next autoupdate timestamp
  • adds reason for why autoupdate will not work

Changes proposed in this Pull Request:

Testing instructions:

  • See D7358-code

Proposed changelog entry for your changes:

@enejb enejb requested a review from a team as a code owner September 23, 2017 17:07
@jeherve jeherve added [Feature] WPCOM API [Status] Needs Review This PR is ready for review. Enhancement Changes to an existing feature — removing, adding, or changing parts of it labels Sep 25, 2017
Copy link
Copy Markdown
Contributor

@zinigor zinigor left a comment

Choose a reason for hiding this comment

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

So far looks good, but if I understand correctly, current plugin management code on Calypso uses 1.1. Is there a way to test 1.2 as well?

@zinigor zinigor added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Sep 26, 2017
@enejb
Copy link
Copy Markdown
Member Author

enejb commented Sep 29, 2017

Yes I use the developer console developer.wordpress.com/docs/api/console/ and but you need to patch the code as expected.

$for_output
);
break;
case 'plugin_v1_2' :
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we could do

case 'plugin' :
case 'plugin_v1_2' :

and extend the case with

if ( === `plugin_v1_2` ) {
do something in particular
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good idea

$result = delete_plugins( array( $plugin ) );
if ( is_wp_error( $result ) ) {
$error = $this->log[ $plugin ][] = $result->get_error_message();
$error = $this->log[$plugin][] = $result->get_error_message();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

missing spaces around $plugin

$error = $this->log[$plugin][] = $result->get_error_message();
} else {
$this->log[ $plugin ][] = 'Plugin deleted';
$this->log[$plugin][] = 'Plugin deleted';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

missing spaces around $plugin

'action_links' => '(array) An array of action links that the plugin uses.',
);

static $_response_format_v1_2 = array(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do we need to declare it here again?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So that we have something to reference when we declare the endpoint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could we remove the other and use this one?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Don't we need both for backwards compatibility?

@enejb enejb force-pushed the update/plugins-api-endpoints-v1.2 branch 2 times, most recently from 1009764 to 188fd96 Compare October 16, 2017 23:10
@enejb enejb force-pushed the update/plugins-api-endpoints-v1.2 branch from d498aa1 to c2ddea1 Compare October 17, 2017 17:05
@enejb enejb added [Status] Needs Review This PR is ready for review. and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Oct 17, 2017
@enejb enejb added this to the 5.5 milestone Oct 17, 2017
@oskosk oskosk added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Oct 18, 2017
@oskosk oskosk merged commit b0cda18 into master Oct 18, 2017
@oskosk oskosk removed the [Status] Ready to Merge Go ahead, you can push that green button! label Oct 18, 2017
@oskosk oskosk deleted the update/plugins-api-endpoints-v1.2 branch October 18, 2017 18:27
@anomiex anomiex mentioned this pull request May 15, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] WPCOM API Touches WP.com Files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants