Permalink
Browse files

Fix error reporting

* Fix error reporting when installing and activating plugins
* Fix Theme Test Drive filename
  • Loading branch information...
SergeyBiryukov committed Mar 7, 2013
1 parent 4611242 commit 750025709f85532998d9f3bb96dc820df4623c11
Showing with 5 additions and 4 deletions.
  1. +5 −4 developer.php
View
@@ -160,6 +160,7 @@ public function admin_init() {
'project_type' => 'wporg-theme',
'name' => esc_html__( 'Theme Test Drive', 'a8c-developer' ),
'active' => function_exists( 'TTD_filters' ),
+ 'filename' => 'themedrive.php',
),
'theme-check' => array(
'project_type' => 'wporg-theme',
@@ -350,7 +351,7 @@ public function ajax_handler( $action ) {
$api = plugins_api( 'plugin_information', array( 'slug' => $_POST['plugin_slug'], 'fields' => array( 'sections' => false ) ) );
if ( is_wp_error( $api ) )
- die( sprintf( __( 'ERROR: Error fetching plugin information: %s', 'a8c-developer' ), $api->get_error_message( $api ) ) );
+ die( sprintf( __( 'ERROR: Error fetching plugin information: %s', 'a8c-developer' ), $api->get_error_message() ) );
$upgrader = new Plugin_Upgrader( new Automattic_Developer_Empty_Upgrader_Skin( array(
'nonce' => 'install-plugin_' . $_POST['plugin_slug'],
@@ -361,12 +362,12 @@ public function ajax_handler( $action ) {
$install_result = $upgrader->install( $api->download_link );
if ( ! $install_result || is_wp_error( $install_result ) )
- die( sprintf( __( 'ERROR: Failed to install plugin: %s', 'a8c-developer' ), $install_result->get_error_message( $install_result ) ) );
+ die( sprintf( __( 'ERROR: Failed to install plugin: %s', 'a8c-developer' ), $install_result->get_error_message() ) );
$activate_result = activate_plugin( $this->get_path_for_recommended_plugin( $_POST['plugin_slug'] ) );
if ( is_wp_error( $activate_result ) )
- die( sprintf( __( 'ERROR: Failed to activate plugin: %s', 'a8c-developer' ), $activate_result->get_error_message( $activate_result ) ) );
+ die( sprintf( __( 'ERROR: Failed to activate plugin: %s', 'a8c-developer' ), $activate_result->get_error_message() ) );
exit( '1' );
@@ -382,7 +383,7 @@ public function ajax_handler( $action ) {
$activate_result = activate_plugin( $_POST['path'] );
if ( is_wp_error( $activate_result ) )
- die( sprintf( __( 'ERROR: Failed to activate plugin: %s', 'a8c-developer' ), $activate_result->get_error_message( $activate_result ) ) );
+ die( sprintf( __( 'ERROR: Failed to activate plugin: %s', 'a8c-developer' ), $activate_result->get_error_message() ) );
exit( '1' );
}

0 comments on commit 7500257

Please sign in to comment.