Skip to content

Commit

Permalink
Merge pull request #38 from nurul-umbhiya/patch-4
Browse files Browse the repository at this point in the history
fix: prevent fatal error if used with old version of Appsero Client
  • Loading branch information
anisAronno authored Jan 30, 2024
2 parents 769b617 + 4d24dbc commit cc0224c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,26 @@ public function insights() {
return $this->insights;
}

/**
* Initialize plugin/theme updater
*
* @return void
*/
public function updater() {
// do not show update notice on ajax request and rest api request
if ( wp_doing_ajax() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {
return;
}

// show deprecated notice
_deprecated_function( __CLASS__ . '::updater', '2.0', '\Appsero\Updater::init($client);, for more details please visit: https://appsero.com/docs/appsero-developers-guide/appsero-client/appsero-sdk-updater-changes/' );

// initialize the new updater
if ( method_exists( '\Appsero\Updater', 'init' ) ) {
\Appsero\Updater::init( $this );
}
}

/**
* Initialize license checker
*
Expand Down

0 comments on commit cc0224c

Please sign in to comment.