Make WordPress Core

Opened 11 years ago

Closed 3 years ago

Last modified 3 years ago

#25615 closed enhancement (fixed)

Improve wording for wpautop code

Reported by: ricomoorman's profile ricomoorman Owned by: hellofromtonya's profile hellofromTonya
Milestone: 6.0 Priority: normal
Severity: trivial Version: 0.71
Component: Formatting Keywords: wpautop has-unit-tests has-patch
Focuses: Cc:

Description

The code for the functions wpautop and shortcode_unautop contains rather inappropriate variable names and wording.

See the attached patch for the following adjustments/corrections:

  • $pee changed to $text
  • $pee_parts changed to $text_parts
  • $pee_part changed to $text_part
  • $last_pee changed to $last_part
  • $tinkle changed to $paragraph
  • rephrased comments containing the word pee

Attachments (1)

correct-wording-for-wpautop.patch (6.8 KB) - added by ricomoorman 11 years ago.

Download all attachments as: .zip

Change History (44)

#1 @jeremyfelt
11 years ago

It should be noted that $pee has been around since the creation of wpautop() in [13] when the function still lived in b2functions.php. So old!

$tinkle was introduced 5 years later in [9255].

#2 follow-up: @Viper007Bond
11 years ago

$content would probably be better than $text in the WordPress context. It's what we use elsewhere.

#3 in reply to: ↑ 2 ; follow-ups: @ricomoorman
11 years ago

Replying to Viper007Bond:

$content would probably be better than $text in the WordPress context. It's what we use elsewhere.

Should I modify the patch and replace the already attached one or will the devs around here take care of that?

Last edited 11 years ago by ricomoorman (previous) (diff)

#4 in reply to: ↑ 3 @Viper007Bond
11 years ago

Replying to ricomoorman:

Should I modify the patch and replace the already attached one or will the devs around here take care of that?

I'm not sure, and the change is just my personal opinion.

#5 in reply to: ↑ 3 @rmccue
11 years ago

Replying to ricomoorman:

Should I modify the patch and replace the already attached one or will the devs around here take care of that?

If you do upload a new patch, please don't replace the existing one. :)

#6 @SergeyBiryukov
11 years ago

  • Version changed from trunk to 3.6

#7 @ricomoorman
11 years ago

This also affects the current version 3.7.1.
Furthermore is there a way to get this reviewed and merged? Is there something else I have to do?

#8 @SergeyBiryukov
11 years ago

  • Keywords 3.9-early added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 3.6 to 1.2

Version number indicates the earliest affected version. Looks like it's 0.71 here, but 1.2 is the earliest version available in the dropdown.

As for $text vs $content, we use $text in wptexturize(), balanceTags(), make_clickable(), and some other functions. correct-wording-for-wpautop.patch brings some consistency to wpautop() and shortcode_unautop(). Looks good to me.

#9 @rmccue
11 years ago

  • Version changed from 1.2 to 0.71

#10 @Hanni
11 years ago

  • Cc h@… added

#11 @westi
11 years ago

Personally I don't think the variable names are significantly inappropriate and it seems a shame to remove the humour from the code.

#12 @azaozz
11 years ago

IMHO the only acceptable change here is to rename all to $alot! See #13237.

#13 @azaozz
11 years ago

  • Owner set to Alot
  • Status changed from new to assigned

#14 @ricomoorman
11 years ago

I hope you don't get me wrong here. This is a serious patch request and no joke. I came across this piece of code several years ago and was surprised that it was still there when I was looking at the Wordpress codebase again a few weeks ago.

To be honest, I do think variable names like this do not belong here and are inappropriate. Variable names should reflect what the variable is about.

#15 @wonderboymusic
11 years ago

  • Priority changed from normal to lowest
  • Severity changed from normal to trivial

#16 @ricomoorman
11 years ago

Is there something wrong with my request?

This was really meant as an improvement as I find it rather unprofessional to have things like that within a codebase.

#17 @wonderboymusic
11 years ago

Of the 1000s of tickets open in Trac, this is in the running for most trivial

#18 @helen
11 years ago

There is nothing specifically wrong with your request, but you are seeing that lead developers do not agree with you.

I agree with westi that it would be a shame to remove developer-facing humor/humour. We talk about the soul of WordPress sometimes - I guess this falls in the camp who hate that the user dropdown says "Howdy".

#19 @nacin
11 years ago

  • Keywords wpautop added

#20 @ericlewis
10 years ago

  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from assigned to closed

Closing until a committer ever wants to do this.

#21 @ericlewis
10 years ago

  • Keywords has-patch 3.9-early removed

#22 @tzipporahwitty
3 years ago

  • Resolution maybelater deleted
  • Status changed from closed to reopened

Reopening this at @peterwilsoncc 's suggestion following the recent discussion on Post Status. I am the one that @miriamschwab referred to noticing this code and flagging it.

#23 @peterwilsoncc
3 years ago

  • Milestone set to 6.0
  • Priority changed from lowest to normal

As WordPress has grown, the tolerance for in-jokes and other developer facing humour has decreased. I am moving this to the 6.0 milestone to action during the next cycle.

