BP Rewrites Feature Plugin Now in Beta
The ball is moving on a nine-year-old effort to migrate BuddyPress’ custom URI parser to use WordPress’ Rewrite API.
BuddyPress currently requires sites to use pretty permalinks in order to be compatible with its URL parser. The plugin analyzes the URL for whatever component you are viewing and performs internal checks to decide what to display there and determine the proper template file. This custom parser has been working well for years but has some drawbacks compared to WordPress’ newer Rewrite API.
BuddyPress lead developer Boone Gorges summarized the problem in the original ticket:
BP’s custom URI parser (living mostly in
bp_core_set_uri_globals()) is slow, error-prone, non-extensible, non-testable, and out of step with WP best practices.
In August of 2021, BuddyPress contributors moved this effort into the BP Rewrites feature plugin with the eventual goal of getting it merged into BP Core after wider testing. The first beta was released this week with a call for testing before it gets moved to the WordPress plugin directory.
BP Rewrites isn’t just an under-the-hood architectural improvement for BuddyPress, it also has several user-facing benefits:
- BuddyPress URLs customization improved and easier
- Compatibility with plain permalinks
- Improved Compliance with WordPress Standards
- Improved User/Advanded user/Plugin developer/Theme designer BuddyPress experience
Users who test the plugin will find a URLs customization screen (replacing the BP Pages screen) under the BuddyPress settings where page slugs can be easily changed. This is much more user-friendly than editing the wp-config.php file.
“When you deactivate the plugin,
buddypress post type’s items are switched back to regular pages and you get them back into the corresponding WordPress Administation edit screen,” BuddyPress core developer Mathieu Viet said. “Post metas are still there in case you want to activate BP Rewrites back (this can happen when you’re testing another BuddyPress plugin). If you absolutely want to get rid of these post metas, you can delete the BuddyPress pages, create new ones and redo the page mapping from the BuddyPress Pages settings screen.”
This isn’t something you want to test on a production site, as it’s still uncertain how BP Rewrites will interact with different plugins. Testers can report bugs as issues on the plugin’s GitHub repository.
“There’s no secret: the only way to have enough confidence into this backward compatibility mechanism to start thinking of merging BP Rewrites into BuddyPress Core is to test, test, and test again,” Viet said.
When discussing BP Rewrites’ progress earlier this year, Viet advised the feature plugin stay as an add-on for at least two major BuddyPress releases. This will give developers the chance to ensure there are fewer plugin conflicts before merging into BuddyPress core.