diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml deleted file mode 100644 index 65489de4..00000000 --- a/.github/workflows/coding-standards.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Coding Standards - -on: - pull_request: - push: - branches: [ master ] - -jobs: - phpcs: - name: PHPCS - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - php: ['8.3'] - - steps: - - name: Cancel previous runs of this workflow (pull requests only) - if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@0.12.1 - with: - access_token: ${{ github.token }} - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - tools: composer:v2 - coverage: none - - - name: Validate Composer - run: composer validate --strict - - - name: Install dependencies - uses: ramsey/composer-install@v3 - with: - composer-options: "--ignore-platform-reqs --optimize-autoloader" - - - name: Run PHPCS - run: composer phpcs diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml deleted file mode 100644 index 0b1a38d3..00000000 --- a/.github/workflows/unit-tests.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Unit Tests - -on: - pull_request: - push: - branches: [ master ] - -jobs: - tests: - name: "WP: ${{ matrix.wp_version }} - PHP: ${{ matrix.php }}" - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php: ['7.4', '8.0', '8.1', '8.2', '8.3'] - wp_version: ['master'] - include: - - php: '8.0' - wp_version: '6.4' - - php: '7.4' - wp_version: '6.4' - - php: '7.4' - wp_version: '6.1' - env: - WP_ENV_PHP_VERSION: ${{ matrix.php }} - WP_VERSION: ${{ matrix.wp_version }} - - steps: - - name: Cancel previous runs of this workflow (pull requests only) - if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@0.12.1 - with: - access_token: ${{ github.token }} - - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Check Gitignored files - run: if [[ ! -z $(git ls-files -i --exclude-standard) ]]; then exit 1; fi - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - tools: composer:v2 - coverage: none - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '>=20.10.0' - - - name: Install Composer dependencies - uses: ramsey/composer-install@v3 - with: - composer-options: "--ignore-platform-reqs --optimize-autoloader" - - - name: Cache node modules - uses: actions/cache@v4 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Validate node modules - run: if [[ -f package.json ]]; then npm audit --audit-level=high --omit=dev --cache ~/.npm; fi - - - name: Install node modules - run: npm ci --cache ~/.npm - - - name: Setup WordPress - run: echo "{\"core\":\"WordPress/WordPress#${WP_VERSION}\"}" >> .wp-env.override.json - - - name: Install WordPress - run: | - chmod -R 767 ./ - npm run wp-env start -- --update - - - name: Running single site unit tests - run: npm run test-php - if: ${{ success() || failure() }} - - - name: Running multisite unit tests - run: npm run test-php-multisite - if: ${{ success() || failure() }} - - - name: Stop Docker environment - run: npm run wp-env stop - if: ${{ success() || failure() }} diff --git a/README.md b/README.md index 29071fd1..7602acdb 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,10 @@ # BuddyPress RESTful API -[![Project Status: Active.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) +[![Project Status: Active.](https://www.repostatus.org/badges/latest/inactive.svg)](https://www.repostatus.org/#inactive) Access your BuddyPress site's data through an easy-to-use HTTP REST API. ## Documentation -We have extensive documentation of each endpoint/components and their CRUD actions: - -## System Requirements (relevant for CI tests only) - -* PHP >= 7.4 -* WP >= 6.1 -* BuddyPress >= Latest - -## Installation - -Drop this plugin in the wp-content/plugins directory and activate it. You need at least [WordPress 6.1](https://wordpress.org/download/) and [BuddyPress](https://buddypress.org/download/) to use the plugin. - -## About - -WordPress is moving towards becoming a fully-fledged application framework. BuddyPress can benefit from this new API by adding endpoints to access social data. - -This plugin provides an easy to use REST API Endpoints for BuddyPress, available via HTTP. Grab your -site's data in simple JSON format, including users, groups, xprofile and more. -Retrieving or updating data is as simple as sending a HTTP request. +This plugin has been deprecated since the V2 of the BP REST API was introduced +at [#9145](https://buddypress.trac.wordpress.org/ticket/9145) and is no longer maintained. diff --git a/bp-rest.php b/bp-rest.php index 1674d05b..1ac37a1c 100644 --- a/bp-rest.php +++ b/bp-rest.php @@ -168,6 +168,26 @@ function bp_rest() { } add_action( 'bp_rest_api_init', 'bp_rest', 5 ); +/** + * Set the current BP REST namespace. + * + * @return string + */ +function bp_filter_v1_rest_current_rest_namespace() { + return 'buddypress'; +} +add_filter( 'bp_rest_namespace', 'bp_filter_v1_rest_current_rest_namespace' ); + +/** + * Set the current BP REST version. + * + * @return string + */ +function bp_filter_v1_rest_current_rest_version() { + return 'v1'; +} +add_filter( 'bp_rest_version', 'bp_filter_v1_rest_current_rest_version' ); + /** * Filter the Blog url in the WP_REST_Request::from_url(). * @@ -175,7 +195,7 @@ function bp_rest() { * @param string $url URL being requested. * @return WP_REST_Request */ -function bp_filter_rest_request_blog_url( $request, $url ) { +function bp_filter_v1_rest_request_blog_url( $request, $url ) { if ( ! bp_is_active( 'blogs' ) || empty( $url ) ) { return $request; @@ -200,7 +220,7 @@ function bp_filter_rest_request_blog_url( $request, $url ) { return $request; } -add_filter( 'rest_request_from_url', 'bp_filter_rest_request_blog_url', 10, 2 ); +add_filter( 'rest_request_from_url', 'bp_filter_v1_rest_request_blog_url', 10, 2 ); /** * Output BuddyPress blog response. @@ -210,7 +230,7 @@ function bp_filter_rest_request_blog_url( $request, $url ) { * @param WP_REST_Request $request Request used to generate the response. * @return WP_REST_Response */ -function bp_rest_post_dispatch( $response, $instance, $request ) { +function bp_filter_v1_rest_post_dispatch( $response, $instance, $request ) { if ( ! bp_is_active( 'blogs' ) || 404 !== $response->get_status() @@ -256,7 +276,7 @@ function bp_rest_post_dispatch( $response, $instance, $request ) { restore_current_blog(); - // Return it, regardless if it was successfull or not. + // Return it, regardless if it was successful or not. return $response; } -add_filter( 'rest_post_dispatch', 'bp_rest_post_dispatch', 10, 3 ); +add_filter( 'rest_post_dispatch', 'bp_filter_v1_rest_post_dispatch', 10, 3 ); diff --git a/composer.json b/composer.json index ca4920e6..19f35da1 100644 --- a/composer.json +++ b/composer.json @@ -44,5 +44,29 @@ "phpunit": "@test", "phpcs": "@php ./vendor/bin/phpcs . --basepath=.", "phpcbf": "@php ./vendor/bin/phpcbf . --basepath=." + }, + "archive": { + "exclude": [ + "*.xml", + "*.dist", + "*.cache", + "phpcs.xml.dist", + "phpunit.xml.dist", + "wp-env.json", + "composer.json", + "composer.lock", + ".editorconfig", + "CHANGELOG.md", + "CONTRIBUTING.md", + "README.md", + ".gitignore", + ".distignore", + ".deployignore", + ".github/", + ".phpcs/", + "tests/", + "bp-rest-api.zip", + "!vendor/" + ] } } diff --git a/includes/bp-activity/classes/class-bp-rest-activity-endpoint.php b/includes/bp-activity/classes/class-bp-rest-activity-endpoint.php index 89ff4ed8..a33ce249 100644 --- a/includes/bp-activity/classes/class-bp-rest-activity-endpoint.php +++ b/includes/bp-activity/classes/class-bp-rest-activity-endpoint.php @@ -30,6 +30,8 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Activity_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->activity->id; } diff --git a/includes/bp-blogs/classes/class-bp-rest-attachments-blog-avatar-endpoint.php b/includes/bp-blogs/classes/class-bp-rest-attachments-blog-avatar-endpoint.php index 6d2a39c3..3d1c7e04 100644 --- a/includes/bp-blogs/classes/class-bp-rest-attachments-blog-avatar-endpoint.php +++ b/includes/bp-blogs/classes/class-bp-rest-attachments-blog-avatar-endpoint.php @@ -41,6 +41,8 @@ class BP_REST_Attachments_Blog_Avatar_Endpoint extends WP_REST_Controller { * @since 6.0.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Blogs_Avatar_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->blogs->id; $this->blogs_endpoint = new BP_REST_Blogs_Endpoint(); diff --git a/includes/bp-blogs/classes/class-bp-rest-blogs-endpoint.php b/includes/bp-blogs/classes/class-bp-rest-blogs-endpoint.php index 28b3e78f..78ebd32f 100644 --- a/includes/bp-blogs/classes/class-bp-rest-blogs-endpoint.php +++ b/includes/bp-blogs/classes/class-bp-rest-blogs-endpoint.php @@ -24,6 +24,8 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller { * @since 6.0.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Blogs_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->blogs->id; } diff --git a/includes/bp-components/classes/class-bp-rest-components-endpoint.php b/includes/bp-components/classes/class-bp-rest-components-endpoint.php index 713cd6dd..ee6ffdfa 100644 --- a/includes/bp-components/classes/class-bp-rest-components-endpoint.php +++ b/includes/bp-components/classes/class-bp-rest-components-endpoint.php @@ -21,6 +21,8 @@ class BP_REST_Components_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Core_Components_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = 'components'; } diff --git a/includes/bp-friends/classes/class-bp-rest-friends-endpoint.php b/includes/bp-friends/classes/class-bp-rest-friends-endpoint.php index 666c770d..7286bbe9 100644 --- a/includes/bp-friends/classes/class-bp-rest-friends-endpoint.php +++ b/includes/bp-friends/classes/class-bp-rest-friends-endpoint.php @@ -24,6 +24,8 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller { * @since 6.0.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Friends_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->friends->id; } diff --git a/includes/bp-groups/classes/class-bp-rest-attachments-group-avatar-endpoint.php b/includes/bp-groups/classes/class-bp-rest-attachments-group-avatar-endpoint.php index f377022a..f0790615 100644 --- a/includes/bp-groups/classes/class-bp-rest-attachments-group-avatar-endpoint.php +++ b/includes/bp-groups/classes/class-bp-rest-attachments-group-avatar-endpoint.php @@ -58,6 +58,8 @@ class BP_REST_Attachments_Group_Avatar_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_Avatar_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->groups->id; $this->groups_endpoint = new BP_REST_Groups_Endpoint(); diff --git a/includes/bp-groups/classes/class-bp-rest-attachments-group-cover-endpoint.php b/includes/bp-groups/classes/class-bp-rest-attachments-group-cover-endpoint.php index ec973848..408cb75e 100644 --- a/includes/bp-groups/classes/class-bp-rest-attachments-group-cover-endpoint.php +++ b/includes/bp-groups/classes/class-bp-rest-attachments-group-cover-endpoint.php @@ -60,6 +60,8 @@ class BP_REST_Attachments_Group_Cover_Endpoint extends WP_REST_Controller { * @since 6.0.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_Cover_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->groups->id; $this->groups_endpoint = new BP_REST_Groups_Endpoint(); diff --git a/includes/bp-groups/classes/class-bp-rest-group-invites-endpoint.php b/includes/bp-groups/classes/class-bp-rest-group-invites-endpoint.php index 2d2d5a68..15075dbf 100644 --- a/includes/bp-groups/classes/class-bp-rest-group-invites-endpoint.php +++ b/includes/bp-groups/classes/class-bp-rest-group-invites-endpoint.php @@ -33,6 +33,8 @@ class BP_REST_Group_Invites_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_Invite_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->groups->id . '/invites'; $this->groups_endpoint = new BP_REST_Groups_Endpoint(); diff --git a/includes/bp-groups/classes/class-bp-rest-group-membership-endpoint.php b/includes/bp-groups/classes/class-bp-rest-group-membership-endpoint.php index ecd2e86e..7b13eebd 100644 --- a/includes/bp-groups/classes/class-bp-rest-group-membership-endpoint.php +++ b/includes/bp-groups/classes/class-bp-rest-group-membership-endpoint.php @@ -42,6 +42,8 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_Membership_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->groups->id; $this->groups_endpoint = new BP_REST_Groups_Endpoint(); diff --git a/includes/bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php b/includes/bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php index a0ae22e4..0c803d5a 100644 --- a/includes/bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php +++ b/includes/bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php @@ -42,6 +42,8 @@ class BP_REST_Group_Membership_Request_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_Membership_Request_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->groups->id . '/membership-requests'; $this->groups_endpoint = new BP_REST_Groups_Endpoint(); diff --git a/includes/bp-groups/classes/class-bp-rest-groups-endpoint.php b/includes/bp-groups/classes/class-bp-rest-groups-endpoint.php index fcba9d76..f31db06e 100644 --- a/includes/bp-groups/classes/class-bp-rest-groups-endpoint.php +++ b/includes/bp-groups/classes/class-bp-rest-groups-endpoint.php @@ -21,6 +21,8 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Groups_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->groups->id; } diff --git a/includes/bp-members/classes/class-bp-rest-attachments-member-avatar-endpoint.php b/includes/bp-members/classes/class-bp-rest-attachments-member-avatar-endpoint.php index 8d0ad08a..71950f96 100644 --- a/includes/bp-members/classes/class-bp-rest-attachments-member-avatar-endpoint.php +++ b/includes/bp-members/classes/class-bp-rest-attachments-member-avatar-endpoint.php @@ -49,6 +49,8 @@ class BP_REST_Attachments_Member_Avatar_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Members_Avatar_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = 'members'; $this->avatar_instance = new BP_Attachment_Avatar(); diff --git a/includes/bp-members/classes/class-bp-rest-attachments-member-cover-endpoint.php b/includes/bp-members/classes/class-bp-rest-attachments-member-cover-endpoint.php index 1db9e2bf..1e2620a7 100644 --- a/includes/bp-members/classes/class-bp-rest-attachments-member-cover-endpoint.php +++ b/includes/bp-members/classes/class-bp-rest-attachments-member-cover-endpoint.php @@ -51,6 +51,8 @@ class BP_REST_Attachments_Member_Cover_Endpoint extends WP_REST_Controller { * @since 6.0.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Members_Cover_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = 'members'; $this->attachment_instance = new BP_Attachment_Cover_Image(); diff --git a/includes/bp-members/classes/class-bp-rest-members-endpoint.php b/includes/bp-members/classes/class-bp-rest-members-endpoint.php index 269f9fea..28fd9190 100644 --- a/includes/bp-members/classes/class-bp-rest-members-endpoint.php +++ b/includes/bp-members/classes/class-bp-rest-members-endpoint.php @@ -24,6 +24,8 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Members_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = 'members'; } diff --git a/includes/bp-members/classes/class-bp-rest-signup-endpoint.php b/includes/bp-members/classes/class-bp-rest-signup-endpoint.php index aabca216..37a67282 100644 --- a/includes/bp-members/classes/class-bp-rest-signup-endpoint.php +++ b/includes/bp-members/classes/class-bp-rest-signup-endpoint.php @@ -26,6 +26,8 @@ class BP_REST_Signup_Endpoint extends WP_REST_Controller { * @since 6.0.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Members_Signup_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = 'signup'; } diff --git a/includes/bp-messages/classes/class-bp-rest-messages-endpoint.php b/includes/bp-messages/classes/class-bp-rest-messages-endpoint.php index cc49f823..c5dff84e 100644 --- a/includes/bp-messages/classes/class-bp-rest-messages-endpoint.php +++ b/includes/bp-messages/classes/class-bp-rest-messages-endpoint.php @@ -25,6 +25,8 @@ class BP_REST_Messages_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Messages_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->messages->id; } diff --git a/includes/bp-messages/classes/class-bp-rest-sitewide-notices-endpoint.php b/includes/bp-messages/classes/class-bp-rest-sitewide-notices-endpoint.php index 9784f5ec..d41e8234 100644 --- a/includes/bp-messages/classes/class-bp-rest-sitewide-notices-endpoint.php +++ b/includes/bp-messages/classes/class-bp-rest-sitewide-notices-endpoint.php @@ -21,6 +21,8 @@ class BP_REST_Sitewide_Notices_Endpoint extends WP_REST_Controller { * @since 9.0.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Messages_Sitewide_Notices_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = 'sitewide-notices'; } diff --git a/includes/bp-notifications/classes/class-bp-rest-notifications-endpoint.php b/includes/bp-notifications/classes/class-bp-rest-notifications-endpoint.php index 525a985c..0f1b8b95 100644 --- a/includes/bp-notifications/classes/class-bp-rest-notifications-endpoint.php +++ b/includes/bp-notifications/classes/class-bp-rest-notifications-endpoint.php @@ -21,6 +21,8 @@ class BP_REST_Notifications_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_Notifications_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->notifications->id; } diff --git a/includes/bp-xprofile/classes/class-bp-rest-xprofile-data-endpoint.php b/includes/bp-xprofile/classes/class-bp-rest-xprofile-data-endpoint.php index 49621b21..7c4d0a9e 100644 --- a/includes/bp-xprofile/classes/class-bp-rest-xprofile-data-endpoint.php +++ b/includes/bp-xprofile/classes/class-bp-rest-xprofile-data-endpoint.php @@ -32,6 +32,8 @@ class BP_REST_XProfile_Data_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_XProfile_Data_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->profile->id; $this->fields_endpoint = new BP_REST_XProfile_Fields_Endpoint(); diff --git a/includes/bp-xprofile/classes/class-bp-rest-xprofile-field-groups-endpoint.php b/includes/bp-xprofile/classes/class-bp-rest-xprofile-field-groups-endpoint.php index 38a59e21..c06bae34 100644 --- a/includes/bp-xprofile/classes/class-bp-rest-xprofile-field-groups-endpoint.php +++ b/includes/bp-xprofile/classes/class-bp-rest-xprofile-field-groups-endpoint.php @@ -33,6 +33,8 @@ class BP_REST_XProfile_Field_Groups_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_XProfile_Field_Groups_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->profile->id . '/groups'; $this->fields_endpoint = new BP_REST_XProfile_Fields_Endpoint(); diff --git a/includes/bp-xprofile/classes/class-bp-rest-xprofile-fields-endpoint.php b/includes/bp-xprofile/classes/class-bp-rest-xprofile-fields-endpoint.php index da1c85fc..13ecdaa7 100644 --- a/includes/bp-xprofile/classes/class-bp-rest-xprofile-fields-endpoint.php +++ b/includes/bp-xprofile/classes/class-bp-rest-xprofile-fields-endpoint.php @@ -24,6 +24,8 @@ class BP_REST_XProfile_Fields_Endpoint extends WP_REST_Controller { * @since 0.1.0 */ public function __construct() { + _deprecated_class( __CLASS__, '15.0.0', 'BP_XProfile_Fields_REST_Controller' ); + $this->namespace = bp_rest_namespace() . '/' . bp_rest_version(); $this->rest_base = buddypress()->profile->id . '/fields'; } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3d67389f..21b8e48a 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,7 +9,7 @@ const WP_TESTS_PHPUNIT_POLYFILLS_PATH = __DIR__ . '/../vendor/yoast/phpunit-polyfills'; // Define constants. -require( dirname( __FILE__ ) . '/define-constants.php' ); +require __DIR__ . '/define-constants.php'; if ( ! file_exists( WP_TESTS_DIR . '/includes/functions.php' ) ) { die( "The WordPress PHPUnit test suite could not be found.\n" ); @@ -31,7 +31,7 @@ function _manually_load_plugins() { require_once BP_TESTS_DIR . '/includes/loader.php'; // Load our plugin. - require_once dirname( __FILE__ ) . '/../bp-rest.php'; + require_once __DIR__ . '/../bp-rest.php'; } tests_add_filter( 'muplugins_loaded', '_manually_load_plugins' ); diff --git a/.wp-env.json b/wp-env.json similarity index 100% rename from .wp-env.json rename to wp-env.json