Earlier today, (well technically it was yesterday) I installed the Acronym Replacer WordPress plugin and had my whole site crash with a PHP parse error. I immediately deactivated the plugin, and everything was fine. I spent the next half hour reviewing the code, and upon finding no apparent problems that would have caused such an obvious error, I spent the following half hour searching the Internet for possible causes. As it turns out, it was really quite simple. Thanks to Dave over at ForbiddenByte I was able to solve the problem in minutes!
It turns out that Safari has a nasty little bug that causes text that you copy to contain invisible characters, referred to as “gremlins,” which are copied right along with the text. This means that when you select and copy code fragments, then paste them right into a source file such as PHP script in my case those gremlins come right along with the code and confuse the hell out of the computer.
The solution then is not to use Safari for copying code. I fired up Firefox, copied the source code for the plugin, pasted it right into my site and bam! No problems.
I’m hoping this entry might save someone the aggravation that I could have gone through, if it weren’t for Dave. That’s the beauty of community, really. The wonder of the Web.