I am new to wordpress development and am trying to write a plugin. Following the recommendations in the book Professional Wordpress Plugin Development, I created a test page and placed it in the wordpress root directory. When I include wp-admin/admin.php to test the admin functionality of this plugin, I get routed to the login page. From there, after supplying the appropriate credentials, I get redirected to the same page. If I don't require wp-admin/admin.php this doesn't happen. I don't know where to begin troubleshooting this.
Here is the very basic script they recommend:
//code to test here
Here is the redirect url that keeps appearing:
Thanks for any help!