diff --git a/src/Client.php b/src/Client.php index 0dc3a1e..7e1c64a 100644 --- a/src/Client.php +++ b/src/Client.php @@ -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 *