BP Rewrites, let’s contribute to the next way BuddyPress will parse URLs

Hi BuddyPress Contributors!

Using the WordPress Rewrite API to replace our Legacy URL parser is a challenge we’ve been trying to achieve for 8 years.

It’s a pretty massive and complex change because BuddyPress plugins/themes and even BuddyPress Core 😬 got used to directly write URLs by adding chunks after a directory, a single member item or a single group item permalink.

Today, our Legacy URL parser is analyzing these URL chunks to globally set variables (eg:  buddypress()->current_action) we can check using specific functions (eg: bp_current_action()) to decide how the plugin should behave.

As it’s working mostly fine, we’ve been postponing this change for a while which is making it harder today to actually migrate to the WordPress Rewrite API. As I often write when announcing a release candidate on our official website:

“Release Candidate” means that we believe the new version is ready for release, but with more than 200,000 active installs, hundreds of BuddyPress plugins and Thousands of WordPress themes, it’s possible something was missed. BuddyPress ?.0.0 is slated for release on Month dd, YYYY and we need your help to get there.

Not to mention the potential customizations advanced users can do using specific constants, specific WordPress configurations, or by adding custom code into the mu-plugins directory or inside a bp-custom.php file.

To safely make this change: we need to have enough confidence into the backward compatibility mechanism we’ll put in place. There’s no secret: the only way to reach this level of confidence is to test, test and test again. The more we are to test and the sooner we do these tests during the development cycle, the better it is for end users, plugin developers, theme designers, BP support team, BP development team: anticipating is less painful than healing!

Your contribution is the key to the success of our challenge.

Why migrating? isn’t the Legacy URL parser doing a good job?

It does! But we believe using the WP Rewrite API will improve users BuddyPress experience making it possible to directly use the plugin without having to change the permalink structure if the site is using plain permalinks and making it a piece of cake to customize URL slugs. Moreover, we think following WordPress best practices in this area is important for our project and will help us increase our “forward compatibility” with the WordPress Full Site Editing feature.

BP Rewrites is a “Feature as a plugin” 

We think using the “feature as a plugin” mode can:

  1. make things easier for you (actually us all!) to do this huge amount of testing,
  2. accelerate the development of the code needed to achieve this “WP Rewrites” migration.

1. Once the team will be happy about our improvements on the feature, we’ll make BP Rewrites available from the WordPress.org Plugins directory. To have it running on your site, you’ll simply need to install & activate it like any other plugin. As soon as you deactivate BP Rewrites, it puts everything back to the state it was before its activation.


2. Working on the 9.0.0 release mainly from the BP Blocks GitHub repository showed us it was accelerating our development process. Let’s hope it will be the same for BP Rewrites. We haven’t received more contributions to BP Blocks from GitHub users, but at the very list we make this possible and everyone’s very welcome to contribute to code!

You can already help us with tests & code!

If you’re comfortable with using GitHub and can easily put up a local development environment, or install the BuddyPress one (it requires Docker) or have already one in place, feel free to start contributing to BP Rewrites 😍.

Please take a few minutes to read these contributor guidelines to quickly get started.

What happens once BP Rewrites is activated?

WordPress Plugins Administration screen
PS: the link is Activate on non mulitiste configs.

As soon as you activate BP Rewrites, BuddyPress is using the WordPress Rewrite API, you have no other installation step to achieve. The Legacy directory pages are automatically migrated as specific buddypress custom post type items (let’s call it “BuddyPress directory” post type) used to maintain backward compatibility and make it possible to revert to the BP Legacy URL parser simply by deactivating the BP Rewrites plugin.

If you included BuddyPress pages into a WordPress menu, the menu will automatically be updated to use the “BuddyPress directory” post type.

With BP Rewrites, there’s no need to associate BP Directories with WordPress Pages anymore, as a result the BuddyPress Pages settings administration screen is replaced by the BuddyPress URLs settings administration screen.

Customizing slugs is a piece of cake!

If you go to this new Settings > BuddyPress > URLs administration screen you’ll be able to customize the BuddyPress URL slugs very easily. In the following example I translated the default BuddyPress slugs by their french meaning.

Under the hood changes

To maintain backward compatibility we are still setting global variables (eg:  buddypress()->current_action), so using the specific functions (eg: bp_current_action()) to decide about the behavior of your plugin/theme/custom code can still be done. The only difference is you need to wait a bit longer during the WordPress loading page process to use these functions.

The BP Legacy URL parser is making them available at the 'bp_init' hook (which is very early!) while the BP Rewrite URL parser is now making them available once the WP Query has been parsed: at the 'bp_parse_query' hook. The same “delay” applies to the BuddyPress Components navigation set up, the BuddyPress canonical stack set up and the BuddyPress document title set up.

What still needs to be done?

  • At the risk of being very redundant, we all have to test, test and test again! 
  • We also need to decide about how we can deal with the bad habit we all took when writing BuddyPress URLs into our code base: rather than directly writing URLs by adding chunks after a directory, a single member item or a single group item permalink, we need to introduce Core functions to make sure the custom slugs will be taken in account everywhere. If you look at the code inside the BP Rewrites  src/bp-{component-id}/bp-{component-id}-template.php  files, you’ll see there’s a huge work in front of us, and I’m pretty sure the first alpha version of BP Rewrites missed some “Legacy built” URLs.
  • We’ll probably need to deprecate a lot of functions to achieve the previous point.
  • We need to write PHP Unit Tests !!!
  • We need to document how Plugins/Themes/Custom codes can use our BP Rewrite API.
  • I’m probably missing some points, so don’t hesitate to add your thoughts in comments 👌

Thanks in advance for your contributions 😍

#alpha, #release, #rewrites

July 21 Dev-Chat summary & August 4 Dev-Chat agenda

Hi everyone, sorry this summary is published very late (the day before we’re having another development meeting).

July 21 Dev-Chat summary

9.0.0 early results and feedbacks

  • 9.0.0 “Mico” was released on July 19.
  • Download spike for it happened on July 20 and reached ~33.400 downloads 📈 🎈.
  • Nothing major about it into Support forums, so @imath was able to quote @vapvarun saying: “We did not break anything big” 😅.
  • This BP Blocks focused (& short time framed) release was an interesting experience, thanks to a discussion launched by @johnjamesjacoby a bit before the dev chat, we were able to discuss about the benefits of working from a “feature as a plugin” GitHub repository. In short: it can save us some time ⏱, but bringing back code into our Trac is making us feel safer from being completely GitHub dependent.

10.0.0 is a magic number!

  • 10 is after 9, and we all feel we need to make this release a bit specific.
  • @sbrajesh has been working on the BP Relationship API and is confident he’ll be able to share a first alpha around August 18. 💪
  • Below are our first thoughts about 10.0.0:
    • A “regular” development cycle, Christmas🎄 as a release date could be a good idea!
    • It’s time BuddyPress has a Media Component, Releasing 10.0.0 once it’s ready was suggested 😇
    • Using rewrites to parse BP URLs might be a bit too early but we’ll have a “feature as a plugin” really soon to check what it means in terms of back compatibility with Plugins using the BP Legacy URL parser.
    • Carry on improving the BP REST API by using it more frequently into BP features (like we did for BP Blocks in 9.0.0)
    • A new great BP Theme seems difficult to achieve, unless we have a lot of interested contributors jumping in!
    • A site membership requests feature to compliment the site membership invites.

Nothing’s set in stone yet! Don’t hesitate to show your support for one (or more) of the above points to help us decide. And if you have great ideas, be there to share them with us during our next development meeting 👇

August 4 Dev-Chat Agenda

We had 2 weeks to think about possible features for 10.0.0, let’s decide about the ones we’ll work on during this magically numbered release cycle 🪄.

It will happen on August 4 (tomorrow) at 19:30 UTC and of course in #BuddyPress.

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

#10-0-0, #9-0-0, #agenda, #dev-chat, #summary

BP Dev-Chat Agenda July 21, 2021

Hi!

Our development meeting will happen today (July 21) at 19:30 UTC and of course in #BuddyPress.

Here’s our agenda:

  • 9.0.0 first feedbacks & results
  • 10.0.0 is a symbolic number, first ideas about the focus/features of this development cycle?

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

👋

#10-0-0, #9-0-0, #agenda, #dev-chat

BuddyPress 9.0.0 is now available!

Hi!

I have the great honnor to introduce you to “Mico” our latest major release. It’s ready for the new WordPress 5.8 Widget Block Editor. It was quite a challenge when we decided to build this release about a bit more than a month ago. We used a short time frame development cycle and we did it! I’m very proud of the work we’ve accomplished together: congrats to all the development team members, the contributors and the polyglots team members.

Have fun with the new 10 BP Blocks included into this release 🍕

BuddyPress 9.0.0 “Mico”

#9-0-0, #release

4 days to test BuddyPress 9.0.0-RC1!

Hi!

