Support Forums: Automate support profile badges#677
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
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_Automationto count eligible published replies and award thesupport-contributorbadge once thresholds and recency criteria are met. - Synchronizes the
support-teambadge 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.
7c040e8 to
89c1675
Compare
89c1675 to
eeecaea
Compare
eeecaea to
8de9f2b
Compare
8de9f2b to
4ae2290
Compare
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.
4ae2290 to
b75b7dd
Compare
| 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 |
| 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 ); | ||
| } |
| 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 ); | ||
| } | ||
| ); | ||
| } |
See https://meta.trac.wordpress.org/ticket/2214.
Summary
support-contributorafter 50 published forum replies.support-teamaligned with bbPress moderator/keymaster roles across main and Rosetta forums.Notes
Testing
php -lon touched PHP files.