A WordPress Login Widget – Sidebar Login Widget

August 11, 2007 | Published in: Wordpress & plugins | Tags: , , , , , 120

This plugin has now been replaced by an updated version which you can find here


Sidebar Login WidgetWant to allow users to log into wordpress from the sidebar? Doing so is not as simple as it sounds, so to ease your stress I have created a widget to handle everything.

It lets users login, and then redirects them back to the page they logged in from rather than the backend, it also shows error messages. Read more for more information and the download link.

Sidebar Login Widget v1.5 Build 20070122

By Mike Jolley ( http://www.blue-anvil.com )

What is it?

It’s a widget that allows users to login to wordpress from the sidebar! It uses php sessions to cleverly retrieve the wordpress login error messages, and uses redirects to send the user back to the site, rather than the wordpress backend.

Screenshots

User not logged in:

Not logged in screenshot.gif

User logged in:

Logged in screenshot.gif

Errors!

Error! Screenshot.gif

Get it now!

Download Sidebar Login Widget Version 1.55

| Index |

Installation Instructions

Simply:

  1. Unzip and upload the php file to your wordpress plugin directory
  2. Activate the plugin
  3. Goto the presentation > widgets tab
  4. Drag the widget into a sidebar and save!

| Index |

License

WordPress Sidebar Login Widget © Copyright 2007-current.
Mike Jolley

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

| Index |

Support my sweat, blood and tears

I know, that sounds gross, but we really did put ALOT of effort into this widget. If you like this widget please make a donation via paypal! Any amounts are welcome, your support is much appreciated.


| Index |

Found this post useful? Why not buy me a coffee!

Related Entries

120 Responses to “A WordPress Login Widget – Sidebar Login Widget”

RSS feed for comments on this post.

  1. tjestr says:

    how to fix the 2.3 problem camc had?
    i’ve got the same error and i don’t know how to fix it.

    Comment made on October 27, 2007 at 9:17 am

  2. Frank says:

    Hi, It works fine for me. I will like that the script does not takes you to the dashboard hwn login in or login out.

    It would be cool if it just stays in the main blog page, and you use the widget to get into the dashboard if you want. thanks

    Comment made on October 31, 2007 at 8:47 am

  3. Nandan says:

    very neat and elegant and very useful. I just put it up on my travel website http://www.ghumakkar.com

    I have multiple bloggers and initially it gets difficult to remember the login link, this makes it so much obvious and clean. Thank you very much.

    Comment made on November 2, 2007 at 6:36 am

  4. Dario Caregnato says:

    Hi, what if I want to add TWO different widgets in two different pages? If I add your widget it doesn’t instantiate itself as it should, it doesn’t clone itself! :) A solution might be giving the code to call the plugin via PHP, as Camc requested a few comments ago ;) The code

    widget_sidebarLogin($args);

    doesn’t work. How to use it? Thanks a lot for your work!!

    Comment made on November 2, 2007 at 9:52 am

  5. clevermonkey says:

    Same problem as camc using WP 2.3.1 -

    First login click gives cookie error, second gives successful login. Any ideas?

    Here’s what I observe:
    1. Open new browser (firefox). I make sure to delete cookies for my site. Go to site, attempt login, get cookie error:

    ERROR: WordPress requires Cookies
    but your browser does not support
    them or they are blocked.

    2. Review of cookies at this point shows: wordpress_test_cookie, lastpost and PHPSESSID.

    3. I click on the login button a second time – I get in, no problem.

    4. Review of cookies now shows the three named above and two more; wordpressuser_###… and wordpresspass_###…

    5. Now I can log in and out with no issue.

    6. Close browser; Open browser; Ok, I can still go in and out.

    7. Delete cookie (those basic three items); problem resumes, back to #1.

    Comment made on November 7, 2007 at 1:32 pm

  6. clevermonkey says:

    Shame on me, as I forgot to say, but awesome widget! Nicely done!

    Comment made on November 7, 2007 at 2:45 pm

  7. Upekshapriya says:

    I have the same problem as camc and clevermonkey – it seems to require two goes to get it to log in – the first gives the message about cookies as described above. Using WordPress 2.3.1 with PHP 4.4.7 and MySQL 5.0.45-community-nt on Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8e mod_autoindex_color PHP/4.4.5.

    Comment made on November 8, 2007 at 11:58 pm

  8. Jauhari says:

    How to use it without Widget?

    Comment made on November 9, 2007 at 2:34 am

  9. Jauhari says:

    I have some problem too, on my WordPres 2.3.1

    Please help

    Comment made on November 9, 2007 at 2:39 am

  10. Capt'n Chris says:

    First off… Thanks for a great plugin!

    I also have the same cookie problem as clevermonkey, Jauhari, and Upekshapriya… with regard to it requiring two login attempts and the cookie error.. Any advice?

    Comment made on November 12, 2007 at 11:06 am

  11. Mark says:

    Same cookie error. The distance between inputboxes are very big How comes?

    Please help asap

    Comment made on November 12, 2007 at 9:36 pm

  12. Mars says:

    Hi! The plugin is just what I was looking for. Unfortunately I have the same problem as camc, Upekshapriya, and clevermonkey! Any advice on what to do from here?

    Comment made on November 13, 2007 at 6:58 am

  13. Theo D. says:

    i figured out how to call the plugin manually.

    open the sidebarLogin.php file (located in the plugins folder)
    comment out line 17 where it says extract($args); [to comment that line type “//” before that line. Then save the sidebarLogin.php file. After past this code anywhere you want to put the login

    Comment made on November 17, 2007 at 3:48 am

  14. Loki says:

    excellent plugin, first of all. is it possible to customize the look of the plugin to fit in with your site’s theme, however? I want to change the grey button, for example.

    Comment made on November 20, 2007 at 9:28 am

  15. angelo says:

    why the plugin apperars in my blog in this way?
    look @ http://www.democraziatrepuntozero.it

    what can i do?

    thanx

    Comment made on November 20, 2007 at 11:34 am

  16. clevermonkey says:

    I think I found a workaround to the cookie issue.

    There are a number of folks who have done the 2.3 upgrade who are experiencing a cookie-related problem because of some code in wp-login.php (found in the root blog folder).

    You may read about these issues here -> http://wordpress.org/support/topic/135598

    There are three lines in wp-login.php that come into play; lines 24, 313 and 314 (or thereabouts). What these lines do is set up a test cookie (in 24), then check to see if that cookie exists (313) and if not, set the cookie error (314). This is to make certain that the browser supports cookies as we know it must.

    Some of the suggestions in that support thread recommend commenting out these three lines, which in my opinion is probably harmless. If you can’t support cookies, you already have bigger problems, and you wouldn’t have been able to register to get a login anyway. So, commenting out those lines (by prefixing each line with //) *does* work, but there’s another way, too, that should please the purists by keeping the functionality intact.

    Replace line 313 in this way:
    // if ( $_POST && empty($_COOKIE[TEST_COOKIE]) )
    if ( $_POST && (sizeof($_COOKIE)==0))

    This will test to see if the $_COOKIE array has nothing in it. By my reasoning, we don’t care if our test cookie is there or not, just that the browser supports cookies. So, this finds other cookies that I noticed. It worked, so I stopped hacking it at this point. Unfortunately, we will have to do the hack again the next time we upgrade WordPress. Not for a while yet, though.

    Ok, for the developers: (sorry to be long-winded). When I was first testing this, I had made a typo on the line shown (I had put ‘.sizeof’). Of course, this was a php error, which I was told about. Before I fixed it, I looked for the test cookie and did not see it, though if line 24 had run, it would have been created.

    So here are two questions:

    I’m not a php developer, but if line 24 creates the cookie, shouldn’t it have executed before hitting the test in 313, even though there was a syntax error there?

    If so, is there any kind of a ‘flush’ type function that would force the write of the cookie before the test for it?

    Just wonder if there’s a solution there.

    Best of luck, everyone, and thanks again for the great plugin.

    Comment made on November 24, 2007 at 3:03 am

  17. Penny says:

    Same cookie problem as mentioned by a few other users.

    Any ideas or comment perhaps?

    Comment made on November 24, 2007 at 5:33 am

  18. Lumini says:

    clevermonkey, thanks for the code fix. it worked in my case (wp v 2.3). :)

    Comment made on November 26, 2007 at 5:58 pm

  19. foolmars says:

    Thanks clevermonkey!

    Comment made on November 27, 2007 at 10:00 am

  20. External says:

    Please, can you provide the code to paste into a page when not using widgets? Thanx a lot man.

    Comment made on November 30, 2007 at 2:18 pm

  21. Jeff Baier says:

    Those of you getting the “WordPress Requires Cookies” error, I was able to solve the problem by adding some code to the top of my header.php in my template.

    I explain my solution over at the WordPress.org support forums – http://wordpress.org/support/topic/144079?replies=25#post-656390

    Basically, just put this code – http://dump.theleafyisle.com/testcookiewp.txt at the top of your header.php in your template along with a is_user_logged_in() conditional.

    Comment made on December 1, 2007 at 6:00 am

  22. shonari says:

    hey ive stumbled on to ur plugin but i am not seeing a register link anywhere for the plugin…i see lost password but thats it

    Comment made on December 2, 2007 at 2:36 am

  23. Onder Ceylan says:

    Hello,

    I have problem with TinyMCE editor. When I enable this plugin through admin plugin page, the TinyMCE control buttons at the “write panel” disappears. When I disable this plugin, they are coming back! What can I do with that? Any ideas?

    Thanks for this great plugin though.

    Comment made on December 3, 2007 at 11:25 pm

  24. Onder Ceylan says:

    An another addition;

    I have tried to solve cookie problem and TinyMCE buttons became visible! So that, there is not any problem about that..

    But I have another question; how can I hide “admin panel” link from the users at level 0? I tried an if else command for user_id but plugin crashed. I want to hide panel link from the subscribers and modify the profile page, then they will only see their profile page link from the sidebar panel.

    Any ideas?

    Comment made on December 4, 2007 at 1:47 am

  25. Mike Jolley says:

    Working on implementing of the wp2.3 cookie bug fixes to the file itself. Check back in a day, or subscribe to RSS; Ill make a post.

    Comment made on December 5, 2007 at 8:50 am

The comments are closed.

About this site

Blue Anvil is the online web design journal & portfolio of , a web designer from Norfolk, England. Read More »
MiniCard Theme for WordPress
  • Featured work - More

    • Beefjack
    • Integrity
    • theotaku.com
  • Latest Tweet - More

    • RT @jameskoster: #Vector illustration of the new #iPod nano, free to download; http://www.potatoestomatoes.co.uk/technical/free-ipod-nano-vector/
  • Out of the blue - More

    • Closing the Forums

      Just posting to let current users know that I’m closing the forum on Blue-Anvil. This is mainly due to spam-registrations getting out of hand and being a general nuisance. I will be posting good topics as FAQ items within posts if applicable.

      Please note that you can still post and get help for my plugins/themes by posting on the wordpress.org website.

    • Show off your MiniCard!

      Are you a user of the WordPress MiniCard theme? Its been downloaded over 14,000 times so far!

      If you have used it as-is, made your own child-theme or done something creative with it, please show off your MiniCard’s in the comments, I’d love to see how the theme is being used!

    • Spam Stopper updated for WordPress 3.0

      My Spam Stopper plugin has been updated for WordPress 3.0 (version 3.1.3) – you can grab it here. Sorry this update took longer than my other plugins but this one gets less lovin’ – if you want to change that feel free to donate, spread the word, or rate it on the WordPress.org plugin page.

    • SexyBookmarks & Tr.im

      Just a notice to users of the brilliant http://www.sexybookmarks.net/ plugin by shareaholic – If you use tr.im (as I have on a few client sites) be aware tr.im has ceased operation so you may see errors on your blog or in your source code; it screwed up the background and headings on one of my blogs.

      To fix, go to sexybookmarks options, switch services in the “Which URL Shortener?” box, and tick the box to reset all short urls. Once done, your blog should return to normal.