diff --git a/includes/admin/helpers/class-rop-post-format-helper.php b/includes/admin/helpers/class-rop-post-format-helper.php index 91c41f35..0590d95b 100644 --- a/includes/admin/helpers/class-rop-post-format-helper.php +++ b/includes/admin/helpers/class-rop-post-format-helper.php @@ -1033,9 +1033,10 @@ public function build_image( $post_id ) { * * @return string */ - public function get_short_url( $url, $short_url_service, $credentials = array() ) { + public function get_short_url( $url, $short_url_service, $credentials = array() ) { try { + $shortner_factory = new Rop_Shortner_Factory(); $shortner_service = $shortner_factory->build( $short_url_service ); if ( ! empty( $credentials ) ) { $shortner_service->set_credentials( $credentials ); @@ -1043,7 +1044,7 @@ public function get_short_url( $url, $short_url_service, $credentials = array() $short_url = $shortner_service->shorten_url( $url ); } catch ( Exception $exception ) { $log = new Rop_Logger(); - $log->alert_error( 'Could NOT get short URL. Error: ' . $exception->getMessage() ); + $log->alert_error( 'Could NOT get short URL for option <' . $short_url_service . '>. Error: ' . $exception->getMessage() ); $short_url = $url; }