#24 @hellofromTonya
3 years ago

  • Owner changed from Alot to hellofromTonya
  • Status changed from reopened to accepted

Thank you @tzipporahwitty for reopening this ticket, Miriam Schwab for raising the discussion on Post Status, and @peterwilsoncc for moving it into the 6.0.

I see the intended humor of the original code. As Peter points out, WordPress has significantly grown since this code was introduced.

IMO sourcecode should be inclusive and welcoming. It exists to power the web. But the human side of code exists to be read, explored, and improved by a world of diverse contributors. Terminology used matter. These terms are the human readable language that can (and in my opinion should) empower people to explore, learn, grow, and contribute to make it better.

Contributors are expressing that they are not comfortable with the human readable language used.

Terminology of the past is being (and has been) revisited to transform words used into language that is inclusive and welcoming while retaining meaning for readability. The terms noted in this ticket fall into that same effort IMO.

Changing the ownership to me to shepherd it forward to land in 6.0.

#26 @peterwilsoncc
3 years ago

  • Keywords has-patch removed

In the linked pull request:

  • basic refresh to account for function changes since original report
  • variable names use the original suggestions
  • followed the suggestion of $text instead of $content to keep the consistency identified in comment #8

Additionally, the JavaScript equivalents for both the classic and block editors appear to use text, etc for variable names so don't need any changes as best I can tell.

This ticket was mentioned in PR #2226 on WordPress/wordpress-develop by ironprogrammer.


3 years ago
#27

  • Keywords has-patch has-unit-tests added

Updates phpunit test names to reflect variable name updates originally proposed by @ricomoorman and later amended by @peterwilsoncc via https://github.com/WordPress/wordpress-develop/pull/2215.

This change is in conjunction with the above PR submitted by @peterwilsoncc.

See https://core.trac.wordpress.org/ticket/25615.

#28 @ironprogrammer
3 years ago

This is a companion update to this ticket. The update applies the proposed variable name changes to phpunit tests for wpautop.

Please see ironprogrammer:25615-update-wpautop-test-names for details. Two test names use the old vernacular that is addressed by this ticket. The function names have been updated for clarity and consistency with this ticket.

#29 @ironprogrammer
3 years ago

  • Keywords has-patch removed

Removing has-patch keyword. It was added automatically and unintentionally.

peterwilsoncc commented on PR #2226:


3 years ago
#30

Thanks for catching these @ironprogrammer

peterwilsoncc commented on PR #2226:


3 years ago
#31

Thanks for catching these @ironprogrammer

ironprogrammer commented on PR #2226:


3 years ago
#32

Merged in @peterwilsoncc's branch so we have a single PR to work from.

#33 @ironprogrammer
3 years ago

  • Keywords has-patch added

Test Report

PR 2226

Unit tests pass ✅.

Tested
phpunit --filter Tests_Formatting_wpAutop

peterwilsoncc commented on PR #2215:


3 years ago
#34

Closing in favour of #2226 which includes some test updates

peterwilsoncc commented on PR #2226:


3 years ago
#35

Merged in @peterwilsoncc's branch so we have a single PR to work from.

Thanks Brian, I've closed my PR in favour of this one. I've also renamed this PR to indicate it now covers both the source code and related tests.

hellofromtonya commented on PR #2226:


3 years ago
#36

The PR looks good to me. But I have a thought.

In the Trac ticket, several folks voiced concerns about preserving developer humor and personality. The code was written originally in this concept, i.e. to be funny. What if a comment is added in the docblock that points folks to a link of the previous version?

Why? To serve as a bridge across all concerns voices for and against the pee pee version.

@peterwilsoncc @ironprogrammer what do you think?

peterwilsoncc commented on PR #2226:


3 years ago
#37

What if a comment is added in the docblock that points folks to a link of the previous version?

Why? To serve as a bridge across all concerns voices for and against the pee pee version.

I don't think there needs to be a link.

The concerns about developer facing humour were from a different era of WP so I think it's safe to assume the attitudes of the past may have been valid at the time but it's no longer the case.

hellofromtonya commented on PR #2226:


3 years ago
#38

Cool. Thanks @peterwilsoncc. With that, this PR is ready for commit.

hellofromtonya commented on PR #2226:


3 years ago
#39

Cool. Thanks @peterwilsoncc. With that, this PR is ready for commit.

#40 @hellofromTonya
3 years ago

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

In 52789:

Formatting: Make terms in wpautop() and shortcode_unautop() more welcoming and inclusive.

The developer facing humor in these functions were from a different era of WordPress. Tolerance for in-jokes and other developer facing humor has decreased over the years. Terms like "pee" and "tinkle" may make some folks chuckle while for others it makes them uncomfortable.

Terminology of the past is being (or has been) re-evaluated to transform words into a language that are inclusive and welcome for all. This commit is part of that effort as it replaces.

Follow-up [13], [9255].

Props ricomoorman, tzipporahwitty, ironprogrammer, peterwilsoncc, jeremyfelt, Viper007Bond, rmccue, SergeyBiryukov, hellofromTonya.
Fixes #25615.

#43 @ricomoorman
3 years ago

Well done. I am glad that this has been fixed. 😄

Keep up the good work!

Note: See TracTickets for help on using tickets.