I'd suggest that you create a loading function that checks a specific directory (./plugins) for the names of various plugins that you plan on distributing. If the files exist then include it and set a global variable that you can check for included plugins.
Now when you have a function that uses a plugin you can wrap the function call in an if..then..else statement.
Ofcourse this method will only work if you have designed the calls for all of the plugins that you are going to create inside your main program.