Issues with WordPress and HTTP Authentication

Quite some time ago, but WordPress blog was hacked. I managed to clean everything up and get things working again thankfully. One measure to help secure it in the future was to password protect the wp-admin area with an .htaccess file. Now it seems that this is causing problems for visitors because anyone who comes to my site is asked to enter a username and password. If they land on the main index, a page within the blog, or a specific post in the blog, they are asked to log in. Each time they nav to a new page. They can simply hit CANCEL to move on, but this is a really horrible user experience.

I think this started happening due to a recent WordPress upgrade, but I can’t be sure. I also can’t figure out how to keep visitors from seeing this, which is all I care about. Disabling the stupid WordPress admin bar only gets rid of one of the log in panels. Yes, that’s right, my blog was asking people to log in twice on each page.

This is really annoying and I hope I can update this post soon with a solution.

Later…

Still no luck. But it seems like trying to hide the admin section behind HTTP auth is a waste of time anyway. I don’t know how long it’s been like this, but in Chrome and Firefox, if you try to access my “protected” admin log in screen and don’t enter the correct password, you still get the WordPress log in screen. It’s just play, un-styled HTML. Awesome. A total waste of time.

I’m lucky, I guess

Apparently this attack on Word Press blogs is widespread. I’d been running 2.7.something up until yesterday, but I was lucky and my blog is still intact. Not that it would be a huge deal if it was invaded, anyway. Still… The really dumb thing is that since I was running 2.7.something, upgrading to the latest was as simple as hitting a button. In the past it was a little more complicated than that (which is why poor Andy Ihnatko got hit).

Since I’m in the middle of a little crash course in PHP/MySQL anyway, I should really take the three minutes to learn how to backup my database.

Quick Tip #2 – Adjust default wp-syntax tab size

The WP-Syntax plug-in is great. Exactly what I’m looking for so that I can embed code snippets in my blog. Thank you Ryan. But one thing that struck me was that the tab size was too big. It’s set at 8 spaces by default. No bueƱo. I like my tabs to be 4 characters.

So find the geshi.php file in wp-content/plugins/wp-syntax/geshi/ and open it in your favorite editor.

geshilocation

Find the following line (#503 as of this writing):

503
var $tab_width = 8;

And change the 8 to whatever you like. Done. Lovely. Have a Coke.

UPDATED Sunday, March 1, 2009 Eh… so that doesn’t actually work. I tried another fix I found here, but that ended up changing the font size in the code. So I’m just going to use TextMate to convert all of the tabs to spaces in my code samples.

Ugh… now what?

Problem #2.

The WordPress Widgets page isn’t allowing me to add Links to the sidebar. It’s not in the sidebar and the “Add” hyperlink next to Links in the Available Widgets section is missing.

can't add links

Help? :(

UPDATE:

I figured out the problem. I found a lot of posts explaining that changing themes might screw up your Widgets. So you’ve got to switch back to the old theme you were using, remove all Widgets, switch to your new theme, and add Widgets back. But that didn’t work. There was no Links Widget to remove from my Current Widgets! Okay, my bad. Magatheme got me again. There are six different sidebars or areas for Widgets in Magatheme. I had the Links in the Right Footbar. So I switched to Right Footbar, found Links, removed it, and all was well with the world.

6 sidebars

Lame, but hopefully they’ll fix that bug soon.

WP-Syntax and Magatheme don’t mix?

So as I’m trying to get started with this whole blogging thing, one of the key things I had to figure out was how to insert ActionScript 3 code snippets into my blogs. WP-Syntax fits the bill. Problem is, all of my code snippets were showing up centered:

centered code snippet

That’s not very cool. I did a little searching on this problem, made sure there wasn’t an update to the WP-Syntax plug-in that I was missing, but couldn’t find an answer. By accident I realized it was my current theme’s fault. I was using Magatheme. It looks nice. Very minimal and clean. But something is going on with it at the messes up the code snippets. Oh well… Maybe if I become a WordPress whiz I’ll be able to customize the theme and fix the problem. Or maybe the theme developer will take care of it for me :)