Review of PHPMyAdmin 3.4

A few month ago I needed to install PHPMyAdmin on my new Macbook Pro. At that time, PHPMyAdmin 3.4.3 just released. After installing PHPMyAdmin 3.4.3, I immediately noticed the theme and user interface changed. At first, I welcomed the change. The new theme, pmahomme, was clean and modern. So dramatic that someone asked what I used during a demo in my talk at WordCamp Chicago.

Unfortunately the euphoria was short lived. The user interface changes soon outweighed the new theme. With due respect to the “reluctance to change” and “learning curves”, I question some of the decisions made in PHPMyAdmin 3.4. Here’s my quick list the UI pros and cons of PHPMyAdmin 3.4.3. Let me disclaim that I use PHPMyAdmin as a development tool.

PHPMYAdmin 3.4 Pros

  • Faster response times. In addition to undoubted PHP optimizations, the combinations of jQuery and CSS make the UI much faster.
  • Inline query editing. While the pop-up window works, this UI is much more streamlined. Probably the single best feature.
  • Create table button in table list. Before you had to go to the database home page (or Operations), scroll down, and add a table. PHPMyAdmin 3.4 could go further, having this button at the top and bottom (for large table lists).

PHPMYAdmin 3.4 Cons

  • Removal of Empty and Drop tabs from table navigation. While I appreciate these are not technically navigation options, burying them under Operations was not the right move. If nothing else, taking features away is always a dangerous game. I have to say PHPMyAdmin lost me on this one. As a developer, these actions, particularly Empty are incredibly common.
  • Hiding of Export options. Instead of displaying all options, like previous versions, the UI is now that of a decision tree. In addition, the options themselves changed. Again, this is an often used feature for me. I could export unconsciously in previous versions. It seems, even after months, I’m continually scanning the options in PHPMyAdmin 3.4.

All in all, it appears that PHPMyAdmin 3.4 caters to new users. I suppose you can’t fault them for appealing to the masses. Yet for my usage the cons of PHPMyAdmin 3.4 outweigh the pros. Although I’ll probably stick with it on my personal server, I have left PHPMyAdmin 3.3 on our work servers. Those extra clicks spread across 4 developers add up. As far as the new features, well, ignorance is bliss.

CakePHP Auth Component loginRedirect Behavior

The other day I noticed some unexpected behavior for one of the web applications I developed in CakePHP using the Auth Component. After logging in, I was redirected to my previously visited page. This would be expected had my session expired or I needed to log in first. However, this occurred after logging out of the web application.

After debugging the login() and logout() actions I noticed that Auth.redirect was not being cleared from the session. I inspected the core file for the Auth Component (auth.php) to see when Auth.redirect updated. It turns out that the startup() method had some interesting code.


