#55647 closed task (blessed) (fixed)
Coding Standards fixes for WP 6.1
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch |
Focuses: | coding-standards | Cc: |
Change History (59)
This ticket was mentioned in PR #2435 on WordPress/wordpress-develop by kebbet.
3 years ago
#6
- Keywords has-patch added
Trac ticket:
A new set of improvements. :)
https://core.trac.wordpress.org/ticket/55647
https://core.trac.wordpress.org/ticket/54728
#9
follow-up:
↓ 10
@
3 years ago
In [53714], instead of MINUTE_IN_SECONDS / 2
, isn't 1/2 * MINUTE_IN_SECONDS
or 0.5 * MINUTE_IN_SECONDS
more readable and quicker understandable, because it reads "left to right"?
#10
in reply to:
↑ 9
;
follow-up:
↓ 11
@
3 years ago
Replying to TobiasBg:
In [53714], instead of
MINUTE_IN_SECONDS / 2
, isn't1/2 * MINUTE_IN_SECONDS
or0.5 * MINUTE_IN_SECONDS
more readable and quicker understandable, because it reads "left to right"?
The first expression gives int(30), the suggested ones two both gives float(30.), so not good for identicality comparisons.
#11
in reply to:
↑ 10
@
3 years ago
Replying to knutsp:
The first expression gives int(30), the suggested ones two both give float(30.), so not good for identicality comparisons.
Good point, hadn't thought of that!
This ticket was mentioned in PR #3189 on WordPress/wordpress-develop by costdev.
2 years ago
#38
Per naming conventions, don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
See PHP Coding Standards - Naming Conventions.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3190 on WordPress/wordpress-develop by costdev.
2 years ago
#39
Per naming conventions, don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
See PHP Coding Standards - Naming Conventions.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3191 on WordPress/wordpress-develop by costdev.
2 years ago
#40
Per naming conventions, don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
See PHP Coding Standards - Naming Conventions.
This PR includes renaming of the following variables:
$sbname
to$sidebar_name
.$sbvalue
to$sidebar_data
.$j
to$widget_count
.$i
to$sidebar_index
.$sb
to$sidebar
insrc/wp-admin/widgets-form.php
.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3192 on WordPress/wordpress-develop by costdev.
2 years ago
#41
Per naming conventions, don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
See PHP Coding Standards - Naming Conventions.
This PR includes renaming of the following variables:
$i
to$submenu_index
.$cap
to$capability
.$tax
to$taxonomy
.- Several
$awaiting_mod_*
to$awaiting_moderation_*
. - Several
$ptype_*
to$post_type_*
. $types
to$post_types
.$appearance_cap
to$appearance_capability
.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3193 on WordPress/wordpress-develop by costdev.
2 years ago
#42
Per naming conventions, don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
See PHP Coding Standards - Naming Conventions.
This PR includes renaming of the following variables:
$r
to$edit_result
.$ext
to$extension
.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3194 on WordPress/wordpress-develop by costdev.
2 years ago
#43
Per naming conventions, don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
See PHP Coding Standards - Naming Conventions.
This PR includes renaming of the following variables:
$q
to$query_string
.$vars
to$query_vars
.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3195 on WordPress/wordpress-develop by costdev.
2 years ago
#44
Per naming conventions, don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
See PHP Coding Standards - Naming Conventions.
This PR includes renaming of the following variables:
$h
to$header
.
Note: There are a few variables I'd like some input on:
$oitar
- I have no idea what this refers to.$dst_height
- This could be$dest_height
, but that doesn't seem like a worthwhile change. Suggestions?$dst_width
- See above.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3196 on WordPress/wordpress-develop by costdev.
2 years ago
#45
Per naming conventions, don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
See PHP Coding Standards - Naming Conventions.
This PR includes renaming of the following variables:
$r
to$upgrade_data
.$res
to$connected
.$info
to$new_theme_data
.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3197 on WordPress/wordpress-develop by costdev.
2 years ago
#46
Per naming conventions, don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
See PHP Coding Standards - Naming Conventions.
This PR includes renaming of the following variables:
$r
to$upgrade_data
.$res
to$connected
.$pluginfiles
to$plugin_files
- Per naming conventions, separate words via underscores.$info
to$new_plugin_data
.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3198 on WordPress/wordpress-develop by costdev.
2 years ago
#47
Per naming conventions, don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
See PHP Coding Standards - Naming Conventions.
This PR includes renaming of the following variables:
$post_ID
to$post_id
. - "Use lowercase letters in variable, action/filter, and function names"$ext_type
to$extension_type
.$ext
to$extension
.$id3data
to$id3_data
. - "Separate words via underscores."$msg
to$message
.$sb
to$sidebar
.$alt
to$alternate
.$pid
to$post_id
.$menu_obj
to$menu_object
.$noparents
to$no_parents
. - "Separate words via underscores."$sup
to$supplemental
.$cat_id
to$category_id
.$cat_name
to$category_name
.$out
to$output
.$r
to$edit_result
.$t
to$taxonomy
.$u
to$update_result
.$r
to$result
.$response
to$response_data
.$x
to$response
.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
2 years ago
#48
Yes I believe so @mukeshpanchal27. Wherever a variable is unnecessarily abbreviated and is ambiguous, it should be renamed, especially if it's a single character variable like $c
. Those reading the source should not need to scroll up to find out what a variable refers to.
That said, there are likely to be exceptions, such as $i
inside for()
loops. While $k => $v
in foreach()
loops is common, I generally find it better to just name _at least_ the $v
variable.
mukeshpanchal27 commented on PR #3197:
2 years ago
#50
@costdev great work 🚀
mukeshpanchal27 commented on PR #3195:
2 years ago
#51
@costdev i don't think we can change $dst_height
and $dst_width
as it also used in JS and unit tests.
mukeshpanchal27 commented on PR #3196:
2 years ago
#52
@costdev great work 🚀
This ticket was mentioned in PR #3329 on WordPress/wordpress-develop by kebbet.
2 years ago
#55
Removes two unneeded whitespaces.
https://core.trac.wordpress.org/ticket/55647
#57
@
2 years ago
- Resolution set to fixed
- Status changed from new to closed
Closing this one out with RC1 today. #56791 has been created for 6.2.
2 years ago
#58
Merged into Core in https://core.trac.wordpress.org/changeset/54480.
@SergeyBiryukov commented on PR #2435:
6 months ago
#59
Thanks for the PR! Merged in r58888.
In 53398: