"; } private static function begin($kind, $id = 0) { echo '
'; wp_nonce_field("lockerpad_save"); echo ''; } private static function select($label, $name, $values, $selected) { echo "

"; } public static function page() { if (!current_user_can("manage_options")) { return; } global $wpdb; $tab = sanitize_key(self::query_arg("tab", "pages")); if (!in_array($tab, ["pages", "clients", "design", "help"], true)) { $tab = "pages"; } $edit = absint(self::query_arg("edit", 0)); echo '
"; Maintenance::legacy_notice(); if (null !== self::query_arg("saved", null)) { echo '

Saved.

'; } if (null !== self::query_arg("maintained", null)) { echo '

Done.

'; } try { Plugin::crypto(); } catch (\Throwable $e) { echo '

' . esc_html($e->getMessage()) . "

"; return; } $vaults = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM %i WHERE purpose='page' ORDER BY id DESC", Plugin::table("vaults"), ), ); if ($tab === "design") { self::design_preview(); echo ""; return; } if ($tab === "help") { Maintenance::help_page(); echo ""; return; } if ($tab === "clients") { $view = sanitize_key(self::query_arg("client_view", "all")); if ( !in_array($view, ["all", "active", "expired", "revoked"], true) ) { $view = "all"; } $search = self::query_arg("client_search"); $page = max(1, absint(self::query_arg("client_page", 1))); // One fixed query for every view and search; each filter is switched on by its own value. $now = time(); $like = "%" . $wpdb->esc_like($search) . "%"; $on = [ "active" => (int) ($view === "active"), "expired" => (int) ($view === "expired"), "revoked" => (int) ($view === "revoked"), ]; $total = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM %i WHERE (%d=0 OR (revoked=0 AND expires>%d)) AND (%d=0 OR expires<=%d) AND (%d=0 OR revoked=1) AND (%s='' OR label LIKE %s OR login LIKE %s)", Plugin::table("clients"), $on["active"], $now, $on["expired"], $now, $on["revoked"], $search, $like, $like, ), ); $clients = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM %i WHERE (%d=0 OR (revoked=0 AND expires>%d)) AND (%d=0 OR expires<=%d) AND (%d=0 OR revoked=1) AND (%s='' OR label LIKE %s OR login LIKE %s) ORDER BY id DESC LIMIT 50 OFFSET %d", Plugin::table("clients"), $on["active"], $now, $on["expired"], $now, $on["revoked"], $search, $like, $like, ($page - 1) * 50, ), ); echo '
PEOPLE & PERMISSIONS

People

Give each person access to the pages they need. Add as many people as you like.

Your people

Add person

' . (int) $total . ' matching people. Showing up to 50 per page.

'; foreach ($clients as $c) { echo '"; } if (!$clients) { echo ''; } echo "
NameExpiresUnlocksLast accessStatusManage
id, ), ) . '">' . esc_html($c->label) . '' . esc_html(wp_date("M j, Y g:i a", (int) $c->expires)) . '' . (int) $c->access_count . ($c->access_limit ? " / " . (int) $c->access_limit : " / unlimited") . '' . ($c->last_access ? esc_html( wp_date("M j, Y g:i a", (int) $c->last_access), ) : "—") . '' . 'expires <= time() ? "lp-badge-warn" : "lp-badge-good")) . '">' . ($c->revoked ? "Revoked" : ($c->expires <= time() ? "Expired" : "Active")) . "" . ''; echo "
Delete person…"; self::begin("delete_client", $c->id); echo '

'; echo "
No matching people.

"; for ( $i = max(1, $page - 2); $i <= min((int) ceil($total / 50), $page + 2); $i++ ) { echo ' "lockerpad", "tab" => "clients", "client_view" => $view, "client_search" => $search, "client_page" => $i, ], admin_url("admin.php"), ), ) . '">' . ($i === $page ? "Page " : "") . (int) $i . " "; } echo "

Revoking access keeps the person’s details for later. Delete removes them permanently. Existing website backups stay unchanged.

"; $c = $edit ? $wpdb->get_row( $wpdb->prepare( "SELECT * FROM %i WHERE id=%d", Plugin::table("clients"), $edit, ), ) : null; if (!$c && $total && !self::query_arg("new")) { echo "
"; return; } if (!$vaults) { echo '

