WordPress plugin that preloads pages on hover and click for faster page navigation.
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.
- WordPress 5.0 or higher
- PHP 8.0 or higher
- Modern browsers that support JavaScript modules
- 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.
-
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.
.
├── .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
- 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
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;
});
-
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
- 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
GPL v3 or later. See LICENSE for details.
- instant.page by Alexandre Dieulot
- Developed by Kntnt