includes/class-freemius.php
function _submit_uninstall_reason_action() {
            $this->_logger->entrance();

            $this->check_ajax_referer( 'submit_uninstall_reason' );

            $reason_id = fs_request_get( 'reason_id' );

            // Check if the given reason ID is an unsigned integer.
            if ( ! ctype_digit( $reason_id ) ) {
                exit;
            }

            $reason_info = trim( fs_request_get( 'reason_info', '' ) );
            if ( ! empty( $reason_info ) ) {
                $reason_info = substr( $reason_info, 0, 128 );
            }

            $reason = (object) array(
                'id'           => $reason_id,
                'info'         => $reason_info,
                'is_anonymous' => fs_request_get_bool( 'is_anonymous' )
            );

            $this->_storage->store( 'uninstall_reason', $reason );

            /**
             * If the module type is "theme", trigger the uninstall event here (on theme deactivation) since themes do
             * not support uninstall hook.
             *
             * @author Leo Fajardo (@leorw)
             * @since  1.2.2
             */
            if ( $this->is_theme() ) {
                if ( $this->is_premium() && ! $this->has_active_valid_license() ) {
                    FS_Plugin_Updater::instance( $this )->delete_update_data();
                }

                $this->_uninstall_plugin_event( false );
                $this->remove_sdk_reference();
            }

            // Print '1' for successful operation.
            echo 1;
            exit;
        }
function _submit_uninstall_reason_action() {
            $this->_logger->entrance();

            $this->check_ajax_referer( 'submit_uninstall_reason' );

            $reason_id = fs_request_get( 'reason_id' );

            // Check if the given reason ID is an unsigned integer.
            if ( ! ctype_digit( $reason_id ) ) {
                exit;
            }

            $reason_info = trim( fs_request_get( 'reason_info', '' ) );
            if ( ! empty( $reason_info ) ) {
                $reason_info = substr( $reason_info, 0, 128 );
            }

            $reason = (object) array(
                'id'           => $reason_id,
                'info'         => $reason_info,
                'is_anonymous' => fs_request_get_bool( 'is_anonymous' )
            );

            $this->_storage->store( 'uninstall_reason', $reason );

            /**
             * If the module type is "theme", trigger the uninstall event here (on theme deactivation) since themes do
             * not support uninstall hook.
             *
             * @author Leo Fajardo (@leorw)
             * @since  1.2.2
             */
            if ( $this->is_theme() ) {
                if ( $this->is_premium() && ! $this->has_active_valid_license() ) {
                    FS_Plugin_Updater::instance( $this )->delete_update_data();
                }

                $this->_uninstall_plugin_event( false );
                $this->remove_sdk_reference();
            }

            // Print '1' for successful operation.
            echo 1;
            exit;
        }
function _submit_uninstall_reason_action ( ) { $ this -> _logger -> entrance ( ) ; $ this -> check_ajax_referer ( 'submit_uninstall_reason' ) ; $ reason_id = fs_request_get ( 'reason_id' ) ; // Check if the given reason ID is an unsigned integer.
 if ( ! ctype_digit ( $ reason_id ) ) { exit ; } $ reason_info = trim ( fs_request_get ( 'reason_info' , '' ) ) ; if ( ! empty ( $ reason_info ) ) { $ reason_info = substr ( $ reason_info , 0 , 128 ) ; } $ reason = ( object ) array ( 'id' => $ reason_id , 'info' => $ reason_info , 'is_anonymous' => fs_request_get_bool ( 'is_anonymous' ) ) ; $ this -> _storage -> store ( 'uninstall_reason' , $ reason ) ; /**
             * If the module type is "theme", trigger the uninstall event here (on theme deactivation) since themes do
             * not support uninstall hook.
             *
             * @author Leo Fajardo (@leorw)
             * @since  1.2.2
             */ if ( $ this -> is_theme ( ) ) { if ( $ this -> is_premium ( ) && ! $ this -> has_active_valid_license ( ) ) { FS_Plugin_Updater :: instance ( $ this ) -> delete_update_data ( ) ; } $ this -> _uninstall_plugin_event ( false ) ; $ this -> remove_sdk_reference ( ) ; } // Print '1' for successful operation.
 echo 1 ; exit ; }
Called after the user has submitted his reason for deactivating the plugin.

@author Leo Fajardo (@leorw)
@since  1.1.2
Called after the user has submitted his reason for deactivating the plugin .