Create a page lock first

Choose the pages you want to protect, then return here to give someone access.

Create a page lock
'; return; } echo '
PAGE ACCESS

' . ($c ? "Edit person" : "Add person") . "

Visitors use their configured password, combination or seed words to unlock. Keep boxes empty to leave saved passwords unchanged. Time zone: " . esc_html(wp_timezone_string()) . ".

"; if ($c) { echo "

Successful unlocks: " . (int) $c->access_count . "   Last access: " . ($c->last_access ? esc_html( wp_date("M j, Y g:i a", (int) $c->last_access), ) : "Never") . "

"; } self::begin("client", $c ? $c->id : 0); echo ''; self::field("Name", "label", $c ? $c->label : "", "text", [ "required" => true, "maxlength" => 180, ]); echo '
Your reference (optional)'; self::field( "Internal reference", "login", $c ? $c->login : "", "text", [ "pattern" => "[a-z0-9][a-z0-9._-]{2,79}", "maxlength" => 80, "placeholder" => "Optional; generated if blank", ], ); echo "
"; self::field( "Access expires", "expires", $c ? wp_date("Y-m-d\TH:i", (int) $c->expires) : wp_date("Y-m-d\TH:i", time() + 30 * DAY_IN_SECONDS), "datetime-local", ["required" => true], ); self::field( "Unlock limit (0 = no limit)", "access_limit", $c ? $c->access_limit : 0, "number", ["min" => 0, "max" => 1000000], ); if ($c) { echo '

'; } echo "

Page locks

Choose which locks this person can open. Use different passwords for each user so you can block access individually.

"; foreach ($vaults as $v) { $g = $c ? $wpdb->get_row( $wpdb->prepare( "SELECT * FROM %i WHERE client=%d AND vault=%d", Plugin::table("access"), $c->id, $v->id, ), ) : null; $config = Policy::configuration($v); $prefix = "grants[" . (int) $v->id . "]"; echo '
' . esc_html($v->title) . '

' . esc_html($config) . "

"; if (in_array("dial", Policy::methods($v->mode), true)) { echo '

Dial combination ' . (int) $v->dial_count . ' stops

Choose one number for each stop, in order.

'; for ($i = 0; $i < (int) $v->dial_count; $i++) { echo ""; } echo '

' . ($g && $g->dial_hash ? "A combination is saved. Leave all dropdowns empty to keep it." : "Select every stop to create this combination.") . "

"; } if (in_array("phrase", Policy::methods($v->mode), true)) { echo '

Seed words ' . (int) $v->phrase_count . ' words

Enter one word per box, or paste all words into the first box.

'; for ($i = 0; $i < (int) $v->phrase_count; $i++) { echo "'; } echo '

' . ($g && $g->phrase_hash ? "A phrase is saved. Leave all word tiles empty to keep it." : "Fill every word tile to create this phrase.") . "

"; } if (in_array("password", Policy::methods($v->mode), true)) { echo '

Password

' . ($g && !empty($g->password_hash) ? "A password is saved. Leave this field empty to keep it." : "Enter a password of 1–100 characters, or generate one below.") . '

'; } if ($g && !Policy::compatible($v, $g)) { echo '

The lock settings changed. Enter credentials for the selected methods shown above.

'; } echo '

'; } echo '

Keep a copy of these passwords before saving. LockerPad cannot show them again. Never use your cryptocurrency recovery words.

"; echo ''; submit_button("Save access"); echo "
"; return; } self::vault_editor($edit, $vaults); echo ""; } private static function vault_editor($edit, $vaults) { global $wpdb; $pageMap = []; foreach (Pages::ids() as $pid) { $vid = Pages::vault_id($pid); $pageMap[$vid][] = $pid; } $v = $edit ? $wpdb->get_row( $wpdb->prepare( "SELECT * FROM %i WHERE id=%d AND purpose='page'", Plugin::table("vaults"), $edit, ), ) : null; echo '
PRIVATE PAGES, SIMPLY

Page Locks

Protect pages and posts with a combination dial, seed words, or both. No page or user limits.

'; if (!$vaults) { echo '
  1. 1. Choose your pagesGroup pages under a named lock.
  2. 2. Give people accessCreate their unique unlock details.
  3. 3. Share the page linkSend access details privately.
'; } echo '

Your page locks

Add page lock
'; if (!$vaults) { echo "

Your first page lock starts below. No shortcodes or changes to your page design are needed.

"; } else { echo '
'; foreach ($vaults as $item) { $n = count($pageMap[$item->id] ?? []); $paths = Targets::directories($item); $description = ($n ? $n . " selected pages/posts" : "") . ($n && $paths ? " · " : "") . ($paths ? count($paths) . " website paths" : ""); echo ''; } echo "
Page lockProtected contentStatusManage
id . "#lp-vault-editor", ), ) . '">' . esc_html($item->title) . "" . esc_html($description ?: "No pages selected") . '' . ($item->enabled ? "Ready" : "Access paused") . 'Manage people
"; } echo "
"; if ($edit && !$v) { echo '

Page lock not found. Choose a page lock from the list.

'; return; } if (!$v && $vaults && !self::query_arg("new")) { return; } echo '
' . ($v ? "PAGE LOCK SETTINGS" : "GET STARTED") . "

" . ($v ? "Edit page lock" : "Create a page lock") . "

"; self::begin("vault", $v ? $v->id : 0); self::field("Page lock name", "title", $v ? $v->title : "", "text", [ "required" => true, "maxlength" => 180, "placeholder" => "For example: Client resources", ]); Targets::picker($v ? (int) $v->id : 0); echo '

Choose the lock

'; self::select( "Unlock method", "mode", Policy::modes(), $v ? $v->mode : "both", ); echo '
'; self::select( "Dial stops", "dial_count", [3 => "3 numbers", 4 => "4 numbers", 5 => "5 numbers"], $v ? $v->dial_count : 4, ); echo '
'; self::select( "Seed words", "phrase_count", [ 4 => "4 words", 8 => "8 words", 12 => "12 words", 16 => "16 words", ], $v ? $v->phrase_count : 8, ); echo '

Choose one or two methods from Dial, Seed words and Password. AND requires both; OR allows either. Set each person’s credentials in People. Two methods are not two-factor authentication.

'; if ($v) { echo '

Changing the unlock method or number of entries may require new access details. Saving ends current sessions for this lock.

'; } echo '


Uncheck to pause access. Selected pages stay protected. To make a page public again, remove it from the selection and save.

'; echo '

Page locks control access to WordPress content. They do not encrypt pages or protect direct image, video or download URLs.

'; echo ''; submit_button($v ? "Save page lock" : "Create page lock"); echo "
"; } private static function design_preview() { $columns = max(1, min(4, absint(self::query_arg("columns", 1)))); $mode = sanitize_key(self::query_arg("preview_mode", "both")); if (!array_key_exists($mode, Policy::modes())) { $mode = "both"; } $stops = absint(self::query_arg("preview_stops", 3)); if (!in_array($stops, [3, 4, 5], true)) { $stops = 3; } $words = absint(self::query_arg("preview_words", 8)); if (!in_array($words, [4, 8, 12, 16], true)) { $words = 8; } $compact = false; echo '
TRY THE LOOK

Design preview

Try the lock at different widths. This sample does not open protected pages or change your saved locks.

Preview settings

'; self::select( "Preview width", "columns", [ 1 => "Full width", 2 => "Half width (2-column page)", 3 => "Third width (3-column page)", 4 => "Quarter width (4-column page)", ], $columns, ); self::select("Lock type", "preview_mode", Policy::modes(), $mode); if (in_array("dial", Policy::methods($mode), true)) { self::select( "Dial stops", "preview_stops", [3 => "3 stops", 4 => "4 stops", 5 => "5 stops"], $stops, ); } else { echo ''; } if (in_array("phrase", Policy::methods($mode), true)) { self::select( "Seed words", "preview_words", [ 4 => "4 words", 8 => "8 words", 12 => "12 words", 16 => "16 words", ], $words, ); } else { echo ''; } echo '

Choose a width to preview one lock. Open each selected panel to try its controls.

'; $samples = [[$mode, $stops, $words]]; foreach ($samples as $i => $sampleSettings) { [$m, $d, $w] = $sampleSettings; $label = Policy::configuration( (object) [ "mode" => $m, "dial_count" => $d, "phrase_count" => $w, ], ); $sample = (object) [ "public_id" => "preview_" . ($i + 1), "title" => $label, "mode" => $m, "dial_count" => $d, "phrase_count" => $w, "compact" => $compact, ]; echo "

