Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ramyakrishnai committed Aug 21, 2024
1 parent a83b10b commit 85ff767
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions includes/Services/InstaMigrateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 85ff767

Please sign in to comment.