Best song title on my experiences with coding: "Stop Breaking Down" by Robert Johnson.
March 2, 2010 3:06 PM   Subscribe

Best practices for WordPress as a CMS ... or, please help me not kill my site again.

Ok, so thanks to a savvy dev (thank you Savior Joe of San Francisco) I'm no longer dealing with a a scary '500 Internal Server Error White Screen Of Death' which came about as a result of a corrupted .htaccess file, non chmod 755 files and several plugin incompatibilities scenario* (I put more details on what happened below). I now know I either have to take a class in PHP or read several books on WP so I don't start hacking away and breaking a site by stupid coding errors (although I know that's how you learn). I'm not a dev - just enough knowledge to be dangerous.

The question is, how do I prevent this kind of problem in the future on my site? I know AskMe has lots of devs, so I guess I'd like to know where you all learn and keep up with the best practices for WP - are there sites that discuss them (i.e. 'do x, not y when you've got a site')? A good book to buy, class to take?** I'm looking to master using WP as a CMS, but am wondering now if it's still the best free or low cost CMS solution for a small, less than 75 pages, not hugely dynamic activity site. I've heard Joomla and Drupal are overkill for this kind of simple 'file management, not huge interaction with a dynamic server' scenarios.

Thanks for the help! If you're in the Bay Area and I can pick your brain over coffee over this stuff, let me know.

* OK, main question is about the best practices - I have a bunch of worried questions as a result of this experience related to plugins etc. Mods, if this is too much, ping me and I'll remove it if it's too many questions in one.

- directories: how can I prevent them from changing from 755? Is there a way to password protect my directories so that these random changes don't happen.

- htaccess: how can I prevent it from getting corrupted? It apparently happened when used TextPad (I'm on a Mac) and must have saved it as a .rtf file and then uploaded it and change the name, so some garbage RTF lines appeared at the start.

- plugins: how can I prevent plugin compatibility issues? Is there a chart somewhere that helps you figure out which are stable ones and which are - or is it simply 'Akismet has been downloaded 50K times, therefore consider it ok'? How many plugins are too many to have, safely? The plugin issues - which was one of the reasons why I migrated to WP in the first place has me freaked out, because when my site was down I tried deleting them one by one, but it didn't help - only when they were all deleted did things start to work.

** I haven't found the books that can help me - most are either basic ('WP has these things called 'plugins') or too advanced ('to create your own plugin...'). I just want something intermediate so I can hopefully learn and improve. And there are lots of great blogs and forums on individual topics, but nothing I've seen yet on 'using WP as a CMS - the missing manual'. I'm in the SF Bay Area if you know of good classes or teachers to speak to.
posted by rmm to Technology (5 answers total) 6 users marked this as a favorite
Well, this is more of a development best practice not just specific to wordpress, but DON'T make untested changes to the production environment! You need a test server that you can mess with without blowing up your live site. Install MAMP (Apache, MySQL and PHP), then install wordpress locally. You can even import your posts so you have a mirror of your live site. Maybe you're already doing this... it isn't clear from your question.

As for some of your specific questions... htaccess: don't do whatever you did to corrupt it again (!), and plugins: you should be able to test plugin compatibility on your dev server.
posted by pipco at 3:31 PM on March 2, 2010

Seconding using MAMP to create a local copy of your site(s) so that you can play with them to your heart's content without screwing up the live site.

I'm just starting out as a developer, but I can't recommend going to WordCamp enough. The San Francisco one (linked) is coming up, on May 1, and is only $50. You'll make great connections and get to watch presentations on everything from choosing themes and plugins to, say, jQuery. The one in New York last November had eight different tracks for everyone from complete WP newcomers to advanced developers.

Also, I'd recommend not using TextPad. Smultron (no longer being updated, but still fantastic) is an excellent code editor. I hear fantastic things about NetBeans as well, but it's above my level at this point.

Good luck!
posted by rebekah at 3:44 PM on March 2, 2010

For one thing, you shouldn't touch your .htaccess file unless you're very confident you know what you're doing. Wordpress generates that on the fly.

Plugins: now publishes the latest version of Wordpress that each plugin has been tested with. So that's something to keep in mind. Add plugins conservatively and one at a time. If you happen to break something after adding a plugin, delete that plugin.

Directories: I don't know what the issue there might have been.

If you want to make any functional changes to your website, they should either go in your themes various template files, or its functions.php file (if it doesn't have one, create it). You don't want to touch the WP core.

I'll nth the advice to get MAMP.
posted by adamrice at 4:26 PM on March 2, 2010

how can I prevent it from getting corrupted? It apparently happened when used TextPad (I'm on a Mac) and must have saved it as a .rtf file and then uploaded it and change the name, so some garbage RTF lines appeared at the start.

RTF files are not text files; they're formatted, in rich text, hence Rich Text Format. Changing the extension from .htaccess.rtf to .htaccess won't do -- it's like changing a *.pdf file to a *.doc file and hoping that it'll open in Word.
posted by suedehead at 10:52 PM on March 2, 2010

Response by poster: Thanks for all the information guys - looks like I'll have to play around with MAMP for good. I downloaded it, but have been struggling on my own without it; maybe a testing environment will help.

Not sure if this will help anyone, but this might be the Missing Manual I've been looking for: Digging into WordPress - plus the book has A Lifetime Subscription. If I buy it and it's good, I'll post a review here.

thanks everyone!
posted by rmm at 1:34 PM on March 4, 2010

« Older Can you translate this French handwriting?   |   When Trusted Doctors Leave Town... Newer »
This thread is closed to new comments.