OG Enhanced Login: developer's guide¶
This page lists what OG Enhanced Login exposes to code: actions, filters, shortcodes, a widget, MCP tools, WP-CLI, options, user meta, the database table, constants and front-end globals. For settings and everyday use, see the user guide.
Unless a heading says Lite and Pro, everything here is Pro only. The Lite has no shortcodes, widget, MCP tools or WP-CLI commands.
OG Enhanced Login registers no blocks. Pro registers one REST route, and only for age checks.
Filters¶
Lite and Pro¶
The Lite uses its own prefix (ogell_). Pro uses ogel_. If you support both editions, hook both names.
| Pro | Lite | Arguments | Return |
|---|---|---|---|
ogel_client_ip |
ogell_client_ip |
string $ip |
The visitor's address used for lockouts, the log and the guard. |
ogel_captcha_allow_when_unreachable |
ogell_captcha_allow_when_unreachable |
bool $allow (default true) |
false refuses the form when the captcha service cannot be reached. |
ogel_dashboard_staff_domain |
ogell_dashboard_staff_domain |
string $domain (default: the site's host without www.) |
E-mail domain left out of the dashboard card's new-user count. Return '' to count everyone. |
// Trust a header set by your own load balancer.
add_filter( 'ogel_client_ip', function ( $ip ) {
return ! empty( $_SERVER['HTTP_X_MY_LB_IP'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_MY_LB_IP'] ) ) : $ip;
} );
// Refuse sign-in when the captcha service is down.
add_filter( 'ogel_captcha_allow_when_unreachable', '__return_false' );
The address you return must be a valid IP address. Anything else becomes 0.0.0.0.
Pro¶
| Filter | Arguments | When it runs | Return |
|---|---|---|---|
ogel_force_login_allowed |
bool $allowed (default false), string $path |
Force login is on and the page is not on Pages guests can still see. $path has leading and trailing slashes, such as /shop/. |
true lets guests see the page. |
og_el_two_factor_other_providers |
array $providers (name => callable) |
Before two-factor starts. Each callable returns true when that other two-factor plugin is active. |
The list. If any callable returns true, OG Enhanced Login leaves two-factor to that plugin. |
// Keep the landing pages public on a members-only site.
add_filter( 'ogel_force_login_allowed', function ( $allowed, $path ) {
return $allowed || 0 === strpos( $path, '/landing/' );
}, 10, 2 );
// Tell OG Enhanced Login that your own two-factor plugin handles it.
add_filter( 'og_el_two_factor_other_providers', function ( $providers ) {
$providers['My two-factor'] = static function () {
return class_exists( 'My_Two_Factor' );
};
return $providers;
} );
Actions¶
All Pro.
| Action | Arguments | When it fires |
|---|---|---|
ogel_guard_blocked |
string $ip, string $name |
The Admin guard caught an address (or caught it again). $name is the name that was tried. |
ogel_social_registered |
int $user_id, string $provider |
A new account was made through social sign-in. $provider is google, facebook, github or reddit. |
og_el_two_factor_enabled |
int $user_id |
A person finished setting up two-factor sign-in. |
og_el_two_factor_disabled |
int $user_id |
A person turned two-factor sign-in off. |
og_el_two_factor_verified |
int $user_id, string $kind |
A two-factor code was accepted. $kind is totp (app code) or backup. |
og_el_two_factor_failed |
int $user_id |
A wrong two-factor code was typed. |
ogaic_age_decided |
int $user_id, string $result |
An age check was decided (only with OG Ai Companion Account active). |
ogaic_age_anonymised |
int $user_id |
A member chose Go anonymous (only with OG Ai Companion Account active). |
Magic links, social sign-in and two-factor also fire WordPress's own wp_login action after signing someone in.
// Post Admin guard catches to your own log.
add_action( 'ogel_guard_blocked', function ( $ip, $name ) {
error_log( sprintf( 'Admin guard caught %s trying "%s"', $ip, $name ) );
}, 10, 2 );
Actions OG Enhanced Login listens to¶
| Action | What it does |
|---|---|
og_account_customiser_security_sections |
Draws the two-factor set-up in OG Account Customiser's My Account › Security page. |
Shortcodes¶
All Pro. None take attributes, except [ogel_guard_field].
| Shortcode | What it prints |
|---|---|
[ogel_signin_form] |
The sign-in form, inline. Nothing for signed-in people. Works with or without the sign-in pop-up switched on. |
[ogel_account_links] |
Members: "Hi, name · My Account · Log out". Guests: a Log in link. My Account falls back to the wp-admin profile without WooCommerce. |
[ogel_guard_popup] |
The Admin guard pop-up for the current visitor. |
[ogel_signin_fields] |
Sign-in fields only, with no card, logo or title. Used inside the Elementor sign-in pop-up template. |
[ogel_guard_field field="ip"] |
One detail of the caught visitor: field is ip, name or time. Used in the Elementor guard template. |
[ogel_guard_details] |
The caught visitor's address, name tried and time, as a list. |
[ogel_guard_actions] |
The guard pop-up's buttons and appeal form. |
The last four are made for the Elementor Popup templates that Elementor integration builds. You can use them in your own templates.
Widget¶
Pro. OG Sign-in (ogel_signin): the sign-in form for guests; My Account and Log out for members.
| Instance key | Default |
|---|---|
title |
Sign in |
member_title |
Your account |
Menu items¶
Pro. Appearance › Menus › OG Enhanced Login adds custom links with these URLs. You can also add them yourself as custom links.
| URL | Item |
|---|---|
#ogel-loginout |
Log in for guests, Log out for members. Opens the sign-in pop-up when it is on. |
#ogel-register |
Register. Guests only, and only when sign-up is open. |
#ogel-account |
My Account. Members only. |
REST route¶
Pro, with OG Ai Companion Account.
| Route | Method | Permission | Use |
|---|---|---|---|
og-ai/v1/age/stripe |
POST |
Public, checked by the webhook signature | Receives age-check verification events from the payment provider's webhook. |
AJAX actions¶
| Action | Edition | Who | What it does |
|---|---|---|---|
ogel_signin |
Pro | Guests and members (wp_ajax_ and wp_ajax_nopriv_) |
Signs in from the pop-up or [ogel_signin_form]. Posts log, pwd, rememberme and redirect_to. Captcha, lockouts, the Admin guard and two-factor all apply. |
Admin-post actions¶
All need manage_options and a nonce, except where noted.
| Action | Edition | What it does |
|---|---|---|
ogel_save / ogell_save |
Pro / Lite | Saves one settings section. |
ogel_register / ogell_register |
Pro / Lite | Saves the Register page settings. |
ogel_unlock / ogell_unlock |
Pro / Lite | Unlocks an address. |
ogel_clear_log / ogell_clear_log |
Pro / Lite | Empties the sign-in log. |
ogel_layout / ogell_layout |
Pro / Lite | Switches between side menu and top tabs for the current user. |
ogel_guard |
Pro | Admin guard actions: unblock, keep blocked, release, lift restriction, close appeals. |
ogel_approval |
Pro | Approves or denies held accounts. |
ogel_passwords |
Pro | Forces or cancels password resets. |
ogel_export, ogel_import, ogel_reset |
Pro | Import & export. |
ogel_elementor_save |
Pro | Builds or saves the Elementor Popup templates. |
ogel_licence_activate, ogel_licence_deactivate |
Pro | Licence key. |
og_el_2fa_start, _confirm, _cancel, _disable, _codes |
Pro | Two-factor set-up steps. Any signed-in user, for their own account. |
ogel_appeal |
Pro | A restricted member sends an appeal from My Account. |
ogel_ban_appeal |
Pro | A caught visitor sends an appeal from the guard pop-up. Also open to guests (admin_post_nopriv_). |
ogaic_age_settings, ogaic_age_doc, ogaic_age_decide, ogaic_age_legal |
Pro | Age checks screens (edit_users). |
MCP tools¶
Pro, with OG AI Core. The tools are served by OG AI Core's MCP server. They are listed only while OG Enhanced Login is active. They are administrators only (manage_options) and never part of the public MCP. Secret keys are never returned and cannot be set.
Tools that change things need confirm: true.
| Tool | Arguments | What it does |
|---|---|---|
ogel_get_status |
none | Version, which features are on, what is waiting (reviews, appeals, held accounts, forced resets) and 7-day sign-in totals. |
ogel_get_settings |
group (all or one group) |
Reads settings. Groups: skin, captcha, lockout, general, popup, hide, redirects, approval, passwords, access, social. |
ogel_update_settings |
group, values (object), confirm |
Changes fields in one group. Objects merge, lists replace. general is read-only here. |
ogel_guard_list |
limit (default 100, max 500) |
Addresses waiting for review, auto blocked addresses, open appeals, the all-time total and the Always refuse list. |
ogel_ip_action |
action (release, keep_blocked, unblock, dismiss_appeal, unlock), ips (array), confirm |
Acts on addresses. |
ogel_signin_log |
limit (default 50, max 500), days (default 7, max 365), ip |
Newest failed sign-ins and guard hits, addresses locked now, and totals. |
ogel_approval_list |
state (pending, unverified, denied, all), limit |
Accounts held by New accounts. |
ogel_approval_action |
action (approve, deny), user_ids (array), confirm |
Approves (and e-mails the person) or denies (and signs them out). Administrators are never denied. |
ogel_password_reset_list |
none | People who must choose a new password, and the current password rules. |
ogel_force_password_reset |
user_ids (array), confirm |
Signs each person out and makes them choose a new password. You cannot force your own account. |
Warning
ogel_update_settings can lock people out, you included, through hide, access.force_login, lockout, passwords and approval. Read the group first and check the change.
WP-CLI¶
Pro.
| Command | What it does |
|---|---|
wp og-el-2fa reset <user> |
Turns two-factor sign-in off for one person. <user> is a user ID, username or e-mail address. |
wp og-el-2fa status <user> |
Shows whether two-factor is on, how many backup codes are left, and whether another plugin handles two-factor. |
Constants¶
Set these in wp-config.php.
| Constant | Edition | What it does |
|---|---|---|
OGEL_HIDE_LOGIN_OFF |
Pro | true switches Hide login off, whatever is saved, so wp-login.php works again. |
OG_EL_TWO_FACTOR_DISABLED |
Pro | true switches two-factor sign-in off for everyone. |
Set by the plugin (read only):
| Constant | Edition | Value |
|---|---|---|
OGEL_VERSION, OGEL_FILE, OGEL_DIR, OGEL_URL |
Pro | Version, main file, folder path and folder URL. If OGEL_VERSION is already defined when Pro loads, the second copy stops and shows a notice. |
OGELL_VERSION, OGELL_FILE, OGELL_DIR, OGELL_URL, OGELL_FULL_URL |
Lite | The same for Lite. OGELL_FULL_URL is the Pro product page. |
OGEL_AGE_CHECKS |
Pro | Defined when age checks are loaded. |
Lite rests whenever OGEL_VERSION is defined (Pro is active).
Options¶
Lite and Pro share ogel_settings, ogel_db_version and the log table.
| Option | Edition | What it holds |
|---|---|---|
ogel_settings |
Lite and Pro | All settings, in groups. Lite keeps the keys only Pro uses when it saves. |
ogel_db_version |
Lite and Pro | Log table schema version (2). |
ogel_settings_before_import |
Pro | The settings from before the last import or reset, for Undo. |
ogel_guard_blocks |
Pro | Addresses caught by the Admin guard and waiting. |
ogel_guard_kept |
Pro | Auto blocked addresses (up to 3,000), with names tried, times and appeals. |
ogel_guard_total |
Pro | All-time count of caught addresses. |
ogel_elementor_templates |
Pro | IDs of the Elementor Popup templates built by the plugin. |
ogk_client_og_enhanced_login |
Pro | Licence state. |
ogel_settings groups¶
| Group | Edition | Main keys (defaults) |
|---|---|---|
skin |
Lite and Pro | enabled (1), background, form_background, field_background, field_text, button_background, button_text, logo_url, logo_width (300), logo_height (84), custom_css, remember_me (1), language_switcher (1). Pro: signin_popup (0), signin_engine (og), bg_image, bg_overlay (40), form_align (center), form_width, form_radius, text_colour, welcome, hide_back, hide_lost |
captcha |
Lite and Pro | enabled (0), provider (recaptcha_v3), theme (dark), keys, site_key, secret_key, threshold (0.5), forms |
lockout |
Lite and Pro | enabled (1), attempts (4), minutes (20), message, allowlist, blocklist, ip_header, keep_days (30). Pro: guard (1), guard_names, guard_email (0) |
general |
Lite and Pro | delete_on_uninstall (0). Pro: elementor (0) |
popup |
Pro | The Admin guard pop-up text and design |
hide |
Pro | enabled (0), slug |
redirects |
Pro | enabled (0), rules (per role) |
approval |
Pro | verify (0), approve (0), notify (1) |
passwords |
Pro | enabled (0), min_length (12), upper, lower, number (1), symbol (0), expire_days (0), expire_admins (0) |
access |
Pro | session_on (0), normal_hours (48), remember_days (14), admin_hours (0), single_session (0), single_admins (0), login_with (both), force_login (0), force_to (login), force_allow, xmlrpc (on), magic_on (0), magic_minutes (15), magic_admins (0) |
social |
Pro | enabled (0), create (1), providers |
Captcha form keys: wp_login, wp_register, wp_lostpassword, woo_login, woo_register, woo_lostpassword. Provider keys: recaptcha_v3, recaptcha_v2, hcaptcha, turnstile.
// Read one setting.
$settings = get_option( 'ogel_settings', array() );
$attempts = isset( $settings['lockout']['attempts'] ) ? (int) $settings['lockout']['attempts'] : 4;
The Register page also writes WordPress and WooCommerce's own options: users_can_register, default_role, woocommerce_enable_myaccount_registration, woocommerce_registration_generate_username and woocommerce_registration_generate_password.
User meta¶
All Pro.
| Meta key | What it holds |
|---|---|
_ogel_status |
New accounts state: unverified, pending or denied. No meta = can sign in. |
_ogel_verify_hash |
Hashed e-mail check token. |
_ogel_pw_changed |
When the password was last set (Unix time). |
_ogel_pw_reset |
Set when a reset is forced. |
_ogel_magic |
The pending magic link. |
_ogel_social_<provider> |
The person's ID at that service, such as _ogel_social_google. |
_ogel_restricted |
Restriction details for a member tied to a caught address. |
_ogel_last_ip |
Address of the last sign-in. |
_ogel_trusted_ips |
An administrator's own addresses from the last 90 days (up to 20). |
_og_el_2fa_secret |
Encrypted authenticator secret. |
_og_el_2fa_pending |
Encrypted secret during set-up. |
_og_el_2fa_backup |
Hashed backup codes. |
_og_el_2fa_last_step |
Last accepted code step, so a code cannot be used twice. |
_og_el_2fa_challenge |
The open code challenge. |
_og_el_2fa_fails |
Recent wrong codes. |
ogks_layout |
Side menu or top tabs on OG screens (shared). |
Database table¶
{prefix}ogel_login_attempts, shared by Lite and Pro.
| Column | Type | Meaning |
|---|---|---|
id |
bigint(20) unsigned |
Row ID. |
ip |
varchar(45) |
Address. |
username |
varchar(191) |
Name typed. |
attempted_at |
datetime |
When. |
gateway |
varchar(20) |
Where it came from (wp-login.php, My Account, pop-up, XML-RPC and so on). |
kind |
varchar(10) |
failed (wrong password), lockout (a lockout started) or guard (Admin guard hit, never counted towards a lockout). |
Indexes: ip_time (ip, attempted_at) and attempted_at. Rows older than Keep the sign-in log (days) are removed by a daily cron.
Cron hooks¶
| Hook | Edition | Schedule | What it does |
|---|---|---|---|
ogel_purge_attempts |
Pro | Daily | Removes old log rows. |
ogell_purge_attempts |
Lite | Daily | The same, for Lite. |
ogaic_kyc_cleanup |
Pro (age checks) | Daily | Deletes age-check uploads nobody reviewed in time. |
ogaic_kyc_expiry |
Pro (age checks) | Hourly | Enforces the deletion dates for members who chose Go anonymous. |
URLs and query arguments¶
| URL | Edition | Use |
|---|---|---|
admin.php?page=og-enhanced-login&ogel_tab=<section> |
Pro | Opens a section. Sections: login, register, approval, redirects, captcha, passwords, access, social, guard, popup, autoblocked, hide, lockouts, log, twofactor, tools, licence. |
admin.php?page=og-enhanced-login&ogell_tab=<section> |
Lite | Sections: login, register, captcha, lockouts, log, pro. |
admin.php?page=ogaic_age |
Pro | Age checks. |
users.php?page=og-el-two-factor |
Pro | Two-factor set-up for the current user. |
wp-login.php?ogel_preview=1 (Lite: ogell_preview=1) |
Lite and Pro | Live preview of the sign-in page. Administrators only. |
wp-login.php?action=ogel_magic |
Pro | Ask for a magic link. |
wp-login.php?action=og_el_2fa |
Pro | The two-factor code page. |
/?ogel_social=<provider> |
Pro | Social sign-in start and return address. |
JavaScript globals¶
| Global | Edition | Script handle | Contents |
|---|---|---|---|
ogelSignin |
Pro | ogel-signin |
ajax, action, login, captcha (site key or empty), engine (og or elementor), elementor (template ID), wait, failed. |
ogelCaptcha |
Pro | ogel-captcha |
key, field (ogel_captcha), provider, theme. |
ogelCaptchaForms |
Pro | ogel-captcha |
Form selectors mapped to captcha actions. |
ogelCaptchaLoad() |
Pro | ogel-captcha |
Callback the box-style captcha services call when loaded. |
ogelAdmin |
Pro | ogel-admin |
Strings for the settings screen's media picker. |
The captcha answer is posted in the field ogel_captcha.
Uninstall¶
Pro's uninstall.php clears the ogel_purge_attempts cron. If Lite is still installed, it stops there. Otherwise, only when Remove on uninstall is on, it drops {prefix}ogel_login_attempts and deletes ogel_settings and ogel_db_version. Lite does the same in reverse. Two-factor and age-check user meta always stay.