diff --git a/README.md b/README.md index 04579a7..e4c4450 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ if ( ! class_exists( 'SureCart\Licensing\Client' ) ) { } ``` +**Note:** Every plugin or theme that bundles the SDK shares the `SureCart\Licensing` namespace, so whichever copy loads first is used by all of them. An older copy bundled elsewhere can override fixes in yours. We recommend prefixing the namespace with a scoper such as [Strauss](https://github.com/BrianHenryIE/strauss) or [PHP-Scoper](https://github.com/humbug/php-scoper) when bundling. + ## Include a release.json Add a `release.json` file to the root of your plugin or theme project. diff --git a/src/Client.php b/src/Client.php index 935508a..92871dd 100644 --- a/src/Client.php +++ b/src/Client.php @@ -12,7 +12,7 @@ class Client { * * @var string */ - public $version = '1.2.2'; + public $version = '1.2.3'; /** * Name of the plugin diff --git a/src/Settings.php b/src/Settings.php index 5924986..9d0c35f 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -413,6 +413,11 @@ public function redirect( $url ) { * @return void */ public function add_notice( $code, $message, $type = 'info' ) { + // Only loaded in wp-admin; the settings page re-runs get_activation() on render. + if ( ! function_exists( 'add_settings_error' ) ) { + return; + } + add_settings_error( $this->name . '_license_options', // matches what we registered in `register_setting. $code, // the error code.