Extended license - How to include Smart Slider 3 in my WordPress theme?

You could include plugins inside your theme by using TGM Plugin Activation library. You could follow their instructions, but I will also write down the process of using it with a very simple example:

Create a folder for your theme:

Download TGM and upload it somewhere into your theme's folder:

Download our installer package and upload it somewhere into your theme's folder:

Create an index.php file into your theme's folder (doesn't matter what code it contains):

Create a style.css file into your theme's folder (doesn't matter what code it contains):

Create a functions.php file, which will need the necessary codes:

Add this code to the functions.php file:

require_once get_template_directory() . '/TGM/class-tgm-plugin-activation.php';

add_action('tgmpa_register', 'register_required_plugins');

function register_required_plugins() {

    $plugins = array(

        // This is an example of how to include a plugin bundled with a theme.
            'name'               => 'Smart Slider 3', // The plugin name.
            'slug'               => 'nextend-smart-slider3-pro', // The plugin slug (typically the folder name).
            'source'             => get_template_directory() . '/plugins/nextend-smart-slider3-wordpress-pro.zip', // The plugin source.
            'required'           => true, // If false, the plugin is only 'recommended' instead of required.
            'version'            => '3.2.4', // E.g. 1.0.0. If set, the active plugin must be this version or higher. If the plugin version is higher than the plugin version installed, the user will be notified to update the plugin.
            'force_activation'   => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
            'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
            'external_url'       => '', // If set, overrides default API URL and points to an external URL.
            'is_callable'        => '', // If set, this callable will be be checked for availability to determine if a plugin is active.


    $config = array(
        'id'           => 'nextend-theme',         // Unique ID for hashing notices for multiple instances of TGMPA.
        'default_path' => '',                      // Default absolute path to bundled plugins.
        'menu'         => 'tgmpa-install-plugins', // Menu slug.
        'capability'   => 'edit_theme_options',    // Capability needed to view plugin install page, should be a capability associated with the parent menu used.
        'has_notices'  => true,                    // Show admin notices or not.
        'dismissable'  => true,                    // If false, a user cannot dismiss the nag message.
        'dismiss_msg'  => '',                      // If 'dismissable' is false, this message will be output at top of nag.
        'is_automatic' => true,                    // Automatically activate plugins after installation or not.
        'message'      => '',                      // Message to output right before the plugins table.

    tgmpa($plugins, $config);

As you see, you need to include the PHP file of the TGM library with require_once.

Then with the add_action you will hook your function to the tgmpa_register. Your function's name can be anything.

Inside your function you can find a $plugins array, which will contain all the plugins you want to be installed with your theme. You can see the comments next to the values what they mean, but if something wouldn't be clear, you can find a documentation here. Basically the important part in this array is the source value, which should point to our zip file inside your theme's directory. And the version should be changed to a higher value everytime you send out an update of our plugin.

The $config can stay as it is. You could replace the id to anything else, it just have to be unique.

As a result, when your theme will be activated, a notice will appear on all of your backend pages, that your theme requires our plugin, also an Install Plugins menupoint will be under the Appearance menu:

When you will put out an update, another notice will appear: