Conversation
supportPlugin is causing a PHP Fatal error due to the function loginpress_box_shadow() being declared more than once from the file style-login.php , Fatal error: Fatal error: Cannot redeclare loginpress_box_shadow() (previously declared in /home/customer/www/public_html/wp-content/plugins/loginpress/css/style-login.php:261) in /home/customer/www/public_html/wp-content/plugins/loginpress/css/style-login.php on line 261 The Best Practice to fix would be Step 1: Modify style-login.php to use function_exists Step 2 (Optional, but Good): Use include_once instead of include if ( ! function_exists( 'loginpress_box_shadow' ) ) { function loginpress_box_shadow( $shadow, $opacity, $default_shadow = 0, $inset = false ) { $loginpress_shadow = ! empty( $shadow ) ? $shadow : $default_shadow; $loginpress_opacity = ! empty( $opacity ) ? $opacity : 80; $inset = $inset ? ' inset' : ''; $opacity_conversion = $loginpress_opacity / 100; $loginpress_rgba = 'rgba( 0,0,0,' . $opacity_conversion . ' )'; return '0 0 ' . $loginpress_shadow . 'px ' . $loginpress_rgba . $inset . ';'; } } This topic was modified 10 months ago by Dev . This topic was modified 10 months ago by Dev .
Hey, @hell0bunny Thank you for reporting this issue. We didn’t experience this error in any of our testing, but we’ve gone ahead and implemented the necessary checks to prevent it. If you’d like, we can share a beta version with the fix so you can test it right away. Please contact our support forum for the beta version. We noticed the 1-star rating was based on this error. Since the issue has now been resolved, we’d really appreciate it if you could reconsider or update your rating. It helps us continue improving LoginPress for everyone 💙. Thanks again for bringing this to our attention!
Hello @abdulwahab610 Plugin is again throwing different error after fixing previous one Fatal error: Cannot redeclare loginpress_custom_js() (previously declared in /wp-content/plugins/loginpress/js/script-login.php:9) in /wp-content/plugins/loginpress/js/script-login.php on line 9
Sorry, I’m not available for testing the beta version, but I would appreciate if you make sure to add the function_exists() check in all files , not just patch one and leave the rest. I appreciate your efforts in making plugin but this kind of rough coding leads to fatal errors and breaks live sites and frustrates client and users. As this plugin is already approved, don’t stop following basic WordPress coding standards. Thanks. if ( ! function_exists( 'function_name' ) ) { function function_name() { // code } }
Hey, @hell0bunny We truly appreciate your efforts in helping us improve the plugin for the community. We haven’t experienced this issue on any of our sites, nor have we received similar reports from other users, but we’ll definitely look into it. Could you please share your log file from LoginPress > Help with us through our support form ? This will greatly help us diagnose the root cause and provide a proper fix. Thanks again!
Hey, @hell0bunny Thank you for reporting this issue. We didn’t experience this error in any of our testing, but we’ve gone ahead and implemented the necessary checks to prevent it. If you’d like, we can share a beta version with the fix so you can test it right away. Please contact our support forum for the beta version. We noticed the 1-star rating was based on this error. Since the issue has now been resolved, we’d really appreciate it if you could reconsider or update your rating. It helps us continue improving LoginPress for everyone 💙. Thanks again for bringing this to our attention!
Hello @abdulwahab610 Plugin is again throwing different error after fixing previous one Fatal error: Cannot redeclare loginpress_custom_js() (previously declared in /wp-content/plugins/loginpress/js/script-login.php:9) in /wp-content/plugins/loginpress/js/script-login.php on line 9
Sorry, I’m not available for testing the beta version, but I would appreciate if you make sure to add the function_exists() check in all files , not just patch one and leave the rest. I appreciate your efforts in making plugin but this kind of rough coding leads to fatal errors and breaks live sites and frustrates client and users. As this plugin is already approved, don’t stop following basic WordPress coding standards. Thanks. if ( ! function_exists( 'function_name' ) ) { function function_name() { // code } }
Hey, @hell0bunny We truly appreciate your efforts in helping us improve the plugin for the community. We haven’t experienced this issue on any of our sites, nor have we received similar reports from other users, but we’ll definitely look into it. Could you please share your log file from LoginPress > Help with us through our support form ? This will greatly help us diagnose the root cause and provide a proper fix. Thanks again!