Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for two credentials bugs #51

Merged
merged 1 commit into from
Oct 18, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 16 additions & 16 deletions tgm-plugin-activation/class-tgm-plugin-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ public function init() {

/** Proceed only if we have plugins to handle */
if ( $this->plugins ) {

$sorted = array(); // Prepare variable for sorting

foreach ( $this->plugins as $plugin )
$sorted[] = $plugin['name'];

array_multisort( $sorted, SORT_ASC, $this->plugins ); // Sort plugins alphabetically by name

add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
Expand Down Expand Up @@ -213,18 +213,18 @@ function admin_init() {
return;

if ( isset( $_REQUEST['tab'] ) && 'plugin_information' == $_REQUEST['tab'] ) {

require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // Need for install_plugin_information()

wp_enqueue_style( 'plugin-install' );

global $tab, $body_id;
$body_id = $tab = 'plugin-information';

install_plugin_information();

exit;

}

}
Expand Down Expand Up @@ -314,7 +314,7 @@ public function install_plugins_page() {
?>
<form action="" method="post">
<?php
wp_nonce_field( 'tgmpa', 'tgmpa_nonce' );
wp_nonce_field( 'tgmpa' );
submit_button(
sprintf(
$this->strings['button'],
Expand Down Expand Up @@ -357,7 +357,7 @@ protected function do_plugin_install() {
if ( empty( $_POST ) ) // Bail out if the global $_POST is empty
return false;

check_admin_referer( 'tgmpa', 'tgmpa_nonce' ); // Security check
check_admin_referer( 'tgmpa' ); // Security check

foreach ( $this->plugins as $plugin ) { // Iterate and perform the action for each plugin in the array

Expand All @@ -366,13 +366,13 @@ protected function do_plugin_install() {

if ( isset( $_POST[sanitize_key( $plugin['name'] )] ) ) { // Don't do anything if the form has not been submitted

$url = wp_nonce_url( 'themes.php?page=' . $this->menu, 'tgm_pa' ); // Make sure we are coming from the right page
$url = wp_nonce_url( 'themes.php?page=' . $this->menu, 'tgmpa' ); // Make sure we are coming from the right page
if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, $fields ) ) )
return true;

if ( ! WP_Filesystem( $creds ) ) {

request_filesystem_credentials( $url, $method, false, false, $fields ); // Setup WP_Filesystem
request_filesystem_credentials( $url, $method, true, false, $fields ); // Setup WP_Filesystem
return true;

}
Expand Down Expand Up @@ -508,7 +508,7 @@ public function notices() {
$rendered = ''; // Display all nag messages as strings

foreach ( $message as $type => $plugin_groups ) { // Grab all plugin names

$linked_plugin_groups = array();

/** Loop through the plugin names to make the ones pulled from the .org repo linked */
Expand All @@ -531,12 +531,12 @@ public function notices() {
}
else
$linked_plugin_groups[] .= $plugin_group_single_name; // No hyperlink

if ( isset( $linked_plugin_groups) && (array) $linked_plugin_groups )
$plugin_groups = $linked_plugin_groups;

}

$linked_plugin_groups[] = &$plugin_groups; // Pass reference back to original variable to keep conditionals in tact

$last_plugin = array_pop( $plugin_groups ); // Pop off last name to prep for readability
Expand Down