[wp-hackers] function_exists - user woes

Alex King alex at alexking.org
Fri Jul 30 05:46:57 UTC 2004


I agree that plugins work poorly in the regard, but use function_exists 
as suggested, you have to require the user to add more complex code 
into their template. This makes installing a plugin/hack much more 
complicated.

<?php my_hack_function(); ?>

turns into:

<?php if (function_exists('my_hack_function') { my_hack_function(); } ?>

And that is a very simple case. There isn't a way that I know of to 
remove that complexity and still have the conditional.

I posted some thoughts a while back on why I don't like the 
enable/disable plugin system:

http://www.alexking.org/blog/2004/06/01/wordpress-implementation/

"One thing I don’t get about the WP 1.2 plugins, they all generally 
give you new functionality that you expose by adding tags, etc. into 
the template. If someone then disables the plugin without removing 
those tags, their blog will break. The plugin enabling/disabling 
mechanism is nice and interactive (and it makes people feel good), but 
I think it gives them the false impression that they can control more 
than they actually can by simply clicking things on and off on the 
plugins page."

--Alex

http://www.alexking.org/


On Jul 29, 2004, at 11:36 PM, Carthik Sharma wrote:

> Note for Plugin Authors :
> from http://sweth.com/index.php?p=65  :
>
> Earlier today, for example, the entire site was crippled apparently
> because I deactivated a plugin and didn't remove some corresponding
> code from one of the pages; if you have to hack things in order to
> make the plugin work (which it seems like almost every plugin I've
> tried requires), then it ain't a plugin, it's a hack. (Especially
> since I just, Googling quickly and having never written a line of
> original PHP code, found the function_exists php function, which would
> seem to make it trivial for plugin authors to at least make their page
> hacks modular enough that turning off the corresponding plugin doesn't
> break anything, if only those authors would spend ten minutes making
> their hacks self-aware. (Laziness is a virtue in programmers, but not
> Foolish Laziness.))
>
> Important points :
> "if you have to hack things in order to make the plugin work (which it
> seems like almost every plugin I've tried requires), then it ain't a
> plugin, it's a hack."
> "function_exists"




More information about the hackers mailing list