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.
[...] CDN Tools [...]
Wow! I can see an incredible improvement in load times just by using the Google CDN, thanks for the great plugin!
I could help you translate the plugin into spanish if you want. Just send me an e-mail.
[...] CDN Tools,把WordPress带入CDN这些新技术。 CDN(Content Delivery Network)内容分发网络,简单的说就是通过在不同地点缓存内容,然后通过负载平衡等技术将用户请求定向到最近的缓存服务器上获取内容,提高用户访问网站的响应速度。和简单的内容镜像不同,CDN通过用户就近性和服务器负载的判断,以一种更为高效的方式为用户的请求提供服务。 [...]
Apologies to those whose comments have disappeared. I foolishly deleted 20 legitimate comments while pruning some spam. Sorry!
i have installed your plugin at my site and the files are not being uploaded at cloud files despite being configured with the API key. however data files have been successfully uploaded.
love the concept – but it doesn’t transfer anything to cloudfiles. Then again we have almost no attachments – but i thought it would transfer some js or css files.
Hi,
To the author of the plug-in…can you e-mail me about support for a certain CDN? I can give you a test account in a few days.
Thanks,
Mark
SimpleCDN are stopping their automatic mirroring services for their basic service, which will then only have various forms of ftp or web based upload and management, unless you are willing to pay a large chunk for rsync.
Anyone can actually set up an account with them for free and receive $15 credit, and the bandwidth is cheaper than Amazon.
If possible, it would be great to allow for multiple sources and locations. As an example you might have public files going to a public bucket, and files secured by some kind of membership plugin going in a private bucket.
Who knows, maybe they can also set you up with one of their Hurricane CDNs to get some support there in some way as well.
I enabled the plugin on my site and entered the cloud file user name and api. When i try to upload a new file to wp, it automatically gets uploaded on cloud files. but when i attempt to load the existing files, I get this error.
Fatal error: Uncaught exception ‘SyntaxException’ with message ‘Missing required size for object data.’ in /home/sober/public_html/JIMMY-GS/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php:860 Stack trace: #0 /home/sober/public_html/JIMMY-GS/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php(924): CF_Object->write(Resource id #238, 0, true, ‘/home/sober/pub…’) #1 /home/sober/public_html/JIMMY-GS/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/loader.php(66): CF_Object->load_from_filename(‘/home/sober/pub…’) #2 /home/sober/public_html/JIMMY-GS/wp-content/plugins/cdn-tools/cdntools.php(217): cdn_loader->attachment_upload(‘/home/sober/pub…’) #3 /home/sober/public_html/JIMMY-GS/wp-content/plugins/cdn-tools/cdntools.php(255): cdntools->cdn_attachment_upload(’34′, ‘/home/sober/pub…’) #4 /home/sober/public_html/JIMMY-GS/wp-content/plugins/cdn-tools/cdntools.php(386): cdntools->cdn_upload_all_attachments() #5 /home/sober/public_html/JIMMY-GS/wp-includes/plugin.php(339): cdntools->sett in /home/sober/public_html/JIMMY-GS/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php on line 860
[...] if you are a WordPress user, there are plugins that will let you integrate either Amazon S3 or Mosso into your existing uploader, making it unnecessary to change your existing [...]
Thanks for this plugin…very useful! Do you accept donations?
For now I’m not accepting donations. That may change in the future, but at the moment I do this entirely for fun and don’t want any restitution.
Thanks for offering though!
Paul, that is quite admirable.
hi i have just started playing with this great plugin but i seem to be getting read errors on my content.
i can load the JS files via the advance option to the cloud but my attachmnets seem to always error
see below my error
ncaught exception ‘IOException’ with message ‘Could not open file for reading: /nfs/c01/h02/mnt/31732/domains/photonbelt.co.uk/html/wp-content/uploads//nfs/c01/h02/mnt/31732/domains/photonbelt.co.uk/html/wp-content/uploads/2008/11/immortality.jpg’ in /nfs/c01/h02/mnt/31732/domains/photonbelt.co.uk/html/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php:909 Stack trace: #0 /nfs/c01/h02/mnt/31732/domains/photonbelt.co.uk/html/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/loader.php(66): CF_Object->load_from_filename(‘/nfs/c01/h02/mn…’) #1 /nfs/c01/h02/mnt/31732/domains/photonbelt.co.uk/html/wp-content/plugins/cdn-tools/cdntools.php(217): cdn_loader->attachment_upload(‘/nfs/c01/h02/mn…’) #2 /nfs/c01/h02/mnt/31732/domains/photonbelt.co.uk/html/wp-content/plugins/cdn-tools/cdntools.php(255): cdntools->cdn_attachment_upload(’83′, ‘/nfs/c01/h02/mn…’) #3 /nfs/c01/h02/mnt/31732/domains/photonbelt.co.uk/html/wp-content/plugins/cdn-tools/cdntools.php(391): cdntools->cdn_upload_all_attachment in /nfs/c01/h02/mnt/31732/domains/photonbelt.co.uk/html/wp-content/plugins/cdn-tools/cdn_classes/cloudfiles/cloudfiles.php on line 909
i have tried deleting the files manually but then i get the same error with another file when i re-run the script.
any help you could lend would be great..
This is a known issue, but I’d appreciate any details you can provide in tracking it down. Are you running PHP as an apache module or CGI, et cetera?
Is it compatible with WordPress 2.8?
[...] 3. Amazon S3 for WordPress or CDN Tools [...]
这个收费吗》》》》
[...] 3. Amazon S3 for WordPress or CDN Tools [...]
Hi, some of my files are uploaded to Mosso until the uploader gives a 404 error, then the upload stops. Only about 27 images are uploaded. Any ideas how I get them all uploaded?
Thanks
Arlyn
Hi,
I’ve been using your plugin for about a week and it make a SERIOUS difference. Thanks so much.
I just noticed that Google is now hosting two more sets of libraries.
# SWFObjectNew!
# Yahoo! User Interface Library (YUI)New!
Are there any plans to include these?
Steve
Dear Paul,
can you add coral cache network? http://coralcdn.org/
greetings,
m.
Does the message, ‘To upload files to the CDN, you must have curl support installed for PHP’, mean that my PHP hasn’t CURL support?
[...] Mosso 2 hours ago RT @reaperhulk: CDN Tools v0.81 is out. Major upgrades to initial loading and more. If you have Cloud Files and WordPress http://swearingscience.com/cdn-tools/ [...]
Yes, CDN Tools requires the cURL module at this time and that message means you do not currently have it installed. Hopefully you can add it without too much trouble!
Hi Paul, thanks for the plugin, is there a manual way I can upload my attachments to cloudfiles before switching on the plugin? the upload bombs out with different http errors every time I try.
Best
Florian
[...] 19th May 2009 CDN Tools 0.81 has been released. I use this on my blogs to sideload the media I upload to WordPress to Cloud [...]
Hi, great plugin. What about a “custom CDN” option with an ftp URL
and a different HTTP URL for serving the files. This would help using your plugin with Limelight CDN.
Thanks !
Here’s a question… there are several free/open community CDNs out there. Coral comes to mind. Why not support some of them as well?
Here is another idea. Back in 1996, there was a plugin for the Mac OS 8 (wow that’s old) workgroup webserver that would automatically mirror files of a certain type or size to other webservers.
You simply set fed the ftp details into the plugin and listed the available space and bandwidth on the mirror. You could set up multiple mirrors and the plugin would manage what files went to what server based on which mirrors were fastest (it tested) and had available space/bandwidth.
You could literally host a site from a modem – your primary server had all the files and managed the requests, and all the html and files were served from three or four mirror sites. If a mirror runs dry or dies, the plugin failed over to the next available. You could build your own multi-homed CDN.
I’ve never since seen a web plugin able to do that so easily. I would pay for that for WP.
LOL! My second recaptcha word is “wobblies” hehe
[...] CDN Tools [...]
I installed CDN Tools, loaded the files and attachments (and verified they exist in my Cloud Files account), but for some reason the existing attachments aren’t loading when viewing the site. The src urls aren’t being rewritten. They look like this
img src=”/image.png”
However, NEW attachments uploaded in new posts after enabling CDN Tools works fine. Dunno what’s up… any ideas?
I am not much of a programmer and I am sure this is simple, but when I try to activate the plugin, it throws me this error in wordpress.
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /plugin/cdn-tools/cdntools.php on line 45
Any help would be greatly appreciated!
It means your server is running PHP4 and CDN Tools requires PHP 5. You’ll need to upgrade or contact your host to see if they support PHP5. Sorry!
[...] Paul Kehrer – CDN Tools is a WordPress plug-in that allows you to load javascript and media files to Cloud Files to drastically speed page loads. CDN Tools has been designed to be as easy to use as possible – simply activate the plug-in, save your credentials, and click “load files”. Once the initial load is complete all your files will be automatically served from Cloud Files and all future attachment uploads will transparently sideload. Link: http://swearingscience.com/cdn-tools/ [...]
hi paul.
i’m getting read errors like:
“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: cloudplasma.co.uk/wp-content/uploads/mansions.jpg/mansions-150×150.jpg”
it only seem to be the thumbnail versions of the files that fail to upload. all the full sized images are fine. the url for the thumbnail should actually be:
“cloudplasma.co.uk/wp-content/uploads/mansions-150×150.jpg”
this a wordpress error?
[...] CDNTools: A WordPress plugin that integrates your blog with Mosso Cloud Files for serving the images from their CDN. [...]
[...] CDNTools: WordPress插件,将你的blog与活跃的云文件相结合,为其提供图片的CDN服务。 [...]
Hi Paul
Your plugin means business ! and the site loads like wildfire. I really appreciate your work and will write a post about this plugin in my upcoming blog
[...] CDNTools: A WordPress plugin that integrates your blog with Mosso Cloud Files for serving the images from their CDN. [...]
me again…
still getting the same errors when attempting to upload thumbnails
“wp-content/uploads/p1010575.jpg/p1010575-300×242.jpg”
tried various things but for whatever reason the url is malformed.
cdn tools is still sticking the thumbnail’s name after the main image’s for some reason when the thumbnail image title should be on its own
[...] der Installation musste ich das CDN Tools Plugin deinstallieren, da dieses den Artikel-/Seiten-/Kommentareditor lahm legt. Leider kann man, da es [...]
[...] CDNTools: A WordPress plugin that integrates your blog with Mosso Cloud Files for serving the images from their CDN. [...]
Hi Paul,
I’m getting read errors while trying your plugin:
“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: example.com/image.jpg”
Is there a fix?
My server info:
Apache/2.0.63
PHP Version 5.2.9
Thanks,
Dan
CDN Tools 0.81 breaks my WordPress editor/TinyMCE
[...] CDNTools: A WordPress plugin that integrates your blog with Mosso Cloud Files for serving the images from their CDN. [...]
Does this plugin affect the database at all?
CDN Tools works great on my MU test platform, but as I tweeted you (@bluesplinter), I have an edge case that you may be able to easily help with.
I am setting up an MU platform for an organization. Each person can have their own blog, but the organization will be using a single CDN account at Mosso. What I’d like to be able to do is simply enable CDN Tools as the site admin, and then have it automatically “just work” for ALL of the user blogs. IOW, they don’t have to enable it, or use their own API key, or “load files”, or anything. In fact, it would be great if they didn’t even see it in their dashboard, and it just “worked” for them.
The authkey/authname could be pulled from the base blog, and the bucket/container could be a combination of my root CDN Container Prefix plus their blog_id (ie, container_4), etc. I think I can hack all of this myself, but any tips as to *where* to do the hacking would be great.
If I just wanted to disable their access to the CDN Tools page, where would I find that?
Ignore my last question… I put an “if (is_site_admin())” check around the add_submenu_page() call, and all is now well.
I think I can hack the rest of it to pull the settings only from the root blog…
Of course, now I’ll have to merge your future updates with this hacked version, unless you decide to incorporate this as an option in the official version (hint, hint) .
I have a question and a comment….
If I install CDN Tools and transfer all of my static assets to Cloud Files are my files still retained locally in the event I need to disable CDN Tools? Also, if I create a new post are the images files retrained locally and then transfered or are they only transfered? I am trying to understand the long term implications of using Cloud Files in the event I wish to discontinue its use.
Also, I would be happy to pay for this plugin, it seems like a very valuable tool and I would like to see active development & support continue.