Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasgriffin committed Feb 3, 2012
2 parents e3238e3 + d6dbae9 commit 8dd7cab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 57 deletions.
6 changes: 5 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=== TGM Plugin Activation ===
Contributors: Thomas Griffin (@jthomasgriffin / thomasgriffinmedia.com)
Gary Jones (Github: @GaryJones / Twitter: GaryJ)
Version: 2.3.0
Version: 2.3.1
Requires at least: 3.0.0
Tested up to: 3.3.1

Expand Down Expand Up @@ -35,6 +35,10 @@ You can also follow project progress and updates on Twitter. Follow us here at h

== Changelog ==

= 2.3.1 =

* Fixed bug with not finding class (reverted back to Plugin_Upgrader)

= 2.3.0 =

* Improved sorting of plugins by sorting them by required/recommended (while still maintaining alphabetical order within each group)
Expand Down
57 changes: 2 additions & 55 deletions tgm-plugin-activation/class-tgm-plugin-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin installation and activation for WordPress themes.
*
* @package TGM-Plugin-Activation
* @version 2.3.0
* @version 2.3.1
* @author Thomas Griffin <[email protected]>
* @author Gary Jones <[email protected]>
* @copyright Copyright (c) 2012, Thomas Griffin
Expand Down Expand Up @@ -469,7 +469,7 @@ protected function do_plugin_install() {
$source = ( 'upload' == $type ) ? $this->default_path . $plugin['source'] : $plugin['source'];

/** Create a new instance of Plugin_Upgrader */
$upgrader = new TGM_Plugin_Installer( $skin = new Plugin_Installer_Skin( compact( 'type', 'title', 'url', 'nonce', 'plugin', 'api' ) ) );
$upgrader = new Plugin_Upgrader( $skin = new Plugin_Installer_Skin( compact( 'type', 'title', 'url', 'nonce', 'plugin', 'api' ) ) );

/** Perform the action and install the plugin from the $source urldecode() */
$upgrader->install( $source );
Expand Down Expand Up @@ -1587,59 +1587,6 @@ public function prepare_items() {
*/
if ( ! class_exists( 'WP_Upgrader' ) && isset( $_GET[sanitize_key( 'page' )] ) && TGM_Plugin_Activation::$instance->menu == $_GET[sanitize_key( 'page' )] ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';

if ( ! class_exists( 'TGM_Plugin_Installer' ) ) {
/**
* Installer class to handle singular plugin installations.
*
* Extends Plugin_Upgrader and customizes the install location.
*
* @since 2.3.0
*
* @package TGM-Plugin-Activation
* @author Thomas Griffin <[email protected]>
* @author Gary Jones <[email protected]>
*/
class TGM_Plugin_Installer extends Plugin_Upgrader {

/**
* Processes the plugin installation.
*
* @since 2.3.0
*
* @param array $package The plugin source needed for installation
* @param boolean $must_use Whether or not the plugin is a 'must-use' plugin
* @return null|boolean Return early on failure, installation success if true
*/
public function install( $package ) {

$this->init();
$this->install_strings();

add_filter( 'upgrader_source_selection', array( &$this, 'check_package' ) );

$this->run( array(
'package' => $package,
'destination' => WP_PLUGIN_DIR,
'clear_destination' => false,
'clear_working' => true,
'hook_extra' => array()
) );

remove_filter( 'upgrader_source_selection', array( &$this, 'check_package' ) );

if ( ! $this->result || is_wp_error( $this->result ) )
return $this->result;

// Force refresh of plugin update information
delete_site_transient( 'update_plugins' );

return true;

}

}
}

if ( ! class_exists( 'TGM_Bulk_Installer' ) ) {
/**
Expand Down
2 changes: 1 addition & 1 deletion tgm-plugin-activation/example.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @package TGM-Plugin-Activation
* @subpackage Example
* @version 2.3.0
* @version 2.3.1
* @author Thomas Griffin <[email protected]>
* @author Gary Jones <[email protected]>
* @copyright Copyright (c) 2012, Thomas Griffin
Expand Down

0 comments on commit 8dd7cab

Please sign in to comment.