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
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,
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
How to Use “Procedure Analyse” to Optimize MySQL Table Size
MySQL provides a useful tool called “procedure analyse” that can help you optimize your tables for storage. “Procedure analyse” examines the contents of a table’s columns and suggests a field type for each column selected that reduces the total table size.
So, why bother to reduce table size when storage is cheaply available? Big tables not only use up memory, but queries on them eat up CPU usage as well. If you have a web site with large custom MySQL tables and your site is on a shared server, you could end up getting penalized monetarily or even have your site shutdown by your ISP, if queries on your MySQL tables consume more CPU than allocated. To keep this from happening you should optimize both your queries and your table size. “Procedure analyse” provides a quick and easy way to do the latter.
Initial tests of “sleep()” were successful, however, I soon discovered that most browsers will interrupt “sleep()” and show a “Slow/Busy script” dialog message whenever the “naptime” argument is greater than 10 seconds (7 seconds in IE). Trying to work around this problem was too much effort, so I left the script as is. If you use this function, I recommend a “naptime” of less than 10 seconds so your site visitors won’t encounter this “slow script” dialog message.
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.
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.
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.
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.
Soon after I upgraded to WordPress 2.6, I discovered that the WordPress' dashboard and post/page editor cause the Safari 1.3 browser to crash. Though other WordPress 2.6 admin functions continue to work fine in Safari 1.3, including the widget functions, without the Dashboard, users can’t login, and without the post/page editor, users can’t update their blog. This makes WordPress 2.6 completely unusable in Safari 1.3.
A quick search of the forums showed that this problem has cropped up for other WordPress users and that it may extend to Safari 2 as well. Here what one user had to say on wordpress.com forums.