{"id":1823,"date":"2026-11-15T20:24:59","date_gmt":"2026-11-15T20:24:59","guid":{"rendered":"https:\/\/endofenthalpyonline.com\/?page_id=1823"},"modified":"2026-11-17T01:48:16","modified_gmt":"2026-11-17T01:48:16","slug":"delete-account-2","status":"publish","type":"page","link":"https:\/\/endofenthalpyonline.com\/?page_id=1823","title":{"rendered":"delete account"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"1823\" class=\"elementor elementor-1823\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-7a060e0 e-con-full e-flex e-con e-parent\" data-id=\"7a060e0\" data-element_type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t<div class=\"elementor-element elementor-element-8187331 elementor-widget__width-initial elementor-widget elementor-widget-html\" data-id=\"8187331\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<html>\r\n<head>\r\n    <link rel=\"stylesheet\" href=\"https:\/\/fonts.googleapis.com\/css2?family=Lumanosimo&display=swap\">\r\n\r\n    <style>\r\n        body {\r\n            background-attachment: scroll;\r\n            background-image: url(https:\/\/endofenthalpyonline.com\/wp-content\/uploads\/public\/oldpaper.png);\r\n        }\r\n\r\n        video {\r\n            position: fixed;\r\n            top: 0;\r\n            left: 0;\r\n            width: 100%;\r\n            height: 100%;\r\n            object-fit: cover;\r\n            z-index: -1;\r\n        }\r\n\r\n        .dangerbutton {\r\n            color: red;\r\n            background-color: #000000AA;\r\n            border-color: black;\r\n        }\r\n\r\n        .dangerbutton:hover:not(:disabled) {\r\n            background-color: red;\r\n            color: white;\r\n        }\r\n\r\n        .dangerbutton:disabled {\r\n            opacity: 0.5;\r\n            cursor: wait;\r\n        }\r\n\r\n        .login-form {\r\n            width: 50%;\r\n            text-align: center;\r\n            padding-right: 1%;\r\n        }\r\n\r\n        #message { color: red; }\r\n\r\n        #identifier, #password { width: 100%; }\r\n\r\n        #adminnote { color: darkred; font-weight: bold; }\r\n\r\n        .hidden { display: none; }\r\n    <\/style>\r\n\r\n    <script>\r\n        const BASE_URL = 'https:\/\/endofenthalpyonline.com\/wp-json\/custom\/v1\/';\r\n\r\n        \/\/ WordPress core returns a REST nonce here for logged-in users (plain text), and an error for visitors.\r\n        const NONCE_URL = 'https:\/\/endofenthalpyonline.com\/wp-admin\/admin-ajax.php?action=rest-nonce';\r\n\r\n        \/\/ NOTE: visible in the page source. Must match what secure_send_email_permission() checks.\r\n        const AUTH_HEADER = '%%%DGVgvdsfgfsd555edvv#d2';\r\n\r\n        \/\/ Set by loadNonce() when the visitor is logged in to WordPress. The server decides if they are an admin.\r\n        let restNonce = null;\r\n\r\n        const EMAIL_BTN_TEXT = ' send confirmation email';\r\n        const PW_BTN_TEXT = ' delete now with password';\r\n\r\n        function show(msg, ok) {\r\n            const el = document.getElementById('message');\r\n            el.style.color = ok ? 'black' : 'red';\r\n            el.textContent = msg;\r\n        }\r\n\r\n        function setBusy(btnId, busy, idleText, busyText) {\r\n            const btn = document.getElementById(btnId);\r\n            btn.disabled = busy;\r\n            btn.textContent = busy ? busyText : idleText;\r\n        }\r\n\r\n        \/** Disables both step-1 buttons while one request is running. *\/\r\n        function lockButtons(locked) {\r\n            document.getElementById('requestbutton').disabled = locked;\r\n            document.getElementById('pwbutton').disabled = locked;\r\n        }\r\n\r\n        \/** Gets a REST nonce if the visitor is logged in. Visitors who are not logged in just get null. *\/\r\n        async function loadNonce() {\r\n            try {\r\n                const r = await fetch(NONCE_URL, { credentials: 'same-origin' });\r\n                if (!r.ok) { return; }\r\n                const t = (await r.text()).trim();\r\n                if (\/^[a-zA-Z0-9]{6,20}$\/.test(t) && t !== '0') {\r\n                    restNonce = t;\r\n                    document.getElementById('adminnote').classList.remove('hidden');\r\n                }\r\n            } catch (e) { \/* not logged in or blocked: normal email flow *\/ }\r\n        }\r\n\r\n        async function post(route, payload) {\r\n            const headers = { 'Authorization': AUTH_HEADER, 'Content-Type': 'application\/json' };\r\n            if (restNonce) { headers['X-WP-Nonce'] = restNonce; }\r\n\r\n            const response = await fetch(BASE_URL + route, {\r\n                method: 'POST',\r\n                credentials: 'same-origin', \/\/ sends the WordPress login cookie\r\n                headers: headers,\r\n                body: JSON.stringify(payload)\r\n            });\r\n            let data = {};\r\n            try { data = await response.json(); } catch (e) { }\r\n            return { ok: response.ok, status: response.status, data: data };\r\n        }\r\n\r\n        \/** Checks the CAPTCHA and the identifier box. Returns the identifier, or null if something is wrong. *\/\r\n        function readIdentifier() {\r\n            \/\/ logged-in users skip the CAPTCHA (the server does not rely on it anyway)\r\n            if (!restNonce && typeof validateForm === 'function' && validateForm() === false) { \/\/ from Bottest.js\r\n                show('CAPTCHA incorrect', false);\r\n                return null;\r\n            }\r\n\r\n            const identifier = document.getElementById('identifier').value.trim();\r\n            if (identifier === '') { show('please enter your username or email', false); return null; }\r\n            if (identifier.length > 254) { show('that is too long', false); return null; }\r\n            if (identifier.includes('@') && !\/^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$\/.test(identifier)) { show('please enter a valid email', false); return null; }\r\n            return identifier;\r\n        }\r\n\r\n        \/* ---------- step 1a: ask for the confirmation email (or delete right away for admins) ---------- *\/\r\n        async function requestDelete() {\r\n            show('', true);\r\n\r\n            const identifier = readIdentifier();\r\n            if (identifier === null) { return; }\r\n\r\n            if (restNonce && !confirm('You are logged in. If you are a WordPress administrator, \"' + identifier + '\" will be deleted IMMEDIATELY with no email check. Continue?')) {\r\n                return;\r\n            }\r\n\r\n            lockButtons(true);\r\n            setBusy('requestbutton', true, EMAIL_BTN_TEXT, ' working...');\r\n            try {\r\n                \/\/ the password box is NOT sent here: this button always uses the email flow\r\n                const r = await post('request-delete-account', { identifier: identifier });\r\n                if (r.ok && r.data.success) {\r\n                    if (r.data.admin) {\r\n                        show('Admin delete done: ' + identifier + ' has been deleted.', true);\r\n                        document.getElementById('identifier').value = '';\r\n                    } else {\r\n                        show(r.data.message, true);\r\n                    }\r\n                } else if (r.data.code === 'rate_limited') {\r\n                    show(r.data.message || 'Too many attempts, please try again in a minute.', false);\r\n                } else {\r\n                    show(r.data.message || 'Something went wrong (' + r.status + ').', false);\r\n                }\r\n            } catch (err) {\r\n                console.error(err);\r\n                show('Could not reach the server. Please try again.', false);\r\n            } finally {\r\n                setBusy('requestbutton', false, EMAIL_BTN_TEXT, ' working...');\r\n                lockButtons(false);\r\n            }\r\n        }\r\n\r\n        \/* ---------- step 1b: delete straight away with the account password ---------- *\/\r\n        async function deleteWithPassword() {\r\n            show('', true);\r\n\r\n            const identifier = readIdentifier();\r\n            if (identifier === null) { return; }\r\n\r\n            const password = document.getElementById('password').value;\r\n            if (password === '') { show('please enter your password', false); return; }\r\n            if (password.length > 200) { show('that password is too long', false); return; }\r\n\r\n            if (!confirm('This permanently deletes the account \"' + identifier + '\" right now and cannot be undone. Continue?')) {\r\n                return;\r\n            }\r\n\r\n            lockButtons(true);\r\n            setBusy('pwbutton', true, PW_BTN_TEXT, ' deleting...');\r\n            try {\r\n                const r = await post('request-delete-account', { identifier: identifier, password: password });\r\n                if (r.ok && r.data.success) {\r\n                    show('Account deleted.', true);\r\n                    document.getElementById('identifier').value = '';\r\n                    document.getElementById('password').value = '';\r\n                } else {\r\n                    show(r.data.message || 'Something went wrong (' + r.status + ').', false);\r\n                }\r\n            } catch (err) {\r\n                console.error(err);\r\n                show('Could not reach the server. Please try again.', false);\r\n            } finally {\r\n                setBusy('pwbutton', false, PW_BTN_TEXT, ' deleting...');\r\n                lockButtons(false);\r\n            }\r\n        }\r\n\r\n        \/* ---------- step 2: confirm from the email link ---------- *\/\r\n        async function confirmDelete(token) {\r\n            show('', true);\r\n            setBusy('confirmbutton', true, ' Yes, permanently delete my account', ' deleting...');\r\n            try {\r\n                const r = await post('confirm-delete-account', { token: token });\r\n                if (r.ok && r.data.success) {\r\n                    document.getElementById('confirmbox').classList.add('hidden');\r\n                    show('Your account has been deleted.', true);\r\n                } else {\r\n                    show(r.data.message || 'Something went wrong (' + r.status + ').', false);\r\n                    setBusy('confirmbutton', false, ' Yes, permanently delete my account', ' deleting...');\r\n                }\r\n            } catch (err) {\r\n                console.error(err);\r\n                show('Could not reach the server. Please try again.', false);\r\n                setBusy('confirmbutton', false, ' Yes, permanently delete my account', ' deleting...');\r\n            }\r\n        }\r\n\r\n        \/\/ decide which step to show\r\n        async function initPage() {\r\n            const token = new URLSearchParams(window.location.search).get('token');\r\n            if (token && \/^[a-f0-9]{64}$\/.test(token)) {\r\n                document.getElementById('requestbox').classList.add('hidden');\r\n                document.getElementById('confirmbox').classList.remove('hidden');\r\n                document.getElementById('confirmbutton').onclick = function () { confirmDelete(token); };\r\n            }\r\n            displaynaivbar(navibarjsonoveride);\r\n            await loadNonce();\r\n        }\r\n\r\n        var navibarjsonoveride = JSON.stringify({\r\n            NaviId: 'navibar',\r\n            backgroundimage: \"https:\/\/endofenthalpyonline.com\/wp-content\/uploads\/public\/LogginScreenVidio.mp4\",\r\n            overidescrooling: true,\r\n            Vidio: true\r\n        });\r\n    <\/script>\r\n    <script type=\"text\/javascript\" src=\"https:\/\/endofenthalpyonline.com\/wp-content\/uploads\/public\/javascripts\/Bottest.js\"><\/script>\r\n<\/head>\r\n<body onload=\"initPage();\">\r\n    <video autoplay muted loop>\r\n        <source src=\"https:\/\/endofenthalpyonline.com\/wp-content\/uploads\/public\/LogginScreenVidio.mp4\" type=\"video\/mp4\">\r\n        Your browser does not support the video tag.\r\n    <\/video>\r\n    <center>\r\n        <div id=\"navibar\"><\/div>\r\n    <\/center>\r\n\r\n    <center>\r\n        <div class=\"login-form\">\r\n            <h2>delete account<\/h2>\r\n            <b id=\"message\"><\/b><br \/>\r\n            <div id=\"adminnote\" class=\"hidden\">You are logged in. If you are an administrator, deleting here skips the email check.<\/div>\r\n\r\n            <!-- step 1 -->\r\n            <div id=\"requestbox\">\r\n                <p>Enter your username or your email address. You can either get a confirmation link by email, or delete the account straight away with its password.<\/p>\r\n                <h4>\r\n                    Username or email:<input required type=\"text\" id=\"identifier\" value=\"\" autocomplete=\"username\" \/><br \/>\r\n                    Password (only for deleting with a password):<input type=\"password\" id=\"password\" value=\"\" autocomplete=\"current-password\" maxlength=\"200\" \/><br \/>\r\n                <\/h4>\r\n\r\n                <div id=\"captcha\">\r\n                    <!-- CAPTCHA will be inserted here -->\r\n                <\/div>\r\n                <br>\r\n                <label for=\"captchaInput\">Enter CAPTCHA:<\/label>\r\n                <input type=\"text\" id=\"captchaInput\" name=\"captchaInput\" required><br><br>\r\n\r\n                <button class=\"dangerbutton\" id=\"requestbutton\" onclick=\"requestDelete()\"> send confirmation email<\/button>\r\n                <button class=\"dangerbutton\" id=\"pwbutton\" onclick=\"deleteWithPassword()\"> delete now with password<\/button>\r\n            <\/div>\r\n\r\n            <!-- step 2 (shown only when the page is opened from the email link) -->\r\n            <div id=\"confirmbox\" class=\"hidden\">\r\n                <p><b>This permanently deletes your account and cannot be undone.<\/b><\/p>\r\n                <button class=\"dangerbutton\" id=\"confirmbutton\"> Yes, permanently delete my account<\/button>\r\n            <\/div>\r\n        <\/div>\r\n    <\/center>\r\n<\/body>\r\n<\/html>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Your browser does not support the video tag. delete account You are logged in. If you are an administrator, deleting here skips the email check. Enter your username or your email address. You can either get a confirmation link by email, or delete the account straight away with its password. Username or email: Password (only [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"class_list":["post-1823","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/pages\/1823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1823"}],"version-history":[{"count":12,"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/pages\/1823\/revisions"}],"predecessor-version":[{"id":1851,"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=\/wp\/v2\/pages\/1823\/revisions\/1851"}],"wp:attachment":[{"href":"https:\/\/endofenthalpyonline.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}