[WordPress] 外掛分享: Fresh Forms for Gravity

首頁外掛目錄 › Fresh Forms for Gravity
WordPress 外掛 Fresh Forms for Gravity 的封面圖片
3,000+
安裝啟用
★★★★
4.7/5 分(7 則評價)
69 天前
最後更新
問題解決
WordPress 4.9+ PHP 7.0+ v1.5.6 上架:2019-10-07

內容簡介

快取非常適合頁面或文章內容較少改動的場景,但如果您嵌入表單而且經常更改表單,或使用動態程式碼,在快取頁面上執行程式碼未必能正常運作,或使用依賴動態即時數據的第三方解決方案(例如 reCAPTCHA),在這些情況下使用快取將會造成其他問題。這同樣適用於快取外掛所做的某些自動 JavaScript 優化,這些優化已知會破壞 JavaScript 執行。

一個簡單的解決方法是將快取外掛或代理配置為排除嵌入表單的頁面,但您還需要在創建新頁面或嵌入新表單時記住這點……

這個外掛可以自動處理上述問題,並執行以下操作:

在啟用外掛時清除現有快取。這是必要的,以便允許下一步運行。
動態檢查是否有支持的將 Gravity Forms 嵌入任何方式(請參見下面的列表)。
如果檢查成功,它將防止受支持的快取外掛,瀏覽器和 CDN/代理對此文章或頁面進行快取。

支持的嵌入方式:

WordPress 預設編輯器,shortcode 或 Gutenberg 區塊。任何文章類型的內容,包括頁面和自訂文章。
Avada。已證明以下元素可用:內容框,Gravity Form,Modal,Text Block。其他元素也可能可用,但未經測試。
Elementor。支援添加到文章內容中的以下小工具:Shortcode、Text。
Essential Addons for Elementor Gravity Forms 小工具
Divi。與任一可在內容中插入 GF shortcode 的預設模塊一起工作,例如:Call To Action、Text、Tabs……
WP Tools Gravity Forms Divi Module
由 Lucas Stark 開發的 WooCommerce Gravity Forms 產品附加元件。
ACF 文字、文本區域和所見即所得的文字(WYSIWYG)字段。默認禁用,有關詳細信息請參見常見問題解答。
Beaver Builder。它會檢測添加到 Text Editor 模塊中的 Gravity Forms shortcode。
Ultimate Addons for Beaver Builder Gravity Forms 列表模塊。
Brainstorm Force 開發的 Ultimate Addons for Elementor
WPBakery Page Builder。已證明以下元素可用:「Gravity Form」、「Text Block」。其他元素也可能可用,但未經測試。

如果您沒有使用上述任何嵌入方式,您仍然可以使用篩選器來傳遞要運行 Fresh forms 的文章 ID 號碼。您還可以讓 Fresh Forms 在檢測到表單時添加一個 cookie,以將其作為跳過使用基於 Varnish 的快取的主機的方法。有關詳細信息,請參見常見問題解答。

沒有任何選項頁面。僅將外掛版本保存到數據庫中,以便在需要時處理更新後的操作,不會存儲其他數據。

它應該與支援 DONOTCACHEPAGE 常數的任何快取外掛以及尊重使用 Cache-Control HTTP 標頭的代理一起使用。

支援的快取外掛:

Autoptimize
Cache Enabler
Comet Cache
Hummingbird
Kinsta Cache
LiteSpeed Cache
SiteGround Optimizer
Surge
W3 Total Cache
WP Engine System
WP Fastest Cache
WP Optimize
WP Rock

外掛標籤

開發者團隊

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

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

原文外掛簡介

Caching is great for scenarios where your post or page content it’s not changed frequently, but if you have a form embedded to which you do changes very often or you’re using dynamic code, that doesn’t run for a cached page, or using third-party solutions relaying in dynamic live data (e.g. reCAPTCHA), using caching in these cases is going to cause issues. The same applies to certain automatic JS optimizations done by caching plugins that are known to break JS execution easily.
An easy solution is to configure your caching plugin or proxy to exclude the page where the form is embedded, but you need also to remember this when you create a new page or embed a new form in an existing page…
This plugin will take care of the above automatically doing the following:

