Skip to content

Commit 39e49f0

Browse files
committed
updated to v2.3.6 to fix API error when installing a single plugin from an externally hosted source
1 parent 67ef217 commit 39e49f0

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

README

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
=== TGM Plugin Activation ===
22
Contributors: Thomas Griffin (@jthomasgriffin / thomasgriffinmedia.com)
33
Gary Jones (Github: @GaryJones / Twitter: GaryJ)
4-
Version: 2.3.5
4+
Version: 2.3.6
55
Requires at least: 3.0.0
6-
Tested up to: 3.3.1
6+
Tested up to: 3.4-beta3
77

88
== Description ==
99

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

3636
== Changelog ==
3737

38+
= 2.3.6 =
39+
40+
* Fixed API error when clicking on the plugin install row action link for an externally hosted plugin
41+
3842
= 2.3.5 =
3943

4044
* Fixed nag message not working when nag_type string was not set (props @jeffsebring)

tgm-plugin-activation/class-tgm-plugin-activation.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin installation and activation for WordPress themes.
44
*
55
* @package TGM-Plugin-Activation
6-
* @version 2.3.5
6+
* @version 2.3.6
77
* @author Thomas Griffin <thomas@thomasgriffinmedia.com>
88
* @author Gary Jones <gamajo@gamajo.com>
99
* @copyright Copyright (c) 2012, Thomas Griffin
@@ -445,14 +445,16 @@ protected function do_plugin_install() {
445445
require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // Need for plugins_api
446446
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; // Need for upgrade classes
447447

448-
$api = plugins_api( 'plugin_information', array( 'slug' => $plugin['slug'], 'fields' => array( 'sections' => false ) ) );
449-
450-
if ( is_wp_error( $api ) )
451-
wp_die( $this->strings['oops'] . var_dump( $api ) );
452-
453448
/** Set plugin source to WordPress API link if available */
454-
if ( isset( $plugin['source'] ) && 'repo' == $plugin['source'] && isset( $api->download_link ) )
455-
$plugin['source'] = $api->download_link;
449+
if ( isset( $plugin['source'] ) && 'repo' == $plugin['source'] ) {
450+
$api = plugins_api( 'plugin_information', array( 'slug' => $plugin['slug'], 'fields' => array( 'sections' => false ) ) );
451+
452+
if ( is_wp_error( $api ) )
453+
wp_die( $this->strings['oops'] . var_dump( $api ) );
454+
455+
if ( isset( $api->download_link ) )
456+
$plugin['source'] = $api->download_link;
457+
}
456458

457459
/** Set type, based on whether the source starts with http:// or https:// */
458460
$type = preg_match( '|^http(s)?://|', $plugin['source'] ) ? 'web' : 'upload';

tgm-plugin-activation/example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* @package TGM-Plugin-Activation
1010
* @subpackage Example
11-
* @version 2.3.5
11+
* @version 2.3.6
1212
* @author Thomas Griffin <thomas@thomasgriffinmedia.com>
1313
* @author Gary Jones <gamajo@gamajo.com>
1414
* @copyright Copyright (c) 2012, Thomas Griffin

0 commit comments

Comments
 (0)