Skip to content

Commit

Permalink
fix: prevent fatal error if used with old version of Appsero Client
Browse files Browse the repository at this point in the history
  • Loading branch information
nurul-umbhiya authored Jan 29, 2024
1 parent 769b617 commit a360c00
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, for more details please visit: https://app.getwemail.io/campaigns/94eef570-bc95-448f-9178-1386f009b2d9' );

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

/**
* Initialize license checker
*
Expand Down

0 comments on commit a360c00

Please sign in to comment.