Flush current cache on plugin activation. This is required in order to allow the next step to run.
Dynamically check if there’s a Gravity Forms for any of the supported embedding methods (see below for the list).
If so, it will prevent post/page from being cached by any of the supported caching plugins, browsers and CDN/Proxies.

Embedding methods supported:

WordPress default editor, shortcode or Gutenberg block. Content of any post type, including pages and custom posts.
ACF fields of type Text, Text Area, and WYSIWYG. Disabled by default.
Avada. The following elements has been proven to work: Content Boxes, “Gravity Form”, Modal, Text Block. Other elements could work too, but not tested.
Beaver Builder. It will detect Gravity Forms shortcodes added to a Text Editor module.
Conversational Forms add-on. It will automatically detect any form page using the conversational_form post type (requires Conversational Forms add-on 1.3.0+).
Divi. It should work with any of the default modules where you can insert a GF shortcode into the content. e.g. Call To Action, Text, Tabs…
Elementor. The following widgets added to the post content are supported: Shortcode, Text.
Essential Addons for Elementor Gravity Forms widget.
GravityKit Gravity Forms Widget for Elementor.
PowerPack for Beaver Builder Gravity Forms Styler module.
Ultimate Addons for Beaver Builder Gravity Forms Styler module.
Ultimate Addons for Elementor By Brainstorm Force.
WooCommerce Gravity Forms Product Add-ons by Lucas Stark.
WPBakery Page Builder. The following elements has been proven to work: “Gravity Form”, Text Block. Other elements could work too, but not tested.
WP Tools Gravity Forms Divi Module.

If you’re not using any of the above embedding methods you can still use Fresh Forms with a filter to pass the ID number of the posts where you want to run Fresh forms. You can also make Fresh Forms to add a cookie when a form is detected to use this cookie as a way to skip caching for hosts using Varnish based caching. Please see FAQ for more details.
There’s no options page. Only the plugin version is saved to the database to be able to handle actions after an update when needed, no other data is stored.
It should work with any caching plugin with support for DONOTCACHEPAGE constant, and proxies respecting the use Cache-Control HTTP header.
Caching and Optimization plugins supported:

Autoptimize
Cache Enabler
Comet Cache
Hummingbird
Kinsta Cache
LiteSpeed Cache
Page Optimize (Script concatenation only)
Perfmatters (Delay JS exclusions only)
Speed Optimizer (by SiteGround, the plugin with more name changes in the history of WordPress!)
Surge
W3 Total Cache
WP Engine System
WP Fastest Cache
WP Optimize
WP Rocket
WP Super Cache

Caching plugins NOT supported:

Breeze. It doesn’t support DONOTCACHEPAGE constant or filters to skip caching. Check FAQ for a workaround.
NitroPack. It doesn’t support DONOTCACHEPAGE constant or filters to skip caching. Check FAQ for a workaround.

Cloudflare and other CDN/proxies:
This plugin will add appropriate HTTP header to pages with a Gravity Forms form to exlude the page HTML from caching when the web host setup allows it.
By default Cloudflare doesn’t cache the page HTML, it does only when you have configured it to “Cache Everything”. In this case, after activating the plugin, you need to purge cache in your Cloudflare account or wait for cache expiration to let Cloudflare know the page must be excluded from caching.
Certain hosts like WP Engine and Kinsta don’t allow HTTP headers modification from WordPress side of things, therefore Cloudflare support will not work for these hosts.
Other proxy services should work in a similar way, but I don’t have access to test any other proxy service. Feel to reach me if you want to provide me access to add support for your proxy service (documentation for the proxy would be required).
Note for these cases (caching is done by an external service), Fresh Forms can just include the HTTP header when your web host allows it. Once the header is added, it’s up to the CDN/proxy being used to obey the header and skip caching for the page.
Requirements

PHP 7.0 or higher.
WordPress 4.9 or higher.
Gravity Forms 2.3 or higher.
Only forms embedded using classic editor shortcode or Gutenberg block are supported.

Usage
Just install and activate. No settings required except for ACF support (see FAQ).

延伸相關外掛

文章
Filter
Apply Filters
Mastodon