// Hermes API Plugin
add_action('init', function() {
    if ($_SERVER['REQUEST_URI'] === '/hermes-api/') {
        header('Content-Type: application/json');
        
        if ($_GET['key'] !== 'hermes2024secure') {
            http_response_code(401);
            echo json_encode(['error' => 'Unauthorized']);
            exit;
        }
        
        require_once('wp-load.php');
        
        $action = $_GET['action'];
        
        if ($action === 'status') {
            echo json_encode([
                'status' => 'ok',
                'user' => wp_get_current_user()->user_login,
                'roles' => wp_get_current_user()->roles
            ]);
            exit;
        }
        
        if ($action === 'create_post' && $_SERVER['REQUEST_METHOD'] === 'POST') {
            $input = json_decode(file_get_contents('php://input'), true);
            
            $post_id = wp_insert_post([
                'post_title' => $input['title'] ?? 'Untitled',
                'post_content' => $input['content'] ?? '',
                'post_status' => $input['status'] ?? 'draft',
                'post_category' => $input['categories'] ?? [1],
                'tags_input' => explode(',', $input['tags'] ?? ''),
            ]);
            
            if (is_wp_error($post_id)) {
                echo json_encode(['error' => $post_id->get_error_message()]);
            } else {
                echo json_encode(['success' => true, 'post_id' => $post_id]);
            }
            exit;
        }
    }
});
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://nogearfit.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://nogearfit.com/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://nogearfit.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://nogearfit.com/wp-sitemap-posts-tdb_templates-1.xml</loc></sitemap><sitemap><loc>https://nogearfit.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://nogearfit.com/wp-sitemap-taxonomies-post_tag-1.xml</loc></sitemap><sitemap><loc>https://nogearfit.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
