WordPress.org

Ready to get started?Download WordPress

Forums

Auto-install plugins when activating a theme. (13 posts)

  1. adrian7
    Member
    Posted 2 years ago #

    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.

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

  3. Daniel Fru?y?ski (sirzooro)
    Member
    Posted 2 years ago #

    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.

  4. adrian7
    Member
    Posted 2 years ago #

    Ok, can somebody post some sample code...?

  5. ivanoconfa
    Member
    Posted 2 years ago #

    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.

  6. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

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

    Some info here which may be interesting to you

  7. ivanoconfa
    Member
    Posted 2 years ago #

    Thanks! this works!

  8. adrian7
    Member
    Posted 2 years ago #

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

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

  9. Gary Jones
    Member
    Posted 2 years ago #

    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.

  10. ivanoconfa
    Member
    Posted 2 years ago #

    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

  11. Gary Jones
    Member
    Posted 2 years ago #

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

  12. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

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

  13. Thomas Griffin
    Member
    Posted 2 years ago #

    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 :)

Topic Closed

This topic has been closed to new replies.

About this Topic