diff --git a/freemius-dashboard.php b/freemius-dashboard.php index 9a3371b..0fe3413 100644 --- a/freemius-dashboard.php +++ b/freemius-dashboard.php @@ -3,17 +3,17 @@ * Plugin Name: Freemius Customer Portal * Plugin URI: https://freemius.com/ * Description: Embeddable the Customer Portal for Freemius powered shops and products. - * Version: 1.0.0 + * Version: 1.0.2 * Author: Freemius * Author URI: https://freemius.com * License: MIT */ /** - * @package Freemius Cleanup + * @package Freemius Customer Portal * @copyright Copyright (c) 2018, Freemius, Inc. * @license https://opensource.org/licenses/mit MIT License - * @since 1.0.1 + * @since 1.0.2 */ if ( ! defined( 'ABSPATH' ) ) { @@ -84,10 +84,11 @@ function fs_members_dashboard_shortcode( $atts, $inner = null ) { // Clear cache on an hourly basis. date('Y-m-d H'); - $user_id = null; - $access_token = null; + $user_id = null; + $access_token = null; + $is_sso_active = class_exists( 'FS_SSO' ); - if ( is_user_logged_in() && class_exists( 'FS_SSO' ) ) { + if ( is_user_logged_in() && $is_sso_active ) { $sso = FS_SSO::instance(); $user_id = $sso->get_freemius_user_id(); @@ -119,15 +120,16 @@ function fs_members_dashboard_shortcode( $atts, $inner = null ) { $dashboard_params['token'] = $access_token; } + $open_params = ''; + if ( $is_sso_active ) { + $open_params = '{ afterLogout: function() { window.location.href = \'' . str_replace( '&', '&', wp_logout_url() ) . '\'; }}'; + } + return apply_filters( 'fs_members_dashboard', ' ');