Archive | Rambling RSS feed for this section

Are child themes the answer to the task of maintaining wordpress mu themes

20 Oct

Being between projects, I am amusing myself by trying to revive the deprecated “almost spring” theme as a child theme of k2. While working on it, suddenly it occurred to me that it might actually be a great idea to convert all the themes that I have at this wordpress mu installation to be children of the k2 theme. Done right it will mean that there is only one theme to upgrade and check when there is a new version of mu, and it will be a lot easier to write plugins which affect all the themes.

write a lot of code, add multitude of options, spice up the interface and win prize?

29 Sep

No disrespect to the efforts of the developers, and the solid reasoning of the judges, but in my humble opinion the winner of the 2009 wordpress plugin competition – the section widget which

provides a way to display section specific content on your WordPress sidebar with an easy to use interface. This new version comes with tabs support, so creating your tabbed section widget is just a few clicks away.

is not good enough to receive the prize.

I only needed to look at the screen shots to decide that I’m not going to recommend this plugin to any one

Who are going to be the users of this plugin? This screenshot alone displays more hardcore wordpress buzzwords than the “all I want is a simple blog” crowd understands, while it might be easier for the WP focused developers to simply add new sidebar for the places where the normal one is not good enough.

Oh, it even worse than that. When I want to hide a widget from the sidebar at a specific page, I just use CSS. It might not be the ideal solution as it wastes some bandwidth and CPU cycles, but your time is probably much more expensive than the cost of bandwidth and CPU.

In my opinion this type of contest should be decided on mainly two factors:

  • Does it solve a real life problem for many WP users
  • Can a non geek teenager use the plugin successfully without help

Based on this criteria, my favorites were

  • Advanced Export for WP and WPMU which solves the problem of exporting big blogs from shared hosting were you don’t have a direct access to the DB. I only wish there was also a simple way to automate the process.
  • One time password. In a world were we blog from a coffee shop via unsecured WiFi it is actually a security madness to use our password (which we probably use at other sites as well). A one time password is probably the best solution after installing an SSL for the blog. I wish it could have been integrated with the FTP server.

Suprising things no one bothered to tell me about custom 404 pages

27 Sep

I thought that 404 pages, which indicates that no content was found at the specified address, are about the most trivial aspect of the web, turns out I was wrong. A couple of weeks ago  a client asked me to add a 404 page to his WordPress theme, and since I like to leave as much control as I can at the hands of the site owner (reduces my headaches) I had to figure out how to integrate it into WordPress, and today I read one of the Firefox developers mentioning that he works on how Firefox should handle 404 pages.

I was surprised to learn that internet explorer and chrome will simply ignore your custom 404 page if it is shorter than 512 bytes, assuming that such a small message was automatically generated by the server and do not contain any useful information to the user. Therefor, if your 4040 page is shorter than 512, you should add some HTML comments to it to make it bigger.

Somewhat less surprising, but very interesting, is an article in a list apart which suggests that the 404 page should be dynamic with different pages served in different 404 contexts.

