Fall Sale! Code FALL2024 takes 25% OFF our Pro Plugins & Books »
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.

About the Author
Jeff Starr = Fullstack Developer. Book Author. Teacher. Human Being.
Digging Into WordPress: Take your WordPress skills to the next level.
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 »
BBQ Pro: The fastest firewall to protect your WordPress.
Thoughts
I disabled AI in Google search results. It was making me lazy.
Went out walking today and soaked up some sunshine. It felt good.
I have an original box/packaging for 2010 iMac if anyone wants it free let me know.
Always ask AI to cite its sources. Also: “The Web” is not a valid answer.
All free plugins updated and ready for WP 6.6 dropping next week. Pro plugin updates in the works also complete :)
99% of video thumbnail/previews are pure cringe. Goofy faces = Clickbait.
RIP ICQ
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.