The problem it solves #
When you import a snippet from GitHub and later the snippet author ships an update, applying that update would normally overwrite any customizations you made to the code. GOCSM solves this with config blocks.
A config block is a clearly delimited section near the top of a snippet’s source code that declares the values a site owner is expected to customize — things like form IDs, redirect URLs, or notification messages.
GOCSM reads the config block, displays the variables as labeled input fields in the admin UI, and stores the values separately in the database. When the snippet is activated or updated, GOCSM injects the stored values back into the config block before writing the generated file to disk.
The result: the snippet author can update the snippet logic freely, and you can apply those updates without losing any of your customizations.
How config injection works #
When GOCSM generates the snippet file, it replaces each variable’s default value in the config block with your stored value:
// Before injection (source code):
// === BEGIN CONFIG ===
$form_id = 5;
// === END CONFIG ===
// After injection (generated file), if you saved form_id = 12:
// === BEGIN CONFIG ===
$form_id = 12;
// === END CONFIG ===
The rest of the snippet code is unchanged.
When the config panel appears #
The config panel appears on the snippet edit screen. It lists variables when the source contains a valid config block with at least one variable. If there is no config block, the panel shows an empty state and lets you re-scan after editing the source.