[WordPress] 外掛分享: Turbo SPA for Elementor

首頁 › 外掛目錄 › Turbo SPA for Elementor
全新外掛
安裝啟用
—
尚無評分
3 天前
最後更新
—
問題解決
WordPress 6.2+ PHP 7.4+ v1.0.4 上架:2026-10-24

外掛標籤

開發者團隊

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

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

原文外掛簡介

Turbo SPA makes an Elementor site navigate like a single-page app and serves stored copies of pages to anonymous visitors, so pages open without reloading the browser and without rendering WordPress again.
Automatic setup:

After activation the plugin fetches a sample of the site’s own pages on the server, finds the header, footer and content container, validates them like the dashboard does and, when every page passes, switches SPA navigation (for everyone) and static output on.
Themes without a single content container (header, content and footer side by side) use “everything between header and footer” mode.
Runs again after a theme switch; “Run automatic setup” on the SPA Navigation page runs it on demand. A site that is already set up keeps its configuration.

What it does:

Intercepts internal links and swaps only the main content; header, footer, menus and overlays stay as the same DOM nodes. Current-menu highlighting is copied from the new page.
Updates title, URL, history (Back/Forward), meta description, canonical, Open Graph and JSON-LD tags, body classes and the admin bar.
Adds the stylesheets the next page needs before showing it, and downloads the scripts it needs in parallel; they still run one by one in page order.
Prefetches a page when the pointer rests on its link and the main menu pages while the browser is idle.
Re-initializes widgets on the new content once per visit: Elementor (classic handlers and v4 atomic elements), Essential Addons, Qi Addons, JNews blocks (load more, next/prev, tabs, popups, comments), WPForms and Contact Form 7.
Cleans up the page being left: Swiper instances, jQuery data and events, window listeners Elementor added for it.
Restores scroll position on Back/Forward and scrolls to #fragments; fast repeated clicks are handled.
Falls back to a normal page load whenever a page is excluded, uses another language or header, times out or fails.
Loading bar at the top of the page, with its color set on the SPA Navigation page (picker or hex code).

Static output (Turbo SPA → Static Compiler and Cache Manager):

Stores the real output of pages and posts as an anonymous visitor sees it, built through a loopback request or on the first anonymous visit.
Serves stored copies to anonymous visitors before themes and Elementor load, or before WordPress loads at all through the advanced-cache.php drop-in when no other cache plugin owns it. Logged-in users, visitors with comment or cart cookies, POST requests and URLs with query strings (other than tracking parameters) always get a live render.
Clears only what changed: a saved post clears itself plus the front and blog pages; templates, global styles, menus, theme, plugin changes and settings clear everything. Cleared pages are rebuilt by a WP-Cron queue.
Lifetime of at most 12 hours, so nonces inside a copy stay valid; optional skip of pages with nonces.
Atomic writes, unguessable file names, .htaccess protection, size limit.

Optional: delay third-party scripts (payments, captchas…) until the first interaction (Settings page, off by default).
Performance (Turbo SPA → Performance): server benchmarks per page (live render versus static copy) with history, and optional anonymous navigation statistics (daily counters only; no URL, IP address or cookie is stored; off by default).
Pages keep working without JavaScript: links are ordinary links.
Developer notes
Events on document: etspa:before-navigation (cancelable), etspa:before-content-replacement (cancelable),
etspa:after-content-replacement, etspa:after-navigation, etspa:navigation-error, etspa:before-fallback.
Add data-no-spa to a link or a container to keep it out of SPA navigation.
Re-initialize your own scripts after navigation:
document.addEventListener('etspa:after-content-replacement', function (e) {
initMyWidgets(e.detail.container);
});

Or register an adapter:
ETSPA_LIFECYCLE.register({ name: 'my-plugin', mount: function (container) {}, unmount: function (container) {} });

PHP filters: etspa_router_config, etspa_request_eligibility, etspa_default_excluded_paths,
etspa_default_excluded_selectors, etspa_excluded_file_extensions, etspa_safe_script_handles
(script handles that only define a library and may be loaded late in conservative mode), etspa_delay_scripts.
Each etspa:after-navigation event carries detail.assets: the stylesheets and scripts that navigation added.
Page view analytics: Google Analytics 4 counts history changes as page views when “Page changes based on
browser history events” is on in Enhanced measurement (the default). Other tools can listen to etspa:after-navigation.
Privacy Policy
This plugin does not contact external servers by default.
Optional navigation statistics (off by default): when enabled by an administrator, browsers send anonymous daily counters to this same WordPress site only (navigations, fallbacks, widget errors, total time). No page URL, IP address, cookie, or personal identifier is stored. You can disable the feature at any time on Turbo SPA → Performance.
Static page copies are stored on the site’s own server under uploads and are served only to anonymous visitors according to the settings you choose.

延伸相關外掛

文章
Filter
Mastodon