Softer plugin dependancy
In some cases, the dependancy is not as strict in the sense that some extra function can be enable if another plugin is installed. There is no dependancy check is needed since it's not mandatory, but the plugin can do some check on the fly to enable the additional function.
An example at hand is NP_Referer2 and NP_Trackback. Recently a new plugin NP_Blacklist is developed by Xiffy to help fight commant spam. The same filter engine actually can used to fight referer and trackback spam as well.
The dependancy to NP_Blacklist is not a strict one. It mean NP_Referer2 and NP_Trackback can utilize NP_Blacklist if it is installed. To enable the function. A run-time dependancy check can be done. An example for NP_Trackback:
if ($manager->pluginInstalled('NP_Blacklist') and $blacklist =& $manager->getPlugin('NP_Blacklist')) { if (floatval($blacklist->getVersion()) >= 0.95) { $blacklist->blacklist('TrackBack',$url.' '.$title.' '.$blog_name.' '.$excerpt); } }
If NP_Blacklist is found, NP_Trackback can call it to filter trackback for potential spam.
Cool, isn't it?
This is a variation of: http://edmondhui.homeip.net...