We really need you to quickly test this release candidate as we plan to release it just before WordPress 5.8. If you want to test the 10 new Widget Blocks into the new Widget Block Editor, you’ll need WordPress 5.8-RC3 💪

Thanks in advance for your help 🙏

#9-0-0, #pizza, #release-candidate

BP Dev-Chat Summary: June 30/July 7, 2021

June 30 improvised dev-chat

Following the discussion we had during June 23 meeting about the frequently requested Follow feature, and a very interesting discussion between @sbrajesh, @espellcastewe and @johnjamesjacoby, we decided to improvise a new Dev Chat about a possible larger scope about it. We shared our views about building a wider vision for “relationship types” in BuddyPress. A new API that would firstly be used for the Follow feature, but could also be used for potential other needs: user likes, improved user favorites, blocking users, what may come to our mind in the future!

@sbrajesh will lead this new project using the “feature as a plugin” model like WordPress does from a BuddyPress GitHub repository. If you’re interested in contributing to this project, please “raise your hand” commenting this summary.

July 7 regular dev-chat

@im4th starts with an apology: unlike what was scheduled (July 8), we were not able to release the 9.0.0 first beta so far. Sorry about it.

9.0.0 🎯

We’ve migrated 90% of Widgets as Block Widgets from the GitHub repository we use to build BuddyPress blocks. We also improved some BP REST API endpoints and we’re on our way to include a new endpoint to deal with Sitewide Notices. BP Block Widgets have been built on 2 principles: use the BP REST API every time it’s possible and use Modern JavaScript on front-end and the Widget/Post Block Editor’s APIs (mainly built on top of React.JS) on back-end.

@dcavins has made great progress about the Sitewide Notices Block Widget (👉 the last one to reach 100%) and about the corresponding REST API Endpoints. @espellcaste gave great advices about the BP REST API to speed up the process.

We also talked about directly packaging a Release Candidate without doing a Beta release. As the 9.0.0 development cycle is focused on migrating Widgets as Blocks, we have a very limited risk of messing with other parts of BuddyPress. @im4th said he’ll work on merging the BP Blocks code into BuddyPress core and will try to find the time to quickly build a Beta Release and some time after the Release Candidate (he hates when he doesn’t do what he has written he would do).

We finally talked about the great work @vapvarun has done building a test drive to host the BuddyPress code reference. The goal is to make it available asap and before the end of the year here. The main difficulty is to generate the documentation using the WP CLI parser command directly from the server (10 minutes). @im4th wondered if this could be achieved using the WP import/export tool (the documentation plugin is using custom post types). This is an approach we’ll try to test to avoid possible downtimes of the BuddyPress.org network.

9.0.0 schedule

  • Beta: July ? 🤔
  • RC: July 12 to 14.
  • Final: July 16 to 19.

Next Dev-Chat

It will happen on July 21 at 19:30 UTC and of course in #BuddyPress. If you have ideas or questions, feel free (and we are strongly encouraging you) to comment this summary to share them!

Additional note about meetings during 9.0.0 development cycle

As we are running a short development cycle, @im4th will be available every Wednesday at 19:30 UTC in #BuddyPress for an hour or more time if needed. Don’t hesitate to ping him (@imath) for help or inputs about contributing to this version of BuddyPress.

#9-0-0, #dev-chat, #relationship-api, #summary

BP Dev-Chat Agenda July 7, 2021

Hi!

Our development meeting will happen today (July7) at 19:30 UTC and of course in #BuddyPress.

Here’s our agenda:

PS: 9.0.0 is a short development cycle, here’s our schedule for it:

  • Beta: July 8.
  • RC: July 12.
  • Final: July 16.

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

👋

#9-0-0, #agenda, #dev-chat

BP Dev-Chat Summary: june 23, 2021

9.0.0 🎯

During yesterday’s development meeting we’ve discussed about @im4th‘s proposal to run the 9.0.0 development cycle very shortly targeting a release date before WordPress 5.8 final release is made available to the planet (~ July 20, 2021)!

@im4th was a bit worried about being too much directive and/or too ambitious, so he specified it was ok to disagree with this proposal. We quickly agreed, but here are some opinions we shared about this idea:

  • “Sounds great.” @sbrajesh
  • “I’m OK with your short cycle just for blocks to support the WP release” @dcavins
  • “I like the idea of very targeted releases” @dcavins
  • “the short release cycle is fine. The reason is good and makes total sense to me” @espellcaste

So we are going to try to do it!

9.0.0 Focus

Blocks!

