• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

XF Optimise

Status
Not open for further replies.

Luke F

Well-known member
#1
This addon is of arguably little use since XenForo 1.1


Based on the now defunct vB4 SuperCharged, this addon does a few things to improve your Page Speed score as well as overall responsiveness.

Features:

  • Minify all Javascript with UglifyJS (beats even Closure Compiler)
  • Defer Javascript loading (moves script tags to before </body>)
  • Minify HTML (not really recommended, but you can give it a try :p)
Installation:
  1. Upload contents of upload folder to your forum root.
  2. Ensure the directories /js and /js-old are writeable by PHP (chmod or otherwise).
  3. Install addon-XFOptimise.xml file.
  4. Go to ACP > Applications > Minify Javascript and wait for around 30 seconds for it to complete the minification process. May take longer since each file must be sent to and processed individually by my server.
  5. If you are running nginx (if not, you should be ;)), see here to take advantage of the .gz files.
Please note that this overwrites all .js files in /js, though a backup is created in /js-old.

Also you should run the Minify Javascript process again after upgrading XenForo or installing addons with Javascript included.

Update: (0.0.x to 0.1.0)
  1. Upload contents of upload folder to your forum root, overwriting all files.
  2. Upgrade addon using addon-XFOptimise.xml file.
Changelog:

0.1.0: (24/04/2011)
  • Added configurable Javascript Blacklist, with existing defaults along with Twitter widgets and AdBrite.
  • Improvements to permissions etc. when running minify Javascript (thanks xfrocks).
0.0.3: (22/03/2011)
  • Switched to a more reliable file iterator (SPL extension required now).
  • Fixed permissions issue (only superadmins had access, now controlled with 'option' flag as previously intended).
0.0.2: (22/03/2011)
  • Possibly fixed array_merge error in Minify Javascript function.
0.0.1: (21/03/2011)
  • Initial release
Donations go here. :)
 

Attachments

DarkVodka

Formerly Wuebit
#6
WIN! :3

Code:
js/highslide.js... Compressing... Compressed 38.1%
js/misc.js... Compressing... Compressed 31.6%
js/moo.fx.js... Compressing... Compressed 29.2%
js/moo.fx.pack.js... Compressing... Compressed 31.9%
js/prototype.lite.js... Compressing... Compressed 48.4%
js/8wayrun/EWRatendo.js... Compressing... Converting to UTF-8... Compressed 28.6%
js/8wayrun/EWRcarta.js... Compressing... Converting to UTF-8... Compressed 27.4%
js/8wayrun/EWRhabla_ajax.js... Compressing... Compressed 27.6%
js/8wayrun/EWRmedio.js... Compressing... Converting to UTF-8... Compressed 30.5%
js/8wayrun/EWRmedio_ajax.js... Compressing... Compressed 35.4%
js/8wayrun/anytime.js... Compressing... Compressed 63%
js/8wayrun/sortable.js... Compressing... Converting to UTF-8... Compressed 55.1%
js/8wayrun/swfobject.js... Compressing... Compressed 16.4%
js/fp/flowplayer-3.2.4.min.js... Compressing... Compressed 8.4%
js/highslide/highslide-full.js... Compressing... Compressed 28.2%
js/highslide/highslide-full.min.js... Compressing... Compressed 3%
js/highslide/highslide-full.packed.js... Compressing... Compressed 4.3%
js/highslide/highslide-with-gallery.js... Compressing... Compressed 29.6%
js/highslide/highslide-with-gallery.min.js... Compressing... Compressed 3.1%
js/highslide/highslide-with-gallery.packed.js... Compressing... Compressed 4.3%
js/highslide/highslide-with-html.js... Compressing... Compressed 27.5%
js/highslide/highslide-with-html.min.js... Compressing... Compressed 3%
js/highslide/highslide-with-html.packed.js... Compressing... Compressed 4.2%
js/highslide/highslide.js... Compressing... Compressed 29%
js/highslide/highslide.min.js... Compressing... Compressed 3.3%
js/highslide/highslide.packed.js... Compressing... Compressed 4.2%
js/jquery/jquery-1.4.4.min.js... Compressing... Compressed 2.4%
js/jquery/jquery.xenforo.rollup.js... Compressing... Compressed 9.1%
js/lnblog/blog_comment.js... Compressing... Compressed 23.6%
js/swfupload/swfupload.min.js... Compressing... Compressed 1.1%
js/tinymce/jquery.tinymce.js... Compressing... Compressed 3.3%
js/tinymce/tiny_mce.js... Compressing... Compressed 3.2%
js/tinymce/tiny_mce_popup.js... Compressing... Compressed 4.8%
js/tinymce/tiny_mce_src.js... Compressing... Compressed 50.7%
js/xenforo/acp_login.js... Compressing... Compressed 56.6%
js/xenforo/attachment_editor.js... Compressing... Compressed 53.1%
js/xenforo/avatar_editor.js... Compressing... Compressed 44.7%
js/xenforo/cache_rebuild.js... Compressing... Compressed 41.4%
js/xenforo/color_picker.js... Compressing... Compressed 37.1%
js/xenforo/comments_simple.js... Compressing... Compressed 39.7%
js/xenforo/contact_details_editor.js... Compressing... Compressed 55.7%
js/xenforo/conversation_invite.js... Compressing... Compressed 44.5%
js/xenforo/discussion.js... Compressing... Compressed 48.9%
js/xenforo/discussion_list.js... Compressing... Compressed 49.5%
js/xenforo/event_listener.js... Compressing... Compressed 33.7%
js/xenforo/feed_preview.js... Compressing... Compressed 34.4%
js/xenforo/filter_list.js... Compressing... Compressed 45%
js/xenforo/follow.js... Compressing... Compressed 52.5%
js/xenforo/inline_mod.js... Compressing... Compressed 47.9%
js/xenforo/lightbox.js... Compressing... Compressed 49.9%
js/xenforo/news_feed.js... Compressing... Compressed 55.7%
js/xenforo/options_censor.js... Compressing... Compressed 45.8%
js/xenforo/permission.js... Compressing... Compressed 43.6%
js/xenforo/personal_details_editor.js... Compressing... Compressed 60%
js/xenforo/quick_reply_profile.js... Compressing... Compressed 39.2%
js/xenforo/spam_cleaner.js... Compressing... Compressed 49.3%
js/xenforo/style_property_editor.js... Compressing... Compressed 47.7%
js/xenforo/template_edit.js... Compressing... Compressed 54.3%
js/xenforo/xenforo.js... Compressing... Compressed 54.8%
js/8wayrun/jw/jwplayer.js... Compressing... Compressed 4%
js/8wayrun/jw/silverlight.js... Compressing... Compressed 69.6%
js/8wayrun/jw/wmvplayer.js... Compressing... Compressed 26.1%
 

