WordPress.org

Ready to get started?Download WordPress

Is your plugin Naughty or Nice?

Posted December 11, 2006 by Matt Mullenweg. Filed under Development.

Guest article by Aaron Brazell

WordPress 2.1 is almost here and you know what that means for developers. It’s time to pull out those old plugins you’ve had stashed, blow off the dust and start applying some spit and polish and make sure it will last longer than Grandma’s Ham and Bean soup that has been sitting in the refrigerator for weeks.

Many of the big changes in WordPress 2.1 are MySQL related so grab a pen and paper (or open Notepad) and start taking notes.

  • The $table* variables have all been eliminated. They have not been deprecated as doing so would mean that the variables are still present but developers are no longer encouraged to use them. In this case, they have been removed from the core. When you’re developing plugins that contain SQL statements, ensure you globalize $wpdb, and call tables using $wpdb->posts, $wpdb->post2cat, etc. Likewise, the former $table_prefix variable that developers could globalize before to find the MySQL table prefix defined in wp-config.php has also been deprecated in favor of $wpdb->prefix.
  • Developers using the former linkcategories table should be aware that link categories are now part of categories. They are simply given another category ID and are not maintained separate from post categories.
  • The posts table now has a column of post_type that should help developers distinguish between posts and pages.
  • Future posts now gain the post_status of ‘future’ which eliminates the use of NOW() in all queries in the core. Plugin developers should follow suit.

WordPress 2.1 is nearing the time when the codebase will be released for testing, but it’s not too early to get those plugins and themes tweaked for the release. There is a Codex page where plugin compatibility is being tracked as well.

Editor’s note: If you stick to the WP APIs as much as possible you won’t run into plugin upgrade issues like this.

No Pings

