-
Task
-
Resolution: Unresolved
-
Should have
-
None
-
3
-
Technical Debt
Summary
Considering code separation and maintainability, JS logic should not be part of Twig templates.
It should exist in separate files and be included using the wp_enqueue_script function or similar, which also has benefits in terms of security, caching, minification, etc...
Requirements
- Remove JS scripts from Twig templates.
- Move the scripts to JS files.
- Include the scripts only to the corresponding pages using the wp_enqueue_script function or similar.