Skip to content

feat(providers): opt-in filters for BuddyBoss + MemberPress (v1.6.0) - #15

Merged
raftaar1191 merged 1 commit into
mainfrom
release/v1.6.0
Jun 17, 2026
Merged

raftaar1191 merged 1 commit into
mainfrom
release/v1.6.0

Conversation

@raftaar1191

Copy link
Copy Markdown
Contributor

Summary

BREAKING (BuddyBoss / MemberPress providers). Both third-party providers are now opt-in. Each provider's is_available() consults a new filter that defaults to false, so the entry is hidden from the React dropdown and denies on every check until the consumer plugin hooks the filter to true.

Why

Plugins that embed wpb-access-control via Composer were inheriting both third-party provider options as soon as those plugins were active on the site — regardless of whether the embedding plugin intended to surface BuddyBoss or MemberPress in its admin UI. Defaulting to false keeps the library quiet by default; consumers opt in per provider.

Migration

In your consumer plugin's bootstrap:

add_filter( 'wpb_access_control_bb_profile_type_enabled', '__return_true' );
add_filter( 'wpb_access_control_mepr_membership_enabled', '__return_true' );

Existing rules saved against either provider deny by default after upgrading until the corresponding filter is hooked.

Changes

  • src/BuddyBossProfileTypeProvider.php — is_available() now also requires wpb_access_control_bb_profile_type_enabled === true
  • src/MemberPressMembershipProvider.php — is_available() now also requires wpb_access_control_mepr_membership_enabled === true
  • tests/Unit/BuddyBossProfileTypeProviderTest.php + tests/Unit/MemberPressMembershipProviderTest.php — add new default-false tests; switch to a static $opt_in_default + andReturnUsing closure pattern in setUp so per-test overrides actually take effect (layered expectApplied calls don't override in Mockery)
  • README.md / CHANGELOG.md — document the new filters and migration steps

No JS / asset changes — purely PHP + tests + docs.

Test plan

  • composer test — 160 tests / 218 assertions, all green
  • Smoke test in a consumer plugin: confirm both options are hidden from the dropdown before adding the filters
  • Hook each filter to __return_true; confirm the options reappear and stored rules pass/deny correctly
  • CI matrix passes on PHP 8.1 – 8.5

🤖 Generated with Claude Code

BREAKING: BuddyBossProfileTypeProvider and MemberPressMembershipProvider are
now opt-in. Each provider's is_available() checks a new filter that defaults
to false, so the provider is hidden from the React dropdown and denies on
every check until the consumer plugin hooks the filter to return true.
Existing rules saved against either provider deny by default after upgrade
until the corresponding filter is set.

Migration — in your consumer plugin's bootstrap:

  add_filter( 'wpb_access_control_bb_profile_type_enabled', '__return_true' );
  add_filter( 'wpb_access_control_mepr_membership_enabled', '__return_true' );

Rationale: plugins that embed wpb-access-control via Composer were inheriting
both third-party-provider options as soon as those plugins were active on the
site, regardless of whether the embedding plugin intended to surface them.
Defaulting to false keeps the library quiet by default; consumers opt in per
provider.

Files:
- src/BuddyBossProfileTypeProvider.php — is_available() now requires the
  wpb_access_control_bb_profile_type_enabled filter (default false) in
  addition to the existing function_exists checks.
- src/MemberPressMembershipProvider.php — is_available() now requires the
  wpb_access_control_mepr_membership_enabled filter (default false) in
  addition to the existing defined/class_exists checks.
- tests/Unit/BuddyBossProfileTypeProviderTest.php — adds new test for the
  default-false gate; uses a static $opt_in_default property + an
  andReturnUsing closure in setUp so per-test overrides actually take
  effect (layered expectApplied calls don't override in Mockery).
- tests/Unit/MemberPressMembershipProviderTest.php — same pattern.
- README.md / CHANGELOG.md — documented the new filters and migration steps.

PHPUnit: 160 tests / 218 assertions all green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@raftaar1191
raftaar1191 merged commit 29705aa into main Jun 17, 2026
5 checks passed
@raftaar1191
raftaar1191 deleted the release/v1.6.0 branch June 17, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant