Script Compressor
4月 30th, 2008
WordPress プラグインの、Script Compressor を公開しました。
テーマや他のプラグインによって読み込まれるJavaScriptとCSSの圧縮を自動的に行うプラグインです。
ダウンロードはScript Compressor « WordPress Pluginsへ
変更履歴はダウンロードページで見ることができます。
Script Compressor is a WordPress plugin which compresses javascript files and CSS files loaded by the theme or other plugins automatically.
Download it in Script Compressor « WordPress Plugins.
The changelog is available in the download page.
Did you find this information helpful? If you did, consider donating.


Thank you for the consideration!
Cheers,
G.
I released the version 1.6. Please check it.
Great plugin! I just can’t seem to figure out how to use the exclude feature, and this plugin seems to interfere with the comment validation plugin. I’ve tried putting in the absolute urls, each on separate lines, in the exclude field, but it doesn’t seem to be working?
I checked that it works properly.
The feature does the following to each script tag:
1. Getting script URL of the script tag which is outputted by other plugins.
2. Excluding the script file from the compression if URL contains the characters you inputted to the option.
Hey,
Thank for this great plugin. I tried phpspeedy but it was breaking my website.
Yours works perfectly improved my Yslow from F to A
@Chisa, if you want to exclude lets says Jquery form the compression, just put “jquery” without the quote in the field, not the full URL.
Hi, thanks for this plugin, it’s great. However I have the same problem with this plugin that I do with every plugin which compresses CSS e.g. php_speedy: it always breaks my CSS. I thought it was my Dreamhost server which didn’t allow it to work but now I have another server and it is the same- it just loads without the CSS.
Also looking at the components with YSlow, it shows that the CSS is not being compressed, while the javascript is. I have done CTRL+F5 many times, emptied the browser cache and nothing works. I have made the cache folder within the plugin writeable, disabled all other plugins but it still does not work. Can you give me any clue as to why it is not working? thanks
@Olivier
I’m sorry for being late for reply. I’m glad to see your report.
@Guy
Please tell me how your CSS is. Is it empty? Does it have 404 error?
@Regen
Hi, thanks for the reply- I changed a setting on my server (turned on xcaching) and turned off WP-Supercache and now your plugin is working. Well, it is definitely compressing the javascript but doesn’t seem to be compressing the CSS- this may be due to it not finding the CSS though. Do most themes load the CSS into wp_head?
I will do some more research into it.
@Guy
Which CSS compression method are you using? If you are using “Composed” method, this plugin changes the codes which are output by wp_head. But theme CSS is not in wp_head. So this plugin provide template tags. Please check them or try “Respective” method.
I am using ‘Respective’ mode- I have tried to add the template tags but I don’t know much about PHP so it ends up breaking the theme. For now I’ll just leave that uncompressed I think.
I have also noticed an error in my server logs:
PHP Warning: preg_match() [function.preg-match]: No ending delimiter ‘/’ found in [server_address]/wp-content/plugins/script-compressor/script-compressor.php on line 218, referer: http://www.mysite.com -is this likely to be a genuine bug or a conflict with something else?
The PHP warning was was my mistake. I released the new version in which this plugin compresses the scripts including theme scripts in the header. So you don’t have to use the template tags in the header. Please check.
VERY BAD BUG FOUND!
When the plug in is deactivated in WP 2.8, it causes all CSS to fail across the entire site. This needs to be fixed! My site is all screwed up now
–So basically, my website is down. I was disabling Script Compressor to troubleshoot my CSS so that it works when enabled. Currently, there seems to be PHP code left behind after the plug in was deactivated.
–After deleting the plugin completely, both Admin and my Blog remained with no style. Here’s the screen shots:
http://bettafootwear.com/tempDELETE/No-style-admin.JPG
http://bettafootwear.com/tempDELETE/No-style-blog.JPG
–EVEN AFTER RE-INSTALL of wordpress, the bug persists. What should I do!? This is NOT good!
Please notify me by email if you read my previous comments
trusktr[at]gmail[dot]com
Oh, and one more thing. When the plugin is re-activated, the CSS for admin control panel and blog works again (except with errors from the compression which is what i wanted to fix originally).
Wait, Nevermind! I fixed it! I had to delete the line of code that was added to .htaccess for css compression and then everything returned to normal. Hehe, newbs out there will have some problems
I’m sorry. I noticed that the mod_rewrite codes remain and cause problems when .htaccess is not writable or the plugin is deactivated by removing the directory.
I’m going to add some explanation to the document.
Script don’t compress JS and CSS like
and
@import url( ‘http:// blablabla /wp-content/plugins/devformatter/devfmt_reset.css?ver=2009.0.1.20′ );
OK. In the next version, @import css will be compressed.
Hi
nice idea and working fine! thank you very much
is there a way to compress dashboard scripts, too (?)
@Sarsura
There is no way to do so now. Do you want to compress them?
Thanks Dude,
Your plugin vastly improved loading time of my site and got me from grade c 77 to grade B 86 points on Yslow (small site/blog) I am grateful!Thanks!
I use jQuery from google CDN and facebook loader js, but script compressor strip them.
How to exclude javascript from external ?
@Ibad
I’m sorry, that is a bug.
I am planning to rewrite the plug-in but I am so busy that I cannot do to until April.
Hey Regen, after trying a lot of wordpress plug ins for compressing scripts i stil haven’t found one that does the job better than yours. Hope that you will find the time to make this one make my site even faster (and no, no idea how you would have to do that
, but you said many months ago that you would work on improving the plug inn…
one bug (if i may call it that, i dunno) is that when working with wp-supercache when using Super Cache Compression the feed gets f*cked up, becomes unreadable. Any ideas? kind regards, Gordon
Everyone, I’m sorry for no reply.
I moved in around April. So I cannot use the Internet now and I’m waiting for the installation. I’ll start developing the plugin when I became able to use the Internet.
Well,good luck with that!
The plugin has good features. I will wait for new release and update from you. Thanks for the effort.