Seamless WassUp Upgrading

Precautionary Steps for a Seamless WassUp Upgrade

WassUp Screenshot
In the newest WassUp WordPress plugin update (v.1.8.1), there is a precautionary notice about upgrading. This notice says that you should not upgrade if your site is busy. That is, you should check the number of current visitors online before upgrading and, if there are more than one regular visitors or multiple spiders online, don’t upgrade!!

WassUp is different from most plugins because once it is enabled it starts working and never stops until it is disabled, deactivated or your site goes down. Every visitor click, every spider hit, every search, and every feed request triggers WassUp to write data into it’s tables. The more popular your site is, the more data WassUp has to write in order to track visitors browsing your site.

An upgrade during a busy time for your site increases the odds that WassUp will be interrupted in the middle of a write operation. That kind of interruption can cause file corruption or can leave a permanent lock on WassUp tables. If that were to happen, WassUp would stop all new recordings until the lock is cleared or until ‘wp_wassup’ table is repaired. Note that this only affects WassUp, not WordPress itself, so your site would remain functioning.

If your site is always busy or you just can’t wait to upgrade, I recommend that you temporarily “disable recording” in WassUp >> Wassup-Options, [Statistics Recording] Tab, or put your site into “maintenance mode” prior to doing the upgrade. If you do this, always remember that you will have to manually re-enable recording or undo maintenance mode page when you have done upgrading.

For a seamless upgrade every time, always check the plugin’s “Installation” instructions at http://wordpress.org/extend/plugins/wassup/installation/ for any new installation/upgrade procedures that could affect your copy of WassUp.

WassUp Works Well with WP Widget Cache

WassUp users looking for ways to speed up their site or blog should try WP Widget Cache plugin.

WP Widget Cache plays nicely with Wassup because it caches only the widgets on a page and does not affect other code in the document. It caches sidebar and footer widgets and allows you to customize cache settings for each widget individually. According to the author, you can achieve up 70% improvement in your site’s performance with this plugin. After installing it on my own blog and setting a cache timeout of 24 hours (86400 seconds) on all static widgets, I saw a impressive improvement in load speed, myself. Continue reading

A Fix for "get_currentuserinfo undefined"

How to Fix the Fatal Error “get_currentuserinfo() undefined” in WordPress

If you write a WordPress plugin that calls the function “get_currentuserinfo()”, you should be aware that this could trigger the fatal error, “get_currentuserinfo undefined’, in some WordPress configurations. Depending on what your plugin does, this error could impact a WordPress site’s display, so it is important to prevent it from ever happening.

One fix (as published by several WP bloggers) is to edit your plugin to add the code, include "/wp-includes/pluggable.php", manually before you call “get_currentuserinfo()” (or other WordPress user functions). This methods works in most cases, but it runs the risk of causing an irreconcilable conflict with any membership or user management plugins that may be installed on the same site.

A better fix is to include a priority argument with your plugin hook function to make sure that it loads into WordPress after any membership/user management plugins and after “pluggable.php” loads. Continue reading

Horizontal Submenus for WordPress Admin Plugins

How to Add Horizontal Submenus to Your Administration Plugin in WordPress 2.7+

With the launch of version 2.7 in December 2008, WordPress added several new features and changed its user interface (UI). I especially like the new automatic update feature and the new vertical sidebar is sleeker and more modern looking. However, I find navigating the menus on that new sidebar to be very inefficient when administration plugins add more selections to it. [Wordpress screen shot]
Image #1: Plugin with sidebar menu

As an admin plugin author, I want my users to have easy access to my plugin menu and submenus. In WordPress 2.2 to 2.6, the built-in menu functions accomplished this with horizontal menus at the top of the page. In 2.7, however, the same menu functions now place the plugin menu (and submenus) near the bottom of the page, in the sidebar. This makes navigation more cumbersome because plugin menus are positioned outside the initial viewing area of the screen in a typical 1280×800 browser window. The user has to scroll down to select the plugin and, after the plugin is selected, scroll down again to navigate the plugin’s submenus. Worse, it not always obvious that there are submenus available for a plugin. You can see an example of this in image #1 where the green line indicates the end of the window area of a 1280×800 resolution browser window.

To workaround this problem in my own admin plugin, I inserted a new horizontal menu containing the submenu links at the top of each submenu page. plugin menu screen shot
image #2: Plugin with horizontal menu
To keep the look consistent with WordPress' new style, I positioned the menu inline with the “contextual help” button and also adopted it’s “look and feel”. This was a relatively simple task to do, once I located and copied the appropriate styles from WordPress' admin stylesheets. You can see an example of this new horizontal menu in the second image to the right.

Continue reading

A Simple Fix for "Simple Tags"

I am not an official WordPress tester, but to keep up with the latest changes and to make sure my own plugins are always compatible with upcoming versions of WordPress, I run WordPress development version on this site.

There are several plugins installed on this site that end up also getting tested for compatibility with upcoming versions of WordPress, although that is not my intention. Wassup, cFormsII, Bad Behavior, and Akismet all run successfully on WordPress 2.7 development version . One plugin that failed was Simple Tags version 1.5.7 by Amaury Balmer. This plugin produced an error because of a test in the code that rejects unrecognized versions of WordPress.

Fortunately the fix was simple. It only required that the version test be replaced by one that tests for current or higher version of WordPress. I modified the code myself and now “Simple Tags 1.5.7a” runs on 2.7-dev.

Continue reading