Error-proof your plugin integrations!
How many times have you installed a plugin, integrated it with your theme, decide to uninstall it, but then forget to remove its function within the theme?
Once you’ve un-installed a plugin, you have to go back to your WordPress theme to remove any trace of it, or else your blog would return “function doesn’t exist” errors.
In case you forget to remove all traces of a certain un-installed plugin, this is a quick tip to error-proof your future un-installation so your readers wouldn’t have to run across “function doesn’t exist” errors.
Let’s say you want to use the Author Highlight plugin, which adds a class to your comments, to style comments made by you. It wants you to add <?php author_highlight(); ?> to somewhere in the comments.php file. Instead of doing just that, here’s what you should add:
<?php if(function_exists(”author_highlight”)) author_highlight(); ?>
Don’t copy and paste the codes above, it will not work. Type it out.

Don’t copy and paste the codes above, it will not work. Type it out.
It’s integration, not intergration.
Good tip nonetheless!
It’s good to have you on this blog Dean. Hahaha. If only WordPress applied spellchecking to titles too…
Great tip! Thank you!!
interesting tip
Nice one!
Good tip. Probably something I should be doing!
Sometimes small things like this makes a big difference in how popular a theme is…
Great tip! I just started building themes for public release, and I was wondering how to offer plugin functionality to users who have that particularly plugin without messing up users who don’t. So, thank you.
Why do plugin coders fail to use your example in their installation instructions? I would say at least 9 out of 10 fail to use an if statement.
oo yay I need something like this. Thankies muchly!!
Nice tip. I always run through any new themes I deploy for people making sure that this hack is done to pre-embedded plugin codes.
I think it’s mainly down to the plugin publishers to phrase the code like this in the help files, rather than the shorter unchecked version.
I do the some technique like you too… and this make Theme still running good, when plugins not available.
lol copy paste wont work, cool — but i dont copy and paste, whats the point in that, wont learn that way
I tried installing this Wordpress Shop plugin and it was terrible. So I deactivated it. But ever since then I haven’t been able to type in the “post” section using Internet Explorer.
It would help if people would just put a little more effort into writing their plugins to begin with.
(Sorry for all the comments today, I haven’t been here in a lil while. Lots to catch up on.)
Great tip, SP. I’ll use your this trick for my WP based blogs.
[…] ??????? ????? ?? ????? ??????? .?????? ??? ?????? ??? ????? ?????? ?????. ???: ???? ?? ????????, ?? […]