Sandboxed WebAssembly (.wasm) Extensions & Host ABI v1
Unlike WordPress PHP plugins—which share global process memory, filesystem access, and raw SQL credentials—Daypress custom extensions execute inside deterministic WebAssembly sandboxes (crates/daypress-wasm) with zero ambient host authority.
Sandbox limits & capability model
Every installed .wasm module in Plugins → Wasm Crates (/d-admin/wasm) is instantiated fresh per invocation with deterministic resource ceilings and an explicit capability allowlist:
| Boundary / Capability | Default / Scope | Enforcement |
|---|---|---|
| Instruction Fuel Budget | 50,000 fuel units (configurable up to 5,000,000) | Infinite loops trap immediately with FuelExhausted without stalling Tokio worker threads. |
| Linear Memory Ceiling | 16 Wasm pages (1 MiB default, max 64 pages / 4 MiB) | Out-of-bounds growth is denied inside the module's isolated linear memory. |
shortcode | Register [your_shortcode] | Allows the module's exported render_shortcode() function to emit HTML fragments. |
content_filter | Post body filter pipeline | Allows exported filter_content() to read UTF-8 input via dp_input_len / dp_read_input. |
read_public_options | blogname, blogdescription, siteurl, home, WPLANG, timezone_string | Secrets, SMTP passwords, session keys, and arbitrary SQLite tables are never exposed. |
kv_read / kv_write | Extension-scoped KV namespace | Isolated key-value state stored per extension slug in daypress_wasm_kv. |

In-admin Wasm shortcode compiler
Need a fast dynamic badge, hit counter, or site-title banner without installing a local Rust toolchain? Use the Quick Wasm Shortcode Compiler directly inside /d-admin/wasm:
- Enter an extension Slug (e.g.
release-badge) and Shortcode Tag (e.g.release_badge). - Write your HTML snippet using safe host placeholders such as
{{option:blogname}},{{attr:label}},{{kv_get:banner_note}}, or{{kv_incr:views}}. - Click Compile & Install .wasm. Daypress synthesizes a valid
\0asmbinary targeting Host ABIv1, persists its SHA-256 hash indaypress_wasm_extensions, and activates[release_badge label="v1.0.4"]immediately.
Authoring a Rust wasm32 crate (Host ABI v1)
For custom business logic, pricing calculators, or syntax transformers, compile any Rust cdylib crate targeting wasm32-unknown-unknown against the locked Daypress Wasm Host ABI v1 imports in module env:
// src/lib.rs — cargo build --target wasm32-unknown-unknown --release
#[link(wasm_import_module = "env")]
extern "C" {
fn dp_abi_version() -> i32; // Always returns 1 on v1.x
fn dp_emit_str(ptr: *const u8, len: i32) -> i32;
fn dp_emit_attr(key_ptr: *const u8, key_len: i32, fb_ptr: *const u8, fb_len: i32) -> i32;
fn dp_emit_option(opt_ptr: *const u8, opt_len: i32) -> i32;
fn dp_kv_incr_emit(key_ptr: *const u8, key_len: i32, delta: i64) -> i64;
}
fn emit(s: &str) {
unsafe { let _ = dp_emit_str(s.as_ptr(), s.len() as i32); }
}
#[no_mangle]
pub extern "C" fn render_shortcode() -> i32 {
emit("<span class="dp-wasm-pill">");
unsafe {
let _ = dp_emit_attr(b"prefix".as_ptr(), 6, b"Reads: ".as_ptr(), 7);
let _ = dp_kv_incr_emit(b"page_reads".as_ptr(), 10, 1);
}
emit("</span>");
0
}env (dp_abi_version, dp_emit_str, dp_emit_i64, dp_emit_option, dp_emit_attr, dp_kv_get_emit, dp_kv_set, dp_kv_incr_emit, dp_input_len, dp_read_input) and both guest exports (render_shortcode, filter_content) are frozen across all 1.x releases.Managing & testing via MCP & REST
AI agents and CI pipelines can list, compile/install, execute dry-run sandbox tests, or remove extensions via daypress_manage_wasm_extensions or /wp-json/daypress/v1/wasm-extensions:
{
"name": "daypress_manage_wasm_extensions",
"arguments": {
"action": "execute",
"slug": "release-badge",
"attrs": { "label": "Stable v1.0.4" },
"input": ""
}
}