Enable jQuery Migrate Helper

外掛說明

WordPress 更新至 5.5 版後,便不再預設啟用移轉工具 jquery-migrate,這會造成某些執行舊版程式碼的佈景主題及外掛缺少功能或產生未預期的行為。

這個外掛提供一個暫時性的因應措施,它能為 WordPress 5.5 的網站啟用移轉指令碼,以便讓 (網站已採用的) 外掛及佈景主題開發者,能夠有更多時間完成程式碼更新及測試。

隨著 WordPress 5.6 的更新,內建的 jQuery 版本也一併升級。這代表以前觸發警告的舊版程式碼,現在會造成網站執行錯誤或全面停擺。

某些不再能正常執行的功能會在背景停止運作,而不會產生任何明顯的問題。

這個外掛能讓網站降級至舊版 jQuery 一段時間,但網站管理員仍應積極修復基礎問題。

安裝方式

  1. 將壓縮檔解壓縮後所得的 enable-jquery-migrate-helper 資料夾及其檔案上傳至 wp-content/plugins/ 資料夾。
  2. 請於 [外掛] 頁面啟用這個外掛。
  3. 大功告成!這個外掛會自動為網站處理接下來的工作。

常見問題集

『有些項目「已淘汰不用」』代表什麼?

當開發者使用更符合開發規範的指令碼、檔案或其他程式碼片段取代現有版本時,舊有項目便會遭到移除及棄用。

WordPress 5.6 發佈後的變更

隨著 WordPress 5.6 的發佈,內建的 jQuery 也一併完成了更新;這代表之前會出現「淘汰不用項目警告訊息」的外掛或佈景主題,現在會造成網站發生錯誤。這個外掛能讓網站在發生這類錯誤時,暫時性的改用舊版 jQuery 以修正程式碼或更換為其他程式,並且會在網站訪客讓網站產生第一次錯誤時就自動採取這項暫時性措施。

如何找到及使用瀏覽器主控台?

請參閱 WordPress.org 上的〈使用瀏覽器診斷 JavaScript 錯誤〉線上說明。

這個外掛不會記錄已遭淘汰不用的項目或變更 jQuery 版本

如果網站使用任何會合併 JavaScript 檔案,或以非同步方式載入 JavaScript 檔案,則這類外掛便會受到負面影響,導致無法如預期般執行。

如果網站需要這個外掛才能運作,請停用會以上述方式載入 JavaScript 檔案進行互動的外掛。當基礎問題解決後,網站管理員變可以移除這個外掛並重新啟用其他工具。

如何判斷網站是否需要這個外掛

如果 WordPress 網站升級後發生異常狀況,網站管理員便可以為網站安裝並啟用這個外掛。如果安裝啟用這個外掛後異常狀況有了緩解,請保持這個外掛的啟用狀態,並遵循外掛顯示的相關說明。當網站不再需要這個外掛時,外掛會顯示相關提示。

使用 jQuery v3 時,出現很多「淘汰不用項目警告訊息」

對 WordPress 來說,jQuery v3 是非常新的版本,因此這些都是可預期的狀況。

「淘汰不用項目通知」代表移轉工具已準備就緒,它能確保相關程式碼在第三方開發者進行更新、修改的期間,相關功能仍能正常執行。

使用者評論

2021 年 3 月 16 日
Weeks later and I am STILL seeing this damned message every week. I have run Remove jQuery Migrate even rerun Enable jQuery Migrate followed by Remove jQuery Migrate again deactivated them then I also have Stop jQuery Migrate Emails which seems to do nothing but I don't find out until a week after I have been messing around. I guess the remedy is send the messages to spam
2021 年 3 月 10 日
This is keeping a site with a paid theme abandoned by its developer working as intended. A backwards compatible patch like this is important keeping things working while applying security updates. Thank You!
2021 年 2 月 26 日
I was referred to this plugin from Qode Interactive (who I purchased my theme from) in order to fix some issues on my website, but then once I installed the plugin it completely broke my website. I tried to disable and uninstall it, but the affects of the plugin stayed. I tried to restore from a backup, but even that didn't work!! Finally, I contacted SiteGround and an agent helped me identify that the plugin left some file in the public_html folder that was outside of the backup. He deleted the files from public_html, restored from backup and I purged my cache and everything is working again. Lot of trouble to get back to square 1.
2021 年 2 月 26 日
Every time WordPress is updated this plugin is reinstalled, every time it's reinstalled I get an email telling me I don't need this plugin and that I should think about deleting it, and every time I delete the plugin it's reinstalled when WordPress gets updated. I can't get this plugin to stop being installed without my consent
閱讀全部 102 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Enable jQuery Migrate Helper〉的開發相關工作。

參與者

Enable jQuery Migrate Helper 外掛目前已有 16 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將 Enable jQuery Migrate Helper 外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

v 1.3.0

  • Added legacy jQuery UI to be loaded if legacy jQuery is in use.
  • Added mention of site URLs in automatic emails.
  • Added option to enable/disable automatic downgrades.
  • Added logic to ensure only one downgrade request is sent per page load.
  • Updated logic around automatic downgrades for improved performance.
  • Fixed core deprecation notices being incorrectly labeled as undetermined inline ones.

v 1.2.0

  • Added settings page
  • Added option for downgrading to legacy jQuery
  • Added automatic downgrades
  • Added option to log deprecations in modern jQuery
  • Added e-mail notifications
  • Added weekly email digest of deprecations
  • Added option to allow logging deprecations from anonymous site visitors
  • Changed the handling of inline JavaScript code causing deprecation notices
  • Changed the admin bar to be two fixed links to avoid ever changing contexts
  • Changed the admin notices to be persistent when using legacy jQuery after upgrading to WordPress 5.6
  • Changed how concatenation is disabled, to address public-facing performance concerns
  • Fixed recommendation to remove plugin when not logging any deprecations having the wrong logic and not being displayed.

v 1.1.0

  • Added option to dismiss deprecation notices in backend
  • Added logging of deprecation notices in the front end
  • Added admin bar entry to show when deprecations occur
  • Added view of logged deprecations
  • Added dashboard notice encouraging users to remove the plugin if no deprecations have been logged in a while (1 week).
  • Changed the time interval between showing the dashboard nag from 2 weeks to 1 week, as WordPress 5.6 comes closer.

v 1.0.1

  • Fix one of the admin notices being non-dismissible.

v 1.0.0

  • Initial release.