<?php
/*
Plugin Name: BAW Login/Logout menu
Plugin URI: https://www.boiteaweb.fr/?p=3337
Description: You can now add a correct login & logout link in your WP menus.
Author: Juliobox
Author URI: https://wp-rocket.me
Version: 1.3.3
*/
define("BAWLLM_VERSION", "1.3.3");
add_action("plugins_loaded", function () {
$filename = "inc/";
$filename .= is_admin() ? "backend-" : "frontend-";
$filename .= defined("DOING_AJAX") && DOING_AJAX ? "" : "no";
$filename .= "ajax.inc.php";
if (file_exists(plugin_dir_path(__FILE__) . $filename)) {
include plugin_dir_path(__FILE__) . $filename;
}
$filename = "inc/";
$filename .= "bothend-";
$filename .= defined("DOING_AJAX") && DOING_AJAX ? "" : "no";
$filename .= "ajax.inc.php";
if (file_exists(plugin_dir_path(__FILE__) . $filename)) {
include plugin_dir_path(__FILE__) . $filename;
}
});
]]>
Hi there,
I’m reaching out on behalf of WordPress.com related to an issue reported by one of our users. During testing I found that the most recent version of this plugin (1.3.3) is not compatible with PHP 8.0. When used together, the following fatal is thrown. I tested this with all other plugins deactivated on WordPress 6.0.1.
I do see that a thread was previously opened about this [here](https://www.ads-software.com/support/topic/login-logout-menu-plugin-does-not-work-in-php-8-0/) where it was reported that the latest update was compatible with 8.0 but this does not appear to be true.
Fatal error: Uncaught Error: Call to undefined function create_function() in /srv/htdocs/wp-content/plugins/baw-login-logout-menu/bawllm.php:13
Stack trace:
#0 /wordpress/core/6.0.1/wp-admin/includes/plugin.php(2313): include_once()
#1 /wordpress/core/6.0.1/wp-admin/includes/plugin.php(661): plugin_sandbox_scrape('baw-login-logou...')
#2 phar:///usr/local/bin/wp-cli/vendor/wp-cli/extension-command/src/Plugin_Command.php(333): activate_plugin('baw-login-logou...', '', NULL)
#3 [internal function]: Plugin_Command->activate(Array, Array)
#4 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func(Array, Array, Array)
#5 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
#6 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func(Object(Closure), Array, Array)
#7 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(417): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
#8 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(440): WP_CLI\Runner->run_command(Array, Array)
#9 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1237): WP_CLI\Runner->run_command_and_exit()
#10 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#11 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/bootstrap.php(78): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#12 phar:///usr/local/bin/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()
#13 phar:///usr/local/bin/wp-cli/php/boot-phar.php(11): include('phar:///usr/loc...')
#14 /usr/local/bin/wp-cli(4): include('phar:///usr/loc...')
#15 {main}
thrown in /srv/htdocs/wp-content/plugins/baw-login-logout-menu/bawllm.php on line 13
]]>
A few weeks ago, I noticed that when someone logs in, it refreshes the homepage, but the menu button does not refresh. It still says “Log In.” Only when I navigate to another page does it refresh to say “Log Out.” Can this be fixed?
]]>After installing the Login Logout Menu plugin, the following error message appears.
Fatal error: Uncaught Error: Call to undefined function create_function() in C:\xampp\htdocs\pluginall\wp-content\plugins\baw-login-logout-menu\bawllm.php:13 Stack trace: #0 C:\xampp\htdocs\pluginall\wp-admin\includes\plugin.php(2299): include() #1 C:\xampp\htdocs\pluginall\wp-admin\plugins.php(191): plugin_sandbox_scrape(‘baw-login-logou…’) #2 {main}thrown in C:\xampp\htdocs\pluginall\wp-content\plugins\baw-login-logout-menu\bawllm.php on line 13
]]>Hi everyone,
The plugin works fine for me, but after adding the Logged In/Logged Out item in the menu, I see following in the navigation:
“Se Connecter/Se Deconnecter”, but as I’m building the website in German (and French and English too), I would rather change the navigation item simply to “Login/Logout” for instance.
I couldn’t find the line to edit in the .php files in the inc folder of the plugin, as well as any option in the WP console (Theme Ocean WP).
Any help would be very welcome!
Olivier
]]>Hello.
The redirect to my page does not work when setting up LOGIN, the wordpress login page loads.
At the same time the address bar seems to indicate everything is correct
_psy.diagnozu.net/wp-login.php?redirect_to=lms-login
After authorization, redirection works where it is necessary, but it is necessary that the first time you click on LOGIN, the user gets to the page I specified immediately and logs in from it.
Tell me, how do I set this up?
Any chance of getting a image for the WordPress plugin directory?
]]>Deprecated: Function create_function() is deprecated in /home/xxxx/xxxxxxxx.com/public_html/wp-content/plugins/baw-login-logout-menu/bawllm.php on line 13
Replace all the code in the bawllm.php file with the code below. Save it, uploaded it and the problem is fixed.
<?php
/*
Plugin Name: BAW Login/Logout menu
Plugin URI: https://www.boiteaweb.fr/?p=3337
Description: You can now add a correct login & logout link in your WP menus.
Author: Juliobox
Author URI: https://wp-rocket.me
Version: 1.3.3
*/
define( 'BAWLLM_VERSION', '1.3.3' );
add_action( 'plugins_loaded', function() {
$filename = "inc/";
$filename .= is_admin() ? "backend-" : "frontend-";
$filename .= defined( "DOING_AJAX" ) && DOING_AJAX ? "" : "no";
$filename .= "ajax.inc.php";
if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
include( plugin_dir_path( __FILE__ ) . $filename );
$filename = "inc/";
$filename .= "bothend-";
$filename .= defined( "DOING_AJAX" ) && DOING_AJAX ? "" : "no";
$filename .= "ajax.inc.php";
if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
include( plugin_dir_path( __FILE__ ) . $filename );
});
]]>
Hello,
This plugin don’t work on my WordPress 4.9.8 with PHP 7.2, I fix it by doing this on the file “baw-login-logout-menu/bawllm.php” :
Because “create_function” is deprecated, I modified :
add_action( ‘plugins_loaded’, create_function( ”, ‘
$filename = “inc/”;
$filename .= is_admin() ? “backend-” : “frontend-“;
$filename .= defined( “DOING_AJAX” ) && DOING_AJAX ? “” : “no”;
$filename .= “ajax.inc.php”;
if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
include( plugin_dir_path( __FILE__ ) . $filename );
$filename = “inc/”;
$filename .= “bothend-“;
$filename .= defined( “DOING_AJAX” ) && DOING_AJAX ? “” : “no”;
$filename .= “ajax.inc.php”;
if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
include( plugin_dir_path( __FILE__ ) . $filename );
‘ )
);
By :
add_action( ‘plugins_loaded’, function() {
$filename = “inc/”;
$filename .= is_admin() ? “backend-” : “frontend-“;
$filename .= defined( “DOING_AJAX” ) && DOING_AJAX ? “” : “no”;
$filename .= “ajax.inc.php”;
if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
include( plugin_dir_path( __FILE__ ) . $filename );
$filename = “inc/”;
$filename .= “bothend-“;
$filename .= defined( “DOING_AJAX” ) && DOING_AJAX ? “” : “no”;
$filename .= “ajax.inc.php”;
if( file_exists( plugin_dir_path( __FILE__ ) . $filename ) )
include( plugin_dir_path( __FILE__ ) . $filename );
});
<3 for you !
]]>Has this plugin been checked for security holes?
]]>Any chance the plugin will update?
]]>Hi,
I want to change the login page link of the ‘BAW’ login button from usual WordPress login to the following page: shishkebabb.com/new-registration/.
In the WP dashboard of my website, I have the following configuration of the Appearance / Menu structure of the menu item:
URL: #bawloginout#
Navigation label: Login|Logout [current-username]
The button which is pointed by a red arrow in the following screen shot, should be linked to the login page ‘shishkebabb.com/new-registration/’ in stead of ‘https://shishkebabb.com/login/’:
https://s18.postimg.org/9qwo9ossp/changing_login_button_page_link.png
How do I change the link of that button?
Kind regards,
Yunis
]]>How can i add this feture for woocommerce login/logout or registration form?
]]>Instead of redirect is there a way to close the window on logout?
]]>Hello,
Could you please let me know, how can I set a Custom Login URL?
I don’t want users to use the default WP login page.
I’ve set up another login page.
Looking forward to hear from you.
Thanks!
This plugin hasn’t been updated in over 2 years. It seems to work fine though…
Will the plugin be maintained in the future?
]]>I have BAW login/logout plugin version 1.3.3 on WordPress version 4.7.5. The plugin does what it is designed to do. No problems there. What I want to know is if there is a relatively easy way to make it affect only the primary (header) menu.
I want to have a static menu in the footer and a menu in the header that has the login/logout options in it.
Any advice would be appreciated.
]]>I used BAW login logout plugin and used link register, login/logout. When i login it redirects to My account page but i want redirection to home page.I have tried #bawloginout#%actualpage%. This redirects back to home page but without login.
When i use register link, it redirect to login/register page.After click on Register,it takes to the page with message-Check email for password link.In email, there are two links (1)https://www.carastore4u.com/wp-login.php (2)<https://www.carastore4u.com/wp-login.php?action=rp&key=7dIoo14j5qwpiAKYFJi9&login=saloni> I click on 2nd link,it redirects to page with get new password link and message-“Please enteryourusername & email.You will recieve a link to create a new password via email. Your password reset link appears to be invalid. Please request a new link below”. I click on set new password >check email >click on link. It redirect to the page with error 502 bad gateway.So registration is not complete.Kindly help me to fix it.
Hi,
I have the following setup:
– WP 4.7.3
– Latest Avada theme
– Latest Thrive Leads plugin
– Latest Easy Digital Downloads plugin
– Your latest plugin
My issue is as follows and the guys at Easy Digital Downloads suggested I ask my questions here:
– I chose the “log in | log out” option (what do I put as the URL? I have chosen to send to my /login page)
– before I’m logged in (it gives me both options of in/out) – I need to only see the log in option
– after I log in, it still shows both options – I need to only see the log out option
– after I’m logged in, and click on the link, it takes me to my log in URL and says I’m already logged in – I need to get logged out and go to the homepage
Can you please advice what I can do to resolve it as your plugin seems to be my only option here according to the guys at EDD.
Thanks
]]>How does one send a user from clicking Login to the xxxxxxxxx.com/login page and not to xxxxxx.com/wp-login.php
]]>I’m using both the Log In|Log Out and Register links on my menu … so simple to install, configure, and use! The Log In|Log Out works wonderfully to bring the user back to the same page as when they performed the Login / Logout.
However when using the Register link, it redirects them to the wp-admin page. It’s very disconcerting to them, since they think they’ve stumbled in to some behind the scenes admin page. I’ve tried simulating the syntax from Log In|Log Out … using #bawregister#%actualpage% … but all that does is display #bawregister# in the Register position, even when I’m logged in.
Is there a trick that I haven’t found, or is this functionality not supported
]]>How do I add the font-awesome sign-in and sign-out icons to the Login/Logout? When I add them to the Navigation Label (that defaults as Login|Logout), it does not work and just displays the font-awesome code.
]]>Been using this plugin for several years and it still works really well if you want to have a menu item that displays ‘Login’ or ‘Logout’ depending on whether you are in/out.
Problem is that the documentation is so vague that even though I got it to work, I wasn’t quite sure how – until now.
Once you have it installed, add the login/logout version to your menu. These should be your settings:
For the URL setting:
#bawloginout#/page-to-load-after-login/|/page-to-load-after-logout/
Explanation:
#bawloginout#
1. This is the code that the plugin needs to switch between ‘Login’ or ‘logout’ depending on the status.
/page-to-load-after-login/
2. Replace this with the page that you want the user to go to after they log in. If all you want to do is redirect the user when they log in and you are okay with them just going to the log in page after they log out, then this is all you need.
|
3. If you want to also control what page the user is redirected to after they log out, add the pipe (|).
/page-to-load-after-logout/
4. Replace this with the page that you want the user to go to after they log out.
For the Navigation Label:
Log In|Log Out
This is a little easier, just replace ‘Log In’ with whatever text you want to display in the menu for the user to click on to log in and replace ‘Log Out’ with whatever text you want to display in the menu (when the user is logged in) for them to click on to log out. Keep the pipe (|) between the two menu titles.
Hope this helps someone, I definitely could have used this info at the beginning.
]]>is it possible to add to the woocommerce registration form?
]]>Hi I have encountered a case, when after the user has registered and login to the site, the login link status was still displaying login | register instead of logout.
]]>Hello,
it’s possible, when a user add username and password to login directly to the content page and not to the user profile?
Thank you
Alessandra
can i add custom login page as i have custom login page at /login/ and custom register page at /join/ ? if yes then how?
]]>custom login and logout links don’t show up anymore in the menu admin page, and if I try to add them manually they don’t work
]]>hi in use with avada theme
Undefined property: bawlogItems::$ID
data/plugins/baw-login-logout-menu/inc/backend-noajax.inc.php:48
so menu metas not saved.
]]>I want to redirect users to a page of my choosing however whenever a user uses this plugin to login they are directed to wp-admin/profile.php.
I have experimented with the code in the URL meta box with no success. Right now it looks like #bawloginout#index.php but users are still being directed to wp-admin/profile.php
]]>