Make WordPress Core

Opened 9 months ago

Closed 8 months ago

#60247 closed defect (bug) (fixed)

Replace exclusionary words within code comments

Reported by: dartiss's profile dartiss Owned by: joedolson's profile joedolson
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: General Keywords: commit
Focuses: accessibility, docs Cc:

Description

I have made 2 minor edits to existing code comments, where the words "stupid" and "lame" have been used. Both are deemed exclusionary and, in both case, there were much better alternatives that could be used.

Both words are deemed to be ableist.

Attachments (4)

class-wp-xmlrpc-server.php.diff (601 bytes) - added by dartiss 9 months ago.
theme.php.diff (693 bytes) - added by dartiss 9 months ago.
60247.patch (462 bytes) - added by upadalavipul 9 months ago.
there are on more instance in wp-includes/class-simplepie.php file.
60247.2.diff (5.8 KB) - added by joedolson 8 months ago.
Combine into one patch; a few additional items

Download all attachments as: .zip

Change History (24)

@dartiss
9 months ago

#1 @dartiss
9 months ago

(The title of this ticket should have read "within code comments")

#2 @SergeyBiryukov
9 months ago

  • Component changed from Comments to General
  • Focuses docs added
  • Milestone changed from Awaiting Review to 6.5

#3 @SergeyBiryukov
9 months ago

  • Summary changed from Replace exclusionary words with code comments to Replace exclusionary words within code comments

#4 @joedolson
9 months ago

  • Focuses accessibility added
  • Owner set to joedolson
  • Status changed from new to accepted
  • Type changed from enhancement to defect (bug)

#5 @shailu25
9 months ago

there are on more instance in src/js/_enqueues/vendor/codemirror/csslint.js in Line no 5702

// not a real token, but useful for stupid IE filters

it should be

// not a real token, but useful for IE filters
Last edited 9 months ago by shailu25 (previous) (diff)

#6 @SergeyBiryukov
9 months ago

Thanks for the ticket! Introduced in [1670] and [20212].

#7 follow-up: @jorbin
9 months ago

@shailu25 - That's an external library. If you would like to report it upstream, the repository is at https://github.com/codemirror/dev/

#8 in reply to: ↑ 7 @shailu25
9 months ago

Replying to jorbin:

@shailu25 - That's an external library. If you would like to report it upstream, the repository is at https://github.com/codemirror/dev/

Got it 👍
Thanks for the clarification.

#9 follow-up: @dmsnell
9 months ago

It might be useful to expand the XMLRPC change a bit, as the previous language also connoted that the sleep( 1 ) was something regrettable but pragmatic.

In this wording change we've removed the implicit warning and replaced it with a confidence boost in the line of code it's describing - communicating that developers shouldn't try to change it.

Can we find a way to include the original warning but provide a little more structure to whoever comes back to this code?

<?php
/*
 * The remote site may have sent the pingback before it finished publishing its own content
 * containing this pingback URL. If that happens then it won't be immediately possible to fetch
 * the pinging post; adding a small delay reduces the likelihood of this happening.
 * 
 * While there are more robust methods than calling `sleep()` here (because `sleep()` merely
 * mitigates the risk of requesting the remote post before it's available), this is effective
 * enough for most cases and avoids introducing more complexity into this code.
 *
 * One way to improve the reliability of this code might be to add failure-handling to the remote
 * fetch and retry up to a set number of times if it receives a 404. This could also handle 401 and
 * 403 responses to differentiate the "does not exist" failure from the "may not access" failure.
 */
sleep( 1 );

#10 in reply to: ↑ 9 @SergeyBiryukov
9 months ago

Replying to dmsnell:

Can we find a way to include the original warning but provide a little more structure to whoever comes back to this code?

The suggested text looks great to me! 👍

@upadalavipul
9 months ago

there are on more instance in wp-includes/class-simplepie.php file.

#11 @benniledl
8 months ago

#60409 was marked as a duplicate.

@joedolson
8 months ago

Combine into one patch; a few additional items

#12 @joedolson
8 months ago

This patch also address some comments in shortcodes.php.

The crazyhorse comments in the patch are not technically ableist, since they refer to a specific historic branch in WordPress history, but I added that context to make this more clear.

That said, I suspect that the old branch reference could just be omitted; it may have been useful at the time of the crazyhorse merge, but I can't see any use to it anymore.

#14 @dartiss
8 months ago

I just want to thank everyone involved with this ticket on moving this forward and improving on my original request.

#15 @manfcarlo
8 months ago

  • Summary changed from Replace exclusionary words within code comments to Improve words within code comments

If the intent is to encourage more contributors, it will only work if described in a positive way. Negative language like "exclusionary" and "ableist" comes across as point-scoring, which most people don't like to see.

#16 @joedolson
8 months ago

  • Keywords commit added
  • Summary changed from Improve words within code comments to Replace exclusionary words within code comments

I'm going to disagree with your change here, @manfcarlo. It's important for tracking what we've done for ticket names to be clear and unambiguous. A generic statement like "improve words" gives no context for what has been done and why. Changing the name of the ticket in this way only obscures what we're doing.

#17 @joedolson
8 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 57584:

General: Remove ableist language from code comments.

Remove a handful of occurrences of ableist terms in code comments; omits external libraries.

Props dartiss, upadalavipul, SergeyBiryukov, shailu25, jorbin, dmsnell, joedolson, manfcarlo.
Fixes #60247.

#18 @manfcarlo
8 months ago

The patch actually still needs work. turns SimplePie into an dumb parser of feeds. looks like a mistake, and (I know, but I'm certain it will confuse people less with support.) loses some of its meaning because I know is no longer referring to anything. I guess when you add a patch on Friday night and commit on Sunday night, fewer people are around to review.

#19 @manfcarlo
8 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Re-opening, to rectify the issues flagged in comment:18.

#20 @swissspidy
8 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 57647:

General: Further improve language in SimplePie code comments.

Follow-up to [57584].

Props manfcarlo.
Fixes #60247.

Note: See TracTickets for help on using tickets.