PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | json-endpoints/jetpack/class.jetpack-json-api-plugins-get-endpoint.php +49 -0 16.2-beta → 16.3 View file →
@@ -1,0 +1,49 @@
1 +<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2 +
3 +if ( ! defined( 'ABSPATH' ) ) {
4 + exit( 0 );
5 +}
6 +
7 +/**
8 + * JSON API plugins get endpoint.
9 + */
10 +new Jetpack_JSON_API_Plugins_Get_Endpoint(
11 + array(
12 + 'description' => 'Get the Plugin data.',
13 + 'method' => 'GET',
14 + 'path' => '/sites/%s/plugins/%s/',
15 + 'min_version' => '1',
16 + 'max_version' => '1.1',
17 + 'stat' => 'plugins:1',
18 + 'path_labels' => array(
19 + '$site' => '(int|string) The site ID, The site domain',
20 + '$plugin' => '(string) The plugin ID',
21 + ),
22 + 'allow_jetpack_site_auth' => true,
23 + 'response_format' => Jetpack_JSON_API_Plugins_Endpoint::$_response_format,
24 + 'example_request_data' => array(
25 + 'headers' => array(
26 + 'authorization' => 'Bearer YOUR_API_TOKEN',
27 + ),
28 + ),
29 + 'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/example.wordpress.org/plugins/hello-dolly%20hello',
30 + )
31 +);
32 +
33 +/**
34 + * Plugins get endpoint class.
35 + *
36 + * GET /sites/%s/plugins/%s
37 + *
38 + * No v1.2 version since it is .com only
39 + *
40 + * @phan-constructor-used-for-side-effects
41 + */
42 +class Jetpack_JSON_API_Plugins_Get_Endpoint extends Jetpack_JSON_API_Plugins_Endpoint {
43 + /**
44 + * Needed capabilities.
45 + *
46 + * @var string
47 + */
48 + protected $needed_capabilities = 'activate_plugins';
49 +}