Skip to content

Privacy: Add @since tags and clarify JSDoc in privacy-tools.js - #13842

Open
zakariabinsaifullah wants to merge 1 commit into
WordPress:trunkfrom
zakariabinsaifullah:49381-privacy-tools-jsdoc
Open

zakariabinsaifullah wants to merge 1 commit into
WordPress:trunkfrom
zakariabinsaifullah:49381-privacy-tools-jsdoc

Conversation

@zakariabinsaifullah

@zakariabinsaifullah zakariabinsaifullah commented Sep 30, 2026 •

Copy link
Copy Markdown

Follow-up to r63556, which added docblocks for the privacy request helper functions in privacy-tools.js. This PR covers the rest of the review feedback left on #6690 (by @masteradhoc, @VladimirAus and @mukeshpanchal27):

  • @since tags on every function. I checked versions against the release tags. The helpers were introduced in 4.9.6 (in wp-admin/js/xfn.js at first, moved to privacy-tools.js in 5.3). setExportProgress() and setErasureProgress() were added in 5.4.0. The signatures haven't changed since.
  • Optional params: zipUrl and errorMessage are now marked [optional], and the descriptions say what happens when each is omitted.
  • Index descriptions: the progress functions receive the number of completed exporters/erasers (0 to exportersCount/erasersCount). doNextExport()/doNextErasure() receive a 1-based index (the first call is doNextExport( 1, 1 )). The summaries now say what drives the progress update.
  • onErasureFailure() was missing its @return {void}.

Documentation only; no behavior change.

Checks run: npx eslint, npx wp-scripts lint-js (JSDoc rules), grunt jshint:core, node --check, git diff --check. All pass.

Trac ticket: https://core.trac.wordpress.org/ticket/49381

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Researching @since versions from the release history and drafting the docblock wording. I reviewed the final changes and take responsibility for them.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Follow-up to [63556], which added docblocks for the privacy request helper
functions. This addresses the remaining feedback on #49381:

- Add `@since` tags: 4.9.6 for the functions introduced with the privacy
  tools, 5.4.0 for `setExportProgress()` and `setErasureProgress()`.
- Mark `zipUrl` and `errorMessage` as optional parameters.
- Clarify that the progress functions take the number of completed
  exporters/erasers (0 to count), while the `doNext*()` functions take a
  1-based index.
- Add the missing `@return` tag to `onErasureFailure()`.

See #49381.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props binsaifullah, masteradhoc.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@masteradhoc

Copy link
Copy Markdown

Thanks! This looks good to me.

@mukeshpanchal27 mukeshpanchal27 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look solid to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants