How to bundle plugins into a new WP theme

13 replies
Is it possible to create a WP theme that includes certain plugins already in the theme, just like Akismet and Hello Dolly are automatically included in the WP default theme?

If it is possible, is it easy enough for a super novice PHP programmer to do?

Thanks.
#bundle #plugins #theme
  • Profile picture of the author mywebwork
    Hi Kristen

    Plugins and Themes reside in independent directories and perform different functions in WordPress. The Akismet and Hello Dolly plugins are included with the base WordPress installation, not with the default theme - these plugins are available to use with any theme the user selects.

    You could bundle some plugins with your theme and offer them as a package, however you would need to install and activate them independently.

    If you want to learn how to program Themes and Plugins the best place to start is here:

    Developer Documentation WordPress Codex

    Bill
    {{ DiscussionBoard.errors[1244996].message }}
    • Profile picture of the author Kristen
      Thanks Bill,

      I guess what I'm really after is the ability to create a plugin that has a bunch of other plugins "in it" that automatically install, and activate.

      Does that make sense? Does auto install and activation go against the WP norm? Would it be Kosher to do something like that?

      Also, thanks for the How To resource. I will check it out today.
      {{ DiscussionBoard.errors[1245232].message }}
  • Profile picture of the author mywebwork
    Hi Kristen

    Are you planning to create a multi-function Plugin that emulates the function of other popular plugins - i.e. a "Swiss Army Knife" of Plugins? That's a challenge but certainly doable, although perhaps you should start with a few simpler ones before building "the mother of all Plugins"!

    If instead you want to make a "super-plugin" that encompasses other common plugins and also installs and activates them - well that's not going to be an easy task. I'm sure you could automate the upload and installation part, but self-activating may not be that easy without modifying the WordPress core files or database.

    Self-activating does kind of go against the grain when it comes to WordPress, at least in my opinion. It's not unheard of for a plugin to cause a problem with a theme or a new release of WordPress, or for a poorly designed plugin to conflict with another one. Because of this it is necessary to be able to deactivate plugins and reinstall them easily.

    A few more links:

    http://www.devlounge.net/publik/Devl...s%20Plugin.pdf

    A 43-page PDF about building plugins


    How to create WordPress Plugin from a scratch

    Another guide to writing plugins.


    Bill
    {{ DiscussionBoard.errors[1245787].message }}
    • Profile picture of the author jayveen
      I think the OP just wants some way to automate having all of the plugins already installed, instead of having to go to the wp-admin screen, select Plugins->add new and manually add and activate each one. Its a nice idea, because some of the plugins become so standard that its tedious to have to install, say, Google Xsitemap each time you start a new domain.

      Unfortunately, I don't know how to do it but there must be some way.
      {{ DiscussionBoard.errors[1246385].message }}
      • Profile picture of the author mywebwork
        Originally Posted by jayveen View Post

        I think the OP just wants some way to automate having all of the plugins already installed
        The following quotes make me think the OP is after advice on how to build a theme and integrate some plugins, and is looking for programming advice:

        Originally Posted by Kristen View Post

        Is it possible to create a WP theme that includes certain plugins already in the theme
        Originally Posted by Kristen View Post

        it is possible, is it easy enough for a super novice PHP programmer to do?
        Originally Posted by Kristen View Post

        I guess what I'm really after is the ability to create a plugin that has a bunch of other plugins "in it" that automatically install, and activate.
        At least that's my interpretation. If I'm wrong then hopefully someone will find the plugin development links useful.

        Originally Posted by jayveen View Post

        , I don't know how to do it but there must be some way.
        You could bundle up WordPress, your theme(s) and Plugins., activate everything and then save the database and ZIP all the files. Then you could run an install that expands the files, creates a MySQL database on your server and pumps all the relevant information into the config file. "WordPress in a box" so to speak!

        A custom Fantastico or similar scripted installation could also be a possibility.

        Bill
        {{ DiscussionBoard.errors[1246575].message }}
        • Profile picture of the author Kristen
          Actually, jayveen hit the mail on the head. I am setting up a bunch of niche sites that all use a bunch of the same plugin. I would love to automate the creation of these sites. Adding all the plugins and then bulk activating them should be automated.

          Somehow maybe there is a first plugin that is manually installed and has a list of all the plugins to be added and bulk activated. Then you pull the trigger and POW, the list of plugins get installed and activated.

          A simple alternative I thought of is to just create a vanilla version of the site that has all the plugins but no content and then use that site to copy to a new site.

          I'm not that familiar with copying a WP site. Does it also copy the plugins?



          Originally Posted by mywebwork View Post

          You could bundle up WordPress, your theme(s) and Plugins., activate everything and then save the database and ZIP all the files. Then you could run an install that expands the files, creates a MySQL database on your server and pumps all the relevant information into the config file. "WordPress in a box" so to speak!

          A custom Fantastico or similar scripted installation could also be a possibility.

          Bill
          Bill, this would work. Would I end up with one zip file that I could upload and unzip?
          {{ DiscussionBoard.errors[1248301].message }}
  • Profile picture of the author mywebwork
    Guess I can't be right all of the time!

    Kristen, I keep a set of standard themes and plugins that I FTP up to my site for every WordPress installation, this isn't as automated as I think you want but it's really easy to setup and maintain.

    If you want to go "all the way" you'll need to perform a standard WP installation on your test server with all your favorite plugins and themes. Activate and configure them as required. Then FTP the entire site back to your local hard disk. You could use 7 ZIP or the equivalent Windows or Mac utility to create a ZIP file of the whole thing, or just leave it expanded.

    Now use phpMyAdmin or the equivalent (if your test server is a local LINUX workstation you could use the MySQL GUI Tools) to make a full database backup. make sure you note the user name and password as you're "cloning" that as well.

    Next time you want to make a WP site FTP the entire file set up to the site. Create a database, if possible keep the name the same as the old one (that isn't really mandatory). There are a few configuration file you will need to edit, these articles will steer you to the right place:

    Moving WordPress WordPress Codex

    How to Move WordPress Blog to New Domain or Location My Digital Life

    To REALLY automate this you could write an install script that copied and expanded the files, created the database and edited the configuration files. Not sure if you want to go to that extreme though!

    Bill
    {{ DiscussionBoard.errors[1249312].message }}
    • Profile picture of the author cma01
      Why not just go with Wordpress MU?

      Then you only have to install and update the plugin on one installation.

      I have seen a few themes that code the plugins in the function file, but then you run into issues when updating.
      Signature
      "Wise men talk because they have something to say; fools, because they have to say something."
      ~ Plato
      {{ DiscussionBoard.errors[1249998].message }}
      • Profile picture of the author Kristen
        Originally Posted by cma01 View Post

        Why not just go with Wordpress MU?

        Then you only have to install and update the plugin on one installation.

        I have seen a few themes that code the plugins in the function file, but then you run into issues when updating.
        I think WP MU won't work because of this...
        WPMU can work in two different URL configurations. One is sub-domain based: joe.mydomain.com, steve.mydomain.com, etc. The other is sub-directory based: blogs.mydomain.com/steve, blogs.mydomain.com/joe. You have to decide what configuration to use when you install WPMU.

        I need distinct domain names since these are sites for commercial use (ta make me $.)

        mywebwork, Maybe I don't fully understand, but it sounds like it might take longer to do all the FTPing and creating the db than it does for me to manually create a new site and add the plugins. Did I miss something?

        Thanks to you both.
        {{ DiscussionBoard.errors[1250362].message }}
  • Profile picture of the author cma01
    No, you can use multiple domains each with their own site with WPMU.

    There is also the subdomain feature, but I've actually never used it that way myself.
    Signature
    "Wise men talk because they have something to say; fools, because they have to say something."
    ~ Plato
    {{ DiscussionBoard.errors[1252448].message }}
    • Profile picture of the author Kristen
      Oh wow. That sounds great then.
      So I am just setting up sites on addon domains so could I set up wpMu on my main domain and then use it to set the other sites?
      That would be awsome.
      Are there plugins specific to wpMu? Because I'm also interested in being able to monitor all those sites from a single panel.

      Thanks a ton.
      {{ DiscussionBoard.errors[1254850].message }}
      • Profile picture of the author cma01
        Kristen,

        Yes, adding a new site is super easy. The additional domain management used to be a little more tricky, but WPMU has come a long way in the past year in that regard.

        All I do is:
        1. add the domain to that hosting account.
        2. Log into the back end of any site on the installation and go to Site Admin => Sites
        3. Under "Add Site," enter the site name, domain name, path (which is just "/" no quotes), and the blog name (because remember you can have multiple blogs or subdomains on each site.)
        And that's it. Then you just log into that domain's back end and activate your theme and plugins for that particular site.

        I've read that some plugins aren't compatible with WPMU, but I haven't run into that issue myself. I have about 40 plugins installed. I don't use all of them on every site as some sites have unique features.

        The only glitches that I've run into with the current version is that the option to change the site admin email doesn't work (the confirmation email doesn't get sent out,) so I just change it in the database with phpadmin.

        Also, the most recent versions of WPMU and WP-Postratings have an issue. The ratings don't register. I'm trying to figure out what the issue is right now.
        Signature
        "Wise men talk because they have something to say; fools, because they have to say something."
        ~ Plato
        {{ DiscussionBoard.errors[1255238].message }}
        • Profile picture of the author Adal
          There is a simple way to bundle plugins with a theme and have them installed automatically.

          It actually requires that you install and activate the theme and then display a front-end page of the website immediately after.

          You can download and use the code on my website. Just google the following:

          Adal Design Bundling Plugins with Themes

          Enjoy!
          {{ DiscussionBoard.errors[3348889].message }}

Trending Topics