My wp-admin stops working suddenly

Are you able to see the login screen? When exactly do you get redirected? Try to go to http://yoursite.com/wp-login.php enter your user and password, and see if it works. If it works, the issue could be related to a plug-in.

Custom WordPress Dashboard for Specific user role

Basic implementation: Create a page for the frontend (and optionally a template). Then add the following code to your functions.php: function login_redirect_capability() { if ( current_user_can(‘author’) || current_user_can(‘editor’) ){ return ‘url-of your custom page’; } } add_filter(‘login_redirect’, ‘login_redirect_capability’); This will redirect them to the page you created. If you want to recode the dashboard as … Read more

Just how ‘expensive’ is this function?

rule of thumb, never do anything that results in DB write from the front end. Even better if you can create an admin page in which the operation is triggered (even if it just starts an AJAx based process). Your problem here is with hooking on an inappropriate hook. You hooked on init which means … Read more