BP Docs-Chat Summary April 24, 2024

BP Documentation tracker status.

Between April 10 & April 24, we haven’t progressed much about documentation. We were very busy working on the 12.4.1 security release and on the 14.0.0 tickets.

  • PR created : 0
  • PR reviewed : 0
  • PR converted : 0

The need to prioritize Documentation tasks

Following up our previous discussions about our various Multisite configs…

@vapvarun shared with us the great work he’s been doing into this area to prepare a documentation resource about it. He made 4 videos to explain the 4 possible BP Multisite configs:

BP Activated at the Network level, community area on main site of the network
BP only activated on one of the site of the network.
BP Activated at the Network level, community area on a secondary site of the Network
BP Multiblog config 🧗‍♂️

@im4th shared his feelings about all these set-ups : as we’re a short contributor team, we need to prioritize what we document according to the “popularity” of the set-up (in terms of number of people using it). Let’s pick the 2 or 3 most used configs and concentrate on their documentations.

@vapvarun picked the 3 first configs to work on a PR he has since submitted 💪 . He also plans to work on pushing PRs about these 2 other migrate tasks:

Documentation pages to use in BP Admin Screen help tabs

@emaralive has been referencing all BP Admin Screens needing a documentation link into this GH discussion. We decided to share migrate tasks about these documentation pages this way:

Open Floor

@emaralive made a very interesting “map” of all Admin places where BuddyPress is adding pages.

@vapvarun introduced Pooja Sahgal to the team, she will regularly contribute to BP Forums, welcome on board 😍.

Next Docs-Chat

It will happen on May 15, 2024 at 19:00 UTC in #BuddyPress. (We decided to postpone meetings by a week to fully test BuddyPress 12.4.1 & prepare a 12.5 minor release).

#docs-chat, #documentation, #summary

Signup fields via the REST API

With the purpose of adding parity between the web version and the REST API, we are introducing a minor breaking change in the next version of BuddyPress (v14.0.0 ) in how the BuddyPress REST API handles Signup XProfile fields.

In this article, I’ll try to explain what the change is, why is necessary, and how you can prepare your app for these changes which will be available when the new BuddyPress version is released.

What problem are we solving?

Currently, our REST API does not support getting Signup XProfile fields or saving them. This means that when creating a signup via the API, there is only one XProfile field available, the user_name argument. This argument is mapped to the required “Name (Primary)” field.

However, if a community administrator creates more custom Signup fields, they would not be able to use them via the REST API. This creates an incomplete experience for API consumers that need to have signup fields in their apps.

As part of the, not yet released, v14.0.0 version, we are changing this behavior. API consumers will be able to return the Signup XProfile fields, and send them while creating a signup via the API. 🥳

Fetch Signup fields

To fetch signup fields only, we introduced a new argument, signup_fields_only. Here is an example of a request to select the Signup group, using the XProfile Groups endpoint:

bp.apiRequest( {
  path: 'buddypress/v1/xprofile/groups',
  type: 'GET',
  data: {
    context: 'view',
    fetch_fields: true // <-- required, in this endpoint.
    signup_fields_only: true // <--- new argument.
  }
} ).done( function( data ) {
  return data; // <--- It returns the signup fields only.
} ).fail( function( error ) {
  return error;
} );

Here is an example of a request to select only the Signup fields, using the XProfile Fields endpoint:

bp.apiRequest( {
  path: 'buddypress/v1/xprofile/fields',
  type: 'GET',
  data: {
    context: 'view',
    signup_fields_only: true // <--- new argument.
  }
} ).done( function( data ) {
  return data; // <--- It returns the signup fields only.
} ).fail( function( error ) {
  return error;
} );

Send signup fields

While creating a signup via the API, a new argument, signup_field_data is required. This argument is mapped to the Signup fields (the order the field data is sent is not important).

