Plugin Sale! Save 15% on pro plugins with discount code: FALL2020
Web Dev + WordPress + Security

New Version of Category LiveBookmarks Plus for WordPress 2.3

Category LiveBookmarks Icon
CLB+
As many WordPress users now realize, there have been many fundamental changes in the new version of WordPress. The latest version of WordPress — 2.3 — features a considerably revamped database structure, including a complete reorganization and redistribution of the wp_categories table. Unfortunately, such database alterations have rendered inoperable many popular plugins, proving quite unfortunate not only for millions of WordPress users, but also for those of us who donate time, effort, and resources toward the development of freely available WordPress plugins.

Tough decisions

Thus, with the advent of WordPress 2.3, developers whose plugins have ceased to function must now decide whether or not to continue their support. In my humble opinion, philanthropic plugin developers have several choices:

  • Continue plugin support by sacrificing additional time and resources for yet another questionable WordPress upgrade.
  • Discontinue plugin support for WordPress 2.3 and the potentially infinite number of impending WordPress upgrades.
  • Drop WordPress completely and embrace a less-ambitious, more-stable blogging/CMS platform.

..and not necessarily in that order ;) Nonetheless, I remain an ardent supporter of WordPress, and will continue supporting my plugins (and themes, for that matter) for as many WordPress upgrades as I can stomach. For now, although I refuse to upgrade Perishable Press to WordPress 2.3, I have taken the time to install and configure a special 2.3 “test site” for the purpose of testing and upgrading my favorite plugin, Category LiveBookmarks Plus, which is (as far as I know) the only one of my five plugins that was broken by WordPress 2.3. As suspected, the restructuring of the wp_categories table made it impossible for CLB+ to query and process the data required for it to function.

Working solution

After investigating the new database structure of WP-2.3, I noticed several changes needing addressed in order to restore proper CLB+ functionality. Specifically, WordPress 2.3 employs the following database changes:

  • categories is now terms
  • cat_ID is now term_ID
  • cat_name is now name

Following the implications of these changes to the old version of the CLB+ plugin, we notice the sudden ineffectiveness of the core database query:

$query  = "
	SELECT cat_ID, cat_name, category_count, category_nicename, category_description, category_parent
	FROM $wpdb->categories
	WHERE cat_ID > 0 AND category_count > 0 AND category_parent = 0
	ORDER BY cat_ID ASC
";

That works fine for all pre-2.3 WP-versions, but needs to be completely rewritten in order to work properly with WordPress 2.3 (and subsequent versions):

$query = "
	SELECT * FROM $wpdb->term_taxonomy 
	JOIN $wpdb->terms ON ( $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id ) 
	WHERE $wpdb->term_taxonomy.taxonomy = 'category' 
	AND $wpdb->terms.term_id > 0 AND count > 0 AND parent = 0 
	ORDER BY $wpdb->terms.term_id ASC";
";

Fortunately, after modifying the main database query, the remaining code fell into place quite nicely. In fact, while implementing the changes required for the WP-2.3 upgrade, I found myself rethinking and rewriting a large portion of the CLB+ script. The new plugin functions flawlessly with WordPress 2.3, requires fewer system resources, and generates improved (X)HTML markup. The overall result is the cleaner, faster, more efficient generation of a completely customizable set of category and feed links.

To download Category LiveBookmarks Plus, visit the CLB+ homepage.

Jeff Starr
About the Author
Jeff Starr = Designer. Developer. Producer. Writer. Editor. Etc.
USP Pro: Unlimited front-end forms for user-submitted posts and more.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
.htaccess made easy: Improve site performance and security.
Thoughts
Watching. Waiting. Praying.
Got all of my free WordPress plugins updated for imminent WP 5.6 in early December. Pro plugin updates currently in the works.
7G Firewall now integrated into BBQ Firewall (free version). Pro version soon ;)
macOS Big Sur update complete. So far no crazy issues. Except TextEdit, which is completely screwed up and unusable. Replaced with free BBEdit.
Got so sick of macOS’ annoying “red dot” that I had to remove System Prefs from the dock. Come on Apple you can do better.
Beginning development of an Nginx version of 7G Firewall.
Happy Birthday to Perishable Press, celebrating 15 years online! :)
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.