wokamoto/wp-basic-auth — pull request #3 by zenozeng (2013-08-09 20:30:34+00:00)
Title: add_action('init', array(&$this, 'basic_auth'), 1);

add action to init, and set $priority to 1 to ensure that this plugin was exec before some other plugins (such as json-api) to avoid escaping form authentication.