Another one in the series of “… hates developers” is WordPress. I’ve been messing with it since I installed 2.0 to power this blog. I’m not happy.
As the title already states I’m not saying that WordPress is bad for the common visitor or even the common user/author. Yes, it has some problems but they don’t even come close to what it has to offer to the power user. If you’re trying to create a plugin that does something they didn’t expect you’re out of luck. That, or the documentation sucks as hell.
To elaborate I’d like to share a bit of it’s code from template-functions-general.php:
function get_post_time( $d = 'U', $gmt = false ) {
global $post;
if ( $gmt )
$time = $post->post_date_gmt;
else
$time = $post->post_date;
$time = mysql2date($d, $time);
return apply_filters('get_the_time', $time, $d, $gmt);
}
As you can see getting a time when you’re not in the main post loop (that sets the global $post) is a bit weird. You have to set a global variable post and then run this thing. You should probably know that this is not the method that is usually called from the templates – that’s the_time that calls get_the_time with a filter, get_the_time retrieves the time_format setting and it calls get_post_time.
Another great thing is getting an author of the post. I gave up end wrote my own sql statement. I don’t like it and if there’s another way please tell me – template-functions-author.php doesn’t tell me anything useful. The global object $authordata is just too much.
I understand that this kind of code gets into version 1. I can’t understand how it gets into version 2, especially when they said they improved abstraction in this version. OK, I can understand the focus – first the users, then the writers, hopefully now the developers. So my proposition for version 3 is a complete rewrite of the backend to something more API-ish so we (plugins and the core) can use the same built-in API for most of the stuff.
[…] WordPress targets at end-users and public, therefore it is committed to providing easy-to-use features and clean layout. Being too concerned about end-users, WordPress has neglected developers, who is eventually in charge of sustaining its friendliness, security and fueling its technological evolution. There are a quite few complaints about WordPress. I’ve read through WordPress source code (version 2.3.0 & 2.3.1), fixed themes, plugins and really dislike the mess and lack of professionalism of the coding style. Mixing HTML, JS and PHP code is never fun. HTML is nested inside PHP loops, control statements. There are numerous plugins which require modification of theme files in order to be displayed (say Counterize). To make the things worse, some plugins even exploit HTML comments <!– blah blah –> in order to work. […]