bp.apiRequest( {
  path: 'buddypress/v1/signup',
  type: 'POST',
  data: {
    context: 'edit',
    user_login: 'testuser',
    user_email: 'test@user.mail',
    password: 'password' // Always use strong passwords, not like this one!
    "signup_field_data[0][field_id]": "36",
	"signup_field_data[0][value]": "Arabic, English",
	"signup_field_data[1][field_id]": "31",
	"signup_field_data[1][value]": "Sometimes, I never travel",
	"signup_field_data[2][field_id]": "35",
	"signup_field_data[2][value]": "This is some text for my profile.",
	"signup_field_data[3][field_id]": "1",
	"signup_field_data[3][value]": "New Profile",
	"signup_field_data[4][field_id]": "19",
	"signup_field_data[4][value]": "Option 01, Option 03",
  }
} ).done( function( data ) {
  return data;
} ).fail( function( error ) {
  return error;
} );

The most noticeable change is that required fields will be respected in the API now. If you send a request creating a signup without the required fields (or sending empty values for the required fields), the REST API will complain about it, just like the web version.

Here is an example of a failed request without a required field.

{
  "code": "bp_rest_signup_field_required",
  "data": {
    "status": 500
  },
  "message": "The CUSTOM field is required."
}

How to migrate

Now, how can you prepare for this change? If your project makes use of the now deprecated user_name argument, you’ll need to update your app to use the new signup_field_data argument when creating a signup via the REST API.

We haven’t updated our documentation yet with those changes, but here is the schema for the new argument:

"signup_field_data": {
  "description": "The XProfile field data for the new user.",
  "items": {
    "properties": {
      "field_id": {
        "description": "The XProfile field ID.",
        "required": true,
        "type": "integer",
      },
      "value": {
        "default": "",
        "description": "The value(s) (comma separated list of values needs to be used in case of multiple values) for the field data.",
        "required": true,
        "type": "string",
      },
      "visibility": {
        "default": "public",
        "description": "The visibility for the XProfile field.",
        "enum": [
          "public",
          "adminsonly",
          "loggedin",
          "friends"
        ],
        "required": false,
        "type": "string",
      }
    },
    "type": "object"
  },
}

The new field expects an array of data with the field_id, its value, and the visibility of the field.

Why do I need to move my code into the new signup_field_data?

One important goal of this change is to add parity with the web version. Keeping the new and the old argument user_name would defeat this purpose. It would also create unnecessary handling of fallbacks, and ultimately confusion.

A user could send the “Name (Primary)” field via user_name argument or using the new signup_field_data argument. Required fields would also not be truly required. Essentially, creating a lot of code to account for both situations.

It’s also accurate to say that the old behavior is a bug, not a feature (or at the very least an MVP of an MVP of an MVP). We are correcting this bug as part of this change.

=D

#developers, #rest-api

WP CLI BuddyPress – v3.0.0

🎈 A new release of WP CLI BuddyPress, v3.0.0, is now available.

The main purpose of this release was to introduce new commands, and polish the implementation of available commands. As always, you can also skip directly to the detailed changelog if you prefer.

This update will be bundled with BuddyPress core when the v14.0.0 version is released. You can also test the new changes beforehand by following the recommended installation methods.

New Commands

We are introducing a few more commands to the package. Mainly:

wp bp notice

This new command can be used to manage Sitewide Notices via the command line.

wp bp notice

wp bp activity delete-comment

This new command can be used to remove activity comments via the command line.

delete-comment and remove-comment are aliases added for the, now removed, wp bp activity delete_comment command.

wp bp activity delete-comment

Removed Commands

wp bp group invite remove

This command was removed and replaced by the new wp bp group invite uninvite command to avoid a conflict, and confusion, with the delete/remove command (where the invite is actually deleted from the database). This is the new way to uninvite a user via the BP CLI.

wp bp activity delete_comment

This command was removed and replaced by the new wp bp activity delete-comment.

wp bp activity favorite user_items

The user_items and items command aliases were removed from the wp bp activity favorite list command.

Noteworthy changes to commands

We polished the implementation of many commands. Here are some noteworthy changes:

  • wp bp tool signup this command can be used to activate or deactivate the BuddyPress signup feature in a multisite installation.
  • Support for the --silence flag introduced to create commands.
  • Support for the --silence flag introduced to the wp bp activity comment command.
  • Support for the --format and --silent flags for the generate commands.
  • Confirmation message updated for delete commands that accepts multiple values
  • PHPDoc improvements
    • All generate commands’ output were standardized
    • All create commands’ output were standardized
    • All delete commands’ output were standardized
    • All delete commands’ aliases were standardized
    • All list commands were standardized
    • Invalid --format option haml removed

