[WordPress] 外掛分享: Defer for Contact Form 7

首頁外掛目錄 › Defer for Contact Form 7
WordPress 外掛 Defer for Contact Form 7 的封面圖片
全新外掛
安裝啟用
尚無評分
29 天前
最後更新
問題解決
WordPress 6.0+ PHP 7.4+ v1.0.0 上架:2026-06-30

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Defer for Contact Form 7」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

On every page Contact Form 7 loads its dependencies (wp-hooks, wp-i18n) and its CSS into the , blocking first paint. This plugin fixes that:

Defer CF7 core — moves wp-hooks/wp-i18n to the footer (you cannot defer them: an inline wp.i18n.setLocaleData block runs synchronously and would throw “wp is not defined”). CF7’s scripts leave the critical path.
Async CSS — the form stylesheet loads via media=print + onload-swap.

Both optimizations are idempotent and safe on every page. Strict dependency: with Contact Form 7 inactive, the plugin does nothing.
A note on jQuery
This plugin does NOT defer jQuery — on purpose. Deferring jQuery is only safe when EVERY jQuery-dependent script on the site is also deferred or in the footer; on an arbitrary site that is not guaranteed and breaks inline scripts in the head.
Pro version
Defer for Contact Form 7 Pro adds lazy-loaded Google reCAPTCHA v3 — spam protection without a PageSpeed hit:

Google’s api.js loads only on the first interaction with a form, so it never appears in Lighthouse/PSI.
The score check is server-side; a fresh single-use token is fetched for every submission.
The badge is hidden with the required Google disclaimer (GDPR-friendly); configurable score threshold and action label.

The free version stays fully functional on its own.
Support
Questions, bug reports or feature requests: https://www.linkedin.com/in/vitalii-ryabinin/

延伸相關外掛

文章
Filter
Apply Filters
Mastodon