securityCheck(); $class = ucfirst($_POST['endpoint']); $endpoint = __NAMESPACE__ . "\\" . $class; $method = $_POST['method']; $args = $_POST['args']; $endpoint = new $endpoint(); $endpoint->$method($args); } function setToken() { $token = wp_create_nonce('mailpoet_token'); $global = '/n"; echo $global; } function securityCheck() { if (!current_user_can('manage_options')) {die();} if (!wp_verify_nonce($_POST['token'], 'mailpoet_token')) {die();} } }