Repository navigation
Bundle the embedded editor exclusively in release packages (ADR-0002) - #72
Merged
Merged
Conversation
Remove the runtime editor installer/updater: the embedded editor is a release artifact shipped pre-built under dist/static/ in every official release ZIP, and that bundle is the only editor source the plugin uses. - Remove ExeLearning_Static_Editor_Installer (GitHub release discovery, download, SHA-256 verification, ZIP extraction, install/rollback, the admin-post action) and its settings-page install/update button. - Add ExeLearning_Editor_Bundle, a read-only helper that validates the bundled editor and reads the .editor-version marker. - Degrade cleanly without a bundle: the editor screen redirects to the settings page with an explanatory notice and client-side export formats stay disabled. - Guard 'make package' so it fails (stderr, non-zero, no partial ZIP) when dist/static/ or a non-empty .editor-version is missing. - DB migration v2 drops the exelearning_static_editor option and the exelearning_installing_editor transient. - Remove the exelearning_*_editor_install* hooks and their docs; update README, readme.txt, HOOKS.md, AGENTS.md and architecture docs. - Regenerate translations for all locales; translate the new strings. - Replace installer lifecycle tests with bundle detection/validation and upgrade-cleanup tests.
Contributor
Test in WordPress PlaygroundTest the plugin with the code from this branch:
|
In a normal installation the embedded editor is always bundled (ADR-0002), so a status card stating that adds nothing. Render the card only as a warning when dist/static/ is absent or invalid, and drop the now-unused version display, ExeLearning_Editor_Bundle::get_version() and the happy-path strings/styles.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The embedded editor becomes a release artifact. Every official release ZIP ships the pre-built editor under
dist/static/, that bundle is the only editor the plugin ever uses, and the plugin no longer downloads executable editor code at runtime. The install/update machinery is removed. Mirrors exelearning/moodle-mod_exelearning#106.Why
Recorded in ADR-0002. Release ZIPs already bundle the editor built from the matching tag, and
check-editor-releases.ymlpublishes a new plugin release for every editor release — so the runtime downloader only added: a remotely sourced executable code surface plugin reviewers object to, the possibility of two sites on the same plugin version serving different editor builds, and a permanent network/TLS/ZIP-extraction/rollback attack surface. It also required a PHP-writable plugin directory.Changes
ExeLearning_Static_Editor_Installer(GitHub release discovery, download, SHA-256 verification, extraction, atomic install with backup/rollback, admin-post action), the settings-page Download & Install / Update button, theexelearning_*_editor_install*hooks and their docs, and the installer lifecycle tests.ExeLearning_Editor_Bundle, a read-only helper that checks onlydist/static/(index.html + expected asset dirs). The settings screen shows nothing in a normal installation; a warning card appears only when the bundle is missing (e.g. a development checkout withoutmake build-editor).make packagefails (stderr, non-zero exit, no partial ZIP) whendist/static/index.html, the editor asset directories, or a non-empty.editor-versionare missing.exelearning_static_editoroption and theexelearning_installing_editortransient.blueprint.jsonalready provisions the editor at blueprint level from a pinned release asset, outside the plugin runtime.Tests
.phpcs.xml.dist,--no-cache): clean.make package: verified to fail withoutdist/static/and without.editor-version, and to produce a ZIP containingdist/static/(3824 files) and.editor-versionon the success path, restoring version placeholders afterwards.make check-translations: up to date and deterministic.Migration implications
Sites keep working with the editor bundled in their release ZIP. A previously self-installed
dist/static/copy is simply replaced on the next plugin update — the served editor version becomes the one matching the plugin release, which is the point of the change. No data is deleted beyond the two installer bookkeeping entries.