Skip to content

feat(bit-connect): add Bit Connect forum triggers and actions - #250

Open
RishadAlam wants to merge 10 commits into
mainfrom
feat/bit-connect
Open

RishadAlam wants to merge 10 commits into
mainfrom
feat/bit-connect

Conversation

@RishadAlam

@RishadAlam RishadAlam commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Pull Request

Description

Adds a free Bit Connect integration: 15 forum event triggers (custom_form_submission) and 7 write actions. Actions call the Bit Connect Pro PHP API (BitApps\BitConnectPro\Integrations\Actions), so they use the forum's own validation, permissions and events. The PR also lets the action search match an app's display name.

Motivation & Context

Bit Connect (the Bit Apps community forum plugin) fires a bit_connect_* WordPress hook for every forum event and offers same-site PHP actions. Users can now react to posts, comments, votes, polls, sign-ups, logins, badges, group changes, reports and moderation, and create posts, comment, vote, set status/stage, award badges and manage group members. Everything runs in the free plugin; Bit Integrations Pro is not needed.

Related Links: (if applicable)

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • ⚡ Improvement
  • 🔄 Code refactor

Key Changes

Triggers (backend/Triggers/BitConnect/)

  • Added 15 tasks: Post Published, Post Status or Stage Changed, Post Voted, Poll Voted*, Comment Added, Comment Voted*, Member Registered, Member Logged In, Badge Awarded*, Member Joined Group*, Member Left Group*, Report Filed, Reports Resolved, Moderation Action Taken, Any Forum Event (bit_connect_event).
  • Added one handler for the event hooks (the task ID is bit_connect_<event> from the payload), each with a note.
  • Added Pro-only tasks (*) are listed only while Bit Connect Pro has an active licence.
  • Added a same-task guard, so a flow whose action fires its own trigger (Comment Added → Add Comment) cannot loop.

Actions (backend/Actions/BitConnect/)

  • Added Create Post, Set Post Status or Stage, Vote for Post, Add Comment, Award Badge, Add Member to Group, Remove Member from Group (BitConnectActionHelper, called from RecordApiHelper with LogHandler).
  • Added the record the action acts on (post ID, member email) is a mapped field; forum options (topic type, status, stage, badge, group, tags, role) are dropdowns fed by refresh_bit_connect_options.
  • Added clear errors: missing fields by label, missing status/stage/badge/group, and "This forum needs a topic type" when the forum requires one.
  • Added when an action cannot run, the message says whether Bit Connect, Bit Connect Pro or its licence is missing, and the flow log records it.

Frontend

  • Added Bit Connect screens (plugin check on the Bit Connect Pro Actions class, action select, option dropdowns with refresh, field map) and registered them in the new/edit/info routers, the action list, the custom form trigger list and the tutorial links.
  • Added notes: actions need Bit Connect Pro with an active licence; Create Post, Add Comment and Vote for Post run with the mapped member's rights, admins included.
  • Fixed the "+" field button is hidden for actions without optional fields, and the required Group Role select keeps a value.
  • Fixed the action search matched only the type key, so "Bit Connect" or "Rox Appointment Booking" found nothing. It now matches the display name too.

Testing

  • php -l and php-cs-fixer clean; prettier and eslint clean on the changed files
  • Built 15 flows in the UI, one per trigger, each captured with Fetch from a real forum action (portal post, comment, upvote, poll vote, comment upvote, sign-up, login, badge, group join and leave, report, resolve, lock/unlock)
  • Fired the events again for real and checked wp_btcbi_log: all 15 triggers ran and all 7 actions succeeded (52 of 53 runs). The one error was a test flow that mapped a comment ID from a moderation event into Vote for Post's post ID ("Invalid post.").
  • A sign-up ran the full chain Member Registered → Create Post → Post Published → Add Comment → Comment Added → Vote → Post Voted → Set Status → Status Changed → Award Badge → Badge Awarded → Add to Group → Joined → Remove → Left → Award Badge

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated
  • Documentation updated if needed
  • README updated if needed

Changelog

  • New Triggers: Bit Connect – 15 forum events, including new posts, comments, votes, polls, sign-ups, badges, groups, reports and moderation.
  • New Actions: Bit Connect – Create Post, Set Post Status or Stage, Vote for Post, Add Comment, Award Badge, Add Member to Group and Remove Member from Group.
  • Fix: The action search now finds apps by their display name.

🤖 Generated with Claude Code

Free fires one bit_connect_* hook per write action (create post, set status, vote, comment,
badge, group add/remove) and logs the result. A refresh route lists topic types, statuses,
stages, badges, groups and tags for the action dropdowns.
Action select, field map, option dropdowns with refresh, the plugin check and the logo.
Add the integration to the new, edit and info routers, the action list, the custom form
trigger list and the tutorial links.
…ee plugin

Move the forum event triggers and the seven actions out of Pro. The free trigger, the
BitConnectActionHelper and RecordApiHelper call Bit Connect Pro directly, and every action is
free in the action list.
The action search matched only the type key, so "Bit Connect" or "Rox Appointment Booking"
found nothing. Match the display name too.
Clicking the selected role cleared the required Group Role select. Fall back to Member.
Copilot AI balanced review requested due to automatic review settings November 2, 2026 07:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Tell the user whether Bit Connect, Bit Connect Pro or its licence is missing, instead of always
saying Bit Connect Pro is not installed, and write the error to the flow log.
Copilot AI balanced review requested due to automatic review settings November 2, 2026 07:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

2 participants