Onboarding - Add extra plugin debug to plugin installation (https://github.com/woocommerce/woocommerce-admin/pull/3272)
* Add extra plugin debug to plugin installation * Add additional debug
This commit is contained in:
parent
940716d7f5
commit
631ffe240f
|
@ -199,7 +199,21 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
|
|||
)
|
||||
);
|
||||
|
||||
// Log extra debug for plugin installation.
|
||||
$logger = wc_get_logger();
|
||||
$logger_source = array(
|
||||
'source' => 'woocommerce-admin',
|
||||
);
|
||||
|
||||
if ( is_wp_error( $api ) ) {
|
||||
$logger->info(
|
||||
sprintf( 'The requested plugin `%s` could not be installed. plugins_api call failed.', sanitize_key( $slug ) ),
|
||||
$logger_source
|
||||
);
|
||||
$logger->debug(
|
||||
'api: ' . wc_print_r( $api, true ),
|
||||
$logger_source
|
||||
);
|
||||
return new \WP_Error( 'woocommerce_rest_plugin_install', __( 'The requested plugin could not be installed.', 'woocommerce-admin' ), 500 );
|
||||
}
|
||||
|
||||
|
@ -207,6 +221,22 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
|
|||
$result = $upgrader->install( $api->download_link );
|
||||
|
||||
if ( is_wp_error( $result ) || is_null( $result ) ) {
|
||||
$logger->info(
|
||||
sprintf( 'The requested plugin `%s` could not be installed. install call failed.', sanitize_key( $slug ) ),
|
||||
$logger_source
|
||||
);
|
||||
$logger->debug(
|
||||
'upgrader: ' . wc_print_r( $upgrader, true ),
|
||||
$logger_source
|
||||
);
|
||||
$logger->debug(
|
||||
'api: ' . wc_print_r( $api, true ),
|
||||
$logger_source
|
||||
);
|
||||
$logger->debug(
|
||||
'result: ' . wc_print_r( $result, true ),
|
||||
$logger_source
|
||||
);
|
||||
return new \WP_Error( 'woocommerce_rest_plugin_install', __( 'The requested plugin could not be installed.', 'woocommerce-admin' ), 500 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue