This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Essential Addons for Elementor (Lite) — a WordPress plugin providing 110+ widgets and extensions for the Elementor page builder. Main plugin file: essential_adons_elementor.php. Current version: 6.x.x. Requires PHP 7.0+, WordPress 5.0+, Elementor.
npm run build # Production (.min.js/.min.css) + dev assets + .pot file
npm run dev # Production + watch modeSources in src/ compile to assets/front-end/. Webpack discovers entries by globbing src/js/view/*, src/js/edit/*, src/css/view/*. Files prefixed _ are partials (skipped as entry points).
- Entry point (
essential_adons_elementor.php): Defines constants, loadsautoload.phpandconfig.php, hooksBootstraponplugins_loaded. - Bootstrap (
includes/Classes/Bootstrap.php): Singleton composed via traits (Core,Helper,Enqueue,Admin,Elements,Controls,Ajax_Handler,Login_Registration,Woo_Hooks, …). - Autoloading (
autoload.php): PSR-4Essential_Addons_Elementor\→includes/.
- Config registry (
config.php): Central map of every element — maps slug → PHP class path, and declares CSS/JS dependencies per widget. This is the single source of truth for what assets each widget needs. - Widget classes (
includes/Elements/): ~65 widgets, each extending Elementor's base widget class. Standard Elementor widget structure: metadata,register_controls(),render(). - Extensions (
includes/Extensions/): Supplementary features (Table of Content, Hover Effect, Post Duplicator, Image Masking, etc.) that augment Elementor rather than adding standalone widgets.
The Bootstrap class uses traits in includes/Traits/ to organize functionality: Admin, Ajax_Handler, Elements, Controls, Helper, Core, Enqueue, Login_Registration, Woo_Hooks, etc. When adding cross-cutting functionality, add or extend a trait rather than bloating Bootstrap directly.
- Source:
src/css/view/*.scss(SCSS),src/js/view/*.jsandsrc/js/edit/*.js(ES6+) - Output:
assets/front-end/css/view/,assets/front-end/js/view/,assets/front-end/js/edit/ - Build: Webpack 4 with Babel (preset-env), Sass, PostCSS (autoprefixer), MiniCssExtractPlugin
- Asset loading:
Asset_Builderclass (includes/Classes/) dynamically enqueues only the CSS/JS needed for widgets present on a page, driven byconfig.php - Third-party libraries live in
assets/front-end/js/lib-view/(not built by webpack)
Elementor registers several libraries as WordPress handles. Always depend on those handles rather than bundling duplicate files.
| Library | Handle | Notes |
|---|---|---|
| Swiper v8 | swiper (CSS), lazy JS via elementorFrontend.utils.swiper |
Container class is .swiper not .swiper-container |
| Font Awesome 5 | font-awesome-5-all |
Already enqueued by Elementor |
Rules:
- CSS: declare the handle in the widget's
get_style_depends(). Do not add a duplicatefileentry inconfig.php. - JS: use
elementorFrontend.utils.swiperasync loader. Do not enqueueswiper.min.jsmanually. - Lite's own
swiper-bundle.min.cssinassets/front-end/css/lib-view/swiper/is a standalone fallback for contexts where Elementor may not load it. Pro widgets should use theswiperhandle instead.
- Create the widget class in
includes/Elements/YourWidget.phpunder namespaceEssential_Addons_Elementor\Elements - Add source SCSS in
src/css/view/and JS insrc/js/view/if needed - Register the widget and its asset dependencies in
config.php - Run
npm run build
| File | Purpose |
|---|---|
config.php |
Element registry — all widgets, their classes, CSS/JS deps |
essential_adons_elementor.php |
Plugin entry point, constants |
includes/Classes/Bootstrap.php |
Main controller (singleton + traits) |
includes/Classes/Asset_Builder.php |
Dynamic per-page asset loading |
autoload.php |
PSR-4 autoloader |
webpack.config.js |
Build configuration |
Deep-dive subsystem documentation lives in docs/architecture/. Read these when tracing bugs that span multiple files, designing cross-cutting features, or understanding hook timing:
docs/architecture/README.md— system map (4 render phases + AJAX flow) and per-doc indexdocs/architecture/asset-loading.md—Asset_Builderlifecycle,config.phpregistry, popup/template/shortcode detection, caching, CSS print modesdocs/architecture/editor-data-flow.md— settings persistence,$settingsshape (Repeater / Group / Responsive),conditionvsconditions, dynamic tags,eael_e_optimized_markup()docs/architecture/admin-notices.md— activebfcm-pointer.phpcampaign and dormantWPDeveloper_Noticeclass infrastructure, dismissal lifecycle, how to add a new campaign noticedocs/architecture/quick-setup.md— React-based onboarding wizard (eael-setup-wizard), Vite build pipeline, three AJAX endpoints, lifecycle option states, how to add a new wizard stepdocs/architecture/extensions.md—includes/Extensions/subsystem (11 plain PHP classes that augment Elementor elements), registration loop,'context' => 'edit'vs'view', the Promotion upsell pattern, how to author a new extension. Per-extension docs live indocs/extensions/(canonical example:docs/extensions/promotion.md)docs/architecture/dynamic-data/— folder of seven docs: AJAX endpoint inventory, WP_Query construction, load-more / pagination, Login & Registration, WooCommerce integration, third-party integrations
For per-widget documentation, see docs/widgets/ (fancy-text.md is the canonical example).
For Claude Code skills, commands, and team usage guidance, see .claude/README.md.
- PHP:
priyomukul/wp-notice(via Composer) - JS:
@wordpress/hooks,axios(via npm)
essential-addons-for-elementor-lite — all user-facing strings must use this domain.
npm run test:setup # First-time setup
npm run test:reset # Clean slate
npm run test:e2e # Run all specsSite: http://localhost:8888 — WP admin: admin / password
Always verify fixes visually on the test site before marking a task done.
@.claude/rules/widget-development.md @.claude/rules/php-standards.md @.claude/rules/asset-pipeline.md @.claude/rules/testing.md