Autologin for wordpress

At one site I have a custom role that can only view the orders. The owner wants some users to hav access without a password. Yes this story gets dumber.. He wants to give access by clicking a link.

The basic script offered to autologin are hooked in to ‘plugins_loaded’ or ‘wp’. Both these hooks resulted in white screens.. WooCommerce did not like the usercapabilities to switch.

The solution was the ‘init’ hook.

By adding ?code=KKGFJ96DKGHJ979679KJHGK098MGHJGKKG to any url the users gets loged in. You can even use and the user gets redirected to the order page. ( now the link gives access ).