Skip to content

Commit

Permalink
[opt-in] Fixed an issue with the opt-in moderation and API connectivi…
Browse files Browse the repository at this point in the history
…ty test logic.
  • Loading branch information
fajardoleo committed May 22, 2024
1 parent 689fd56 commit ecb9475
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions includes/class-freemius.php
Original file line number Diff line number Diff line change
Expand Up @@ -4174,13 +4174,17 @@ function has_api_connectivity( $flush_if_no_connectivity = false ) {
! empty( $this->_storage->connectivity_test ) &&
isset( $this->_storage->connectivity_test['is_active'] )
) {
$is_active = $this->_storage->connectivity_test['is_active'];
$is_connected = isset( $this->_storage->connectivity_test['is_connected'] ) ?
$this->_storage->connectivity_test['is_connected'] :
null;
$is_active = ( $this->_storage->connectivity_test['is_active'] || is_object( $this->_site ) );
} else {
$is_active = $this->should_turn_fs_on( $this->apply_filters( 'is_plugin_update', $this->is_plugin_update() ) );

$this->store_connectivity_info( (object) array( 'is_active' => $is_active ), null );
$is_connected = null;
$is_active = $this->should_turn_fs_on( $this->apply_filters( 'is_plugin_update', $this->is_plugin_update() ) );
}

$this->store_connectivity_info( (object) array( 'is_active' => $is_active ), $is_connected );

if ( $is_active ) {
$this->_is_on = true;
}
Expand Down Expand Up @@ -5484,7 +5488,11 @@ private function parse_settings( &$plugin_info ) {
'affiliate_moderation' => $this->get_option( $plugin_info, 'has_affiliation' ),
'bundle_id' => $this->get_option( $plugin_info, 'bundle_id', null ),
'bundle_public_key' => $this->get_option( $plugin_info, 'bundle_public_key', null ),
'opt_in_moderation' => $this->get_option( $plugin_info, 'opt_in', null ),
'opt_in_moderation' => $this->get_option(
$plugin_info,
'opt_in',
$this->get_option( $plugin_info, 'opt_in_moderation', null )
),
) );

if ( $plugin->is_updated() ) {
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.7.2';
$this_sdk_version = '2.7.2.1';

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

Expand Down

0 comments on commit ecb9475

Please sign in to comment.