Descripción
The Kouib Blocks for Tutor LMS package turns a static course listing into a fast, interactive experience inside the Gutenberg block editor — no complex setup. Add a block and display it anywhere.
The five blocks:
- Courses Filter — a grid of courses with category buttons, custom ordering by student count, and a cache per settings combination. Works on the frontend and in the editor (ServerSideRender).
- Courses Carousel — a responsive slider with side arrows, columns adjustable from the editor, and ordering by newest, most enrolled, or random.
- Course Category Boxes — a grid of categories with a course counter and a link per category, plus a custom icon (PNG/SVG) per category uploaded straight from the media library.
- Quick Search — an instant (AJAX) search field with live results and no page reload, featuring:
- Full Arabic normalization: (أ/إ/آ/ٱ ا), (ة ه), (ى ي) and diacritics removal, so searching «الحساب» also finds «المحاسبة».
- Smart relevance ranking: title match > starts with the phrase > contains it.
- A «match exact phrase» option and a two-letter minimum for words.
- Form colors, size and shape adjustable from the editor, with results floating over the page when needed.
- Platform Stats — prominent counters (icon + number + label) for students, instructors, courses and lessons, with a responsive grid (3 breakpoints) and a full panel to show/hide each statistic and its style.
Guaranteed performance:
– Transient cache for every piece (ready HTML or stat numbers) with an active-keys registry.
– Automatic invalidation on saving/deleting a course, on new student enrollments, or on rating updates.
– Light queries: no row-by-row enrollment counting; instructor stats via a single query.
– Each block’s assets load only when the block is present — no extra CSS/JS on pages that don’t need it.
Translation & Arabic:
– All strings use __() with the kouib-blocks-for-tutor-lms text domain and are ready for .po/.mo.
– Full RTL support and numbers formatted with number_format_i18n.
– Compatible with Kadence and other themes that respect theme.json.
Source Code
The source code for this plugin is publicly available at:
https://github.com/kouiderbounama/kouib-blocks-for-tutor-lms
The source code for the compiled block editor scripts is also included in the src/ directory of this plugin. Each block’s edit.jsx file is the human-readable source that generates the corresponding build/*/index.js file.
To regenerate the compiled files:
- Install Node.js 18+ and run
npm installin the plugin root. - Run
npx wp-scripts buildto compile thesrc/directory intobuild/. - Run
node build-i18n.jsto regenerate translation files.
The vanilla JavaScript files in assets/js/ (carousel.js, search.js, view.js) are hand-written source files and are not generated by build tools.
Capturas





Bloques
Este plugin proporciona 5 bloques.
- Tutor Courses Categories Course category boxes for Tutor LMS with a custom icon per category (upload PNG images and replace or remove them)
- Tutor Courses Filter Filter Tutor LMS courses by category with ordering by student count
- Platform Stats Quick platform stats: student, instructor, course and lesson counts with lightweight caching
- Tutor Courses Search Instant search across Tutor LMS courses with live AJAX results — no page reload
- Tutor Courses Carousel Interactive carousel for displaying Tutor LMS courses with full motion and navigation control
Instalación
- Upload the plugin folder to
/wp-content/plugins/or install it from «Plugins Add New Upload Plugin» (zip file). - Activate the plugin from the «Plugins» screen.
- Activate Tutor LMS (the plugin works without it, but shows zero courses).
- Open the editor and add any block from the Kouib Blocks category at the top of the block inserter.
- Configure each block from the sidebar settings panel, then publish the page.
Optional tuning: the HTML cache duration, via the filter:
add_filter( 'kouib_cache_ttl', fn() => 2 * HOUR_IN_SECONDS );
Preguntas frecuentes
-
Does the plugin work without Tutor LMS?
-
Yes, it activates and registers the blocks; but zero courses/lessons appear because the content types belong to Tutor. The students statistic relies on the total WordPress user count.
-
Does it affect site speed?
-
No; each block gets its own cache, data is computed with light SQL statements and stored in a Transient (30 minutes, adjustable via the filter above), and each block’s assets load only when the block is used.
-
How do I recompute student counts after changes?
-
They are refreshed automatically on: saving/deleting a course, a new enrollment, or any
tutor_after_*event — and the whole cache is flushed when the plugin is updated. -
Is there an API for programmatic customization?
-
Yes:
kouib_cache_ttl(duration), the shared render keykouib_render_course_card, and the reusable cache layerkouib_register_active_key/kouib_flush_courses_cache. -
Do I need coding skills to use it?
-
No; everything happens in the editor: live preview, colors, columns, icons, show/hide elements.
Reseñas
No hay reseñas para este plugin.
Colaboradores y desarrolladores
«Kouib Blocks for Tutor LMS» es un software de código abierto. Las siguientes personas han colaborado con este plugin.
Colaboradores«Kouib Blocks for Tutor LMS» ha sido traducido a 1 idioma local. Gracias a los traductores por sus contribuciones.
Traduce «Kouib Blocks for Tutor LMS» a tu idioma.
¿Interesado en el desarrollo?
Revisa el código , echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.
Registro de cambios
1.0.1
- Carousel: fixed flipped navigation arrows in RTL — arrow positions now use logical properties (inset-inline), matching the direction of the page.
- Carousel: frontend assets now load before the cache lookup, so the block keeps its full styling on cached page loads (no more need to clear the cache).
- Cache keys unified under the kouib_ prefix (kouib_carousel_, kouib_categories_); legacy keys cleaned up on uninstall.
- Package ZIP rebuilt with forward-slash paths.
Initial release
- Five blocks for Tutor LMS: Courses Filter, Courses Carousel, Course Category Boxes, Quick Search and Platform Stats.
- Transient cache per piece with automatic invalidation and selective asset loading.
- Central settings panel, full RTL support, Arabic-tolerant search and a bundled Arabic translation.
- Clean uninstall (settings and cache removed on deletion).