BTW: most WordPress themes serves what should be 404 pages as a 200 (success) pages. My solution fell into this trap too :(

Is there a proper moral way to treat wordpress related abandonware?

18 Sep

The ease with which you may create wordpress plugins and themes, combined with relatively long time of existence of wordpress, created a growing wave of abandonware (software which is not maintained by their legal owner, and sometimes it is not clear if they have one).

The bigger part of this abandonware are plugins and themes which were rarely used, and probably not many people are actually missing them, but one of my favorite themes “Almost Spring” have gone the way of the dodo and not only that it was not updated for a very long time, but now the blog of its creator has vanished as well.

I keep the source code of the theme and I would like to update it and release to the public, the question is how much should I follow the original licensing terms of the theme (even worse, there is no explicit license in the source files).  I prefer to release my code under a sort of BSD license, and I would like to remove the link to the creators site, as I don’t see any real reason to provide SEO for some unknown domain squatter.

The law is quite clear about it, and under the law I should preserve the original license. Yet I wonder, if there is no one to care enough to complain about me breaking the law, can I practically do whatever I wish with the code?

Never, ever blame your users – learn from their mistakes

14 Sep

The worm attack on pre 2.8.3 wordpress versions started a blame game between wordpress users and wordpress developers and core community.  While the users claim that although wordpress is great piece of blogging software, it is not the center of their lives, and it is ridiculous to expect them to check every day if there is a new version available, and dedicate instantly the time to perform an upgrade. The developers on the other hand, claim that it is the user’s responsibility to keep their wordpress updated whenever it is needed.

As I am a great believer in personal responsibility, I sympathize with the developer’s position – If a user can not spare the time to maintain their wordpress, they should consider opening a blog at wordpress.com, or other service of the same kind.  But then I think about how wordpress is being marketed, with its 5 minutes install, central repository of plugins and themes with a one-click install, and other very user friendly features. But surely this set of features attracts users which are less technically savvy and if they complain about the upgrade process it probably means that it is relatively complex, especially when comparing to other features of wordpress.

My understanding is that the main complaint is that the upgrade process might fail due to a plugin or theme which are not compatible with the new version. It is actually a serious problem when the development team wants to push out a new version every three months, which practically means that users have to spend time on upgrading and testing every three months. For non technical bloggers this might be a real pain.

What wordpress need is an upgrade path that is by definition more stable then upgrading to a new release. Maybe there should be support for older version for a year, in which a new minor update will be released for any security related problem. This way the users will be assured that the security upgrade will not break their plugins and themes, and they will be able to plan in advance when to upgrade to the latest and greatest release, when it is comfortable for them, and not when some wordpress dude says that you have to upgrade right now.

Even if it happens, there would be users which will not upgrade, but you can not force everyone to do the right thing ….

What is the meaning of “Real Time” for the web?

10 Sep

I have spent the first eight years of my software development career developing an embedded software for telecom devices. At that point of my life the term real time indicated for me a system that has to reliably and consistently perform a task in a very small a mount of time. For example switching from a faulty controller of a fiber to the backup should be done in less the 50 milli-seconds.

Later I wrote network monitoring software, and discovered the term “soft real time”. Soft real time is about the human perception of time and its granularity. User interface should respond to input in less than 5 second, if your software takes a second to respond that is good, but if it takes half a second, it is most likely that no one will notice the difference. If a router fails it is important to notify the on duty system administrator in no more than a minute, but since it will take him several seconds to just open is cellphone and look at the message, there is no much point to do extra work just to cut the notification time to one second.

Now people are talking about real time updates on the web. To have a meaningful discussion about it, and the proper ways to implement it, someone has to define what is the expected notification time and the longest time which can pass from the origination of a message until people are notified about it. Without a proper definition no one can objectively asses the pros and cons of methods to implement it.

WordPress translation scheme reached the end of its useful life

29 Aug

I was testing some wordpress optimization ideas which lead me into writing some profiling code which somehow lead me into installing alex rabe’s wordpress memory usage plugin. What especially caught my eye was the test that demonstrated that wordpress with german translation requires 6.5 Megs more then the english wordpress version. I have repeated his test with the hebrew translation and got a difference of about 4 Megs (the difference between the languages can be explained by the fact that german has notoriously long words or the hebrew translation is somewhat sloppy).

This just confirmed something that I have thought for quite a long time but hadn’t figured out how to quantify it. The problem with the wordpress translation process is that you translate the whole of wordpress and generate a single translation file which essential contains pairs of strings and their translation. Then you place your translation in predefined place and wordpress loads the whole translation pairs to the memory when the first string is being translated.

The problem with this approach is that as time passes by, the admin interface accumulates much more translatable strings then the front end functions. Of the ~3200 translatable string in wordpress I guess that no more the 400 are used when the actual HTML for the blog posts is generated. In other words, about 80% of the memory consumed by the translation will never be used for the work wordpress does for the 99% of the incoming trafic.

As if to demonstrate the problem, for version 2.8 the wordpress developers had split the translation file and created a unique translation file for the cities of the world, used when configuring time zone information, which is loaded only in one location in the admin interface and by that saved 400 string from loading at any other page of the site. But then, those strings where actually loaded when you reached that page, and with some help from inefficient PHP code, have caused an “out of memory” php error. The end result was that part of the page did not get displayed and since the error was not displayed, it was really hard to even understand what is the problem, and harder to find its cause.

The whole issue is not being helped by the fact that there is no way to use the PHP gettext module from wordpress without hacking the core. I don’t know how much it will be more efficient but since it is written in the C language it can theoretically use less memory and have a faster response time then the PHP implementation.

Ideal translation implementation will have a single translation file for a single uri, but this is currently far from being practical as it is hard to know all the possible execution paths just by looking and the code, and therefor hard to determine which translations will be required for each uri. Maybe some run-time adaptive algorithm which will compute the translation file while wordpress is executing will give the best approximation to the ideal.

Meanwhile, in the real world, the translation should be separated at least in to two parts – the front end, and the admin. This should be done either by moving all of the admin related string to reside under the wp-admin directory while the front end will be found only under wp-includes directory. Alternatively the wordpress release process should generate two POT files for the release by employing some internal knowledge on which files/strings should be used only at the admin, aknowledge which most of wordpress tranlators lacks.

While this will not necessarily solve the problem of the translation “nuking” the admin interface, it will at least reduce the memory consumption and improve CPU performance at the front end

Note: while caching plugins like super cache can be used to practically ignore this problem, not every shared hosting has the facilities to support it, and it has its own drawbacks which will prevent it from being a bullet proof solution (otherwise its place is in the wordpress core).

Update: Looks like I am not the only one who is bothered by the inefficiencies in the way the translation works. Johan Eenfeldt had created a plugin which provides caching to the parsed translation file. This might not solve my memory related problems (I will have to use the file cache option), but at least it is a performance gain.

Firefox 3.5 do not respect the cache size setting – limits it to 8192 files

29 Aug

There is an urban legend about bill gates of microsoft saying in the old DOS days that 640KB of RAM should be enough for everybody. It seems like someone in the mozilla organization is thinking along the same lines of thought, and while you actually have an option to change the amount of disk space which can be used by caching, the practical limits are not a lot higher then the default of 50MB as firefox, as the real limiting factor on the usage of the cache is an obscure technical decision to limit the number of files in the cache to 8192, a limit which is reached very easily today with all the small javascripts and images you get from every site.

The relevant bug contains a very small patch which probably solves the problems, but for sure normal users will not be able to set up the build environment required to build firefox, and even most of the geeks will have trouble doing so. In any case no one really wants to fork firefox just because of this bug….

So what can be done until the high console of mozilla will decide to solve this bug? Install a caching proxy!. Unfortunatly I could not find a nice small one in 5 minutes search on the net. All I have found were ad blocking non-caching proxies which are not interesting in this context :(

No twitts in the comments please

25 Aug

Although I think that I understand the possible value that twitter may have, I actually find that I don’t posses the hyperactivity traits needed to have a never ending real time communication, and actually maybe I’m not very communicative at all which results in me wanting to control the time and duration of the communication when I decide that I have to do it.

I used to be very negative about twitter*, but as time flows by even I find that there are some useful aspects for the service, the problem is that it is so over hyped and misused that even for people like me that are not interested in the commotion it is hard to ignore it.

The latest annoying twitter sightings in the WordPress world is in blog comments. For some reason people think that it is cool that people are twitting about their posts, and they are probably right. The problem is that comment are good for discussion and sharing information and sometimes they have a content which is actually more important/interesting then the actual post. Then you got trackbacks, which some WordPress themes relegate to the end of the comment section, and while they are not adding anything to the discussion they let the casual visitor from a search engine to explore other opinions on the topic.

Now comes the twittings as part of the comments. Like the trackbacks they do not add anything real to the discussion, but unlike the trackbacks they are relevant for no more than a day (at least I couldn’t find a reasonable way to follow a discussion on twitter which is more they a day old), so while at the first day from the posting they might add some value to the reader, for the casual visitor from a search engine they will be just a visual and bandwidth dead beef.

Conclusion: even if you enjoy the ego boost which comes from being mentioned by other people, do me (and maybe other people as well) a favor and make your comments section easier to read by cleaning up the twitts from time to time.

*One of my clients (web/social ad company) had a link to the twitter of one of its client which was kind of design firm. I asked once what is the purpose of the twitts? in what situation will it be helpful for a reader to have a real time announcement of something related to design? The answer I got was that maybe I’m wandering in the streets of tel aviv with nothing to do and the twitt will give me an idea. I was far from being impressed with this answer, but at least they have done it as part of their overall service and didn’t charge outrageous sums of money just to open a twitter profile. Wow, it seems like it was in the distant past, but this naive approach for advertising in twitter was articulated in 2008 :(

The not so awesome bar

25 Aug

I was very excited when the awesome bar was introduced in firefox 3.0, I thought that it will change the way I use my browser – no more automatic googling for sites in which I have been rarely before, but rather first doing a local search in the browser history which at least should be faster.

I was right. The knowledge of the existence of the awesomebar have actually changed the way I use the browser. I no more attempt to guess the initial character in the name of the site but rather some part of it, or an outstanding word in the title. On the other hand, the awesome bar caused me a lot of misery every time I have misspelled something which had no match in the history DB as it would practically freeze the input to the address bar while it was conducting its useless search.

FF 3.5.2 have changed things to the better, as even when there was no match the perceived responsiveness have improved*, but now mozilla guys have publicized an hack which improves the performance of the awesome bar by essentially optimizing its DB. This shows a really sloppy coding practizes by mozilla. If you are going to use a DB embedded in your product, you better have someone how understands the pitfalls of using such a DB. The obvious pitfall in this case is that from time to time the DB has to be optimized in order to have fast responses from the DB, which means in the embedded DB case, that the embedding software have to do the cleanup automatically.

I have read some excuses about the optimization taking long time in which the GUI is frozen, but those are mere excuses as the optimization can be moved to the background as most of the time the browser is just seating idle, or to the startup or shutdown parts of the code. In the worst case FF should at least try to use some heuristic to calculate if an optimization is required and prompt the user that it is about to run one. I find it hard to believe that anyone will complain if this will happen once in two months as upgrades to new dot releases are being pushed in a higher frequency (and maybe it should be combined?) and I haven’t heard any complains about that.

* As a side note, I think that with FF 3.5 mozilla got away without getting the amount of criticism that a commercial company would get for releasing an uncomplete product. 3.5.2 solved a major usability bugs of the awesome bar and the startup time, bugs which were surly known at the time 3.5 was developed but waited another two “dot” releases to be at least partially fixed.