CACHE IMAGES PLUGIN FOR WORDPRESS

I’ve been migrating blogs from Blogger to WordPress and was looking for a way to automatically move the images, too. One of my clients had heard about Matt Mullenweg’s Cache Images plugin and suggested it.

As it turned out, it was a great starting point, but not exactly ready-to-go. This is mostly because it was written for WordPress 1.5, and things have changed somewhat since then. This has inspired some frustration. Fortunately, I had a little extra time today, so I started working through the issues. Since other people are obviously wanting this functionality, I’m releasing my modified (but potentially very buggy!) version here.

What it does:
The point of the original plugin and this one are the same. It goes looking through your blog posts for images hosted on any other server, and then gives you the option to automatically create local copies. It then replaces the references to the old files with references to the new files. This is very handy when you’re moving from another blogging platform to WordPress. You might also find it handy when moving servers or anything along those lines that would change your image locations.

How to use it:
Start by getting all of your posts imported into WordPress 2.0.4+, and make sure your uploads directory is set (in Options > Miscellaneous) and has “write” permissions. Then unzip and upload cache-images.php to your wp-content/plugins/ folder. Activate the plugin in the WordPress admin Plugins page. You’ll get a new “Remote Images” sub-menu under “Manage”. Follow the instructions therein.

How to get it:
Download cache-images.zip

Please note:
Consider this an alpha release. Don’t use it on a production blog, and back up your posts first unless you’d like to lose them should something go wrong. I can’t promise much in the way of support (time constraints being what they are) but please feel free to report any issues you encounter.

Known issues:

  • May not work with images that have unusual characters in their names (periods, tildes, etc.). I believe it will still convert the rest, but these images will have to be handled manually until I sort this out.
  • May not work on Pair hosting or others that have certain restrictions. This shows up in an error like this:
    URL file-access is disabled in the server configuration in /usr/www/users/username/blog/wp-content/plugins/cache-images.php on line 119
    If you get this error, try this fix recommended by the Pair tech support folks (thanks, Michael, for passing this on!):You can solve this permanently by putting the following line of text in a .htaccess file placed in your working web directory:php_value allow_url_fopen 1URL file access is turned off globally on the server for security purposes. However, customers can enable it locally by adding that configuration line in a .htaccess file.