Brandon Hubbard Engineering / wp-cloudflare-d1
PHP · WORDPRESS & CLOUDFLARE D1

wp-cloudflare-d1 — WordPress & PHP Client for Cloudflare D1 Serverless SQLite

wp-cloudflare-d1 connects WordPress sites to Cloudflare D1 serverless SQLite databases at the network edge for offloading high-volume analytics, logs, and read-heavy catalogs. It provides parameterized SQL query builders, batch statement execution, and WordPress HTTP API connection pooling.

$ composer require bhubbard/wp-cloudflare-d1
GitHub ↗
Prepared Statements 100% SQLi Safe
Batch Queries Single HTTP Roundtrip
WP_Error Native Strict Error Handling
Edge Read Replicas Global D1 Sessions
Interactive WordPress -> Cloudflare D1 Prepared Statement & Batch Builder
Deterministic Execution Output & Telemetry STATUS: READY // 0 ERRORS

        
PHP (WP Cloudflare D1 Client)
$d1 = new \BHubbard\CloudflareD1\Client(
    account_id:  defined( 'CF_ACCOUNT_ID' ) ? CF_ACCOUNT_ID : '',
    database_id: defined( 'CF_D1_DATABASE_ID' ) ? CF_D1_DATABASE_ID : '',
    api_token:   defined( 'CF_API_TOKEN' ) ? CF_API_TOKEN : ''
);

$result = $d1->query(
    'SELECT id, event_type, created_at FROM edge_audit_log WHERE site_id = ? AND severity = ? LIMIT 25',
    [ get_current_blog_id(), 'critical' ]
);
Production Engineering Specifications
Repository:    https://github.com/bhubbard/wp-cloudflare-d1
Live Studio:   https://code.brandonhubbard.com/wp-cloudflare-d1/
Portal:        https://code.brandonhubbard.com/
Install:       composer require bhubbard/wp-cloudflare-d1
Design System: Brandon Hubbard Swiss Modernist (#0A0A0C / 1px Exposed Structural Grid)