includes/class-freemius.php
function delete_account_event( $check_user = true ) {
            $this->_logger->entrance( 'slug = ' . $this->_slug );

            if ( $check_user && ! $this->is_user_admin() ) {
                return;
            }

            $this->do_action( 'before_account_delete' );

            // Clear all admin notices.
            $this->_admin_notices->clear_all_sticky( false );

            $this->_delete_site( false );

            $delete_network_common_data = true;

            if ( $this->_is_network_active ) {
                $installs = $this->get_blog_install_map();

                // Don't delete common network data unless no other installs left.
                $delete_network_common_data = empty( $installs );
            }

            if ( $delete_network_common_data ) {
                $this->_delete_plans( false );

                $this->_delete_licenses( false );

                // Delete add-ons related to plugin's account.
                $this->_delete_account_addons( false );
            }

            // @todo Delete plans and licenses of add-ons.

            self::$_accounts->store();

            /**
             * IMPORTANT:
             *  Clear crons must be executed before clearing all storage.
             *  Otherwise, the cron will not be cleared.
             */
            if ( $delete_network_common_data ) {
                $this->clear_sync_cron();
            }

            $this->clear_install_sync_cron();

            // Clear all storage data.
            $this->_storage->clear_all( true, array(
                'connectivity_test',
                'is_on',
            ), false );

            // Send delete event.
            $this->get_api_site_scope()->call( '/', 'delete' );

            $this->do_action( 'after_account_delete' );
        }
function delete_account_event( $check_user = true ) {
            $this->_logger->entrance( 'slug = ' . $this->_slug );

            if ( $check_user && ! $this->is_user_admin() ) {
                return;
            }

            $this->do_action( 'before_account_delete' );

            // Clear all admin notices.
            $this->_admin_notices->clear_all_sticky( false );

            $this->_delete_site( false );

            $delete_network_common_data = true;

            if ( $this->_is_network_active ) {
                $installs = $this->get_blog_install_map();

                // Don't delete common network data unless no other installs left.
                $delete_network_common_data = empty( $installs );
            }

            if ( $delete_network_common_data ) {
                $this->_delete_plans( false );

                $this->_delete_licenses( false );

                // Delete add-ons related to plugin's account.
                $this->_delete_account_addons( false );
            }

            // @todo Delete plans and licenses of add-ons.

            self::$_accounts->store();

            /**
             * IMPORTANT:
             *  Clear crons must be executed before clearing all storage.
             *  Otherwise, the cron will not be cleared.
             */
            if ( $delete_network_common_data ) {
                $this->clear_sync_cron();
            }

            $this->clear_install_sync_cron();

            // Clear all storage data.
            $this->_storage->clear_all( true, array(
                'connectivity_test',
                'is_on',
            ), false );

            // Send delete event.
            $this->get_api_site_scope()->call( '/', 'delete' );

            $this->do_action( 'after_account_delete' );
        }
function delete_account_event ( $ check_user = true ) { $ this -> _logger -> entrance ( 'slug = ' . $ this -> _slug ) ; if ( $ check_user && ! $ this -> is_user_admin ( ) ) { return ; } $ this -> do_action ( 'before_account_delete' ) ; // Clear all admin notices.
 $ this -> _admin_notices -> clear_all_sticky ( false ) ; $ this -> _delete_site ( false ) ; $ delete_network_common_data = true ; if ( $ this -> _is_network_active ) { $ installs = $ this -> get_blog_install_map ( ) ; // Don't delete common network data unless no other installs left.
 $ delete_network_common_data = empty ( $ installs ) ; } if ( $ delete_network_common_data ) { $ this -> _delete_plans ( false ) ; $ this -> _delete_licenses ( false ) ; // Delete add-ons related to plugin's account.
 $ this -> _delete_account_addons ( false ) ; } // @todo Delete plans and licenses of add-ons.
 self :: $ _accounts -> store ( ) ; /**
             * IMPORTANT:
             *  Clear crons must be executed before clearing all storage.
             *  Otherwise, the cron will not be cleared.
             */ if ( $ delete_network_common_data ) { $ this -> clear_sync_cron ( ) ; } $ this -> clear_install_sync_cron ( ) ; // Clear all storage data.
 $ this -> _storage -> clear_all ( true , array ( 'connectivity_test' , 'is_on' , ) , false ) ; // Send delete event.
 $ this -> get_api_site_scope ( ) -> call ( '/' , 'delete' ) ; $ this -> do_action ( 'after_account_delete' ) ; }
Delete account.

@author Vova Feldman (@svovaf)
@since  1.0.3

@param bool $check_user Enforce checking if user have plugins activation privileges.
Delete account .