As WordPress 5.8 is introducing the Widgets Block Editor, we are going to start migrating our legacy widgets. We actually already started the process from the GitHub plugin we use to develop BuddyPress Blocks. The first step is building a block for every BP Widgets and making it possible to transform existing BP Widgets to their corresponding BP Block. BP Widgets won’t disappear in 9.0.0 yet (no worries), but they’ll get a well deserved retirement progressively 😁. You can expect (at least) 10 new BuddyPress Blocks to be introduced in BuddyPress core.

A new follow component (if it’s ready for 9.0.0 release date)

@sbrajesh volunteered to satisfy a frequent request about this feature and he’s very welcome to contribute and lead this effort to make it happen! We talked about the “Followers” plugin @rayisme built which can be a source of inspiration. We’ll organize it from another specific GitHub repository. After the dev-chat, we had a complementary discussion about it, you can have a look at it for more information about early directions about the feature.

And of course, we’ll fix issues related to our latest major release (8.0.0) that may be found.

9.0.0 schedule

  • Beta: July 8.
  • RC: July 12.
  • Final: July 16.

8.0.0 issue “monitoring”

During the dev-chat, we also discussed about the feedbacks we got from the support forums about 8.0.0. We shared our surprise that plugins that appear to rely on BP aren’t tested in the beta window. This is something we need to carry on trying to improve. Working on documentation could be a way. On this topic, @vapvarun informed us he would prepare a list about which documentation resources need updates & then update them one by one 😍. Many thanks to him: it’s a very important work that will benefit to us all.

Next Dev-Chat

It will happen on July 7 at 19:30 UTC and of course in #BuddyPress. If you have ideas or questions, feel free (and we are strongly encouraging you) to comment this summary to share them!

Additional note about meetings during 9.0.0 development cycle

As we are running a short development cycle, @im4th will be available every Wednesday at 19:30 UTC in #BuddyPress for an hour or more time if needed. Don’t hesitate to ping him (@imath) for help or inputs about contributing to this version of BuddyPress.

#9-0-0, #dev-chat, #summary

June 9 Dev-Chat summary & June 23 Dev-Chat agenda

Hi everyone, sorry this summary is published very late (the day before we’re having another development meeting).

June 9 Dev-Chat summary

  • 8.0.0 was released on June 7.
  • Download spike for it happened on June 8 and reached ~27.000 downloads, but I believe we can include the 12.000 packages that were downloaded on release day. The total amount of downloads just after release is 39373.
  • As @vapvarun said: “We did not break anything big” 😅.
  • First issues are about the brand new Members Invitations feature:
    • It looks like some BuddyPress plugins are running some code before BuddyPress is fully ready.
    • It looks like some template overrides made by plugins or themes forgot to update their template pack to include this feature new templates.
    • The 2 above points could have been avoided if their plugin/theme authors had tested our beta/RC releases… That’s why we always ask you for help during our pre-release periods. The more we all test, the best will be the final release.
    • Thanks for @dcavins investigations about these first issues.
  • There will be a 8.1.0 release soon, unless we do a short 9.0.0 release cycle. @im4th would like us to try to have our legacy Widgets migrated as blocks as soon as WordPress 5.8 is released (it is slated to July 20). He’s been working on these 8 new blocks form our BP Blocks GH repository. So far 4 legacy widgets have their corresponding blocks, you can follow his progress (and of course help him) from this GH issue.
  • @vapvarun & @im4th discussed about the BP Attachments Plugin: the goal is to include the User Attachments feature or build a new plugin by the end of the year. The new plugin path is an option considering the various plugins playing into this area.
  • @im4th would also like to progress on migrating BP’s custom URI parser to use WP’s Rewrite API (#4954) from a plugin: if you’re interested about it, let’s team up! Let him know you want to join this project pinging him on WordPress Slack (@imath).

June 23 Dev-Chat Agenda

So here’s the question we need to reply to during tomorrow’s development meeting:

So here’s my plan: July 16 is my birthday and WP 5.8 is slated to July 20. What about releasing BP 9.0 on July 16 with only blocks (and some other fixes of course) ?

@im4th on June 9

It will happen on June 23 at 19:30 UTC and of course in #BuddyPress.

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

#8-0-0, #9-0-0, #agenda, #dev-chat, #summary

BP Dev-Chat Agenda June 9, 2021

Hi!

Our development meeting will happen on June 9 (tomorrow) at 19:30 UTC and of course in #BuddyPress.

Here’s our agenda:

  • Feedbacks & results about « Alfano » 8.0.0.
  • BP widgets & the Widget Block Editor.

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

👋

#8-0-0, #agenda, #dev-chat