manifest / performance / custom-spa
custom spa
Lightweight plugin that turns WordPress front-end navigation into a single-page-app experience, without a JS framework.
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/elmira-ashrafi/custom-spa/archive/refs/heads/main.zipReadme
Custom SPA for WordPress
A lightweight WordPress plugin that turns normal front-end navigation into an SPA-style (single-page-application) experience — without a JS framework, a build step, or touching your theme's templates. Regular WordPress page requests still render exactly as they always have; only AJAX/fragment requests get intercepted and converted into structured JSON, so a front-end script can swap in new content without a full page reload.
✨ Key Features
- Transparent fragment interception — detects AJAX requests (
X-Requested-With: XMLHttpRequest) attemplate_redirectand captures the page's rendered HTML output before it's sent to the browser. - Structured JSON responses — instead of returning full HTML on a fragment request, the plugin extracts and returns just what's needed to update the page: the document title, the
#spa-contentregion, and any `