One option is to use the add_rewrite_endpoint
technique I mention in my comment.
Another option is to use the admin_post_{action}
hook.
For example, you can POST data to your URL with an action
GET parameter:
http://www.example.com/wp-admin/admin-post.php?action=my_plugin_action
Then hook that action via admin_post_nopriv_my_plugin_action
to receive that request and process the data:
function wpd_my_plugin_action() {
status_header(200);
// do stuff
echo $_POST['somedata'];
die;
}
add_action( 'admin_post_nopriv_my_plugin_action', 'wpd_my_plugin_action' );
Both options load WordPress without running the main query and loading the template.
EDIT: To allow incoming POSTs, you must hook into the allowed_http_origin
or allowed_http_origins
(this filter will only work if POSTer is setting HTTP_ORIGIN
), otherwise WordPress will throw out the requests before they hit your action.