Skip to content

Commit

Permalink
API: create REST endpoint for 'features/available' (#39442)
Browse files Browse the repository at this point in the history
* API: create REST endpoint for 'features/available'.

* Added test for succesful authentication for the features available rest endpoint

* Removing deprecated legacy features_available

* changelog

---------

Co-authored-by: Juanma Rodriguez Escriche <juanma.rodriguez.escriche@automattic.com>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/10994727170

Upstream-Ref: Automattic/jetpack@e173ec2
  • Loading branch information
darssen authored and matticbot committed Sep 23, 2024
1 parent f7dc990 commit 6d6dfc7
Show file tree
Hide file tree
Showing 40 changed files with 174 additions and 181 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.2-alpha] - unreleased
## [3.1.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Updated package dependencies.

### Removed
- Connection: Removed deprecated method features_available

## [3.0.1] - 2024-09-06
### Changed
- Internal updates.
Expand Down Expand Up @@ -156,7 +159,7 @@ This is an alpha version! The changes listed here are not final.

[1.1.0-beta]: https://github.com/Automattic/jetpack-search-plugin/compare/1.0.0...1.1.0-beta
[1.2.0-beta]: https://github.com/Automattic/jetpack-search-plugin/compare/1.1.0...1.2.0-beta
[3.0.2-alpha]: https://github.com/Automattic/jetpack-search-plugin/compare/3.0.1...3.0.2-alpha
[3.1.0-alpha]: https://github.com/Automattic/jetpack-search-plugin/compare/3.0.1...3.1.0-alpha
[3.0.1]: https://github.com/Automattic/jetpack-search-plugin/compare/3.0.0...3.0.1
[3.0.0]: https://github.com/Automattic/jetpack-search-plugin/compare/2.1.0...3.0.0
[2.1.0]: https://github.com/Automattic/jetpack-search-plugin/compare/2.0.0...2.1.0
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"automattic/jetpack-autoloader": "^3.1.0",
"automattic/jetpack-composer-plugin": "^2.0.3",
"automattic/jetpack-config": "^2.0.4",
"automattic/jetpack-connection": "^4.0.4",
"automattic/jetpack-connection": "^5.0.0-alpha",
"automattic/jetpack-my-jetpack": "^4.35.7-alpha",
"automattic/jetpack-search": "^0.45.5-alpha",
"automattic/jetpack-stats": "^0.13.2",
Expand Down Expand Up @@ -53,7 +53,7 @@
},
"config": {
"sort-packages": true,
"autoloader-suffix": "b462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha",
"autoloader-suffix": "b462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha",
"allow-plugins": {
"automattic/jetpack-autoloader": true,
"automattic/jetpack-composer-plugin": true,
Expand Down
4 changes: 2 additions & 2 deletions jetpack-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Jetpack Search
* Plugin URI: https://jetpack.com/search/
* Description: Easily add cloud-powered instant search and filters to your website or WooCommerce store with advanced algorithms that boost your search results based on traffic to your site.
* Version: 3.0.2-alpha
* Version: 3.1.0-alpha
* Author: Automattic - Jetpack Search team
* Author URI: https://jetpack.com/
* License: GPLv2 or later
Expand All @@ -26,7 +26,7 @@
define( 'JETPACK_SEARCH_PLUGIN__FILE', __FILE__ );
define( 'JETPACK_SEARCH_PLUGIN__FILE_RELATIVE_PATH', plugin_basename( __FILE__ ) );
define( 'JETPACK_SEARCH_PLUGIN__SLUG', 'jetpack-search' );
define( 'JETPACK_SEARCH_PLUGIN__VERSION', '3.0.2-alpha' );
define( 'JETPACK_SEARCH_PLUGIN__VERSION', '3.1.0-alpha' );

defined( 'JETPACK_CLIENT__AUTH_LOCATION' ) || define( 'JETPACK_CLIENT__AUTH_LOCATION', 'header' );

Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-boost-core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.4"
"automattic/jetpack-connection": "^5.0.0-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
8 changes: 8 additions & 0 deletions jetpack_vendor/automattic/jetpack-connection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.0.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Removed
- Connection: Removed deprecated method features_available

## [4.0.4] - 2024-09-18
### Changed
- SSO tooltip: Use anchor element's document instead of the global `document`. [#39364]
Expand Down Expand Up @@ -1202,6 +1209,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Separate the connection library into its own package.

[5.0.0-alpha]: https://github.com/Automattic/jetpack-connection/compare/v4.0.4...v5.0.0-alpha
[4.0.4]: https://github.com/Automattic/jetpack-connection/compare/v4.0.3...v4.0.4
[4.0.3]: https://github.com/Automattic/jetpack-connection/compare/v4.0.2...v4.0.3
[4.0.2]: https://github.com/Automattic/jetpack-connection/compare/v4.0.1...v4.0.2
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-connection/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}"
},
"branch-alias": {
"dev-trunk": "4.0.x-dev"
"dev-trunk": "5.0.x-dev"
},
"dependencies": {
"test-only": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,24 +823,6 @@ public function disconnect_blog() {
return false;
}

/**
* Deprecated: This method is no longer part of the Connection package and now lives on the Jetpack plugin.
*
* Returns what features are available. Uses the slug of the module files.
*
* @deprecated since 1.25.0
* @see Jetpack_XMLRPC_Methods::features_available() in the Jetpack plugin
*
* @return array
*/
public function features_available() {
_deprecated_function( __METHOD__, '1.25.0', 'Jetpack_XMLRPC_Methods::features_available()' );
if ( class_exists( 'Jetpack_XMLRPC_Methods' ) ) {
return Jetpack_XMLRPC_Methods::features_available();
}
return array();
}

/**
* Deprecated: This method is no longer part of the Connection package and now lives on the Jetpack plugin.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class Package_Version {

const PACKAGE_VERSION = '4.0.4';
const PACKAGE_VERSION = '5.0.0-alpha';

const PACKAGE_SLUG = 'connection';

Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-explat/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.4"
"automattic/jetpack-connection": "^5.0.0-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-jitm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"php": ">=7.0",
"automattic/jetpack-a8c-mc-stats": "^2.0.2",
"automattic/jetpack-assets": "^2.3.8",
"automattic/jetpack-connection": "^4.0.4",
"automattic/jetpack-connection": "^5.0.0-alpha",
"automattic/jetpack-device-detection": "^2.1.5",
"automattic/jetpack-logo": "^2.0.4",
"automattic/jetpack-redirect": "^2.0.4",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-licensing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.4"
"automattic/jetpack-connection": "^5.0.0-alpha"
},
"require-dev": {
"automattic/wordbless": "@dev",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-my-jetpack/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"automattic/jetpack-admin-ui": "^0.4.5",
"automattic/jetpack-assets": "^2.3.8",
"automattic/jetpack-boost-speed-score": "^0.3.12",
"automattic/jetpack-connection": "^4.0.4",
"automattic/jetpack-connection": "^5.0.0-alpha",
"automattic/jetpack-explat": "^0.1.8",
"automattic/jetpack-jitm": "^3.1.22",
"automattic/jetpack-licensing": "^2.0.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.4",
"automattic/jetpack-connection": "^5.0.0-alpha",
"automattic/jetpack-plugins-installer": "^0.4.3",
"automattic/jetpack-sync": "^3.13.0",
"automattic/jetpack-protect-models": "^0.3.0-alpha",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-search/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.4",
"automattic/jetpack-connection": "^5.0.0-alpha",
"automattic/jetpack-assets": "^2.3.8",
"automattic/jetpack-constants": "^2.0.4",
"automattic/jetpack-status": "^4.0.1",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-stats/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.4",
"automattic/jetpack-connection": "^5.0.0-alpha",
"automattic/jetpack-constants": "^2.0.4",
"automattic/jetpack-status": "^4.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/automattic/jetpack-sync/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.4",
"automattic/jetpack-connection": "^5.0.0-alpha",
"automattic/jetpack-constants": "^2.0.4",
"automattic/jetpack-password-checker": "^0.3.2",
"automattic/jetpack-ip": "^0.3.0-alpha",
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
),
'jetpack-connection' => array(
'path' => 'jetpack_vendor/automattic/jetpack-connection',
'ver' => '4.0.4',
'ver' => '5.0.0-alpha1727096135',
),
'jetpack-explat' => array(
'path' => 'jetpack_vendor/automattic/jetpack-explat',
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha::getLoader();
return ComposerAutoloaderInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha::getLoader();
2 changes: 1 addition & 1 deletion vendor/autoload_packages.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package automattic/jetpack-autoloader
*/

namespace Automattic\Jetpack\Autoloader\jpb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha\al3_1_0;
namespace Automattic\Jetpack\Autoloader\jpb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha\al3_1_0;

// phpcs:ignore

Expand Down
2 changes: 1 addition & 1 deletion vendor/automattic/jetpack-plans/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=7.0",
"automattic/jetpack-connection": "^4.0.4"
"automattic/jetpack-connection": "^5.0.0-alpha"
},
"require-dev": {
"yoast/phpunit-polyfills": "^1.1.1",
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha
class ComposerAutoloaderInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha
{
private static $loader;

Expand All @@ -24,17 +24,17 @@ public static function getLoader()

require __DIR__ . '/platform_check.php';

spl_autoload_register(array('ComposerAutoloaderInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha::getInitializer($loader));

$loader->setClassMapAuthoritative(true);
$loader->register(true);

$filesToLoad = \Composer\Autoload\ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha
class ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha
{
public static $files = array (
'3773ef3f09c37da5478d578e32b03a4b' => __DIR__ . '/../..' . '/jetpack_vendor/automattic/jetpack-assets/actions.php',
Expand Down Expand Up @@ -259,9 +259,9 @@ class ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_0_2_alpha::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitb462338fb66be23595d68a93345c9e3d_jetpack_searchⓥ3_1_0_alpha::$classMap;

}, null, ClassLoader::class);
}
Expand Down
Loading

0 comments on commit 6d6dfc7

Please sign in to comment.