Elementor Pro loads its v3 frontend JS bundle and jQuery on every page, including pages that contain only V4 atomic elements

Aperta
#38,245 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, jquery, php, wordpress

Direzione di ricerca

Start by reading Plugin::enqueue_frontend_scripts() in elementor-pro/plugin.php, then trace the script registrations and dependencies in plugin.php and elementor/includes/frontend.php. Check how Pro’s V3 handlers and V4 form scripts are registered and whether the form needs jQuery. Done means a page containing only V4 elements avoids jQuery and the V3 handler bundle, while pages with relevant V3 widgets still load their required scripts.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

With Elementor Pro 4.4.1 active, a page built only from V4 elements (e-flexbox, atomic form) loads elementor-pro/assets/js/elements-handlers.min.js and jQuery. The page has no classic (V3) widgets.

Elementor core loads nothing for this page on its own: no handler script and no jQuery registers for it. Pro adds the chain below.

  • Plugin::enqueue_frontend_scripts() in elementor-pro/plugin.php runs on elementor/frontend/before_enqueue_scripts, which fires on every Elementor frontend page.
  • It enqueues elementor-pro-frontend (frontend.min.js) and pro-elements-handlers (elements-handlers.min.js) unconditionally.
  • pro-elements-handlers depends on elementor-frontend (plugin.php, register_frontend_scripts()).
  • elementor-frontend depends on jquery-ui-position (elementor/includes/frontend.php, register_scripts()). That pulls in jquery-ui-core, jquery and jquery-migrate.
  • elements-handlers.min.js is one 292 KB file (74 KB transferred) holding every Pro V3 handler. It contains 87 jQuery references.

Result: the atomic promise (CSS and JS loaded per element, only when used) does not hold once Pro is active.

Page measured on 17 Nov 2026 (request by curl, script tags read from the HTML):

  • Elements on the page: e-flexbox, e-form, e-form-error-message, e-form-success-message. Zero data-widget_type attributes.
  • Scripts loaded on the page, in order: webpack.runtime, jquery-core, jquery-migrate, frontend-modules, wp-hooks, wp-i18n, elementor-pro-frontend, jquery-ui-core, elementor-frontend, pro-elements-handlers.
  • Transferred sizes, from the browser's Network panel: elements-handlers.min.js 74.1 kB, jquery.min.js 30.7 kB, Pro frontend.min.js 25.0 kB, core frontend.min.js 19.1 kB, frontend-modules.min.js 16.7 kB, jquery-migrate.min.js 5.2 kB.
Steps to reproduce
  1. Activate Elementor, Elementor Pro 4.4.1, and Hello Elementor. Turn Editor V4 on.
  2. Create a page with one Flexbox (V4) and one atomic Form. Add no classic widget.
  3. Publish and open the page.
  4. Open the browser's Network panel, filter by JS.
  5. See jquery.min.js, jquery-migrate.min.js, elementor-pro/.../frontend.min.js and elementor-pro/.../elements-handlers.min.js load.
  6. Deactivate Elementor Pro and reload. Compare the script list.
Expected behavior
  • A page with only V4 elements loads no jQuery and no V3 handler bundle.
  • Pro registers the V3 handlers as conditional assets, loaded only when a V3 widget that needs them is on the page. Pro's V4 form script is loaded only when the form is present.
Verified and not verified
  • Verified: the script list and the element types on the page, read from the page's HTML.
  • Verified: the dependency chain, read in the source of Pro 4.4.1 and core 4.3.0-latest.
  • Not verified: the script list with Pro deactivated. That site is in use, so I did not deactivate Pro there. The statement that core loads no jQuery on its own comes from the source: nothing in core enqueues elementor-frontend directly.
  • Not verified: whether the V4 form's own JS needs jQuery. elements-handlers.min.js is minified, so this needs a check in the source repository.
Elementor System Info
Elementor 4.3.0-latest-1789042183
Elementor Pro 4.4.1
Hello Elementor 3.5.2
WordPress 7.1.4
Features: e_atomic_elements: active, e_opt_in_v4: active, e_pro_atomic_form: active
Lingua principale
PHP
Stelle
7.1k
Fork
1.6k
Merge medio
20h 20m
PR unite (30g)
329

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di elementor/elementor

Tutte le issue di elementor/elementor

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.