Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference pre-packaged plugins, plugins from t…

tree: d32e576943

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 tgm-plugin-activation
Octocat-spinner-32 README
README
=== TGM Plugin Activation ===
Contributors:      Thomas Griffin (@jthomasgriffin / thomasgriffinmedia.com)
                   Gary Jones (Github: @GaryJones / Twitter: GaryJ)
Version:           2.2.0
Requires at least: 3.0.0
Tested up to:      3.3

== Description ==

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference pre-packaged plugins, plugins from the WordPress Plugin Repository or even plugins hosted elsewhere on the internet.

== Installation ==

1. Drop the class file somewhere in your theme hierarchy.
2. Add a require_once call within functions.php (or other theme file) referencing the class file.
3. Create a function, hooked to `tgmpa_register`, that registers the plugin and configurations.

For steps 2 and 3, it is recommended you view, copy and paste the contents of example.php
and amend to suit. The example.php file is a model for how you should include the class in your theme.

Some important things to note:

1. With the `require_once` call, make sure to amend the path to the correct location within your theme.
2. For plugins pulled from the .org repo, the source argument is optional. Otherwise it is required and should point
   to the absolute path for the plugin zips within your theme, or to a URL for zips elsewhere online.
3. The $config variable holds an array of arguments that can be used to customize aspects of the class.
   If you define an absolute default path for packaged plugins, you do not need to specify the directory path
   for your pre-packaged plugin within the 'source' argument. You will only need to specify the zip file name.

== Feedback ==

See https://github.com/thomasgriffin/TGM-Plugin-Activation/issues for current issues and for reporting bugs and enhancements.

You can also follow project progress and updates on Twitter. Follow us here at http://twitter.com/TGMPA.

== Changelog ==

= 2.2.0 =

* Fixed erroneous links for plugins linked to the WordPress Repo
* Improved UI of plugins by listing them in WordPress' default table layout
* Improved support for installing plugins if security credentials require FTP information
* Improved support for MultiSite
* Added 3 new classes (all extensions of existing WordPress classes): TGMPA_List_Table for outputting required/recommended plugins in a familiar table format, TGM_Bulk_Installer for bulk installing plugins and TGM_Bulk_Installer_Skin for skinning the bulk install process
* Added extra defensive measures to prevent duplication of classes
* Added ability to bulk install and bulk activate plugins
* Added new config options: 'parent_menu_slug', 'parent_menu_url', 'is_automatic', and 'message'
* Added new string: 'complete' (displayed when all plugins have been successfully installed and activated)
* Added support for singular/plural strings throughout the library
* Added permission checks to action links
* Added new filter tgmpa_default_screen_icon to set the default icon for the plugin table page
* Added new optional plugin parameters: 'version', 'force_activation', 'force_deactivation' and 'external_url'
* Removed 'button' string (deprecated with use of plugins table)

= 2.1.1 =

* Fixed nag not re-appearing if user switched themes and then re-activated the previous theme (UX improvement)

= 2.1.0 =

* Fixed duplicate nag message on admin options pages
* Fixed FTP nonce error when FTP credentials aren't defined in wp-config.php
* Improved handling of failed FTP connections with WP_Filesystem
* Improved string labeling for semantics
* Improved nag messages so that they are now consolidated into one message
* Improved plugin sorting by listing them alphabetically
* Improved plugin messages after installation and activation
* Added automatic activation of plugins after installation (users no longer need to click the "Activate this plugin" link)
* Added links to repo plugins for their plugin details and information (done via thickbox)
* Added option to dismiss nag message
* Added tgmpa_notice_action_links filter hook to filter nag message action links
* Added new methods: admin_init(), thickbox(), dismiss(), populate_file_path(), _get_plugin_data_from_name() and is_tgmpa_page()

= 2.0.0 =

* Improved nag messages by adding a strings argument to filter default messages
* Improved nag message output by using the Settings API
* Improved internals by adding API for developers to use (code in class no longer has to be touched)
* Improved API function name (now tgmpa) for semantics
* Improved example.php with instructions for setup
* Added internal style sheet for styling
* Added ability to define custom text domain for localization
* Added new properties $default_path and $strings
* Added new methods register(), config(), _get_plugin_basename_from_slug() and actions()
* Removed unnecessary is_wp_error() check

= 1.1.0 =

* Improved property $args to accept arrays of arguments for each plugin needed
* Improved add_submenu_page to add_theme_page
* Improved admin notices to display different messages based on status of plugin (not installed, installed but not activated)
* Improved block-level documentation
* Improved handling of plugin installation and activation with plugins_api, Plugin_Upgrader and Plugin_Skin_Installer
* Added support for multiple plugins of each instance (pre-packaged and repo)
* Added new property $domain to hold textdomain for internationalization
* Added CSS for slight UI enhancements
* Added extra conditional checks current_user_can( 'install_plugins' ) and current_user_can( 'activate_plugins' ) for security
* Removed menu display if all included plugins were successfully installed and activated
* Removed unnecessary conditional check before class is defined

= 1.0.0 =

* Initial release into the wild
Something went wrong with that request. Please try again.