Conflicting names

PHP as a language is particularly vulnerable to naming collisions, and this is especially prevalent in WordPress plugins where many authors are not particularly aware or sensitive about this problem. If your site is running a lot of plugins, you are increasing the odds that a naming conflict might occur. While debugging a plugin, one of the first things that you should do is disable all of your other plugins so you can isolate problems.

We have seen a lot of useless attempts to prevent naming collisions when plugin authors wrap their function definitions in a big if-block:

if ( !function_exists('myfunction') ) 
{  
   function myfunction() 
   {
      // Do stuff
   }
}

Do not think that your plugin is safe if you use if-blocks like this! This is ...

Get WordPress 3 Plugin Development Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.