" . esc_html($label) . "

"; Plugin::print_lock($sample, true); echo "
"; } echo "
"; } public static function save() { if (!current_user_can("manage_options")) { wp_die("Not permitted.", "LockerPad", ["response" => 403]); } check_admin_referer("lockerpad_save"); if (!is_ssl()) { wp_die("HTTPS is required."); } global $wpdb; $kind = sanitize_key(wp_unslash($_POST["kind"] ?? "")); $id = absint(wp_unslash($_POST["id"] ?? 0)); try { $crypto = Plugin::crypto(); $storageLock = Maintenance::write_lock(); if ($kind === "delete_client") { $client = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM %i WHERE id=%d", Plugin::table("clients"), $id, ), ); if (!$client) { throw new \RuntimeException("User not found."); } if (empty($_POST["confirm_delete"])) { throw new \RuntimeException( "Confirm permanent deletion first.", ); } if ($wpdb->query("START TRANSACTION") === false) { throw new \RuntimeException("Cannot update user."); } try { if ( $wpdb->delete(Plugin::table("sessions"), [ "client" => $id, ]) === false ) { throw new \RuntimeException( "Cannot end user sessions.", ); } if ( $wpdb->delete(Plugin::table("access"), [ "client" => $id, ]) === false || $wpdb->delete(Plugin::table("clients"), [ "id" => $id, ]) === false ) { throw new \RuntimeException("Cannot delete user."); } if ($wpdb->query("COMMIT") === false) { throw new \RuntimeException( "Cannot finish user update.", ); } } catch (\Throwable $e) { $wpdb->query("ROLLBACK"); throw $e; } wp_safe_redirect( admin_url("admin.php?page=lockerpad&tab=clients&saved=1"), ); exit(); } if ($kind === "client") { $old = $id ? $wpdb->get_row( $wpdb->prepare( "SELECT * FROM %i WHERE id=%d", Plugin::table("clients"), $id, ), ) : null; if ($id && !$old) { throw new \RuntimeException("User not found."); } $login = strtolower( trim( sanitize_text_field(wp_unslash($_POST["login"] ?? "")), ), ); if (!$login) { $login = "invite-" . bin2hex(random_bytes(6)); } if (!preg_match('/^[a-z0-9][a-z0-9._-]{2,79}$/D', $login)) { throw new \RuntimeException( "Use an internal ID of 3–80 lowercase letters, numbers, dots, underscores, or hyphens.", ); } $label = substr( sanitize_text_field(wp_unslash($_POST["label"] ?? "")), 0, 180, ); if (!$label) { throw new \RuntimeException("Name is required."); } $date = \DateTimeImmutable::createFromFormat( "!Y-m-d\TH:i", sanitize_text_field(wp_unslash($_POST["expires"] ?? "")), wp_timezone(), ); if (!$date) { throw new \RuntimeException("Choose an expiration date."); } $limit = filter_var( wp_unslash($_POST["access_limit"] ?? 0), FILTER_VALIDATE_INT, ["options" => ["min_range" => 0, "max_range" => 1000000]], ); if ($limit === false) { throw new \RuntimeException( "Enter an unlock limit from 0 to 1000000. Zero means unlimited.", ); } $grants = []; if ( empty($_POST["complete_form"]) || empty($_POST["grants_json"]) ) { throw new \RuntimeException( "Your form was incomplete. Reload and try again; no access was changed.", ); } foreach (Targets::decode("grants_json") as $vid => $input) { if (!is_array($input) || empty($input["enabled"])) { continue; } $vid = absint($vid); $v = Plugin::vault($vid); if (!$v) { throw new \RuntimeException( "Choose enabled vaults only.", ); } $prior = $old ? $wpdb->get_row( $wpdb->prepare( "SELECT * FROM %i WHERE client=%d AND vault=%d", Plugin::table("access"), $id, $vid, ), ) : null; $g = [ "vault" => $vid, "dial_count" => (int) $v->dial_count, "phrase_count" => (int) $v->phrase_count, ]; $normals = []; foreach (["dial", "phrase", "password"] as $kindName) { $count = $kindName === "password" ? 0 : (int) $v->{$kindName . "_count"}; $needed = in_array( $kindName, Policy::methods($v->mode), true, ); $raw = ""; if ( $kindName === "password" && isset($input[$kindName]) && !is_string($input[$kindName]) ) { throw new \RuntimeException( "Enter a valid password.", ); } if (isset($input[$kindName . "_entries"])) { $raw = Policy::entries( $input[$kindName . "_entries"], $kindName, $count, ); if ($raw === null) { throw new \RuntimeException( "Complete every " . ($kindName === "dial" ? "dial stop (0–99)" : "seed word tile") . " for " . $v->title . ", or leave the entire set blank to keep the saved details.", ); } } elseif ( isset($input[$kindName]) && is_scalar($input[$kindName]) ) { $raw = $kindName === "password" ? (string) $input[$kindName] : trim((string) $input[$kindName]); } $hash = $prior ? $prior->{$kindName . "_hash"} ?? "" : ""; $lookup = $prior ? $prior->{$kindName . "_lookup"} ?? "" : ""; if ($raw !== "") { $normal = Policy::$kindName($raw, $count); if ($normal === null) { throw new \RuntimeException( "Check the " . $kindName . " format for " . $v->title . ".", ); } $hash = password_hash( $crypto->credential($kindName . ":" . $normal), PASSWORD_BCRYPT, ["cost" => 12], ); $lookup = Plugin::lookup($vid, $kindName, $normal); $normals[$kindName] = $normal; } elseif ( $needed && (!$prior || !$hash || ($kindName !== "password" && (int) $prior->{$kindName . "_count"} !== $count)) ) { throw new \RuntimeException( "Enter the " . $kindName . " for " . $v->title . " using its configured length.", ); } $g[$kindName . "_hash"] = $hash; $g[$kindName . "_lookup"] = $lookup; } $others = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM %i WHERE vault=%d AND client<>%d", Plugin::table("access"), $vid, $id, ), ); foreach ($others as $other) { $same = []; foreach (["dial", "phrase", "password"] as $k) { $same[$k] = false; if ( $g[$k . "_hash"] && !empty($other->{$k . "_hash"}) && ($k === "password" || (int) $other->{$k . "_count"} === (int) $g[$k . "_count"]) ) { $same[$k] = hash_equals( $g[$k . "_hash"], $other->{$k . "_hash"}, ) || ($g[$k . "_lookup"] && !empty($other->{$k . "_lookup"}) && hash_equals( $g[$k . "_lookup"], $other->{$k . "_lookup"}, )) || (isset($normals[$k]) && password_verify( $crypto->credential( $k . ":" . $normals[$k], ), $other->{$k . "_hash"}, )); } } if ( Policy::matches( $v->mode, $same["dial"], $same["phrase"], $same["password"], ) ) { throw new \RuntimeException( "Choose unique credentials for " . $v->title . "; those details already belong to another user.", ); } } $grants[] = $g; } // Preserve retired media grants when updating page access; they remain unusable here. if ($old) { $legacy = $wpdb->get_results( $wpdb->prepare( "SELECT a.* FROM %i a INNER JOIN %i v ON v.id=a.vault WHERE a.client=%d AND v.purpose<>'page'", Plugin::table("access"), Plugin::table("vaults"), $id, ), ARRAY_A, ); if ($wpdb->last_error) { throw new \RuntimeException( "Could not preserve existing access.", ); } foreach ($legacy as $grant) { unset($grant["client"]); $grants[] = $grant; } } if (!$grants && empty($_POST["revoked"])) { throw new \RuntimeException("Assign at least one vault."); } $data = [ "access_limit" => $limit, "label" => $label, "login" => $login, "mode" => "vault", "dial_count" => 0, "phrase_count" => 0, "dial_hash" => "", "phrase_hash" => "", "vaults" => wp_json_encode(array_column($grants, "vault")), "expires" => $date->getTimestamp(), "revoked" => empty($_POST["revoked"]) ? 0 : 1, "version" => $old ? (int) $old->version + 1 : 1, ]; if (!empty($_POST["reset_usage"])) { $data["access_count"] = 0; $data["last_access"] = 0; } if ($wpdb->query("START TRANSACTION") === false) { throw new \RuntimeException( "Could not start access update.", ); } try { $result = $old ? $wpdb->update(Plugin::table("clients"), $data, [ "id" => $id, ]) : $wpdb->insert(Plugin::table("clients"), $data); if ($result === false) { throw new \RuntimeException( "Could not save; the internal ID may already be in use.", ); } if (!$id) { $id = $wpdb->insert_id; } if ( $wpdb->delete(Plugin::table("access"), [ "client" => $id, ]) === false ) { throw new \RuntimeException("Could not update access."); } foreach ($grants as $g) { $g["client"] = $id; if (!$wpdb->insert(Plugin::table("access"), $g)) { throw new \RuntimeException( "Could not save vault access.", ); } } if ( $wpdb->delete(Plugin::table("sessions"), [ "client" => $id, ]) === false ) { throw new \RuntimeException( "Could not end prior sessions.", ); } if ($wpdb->query("COMMIT") === false) { throw new \RuntimeException( "Could not finish access update.", ); } } catch (\Throwable $e) { $wpdb->query("ROLLBACK"); throw $e; } $tab = "clients"; } elseif ($kind === "vault") { if ( empty($_POST["complete_form"]) || !isset($_POST["target_ids"], $_POST["directory_paths"]) ) { throw new \RuntimeException( "Your form was incomplete. Reload and try again; no pages were changed.", ); } $v = $id ? $wpdb->get_row( $wpdb->prepare( "SELECT * FROM %i WHERE id=%d AND purpose='page'", Plugin::table("vaults"), $id, ), ) : null; if ($id && !$v) { throw new \RuntimeException("Page lock not found."); } $title = substr( sanitize_text_field(wp_unslash($_POST["title"] ?? "")), 0, 180, ); if (!$title) { throw new \RuntimeException("Give this page lock a name."); } $mode = sanitize_key(wp_unslash($_POST["mode"] ?? "")); $dc = absint(wp_unslash($_POST["dial_count"] ?? 0)); $pc = absint(wp_unslash($_POST["phrase_count"] ?? 0)); if ( !array_key_exists($mode, Policy::modes()) || !in_array($dc, [3, 4, 5], true) || !in_array($pc, [4, 8, 12, 16], true) ) { throw new \RuntimeException( "Choose a valid unlock method and lengths.", ); } $selectedPages = Pages::validate_selection( $id, Targets::decode("target_ids"), ); $directories = Targets::validate_directories( $id, Targets::decode("directory_paths"), ); if (!$v && !$selectedPages && !$directories) { throw new \RuntimeException( "Select a page, post or website path to protect.", ); } if (!$id) { if ( !$wpdb->insert(Plugin::table("vaults"), [ "public_id" => Plugin::new_public_id(), "purpose" => "page", "title" => $title, "body" => "", "files" => "", "enabled" => 0, ]) ) { throw new \RuntimeException("Cannot create page lock."); } $id = (int) $wpdb->insert_id; } // Never overwrite old encrypted content fields while editing page settings. $data = [ "directories" => wp_json_encode($directories), "purpose" => "page", "compact" => 0, "absolute_hours" => 0, "mode" => $mode, "dial_count" => $dc, "phrase_count" => $pc, "version" => $v ? (int) $v->version + 1 : 1, "title" => $title, "enabled" => empty($_POST["enabled"]) ? 0 : 1, ]; if (!$v) { $data["body"] = $crypto->encrypt("", "body:" . $id); $data["files"] = $crypto->encrypt("[]", "files:" . $id); } if ( $wpdb->update(Plugin::table("vaults"), $data, [ "id" => $id, ]) === false ) { throw new \RuntimeException("Cannot save page lock."); } if ( $wpdb->delete(Plugin::table("sessions"), [ "vault" => $id, ]) === false ) { throw new \RuntimeException( "Could not end prior sessions.", ); } Targets::reset(); Pages::save($id, $selectedPages); if (function_exists("sg_cachepress_purge_cache")) { sg_cachepress_purge_cache(); } $tab = "pages"; } else { throw new \RuntimeException("Invalid action."); } wp_safe_redirect( admin_url( "admin.php?page=lockerpad&tab=" . $tab . "&edit=" . $id . "&saved=1", ), ); exit(); } catch (\Throwable $e) { wp_die(esc_html($e->getMessage()), "LockerPad", [ "back_link" => true, "response" => 400, ]); } } }