RSS feed for comments on this post.

  1. Llamada a actualizar los plugins de WordPress

    Ante la "inminente" salida de WordPress 2.1, recomiendan a los desarrolladores que actualicen sus plugins para asegurarse de que no se rompan con la nueva versión. Los cambios tienen que ver con la estructura de la base de datos. Y se recuer…

    Trackback from meneame.net on December 11, 2006

  2. [...] Nachdem ich heute den Artikel vom Development Blog gelesen habe, musste ich ein wenig schmunzeln, denn genau das habe ich ja schon selbst erfahren… [...]

    Pingback from Erklärt sich von selbst at Insanity On Stage on December 11, 2006

  3. [...] Drüben bei WP.org gibt’s einen Gast-Beitrag von Technosailor Aaron Brazell, der ein klein bisserl outlined, was sich in WordPress 2.1 ändert. Vor allem geht er darauf ein was ihr (Plugin-Entwickler) ggf. ändern müsst, damit Eure (achtung schlechter Übersetzungswitz) Einstöpsler auch weiterhin funktionieren. [...]

    Pingback from Blogschrott - » WordPress-Plugin-Developer hergehört on December 11, 2006

  4. [...] It looks like WordPress 2.1 is getting closer to being out the door… The WordPress Development blog just made a post to suggest the plugin authors check their code to make sure if it’s naughty or nice. Well, Upcoming Events is somewhere in between. I followed the instructions on WordPress’ site for creating tables in the database which said to use $table_prefix in order to get the configured prefix (wp_ by default). It seems, however, that I should actually be using $wpdb->prefix instead. Fortunately, $table_prefix is just depreaciated, not eliminated so even version 0.1 of Upcoming Events is WordPress 2.1 ready. Upcoming Events 0.4, when it comes out, will use the shiny new $wpdb->prefix interface. Filed under: Computers, WordPress, upcoming-events, Shoveled by Jake at 3:23 pm | so far [...]

    Pingback from Jake’s Weblog » Upcoming Events and WordPress 2.1 on December 11, 2006

  5. [...] Is Your Plugin Naughty Or Nice?: With WordPress 2.1 on the way, developers had better look sharp… and make their plugins look sharper. Although the first plugins for the upcoming WordPress version are sure to be buggy, I believe there’s a lot in store. [...]

    Pingback from Weekly Tech Links » Link Dump XX on December 11, 2006

  6. [...] With WordPress 2.1 coming out in a month or so, it’s time for plugin developers out there to make sure their plugins are compatible with it. Check out the official WP blog for details. [...]

    Pingback from Viper007Bond.com » Blog Archive » Plugin Developers: Make Sure Your Plugins Are WP 2.1 Compatible on December 11, 2006

  7. [...] La versione 2.1 di WordPress è prossima al rilascio. In attesa del rilascio definitivo, il team di sviluppo segnala agli sviluppatori di Plugin alcuni importanti cambiamenti nel funzionamento della piattaforma. [...]

    Pingback from WordPress 2.1 e lo sviluppo di Plugin « Studio404 Blog on December 12, 2006

  8. [...] The announcement came some 7 hours ago through WordPress dashboard. A guest blogger Aaron Brazell wrote in the WordPress Development blog (Is your plugin Naughty or Nice?) noting some major changes. Most changes mentioned are at the MySQL level, making it vital for existing developers to change if they would like their plugins to be compatible with WordPress 2.1. [...]

    Pingback from crackjet.com - Technology Life Journal » Plugin developers buckle up for upcoming WordPress 2.1 code change on December 12, 2006

  9. WordPress 2.1 beta 即将来临

    今天在WordPress官方blog的一篇文章中,Matt提到WordPress 2.1即将公测,但是一些插件可能不能跟上节奏。官方并提供了一个插件兼容跟踪页面,在里面发现了Brians Latest Comments,上次试用2.1 Alphaçš„æ—…

    Trackback from Nicky's blog on December 12, 2006

  10. [...] If you have a plugin, it’s time to make sure it works with 2.1. Go read some of the tips I’ve given and feel free to add your own if you have any. [...]

    Pingback from Is Your Plugin Naughty or Nice? » Technology, Blogging and New Media on December 12, 2006

  11. WordPress 2.1 Database Changes

    Some notable changes have been made in WordPress 2.1 in they way developers interact with the database. There’s a post over at the WordPress development blog that discusses some variables that have been removed, and the addition of a “futu…

    Trackback from T. Longren on December 12, 2006

  12. [...] 今天wordpress博客上说,wordpress2.1即将出台,同时列出了一些与wordpress2.1兼容的插件。 WordPress 2.1 is almost here and you know what that means for developers. It’s time to pull out those old plugins you’ve had stashed, blow off the dust and start applying some spit and polish and make sure it will last longer than Grandma’s Ham and Bean soup that has been sitting in the refrigerator for weeks. WordPress 2.1 is nearing the time when the codebase will be released for testing, but it’s not too early to get those plugins and themes tweaked for the release. There is a Codex page where plugin compatibility is being tracked as well. [...]

    Pingback from 期待wordpress2.1的公测 | iF20:天真。天眞的我们必然幸福。 on December 12, 2006

  13. [...] One feature that I would love to see in any future WordPress release is the capability to mark posts as asides, as seen on many blogs. Will WordPress 2.1 have an asides feature built in? The latest development blog post mentions changes to how links are dealt with, but I doubt that this extends to a new asides feature. [...]

    Pingback from Shining Wit » Aside on December 12, 2006

  14. [...] His intriguing title “Is Your Plugin Naughty or Nice?” features a guest article by Aaron Brazell informing developers to ensure plugin compliance with WordPress 2.1 which is ‘almost here’. [...]

    Pingback from Imminent Launch of WordPress 2.1? at Andrew Wee | Blogging | Affiliate Marketing | Social Traffic Generation | Internet Marketing on December 12, 2006

  15. [...] Das anstehende Update auf WordPress Version 2.1, hier wurde darüber berichtet, ist nicht mehr weit und nun gibt es einige Veränderungen für Pluginentwickler. Es müssen also in Zukunft alle bestehenden Plugins nach dem aktuellen Codex erstellt sein. Einen Beitrag dazu gibt es vom Gastautor Aaron Brazell auf wordpress.org. [...]

    Pingback from WordPress v2.1 und die Veränderungen für bestehende Plugins - bueltge.de [by:ltge.de] on December 12, 2006

  16. [...] Says WordPress blog. And asks plugin developers to update their plugins as per the guidelines given in Is your plugin Naughty or Nice? post. [...]

    Pingback from Net 2.0 » Blog Archive » WordPress 2.1 is almost here on December 12, 2006

  17. [...] Según se anunció horas atrás en el sitio de WordPress, el lanzamiento de la versión 2.1 de este sistema de blogs supondrá la actualización de los plugins. Muchos de los cambios de la nueva versión tienen que ver con la estructura de la base de datos, por lo cual los desarrolladores de plugins deberán tomar nota sobre como recorrer el contenido de las tablas. [...]

    Pingback from Thuer.com.ar » Llaman a actualizar plugins ante la salida de WordPress 2.1 | Comunicación multimedia, diseño web y tecnología on December 12, 2006

  18. WordPress 2.1 Yakında!

    Gün geçtikçe gelişen WordPress’in yeni sürümü olan WordPress 2.1′in kokusu gelmeye başladı. Zaten WordPress deneyicilerine (tester) önceden dağıtılmış olan ve hataları bu şekilde kapatılan 2.1 sürümündeki bazı değişi…

    Trackback from yakuter on December 12, 2006

  19. [...] Azért mekkora cink már, hogy ezer dolog változik az új WP verzióval, mármint pluginek és bővítés terén. Még nem érkezett komment. Szólj te is hozzá! [...]

    Pingback from suexID blog - Tokio Hotel fan vagyok on December 12, 2006

  20. [...] Na bent jau taip rašo jo kūrėjai. Kažkaip labai nekantraudamas nusprendžiau parsitemti is cvs`o dabartinę WordPress 2.1 Alpha versiją ir pasižiūrėti kas gi gero laukia mūsų jau visai netrukus.. [...]

    Pingback from WordPress 2.1 is almos here « Vaidotas Internete. on December 12, 2006

  21. [...] UPDATE: Forgot to add – test it with WordPress 2.1 [...]

    Pingback from Peter Upfold » Blog Archive » WPGet 0.7 - your input wanted on December 12, 2006

  22. [...] It’s hard NOT to notice that guest article in the dashbaord of every friggin blog that I’ve updated today by Aaron Brazell on the WordPress Development Blog. Since Aaron shares the first name with my father .. I’ll give him a link out and congrats with that. It sure beats the old 46 day old Ronan WordPress 2.0.5 notice. I actually wanted to read Aaron’s article! [...]

    Pingback from HART-Empire.com » Quickies - December 12, 2006 (HART-EMPIRE NETWORK) on December 12, 2006

  23. [...] 完整的說明可以參考 WordPress 開發 Blog 上的 Is your plugin Naughty or Nice? 這篇。 [...]

    Pingback from WordPress 的資料庫架構更新 at Gea-Suan Lin’s BLOG on December 12, 2006

  24. [...] With WordPress 2.1 (current version is version 2.0.5 Ronan), the major changes are MYSQL changes, as pointed out here. [...]

    Pingback from Scarform.com » WordPress 2.1 on December 13, 2006

  25. [...] [2006-12-13 補充]  WordPress 官方說法:”Is your plugin Naughty or Nice?” [...]

    Pingback from William’s Blog » Blog Archive » WordPress 2.1-alpha 外掛相容性問題 on December 13, 2006

  26. [...] O stire prezenta in dashboard-ul oricarui bloger ce folosesc WordPress observ ca a trecut oarecum neobservata. Ma refer la stirea ce spune ca in curand va incepe perioada de testare a pluginurilor pentru a le face compatibile cu versiunea 2.1 de WordPress. [...]

    Pingback from WordPress 2.1 aproape gata at E-Utile.Ro - IT proaspat on December 13, 2006

  27. [...] Se sviluppate plugin per WP vi consiglio di leggere questo post e di iscrivervi alla mailing-list wp-hackers per tenere traccia di tutte le future novità. Ah, già l’attuale lista di compatibilità dei plugin è qui: Codex: Plugin Compatibility [...]

    Pingback from Full(o)bloG » Blog Archive » WordPress 2.1 cambia API on December 13, 2006

  28. [...] December 13th, 2006 @ 22:09 by Mike It seems that WordPress 2.1 will be here soon. The developers are warning about some core code changes, some also related with the database structure, so we’ll need to test it deeper before updating our citaBlog, due to the integration with our main site.We look forward to see the 2.1’s improvements!Mike [...]

    Pingback from devBlog » Blog Archive » WordPress 2.1 approaching on December 13, 2006

  29. [...] Read more: Is you plugin naughty or nice? [...]

    Pingback from Is Your Plugin Compatible With WordPress 2.1? « Sabahan.com on December 14, 2006

  30. [...] A guest article by Aaron Brazell on WordPress notes that WordPress 2.1 will be out soon and WordPress plugin developers need to fix codes to make their plugins compatible with the new version. [...]

    Pingback from Pecas Ndahe by Ndoro Kakung on December 14, 2006

  31. [...] ASAP. admin | 7:19 pm | Tags: Social Media , WordPress , plugin | Bookmark on del.icio.us | Digg It  [...]

    Pingback from Big in Japan Blog on December 15, 2006

  32. [...] Naja, die neuen Icons sind zwar aus dem K2-Theme und die haben die von famfamfam.com, die Teile sind aber auch geil… Muss nur mal sehen, ob alles auch mit dem Vorangekündigten WordPress 2.1 geht… [...]

    Pingback from Kreativgemüse » Blog Update on December 16, 2006

  33. [...] There’s a post on the WordPress development blog outlining some changes in the upcoming WordPress 2.1. These are all welcome and sensible changes that will be merged into Lyceum when the code is final. [...]

    Pingback from The Lyceum Project » WordPress 2.1 Database schema and variable changes on December 18, 2006

  34. [...] Reparaturen und Anpassungen für die Kompatibilität mit WordPress 2.1 – jawoll, 2.1 kann kommen! [...]

    Pingback from Zirona :: OpenSource Consulting » Blog-Artikel » Erweiterte Suche Version 0.4 on December 24, 2006

  35. [...] As you maybe already noticed in the article at wodpress.org from Aaron Brazell, the plugin developers are encouraged to update their plugings. So I start and install WordPress 2.1a3 and trapped direct into the biggest upcomming problem for plugin developers: The visual editor (TinyMCE) is updated and didn’t support anymore a Button integration in the old way (with buttonsnap.php). [...]

    Pingback from Is WordPress 2.1 Naughty or Nice? at alex.rabe on December 28, 2006

  36. [...] It’s not all about this blog though. This blog has almost doubled in traffic. I’ve dumped 4 blogs and picked up Suicide Fan and began contributing to the Washington Hotlist. I’ve contributed at Problogger, Blog Herald and the WordPress development blog. [...]

    Pingback from Happy 2007! » Technology, Blogging and New Media on January 1, 2007

  37. [...] ondersteunen de beta WordPress 2.1 te testen, meld je dan aan voor de beta groep. Belangrijk: uitgebreide MySQL wijzigingen worden doorgevoerd in WordPress 2.1 als je een WordPress plugin ontwikkelaar bent, wordt je [...]

    Pingback from belangrijk update voor WordPress - 2.06 at Enthousiasmeren on January 6, 2007

  38. [...] Yo acabo de actualizar la bitácora en un periquete, para lo cual he utilizado, una vez más, el archivo diferencial que tan amablemente proporciona Mark on WordPress. Otra cosa será enfrentarse a la versión 2.1, que parece estar a la vuelta de la esquina, con un montón de novedades (entre ellas el corrector ortográfico integrado del editor TinyMCE, ay Dios), y modificaciones en la estructura de la base de datos. [...]

    Pingback from La Bitácora del Tigre · Actualización de WordPress a la versión 2.0.7 on January 16, 2007

  39. [...] gerekmekte. WordPress Resmi Blog’unda yakın bir zamanda eklenti geliştiricileri için bir makale yayınlanmıştı; Hakan da WordPress 2.1′in MySQL gereksinimlerini anlatmış, ve WordPress [...]

    Pingback from Tekno Seyir » Blog Arşivi » WordPress 2.0.7 sürümü on January 16, 2007

  40. [...] versión 2.1 de wordpress trae consigo numerosas mejoras, uno de los cambios es la forma de hacer llamadas a la base de datos de los plugins, por lo que algunos de ellos tendrán que ser actualizados o dejarán de funcionar. [...]

    Pingback from WordPress 2.1: Compatibilidad con plugins » La mate por un yogur on January 19, 2007

  41. [...] Deprecation of $tableposts, $tablecomments, etc – Deprecation is a mild word. Typically in software development, deprecation means that it is no longer a recommend approach but for backwards compatibility, the function or variable still exists. In this case, elimination would be a more appropriate term. This is going to affect a lot of people because there are still many plugins out there using these variables when generating queries within plugins. Instead, the method for querying wordpress table sis to use the $wpdb global. For instance, $tableposts should be termed $wpdb->posts. $tablecomments should now be $wpdb->comments. And so on. Plugins using the old format will cause SQL errors that might be displayed on a blog or simply break a blog altogether. I had a post recently on the WordPress Development blog which describes these changes. [...]

    Pingback from 10 Things You should Know About WordPress 2.1 » Technology, Blogging and New Media on January 21, 2007

  42. [...] Elimination of $tableposts and $tablecomments – There has been a movement to get rid of all $table* variables. There will be replacements, however plug-in compatibility might be affected. More information is available on this WordPress blog post. [...]

    Pingback from JP Knows IT » Blog Archive » WordPress 2.1 being released Monday January 22nd 2007 on January 22, 2007

  43. [...] that there are expected to be some plugin compatibility issues, which you can read about and check [...]

    Pingback from WebbleYou WordPress Hosting : Blog Archive : WordPress 2.1 Released on January 23, 2007

  44. [...] formaat kun je SQL errors verwachten of erger nog de gehele blog werkt niet meer. Meer info over deze wijzigingen. Aanvulling: volgens Ryan Boren van WordPress, zijn deze variabelen “ressurrected” en in [...]

    Pingback from WordPress 2.1 - eindelijk at Enthousiasmeren on January 23, 2007

  45. [...] Duh…finally my blog is up and running the latest WordPress release – WordPress 2.1 and it took me almost a day to compile all the things. After all, this is one thing which I would always like to remain updated with. Still I am not sure if there are some leaks anywhere as there are lot of db changes and at the same time, lot of variables and functions are deprecated (all deprecated functions are put into deprecated.php file). One of such functions is wp_list_cats which is used to display categories and therefore, is very important function. It is now replaced with completely new function – wp_list_categories. So, will I have to ask the theme creator to change the theme for this single function or will he do it himself? :roll:. And then I had to change the plugins for deprecated variables which I am still doing. specially when all the variables starting with $table ($table*) have been deprecated. For more changes which have been made in latest release, you may like to visit here. [...]

    Pingback from Net 2.0 » Blog Archive » My blog is running latest WordPress version on January 23, 2007

  46. [...] deals with pages will be more or less broken. This change was mention by Aaron in December in the development blog, but if you missed the post then you are on your [...]

    Pingback from Apostolos Dountsis » WordPress 2.1 - A developer’s point of view on January 24, 2007

  47. 英文不好也没有关系

    今天(美国是December 11, 2006)看到Blogger Buzz和WordPress Blog都更新了一篇文章。Blogger Buzz的还好,WordPress Blog的我就懒得看了。让iLEMONed(ta博客都是英文写的)帮我看了下大意也就了事了。
    下午å…

    Trackback from OtherSide on January 25, 2007

  48. [...] should have checked out this post on the WordPress development blog. I don’t fancy myself a WP “developer,” but [...]

    Pingback from The Nested Float » A Word of Warning: Category ID Numbers Have Changed in WP 2.1 on January 25, 2007

  49. [...] WordPress provided command: $wpdb->linkcategories but this no longer works (as noted at their development site) I have no idea what could have led them to change [...]

    Pingback from Exploring the Mystery - WordPress 2.1 and link categories on January 26, 2007

  50. [...] 2.1 is coming and there are some changes for plugins to deal with. Looking at what is changing and the Xinha4WP code, I don’t see any reason why Xinha4WP would [...]

    Pingback from Mike’s WordPress Plugins » Blog Archive » WordPress 2.1 and Xinha4WP on January 29, 2007

  51. [...] se anunció horas atrás en el sitio de WordPress, el lanzamiento de la versión 2.1 de este sistema de blogs [...]

    Pingback from Llaman a actualizar plugins ante la salida de WordPress 2.1 | Thuer.com.ar on April 28, 2008

See Also:

For more WordPress news, check out the WordPress Planet.

There’s also a development P2 blog.

To see how active the project is check out our Trac timeline, it often has 20–30 updates per day.

Categories

%d bloggers like this: