Kntnt Instant Pages
WordPress plugin that preloads pages on hover and click for faster page navigation.
by Thomas Barregren · github.com/kntnt/kntnt-instant-pages · website
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/kntnt/kntnt-instant-pages/releases/download/1.0.5/kntnt-instant-pages.zipReadme
Kntnt Instant Pages
WordPress plugin that preloads pages on hover and click for faster page navigation.
Description
This plugin uses the lightweight (1 kB) instant.page script for just-in-time preloading for faster user navigation – it preloads a page right before a user clicks on it.
The plugin is designed to work alongside the Speculative Loading plugin. If the Speculative Loading plugin is activated and and the browser supports the Speculation Rules API, instant.page will not be loaded, deferring to the native browser implementation instead.
Requirements
- WordPress 5.0 or higher
- PHP 8.0 or higher
- Modern browsers that support JavaScript modules
Installation
For Users
- Download the plugin zip file.
- Go to WordPress admin panel → Plugins → Add New.
- Click "Upload Plugin" and select the downloaded zip file.
- Activate the plugin.
For Developers
-
Clone this repository:
git clone https://github.com/Kntnt/kntnt-instant-pages.git cd kntnt-instant-pages -
Install dependencies:
npm install composer install
The npm install command will automatically copy the instant.page script to the correct location.
Development
Directory Structure
.
├── .gitattributes
├── .gitignore
├── composer.json
├── includes/
│ └── class-plugin.php
├── js/
│ ├── instant.page.js
│ └── kntnt-instant-pages.js
├── kntnt-instant-pages.php
├── LICENSE
├── package.json
└── README.md
Key Features
- Automatic integration with instant.page script
- Graceful fallback to native browser features when available
- Support for the Speculation Rules API
- No configuration needed - works out of the box
- Loads scripts in footer for optimal performance
- Skips loading in admin area and customizer
Filters
kntnt-instant-pages-skip
Controls whether the instant pages functionality should be skipped for the current request.
Parameters:
$is_skipping(bool) Whether to skip loading instant pages. Default:false
Example:
// Disable instant pages on specific post types
add_filter( 'kntnt-instant-pages-skip', function( $is_skipping ) {
if ( is_singular( 'product' ) ) {
return true;
}
return $is_skipping;
});
Building and Testing
-
Build zip file that can be uploaded to WordPress:
composer run-script build -
Run PHP CodeSniffer:
composer run phpcs -
Check for script updates:
npm run check-updates -
Update instant.page script:
npm run update-script
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
GPL v3 or later. See LICENSE for details.
Credits
- instant.page by Alexandre Dieulot
- Developed by Kntnt
Read the full README on GitHub →
Releases
| Tag | Published | Asset | Downloads |
|---|---|---|---|
| 1.0.5 | Nov 7, 2024 | kntnt-instant-pages.zip | 12 |