• As a theme developer, I’ve got many times this problem:

    You see, for some features of your themes you may need few plugins (or dozens), and many times your theme might just not work whithout them.
    So you have to:
    1. Bundle those plugins with your theme – and have users read dozen-lines installation instruction (not retarded-proof!).
    2. Re-build or copy the functionality in your theme – more work…

    WordPress has a great one-click installer for plugins, and theme developers should benefit of this.

    It would be great to have an api, and with a few lines of code, to request and automatically install plugins you need for the theme just after/just before activating it.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Some people have done that, but right now WP isn’t headed that way, as there’s no good way to maintain the ‘packages’.

    You can add some extra code to your theme which will check if all required plugins are active. If not, display error/warning message in admin backend.

    Thread Starter adrian7

    (@adrian7)

    Ok, can somebody post some sample code…?

    Yes, I could really do with the same sample code too. I searched on google and could not find anything helpful. I am finding a bit of a nightmare to embed a slideshow plugin within my theme, it cannot link to the images in uploads folder.

    http://wpcandy.com/reports/the-tgm-plugin-activation-class-on-github

    Some info here which may be interesting to you

    Thanks! this works!

    Thread Starter adrian7

    (@adrian7)

    Yes, looks great! It should be included in wordpress.

    https://github.com/thomasgriffin/TGM-Plugin-Activation

    adrian7,

    The code in TGMPA makes use of all the WP code anyway for unzipping a plugin and installing it. All we’ve done is provide a way for theme authors to say “Hey, this theme NEEDS this plugin to work properly”, and a way for users to say “OK, sure, install and activate that plugin then” – plugins can be included with the theme, pulled from the .org repo, or from anywhere else online.

    As such, it kinda already is *in* WordPress – we’ve just made it easier to access.

    This is great particularly because it opens up huge possibilities for non developers like me to design themes by including plugins without the need for extra coding. There must be 1000s of designers who cannot code a plugin within a theme who will welcome your TGMPA.
    Saying that, a single button to install all plugins at once would be even better. Thank you

    Bulk install is one of the future features we plan on adding in.

    @garyj, good stuff, I’ve been dropping your link to folks a lot lately!

    As Gary has mentioned, Bulk install is one of the features we plan on implementing once we chisel away at a few other pressing issues (like consolidating nag messages). Bulk install will be huge when it is functioning 🙂

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Auto-install plugins when activating a theme.’ is closed to new replies.