What MevvCode is for
MevvCode is a home for small pieces of site-specific behaviour: a WooCommerce shipping rule, a checkout field, a verification tag, a short admin tool, a visual CSS fix or reusable HTML/text. It gives code an owner, a location, conditions, history and a guarded route into production.
- Use it when
- The change is smaller than a full plugin but important enough that it should not disappear inside a theme file.
- Do not use it when
- The requirement is a complete domain product with its own data model, screens and release lifecycle; build a conventional plugin instead.
- Code ownership
- Write the code yourself or bring reviewed code from a developer or source you trust. MevvCode manages and protects code; it does not make an unknown snippet trustworthy.
Start every borrowed snippet inactive. Read it, remove secrets and site-specific identifiers, then validate it before activation.
Installation
Install and activate the free MevvCode plugin first. It requires WordPress 6.6 or newer and PHP 8.1 or newer. Pro is a separate companion plugin and never replaces the free runtime.
- Upload
mevvcode-1.1.0.zipand activate it. - Open MevvCode → Snippets. The storage directory and its web-server protection files are created automatically.
- Create an inactive snippet, choose its type and location, then save it.
- Use the preview and syntax result before activating it.
- Install
mevvcode-pro-1.1.0.ziponly if you need the Pro surfaces, then activate your MEVD licence under MevvCode → Licence.
Keep the free plugin active when Pro is installed. The executable runtime belongs to Free so a lapsed licence never makes already-published behaviour disappear.
Your first snippet
Create the first record inactive. Give it a purpose-led name, select PHP and the global location only if the code itself attaches to a narrow WordPress or WooCommerce hook, then save.
add_filter( 'woocommerce_package_rates', function ( $rates ) {
if ( ! WC()->cart || WC()->cart->get_subtotal() < 1000 ) {
return $rates;
}
return array_filter( $rates, function ( $rate ) {
return 'free_shipping' === $rate->method_id;
} );
} );
- Read the validation result; a parse error must leave the record inactive.
- Confirm that your store already has a free-shipping method configured.
- Activate the snippet in staging and test carts below and above the threshold.
- Export a JSON copy before carrying the record to production.
- Publish, then verify the public cart and the MevvCode health endpoint.
The example demonstrates the workflow, not a universal shipping policy. Taxes, coupons, currencies and shipping zones can change which subtotal your business rule should use.
Turkish dashboard and plugin row
Free and Pro 1.1.0 ship editable PO, compiled MO and POT catalogues. When the WordPress site language is Türkçe (tr_TR), the dashboard, migration states, validation errors and licence screen load in Turkish automatically.
- The Plugins screen shows the translated description.
- Settings opens the MevvCode settings tab directly.
- Documentation opens this page and Support opens the contact page.
- WordPress dependency handling prevents Free from being removed while MevvCode Pro requires it.
If the Turkish dashboard does not load, check Settings → General → Site Language, then update both Free and Pro to the same version. Do not rename files under the languages directory.
The runtime model
Editable records live under wp-content/mevvcode-snippets/records. Saving an active change builds a new generation in a temporary directory, validates every PHP file, writes a manifest and only then swaps the current pointer.
- Records
- The editable source, metadata, conditions and history.
- Generation
- Immutable compiled files for one known-good state.
- Manifest
- The small map the request path reads to find the current generation.
A compile failure does not partially update the site. The old manifest remains current, the failed source stays editable and the dashboard shows the error. There is no per-request query for snippet code.
Do not edit generated files by hand. They are disposable build output and will be replaced by the next successful compile.
Types, locations and conditions
PHP runs through WordPress hooks. JavaScript, CSS, HTML and text are printed only at the explicit location you select: head, body-open, footer, before or after content, shortcode, manual or once.
- AND applies inside one condition group; groups are joined with OR.
- Admin, front-end, URL, user, role and request context can be combined.
- Tags and groups organise records; a lock prevents accidental edits and bulk actions.
- A manual snippet never joins a request hook until your own code calls it.
Use the narrowest location and condition that describes the requirement. A global PHP hook should be a deliberate choice, not the default home for code copied from a support ticket.
Migrating from Code Snippets
Open MevvCode → Migration. The importer reads the site-prefix snippets table, preserves every source id and the exact code bytes, and creates staged MevvCode records without changing which plugin is active.
- Run detection and inspect the record count.
- Import into the staged, inactive set.
- Parse every snippet that is active in Code Snippets.
- Create a rollback snapshot of the active-plugin list and current MevvCode manifest.
- Compile one complete generation.
- Start the cutover. Code Snippets is switched off only after the manifest exists.
- A signed loopback request checks the public site. Success commits; failure restores the plugin list and manifest automatically.
The source tables are not deleted. Manual rollback remains available after a successful cutover, and re-enables the exact former active-plugin list. On mevvshop.com on 1 September 2026, the measured production cutover preserved 9 records, 6 active states and produced 0 mismatches across name, exact code bytes, priority and status. That is evidence for that store, not a universal benchmark.
If an imported snippet fails parsing, fix the staged MevvCode copy or leave it inactive. Do not deactivate Code Snippets by hand before the cutover reports a healthy generation.
Safe mode and recovery
Safe mode can be entered with the documented constant or a short-lived signed URL generated for an administrator. In safe mode snippet execution stops while the dashboard remains available for repair.
- A PHP parse error never becomes the current generation.
- A runtime exception disables the responsible record and leaves other snippets available.
- A fatal guard records only the record identity and state needed for recovery — never the source code or request secrets.
- The previous known-good generation is retained until the replacement passes all checks.
define( 'MEVVCODE_SAFE_MODE', true );
Remove the constant after the broken record has been fixed or disabled. Leaving it in place intentionally keeps all snippets off.
Portability and backups
Export selected records as MevvCode JSON v1 for a lossless round trip, or as readable PHP when the destination should not depend on MevvCode. Code Snippets and WPCode imports are adapters into the same canonical record format.
- A JSON export includes metadata, conditions and status.
- A PHP export is meant for review and manual ownership, not for re-importing hidden metadata.
- The must-use loader can carry compiled behaviour when the normal plugin must be removed.
- Pro can package selected snippets as a conventional functionality plugin ZIP after validating names, paths and PHP.
Keep an off-site copy of exports before a large import, bulk activation or migration. Revisions are an editing history, not a disaster-recovery backup.
Free and Pro
Free is the complete safe local snippet manager. It includes all five types, the atomic runtime, locations and base conditions, the fatal guard, safe mode, Code Snippets migration, import/export, generators, revisions, role capabilities, read-only REST and the must-use loader.
Pro is the collaboration and delivery layer. It adds reusable and scheduled conditions; device, referrer, geo, cart and order context; unlimited audit history; CSS/JS builds and external assets; ecommerce pixel events; signed automation; plugin export; local aggregate insights; encrypted cloud workspaces; opt-in AI review; and an action-gated REST/MCP-compatible API.
Cloud and AI are separate opt-ins. AI receives the redacted copy and returns a review diff; it never applies the diff automatically. Cloud writes use an HMAC signed with the licence key and optimistic revisions reject stale updates.
Finding and activating a Pro licence
A purchased licence is associated with the checkout email and appears at mevvsoft.com/account. The key begins with MEVD; never paste it into a support ticket, URL or public log.
- Install and activate the free MevvCode package.
- Install and activate the matching MevvCode Pro package.
- Sign in to the account created for the checkout email and copy the MevvCode Pro key.
- Open MevvCode → Licence, paste the MEVD key and activate it.
- Confirm that the status is active and the site appears against the licence in your account.
If the licence is absent from the account, first confirm that you signed in with the same email used at checkout. If it is present but activation reports a site limit, release an old site from the account or contact support without sending the full key.
FAQ and troubleshooting
- A snippet saved but did not run
- Check that it is active, its location matches the request, every condition group can be satisfied and safe mode is off.
- The old plugin is still active after migration
- The cutover did not commit. Read the migration result; a parse, compile or loopback health check failed and rollback protected the site.
- The site entered safe mode
- Open the dashboard through the signed recovery URL, inspect the most recently disabled record, fix or leave it disabled, compile, then leave safe mode.
- Cloud reports a conflict
- Another client changed the workspace after the revision you loaded. Compare the remote record with your local record and push again using the new base revision.
- AI review is unavailable
- Both the Pro licence and the explicit AI opt-in must be active, and the service adapter must be configured. Local snippets continue working.
When asking for support, send the plugin versions, WordPress/PHP versions, the record UUID and the exact error text. Remove secrets and customer data. Do not send a production licence key or the complete source unless it is necessary and you have reviewed it.