# How Do You Convert - AI Agent SOP This document defines the standard operating procedure (SOP) for AI agents creating or updating calculators on `howdoyouconvert.com`. Adherence to these steps ensures high code quality, mathematical accuracy, and SEO compliance. --- ## 1. Environment & Authentication - **Endpoint (Posts)**: `/wp-json/wp/v2/calculator` (Custom Post Type). - **Endpoint (Logic)**: `/wp-json/wp/v2/kadence_element` (Kadence Elements CPT). - **Authentication**: Basic Auth via headers: `Authorization: Basic base64(user:pass)`. - **User-Agent**: **CRITICAL**. You must emulate a modern browser (e.g., `Mozilla/5.0...`) or Cloudflare will block the request (Error 1010). --- ## 2. Two-Part Architecture Every calculator consists of **two separate WordPress objects** that work together: ### Part A: The Calculator Post (`calculator` CPT) Contains the **HTML layout** (inputs, labels, Kadence Row/Column blocks) and the **SEO text**. This is what the user sees as the page content. > [!CAUTION] > **WordPress strips ` ``` ### Creating the Logic Element via API ```python js_data = { "title": f"JS Logic: {title}", "content": js_code, # The block above "status": "publish", "meta": { "_kad_element_hook": "kadence_after_header", "_kad_element_show_conditionals": f'[{{"rule":"singular|calculator","select":"ids","ids":[{post_id}],"mustMatch":false}}]' } } # POST to /wp-json/wp/v2/kadence_element ``` --- ## 6. Infrastructure Warnings > [!WARNING] > **Cloudflare Rocket Loader** is active on the site. It rewrites `