Permalink
Browse files

updated to v2.3.6 to fix API error when installing a single plugin fr…

…om an externally hosted source
  • Loading branch information...
1 parent 67ef217 commit 39e49f0cfc925437d6f057537971715c83a738f5 @thomasgriffin thomasgriffin committed Apr 23, 2012
Showing with 17 additions and 11 deletions.
  1. +6 −2 README
  2. +10 −8 tgm-plugin-activation/class-tgm-plugin-activation.php
  3. +1 −1 tgm-plugin-activation/example.php
View
@@ -1,9 +1,9 @@
=== TGM Plugin Activation ===
Contributors: Thomas Griffin (@jthomasgriffin / thomasgriffinmedia.com)
Gary Jones (Github: @GaryJones / Twitter: GaryJ)
-Version: 2.3.5
+Version: 2.3.6
Requires at least: 3.0.0
-Tested up to: 3.3.1
+Tested up to: 3.4-beta3
== Description ==
@@ -35,6 +35,10 @@ You can also follow project progress and updates on Twitter. Follow us here at h
== Changelog ==
+= 2.3.6 =
+
+* Fixed API error when clicking on the plugin install row action link for an externally hosted plugin
+
= 2.3.5 =
* Fixed nag message not working when nag_type string was not set (props @jeffsebring)
@@ -3,7 +3,7 @@
* Plugin installation and activation for WordPress themes.
*
* @package TGM-Plugin-Activation
- * @version 2.3.5
+ * @version 2.3.6
* @author Thomas Griffin <thomas@thomasgriffinmedia.com>
* @author Gary Jones <gamajo@gamajo.com>
* @copyright Copyright (c) 2012, Thomas Griffin
@@ -445,14 +445,16 @@ protected function do_plugin_install() {
require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // Need for plugins_api
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; // Need for upgrade classes
- $api = plugins_api( 'plugin_information', array( 'slug' => $plugin['slug'], 'fields' => array( 'sections' => false ) ) );
-
- if ( is_wp_error( $api ) )
- wp_die( $this->strings['oops'] . var_dump( $api ) );
-
/** Set plugin source to WordPress API link if available */
- if ( isset( $plugin['source'] ) && 'repo' == $plugin['source'] && isset( $api->download_link ) )
- $plugin['source'] = $api->download_link;
+ if ( isset( $plugin['source'] ) && 'repo' == $plugin['source'] ) {
+ $api = plugins_api( 'plugin_information', array( 'slug' => $plugin['slug'], 'fields' => array( 'sections' => false ) ) );
+
+ if ( is_wp_error( $api ) )
+ wp_die( $this->strings['oops'] . var_dump( $api ) );
+
+ if ( isset( $api->download_link ) )
+ $plugin['source'] = $api->download_link;
+ }
/** Set type, based on whether the source starts with http:// or https:// */
$type = preg_match( '|^http(s)?://|', $plugin['source'] ) ? 'web' : 'upload';
@@ -8,7 +8,7 @@
*
* @package TGM-Plugin-Activation
* @subpackage Example
- * @version 2.3.5
+ * @version 2.3.6
* @author Thomas Griffin <thomas@thomasgriffinmedia.com>
* @author Gary Jones <gamajo@gamajo.com>
* @copyright Copyright (c) 2012, Thomas Griffin

0 comments on commit 39e49f0

Please sign in to comment.