Commit cb8886ef authored by John James Jacoby's avatar John James Jacoby

Add constant check for multisite license keys.

parent 4545ddca
......@@ -633,7 +633,27 @@ class Flox_Licensed_Product {
* @return string
*/
protected function get_license() {
return trim( get_option( $this->license_key(), false ) );
static $retval = false;
// Only calculate this one time per object
if ( false !== $retval ) {
return $retval;
}
// Get the license key & setup constant check
$key = $this->license_key();
$const = strtoupper( $key );
// Global constant
if ( defined( $const ) && ! empty( $const ) ) {
$retval = $const;
// Site option
} else {
$retval = get_option( $key, false );
}
return trim( $retval );
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment