Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#54746 closed task (blessed) (fixed)

Comment Error in wp-login.php

Reported by: alkesh7's profile alkesh7 Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.0 Priority: normal
Severity: minor Version:
Component: Login and Registration Keywords:
Focuses: docs, coding-standards Cc:

Description

Hello WordPress Team,

I have seen that WordPress have issue in the comment structure.

WordPress follow a comment structure. See the Comment Standard link: https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#5-inline-comments

In the WordPress 5.9 Release Candidate Version. There is a Comment structure issue in file "wp-login.php" in root folder. See the issue in the below screenshot.
https://prnt.sc/263q9qs

Kindly take a look on my request and fix it.

Thank you!

Attachments (3)

wp-login.php.patch (347 bytes) - added by alkesh7 2 years ago.
wp-org-ticket.png (53.5 KB) - added by alkesh7 2 years ago.
54746.diff (1.0 KB) - added by peterwilsoncc 2 years ago.

Download all attachments as: .zip

Change History (14)

@alkesh7
2 years ago

#1 @audrasjb
2 years ago

  • Milestone changed from Awaiting Review to 6.0

Hello and welcome back to Trac!
As we entered release candidate cycle for 5.9, let's address this in 6.0.

#2 @Presskopp
2 years ago

Oh, we have this in many many places!

This ticket was mentioned in Slack in #docs by presskopp. View the logs.


2 years ago

This ticket was mentioned in Slack in #core-coding-standards by presskopp. View the logs.


2 years ago

#5 @audrasjb
2 years ago

  • Component changed from Comments to Login and Registration
  • Focuses docs added
  • Version trunk deleted

#6 @peterwilsoncc
2 years ago

@Presskopp Yes, it's in several places in core. I found it in 49 files but some of those were third party libraries.

For the purposes of this ticket, let's focus on wp-login.php and any further fixes can go on the generic coding standards fixes ticket #54728.

@peterwilsoncc
2 years ago

#7 @peterwilsoncc
2 years ago

  • Owner set to peterwilsoncc
  • Resolution set to fixed
  • Status changed from new to closed

In 52945:

Registration/Login: Coding standards fixes for wp-login.php.

Props alkesh7, Presskopp, audrasjb.
Fixes #54746.
See #54728.

#8 follow-up: @SergeyBiryukov
2 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I think comments like "Main" have some benefit, as they denote various parts of the file, in this case separating function declarations from the main part.

Instead of removing them, I think we can convert them to the multi-line format per the documentation standards:

/*
 * Main.
 */

#9 in reply to: ↑ 8 @peterwilsoncc
2 years ago

  • Keywords has-patch removed
  • Owner changed from peterwilsoncc to SergeyBiryukov
  • Status changed from reopened to assigned

Replying to SergeyBiryukov:

I think comments like "Main" have some benefit, as they denote various parts of the file, in this case separating function declarations from the main part.

With the additional context they do, on it's own the word main is meaningless.

Instead of removing them, I think we can convert them to the multi-line format per the documentation standards:

/*
 * Main.
 */

The point is to meet the coding standards by avoiding single line comments of that format. Given that the additional context is needed for the comment to make sense, I think it best revised as a multi-line comment anyway.

#10 @costdev
2 years ago

  • Type changed from enhancement to task (blessed)

#11 @SergeyBiryukov
2 years ago

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

In 53313:

Docs: Further clarify a comment for the main part of wp-login.php.

Follow-up to [52945].

Fixes #54746.

Note: See TracTickets for help on using tickets.