Directory Structure
Below is the top-level layout of the plugin directory. This is a concise map of where major systems live.
sanil-website-builder/
├── sanil-website-builder.php Plugin entry point
├── CONSTANTS.php Plugin-wide constants (SANILWB_PATH, SANILWB_URL, etc.)
│
├── admin/
│ ├── class-sanil-website-builder-admin.php Main admin orchestrator
│ ├── class-sanilwb-admin-page-builder.php
│ ├── class-sanilwb-admin-template-builder.php
│ ├── class-sanilwb-admin-theme-options.php
│ ├── helpers.php
│ ├── assets/
│ │ ├── css/ SCSS source + compiled CSS for all admin pages
│ │ └── js/
│ │ └── src/
│ │ ├── page-builder/ React app (also runs templates and Site Layout, via context)
│ │ ├── theme-options/ React app
│ │ └── shared/ Shared components, hooks, field types
│ └── templates/
│ ├── meta-box-contents.php
│ ├── page-builder/
│ ├── template-builder/ list-page.php only — CRUD table, editing is Page Builder
│ ├── site-layout-builder/ list-page.php — CRUD table, editing is Page Builder
│ ├── theme-options/
│ ├── partials/
│ └── sidebar-widgets/
│
├── includes/
│ ├── class-sanil-website-builder.php Main plugin orchestrator
│ ├── class-sanilwb-ajax.php AJAX handlers (template CRUD, Site Layout save, etc.)
│ ├── class-sanilwb-db.php DB model (wp_sanilwb_templates)
│ ├── class-sanilwb-site-layout-db.php Site Layout DB model (wp_sanilwb_site_layouts) — includes header/footer as layout_type values
│ ├── class-sanilwb-site-layout-renderer.php Site Layout rendering bridge (single/page/archive/404/search/header/footer)
│ ├── class-sanilwb-site-layouts-list-table.php Site Layout admin list table
│ ├── class-sanilwb-css-compiler.php Stateless CSS declaration builders (typography, spacing, borders, layout)
│ ├── class-sanilwb-frontend-renderer.php Page Builder recursive div/widget render loop (Blueprint-protected)
│ ├── class-sanilwb-shortcode-handler.php [sanilwb] shortcode dispatcher — routes to shortcodes/ by widget type
│ ├── class-sanilwb-style-field-targets.php Config-declared style target class definitions
│ ├── class-sanilwb-templates-list-table.php WP_List_Table for the Template Builder list screen
│ ├── class-sanilwb-cli.php Registers the `wp sanilwb` WP-CLI command
│ ├── class-sanilwb-font-downloader.php
│ ├── class-sanilwb-font-sync.php
│ ├── shortcodes/ One render() class per widget type + shared helpers, loaded via glob()
│ └── helpers/
│ └── class-sanilwb-title-style-registry.php
│
├── public/
│ ├── class-sanil-website-builder-public.php Thin facade — bootstraps hooks, delegates rendering to includes/class-sanilwb-frontend-renderer.php and includes/class-sanilwb-shortcode-handler.php
│ ├── hooks.php Lazy-load, author filter, preview iframe styles
│ ├── helpers.php Frontend helper functions (dates, images, authors)
│ ├── imagesize.php Custom image sizes
│ ├── css/ Frontend CSS (sanilwb-styles.scss → .css)
│ └── js/ Frontend JS
│
├── bin/ Standalone WP-CLI-adjacent scripts (create-template.php, reset-plugin-data.php)
├── tests/ JS (Vitest) and PHP (PHPUnit) test suites — see Tests section
├── calendar/ Nepali calendar utility
├── mkdocs/ This documentation
├── vendor/ Composer dependencies (PHPUnit, etc.)
├── languages/ Translation files
└── graphify-out/ Knowledge graph analysis artifacts
The old public/presets/{type}/{slug}/ folder-preset system (manifest.json + index.php + style.scss per preset) is gone entirely — public/presets/ no longer exists. Every content type it used to cover, including header and footer, is now a layout_type on Site Layout, a visual Page-Builder-authored alternative stored in its own database table. Rendering is theme-agnostic (see Site Layout → Rendering Bridge): single/page/archive/404/search fall back to whichever theme is currently active rendering its own normal template when nothing matches — there is no plugin-specific fallback file anymore, and no requirement that template-for-page-builder be the active theme; header/footer have no fallback at all.