Conversation
Plugin Directory guideline 13 asks plugins to use the libraries WordPress already ships. The editor bundle loads its own jQuery 3.7.1 and jQuery UI 1.14.1; the editor page now replaces those two tags with core's copies: jQuery (without Migrate, which the editor never ran with) and every jQuery UI and effects handle core registers, in dependency order, resolved from a private WP_Scripts so the page queue is untouched. Core's jQuery calls noConflict(), so a one-line shim restores the global $ the editor expects. The bundled copies stay in dist/static/libs/: the editor embeds them in the SCORM, IMS, EPUB and web packages it exports, which must run without WordPress.
Test in WordPress PlaygroundTest the plugin with the code from this branch:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/enqueue-embed-behavior #150 +/- ##
====================================================================
+ Coverage 96.36% 96.38% +0.02%
- Complexity 813 823 +10
====================================================================
Files 36 36
Lines 4240 4264 +24
====================================================================
+ Hits 4086 4110 +24
Misses 154 154
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Closing: the embedded eXeLearning editor is a self-contained application that is built and tested against its own jQuery/jQuery UI versions, and it also embeds those same files in every package it exports (which must run without WordPress). Swapping in core's copies would tie the editor to whatever version each site runs (WordPress 6.1 ships jQuery 3.6 / jQuery UI 1.13), for no reduction in package contents. This will be explained to the plugin reviewers instead. |
Stacked on #125 (both touch
admin/views/editor-bootstrap.php).Why
Plugin Directory guideline 13: plugins must use the libraries WordPress already ships. The embedded editor loads its own jQuery 3.7.1 and jQuery UI 1.14.1 from
dist/static/libs/.Change
The editor page swaps the bundle's two tags for WordPress' own copies:
jquery-core, withoutjquery-migrate, which the editor never ran with.jquery-ui-*andjquery-effects-*handle core registers. Their dependency order is resolved by a privateWP_Scriptsinstance, so the page queue is untouched, and core'swp-a11y/i18ndependencies are skipped because no jQuery UI file uses them.noConflict(), so a one-line inline shim (window.$ = window.jQuery;) restores the global$the editor and iDevices use.The logic lives in
ExeLearning_Editor::core_jquery_tags().AGENTS.mddocuments it.What stays bundled, and why
dist/static/libs/jqueryandlibs/jquery-uiremain in the package. The editor is also an exporter: it embeds those files in every SCORM, IMS, EPUB and web package it generates, and those packages run offline and without WordPress, so they cannot usewp-includes. Inside WordPress the editor no longer loads them. CodeMirror (TinyMCEcodemagic) and the old jQuery copy inexemindmapare being removed in the editor itself (exelearning/exelearning).Verification
$ === jQuery, and sortable, draggable, droppable, tooltip, dialog, resizable and slider are all available. No bundled jQuery is requested.dragdropiDevice. There are no console errors beyond thosemainalready shows: 403/404 on TinyMCEcontent_csspaths and duplicated tabs in that iDevice's form. Both are identical with the bundled jQuery, so they are pre-existing and out of scope here.EditorBootstrapPageTestcase. PHPUnit:OK (900 tests).