Garamond

Well-known member
#9
The "Compressed" numbers seems promising - but what are the real world results of this add-on? Percent doesn't tell me that much, but seconds do.
 

Luke F

Well-known member
#11
The "Compressed" numbers seems promising - but what are the real world results of this add-on? Percent doesn't tell me that much, but seconds do.
Some figures from my forum homepage:

Before XF Optimise:
YSlow: 88 (B)
Page Speed: 78

After Defer Javascript:
YSlow: 90 (A)
Page Speed: 79

After Minify HTML:
No change, other than a tick for Minify HTML in Page Speed
(For a thread or any other page with a lot of HTML this would probably push the score up a bit)

After Minify Javascript:
YSlow: 90 (A)
Page Speed: 82
 

chrisj

Active member
#13
Server Error

array_merge() [function.array-merge]: Argument #2 is not an array

  1. XenForo_Application::handlePhpError()
  2. array_merge()inDark/XFOptimise/ControllerAdmin/Kondou.phpat line78
  3. Dark_XFOptimise_ControllerAdmin_Kondou->bfglob()inDark/XFOptimise/ControllerAdmin/Kondou.phpat line18
  4. Dark_XFOptimise_ControllerAdmin_Kondou->actionMinifyjs()inXenForo/FrontController.phpat line310
  5. XenForo_FrontController->dispatch()inXenForo/FrontController.phpat line132
  6. XenForo_FrontController->run()in/home/jordanc/domains/ngpforum.com/public_html/admin.phpat line13
I get this error when I go to minify javascript. Thanks for making this addon.
 

M@rc

Well-known member
#14
Thanks for the add-on. I'll test it out later, ;)

Edited on 30th March 2011 : I've installed it on my board. Works great!
 

Luke F

Well-known member
#15
Server Error

array_merge() [function.array-merge]: Argument #2 is not an array

  1. XenForo_Application::handlePhpError()
  2. array_merge()inDark/XFOptimise/ControllerAdmin/Kondou.phpat line78
  3. Dark_XFOptimise_ControllerAdmin_Kondou->bfglob()inDark/XFOptimise/ControllerAdmin/Kondou.phpat line18
  4. Dark_XFOptimise_ControllerAdmin_Kondou->actionMinifyjs()inXenForo/FrontController.phpat line310
  5. XenForo_FrontController->dispatch()inXenForo/FrontController.phpat line132
  6. XenForo_FrontController->run()in/home/jordanc/domains/ngpforum.com/public_html/admin.phpat line13
I get this error when I go to minify javascript. Thanks for making this addon.
Anything weird in your js folder? Such as empty folders etc.
 

chrisj

Active member
#17
Anything weird in your js folder? Such as empty folders etc.
Nothing that I can notice easily. I'll do a more in depth search but I have these folders: jquery, swfupload, tinymce, xenforo. I also had an empty html file, index.html (not sure what the purpose of that is).
 
#20
Server Error

array_merge() [function.array-merge]: Argument #2 is not an array

  1. XenForo_Application::handlePhpError()
  2. array_merge()inDark/XFOptimise/ControllerAdmin/Kondou.phpat line78
  3. Dark_XFOptimise_ControllerAdmin_Kondou->bfglob()inDark/XFOptimise/ControllerAdmin/Kondou.phpat line18
  4. Dark_XFOptimise_ControllerAdmin_Kondou->actionMinifyjs()inXenForo/FrontController.phpat line310
  5. XenForo_FrontController->dispatch()inXenForo/FrontController.phpat line132
  6. XenForo_FrontController->run()in/home/jordanc/domains/ngpforum.com/public_html/admin.phpat line13
I get this error when I go to minify javascript. Thanks for making this addon.
I get this also :( Have checked for empty folders etc, however I can't seem to find any (there's a lot of folders in the xf directory :p ). Permissions are fine too.
 
Status
Not open for further replies.