#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 (69)
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_SECONDSor0.5 * MINUTE_IN_SECONDSmore readable and quicker understandable, because it reads "left to right"?
The first expression gives int(30), the suggested ones two both give 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.
3 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.
3 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.
3 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:
$sbnameto$sidebar_name.$sbvalueto$sidebar_data.$jto$widget_count.$ito$sidebar_index.$sbto$sidebarinsrc/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.
3 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:
$ito$submenu_index.$capto$capability.$taxto$taxonomy.- Several
$awaiting_mod_*to$awaiting_moderation_*. - Several
$ptype_*to$post_type_*. $typesto$post_types.$appearance_capto$appearance_capability.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3193 on WordPress/wordpress-develop by costdev.
3 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:
$rto$edit_result.$extto$extension.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3194 on WordPress/wordpress-develop by costdev.
3 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:
$qto$query_string.$varsto$query_vars.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
This ticket was mentioned in PR #3195 on WordPress/wordpress-develop by costdev.
3 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:
$hto$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.
3 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:
$rto$upgrade_data.$resto$connected.$infoto$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.
3 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:
$rto$upgrade_data.$resto$connected.$pluginfilesto$plugin_files- Per naming conventions, separate words via underscores.$infoto$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.
3 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_IDto$post_id. - "Use lowercase letters in variable, action/filter, and function names"$ext_typeto$extension_type.$extto$extension.$id3datato$id3_data. - "Separate words via underscores."$msgto$message.$sbto$sidebar.$altto$alternate.$pidto$post_id.$menu_objto$menu_object.$noparentsto$no_parents. - "Separate words via underscores."$supto$supplemental.$cat_idto$category_id.$cat_nameto$category_name.$outto$output.$rto$edit_result.$tto$taxonomy.$uto$update_result.$rto$result.$responseto$response_data.$xto$response.
Trac ticket: https://core.trac.wordpress.org/ticket/55647
3 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:
3 years ago
#50
@costdev great work 🚀
mukeshpanchal27 commented on PR #3195:
3 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:
3 years ago
#52
@costdev great work 🚀
This ticket was mentioned in PR #3329 on WordPress/wordpress-develop by kebbet.
3 years ago
#55
Removes two unneeded whitespaces.
https://core.trac.wordpress.org/ticket/55647
#57
@
3 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.
3 years ago
#58
Merged into Core in https://core.trac.wordpress.org/changeset/54480.
@SergeyBiryukov commented on PR #2435:
16 months ago
#59
Thanks for the PR! Merged in r58888.
@SergeyBiryukov commented on PR #3189:
2 months ago
#60
Thanks for the PR! Merged in r60923.
@SergeyBiryukov commented on PR #3190:
2 months ago
#61
@SergeyBiryukov commented on PR #3193:
2 months ago
#62
Thanks for the PR! Merged in r60932.
@SergeyBiryukov commented on PR #3194:
2 months ago
#63
Thanks for the PR! Merged in r60967.
@SergeyBiryukov commented on PR #3195:
2 months ago
#64
Thanks for the PR! Merged in r60970.
@SergeyBiryukov commented on PR #3197:
8 weeks ago
#65
Thanks for the PR! Merged in r60997.
@SergeyBiryukov commented on PR #3196:
8 weeks ago
#66
Thanks for the PR! Merged in r61028.
@SergeyBiryukov commented on PR #3191:
5 weeks ago
#67
Thanks for the PR! Merged in r61187.
@SergeyBiryukov commented on PR #3192:
5 weeks ago
#68
Thanks for the PR! Merged in r61200.
@SergeyBiryukov commented on PR #3198:
5 weeks ago
#69
Thanks for the PR! Merged in r61224.
In 53398: