includes/class-freemius.php
function _add_deactivation_feedback_dialog_box() {
            /* Check the type of user:
			 * 1. Long-term (long-term)
			 * 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term).
			 * 3. Short-term (short-term)
			 */
            $is_long_term_user = true;

            // Check if the site is at least 2 days old.
            $time_installed = $this->_storage->install_timestamp;

            // Difference in seconds.
            $date_diff = time() - $time_installed;

            // Convert seconds to days.
            $date_diff_days = floor( $date_diff / ( 60 * 60 * 24 ) );

            if ( $date_diff_days < 2 ) {
                $is_long_term_user = false;
            }

            $is_long_term_user = $this->apply_filters( 'is_long_term_user', $is_long_term_user );

            if ( $is_long_term_user ) {
                $user_type = 'long-term';
            } else {
                if ( ! $this->is_registered() && ! $this->is_anonymous() ) {
                    $user_type = 'non-registered-and-non-anonymous-short-term';
                } else {
                    $user_type = 'short-term';
                }
            }

            $uninstall_reasons = $this->_get_uninstall_reasons( $user_type );

            // Load the HTML template for the deactivation feedback dialog box.
            $vars = array(
                'reasons' => $uninstall_reasons,
                'id'      => $this->_module_id
            );

            /**
             * @todo Deactivation form core functions should be loaded only once! Otherwise, when there are multiple Freemius powered plugins the same code is loaded multiple times. The only thing that should be loaded differently is the various deactivation reasons object based on the state of the plugin.
             */
            fs_require_template( 'forms/deactivation/form.php', $vars );
        }
function _add_deactivation_feedback_dialog_box() {
            /* Check the type of user:
			 * 1. Long-term (long-term)
			 * 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term).
			 * 3. Short-term (short-term)
			 */
            $is_long_term_user = true;

            // Check if the site is at least 2 days old.
            $time_installed = $this->_storage->install_timestamp;

            // Difference in seconds.
            $date_diff = time() - $time_installed;

            // Convert seconds to days.
            $date_diff_days = floor( $date_diff / ( 60 * 60 * 24 ) );

            if ( $date_diff_days < 2 ) {
                $is_long_term_user = false;
            }

            $is_long_term_user = $this->apply_filters( 'is_long_term_user', $is_long_term_user );

            if ( $is_long_term_user ) {
                $user_type = 'long-term';
            } else {
                if ( ! $this->is_registered() && ! $this->is_anonymous() ) {
                    $user_type = 'non-registered-and-non-anonymous-short-term';
                } else {
                    $user_type = 'short-term';
                }
            }

            $uninstall_reasons = $this->_get_uninstall_reasons( $user_type );

            // Load the HTML template for the deactivation feedback dialog box.
            $vars = array(
                'reasons' => $uninstall_reasons,
                'id'      => $this->_module_id
            );

            /**
             * @todo Deactivation form core functions should be loaded only once! Otherwise, when there are multiple Freemius powered plugins the same code is loaded multiple times. The only thing that should be loaded differently is the various deactivation reasons object based on the state of the plugin.
             */
            fs_require_template( 'forms/deactivation/form.php', $vars );
        }
function _add_deactivation_feedback_dialog_box ( ) { /* Check the type of user:
			 * 1. Long-term (long-term)
			 * 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term).
			 * 3. Short-term (short-term)
			 */ $ is_long_term_user = true ; // Check if the site is at least 2 days old.
 $ time_installed = $ this -> _storage -> install_timestamp ; // Difference in seconds.
 $ date_diff = time ( ) - $ time_installed ; // Convert seconds to days.
 $ date_diff_days = floor ( $ date_diff / ( 60 * 60 * 24 ) ) ; if ( $ date_diff_days < 2 ) { $ is_long_term_user = false ; } $ is_long_term_user = $ this -> apply_filters ( 'is_long_term_user' , $ is_long_term_user ) ; if ( $ is_long_term_user ) { $ user_type = 'long-term' ; } else { if ( ! $ this -> is_registered ( ) && ! $ this -> is_anonymous ( ) ) { $ user_type = 'non-registered-and-non-anonymous-short-term' ; } else { $ user_type = 'short-term' ; } } $ uninstall_reasons = $ this -> _get_uninstall_reasons ( $ user_type ) ; // Load the HTML template for the deactivation feedback dialog box.
 $ vars = array ( 'reasons' => $ uninstall_reasons , 'id' => $ this -> _module_id ) ; /**
             * @todo Deactivation form core functions should be loaded only once! Otherwise, when there are multiple Freemius powered plugins the same code is loaded multiple times. The only thing that should be loaded differently is the various deactivation reasons object based on the state of the plugin.
             */ fs_require_template ( 'forms/deactivation/form.php' , $ vars ) ; }
Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins
page.

@author Vova Feldman (@svovaf)
@author Leo Fajardo (@leorw)
@since  1.1.2
Displays a confirmation and feedback dialog box when the user clicks on the Deactivate link on the plugins page .