diff --git a/includes/class-freemius.php b/includes/class-freemius.php index 6fc8bd9a..1cd9f925 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -19869,8 +19869,10 @@ private function _store_plans( $store = true ) { // Copy plans. $encrypted_plans = array(); - for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) { - $encrypted_plans[] = self::_encrypt_entity( $this->_plans[ $i ] ); + if ( is_array( $this->_plans ) ) { + for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) { + $encrypted_plans[] = self::_encrypt_entity( $this->_plans[ $i ] ); + } } $plans[ $this->_slug ] = $encrypted_plans; diff --git a/includes/entities/class-fs-site.php b/includes/entities/class-fs-site.php index 9b35f328..b288b605 100755 --- a/includes/entities/class-fs-site.php +++ b/includes/entities/class-fs-site.php @@ -119,7 +119,7 @@ class FS_Site extends FS_Scope_Entity { function __construct( $site = false ) { parent::__construct( $site ); - if ( is_object( $site ) ) { + if ( is_object( $site ) && isset( $site->plan_id ) ) { $this->plan_id = $site->plan_id; }