Skip to content

Support Forums: Automate support profile badges#677

Open
dd32 wants to merge 1 commit into
WordPress:trunkfrom
dd32:issue/2214-support-badges
Open

Support Forums: Automate support profile badges#677
dd32 wants to merge 1 commit into
WordPress:trunkfrom
dd32:issue/2214-support-badges

Conversation

@dd32
Copy link
Copy Markdown
Member

@dd32 dd32 commented Jun 5, 2026

See https://meta.trac.wordpress.org/ticket/2214.

Summary

  • Add Support Contributor badge automation using the existing bbPress reply count.
  • Award support-contributor after 50 published forum replies.
  • Keep support-team aligned with bbPress moderator/keymaster roles across main and Rosetta forums.

Notes

  • The initial Support Contributor implementation is intentionally broad: no Rosetta/main distinction, no plugin/theme/review distinction, and no recency window.
  • Email and Slack announcements are intentionally left out; those were split to Meta Trac #7651.

Testing

  • php -l on touched PHP files.
  • Full PHPCS on the new badge automation class.
  • Changed-line PHPCS on the two legacy files touched for loading/instantiation.

Copilot AI review requested due to automatic review settings June 5, 2026 07:28
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props dd32.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds automated badge management to the Support Forums plugin, awarding a Support Contributor badge based on eligible reply activity and keeping the Support Team badge in sync with bbPress moderator/keymaster roles across main and Rosetta forums.

Changes:

  • Introduces Badge_Automation to count eligible published replies and award the support-contributor badge once thresholds and recency criteria are met.
  • Synchronizes the support-team badge with bbPress role changes (including user removal from a site).
  • Adds a per-forum exclusion setting (meta box + post meta) to omit future replies from badge counting.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
wordpress.org/public_html/wp-content/plugins/support-forums/support-forums.php Loads the new badge automation class.
wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin.php Instantiates badge automation as part of plugin initialization.
wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-badge-automation.php Implements reply counting, eligibility logic, role/badge syncing, and forum exclusion UI/storage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dd32 dd32 force-pushed the issue/2214-support-badges branch from 7c040e8 to 89c1675 Compare June 5, 2026 07:38
Copilot AI review requested due to automatic review settings June 5, 2026 07:48
@dd32 dd32 force-pushed the issue/2214-support-badges branch from 89c1675 to eeecaea Compare June 5, 2026 07:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin.php Outdated
@dd32 dd32 force-pushed the issue/2214-support-badges branch from eeecaea to 8de9f2b Compare June 5, 2026 08:12
Copilot AI review requested due to automatic review settings June 5, 2026 08:49
@dd32 dd32 force-pushed the issue/2214-support-badges branch from 8de9f2b to 4ae2290 Compare June 5, 2026 08:49
Adds Support Contributor automation based on the existing bbPress reply count and keeps Support Team aligned with bbPress roles. See https://meta.trac.wordpress.org/ticket/2214.
@dd32 dd32 force-pushed the issue/2214-support-badges branch from 4ae2290 to b75b7dd Compare June 5, 2026 08:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

include( __DIR__ . '/inc/class-audit-log.php' );
include( __DIR__ . '/inc/class-blocks.php' );
include( __DIR__ . '/inc/class-rest-api.php' );
include __DIR__ . '/inc/class-badge-automation.php'; // phpcs:ignore PEAR.Files.IncludingFile.UseRequire
Comment on lines +94 to +102
if (
has_badge( self::SUPPORT_CONTRIBUTOR_BADGE, $user_id ) ||
! $this->user_meets_contributor_criteria( $user_id )
) {
return;
}

assign_badge( self::SUPPORT_CONTRIBUTOR_BADGE, $user_id );
}
Comment on lines +75 to +88
public function schedule_support_team_badge_sync( $user_id ) {
$user_id = (int) $user_id;

if ( ! $user_id ) {
return;
}

add_action(
'shutdown',
function () use ( $user_id ) {
$this->update_support_team_badge( $user_id );
}
);
}
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