PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 13.2.4
Jetpack – WP Security, Backup, Speed, & Growth v13.2.4
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 13.7.2 13.8.3 All 506 releases
jetpack / json-endpoints / jetpack / class.jetpack-json-api-plugins-list-endpoint.php

class.jetpack-json-api-plugins-list-endpoint.php in Jetpack – WP Security, Backup, Speed, & Growth 13.2.4, at json-endpoints/jetpack/class.jetpack-json-api-plugins-list-endpoint.php

55 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2
3 new Jetpack_JSON_API_Plugins_List_Endpoint(
4 array(
5 'description' => 'Get installed Plugins on your blog',
6 'method' => 'GET',
7 'path' => '/sites/%s/plugins',
8 'stat' => 'plugins',
9 'min_version' => '1',
10 'max_version' => '1.1',
11 'path_labels' => array(
12 '$site' => '(int|string) The site ID, The site domain',
13 ),
14 'allow_jetpack_site_auth' => true,
15 'response_format' => array(
16 'plugins' => '(plugin) An array of plugin objects.',
17 ),
18 'example_request_data' => array(
19 'headers' => array(
20 'authorization' => 'Bearer YOUR_API_TOKEN',
21 ),
22 ),
23 'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/example.wordpress.org/plugins',
24 )
25 );
26
27 /**
28 * Plugins list endpoint class.
29 *
30 * GET /sites/%s/plugins
31 *
32 * No v1.2 versions since they are .com only
33 */
34 class Jetpack_JSON_API_Plugins_List_Endpoint extends Jetpack_JSON_API_Plugins_Endpoint {
35 /**
36 * Needed capabilities.
37 *
38 * @var string
39 */
40 protected $needed_capabilities = 'activate_plugins';
41
42 /**
43 * Validate the input.
44 *
45 * @param string $plugin - the plugin.
46 *
47 * @return bool
48 */
49 public function validate_input( $plugin ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
50 wp_update_plugins();
51 $this->plugins = array_keys( get_plugins() );
52 return true;
53 }
54 }
55