Developer guide

Open the popup from your code, override its templates, react to its events and extend it.

FreePro

Architecture

FreePro
NamespaceSiteryn\SiterynLoginRegisterPopupSiterynPro\SiterynLoginRegisterPopup
Bootsiteryn_lrp_loaded (on plugins_loaded)siteryn_lrp_pro_loaded; features on init (priority 11) while licensed
Handlessiteryn-lrp (CSS and JS)siteryn-lrp-pro (CSS and JS)
Settings optionsiteryn_lrp_settingssiteryn_lrp_pro_settings
Settings pageadmin.php?page=siteryn-login-register-popupSame page, its own tabs (pro_*)

Free does all logging in, registration and password resets through WooCommerce (WooCommerce\CustomerAuth). Pro never copies that logic: it extends Free only through its hooks, script API and templates.

Data stored

NameWhat
siteryn_lrp_settingsFree settings (only changed keys are needed; defaults fill the rest)
siteryn_lrp_versionInstalled Free version
siteryn_lrp_outdated_templates (transient)Cached list of outdated theme template overrides
_transient_siteryn_lrp_rl_*Attempt counters, hashed keys, expire within an hour (object cache when available)
siteryn_lrp_pro_settingsPro settings, including the builder layout and redirect rules
siteryn_lrp_pro_versionInstalled Pro version
siteryn_lrp_pro_license_key, _license_status, _license_updateLicense key (not autoloaded), cached status and update info
User meta / customer dataPro custom registration fields (see where values are saved)

Accounts themselves are created and stored by WooCommerce. Uninstall removes the options above (on every site of a network), never customer accounts.

AJAX endpoints

ActionNonce field / actionFields
siteryn_lrp_loginwoocommerce-login-nonce / woocommerce-loginusername, password, rememberme, redirect
siteryn_lrp_registerwoocommerce-register-nonce / woocommerce-registeremail, username*, password*, redirect, custom fields
siteryn_lrp_lost_passwordwoocommerce-lost-password-nonce / lost_passworduser_login
siteryn_lrp_refresh_nonces-Returns fresh nonces for cached pages

* Only when WooCommerce does not generate them. All are POST to admin-ajax.php for logged-out visitors only, rate limited, and refused when the Origin is not your site. The script also sends lang and redirect_source (opener when the opener chose the destination, else page).

{ "success": true,  "data": { "message": "…", "redirect": "…", "view": "login" } }
{ "success": false, "data": { "code": "…", "message": "…", "fields": { "email": "…" }, "nonces": { … } } }

HTTP status: 400 validation, 403 credentials/nonce/disabled/cross-site, 405 not POST, 409 already logged in, 429 rate limited (with Retry-After). Pro adds the public REST route POST /wp-json/siteryn-lrp-pro/v1/license/refresh, which only schedules a license check (at most every 5 minutes).

Templates

Copy a file from the plugin's templates folder to yourtheme/siteryn-login-register-popup/ and edit it there. Each file has an @version tag; an admin notice lists theme copies older than the plugin's.

TemplatePurpose
popup.phpDialog shell: overlay, close button, views container
login-form.phpLog in view
register-form.phpRegister view (only when registration is enabled)
lost-password-form.phpLost-password view
field.phpOne form field, used for every field of every view

Keep every data-siteryn-lrp-* attribute, field name and the view section ids (siteryn-lrp-view-{view}) in your copies. Without JavaScript the forms post WooCommerce's own fields and nonces to My Account.

Opening from your code

<button type="button" data-siteryn-lrp-open="register">Join</button>
<a href="#siteryn-lrp-login" data-siteryn-lrp-redirect="/checkout/">Log in and check out</a>

Or in PHP: siteryn_lrp_link( array( 'view' => 'register' ) ) echoes the same link as the shortcode.

JavaScript API

MethodDescription
SiterynLRP.open( view, trigger )Opens on a view; focus returns to trigger on close
SiterynLRP.close()Closes and restores focus and page scrolling
SiterynLRP.switchView( view, focus )Shows a view
isOpen(), currentView(), hasView( view ), getView( view )State helpers
showNotice( view, message, type ), clearNotice( view )Text message under the heading; type is error, success or info
setFieldError( input, message ), clearFieldErrors( form )Field errors with aria-invalid
setBusy( form, busy ), isBusy( form )Submitting state
refreshNonces()Fetches fresh nonces into the forms

Events on document (event.detail.view set): siteryn-lrp:ready, siteryn-lrp:open (detail.trigger), siteryn-lrp:close, siteryn-lrp:view, siteryn-lrp:submit (detail.form, detail.data: the outgoing FormData, append to it synchronously), siteryn-lrp:success and siteryn-lrp:error (detail.data). Pro adds siteryn-lrp-pro:auto-open (detail.reason: delay, scroll or exit-intent) and the cancelable siteryn-lrp-pro:social-click (detail.provider, detail.url).

document.addEventListener( 'siteryn-lrp:success', function ( event ) {
	if ( 'login' === event.detail.view ) {
		// Your analytics call.
	}
} );

CSS variables

Set on .siteryn-lrp: --siteryn-lrp-z, --siteryn-lrp-width, --siteryn-lrp-radius, --siteryn-lrp-padding, --siteryn-lrp-bg, --siteryn-lrp-text, --siteryn-lrp-muted, --siteryn-lrp-border, --siteryn-lrp-accent, --siteryn-lrp-accent-hover, --siteryn-lrp-accent-text, --siteryn-lrp-overlay, --siteryn-lrp-error, --siteryn-lrp-error-bg, --siteryn-lrp-success, --siteryn-lrp-success-bg, --siteryn-lrp-info-bg, --siteryn-lrp-field-radius, --siteryn-lrp-button-radius, --siteryn-lrp-font-size. Pro adds --siteryn-lrp-heading-size and --siteryn-lrp-logo-width. The root also carries siteryn-lrp--anim-{slide|fade|none} and siteryn-lrp--mobile-fullscreen.

Multilingual

PHP API

MethodReturns
WooCommerce\AccountSettings::registration_enabled()Whether registration is allowed (filtered)
WooCommerce\PageContext::should_load_popups()Whether popups load on this request (filtered)
Frontend::is_active() / Frontend::get_views()Whether the popup is printed / view id => template
FormFields::get( $view )A view's normalized fields
WooCommerce\CustomerAuth::login(), register(), send_password_reset()Sign in, create a customer, send the reset email (no nonce or rate-limit checks: verify the request first)
Settings::get( $key ) / get_all()Free settings
Ajax::redirect_is_explicit()Whether the opener chose the destination
SpeculativeLoading::path_pattern( $url )A speculative-loading exclusion pattern for a page on this site

All hooks are listed in the Hooks reference.