WordPress / WordPress/Documentation-Issue-Tracker
[DevHub] Fixing escaping and internationalization mistakes in user contributed notes
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 109
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Description
I'm creating and updating this issue and plan on collecting issues with user contributed notes in the code reference.
Contributing
This issue will frequently be updated and I encourage you to add mistakes you find in the comments with the following format:
( checkbox ) - Brief issue description - link to comment
( larger issue description if warranted ).
Progress
Currently i've scrubbed function references pages 1 and 2 (of 111 😅). Feel free to start at page 3:
https://developer.wordpress.org/reference/functions/page/3/
Missing escapes and sanitation:
- add
\absint()around $item_id of this comment to escape as late as possible - reference: WP_Query - add
\esc_html()around $myvar to escape as late as possible - reference: add_action - change
printfstatement to code example below this todo - reference: add_action
printf( esc_html__( 'Comment ID %s could not be found.', 'textdomain' ), \absint( $comment_id ) ); - add
sanitize_text_field()around $_POST['wpdocs-meta-name'] inupdate_post_metadeclaration - reference: add_meta_box - declaration of
esc_attr()at the bottom in the textarea should becomeesc_textarea()- reference: add_meta_box - add
esc_html()around $wp_query->query_vars mentions - reference: add_rewrite_rule - add
esc_attr()to button_attrs['url'] declaration - reference: add_shortcode - add
esc_html()to echo get_site_option() declarations - reference: add_site_option
Strings requiring internationalization:
- strings in this comment - reference: add_action
- string 'Hello World' - reference: add_action
- string 'Hello' - reference: add_action
- strings 'aye!' - reference: add_feed
- missing textdomain in strings 'Square medium' and 'Square large' - reference: add_image_size
- strings 'My WP tool page' and 'My WP tool' - reference: add_management_page
- strings 'My page title', 'Title in the menu' and 'this is the content of the page - reference: add_management_page
maybe not though, because they seem to more describe the contents of those parameters? - all capitalized strings in this comment - reference: add_menu_page
- all capitalized strings in this comment - reference: add_menu_page
- string 'Unsubscribe email list' - reference: add_menu_page
- missing textdomain in last code string of this comment - reference: add_menu_page
- all capitalized strings in
add_menu_pagefunction call - reference: add_menu_page - string 'Last modified' - reference: add_meta_box
- string 'Social link' - reference: add_meta_box
- missing textdomain - reference: add_meta_box
-
esc_html()declarations should becomeesc_html__()declarations - reference: add_meta_box - capitalized strings in this comment - reference: add_rewrite_rule
- string 'Custom subscriber' - reference: add_role, additionally in this comment
- string 'Superintendent' - reference: add_role
- string 'My label' - reference: add_screen_option
- strings 'This is the setting title' and 'Content here' - reference: add_settings_field, additionally this comment
- string 'My new checkbox' - reference: add_settings_field
- string 'WP Custom Setting Section' - reference: add_settings_section
- string 'Hello shortcode' - reference: add_shortcode
- all capitalized strings - reference: add_submenu_page
- strings 'Submenu Title' - reference: add_submenu_page
- strings 'My Custom Submenu Page' - reference: add_submenu_page, also this comment
- strings 'My custom page' - reference: add_submenu_page
- strings 'Product filter by ambient noise' - reference: add_submenu_page
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the function reference pages, beginning with page 3, and inspect the linked user-contributed comments listed in the checklist. Work through a focused subset of the unchecked escaping and internationalization items, using each linked reference as the entry point. Done means the selected checklist items are corrected and marked complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation, internationalization, security
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100