includes/class-freemius.php
function _maybe_add_subscription_cancellation_dialog_box( $is_license_deactivation = false ) {
            if ( fs_is_network_admin() ) {
                // Subscription cancellation dialog box is currently not supported for multisite networks.
                return;
            }

            $license = $this->_get_license();

            /**
             * If the installation is associated with a non-lifetime license, which is either a single-site or only activated on a single production site (or zero), and connected to an active subscription, suggest the customer to cancel the subscription upon deactivation.
             *
             * @author Leo Fajardo (@leorw) (Comment added by Vova Feldman @svovaf)
             * @since 2.2.1
             */
            if ( ! is_object( $license ) ||
                $license->is_lifetime() ||
                ( ! $license->is_single_site() && $license->activated > 1 )
            ) {
                return;
            }

            /**
             * @var FS_Subscription $subscription
             */
            $subscription = $this->_get_subscription( $license->id );
            if ( ! is_object( $subscription ) || ! $subscription->is_active() ) {
                return;
            }

            $vars = array(
                'id'                      => $this->_module_id,
                'license'                 => $license,
                'has_trial'               => $this->is_paid_trial(),
                'is_license_deactivation' => $is_license_deactivation,
            );

            fs_require_template( 'forms/subscription-cancellation.php', $vars );
        }
function _maybe_add_subscription_cancellation_dialog_box( $is_license_deactivation = false ) {
            if ( fs_is_network_admin() ) {
                // Subscription cancellation dialog box is currently not supported for multisite networks.
                return;
            }

            $license = $this->_get_license();

            /**
             * If the installation is associated with a non-lifetime license, which is either a single-site or only activated on a single production site (or zero), and connected to an active subscription, suggest the customer to cancel the subscription upon deactivation.
             *
             * @author Leo Fajardo (@leorw) (Comment added by Vova Feldman @svovaf)
             * @since 2.2.1
             */
            if ( ! is_object( $license ) ||
                $license->is_lifetime() ||
                ( ! $license->is_single_site() && $license->activated > 1 )
            ) {
                return;
            }

            /**
             * @var FS_Subscription $subscription
             */
            $subscription = $this->_get_subscription( $license->id );
            if ( ! is_object( $subscription ) || ! $subscription->is_active() ) {
                return;
            }

            $vars = array(
                'id'                      => $this->_module_id,
                'license'                 => $license,
                'has_trial'               => $this->is_paid_trial(),
                'is_license_deactivation' => $is_license_deactivation,
            );

            fs_require_template( 'forms/subscription-cancellation.php', $vars );
        }
function _maybe_add_subscription_cancellation_dialog_box ( $ is_license_deactivation = false ) { if ( fs_is_network_admin ( ) ) { // Subscription cancellation dialog box is currently not supported for multisite networks.
 return ; } $ license = $ this -> _get_license ( ) ; /**
             * If the installation is associated with a non-lifetime license, which is either a single-site or only activated on a single production site (or zero), and connected to an active subscription, suggest the customer to cancel the subscription upon deactivation.
             *
             * @author Leo Fajardo (@leorw) (Comment added by Vova Feldman @svovaf)
             * @since 2.2.1
             */ if ( ! is_object ( $ license ) || $ license -> is_lifetime ( ) || ( ! $ license -> is_single_site ( ) && $ license -> activated > 1 ) ) { return ; } /**
             * @var FS_Subscription $subscription
             */ $ subscription = $ this -> _get_subscription ( $ license -> id ) ; if ( ! is_object ( $ subscription ) || ! $ subscription -> is_active ( ) ) { return ; } $ vars = array ( 'id' => $ this -> _module_id , 'license' => $ license , 'has_trial' => $ this -> is_paid_trial ( ) , 'is_license_deactivation' => $ is_license_deactivation , ) ; fs_require_template ( 'forms/subscription-cancellation.php' , $ vars ) ; }
Displays a subscription cancellation dialog box when the user clicks on the "Deactivate License"
link on the "Account" page or deactivates a plugin and there's an active subscription that is
either associated with a non-lifetime single-site license or non-lifetime multisite license that
is only activated on a single production site.

@author Leo Fajardo (@leorw)
@since  2.2.1

@param bool $is_license_deactivation
Displays a subscription cancellation dialog box when the user clicks on the Deactivate License link on the Account page or deactivates a plugin and there s an active subscription that is either associated with a non - lifetime single - site license or non - lifetime multisite license that is only activated on a single production site .