Skip to content

Commit

Permalink
Added a boolean parameter to get_plan_by_id to avoid calling sync_pla…
Browse files Browse the repository at this point in the history
…ns when coming from sync_plan
  • Loading branch information
DanieleAlessandra committed Oct 2, 2024
1 parent 2f941a9 commit 9ccdc32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions includes/class-freemius.php
Original file line number Diff line number Diff line change
Expand Up @@ -11496,7 +11496,7 @@ function _sync_plans() {
continue;
}

$missing_plan = self::_get_plan_by_id( $plan_id );
$missing_plan = self::_get_plan_by_id( $plan_id, false );

if ( is_object( $missing_plan ) ) {
$plans[] = $missing_plan;
Expand Down Expand Up @@ -11658,10 +11658,10 @@ private function get_license_ids_associated_with_installs() {
*
* @return FS_Plugin_Plan|false
*/
function _get_plan_by_id( $id ) {
function _get_plan_by_id( $id, $allow_sync = true ) {
$this->_logger->entrance();

if ( ! is_array( $this->_plans ) || 0 === count( $this->_plans ) ) {
if ( $allow_sync && ( ! is_array( $this->_plans ) || 0 === count( $this->_plans ) ) ) {
$this->_sync_plans();
}

Expand Down
2 changes: 1 addition & 1 deletion start.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @var string
*/
$this_sdk_version = '2.8.1.1';
$this_sdk_version = '2.8.1.2';

#region SDK Selection Logic --------------------------------------------------------------------

Expand Down

0 comments on commit 9ccdc32

Please sign in to comment.