Apraksts
On every page Contact Form 7 loads its dependencies (wp-hooks, wp-i18n) and its CSS into the <head>, blocking first paint. This plugin fixes that:
- Defer CF7 core — moves wp-hooks/wp-i18n to the footer (you cannot
deferthem: an inlinewp.i18n.setLocaleDatablock 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/
Ekrānuzņēmumi
→ Performance: defer/async toggles and the Pro reCAPTCHA v3 section.” class=”wp-image-9000001″ srcset=”https://i0.wp.com/ps.w.org/defer-for-contact-form-7/assets/screenshot-1.png?rev=3592120&w=300 300w, https://i0.wp.com/ps.w.org/defer-for-contact-form-7/assets/screenshot-1.png?rev=3592120&w=600 600w, https://i0.wp.com/ps.w.org/defer-for-contact-form-7/assets/screenshot-1.png?rev=3592120&w=900 900w” sizes=”(max-width: 599px) 50vw, 33vw” width=”1714″ height=”748″ loading=”eager” fetchpriority=”high” decoding=”async”/>Uzstādīšana
- Upload the
defer-for-contact-form-7folder to/wp-content/plugins/, or install the ZIP via Plugins Add New Upload. - Activate the plugin. Contact Form 7 must be active.
- Both optimizations are on by default — there is nothing else to configure.
- To toggle them, go to Contact Performance.
BUJ
-
Does this work with caching/optimization plugins?
-
Yes, but minifiers that combine and reorder scripts can interfere with the headfooter move. Test with your cache plugin enabled.
-
Does the plugin send any data anywhere?
-
No. It makes no external requests and stores no personal data.
Atsauksmes
Par šo spraudni nav atsauksmju.
Autori un izstrādātāji
“Defer for Contact Form 7” ir atvērtā pirmkoda programmatūra. Šo spraudni ir veidojuši šādi cilvēki.
LīdzdalībniekiTulkot “Defer for Contact Form 7” savā valodā.
Vai jūs interesē attīstība?
Pārlūkojiet kodu, apmeklējiet SVN krātuvi vai abonējiet attīstības žurnālu, ko izveidojis RSS.
Izmaiņu žurnāls
1.0.0
- Initial release: CF7 core defer + async CSS.
