CDN Tools

Due to time constraints, CDN Tools is not currently being maintained. If you’re interested in taking over, let me know!

CDN Tools is a WordPress plugin designed to help you drastically speed up your blog’s load time by loading content onto a distribution network (CDN).  You can use a commercial CDN or just load some of your larger JS libraries for free from Google’s servers!  At this time Rackspace Cloud Files is the only supported service, but Amazon S3 will be added soon.

View a screencast of how to set up your WordPress blog with CDN Tools!

Features

  • One click load all attachments and JS to a CDN
  • Transparently sideload new content (including images resized by WP!)
  • Automatically rewrite URLs on your blog to point at the CDN-loaded content.
  • Easy deactivation if you decide to stop using it. No messy fixes to get back to a pristine WP install. Just remove the plugin and everything will work fine!

CDN Tools is still early in its life so please do not hesitate to contact me with bugs or feature suggestions. At the moment there are a few major features I’m planning to add:

  • i18n support (this will require translators)
  • Error handling! (Some exceptions are not caught at this time)
  • More CDNs (eventually, this is low priority until the core is stable)

Requirements

CDN Tools requires PHP5 (with the cURL extension installed) and WP 2.9 or newer. It may work on older versions of WP, but I haven’t tested it. It emphatically will not work on PHP < 5.0.

Download

You can download CDN Tools through the wordpress.org plugin repository homepage.

Version History

v1.0 – 6/29/2010
- WP 3.0 compatibility
- Changed method of storing info about sideloaded files to be far more robust.
- Use directory structure on Cloud Files (uses just one container now)
- Now CDNifies post thumbnails as well (WP 2.9+ feature)
- Fix for blogs using SSL
- Caches credentials for more rapid initial loads/multiple media attach uploads.
- You can now define constants in wp-config for plugin configuration. This allows to configure settings that will be active on all end-user sites without allowing them to see/edit the config. If you define constants the CDN Tools admin page will not register a configuration page.

v0.99 – 12/31/2009
- Log retention support (in advanced options)
- Servicenet flag (in advanced options)
- Both these features were added courtesy of John Dickinson

v0.98 – 12/13/2009
- WordPress 2.9 support. CDN Tools can now handle the image edit system introduced in WP 2.9.
- Better error handling for a few scenarios.
- As of this release WP 2.7 is no longer supported. It might work, but future releases will almost certainly break it.

v0.97 – 12/9/2009
- Initial sideload AJAX used an absolute path with the siteurl. This should have been a relative path or the adminurl to accommodate situations were FORCE_SSL_ADMIN is defined. Thanks to John for identifying the bug.

v0.96 – 12/4/2009
- Upgraded and (temporarily) forked CloudFiles API to fix bugs related to safe_mode and content type detection. This means you shouldn’t see badcontenttype exceptions or “stuck at 0%” errors any more!
- Improved error reporting for AJAX uploads (including timeout errors, which are now set at 90 seconds)
- Removed loading.gif in favor of WP native spinner

v0.95 – 10/25/2009
- Upgraded to CF API 1.5.1. For users within the Rackspace network who have $_ENV['RACKSPACE_SERVICENET'] defined, CDN Tools will now use the servicenet instead of the public network. This should speed sideloading of large files as well as not consuming your bandwidth.

v0.94 – 10/19/2009
- Upgraded to CF API 1.4. This should resolve some cURL issues users have experienced and removes the dependence on a png hack for RHEL4 users.
- Fixed major issue with Google AJAX CDN. Previously users were unable to switch between visual and HTML mode on the edit post page.

v0.93 – 10/8/2009
-A partial fix for issues with customers who have full file paths stored in their postmeta table. This is not a complete fix, but should help some (most?) users.
-Other small bug fixes.

v0.92 – 10/5/2009
-Major upgrade to support WP 2.8. If you are a previous user of CDN Tools you MUST unload files and then load them again. Please let me know if you have issues because several major changes were made.

v0.81 – 5/17/2009
-Major upgrade to the initial load for attachments. Now done via AJAX with percentage progress.
-Additional exception handling (this is still incomplete)
-Upgrade to CF API 1.3.0.
-Wordpress MU compatible (credit John Keyes)

v0.72 – 2/25/2009
-First public release, no changes from previous.

v0.72 – 2/22/2009
-Small bugfixes
-WP Super Cache compatibility.

v0.71 – 2/22/2009
-Workaround for a MIME/PHP bug on RHEL4.

v0.7 – 2/17/2009
-Nearing completion of initial feature set.
-UI rework (again)

v0.6 – 2/15/2009
-Huge improvements on all fronts

