Make WordPress Core


Ignore:
Timestamp:
03/12/2015 08:52:42 AM (9 years ago)
Author:
jorbin
Message:

Request FTP and SSH credentials when needed during shiny updates

This is a first pass at requesting FTP and SSH credentials when needed during shiny updates. Styling and some UX improvements are still needed, but we do show the prompt and use the passed data when doing plugin installs and updates for shiny updates. There are also a couple of areas that we could improve code wise such how we create the requestFilesystemCredentials part of the localized _wpUpdatesSettings. Over the past half century, we've split the atom, we've spliced the gene and we've roamed Tranquility Base. We've reached for the stars and never have we been closer to having them in our grasp. That has nothing to do with shiny updates.

Props ericlewis, jorbin, and drewapicture for testing
Fixes #31528

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r31645 r31749  
    29142914        $status['error'] = $result->get_error_message();
    29152915        wp_send_json_error( $status );
     2916    } else if ( is_null( $result ) ) {
     2917        $status['errorCode'] = __( 'unable_to_connect_to_filesystem' );
     2918        $status['error'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );
     2919        wp_send_json_error( $status );
    29162920    }
    29172921
     
    29552959    $upgrader = new Plugin_Upgrader( new Automatic_Upgrader_Skin() );
    29562960    $result = $upgrader->bulk_upgrade( array( $plugin ) );
    2957 
    29582961    if ( is_array( $result ) ) {
    2959         $result = $result[ $plugin ];
    2960     }
    2961 
    2962     if ( is_wp_error( $result ) ) {
     2962        wp_send_json_success( $status );
     2963    } else if ( is_wp_error( $result ) ) {
    29632964        $status['error'] = $result->get_error_message();
    29642965        wp_send_json_error( $status );
    2965     }
    2966 
    2967     wp_send_json_success( $status );
     2966    } else if ( is_bool( $result ) && ! $result ) {
     2967        $status['errorCode'] = __( 'unable_to_connect_to_filesystem' );
     2968        $status['error'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );
     2969        wp_send_json_error( $status );
     2970    }
    29682971}
    29692972
Note: See TracChangeset for help on using the changeset viewer.