Skip to content

Fix silently dropped WordPress core functions in since-data generator - #1411

Merged
ernilambar merged 4 commits into
trunkfrom
1398-since-scanner
Jul 25, 2026
Merged

ernilambar merged 4 commits into
trunkfrom
1398-since-scanner

Conversation

@ernilambar

@ernilambar ernilambar commented Jul 24, 2026 •

Copy link
Copy Markdown
Member

Fixes #1398

Summary

tools/generate-wp-function-since-data.php was silently dropping valid WordPress core functions

Fixes

  • @since MU (3.0.0) docblocks not matched — the regex required digits right after @since, so functions using the frozen MU (x.y.z) form (get_active_blog_for_user, wpmu_activate_signup, domain_exists, …) were skipped.
  • Root-level core files not scanned — only wp-includes/ and wp-admin/ were scanned, missing global functions in wp-signup.php (confirm_blog_signup), wp-cron.php, and xmlrpc.php.
  • Other points mentioned in the related Issue is invalid.
Open WordPress Playground Preview

@ernilambar
ernilambar marked this pull request as ready for review July 24, 2026 08:07
@github-actions

github-actions Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ernilambar <nilambar@git.wordpress.org>
Co-authored-by: davidperezgar <davidperez@git.wordpress.org>
Co-authored-by: frantorres <frantorres@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the WordPress @since dataset generator to avoid silently skipping valid core functions by expanding the scan scope to include core root PHP files and by enhancing @since parsing to recognize the @since MU (x.y.z) docblock form.

Changes:

  • Add a root-level PHP file scan target alongside the existing wp-includes/ and wp-admin/ recursive scans.
  • Update the @since extraction regex to support the @since MU (3.0.0) format used by some WordPress MU–ported functions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/generate-wp-function-since-data.php Outdated
@davidperezgar

Copy link
Copy Markdown
Member

Thanks to Codex’s review, I noticed that glob( $wordpress_dir . '/wp-*.php' ) is broader than the intended core-only scope. It will also scan site-specific root files whose names begin with wp- (for example, wp-maintenance.php), potentially adding their @since-annotated functions to the generated core dataset.

Could we use an explicit allowlist of WordPress core entrypoints instead?

@ernilambar ernilambar added this to the 2.1.0 milestone Jul 25, 2026
@ernilambar
ernilambar merged commit 016615b into trunk Jul 25, 2026
28 checks passed
@ernilambar
ernilambar deleted the 1398-since-scanner branch July 25, 2026 13:37
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.

Issue related to since scanning

4 participants