[CRITICAL] 3 Major Bugs Report
-
I am reporting three critical issues found in LoginPress Free (6.1.0) and LoginPress Pro (6.0.0) running on WordPress 6.9 (PHP 8.1).
Below are the details and the fixes I had to apply manually to make the plugin work.BUG #1: PHP 8.x Fatal Error (Limit Login Attempts Add-on)
Severity: Critical (Site Crash)
Error: PHP Fatal error: Uncaught TypeError: Unsupported operand types: string * int in class-attempts.php:692Root Cause:
- Missing Table: The table wp_loginpress_limit_login_details is not created upon activation.
- Type Error: Without the table, the code retrieves empty strings and attempts arithmetic operations on them, violating PHP 8 strict typing.
The Fix:
Ensure the table is created on activation. Here is the missing SQL schema:codeSQLCREATE TABLE IF NOT EXISTSwp_loginpress_limit_login_details( id int(11) NOT NULL AUTO_INCREMENT, ip varchar(255) NOT NULL, username varchar(255) NOT NULL, datentime varchar(255) NOT NULL, gateway varchar(255) NOT NULL, whitelist int(11) NOT NULL, blacklist int(11) NOT NULL, login_status varchar(255) NOT NULL, UNIQUE KEY id (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;Also, please update class-attempts.php to check for table existence before querying.BUG #2: JS ReferenceError “sprintf is not defined”
File: loginpress-pro/build/index.js
Error: ReferenceError: sprintf is not definedRoot Cause:
In the compiled React JS, sprintf() is called directly without the wp.i18n namespace.The Fix:
Replace standalone sprintf( calls with (0, wp.i18n.sprintf)( in your build process.BUG #3: Missing REST Endpoint (404 Error)Error: GET /wp-json/loginpress/v1/captcha-tab-visibility 404 (Not Found)
Root Cause:
The React frontend calls this endpoint, but it is never registered in the PHP backend.The Fix:
Add this to loginpress/classes/traits/loginpress-rest-trait.php:codePHPregister_rest_route( LOGINPRESS_REST_NAMESPACE, '/captcha-tab-visibility', array( 'methods' => 'GET', 'callback' => array( $this, 'loginpress_get_captcha_tab_visibility' ), 'permission_callback' => array( $this, 'loginpress_rest_can_manage_options' ), ) ); // Callback: public function loginpress_get_captcha_tab_visibility() { $visible = false; // ... logic to check if captcha addon is active ... return array( 'visible' => $visible ); }Environment:
- WP: 6.9
- PHP: 8.1
- LoginPress Free: 6.1.0 / Pro: 6.0.0
You must be logged in to reply to this topic.