|
3 | 3 | * Plugin Name: CloudScale DevTools |
4 | 4 | * Plugin URI: https://andrewbaker.ninja |
5 | 5 | * Description: Developer toolkit with syntax-highlighted code blocks, SQL query tool, code migrator, site monitor, and login security (passkeys, TOTP, email 2FA, hide login URL). |
6 | | - * Version: 1.8.88 |
| 6 | + * Version: 1.8.90 |
7 | 7 | * Author: Andrew Baker |
8 | 8 | * Author URI: https://andrewbaker.ninja |
9 | 9 | * License: GPL-2.0-or-later |
|
38 | 38 | */ |
39 | 39 | class CloudScale_DevTools { |
40 | 40 |
|
41 | | - const VERSION = '1.8.88'; |
| 41 | + const VERSION = '1.8.90'; |
42 | 42 | const HLJS_VERSION = '11.11.1'; |
43 | 43 | const HLJS_CDN = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/'; |
44 | 44 | const TOOLS_SLUG = 'cloudscale-devtools'; |
@@ -311,9 +311,11 @@ public static function init() { |
311 | 311 | add_filter( 'site_url', [ __CLASS__, 'login_custom_site_url' ], 10, 4 ); |
312 | 312 |
|
313 | 313 | // Brute-force protection — check before authentication (priority 1, before password check). |
314 | | - add_filter( 'authenticate', [ __CLASS__, 'login_brute_force_check' ], 1, 3 ); |
| 314 | + add_filter( 'authenticate', [ __CLASS__, 'login_brute_force_check' ], 1, 3 ); |
315 | 315 | // Force persistent cookie when a custom session duration is configured. |
316 | | - add_action( 'login_form_login', [ __CLASS__, 'login_force_remember' ] ); |
| 316 | + // Must be login_init (fires before the POST is processed) not login_form_login |
| 317 | + // (which is a display hook that never fires on a successful login POST). |
| 318 | + add_action( 'login_init', [ __CLASS__, 'login_force_remember' ], 5 ); |
317 | 319 | // Security monitor — always track failed logins regardless of monitor toggle. |
318 | 320 | add_action( 'wp_login_failed', [ __CLASS__, 'perf_track_failed_login' ] ); |
319 | 321 |
|
@@ -4214,12 +4216,18 @@ public static function login_session_expiration( int $expiration, int $user_id, |
4214 | 4216 | } |
4215 | 4217 |
|
4216 | 4218 | /** |
4217 | | - * When a custom session duration is configured, forces "remember me" on the |
4218 | | - * standard WordPress login form so the auth cookie is written as a persistent |
4219 | | - * cookie (non-zero expiry) rather than a session cookie that browsers clear |
4220 | | - * when closed. |
| 4219 | + * When a custom session duration is configured, forces "remember me" so the |
| 4220 | + * auth cookie is written as a persistent cookie (non-zero browser expiry) |
| 4221 | + * rather than a session cookie that browsers clear when closed/swiped away. |
4221 | 4222 | * |
4222 | | - * @since 1.9.5 |
| 4223 | + * Hooked to `login_init` (priority 5) — fires before WordPress reads |
| 4224 | + * $_POST['rememberme'] when processing the login form POST, so wp_signon() |
| 4225 | + * receives remember=true and wp_set_auth_cookie() sets an explicit expiry. |
| 4226 | + * |
| 4227 | + * Note: login_form_login is a DISPLAY hook (fires when rendering the form) |
| 4228 | + * and never fires on a successful login POST — do NOT use that hook here. |
| 4229 | + * |
| 4230 | + * @since 1.8.88 |
4223 | 4231 | * @return void |
4224 | 4232 | */ |
4225 | 4233 | public static function login_force_remember(): void { |
|
0 commit comments