Skip to content

Commit

Permalink
Added suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ramyakrishnai committed Aug 21, 2024
1 parent 853d4fa commit 190a609
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions includes/Services/InstaMigrateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class InstaMigrateService {
/**
* Retry count
*
* @var $count
* @var int $count
*/
private $count = 0;

Expand Down Expand Up @@ -81,9 +81,10 @@ public function install_instawp_connect() {
if ( function_exists( 'instawp' ) ) {
// Check if there is a connect ID
if ( empty( Helper::get_connect_id() ) ) {
if ( $count < 2 ) {
$count++;
delete_option( 'instawp_api_options' );
if ( $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 ) );
Expand Down

0 comments on commit 190a609

Please sign in to comment.