Beginning testing against PHP 8.3

We are not testing for PHP 8.3. This paves the way for eventually supporting the 8.3 version.

And several other minor changes to improve the codebase, and make sure the commands would run smoothly.

#14-0-0, #wp-cli

BP Dev-Chat Agenda May 2, 2024

Hi!

Our next development meeting will happen on May 2 at 19:00 UTC (today!) in #BuddyPress. Here’s our agenda:

  • Needed follow-up to 12.4.1 Security Release.
    • Build a new maintenance release (12.5.0) to fix some too conservative or wrong escapes (asap!).
    • Make 14.0.0 and following BP versions include a WPCS Security Escape check for each grunt commit or PR submission.
  • 14.0.0 ticket updates
  • Open floor

If you have specific/additional points you need to discuss about, please share them into the comments area of this post.

PS: this meeting as well as next week one are exceptionally happening on a Thursday (due to the fact May 1st and May 8th are days off in 🇫🇷).

#14-0-0, #agenda, #dev-chat

BP Dev-Chat Summary April 17, 2024

🧰 BuddyPress 14.0.0

We first talked about ticket #8728 (allowing group mods/admins to delete corresponding group activities):

  • @emaralive did a great job reviewing existing group roles capabilities. We now have a clear understanding of these.
  • He also worked on fixing the filter callback so that it actually do what it was built for: allowing group mods/admins to delete corresponding activities.
  • @espellcaste has prepared unit tests about it.
  • The last point we needed to take a decision about was to introduce a global community setting to let the site’s Administrator to allow/disallow group mods/admins to delete activity as well as a « per group » basis setting to let the group creator to allow/disallow this delegation for their group. We all agreed it will be a nice addition. So next steps about this ticket is to build the corresponding UIs (BP Settings Admin screen + Group’s create/manage/admin screens).
  • As this summary is being written very late, @emaralive has updated the patch on the ticket 4 days ago and suggests we don’t need a group setting: promoting members to mods or admins seems sufficient.