v0.4 – 2/8/2009
-Initial sideload support.

v0.2 – 2/7/2009
-First release outside of my own work (seeded to Major Hayden).
-GoogleAJAX for Prototype, jQuery, Dojo, and mootools (free for anyone to use)
-Uploading JS to CloudFiles (only supported CDN presently)
-Supports opting out of CDN’ing wp-admin scripts.

Leave a comment ?

181 Comments.

  1. How can we set the current path and url variables in the code…? that would fix it?

  2. Hi!
    First of all thanx for a great plugin!
    I have a same error –

    “A file failed to upload. CDN Tools will behave inconsistently if all files do not upload successfully! You should contact the developer with this info:
    Could not open file for reading: /home/u12290/djkrypton.de/”

    Server’s PHP version:
    PHP Version 5.2.9

    System:
    FreeBSD 7.2-i386-20091008-RELENG_7_2 i386.

    Thanx in advance!

  3. Same here…

    Could not open file for reading: /home/festival/public_html/wp-content/uploads/2007/11/dth_machmalauter.jpg

    System: Debian Lenny latest
    PHP-Version: 5.2.6-1+lenny4

    The file as all others which could not be opend are present and working correctly if you call them via browser…

    Is there any way to upload files by hand to rackspace cloud files instead of letting the plugin handle it?

    Id love to spend some bucks if this makes this plugin work over here on my site.

  4. Will CDN Tools work with a custom upload location? I’ve been using the plugin for a while now and it rocks. Thanks!

  5. I agree with Robbie. We use Cloud Files for many website/blog.

    This CDN Tools is almost perfect but upload location is too useless.

    Create too many container is not a good idea. Why else we just create/select a container for upload all owner files?

    wp-content folder = container

    Easy and complex.

  6. Custom upload locations will be supported (along with a single container) in 1.0.

  7. Thanks Paul.

  8. FYI – Hit a snag uploading a CSV file from the media library to Cloud Files. Got an error message and it said to contact the developer. Lucky you! It tried to create a container in Cloud files on its own rather than being imported into the appropriate year/month container. File did not upload although other non-images, such as pdf and ppt did just fine.

  9. Bug Report: I am receiving an error message before and after installing CDN Tools .99. The error is Warning: set_time_limit() has been disabled for security reasons in /home/vol12/xtreemhost.com/xth_5012117/jclyde.cz.cc/htdocs/wp-content/plugins/cdn-tools/cdntools.php on line 28

  10. Is there any blacklisting functionality in CDN tools just like FreeCDN?

  11. What type of blacklisting functionality are you looking for? At this time CDN Tools doesn’t do ACLs (waiting for a feature release from Cloud Files)

  12. Thanks for the bug report! I’ll have to suppress error messages on set_time_limit for hosts that have restrictions set there.

  13. Seriously, I can’t patient with version 1.0. This is too amazing!

  14. When installing this plugin via the Plugins panel within WP, it installs successfully, but when clicking “Activate Plugin” an error message “This plugin does not have a valid header” appears.

    Ignoring this and browsing to the list of installed plugins, and activating the plugin via this screen, activates it successfully.

  15. We are getting this error.
    A file failed to upload. CDN Tools will behave inconsistently if all files do not upload successfully! You should contact the developer with this info:

    Fatal error: Uncaught exception ‘SyntaxException’ with message ‘Object name ‘/home1/drawloop/public_html/www/wp-content/uploads/drawloop-world.jpg’ cannot contain begin with a ‘/’ character.’ in /mnt/stor1-wc1-dfw1/368990/www.drawloop.com/web/content/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php:1530
    Stack trace:
    #0 /mnt/stor1-wc1-dfw1/368990/www.drawloop.com/web/content/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php(1216): CF_Object->__construct(Object(CF_Container), ‘/home1/drawloop…’)
    #1 /mnt/stor1-wc1-dfw1/368990/www.drawloop.com/web/content/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/loader.php(66): CF_Container->create_object(‘/home1/drawloop…’)
    #2 /mnt/stor1-wc1-dfw1/368990/www.drawloop.com/web/content/wp-content/plugins/cdn-tools/cdntools.php(245): cdn_loader->attachment_upload(‘/home1/drawloop…’, ’0′)
    #3 /mnt/stor1-wc1-dfw1/368990/www.drawloop.com/web/content/wp-content/plugins/cdn-tools/cdntools.php(260): cdntools->cdn_attachment_upload(’737′, ‘/home1/drawlo in /mnt/stor1-wc1-dfw1/368990/www.drawloop.com/web/content/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php on line 1530

    Click Okay to continue uploading, or cancel to abort.

  16. Hey Paul,
    Just installed your plugin on WP2.9.2 and I’m getting a time out on upload error (below). Curl tools with the same credentials work well so i’m not sure whats going on here. Ideas?
    A timeout on upload has occurred. Please contact the developer and provide them this information:
    error
    action=cdn_attachment_upload_ajax&path=/mnt/stor1-wc2-dfw1/457867/461372/www.stacorflatfiles.com/web/content/flatfiles/wp-content/uploads/2010/01/ShippingPromotion.jpg&post_id=84&cookie=wp-settings-time-1%3D1263844652%3B%20wp-settings-time-3%3D1265306815%3B%20wp-settings-4%3Dm0%253Do%2526m1%253Do%2526m2%253Dc%2526m3%253Do%2526m4%253Do%2526m5%253Do%2526m6%253Do%2526m7%253Do%2526m8%253Do%2526m9%253Do%2526urlbutton%253Durlfile%3B%20wp-settings-time-4%3D1266257776%3B%20wp-settings-3%3Deditor%253Dhtml%3B%20wp-settings-time-5%3D1266810958%3B%20wp-settings-5%3Dm0%253Do%2526m1%253Dc%2526m2%253Dc%2526m3%253Do%2526m4%253Do%2526m5%253Do%2526m6%253Do%2526m7%253Dc%2526m8%253Do%2526m9%253Do%2526m10%253Do%2526editor%253Dhtml%3B%20wordpress_test_cookie%3DWP%2BCookie%2Bcheck%3B%20wp-settings-time-6%3D1266820127%3B%20__utma%3D237871938.164214939.1264705997.1266721754.1266863083.62%3B%20__utmz%3D237871938.1264705997.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B%20fcspersistslider1%3D3%3B%20X-Mapping-caklakng%3D7C479C977E07FF62986DC043A2728BE9%3B%20PHPSESSID%3D8vsu0dhghc991sq828g63ve6i1%3B%20wordpress_test_cookie%3DWP%2BCookie%2Bcheck%3B%20__utmc%3D237871938

  17. Installed getting a series of 3 errors.

    The first is:

    Fatal error: Uncaught exception ‘InvalidResponseException’ with message ‘Invalid response (): (curl error: 6) Couldn’t resolve host ‘storage5.clouddrive.com’: Failed to obtain valid HTTP response…..

    I click submit a couple of times initially it repeats two or three times then goes away and upload resumes.

    It is then later followed by:

    action=cdn_attachment_upload_ajax&path=/mnt/stor1-wc2-dfw1/4#####/www.domain.com/web/content/wp-content/uploads/2009/03/keepmovingforwardscaled1-300×200.jpg&post_id=314&cookie=X-Mapping-beedigeg%3D4306A947DAC30E7D4FC3C27A9E4569AF%3B%20__utma%3D179742068.615175764.1268705265.1268705265.1268705265.1%3B%20__utmb%3D179742068.1.10.1268705265%3B%20__utmc%3D179742068%3B%20__utmz%3D179742068.1268705266.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B%20wordpress_test_cookie%3DWP%2BCookie%2Bcheck%3B%20wp-settings-1%3Dm0%253Do%2526m1%253Do%2526m2%253Do%2526m3%253Dc%2526m4%253Do%2526m5%253Do%2526m6%253Do%2526m7%253Do%2526m8%253Dc%2526m9%253Do%2526m10%253Do%2526imgsize%253Dfull%2526editor%253Dhtml%2526align%253Dcenter%2526hidetb%253D1%2526urlbutton%253Durlpost%2526m11%253Dc%2526m12%253Dc%2526m13%253Dc%2526m14%253Do%2526m15%253Dc%2526m16%253Dc%2526m17%253Dc%2526m18%253Dc%2526m19%253Dc%2526m20%253Dc%2526m21%253Dc%2526m22%253Dc%2526m23%253Dc%2526m24%253Dc%2526m25%253Dc%3B%20wp-settings-time-1%3D1268705280

    I click submit/continue uploading resumes again.

    Finally I am hit with:

    Invalid response (202): Unexpected HTTP return code: 202

    This error will not go away. I can click submit/continue over and over and the same error continue. Uploading completely ceases at about 45%.

  18. Hi Paul,

    Thanks for the plugin. Could you take a look at my site? It looks as though my images (now on the Cloud Files CDN) are not being redirected to load. Everything is still coming from my server—unless I’m mistaken.

    Is it working?

    Everything looks good in the backend.

    Thanks,
    Jesse

  19. 10 Wordpress Plugins to Speed Up Your Blog « Nothing But Random - pingback on April 24, 2010 at 12:54 pm
  20. This is definitely my most favorite WordPress plugin. After getting positive results on speed tests coupled with the ease of access to CDN, we are now migrating all of our WP customers to Rackspace. Thanks Paul!

  21. Some time ago I moved my site from:

    htp://mysite.com/public_html/wordpress/
    to
    htp://mysite.com/public_html/

    So now the plugin trys to access

    htp://mysite.com/public_html/wordpress/wp-content/uploads
    instead of
    htp://mysite.com/public_html/wp-content/uploads

    I am still using my original database so CDN is getting the old info I am guessing?

    Any help appreciated

    Pete

  22. Great tool! Very glad I stumbled across it.

    Unfortunately, I’ll have to wait until it supports uploading to a specified container. I’m not a fan of creating so many containers for files.

    Fingers crossed for 1.0 :)

  23. I like the plugin a lot, but I wanted this to work on the upcoming WordPress 3.0 with Multisite Enabled, because I want to control the CDN for my customers instead of allowing them to pay for Cloud Files, and the risk of viewing my API Key.

  24. Hello: I am trying to use your plugin. It stopped uploading again and again,
    because it can´t read files called like”München” or Zoltán.
    Now I hopefully renamed and re uploaded all those files to my hosted server, and though all the files are already uploaded to the rackspace cloude files, I don´t happen to notice any change. Though …your plugin up until now never managed to finish uploading the attachements, the last time it stuck at 97%.
    I am now repeating this uploading procedure with your plugin, though all the files are already where they should be, in the hope that some miracle will happen, …
    any suggestions?
    Zoltán Jókay

  25. Hello again,
    “Automatically rewrite URLs on your blog to point at the CDN-loaded content.”
    CDN Tools doesn´t do that for me….
    My regards,

  26. I don’t even get past 0% on loading files on WordPress 2.9.2. Looking at my cloudfiles 14 files have been uploaded before it stops. Hitting okay doesn’t get me any further. Here’s my error:

    A file failed to upload. CDN Tools will behave inconsistently if all files do not upload successfully! You should contact the developer with this info:
    202 Accepted

    The request is accepted for processing.

    201 Created

    201 Created

    true

    Click Okay to continue uploading, or cancel to abort.

  27. I am having the same problem Miranda is. How will you contact me to let me know what the solution is? Please let me know. Here is what the error says:

    A file failed to upload. CDN Tools will behave inconsistently if all files do not upload successfully! You should contact the developer with this info:
    202 Accepted

    The request is accepted for processing.

    201 Created

    201 Created

  28. CDN Tools 1.0 is in progress now and should be out around the time WP 3.0 is released, those who are interested in beta testing let me know!

  29. New Design | Feint - pingback on May 28, 2010 at 1:31 am
  30. @Paul, I am interested in testing CDN Tools 1.0.

  31. I’d like to beta test too please! I have a small issue with 0.99 as it interferes with the admin bar that Buddypress uses whilst in the admin section / dashboard…

  32. Sorry the beta fails to install with an invalid header error!

  33. I’ll get you another one soon! Not sure why it’s throwing that error for so many people…

  34. Is this tool still in production?

  35. Sure is. 1.0 will be out the door shortly after WP 3.0 goes final.

  36. Hmm. I just cant get this plug in to work, it constantly errors out on all my installations when attempting to load the files to Cloud Files. :(

    Fatal error:Uncaught exception ‘InvalidResponseException’ with message ‘Unexpected response (): ‘ in /var/www/xxxxx/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php:206

  37. Very interested in beta testing 1.0. I’ve been toying with the current release for a week or so now and so far very impressed. Maybe we can talk outside of comments. Great plugin btw.

  38. Are you still beta testing?

  39. Thanks for the Plugin! Works perfect.

    Karl

  40. do you have an idea, when you will release 1.0?

    greetings

  41. I was trying to use the CDN tools plugin for my primary business website. I installed it and added my rackspace cloud api key and info. Everything worked beautifully, but I noticed that my images were not showing on my wordpress site anymore. They were ghostly transparent boxes with question marks that linked back to rackspace cloud file. Not sure if I missed a step, was wondering if someone could help please.

  42. Great tool! :mrgreen:
    You stated that it’s possible to write our own plugins, do you have any documentation for a home made cdn using ftp and subdomain like static.domainname.com who wll serve all static files…

    Thanks

    Eric

  43. Unfortunately I don’t have any documentation written about writing CDN plugin classes, but if you look at how the cdn_loader class works you can see the methods (and return values) you’ll need to implement for your idea. If you’re experienced with PHP development it’s reasonably straightforward (albeit a bit messy).

  44. Bummage, With 1.0, still failing to upload my files to Cloud Files.

  45. Hey Paul,

    When I attempt to use servicenet, I am getting this error…

    ===================

    A file failed to upload. CDN Tools will behave inconsistently if all files do not upload successfully! You should contact the developer with this info:

    Fatal error: Uncaught exception ‘InvalidResponseException’ with message ‘Invalid response (): (curl error: 51) SSL: certificate subject name ‘snet-storage101.ord1.clouddrive.com’ does not match target host name ‘snet-storage101.dfw1.clouddrive.com’: Failed to obtain valid HTTP response.’ in /home/public_html/mydomain.com/public/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php:490
    Stack trace:
    #0 /home/public_html/mydomain.com/public/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/loader.php(79): CF_Connection->create_container(‘cdn-fatguyonabi…’)
    #1 /home/public_html/mydomain.com/public/wp-content/plugins/cdn-tools/cdntools.php(264): cdn_loader->attachment_upload(‘/home/public_ht…’, ’1′)
    #2 /home/public_html/mydomain.com/public/wp-content/plugins/cdn-tools/cdntools.php(280): cdntools->cdn_attachment_upload(’83′, ‘/home/public_ht…’)
    #3 [internal function]: cdntools->cdn_attachment_upload_ajax(”)
    #4 /home/public_html/mydomain.com/public/wp-includes/plugin.php(395): call_ in /home/public_html/mydomain.com/public/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php on line 490

    Click Okay to continue uploading, or cancel to abort.

    ===================

    My setup is a Rackspace Cloud Server. Thoughts?

    Thanks!

  46. I am configuring the plugin for the first time and get the following timeout errors

    A timeout on upload has occurred. Please contact the developer and provide them this information:
    error
    action=cdn_attachment_upload_ajax&path=/mnt/stor1-wc2-dfw1/459398/www.vertbusiness.com/web/content/wp-content/uploads/2010/01/growthchannelmenu-150×43.gif&post_id=518&cookie=sforum_853c784b579d5ab29ae97804bbc105a8%3DKev%2BRoberts%3B%20wp-settings-2%3Dhidetb%253D1%2526m9%253Dc%2526m6%253Dc%2526m8%253Dc%2526m12%253Dc%2526m10%253Dc%2526m11%253Dc%2526m4%253Do%2526m5%253Dc%2526m7%253Dc%2526m3%253Dc%2526m1%253Do%2526m0%253Do%2526editor%253Dhtml%2526align%253Dleft%2526m2%253Dc%2526m13%253Do%2526urlbutton%253Dnone%2526imgsize%253Dfull%3B%20wp-settings-time-2%3D1278332353%3B%20WP-LastViewedPosts%3Da%253A10%253A%257Bi%253A0%253Bi%253A1886%253Bi%253A1%253Bi%253A1883%253Bi%253A2%253Bi%253A79%253Bi%253A3%253Bi%253A68%253Bi%253A4%253Bi%253A66%253Bi%253A5%253Bi%253A924%253Bi%253A6%253Bi%253A922%253Bi%253A7%253Bi%253A920%253Bi%253A8%253Bi%253A417%253Bi%253A9%253Bi%253A419%253B%257D%3B%20__utma%3D137074615.1046956206.1271238521.1276185678.1277708402.16%3B%20__utmz%3D137074615.1271238521.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B%20wp-settings-time-16%3D1273933632%3B%20wp-settings-1%3Dm0%253Dc%2526m1%253Do%2526m2%253Do%2526m3%253Dc%2526m4%253Do%2526m5%253Dc%2526m6%253Do%2526m7%253Do%2526m8%253Do%2526m9%253Dc%2526m10%253Do%2526m11%253Do%2526m12%253Dc%2526editor%253Dhtml%2526hidetb%253D1%2526m13%253Do%2526align%253Dcenter%2526imgsize%253Dfull%3B%20wp-settings-time-1%3D1271940987%3B%20X-Mapping-akhokmek%3DA2343539FC7E716822220717B48E85F2%3B%20wordpress_test_cookie%3DWP%2BCookie%2Bcheck%3B%20submenuheader%3D2c%3B%20submenuheadersidebar%3D1c%3B%20PHPSESSID%3D55bnp2l8nojtuhg7gta5p945l2

  47. Hi Paul. This looks like a great plugin, something we really need on our site. When we activated it, we could not access the media library anymore. It would not let us upload any new images or even choose from existing images in the library. The fix was to disable the plugin.

    Could I have done something wrong to make this happen?

    Thanks!

  48. A timeout on upload has occurred. Please contact the developer and provide them this information (error removed)

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

 

Trackbacks and Pingbacks: