OddOneOut / bwp-minify

A WordPress Minification plugin that relies on Minify PHP library and WordPress's enqueueing system to serve minified CSS and JS to your audience
http://betterwp.net/wordpress-plugins/bwp-minify/
49 stars 23 forks source link

Ignored in header/footer for every file #54

Open sfolador opened 8 years ago

sfolador commented 8 years ago

Hi, in our live environment we are not able to make bwp-minify work, plugin settings are the same on both local and live environment. No errors are shown. If we go to the Manage Enqueued Files we only see "Ignored in header/footer" for each file, whereas in the local environment we can see "minified in header/footer". Also the links shown on the enqueued files table are http://livewebsite.com/wp-content/pathtothefile.js while in the local environment they are: "wp-content/pathtothefile.js" (without http). Are we missing anything?

kminh commented 8 years ago

My guess is that BWP Minify considers those files external and thus not minify them, as it can only minifies files that are on your server.

Do you happen to host your files on a separate subdomain when going live? Does your deployment script involve changing the URLs? Can you post an example of your enqueued file here?

sfolador commented 8 years ago

Hi thanks a lot.

Here's an example of an enqueued file:

wp_register_script('custom-script2', get_bloginfo('template_directory') . "/js/jquery-ui.min.js"); wp_enqueue_script('custom-script2');

Files are on the same domain (as far as I know it).

kminh commented 8 years ago

Are you using HTTPS on the live site?

So when you browse http://livewebsite.com , you see your files served at http://livewebsite.com/wp-content/themes/your-theme/js/jquery-ui.min.js ? Does this happen for every file, meaning no files are minified on live website?

sfolador commented 8 years ago

No HTTPS and no files are minified. If I go to: http://livewebsite.com/wp-content/themes/mytheme/js/jquery-ui.min.js I see the JS script correctly. The only difference between the local infrastructure and the live one is that on the live one there is a Nginx server in front of our WP servers. Nginx acts as a cache. Do you think that could be the issue?

kminh commented 8 years ago

That should not make a difference in this case. Can you contact me via http://betterwp.net/contact/ ? I will need more info to check this issue.

sfolador commented 8 years ago

Done. Thanks again