We then talked about the Activity Block Editor (see ticket #8319):

« Videmo » of the BP Activity Block Editor Add-on
  • It’s still a work in progress that needs improvements such as being able to use this editor to comment an activity (@emaralive noted it), making sure using the paragraph block’s alignment button actually aligns the posted activity.
  • It replaces the current Activity WP Admin screen with a specific Activity stream using this editor to post, edit & comment existing activities.
  • Goal is to first publish it as « feature as a plugin » on WordPress Plugin directory, see how people welcome/use it before eventually merging it into the BP Activity component.

We finally talked about other tickets progress:

  • #8976 Adding custom xProfile fields to registration REST API endpoint: @espellcaste has made great progress about it and should have it fixed soon.
  • #9129 Automated tests with cache services: @espellcaste informed us we’d need a specific GitHub Action to reach this goal as it doesn’t seem possible to use the WordPress env package.
  • #6123 has been fixed, 14.0.0 won’t create users during a regular WP user registration, see this developer note for additional information.

    14.0.0 schedule reminder

    • June 3: 14.0.0-beta1.
    • July 8: 14.0.0.

    Next Dev-Chat

    It will happen today Thursday May 2, 2024 at 19:00 UTC (exceptionaly as yesterday was a day off) in #BuddyPress.

    #14-0-0, #agenda, #dev-chat, #summary

    BuddyPress 12.4.1 Security Release

    Please upgrade asap.

    🚨🙏

    #12-4-1, #release, #security

    BP Docs-Chat Agenda April 24, 2024

    Hi!

    Our next documentation meeting will happen on April 24 at 19:00 UTC (today) in #BuddyPress. Here’s our agenda:

    If you have specific/additional points you need to discuss, please share them in the comments area of this post.

    #agenda, #docs-chat

    Signups are becoming members only after validating their accounts

    BuddyPress is using the $wpdb->signups table to manage signups since 2.0.0. This table which is only available into the WordPress Multisite DB schema is generated by BuddyPress on regular WordPress installs.

    For 10 years we’ve been carrying on creating users to preserve backwards compatibility with 3rd party plugins relying on our “prehistorical” way of dealing with signups on regular WordPress configs, today we are finally deprecating this behavior to improve BuddyPress consistency and fix this 9 years old issue.

    If you are still playing with the activation_key user meta and the {$wpdb->users}.user_status (which we used to set to 2 to mark a user as a signup), please update your code so that you now fully enjoy our BP Signups API.

    In 14.0.0, we are throwing deprecation notices if you use the BP “prehistorical” way to deal with signups, but please note we will completely remove this code in 15.0.0.

    #14-0-0, #developers

    BP Docs-Chat Summary April 10, 2024

    BP Documentation tracker status.

    Phase 1 (a.k.a., BP Codex migration meta task ) was completed which resulted in a total quantity of  271 BP Codex pages reviewed,  which netted 208 pages to be ignored and 63 pages to be migrated.

    The actual count of issues created were:

    • 209 ignore – the extra issue was a duplicate – 209 -1 = 208
    • 58 migrate – there were 5 pages that were included within a single issue – 58 + 5 = 63

    For Phase 2 (a.k.a., BP Documentation meta task) the main emphasis is document creation and, if necessary, the updating of documents previously created during Phase 1, as well as Phase 2.

    A question was posed (by @emaralive) as to the presentation of statistics for Phase 2; IOW, what should be included? @im4th suggested:

    • PR created
    • PR reviewed
    • PR converted

    In an effort to help facilitate the tracking and gathering of metrics for the statistics @emaralive suggested and completed action to archive the 208 ignore issues. This left a total of 71 issues of which 24 issues were completed , by @im4th and @vapvarun, (status of Done) during Phase 1, which left 47 open issues (status of Todo and In Progress) and the % of complete (as of April 10, 2024) to be 34%.

    Futhermore, @emaralive created additional views within the project for documentation (although, this appeared to have gone unnoticed):

    Although, not explicitly stated, the additional project views could help with the gathering of data in support of the statistics, for example:

    OpenClosed% Complete
    Migrate391933%
    Add6440%
    Update2133%
    Total472434%

    Or:

    TodoIn ProgressDone% Complete
    Migrate3901933%
    Add60440%
    Update20133%
    Total4702434%

    However, presentation of documentation statistics is still open to discussion, since this topic has not been settled.

    Follow-up on BuddyPress Multiblog & BuddyPress Multi Network

    A comment was posted regarding BP Docs-Chat Summary March 28, 2024 and the poster’s concern for the deprecation of the BP_ENABLE_MULTIBLOG constant and whether this would affect a plugin the poster was using.. @im4th volunteered to make a reply to the comment and completed the action.

    @vapvarun reported his efforts in support of documentation for this area of interest (Multiblog/Multi Network/Multisite):

    • The availability of screenshots
    • The availability of 3 dedicated videos

    Additionally, @im4th & @vapvarun conversed a bit about the logistics of embedding/including videos within GH (GitHub) documents.

    Open Floor

    @im4th revealed the completion of a:

    “generic” area for resources common to all Handbooks

    Whereby documents such as the following can reside:

    @emaralive suggested and volunteered to update the main README.md for the bp-documentation repo, since Phase 1 has been completed, which makes the content outdated, along with the removal of 2 issue templates (ignore & migrate) that are no longer relevant. This task has yet to be started and @im4th volunteered to review the changes, once a PR has be generated.

    Next Docs-Chat

    It will happen on April 24, 2024 at 19:00 UTC in #BuddyPress.

    #docs-chat, #documentation, #summary

    BP Dev-Chat Agenda April 17, 2024

    Hi!

    Our next development meeting will happen on April 17 at 19:00 UTC in #BuddyPress. Here’s our agenda:

    If you have specific/additional points you need to discuss about, please share them into the comments area of this post.

    🚀 💫

    #14-0-0, #agenda, #dev-chat