Access Gate
Keeps the storefront public and crawlable while requiring a branded login/registration at the cart & checkout (or, optionally, the whole site). Custom fields, OTP email verification, auto-login, guest access, and an admin dashboard. WoodMart & Elementor friendly.
by Your Name · github.com/md-abu-bakker-siddik/access-gate · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/md-abu-bakker-siddik/access-gate/archive/refs/heads/main.zipLocks your WordPress site behind a branded login / registration popup with custom fields, OTP email verification, automatic login, guest access and an admin dashboard.
What it does
- Forces visitors to log in or register before viewing any page (except the Lost Password page, your Privacy Policy page and any pages you exclude).
- Renders its own standalone gate screen, so it never clashes with WoodMart, Elementor or any other theme/builder — their templates don't run for logged-out visitors.
- Registration form is driven by a Form Builder (add / edit / remove / reorder / require fields). Ships with Full Name, Email, Password, Confirm Password, Phone and Date of Birth to match the supplied design.
- OTP email verification with a configurable code length, expiry and template.
- Choose whether users log in immediately after registering, or only after OTP verification (Settings → Behaviour → Login timing).
- Optional admin approval before access is granted.
- Guest access (Magic Links): opening a guest link starts a temporary guest session — no WordPress account is created and no persistent login is set. Access ends automatically when the browser closes, the session length elapses (e.g. 24h), or the link expires / reaches its usage limit. Guests can browse and complete a WooCommerce checkout without registering. You control session length, link validity, max uses and which pages guests may see.
- Registrations dashboard: search, filter, approve, reject and export. Each captured field exports to its own column. Native Excel (.xlsx) export keeps colour-coding — Mobile and Date of Birth are highlighted in distinct colours — and a plain-columns CSV opens anywhere.
- Full design control: colours, fonts, radius, logo, side image, copy.
- Mobile responsive, noindex on the gate, nonce-protected and rate-limited.
Installation
- Zip the
access-gatefolder (or upload the provided zip). - WP Admin → Plugins → Add New → Upload Plugin → choose the zip → Install → Activate.
- Go to "Access Gate" in the admin menu. The gate is ON by default.
- IMPORTANT: make sure you are logged in as an admin before activating, or set at least one excluded page, so you don't lock yourself out of the front end. (Admin / wp-login.php are always accessible.)
Excel / CSV export
Both run out of the box with no extra libraries. From Registrations:
- "Export Excel" produces a native .xlsx where every field is its own column, the header row is styled and frozen, an auto-filter is enabled, and the Mobile and Date of Birth columns are highlighted in their own colours.
- "Export CSV" produces the same one-column-per-field layout as plain text (with a UTF-8 BOM so accents survive in Excel).
The export logic lives in includes/class-export.php. The set of columns is
derived from your Form Builder fields, so any custom field you add is exported
automatically; fields whose key looks like a phone/mobile or a date-of-birth
(or whose type is tel/date) are auto-detected as the highlighted columns.
Changelog
1.9.7
- Your data is now kept by default when the plugin is uninstalled. Previously the uninstall routine always wiped everything (settings/branding, the registrations table, guest links and gate user meta) because the "keep data" flag was never actually exposed. Now nothing is deleted on uninstall/reinstall unless you opt in via the new "Delete all plugin data when the plugin is uninstalled" toggle (Settings → Behaviour). Customer login accounts were, and still are, never deleted by the plugin.
1.9.6
- Turning OFF "Require OTP email verification" now logs new customers in automatically the moment they register (as long as admin approval isn't required) — no extra step, no getting stuck. When OTP is on, login still waits until the emailed code is verified.
- Removed the old, now-redundant "Login timing" setting. Behaviour is simply: OTP on → log in after verifying the code; OTP off → log in immediately; admin approval on → wait for approval. The dashboard reflects this.
1.9.5
- The popup now fully follows your colour settings — no more off-brand bits. Several colours used to be hard-coded (a gold backdrop glow, the gold show/hide-password icon, navy focus/active shadows, and a fixed beige wash over the side image), so changing the design colours left them behind. They are all derived from your Primary / Accent / Side-panel colours now, so "Adopt my theme colours" (or any manual change) reskins the whole popup cleanly.
- New "Body font" option (Settings → Design) — pick a Google Font for the body text so the popup's typography matches your site, alongside the existing heading font. Both load automatically and show in the live preview.
1.9.4
- Branded HTML emails. The OTP code, password-reset and new-registration emails
now use a designed, mobile-friendly template (your logo or brand name, your
primary/accent colours, a header bar and footer) instead of raw plain text —
built with inline styles + table layout so it renders in Gmail, Outlook and
Apple Mail.
- The verification email shows the code in a large highlighted box; your custom OTP subject/body text is still used and simply wrapped in the design.
- The reset email has a clear "Set a new password" button (with a copy-paste link fallback).
- The admin "new registration" email is laid out with the name/email and a "Review in dashboard" button.
1.9.3
- "Forgot password?" now opens its own simple step inside the popup — a single "Reset your password" email field with a "Send reset link" button — instead of asking the visitor to type into the login form first. Anything already typed in the login field is carried over, and a "Back to log in" link returns.
1.9.2
- Fully branded password reset — customers never see the raw WordPress pages:
- "Forgot password?" now emails a branded reset link that opens a branded "set a new password" screen (matching the popup's colours, logo and layout), instead of the default wp-login.php reset page.
- Setting a new password happens on that branded screen and signs the customer straight in (the reset link proves they own the email).
- New "Hide the default WordPress login & reset pages" setting (Settings → Behaviour, on by default). Visitors who land on wp-login.php (login, lost password, reset) are sent to the branded popup. Admins are never locked out: the native form is still reachable at wp-login.php?ag-admin=1 and via any link into wp-admin, and turning the gate off restores normal WordPress login.
1.9.1
- Friendlier onboarding for existing customers (e.g. anyone who has ordered
before and already has an account):
- Registering with an email that already has an account no longer shows a dead-end error. The popup now slides to the Log in step with the email pre-filled and a warm message, and gently highlights "Forgot password?".
- "Forgot password?" now emails a reset link inline — one tap, no page change — using WordPress/WooCommerce's own reset flow. (If the email field is empty it asks for the address first.)
- The Register tab shows an upfront hint: "Ordered with us before? You may already have an account — log in instead."
- The failed-login message is softer and points to the reset link. Note: a generic reset request never reveals whether an email has an account; the "you already have an account" message during registration is intentional so returning customers know to log in.
1.9.0
- Closable popup: the gate now has a × button and closes on a click outside the card or the Esc key. Closing sends the visitor to the storefront (the "Continue browsing" URL) and never grants access, so the gate returns at the cart/checkout. A new "Let visitors close the popup" toggle (Settings → Behaviour) keeps the old un-dismissable wall available for strict setups.
- Theme-aware design: the gate is now driven entirely by design tokens, and a new "Adopt my theme colours" button (Settings → Design) fills the colour pickers from the active block theme's palette / global styles in one click (with an ag_theme_tokens filter for exact kit mapping).
- Live preview: the Design tab shows a scaled, real-time demo of the popup (powered by an admin-only preview route) that updates as you change colours, text and layout — so you can decide without saving and reloading.
- More design options: choose the modal layout (brand panel left / right / no panel), the field shape (pill / soft / square), and a backdrop colour.
- Media Library pickers: the logo and side image are now chosen from the WP Media Library with a thumbnail preview, instead of pasting a URL (pasting still works).
- Settings tabs are route-based (?tab=…) and stay on the same tab after saving, instead of snapping back to Behaviour.
- The Users list is now paginated (25 per page) instead of capping at 500.
1.8.0
- Security & privacy hardening:
- The email-verification (OTP) check endpoint is now rate-limited per IP, on top of the existing per-code attempt cap, so codes can't be brute-forced by cycling requests.
- "Resend code" no longer reveals whether an email has an account (it always reports success), closing an account-enumeration path.
- Guest-link tokens are now 20 characters (was 8), making them infeasible to guess or enumerate. Existing links keep working.
- The guest-session store is capped so a flood of link opens can't bloat the database; the newest sessions are kept.
- Added blank index.php files to plugin folders and a clean uninstall that now also removes the per-user data the plugin wrote.
- Usability:
- New "Enable guest access (Magic Links)" master switch (Settings → Pages & Guest). Turning it off immediately stops every guest link from granting access — a single, reliable kill switch. (This also fixes a bug where the guest flag could be silently turned off when saving settings.)
- New "Continue browsing" link on the popup (Settings → Behaviour). In cart/checkout-only mode a shopper who reaches the gate but doesn't want to sign in can return to the public storefront instead of being stuck on the login screen. Text and destination are configurable; hidden automatically in full-site mode where there is nowhere public to go.
1.7.0
- New "What to lock" setting with two modes:
- "Only the cart & checkout" (new default): the storefront — homepage, shop, product pages, categories and content — stays public and fully crawlable. The login / registration popup now appears only when a visitor reaches the cart, the checkout, or (optionally) adds an item to the cart. This restores Google's ability to crawl and index products and product images, so rankings and search-result thumbnails can recover.
- "The entire site": the previous full-page login wall, unchanged — but it now lets genuine search-engine crawlers through so the catalogue can still be indexed.
- New "Require login to add items to the cart" toggle. When on, a logged-out visitor who clicks Add to Cart is sent to the login popup; a server-side guard (woocommerce_add_to_cart_validation) also blocks the add for AJAX and classic add-to-cart, so the rule can't be bypassed. When off, anyone can fill a cart and login is requested only at the cart / checkout pages.
- Logged-in (and active guest-session) shoppers are unaffected and can buy as before.
1.6.0
- Magic Links are now true guest access instead of authentication. Opening a
guest link starts a temporary, session-based guest pass:
- No WordPress user account is created (previously every open inserted a
permanent
guest_xxx@guest.localuser). - No persistent login. Access is held in a signed session cookie that dies when the browser closes, backed by a server-side record with a hard expiry.
- Access is revoked automatically when the browser session ends, when the configured session length elapses, or when the link expires / hits its usage limit. After that the visitor must open the Magic Link again.
- Sharing or reusing a link stays controlled by the link's expiry and max-uses settings, which the backend enforces.
- WooCommerce: guest-session visitors can browse, add to cart and check out without logging in or creating an account. The shop, cart, checkout and account pages always stay reachable, and guest checkout is forced on for the duration of the session so store settings can't trap them. This removes the previous login/session conflicts that could occur when a link was shared, the original user logged out, or a session expired. Existing logged-in users and admins are unaffected.
- No WordPress user account is created (previously every open inserted a
permanent
1.5.0
- Email/OTP verification is now strictly enforced. When OTP verification is
required, an account that has not verified its email can no longer reach the
site under any path:
- Registration never logs the user in until the code is verified (previously the "log in immediately after registration" option could bypass this).
- Logging in with a correct password on an unverified account no longer grants access — the popup jumps straight to the verification step and a fresh code is emailed.
- A front-end safety net signs out any unverified account that became logged in by other means (e.g. wp-login.php) and shows the gate until it verifies. Administrators, guest-link accounts, and accounts created outside the gate are never affected.
1.4.0
- Registrations list now stays clean: Mobile, Date of Birth and other captured fields are hidden from the main rows and shown only when you click each registration's "Details" button (a mobile-friendly expandable view).
- "All Users" now has an Export CSV button that exports every user with one column per field — name, email, username, role, status, verified, each custom registration field, last login and registration date.
- Reinforced the mobile popup scrolling so the whole registration form can always be scrolled into view on phones.
1.3.1
- Mobile fix: the registration popup no longer clips the bottom of the form — the entire form (including the submit button) is now fully visible and scrollable on phones. Caused by the modal clipping overflow while pinned to the viewport height; the overlay is now the scroll container.
- Mobile: the brand logo now appears as a compact header at the top of the popup (previously the logo panel was hidden on small screens).
1.3.0
- Dashboard refresh: gradient hero header, richer stat cards with context lines and hover depth, softer panels.
- Registrations now show Mobile and Date of Birth as their own colour-coded columns, plus an expandable "Details" row listing every captured field separately instead of one combined blob.
- New native Excel (.xlsx) export with a styled, frozen header row, auto-filter, one column per field, and Mobile / Date of Birth highlighted in distinct colours. CSV export rewritten to one column per field with a UTF-8 BOM.
- Exports are dependency-free (no PhpSpreadsheet/Composer required) and adapt automatically to custom Form Builder fields.
1.0.0
- Initial release.