CDN Tools

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

156 Comments.

  1. 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

  2. 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 :)

  3. 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.

  4. 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

  5. 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,

  6. 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.

  7. 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

  8. 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!

  9. @Paul, I am interested in testing CDN Tools 1.0.

  10. 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…

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

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

  13. Is this tool still in production?

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

  15. 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

  16. 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.

  17. Are you still beta testing?

  18. Thanks for the Plugin! Works perfect.

    Karl

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

    greetings

  20. 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.

  21. 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

  22. 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).

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

  24. 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!

  25. 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

  26. 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!

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

  28. Paul, getting the following error. The path being referenced is for the old host we used – I moved to Amazon EC2 last year and cannot find where it is referenced. Look forward to trying this (and Rackspace) out.

    Thanks in advance, Jay

    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:
    Invalid response (202): Unexpected HTTP return code: 202failed create_paths /users/home/jaybna/domains/styleblueprint.com/web/public/wp-content/uploads/2008/12/paperdoll-300×181.jpg

    Click Okay to continue uploading, or cancel to abort.

  29. I need help with setting up CDN Tools. I don’t have a CDN but would like to use it. All I can do is put ‘true’ for “Use Google AJAX CDN” and then choose ‘none’ for “Primary CDN.” Even when I sign up for an AJAX Search API Key and put it in there, it doesn’t help. What am I doing wrong? What am I not understanding?

  30. Nima,
    When using Google AJAX CDN you don’t need to put in any API key at all. You just set it to Google AJAX + None and you’re done. JS libs will be loaded from google’s CDN with that setting.

  31. Hi Paul,

    Getting tons of errors on uploading files from Cloud Sites to Cloud Files – too may to post here. Most files go but eventually the upload completely hangs. Can I email errors to you?

    Thanks

  32. I’m having problems with this plugin too. My upload gets to 97% and stops. I’ve tried several times but it never completes.

    Also, I’ve noticed that the theme files aren’t tranferred to the cloud.

    Finally, when I look at my website using Chrome’s inspect element feature and look at the resources my website is loading images from the cloud and those SAME images from my wordpress installation. How do I fix this?

  33. Hi Paul, i get the 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:

    Fatal error: Uncaught exception ‘InvalidResponseException’ with message ‘Unexpected response (): ‘ in /xxxxxxxx/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php:203
    Stack trace:…..

Leave a Reply


[ Ctrl + Enter ]

Trackbacks and Pingbacks: