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:<?php
require('./wp-load.php');
require_once('./wp-admin/admin.php');
?>
<pre>
<?php
//code to test here
var_dump(is_admin());
?>
</pre>
Here is the redirect url that keeps appearing:
http://mysite.com/wp-login.php?redirect_to=http%3A%2F%2Fmysite.com%2Ftest.php&reauth=1
Thanks for any help!