WordPress Plugins and File Fetching

A number of my recent plugins have provided a facility to read files from other sites. However, errors were being reported by some users and so I attempted a change in one such plugin to address this.

Unfortunately, that didn’t quite work as I intended. Kind of. In this case, I swapped to using a different file routine, but one which now only works with PHP 5. So I’ve now published a newer version of the same plugin using another new method, and one that should now be compatible with PHP 4.

The problem here is that there are security implications with reading files externally, so there is a way for hosts to turn this ability off.

My new plugin, I suspect, doesn’t actually resolve this and there isn’t a great amount I can do about this – if your host has decided to prevent you from reading external files then, well, you’re stuffed. My host doesn’t, which might explain why I didn’t recognise the problem at first.

The file system I’ve used now, however, should allow you to specify local file names – at least that way files hosted by yourself should be readable. I’ve not tested it though, so feel free to provide feedback.

I’m now going to upgrade my other plugins with the same code process.

Posted by David Artiss

Enterprise Happiness Engineer for the WordPress VIP team at Automattic. Gamer, film lover and general fan of all things Marvel, Star Trek and Star Wars. Failed comedian. Writer for The Big Tech Question. World's Greatest Grandma.

Talk to me!

This site uses Akismet to reduce spam. Learn how your comment data is processed.