Repository navigation
Performance
This plugin is built with loading speed as a top priority.
The carousel JavaScript is written in pure vanilla JS. It does not require jQuery, reducing load overhead for sites that don't already load jQuery.
Scripts and styles are registered on page load but only enqueued when a carousel widget is actually rendered on the page. Pages without the widget load zero carousel assets.
Page with widget: Swiper CSS (~7KB) + Carousel CSS (~1.5KB) + Swiper JS (~40KB) + Carousel JS (~1KB)
Page without widget: 0 bytes loaded
All JavaScript loads in the footer (wp_register_script with $in_footer = true), ensuring HTML rendering is not blocked.
- All slide images include the native
loading="lazy"attribute - Swiper's built-in lazy loading is enabled by default
-
loadPrevNext: truepreloads adjacent slides for smooth navigation -
loadOnTransitionStart: truebegins loading during slide transitions
The carousel initializes on DOMContentLoaded. For Elementor AJAX-loaded content, the Elementor frontend hooks ensure proper initialization.
Optional MutationObserver can be enabled to detect dynamic DOM changes and reinitialize the carousel automatically. Useful for pages with dynamic content.
- CSS
will-change: transformon the swiper wrapper -
transform: translateZ(0)for GPU compositing - CSS
contain: layout styleon the container for rendering isolation - Swiper uses CSS transforms exclusively (no
left/topanimations)
| File | Raw | Gzipped |
|---|---|---|
| swiper-bundle.min.js | 154 KB | ~40 KB |
| swiper-bundle.min.css | 18 KB | ~5 KB |
| carousel.min.js | 1 KB | ~0.5 KB |
| carousel.min.css | 1.5 KB | ~0.5 KB |
| Total | 174.5 KB | ~46 KB |
- Disable effects you don't use — Slide is fastest
- Keep slides per view reasonable — avoid high counts
- Optimize images — use WebP and proper sizing
- Disable Observer Mode unless you need it
- Use conditional autoplay — pause on hover saves resources
- Avoid excessive slide content — heavy slides slow rendering