Make WordPress Core

Opened 11 months ago

Last modified 11 months ago

#58102 new defect (bug)

Check PHPcs Coding standard into the wp-includes folder

Reported by: viralsampat's profile viralsampat Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: coding-standards Cc:

Description

Hello Team,

I have reviewed the code and found a few errors in some of the below files. Please below files:

Files:

wp-includes/admin-bar.php
wp-includes/option.php

Thanks,

Attachments (13)

58102.diff (627 bytes) - added by viralsampat 11 months ago.
I have checked above mentioned issue and I have resolved it and added patch.
58102.2.diff (1.5 KB) - added by viralsampat 11 months ago.
I have checked above mentioned issue and I have resolved it and added patch.
58102.3.diff (1.3 KB) - added by viralsampat 11 months ago.
I have found one another file and added patch for the same.
58102.4.diff (1.3 KB) - added by dhrumilk 11 months ago.
@audrasjb Please Verify the diff it OK or does need to change.
58102-general-template.diff (1.3 KB) - added by viralsampat 10 months ago.
58102-template.diff (1.2 KB) - added by viralsampat 10 months ago.
I have removed unused variables from above mentioned files and checked phpcs coding standard.
58102-twentyseventeen-404.diff (942 bytes) - added by viralsampat 10 months ago.
I have checked above mentioned issue into the theme section and I have resolved it and added patch.
58102-twentysixteen.diff (5.7 KB) - added by viralsampat 10 months ago.
I have checked another file and added my patch
58102-twentyfifteen.diff (4.6 KB) - added by viralsampat 10 months ago.
I have checked another theme and founds few file. Here, I have added its patch.
58102-twentyfourteen.diff (9.1 KB) - added by viralsampat 9 months ago.
I have checked another theme and founds few file. Here, I have added its patch.
58102-twentythirteen.diff (5.1 KB) - added by viralsampat 9 months ago.
I have checked another theme and founds few file. Here, I have added its patch.
58102-twentytwelve.diff (15.1 KB) - added by viralsampat 9 months ago.
I have checked another theme and founds few file. Here, I have added its patch.
58102-twentyeleven.diff (24.2 KB) - added by viralsampat 9 months ago.
I have checked above mentioned issue and founds few files. Here, I have added its patch.

Download all attachments as: .zip

Change History (19)

@viralsampat
11 months ago

I have checked above mentioned issue and I have resolved it and added patch.

@viralsampat
11 months ago

I have checked above mentioned issue and I have resolved it and added patch.

#1 @SergeyBiryukov
11 months ago

  • Component changed from External Libraries to General

@viralsampat
11 months ago

I have found one another file and added patch for the same.

#2 @audrasjb
11 months ago

There is a small issue in your change on revison.php: __() should not be replaced with esc_html_e() but rather with esc_html__().

#3 @audrasjb
11 months ago

Also adding esc_attr() to $type_attr in
<style<?php echo $type_attr; ?> media="print">#wpadminbar { display:none; }</style>
looks wrong to me, as $type_attr may contain an attribute + its value (example: type="text/css".

If we want to escape this variable, I think esc_html would be more appropriate here.

@dhrumilk
11 months ago

@audrasjb Please Verify the diff it OK or does need to change.

#4 follow-up: @krupalpanchal
11 months ago

Shouldn't all the changes be in one diff file instead of multiple, like 58102.diff, 58102.2.diff etc. Or is that okay to have multiple diff files?

Because in the 58102.diff, there is a change in the option.php file. In 58102.2.diff, there is a change in admin-bar.php and so on.

#5 in reply to: ↑ 4 @NekoJonez
11 months ago

Replying to krupalpanchal:

Shouldn't all the changes be in one diff file instead of multiple, like 58102.diff, 58102.2.diff etc. Or is that okay to have multiple diff files?

Because in the 58102.diff, there is a change in the option.php file. In 58102.2.diff, there is a change in admin-bar.php and so on.

I think it's best practice to set them all in one file. Otherwise it looks like we have 4 different versions of one patch...

#6 @audrasjb
11 months ago

It really depends on the scope of the patch. Sometimes, it's easier to separate things into multiple small scoped patches.
But yes, when adding multiple patches to one ticket, it's probably better to name them after to scope of the change.
Example: 58102-revisions.diff would probably be a better name for 58102.4.diff.

@viralsampat
10 months ago

I have removed unused variables from above mentioned files and checked phpcs coding standard.

@viralsampat
10 months ago

I have checked above mentioned issue into the theme section and I have resolved it and added patch.

@viralsampat
10 months ago

I have checked another file and added my patch

@viralsampat
10 months ago

I have checked another theme and founds few file. Here, I have added its patch.

@viralsampat
9 months ago

I have checked another theme and founds few file. Here, I have added its patch.

@viralsampat
9 months ago

I have checked another theme and founds few file. Here, I have added its patch.

@viralsampat
9 months ago

I have checked another theme and founds few file. Here, I have added its patch.

@viralsampat
9 months ago

I have checked above mentioned issue and founds few files. Here, I have added its patch.

Note: See TracTickets for help on using tickets.