Make WordPress Core

Opened 6 months ago

Closed 3 months ago

Last modified 3 months ago

#65119 closed defect (bug) (fixed)

Docs: Correct the grammar/spelling in api.js documentation

Reported by: baikare.sandeep007 Owned by: westonruter
Priority: normal Milestone: 7.1
Component: REST API Version: 4.7
Severity: normal Keywords: has-patch commit
Cc: Focuses: javascript, docs

Description (last modified by sabernhardt)

During a routine review of src/js/_enqueues/wp/api.js, I identified several grammatical errors and spelling inconsistencies within the inline comments. These issues, while minor, can hinder readability and comprehension for developers working with or learning from this code.

Changes Made:

This patch improves the inline documentation by:

  • Correcting spelling mistakes throughout the file's comment blocks
  • Fixing grammatical errors to enhance sentence clarity and flow
  • Maintaining the original technical meaning and intent of all comments
  • Preserving consistent terminology and code comment formatting standards

Impact:

These changes are purely documentation-focused and have no impact on:

  • Code execution or functionality
  • API behavior or public interfaces
  • Performance or backward compatibility

Testing:

No functional testing is required as these changes only affect inline comments. The patch has been verified to contain only whitespace and text modifications within comment blocks.

Attachments (2)

api.js-doc-enhancement.patch​ (1.3 KB ) - added by baikare.sandeep007 6 months ago.
65119.diff​ (7.0 KB ) - added by sabernhardt 6 months ago.

Download all attachments as: .zip

Change History (15)

#1 @baikare.sandeep007
6 months ago

  • Keywords has-patch added

This ticket was mentioned in ​Slack in #core by baikaresandeep007-1. ​View the logs.


6 months ago

#3 @westonruter
6 months ago

  • Component Text Changes → REST API
  • Focuses coding-standards removed
  • Milestone Awaiting Review → 7.1

#4 @gaurangsondagar
6 months ago

Patch Testing Report:

Patch Tested: https://core.trac.wordpress.org/attachment/ticket/65119/api.js-doc-enhancement.patch

Environment:

  • WordPress: 7.0-RC2-62242
  • PHP: 8.2
  • Server: Apache
  • Browser: Chrome
  • OS: Ubuntu 22.04.5 LTS

Test Cases:

  • I have reviewed and verified all the reported grammer/spelling mistake from the below file path.
    wp-includes/js/wp-api.js
    

Result:
I have verified and patch looks correctly applied.

Please review the attached screenshots for reference:
​https://snipboard.io/zGhc53.jpg
​https://snipboard.io/Xq6k2U.jpg
​https://snipboard.io/envRLd.jpg

#5 @westonruter
6 months ago

@gaurangsondagar Thank you, but I suggest focusing your efforts on testing patches that actually have functionality. Testing reports for coding standards and docs updates aren't particularly helpful.

@sabernhardt
6 months ago

#6 @sabernhardt
6 months ago

  • Description modified (diff)
  • Summary Docs: Correct the grammer/spelling in api.js documentation → Docs: Correct the grammar/spelling in api.js documentation
  • Version trunk → 4.7

The three sentences edited in api.js-doc-enhancement.patch were all included in api.js when [38832] introduced the script file.

  • Capitalizing ID is good, but I would capitalize it in another line too.
  • URL, MySQL, and Safari were also lowercase.
  • The word "thru" is used in two lines.

Special notes about 65119.diff:

  1. // Attach parent post ID to the collection.
    The script sets 'parent_post' (not 'post_parent'), and I think a space fits the documentation instead of the underscore.
  2. // Go through the parsable date fields. If our model contains any of them, it gets the TimeStampedMixin.
    The patch splits this into two sentences.
  3. // Fail silently, to avoid errors in Safari private mode.
    Failing silently does not fix errors.
  4. 65119.diff corrects the typos for "nonce", "route" and "it is" (or "it's"). I noticed later that these were reported—and edited—in #65112.

#7 @westonruter
6 months ago

  • Owner set to westonruter
  • Status new → reviewing

Self-assigning to move this forward to commit when trunk is unfrozen.

#8 @wildworks
3 months ago

  • Type enhancement → defect (bug)

The trunk is no longer frozen, so feel free to commit a patch at any time.

This ticket was mentioned in ​PR #12477 on ​WordPress/wordpress-develop by ​@sabernhardt.


3 months ago
#9

  • Capitalizes ID, URL, MySQL, and Safari.
  • Replaces the word "thru" with "through"
  • Replaces "post_parent id" with "parent post ID"
  • Splits the "Go through the parsable date fields..." sentence into two.
  • Edits the comment about failing silently.

Trac 65119

Use of AI Tools: none by me

#10 @sabernhardt
3 months ago

The patch needed to be refreshed, so now it is a pull request.

#11 @wildworks
3 months ago

  • Keywords commit added

#12 @westonruter
3 months ago

  • Resolution → fixed
  • Status reviewing → closed

In 62692:

Docs: Correct grammar and spelling in api.js documentation.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/12477.
Follow-up to r38832, r62431.

Props sabernhardt, baikaresandeep007, wildworks, gaurangsondagar.
See #65112.
Fixes #65119.

​@sabernhardt commented on ​PR #12477:


3 months ago
#13

Committed in r62692

Note: See TracTickets for help on using tickets.