Make WordPress Core

Opened 2 weeks ago

Last modified 2 weeks ago

#65119 reviewing enhancement

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

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

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 2 weeks ago.
65119.diff (7.0 KB) - added by sabernhardt 2 weeks ago.

Download all attachments as: .zip

Change History (9)

#1 @baikare.sandeep007
2 weeks ago

  • Keywords has-patch added

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


2 weeks ago

#3 @westonruter
2 weeks ago

  • Component changed from Text Changes to REST API
  • Focuses coding-standards removed
  • Milestone changed from Awaiting Review to 7.1

#4 @gaurangsondagar
2 weeks 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
2 weeks 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
2 weeks ago

#6 @sabernhardt
2 weeks ago

  • Description modified (diff)
  • Summary changed from Docs: Correct the grammer/spelling in api.js documentation to Docs: Correct the grammar/spelling in api.js documentation
  • Version changed from trunk to 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
2 weeks ago

  • Owner set to westonruter
  • Status changed from new to reviewing

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

Note: See TracTickets for help on using tickets.