How to bundle plugins with a theme

This seems like an obvious, though novice, question: I was rummaging for a good way to include WP plugins in my themes so that when the client installs them, PHP will copy the plugin files into the “plugins” folder in wordpress.

It seems (very) impractical to do that, so I wanted to ask how do you as theme designers tackle having to bundle plugins with your theme? Do you simply indicate the customer “please download this and that plugin for the ultimate user-exprience”?

This seems like an obvious, though novice, question: I was rummaging for a good way to include WP plugins in my themes so that when the client installs them, PHP will copy the plugin files into the “plugins” folder in wordpress.
It seems (very) impractical to do that, so I wanted to ask how do you as theme designers tackle having to bundle plugins with your theme? Do you simply indicate the customer “please download this and that plugin for the ultimate user-exprience”?

if you include(php include or require) the plugin from your theme’s functions.php file, its the same as having the plugin installed.

This seems like an obvious, though novice, question: I was rummaging for a good way to include WP plugins in my themes so that when the client installs them, PHP will copy the plugin files into the “plugins” folder in wordpress.
It seems (very) impractical to do that, so I wanted to ask how do you as theme designers tackle having to bundle plugins with your theme? Do you simply indicate the customer “please download this and that plugin for the ultimate user-exprience”?

if you include(php include or require) the plugin from your theme’s functions.php file, its the same as having the plugin installed.

Actually, some plugins rely on the fact that they should dwell inside wp-content/plugins directory (e.g. make require_once calls for a file that technically does not exist). Furthermore, from my experience, when you include a plugin like that, it does not appear in your “plugins” menu on WordPress and thus you don’t get the added benefit of perhaps updating it when it is revamped.

Actually, some plugins rely on the fact that they should dwell inside wp-content/plugins directory (e.g. make require_once calls for a file that technically does not exist). Furthermore, from my experience, when you include a plugin like that, it does not appear in your “plugins” menu on WordPress and thus you don’t get the added benefit of perhaps updating it when it is revamped.

Better solution?

Plugins like that are often not written with such great code.

Anyway, if thats what you want, you can use a script to move files on theme activation. Use the PHP copy function to copy files from your theme directory to the plugins directory.

Actually, some plugins rely on the fact that they should dwell inside wp-content/plugins directory (e.g. make require_once calls for a file that technically does not exist). Furthermore, from my experience, when you include a plugin like that, it does not appear in your “plugins” menu on WordPress and thus you don’t get the added benefit of perhaps updating it when it is revamped.

Better solution?

Plugins like that are often not written with such great code.

Anyway, if thats what you want, you can use a script to move files on theme activation. Use the PHP copy function to copy files from your theme directory to the plugins directory.

I agree with you on that; though I was hoping for some magic WP built-in function.

Actually, some plugins rely on the fact that they should dwell inside wp-content/plugins directory (e.g. make require_once calls for a file that technically does not exist). Furthermore, from my experience, when you include a plugin like that, it does not appear in your “plugins” menu on WordPress and thus you don’t get the added benefit of perhaps updating it when it is revamped.

Better solution?

Yes! There is a better solution. The code was written by WPML but for some reason they recently discontinued it’s distribution.

I took upon myself the responsibility to continue distributing this terribly useful piece of work, and do not claim to take any credit for it. When I have time though, I might work on extending or optimizing it.

For full instructions on how [self promotion removed] and even have them install automatically, check out the link.

Yes! There is a better solution. The code was written by WPML but for some reason they recently discontinued it’s distribution.

I took upon myself the responsibility to continue distributing this terribly useful piece of work, and do not claim to take any credit for it. When I have time though, I might work on extending or optimizing it.

Just search Blundling Plugins with Themes for instructions.

Phoenix, that’s some tight code, thanks for sharing! Do you just change your functions file every-time you add/remove a plugin from the package then?

Might be a silly question but, do I just add the above code to the functions file in my theme and adjust it to the relevant plugin information? A nice feature to add if you decide to develop it further would be to scan the directory in the theme and copy all plugins within it.