Thanks for your feedback.
jquery migrate isn’t in the list, because i have grouped the jquery-core and jquery-migrate handles into one jquery handle, like wordpress did it itself internally.
They always have to moved together, otherwise it leads to trouble^^ Maybe i should make it clearer in the list.
Also i have take a look into the woocommerce repo. They enqueue their scripts mostly only on pages where they were needed. But WP Script Optimizer can actually only handle globally included scripts. That is in the nature of wordpress, because all scripts are registered, enqueued and printed on the fly with each page load. Unfortunately there is no persistent central database table, that includes all scripts of all pages.
So i currently can only check the scripts on the frontpage of a site. The only other way is a per page selection of scripts. I have considered that as an additional feature for scripts or styles that are not globally enqueued, e.g. via the admin bar or backend page edit window. But i wasn’t sure, if this is a much needed feature, because the main purpose of this plugin should be in fact, to configure global scripts, that are not needed on every page.
When it comes to minify/encrypt/concatenate, that will be of course selectable for each file or group of files.
Thread Starter
John
(@dpinc)
Good
Anything that have been group just listed in description will do
Yes Global is a must – Agree
Per Page/Post additional js, css can consider
Overall what you have planned is very good and waiting for the release to test soon.
Sometimes when save the conditional define doesn’t show instantly and you need to click the menu to see it again perhaps you might have a looks
Yours code is much better and solid vs others for now
Thread Starter
John
(@dpinc)
Keep up a good work and take a look when save it doesn’t see changes when you edit in the conditions to see it again sometimes u need to click on the left menu to see changes. Sometimes work and sometimes not
Thread Starter
John
(@dpinc)
wp-embed.min.js not shown this script is globally right?
wp-embed is a special case. I know about it.
The problem here is, that wordpress enqueues this file not like their other default files, namely directly through “wp_head” hook as far as i see.
I will try to find a solution..
Thread Starter
John
(@dpinc)
No worry this is small matters
Most other script when they make changes to theme, etc via customizer and save those dequeue, enqueue script that using templates of pages will be cleared/reset but yours remain saved because follow the conditional
https://wordpress.org/plugins/wp-asset-clean-up/ – currently available but not good coding that force to dequeue so this is not good and will be clear whenever you make changes
Your conditional (and) is both must match to execute it – (or) is match the per rules basis to execute it
Thread Starter
John
(@dpinc)
Move style/css into body/footer options
Sry, but moving stylesheets to the bottom of a site is not possible, because wordpress doesn’t allow this at the moment (no group parameter in wp_enqueue_styles). I can only test if i can set the group parameter manually..
But it’s a lot harder to improve CSS in the way like improving JS, with all the “above the fold” and “critical or uncritical css” stuff. If you only move all CSS to the bottom, you have an unstyled site while rendering. That’s not very pretty π
You have to separate the critical CSS and include it in the header (as file or inline). That can be tricky.
It’s even possible to load CSS async, but thats an other story..^^
Thread Starter
John
(@dpinc)
Yup some css like font awesome would be blocking rendering pages so into body would be better π
About merging and minify try to make it flexible with option to select because most js file having problem with merge/minify
Async/Defer if you can add as option later on π