Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#43405 closed defect (bug) (fixed)

CS: Fix violations for wp-signup.php

Reported by: garyj's profile GaryJ Owned by: jrf's profile jrf
Milestone: 5.1 Priority: normal
Severity: normal Version: 5.1
Component: Users Keywords: has-patch
Focuses: multisite, coding-standards Cc:


Address code standard violations in wp-signup.php.

Attachments (5)

wp-signup.diff (9.2 KB) - added by GaryJ 6 years ago.
43405.diff (9.2 KB) - added by nikolam 6 years ago.
Applied feedback from @jrf
43405.2.diff (8.1 KB) - added by netweb 6 years ago.
43405.3.diff (7.3 KB) - added by desrosj 5 years ago.
43405.4.diff (7.3 KB) - added by desrosj 5 years ago.

Download all attachments as: .zip

Change History (18)

6 years ago

#1 @GaryJ
6 years ago

  • Keywords has-patch added

#2 @jrf
6 years ago

  • Version set to trunk


Couple of small remarks/questions (line nrs refer to the "new" lines):

  • Line 122: ( $site_domain ) does not need the parentheses anymore as it is, though it might need output escaping.
  • Line 406/412 - the "Don't override WP globals" sniff is more than anything intended for plugins/themes. Should that sniff be excluded for core ?
  • Line 933: you may want to split this line up as it's pretty long now, i.e. one condition per line.

#3 @netweb
6 years ago

  • Milestone changed from Awaiting Review to 5.0

#4 @SergeyBiryukov
6 years ago

  • Component changed from General to Users
  • Focuses multisite added

6 years ago

Applied feedback from @jrf

6 years ago

#5 @netweb
6 years ago

  • Keywords commit added

Patch 43405.2.diff updates 43405.diff and wp-signup.diff with a couple of whitespace indentation issues and removes the instance of phpcs:ignore as it is not required.

#6 @netweb
6 years ago

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

#7 @pento
6 years ago

  • Milestone changed from 5.0 to 5.1

5 years ago

#8 @desrosj
5 years ago

  • Keywords commit removed

43405.3.diff is a refresh to apply cleanly to trunk. Can someone just give it a review?

#9 @jrf
5 years ago

@desrosj I've given it a once-over. LGTM, just two remarks:

  1. The condition on line 925/939 is still hard to read and confusing for people who don't know operator precedence well enough by heart.

Suggested alternative:

if ( 'all' === $active_signup
    || ( 'blog' === $_POST['signup_for'] && 'blog' === $active_signup )
    || ( 'user' === $_POST['signup_for'] && 'user' === $active_signup )
) {
    // Code
  1. FYI/For future reference: it's likely that we'll be moving away from Yoda conditions in the near future, see, but as that hasn't been actioned yet, that shouldn't influence this patch.

#10 @desrosj
5 years ago

  • Keywords commit added

Thanks, @jrf! 43405.4.diff includes your suggestion above.

5 years ago

#11 @desrosj
5 years ago

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

In 44626:

Coding Standards: Manually fix coding standards violations in wp-signup.php.

Props GaryJ, jrf, netweb, desrosj.
Fixes #43405.

#12 @desrosj
5 years ago

In 44628:

Privacy: Allow column sorting in the privacy request admin tables.

This allows users to sort the export and erase personal data request tables by “Requester” (post_title, or user email) and “Requested” (post_date, or when the request was created), which can be helpful when sites have many requests present.

Props birgire, ianbelanger, pbiron, desrosj.
Fixes #43405.

#13 @desrosj
5 years ago

  • Keywords commit removed

Sorry for the noise. [44628] does not belong to this ticket.

Note: See TracTickets for help on using tickets.