[wp-trac] [WordPress Trac] #58573: Site Health: Improve the speak() messages

WordPress Trac noreply at wordpress.org
Mon Jul 17 13:17:21 UTC 2023


#58573: Site Health: Improve the speak() messages
---------------------------------------+----------------------------
 Reporter:  afercia                    |       Owner:  joedolson
     Type:  defect (bug)               |      Status:  accepted
 Priority:  normal                     |   Milestone:  6.4
Component:  Site Health                |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  has-screenshots has-patch  |     Focuses:  accessibility
---------------------------------------+----------------------------
Changes (by afercia):

 * keywords:  has-screenshots needs-patch => has-screenshots has-patch


Comment:

 [attachment:"58573.diff"] is a first pass.

 - Moves the `speak()` calls to a new function.
 - Prevents the messages from being announced on the Dashboard page by
 checking for `SiteHealth.screen`.
 - Shortens a couple messages by removing the part 'and the results are now
 available on the page.', which seems not necessary to be specified.
 - Prevents a redundant message from being announced.

 Regarding the last point: seems to me `recalculateProgression()` already
 triggers a `speak` message anyways. I moved a call to
 `recalculateProgression()` within the setTimeout that was used to trigger
 the 'redundant' message. This way, when the directory sizes test takes
 more than 3 seconds and then completes, score calculations and visual
 updates will run after some delay. Also, a speak message will be
 triggered. Unless I'm missing something, this seems OK to me. On one hand,
 it is good that the visual updates and the speak message happen at the
 same time. On the other hand, it's an edge case anyways because in the
 majority of the cases thi test will likely take _less_ than 3 seconds.
 Cc @azaozz when you have a chance, I'd greatly appreciate your feedback.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58573#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list