Add checks to detect jQuery 4 incompatibilities ahead of WordPress 7.2 / 7.3

未关闭
#1,549 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@avinash-addweb 已经在做这个了。

开始于 2026年11月18日。

  • #1551 来自 @avinash-addweb —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript, jquery, php, wordpress

调研方向

Start by reading the existing React 19 compatibility check (#1356) and the check registration and test patterns it uses. Confirm the proposed API list against the jQuery 4.0 upgrade guide, then identify where plugin JavaScript and inline scripts are scanned. Done means the warning check is registered and documented, reports file, line, and replacement links, and has passing and failing fixtures with minified or vendored file behavior covered.

由索引模型根据 Issue 内容生成。

描述

Background

WordPress 7.2 will ship with jQuery Migrate 3.6.0 to prepare for updating to jQuery 4 in core. The planned timeline, per Preparing for jQuery 4 with WordPress 7.2:

  1. WordPress 7.2: update jQuery Migrate to 3.6.0, so extenders can catch deprecation notices.
  2. WordPress 7.3 (tentative): update to the latest jQuery and jQuery Migrate, plus jQuery UI and other jQuery-dependent libraries.
  3. End of 2027 (WordPress 7.5 or 7.6): disable jQuery Migrate by default.

Progress is tracked in core ticket #60478.

Once Migrate is disabled by default, plugins that rely on APIs removed in jQuery 4 will break on the front end and in the admin. Plugin Check is well placed to help developers find these issues before submission.

Proposal

Add a static check, for example jquery_deprecated_apis, that scans plugin JS (and inline scripts where feasible) for jQuery APIs removed or deprecated in jQuery 4. Suggested starting list, to be confirmed against the jQuery 4.0 upgrade guide:

  • Removed utilities: jQuery.isArray, jQuery.parseJSON, jQuery.trim, jQuery.type, jQuery.now, jQuery.isNumeric, jQuery.isFunction, jQuery.isWindow, jQuery.camelCase, jQuery.nodeName
  • Removed or deprecated events and methods: .bind(), .unbind(), .delegate(), .undelegate(), .hover(), shorthand event methods (.click(), .change(), etc.), .size()
  • Removed jQuery.fn.push, .sort, .splice usage
  • Behavior changes: jQuery.ajax and $.get/$.post defaults, .data() and .attr() edge cases, .addClass() / .removeClass() with arrays

Severity: start as warning, so it does not block submissions while the timeline is still tentative. Promote to error once jQuery 4 lands in core.

Also consider:

  • A check for wp_enqueue_script() calls that bundle their own jQuery or deregister core's jQuery (related to #702).
  • A readme / docs section pointing developers to SCRIPT_DEBUG and the jQuery Migrate console warnings in 7.2.

Acceptance criteria

  • New check registered, with a category such as plugin_repo or performance, and documented.
  • Each flagged API reports file, line, and a link to the replacement.
  • Unit tests with passing and failing fixtures.
  • Minified / vendored files are skipped, or flagged separately.
  • Docs updated.

Related

  • #1356: React 19 incompatibilities check (same "warn about upcoming incompatibilities" approach)
  • #702: check for libraries already in WP core, including jQuery (bundling, not deprecated APIs)

References

主要语言
PHP
星标
365
派生
135
平均合并
1 天 8 小时
30 天内合并 PR
20

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

WordPress/plugin-check 的其他 Issue

查看 WordPress/plugin-check 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。