From 85ff767130fb49fc8c2243dfb708d2095d87db8a Mon Sep 17 00:00:00 2001 From: Ramya krishna Date: Wed, 21 Aug 2024 17:29:52 +0530 Subject: [PATCH] linting --- includes/Services/InstaMigrateService.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/includes/Services/InstaMigrateService.php b/includes/Services/InstaMigrateService.php index 9c6b0bc..9db91e3 100644 --- a/includes/Services/InstaMigrateService.php +++ b/includes/Services/InstaMigrateService.php @@ -68,19 +68,15 @@ public function install_instawp_connect() { if ( empty( Helper::get_connect_id() ) ) { $connect_response = Helper::instawp_generate_api_key( $this->insta_api_key ); - if ( ! $connect_response || empty( Helper::get_connect_id() ) ) { - if ( $this->count < 3 ) { - $this->count++; + if ( empty( Helper::get_connect_id() ) && $this->count < 3 ) { + ++$this->count; delete_option( 'instawp_api_options' ); // delete the connection to plugin and website sleep( 1 ); self::install_instawp_connect(); - } else { - return new \WP_Error( 'Bad request', esc_html__( 'Connect plugin is installed but no connect ID.' ), array( 'status' => 400 ) ); - } + } else { + return new \WP_Error( 'Bad request', esc_html__( 'Connect plugin is installed but no connect ID.' ), array( 'status' => 400 ) ); } } - - return array( 'message' => esc_html__( 'Connect plugin is installed and ready to start the migration.' ), 'response' => true,