KEMP.REST / EXAMPLES / CODE
Code
Written by Kevin Kemp. Samples from the past year. AI SEO is the first group: the page builder, schema, llms.txt, and AI Overviews. Offing: Following Seas is next: the technical report, then the AIS, NOAA, and OpenStreetMap integrations. The other groups are here so the index can keep growing. Each page explains the problem, names the technology in that file, and puts the source at the bottom.
Across these files: HTML, CSS, and JavaScript, JSON and JSON-LD, PHP, WordPress, WooCommerce, WooRewards, AffiliateWP, Advanced Custom Fields, MySQL, REST APIs, WebSockets, Canvas, OAuth, Auth0, Laravel, Blade, Eloquent, WHMCS, cURL, the WordPress AI client, OpenAI, Anthropic, Google Cloud, Google Business Profile, Google Maps, DataForSEO, AISStream, NOAA, and OpenStreetMap.
AI SEO Offing WooCommerce AnswerPins PressCare tools
AI SEO
-
Service area page builder
ChatGPT drafts one service in one town. The page is published as WordPress blocks, with a rollback if the live page does not show it.
-
Schema on the service page
JSON-LD on every generated page: a Service, the LocalBusiness that provides it, and an FAQPage from the questions on the page.
-
llms.txt on the live site
Built from the pages already published, sent to WordPress, and served at the site root by a small plugin.
-
llms.txt generator
The public version of that file. Name, summary, grouped links, and checks, all in the browser.
-
Schema markup generator
JSON-LD for 15 schema types, checked against the fields Google asks for, with import from a page or an existing block.
-
Schema markup validator
Paste HTML or raw JSON-LD. Every entity is checked for required and recommended fields, including arrays and @graph.
-
Live AI Overviews through DataForSEO
A live organic search at a town’s coordinates, with a short retry, then the AI Overview, local pack, and organic results parsed out.
Offing: Following Seas
-
Technical report
The 24-page account of Following Seas 1.3.7: the WebSocket client, the collector, the state file, the chart, and what AIS can and cannot promise. The code excerpts are from 1.5.1.
-
AIS positions from AISStream
A hand-written WebSocket client and a two-connection collector. Tracked vessels on one socket, nearby traffic on the other, flushed to a state file every two seconds.
-
NOAA chart and charted anchorages
Nautical chart tiles drawn on the canvas in a night palette, plus ENC anchorage areas stored as rings during import.
-
OpenStreetMap marinas and anchorages
Overpass import in 3° tiles into MySQL. Marinas, anchorages, and anchor berths, with phone, VHF, and fuel kept from the tags.
WooCommerce and the back office
-
Syncs Points Data
WordPress plugin that copies a back office customer into WooCommerce and keeps the points balance aligned with WooRewards.
-
Affiliate referral sync
Scheduled AffiliateWP job that accepts, reprices, or rejects referrals from WooCommerce customer status.
-
Storefront and order sync
Coupon links, order-status sync, tracking, token refresh, and account tools between WooCommerce and the back office.
-
Merged order history
My Account orders from WooCommerce and the back office, plus campaign parameters saved on the order.
AnswerPins
-
Local rank grids on a clock
Laravel schedule, queued jobs, and DataForSEO Google Maps searches at every point of a grid. Weekly or monthly, with retries and a time limit.
-
Google Business Profile on Google Cloud
OAuth, token refresh, and direct edits to category, website, phone, and description through the Business Profile APIs.
-
Blade screens for the grid and the listing
Laravel Blade that draws the rank grid on a Google Map and shows the Business Profile the way a customer sees it.
-
WHMCS module: accounts, SSO, and city billing
A WHMCS server module that creates the account on purchase, signs the client or admin in with a one-time link, and provisions extra cities from the product options.
PressCare tools
-
Image optimizer
Resize, compress, and strip metadata in the browser. JPG, PNG, WebP, and GIF in. WebP, JPG, or PNG out, with a zip of the batch.
-
Error Doctor
A read-only scan of the PHP log. Repeated events are grouped, secrets are redacted, and an explanation is optional through the WordPress AI client.