if ($loginAction == $url) {
  // ...
  if (!$this->Session->check('Auth.redirect') && !$this->loginRedirect && env('HTTP_REFERER')) {
    $this->Session->write('Auth.redirect', $controller->referer(null, true));
  }

The interesting piece is the inclusion of $this->loginRedirect. According to the documentation:

The AuthComponent remembers what controller/action pair you were trying to get to before you were asked to authenticate yourself by storing this value in the Session, under the Auth.redirect key. However, if this session value is not set (if you’re coming to the login page from an external link, for example), then the user will be redirected to the URL specified in loginRedirect.

Yet, according to the code above, $loginAction sets Auth.redirect unless it or loginRedirect is set. I added the following code to my Auth Component configuration:

'Auth' => array('autoRedirect' => false, 'loginRedirect' => '/', …

After doing so, I expected that the Auth Component would no longer remember the requested URL if I was not logged in. But, contrary to the documentation, I was still redirected when attempting to access a secure area of the site before logging in.

Honestly, my head exploded on this one. I’m still a little fuzzy on loginRedirect. But here’s my two cents. The original issue only occurred after logout. Since logout redirects to loginAction, the referrer was the previously requested page. Although logout() cleared Auth.redirect, the code above stored the referrer in Auth.redirect. Upon setting loginRedirect, the logic above failed. Since this code only runs when $loginAction == $url, it does not prevent Auth from remembering the requested URL when it matters.

I find many developers dislike the Auth Component. Whether it’s too complex or not enough features, I don’t know. What I do know is there is value in using native functionality. So, to be clear, this post is about the unclear documentation for the loginRedirect property and not bashing the Auth Component.

My Talk at WordCamp Louisville: Configuring WordPress for Multiple Environments

First, a thanks to everyone that attended WordCamp Louisville 2011 and my talk – Configuring WordPress for Multiple Environments. Second, I’m sorry for any disorganization during my talk. I was informed minutes before the opening remarks that I moved from the first talk after lunch to the first of the day. In addition, my session shrank from 45 minutes to 25 minutes due to the late start. Either put any speaker in a tough spot. I like to tempt the speaker gods by adding several demos to my talk. Unfortunately I was not prepared for my first demo and had to cut others. I take my share of the blame on preparedness. However, I think everyone in attendance noticed that the schedule, if nothing else, was disorganized.

With that said, I wanted to share the resources for my talk. As this was more or less the same talk I gave at WordCamp Chicago, I’ve provided some links to that material to avoid duplication. You can find the slides on SlideShare. Code samples of the wp-config.php files and using environment constants taken from my WordCamp Chicago post. Finally, the original post leading to this talk can be found on the VIA Studio blog titled Configuring WordPress for Multiple Environments.

After the talk I received several questions regarding migrating the database between environments and handling absolute URLs. This seems to be a continual pain point. I’ve put it on the list to write a post or possibly develop a WordPress plugin. Look for more information here or the VIA Studio blog in the coming weeks.

I welcome your feedback and questions regarding my talk. Speaking is a recent development for me. I find it rewarding and look forward giving more talks at future WordCamps. I also enjoyed meeting everyone that stopped by the “Genius Bar” hosted by VIA Studio and the after party at the BBC. Please feel free to contact me or us at VIA Studio. Also, if anyone took any photos during my talk I would appreciate a copy.

I’m Speaking at WordCamp Louisville

I’ll be speaking at the 2011 WordCamp Louisville this Saturday, October 1st. This will be my third time speaking at WordCamp and second time for this talk – Configuring WordPress for Multiple Environments. I gave this talk as well as moderated two unconference sessions in June at WordCamp Chicago. It was a very rewarding experience and I look forward to speaking again.

Here’s the talk synopsis:

WordPress boasts a “5 minute install”. This is great for simple sites running only in a production environment. But if you’re using WordPress as a development platform or following a software development life cycle things become a little tricky. This talk will cover ways to migrate WordPress between different environments smoothly, including: code, database, and environment specific tasks. Although some aspects of the talk may be advanced, there will be demos, code samples, and time for Q&A. So if you use WordPress in more than just production, this talk’s for you.

In addition, VIA Studio (my day job) will be the title sponsor for WordCamp Louisville. So I’m also running a “Genius Bar” with my team. We’ll be available to answer any user or development questions you may have about WordPress. I know I go to a conference hungry for answers to very specific questions. Hopefully this WordPress “Genius Bar” provides that, and of course drums up some business.

Register for WordCamp Louisville. It’s only 15 bucks!

Installing siege on Mac OS X Lion

I am not a system admin or *nix guru. So configure-ing, make-ing, and installing applications from the command line remains intimidating. I did what most people would do – went to Google and searched for “installing siege on mac os x”. Top result looked promising. I copied step 1 to the command line. Error. Not sure if it was because the article was for Mac OS X Snow Leopard and I am on Mac OS X Lion or if I was missing a dependency the author pre-installed. Either way, if step 1 fails, it’s time to move on.

To step back, siege is an http load testing and benchmarking utility. Lately I’ve taken a strong interest in benchmarking my web applications. Mainly because I am developing APIs and using WordPress (which is notorious for being slow under server load). Although ab (Apache Benchmark) comes bundled with apache (which is preinstalled on Mac OS X), I’ve been hearing a lot about siege at conferences. As any good developer should, I wanted to tinker with it myself.

Installing siege

  1. Open the Terminal app
  2. Download the latest version of siege (currently 2.70)
    curl -C - -O http://www.joedog.org/pub/siege/siege-latest.tar.gz
  3. Extract the tarball
    tar -xvf siege-latest.tar.gz
  4. Change directories to the extracted directory (again, currently siege-2.70)
    cd siege-2.70/
  5. Run the following commands (one at a time) to build and install siege. If you have an older version of siege read the INSTALL file for more instructions.
    ./configure
    make
    make install

This installed siege to /usr/local/bin/. This should already be in your PATH, so type:

siege 

You will be presented with a message that instructs you to generate a siege configuration file for your account.

siege.config 

Now you can run siege. The following sends a 10 requests across 10 concurrent connections for benchmarking (no delay between requests).

siege -c 10 -r 10 -b http://jason.pureconcepts.net/ 

If you want to learn more about configuring or using siege type siege -h or visit the siege manual.