[wp-hackers] Strange plugin fatal error
Sudar Muthu
sudar at sudarmuthu.com
Mon Apr 7 09:42:47 GMT 2008
I have experienced similar issue with my Plugins before.
After some debugging I found that this occurs if there is an error in the
function which executes when the Plugin is activated.
Jeremy,
When you try to use if (!function_exists) { ....} the error message will be
simply shown in the next function which is not wrapped with the
function_exists condition. This is kind of deceive behavior, but the actual
culprit is the error which has occurred in the code executed during
activation.
Hope this helps.
On Wed, Apr 2, 2008 at 4:29 PM, Jeremy Visser <jeremy.visser at gmail.com>
wrote:
> On Mon, 2008-03-31 at 23:42 +0100, Robert R. Marsh, SJ wrote:
> > Fatal error: Cannot redeclare similar_posts() (previously declared in
> >
> /blah/blah/blog/wordpress/wp-content/plugins/similar-posts/similar-posts.php
> > :33) in
> >
> /blah/blah/blog/wordpress/wp-content/plugins/similar-posts/similar-posts.php
> > on line 33
>
> This isn't a solution per se, but you could wrap your functions in
> !function_exists() to suppress the error messages:
>
> if (!function_exists('similar_posts')) :
> function similar_posts() {
> // blah blah
> }
> endif;
>
> --
> Jeremy Visser http://jeremy.visser.name/
>
> () ascii ribbon campaign — against HTML e-mail
> /\ http://asciiribbon.org/
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
--
With Regards,
Sudar
http://SudarMuthu.com
More information about the wp-hackers
mailing list