This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
eXeLearning is a WordPress plugin for managing eXeLearning .elp files. It allows uploading, extracting, and embedding eXeLearning content in WordPress pages and posts.
Key principle: The plugin works directly with WordPress attachments (Media Library). No custom post type is needed - ELP files are uploaded as attachments and their metadata is stored in attachment post meta.
make build-editor # Build static eXeLearning editor from submodule (requires Bun)
make build-editor-no-update # Build without updating submodule (for CI/CD)
make update-submodule # Update eXeLearning submodule to correct branch
make clean-editor # Remove static editor build and node_modulesNote: The static editor is built from the exelearning/ submodule (branch release/3.1-embedable-version-refactor). Output is placed in dist/static/.
make up # Start wp-env Docker containers (http://localhost:8888, admin/password)
make down # Stop containers
make clean # Reset WordPress environment
make destroy # Completely remove wp-envmake test # Run all PHPUnit tests
make test FILTER=MyTest # Run tests matching patternmake fix # Auto-fix code style with PHPCBF
make lint # Check code style with PHPCSmake pot # Generate .pot file
make po # Update .po files
make mo # Generate .mo files- User uploads
.elpfile to Media Library - Plugin validates the file using ElpParser
- File is extracted to
wp-content/uploads/exelearning/{sha1_hash}/ - Metadata from ELP is stored in attachment post meta
- Content is embedded via shortcode or Gutenberg block
- exelearning.php: Main plugin file
- includes/class-exelearning.php: Core class that initializes all components
- includes/class-hooks.php: WordPress action registration
- includes/class-filters.php: WordPress filter registration
- includes/class-elp-upload-handler.php: Handles ELP file upload and extraction
- includes/class-elp-file-service.php: Validates, parses, and extracts ELP files (inline ZipArchive + SimpleXML)
- includes/class-elp-upload-block.php: Gutenberg block for embedding ELP content
- includes/class-mime-types.php: Registers
.elpMIME type for WordPress uploads
- admin/class-admin-settings.php: Settings page
- admin/class-admin-upload.php: Admin upload handler
- public/class-shortcodes.php:
[exelearning]shortcode handler - includes/integrations/class-media-library.php: Media library integration (columns, meta boxes)
ELP files use WordPress attachments. Metadata is stored in post meta:
| Meta Key | Description |
|---|---|
_exelearning_title |
Title from ELP file |
_exelearning_description |
Description from ELP file |
_exelearning_license |
License information |
_exelearning_language |
Content language |
_exelearning_resource_type |
Learning resource type |
_exelearning_extracted |
SHA1 hash pointing to extraction folder |
When an ELP file is uploaded:
- Original
.elpfile stored in Media Library - Extracted to
wp-content/uploads/exelearning/{sha1_hash}/ - Content accessible via
index.htmlin extraction folder
The plugin includes a fully embedded eXeLearning editor built from the static PWA version.
- dist/static/: Static build of eXeLearning editor (generated by
make build-editor) - admin/views/editor-bootstrap.php: Loads static editor with WordPress configuration
- assets/js/wp-exe-bridge.js: Bridge JavaScript connecting editor with WordPress
- includes/class-exelearning-rest-api.php: REST endpoints for saving/creating ELP files
- User clicks "Edit in eXeLearning" on an attachment
- Plugin loads
dist/static/index.htmland injects WordPress config - Bridge JS (
wp-exe-bridge.js) handles:- Loading ELP file from WordPress into editor
- Saving edited content back to WordPress via REST API
- Keyboard shortcuts (Ctrl+S to save)
- Editor runs 100% client-side (static PWA)
| Endpoint | Method | Description |
|---|---|---|
/exelearning/v1/save/{id} |
POST | Update existing ELP file |
/exelearning/v1/create |
POST | Create new ELP file |
/exelearning/v1/elp-data/{id} |
GET | Get ELP file metadata |
- WordPress Coding Standards enforced via PHPCS
- Tests run inside wp-env container
- ELP files are ZIP archives with XML metadata
- No custom post type - uses WordPress attachments
- Static editor (PWA) runs client-side, no backend required