Skip to content

fix: add missing alt text to Who's Online widget avatar - #147

Open
i-am-chitti wants to merge 1 commit into
WordPress:mainfrom
i-am-chitti:issue-142
Open

fix: add missing alt text to Who's Online widget avatar#147
i-am-chitti wants to merge 1 commit into
WordPress:mainfrom
i-am-chitti:issue-142

Conversation

@i-am-chitti

Copy link
Copy Markdown
Contributor

Description

This Pull Request resolves an accessibility issue where the avatar in the "Who's Online" dashboard widget is rendered without alternative text (alt="").

In includes/widgets/class-wp-presence-widget-whos-online.php, get_avatar() was called without the $alt argument:

echo wp_kses_post( get_avatar( $user->ID, 24 ) );

This PR updates the call to pass the user's display_name as the $alt parameter, matching the existing pattern used elsewhere in the plugin (e.g., includes/post-list.php):

echo wp_kses_post( get_avatar( $user->ID, 24, '', $user->display_name ) );

Fixes

@i-am-chitti
i-am-chitti requested a review from josephfusco as a code owner July 27, 2026 16:29
@github-actions

Copy link
Copy Markdown
Contributor

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 iamchitti.

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

@github-actions

Copy link
Copy Markdown
Contributor

▶ Preview in WordPress Playground

Open in WordPress Playground

Boots a fresh WordPress with this PR's presence-api build, seeds 5 demo users, and drops you on the dashboard.

Stress-test variant: 40 demo users · Built from 1771cf2711ef647670942dd4d769a2ffaf363571. Auto-updates when you push.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 28.94%. Comparing base (f1f3a2e) to head (1771cf2).
⚠️ Report is 44 commits behind head on main.

Files with missing lines Patch % Lines
...s/widgets/class-wp-presence-widget-whos-online.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #147      +/-   ##
============================================
+ Coverage     27.24%   28.94%   +1.70%     
  Complexity      174      174              
============================================
  Files            15       15              
  Lines          1817     1817              
============================================
+ Hits            495      526      +31     
+ Misses         1322     1291      -31     
Flag Coverage Δ
phpunit 28.94% <0.00%> (+1.70%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@josephfusco josephfusco changed the title Accessibility: Add missing alt text to Who's Online widget avatar fix: add missing alt text to Who's Online widget avatar Jul 31, 2026
@josephfusco josephfusco added [Type] Bug An existing feature is broken [Area] Widgets Issues for the dashboard widgets labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Widgets Issues for the dashboard widgets [Type] Bug An existing feature is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants