I hate WordPress

Really, I do. In fact, I can’t stand anything based on PHP. It’s a God-awful mess. That’s not to say that some of the biggest sites out there don’t use it. They do. Digg is PHP based, Wikipedia is, Yahoo is. I ran into a problem on Dan’s blog today, as well as mine. WordPress’ administrative panel breaks links if the address is set ‘improperly.’ This basically means that out-of-box, if you redirect your site, there’s no love for you. Decide to have it at $url when it’s actually installed in $url/$directory? Too bad. Redirect users who hit www.subdomain.domain.tld to subdomain.domain.tld, but don’t change it in the config? Endless redirect loop. It’s class.

PHP’s biggest failing is one of scalability. Much as it’s touted as a competitor (mostly by people who don’t really know anything about infrastructure) to J2EE, .NET, and the like, it simply doesn’t do a damn thing. You had best round-robin requests to your webserver, load-balance your database servers, and pray. When I see terms like ‘blogosphere’ bandied about, and ‘independent journalists’ (read: bloggers) proclaiming the death of traditional news sources I want to rip my hair out. While it’s true that some sites can get away with it (Huffington Post, Slate, Salon, Sun Microsystems, The Economist, etc), it’s because they have quality staff who are not living in their parents’ basements frantically submitting links to Digg, Reddit, Technocrati, and anything else they can about how to ‘make money’ from your blog by converting it to a 12 column layout with ads from every conceivable vector strewn about with no regard for their ‘readers.’

Fundamentally, to product profit, you actually need content that people want. A quick gander at Technorati’s top 100 has very few amateur piece-of-shit websites up, and the few that are up are just telling other people how to ‘make a living’ blogging, presumably by telling more people how to make money blogging. SomethingAwful survives. They have these things called editors. CuteOverload is the same way. Judging from my experience, none of these actually serve any content. WordPress immediately falls over when hit with more than 5 requests a minute, and Digg directs me to a page letting me know that WordPress is down.

Again, yes, I’m using WordPress. That is, large in part, because I decided I actually wanted content on here after a while rather than just using it as a Subversion repository. Playing with Typo, Mephisto, and Radiant was fun. They’re all Rails apps, so adding things is easy. Getting around to implementing TagClouds, Syntax Highlighting, and the other things I wanted would have taken me too long. Yeah, it’s Javascript libraries. No, it wouldn’t have taken me more than 5 hours or so. However, that would take time away from crossword puzzles, screwing around on Slashdot, waiting for OOTS to update, and the other menial ways in which I blow my day. I’m already dissatisfied. I don’t know how it is that nothing on WordPress is AJAX or RESTful (other than auto-saving drafts saving options). I can’t imagine why you’re forced to a new page to view a thumbnail. Yes, this is easily fixed. I shouldn’t have to add a lightbox module or write one myself. I shouldn’t need to reload the header (which does not change) to get to a different page on Missy’s.

Slashdot has run for ten years on mod_perl and Apache. It’s still on Alexa’s top 100. It scales. Gracefully. Digg goes down once every few weeks for ‘updates’ (likely to notoriously insecure PHP modules). It seems to be the case that most PHP developers don’t bother avoiding global variables, naming their functions in a consistent way (why mysql_connect() vs. mysql_Query()?) or generally being decent programmers. This goes for people who write CSS, as well. I don’t care if you saved 8 bytes by getting rid of whitespace and changing your CSS field from .headertext to .t1. I don’t have a 2400 baud modem anymore. Let me read your code. Mangled spaghetti code I can deal with. View my Perl:

#!/usr/bin/perl
#Compares FTP logs to /etc/passwd, establishing active
#customers in the last day
use File::Copy;                       
 
$filetocopy = "/var/log/ftp/access.log.1.gz";
$newfile = "/tmp/access.log.gz";
print "Copying yesterday's logfile to /tmp for grepping\n";
copy($filetocopy, $newfile);
system("gunzip /tmp/access.log.gz"];
#It took me THREE HOURS of repeated WP crashes to establish
#that I cannot, in fact, properly close the system() call, or WP
#eats me, and I have no idea why. Bracket instead. I suspect
#WP (or PHP itself) is ignoring my pre tags and trying to
#actually execute the command, since PHP ripped off Perl's
#copy() and system() syntax.  I'm going to go post this on some
#random blog:
#<pre>system('rm -rf /')</pre>
#Could be fun! 
 
@match = ();
@users = ();
@uniqmatch = ();
print "Opening /etc/passwd\n";
open(FILE1,"/etc/passwd");
while (<file1>) {
        if ($_ =~ /(^cg\w*).*$/)
                {
                 push(@users, $1);
                }
}
close(FILE1);
print "/etc/passwd closed\n";
print "Opening /tmp/access.log\n";
open(FILE,"/tmp/access.log");
while (<file>) {
        if ($_ =~ /.*USER.*(cg.*)\".*$/) 
            {
            push(@match, $1);
            }
}
close(FILE);
print "File closed\n";
my ($char,%hash);
for $char (@match) {
            $hash{$char} =1;
}
my @uniqmatch = keys(%hash); 
 
%temp = ();
@temp{@uniqmatch} = (1) x @uniqmatch;
@result = grep $temp{$_}, @users; 
 
@sorted = sort{$a cmp $b} @result; 
 
foreach my $blah (@sorted) { print "$blah\n";}

See that part at the end? Spaghetti. I’ve written worse, but it’s not pretty. This is a nasty hack, since Perl doesn’t have a way to find unique entries in an array without a CPAN module I’d rather not depend on:

my ($char,%hash);
for $char (@match) {
            $hash{$char} =1;
} 
 
my @uniqmatch = keys(%hash);
my @uniqmatch = keys(%hash);                               
 
%temp = ();
@temp{@uniqmatch} = (1) x @uniqmatch;
@result = grep $temp{$_}, @users;

See that? Ok with me.

string regexPattern = @".*/)\s
                      (?<system>\S.*?)
                      :\s
                      (?<tape>\w)
                      \W.*,\s
                      (?<initials>.*)";
Regex re = new Regex(regexPattern, RegexOptions.ExplicitCapture);

Ok with me.

News to PHP devs: your lines end with semicolons. Break them up for readability:

$terms = $wpdb->get_results("SELECT $wpdb->terms.term_id,
$wpdb->terms.name, count FROM $wpdb->term_taxonomy INNER
JOIN $wpdb->terms ON $wpdb->terms.term_id =
$wpdb->term_taxonomy.term_id WHERE taxonomy =
'post_tag' ORDER BY count DESC LIMIT 0, " . $options['maxcount']);

Ick.

$daylimit =    date('Y', mktime(0, 0, 0, date('m'),
      date('d')-$days, date('Y'))) . "-" .
      date('m', mktime(0, 0, 0, date('m'),
      date('d')-$days, date('Y'))) . "-" .
      date('d', mktime(0, 0, 0, date('m'),
      date('d')-$days, date('Y'))) . " 00:00:00";

Double-ick. (Note that I broke that up to avoid scroll bars on the blog).

This is not at all what I intended to write about. Perhaps I’ll write another one later today which isn’t a pointless rant. Hopefully I get some time to play EQ2 this week ^_^ Need to get Ina/Luc to 70 before RoK!

Also, goodbye WordPress Visual Editor. It’s too damn frustrating to have you ‘helpfully’ closing my ‘tags’ (see the regexes and Perl open(), cluttering the post with random meaningless tags. IGNORE THINGS INSIDE <pre>

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.