Perfmatters Enhancer
Quality-of-life improvements for the Perfmatters WordPress plugin.
Requirements
- WordPress 6.9+
- PHP 8.1+
- Perfmatters
Installation
- Install and activate Perfmatters.
- Download the latest Perfmatters Enhancer ZIP from GitHub Releases.
- In WordPress: Plugins → Add New → Upload Plugin, upload the ZIP, and activate.
- Open Settings → PD RafflePress to enable modules and configure integrations.
Code Snippet Admin
- Location Column: See where each snippet runs at a glance in the snippets list (sortable).
- Bulk Location Editing: Change the run location for multiple snippets at once using the bulk actions bar.
- Snippet Duplication: Duplicate one or many snippets from the list (row action or bulk button). Copies are created inactive with the same code, location, and conditions.
- Condition logic (OR / AND): Control how Include rules, Exclude rules, and user conditions combine on the single-snippet editor.
Location Column
For your convenience, the snippets table now includes a Location column showing where each snippet runs. Click the column header to sort by location.
Supported locations match Perfmatters (e.g., Frontend Header, Frontend Footer, Admin Header, Admin Footer, plus PHP and HTML-specific options).
Bulk Location Editing
- Select snippets using Perfmatters’ checkboxes (same as bulk Activate/Delete).
- Use Change Location To in the bulk actions bar, pick a location, and click Apply to Selected.
The location dropdown shows only the options that Perfmatters supports for the selected snippet types (the same rules apply as in the single-snippet editor). Select snippets first; mixed types show only locations valid for all selected types.
Snippet Duplication
Duplicate snippets from the Perfmatters snippets list in two ways:
- Row action — Click Duplicate under a snippet name (next to Edit / Export / Delete).
- Bulk button — Select snippets, then click Duplicate Selected in the bulk actions bar.
Duplicates are saved as inactive copies with the same code, location, conditions, tags, and other metadata.
Condition Logic (OR / AND)
Open a snippet from Settings → Perfmatters → Code → Snippets. A Condition Logic panel appears below Perfmatters’ Include / Exclude / Users sections:
| Setting | Default (Perfmatters-native) | Enhanced option |
|---|---|---|
| Include Rules | Match any row (OR) | Match all rows (AND) |
| Exclude Rules | Exclude when any matches | Exclude only when all match |
| Include vs. users | Both sections required | Either section can enable the snippet |
Logic settings are saved in the snippet’s conditions meta as a hidden sapfp:logic row (JSON in the exclude list). They survive plugin deactivation like any other snippet field.
Custom logic is evaluated while Snippet Admin Pro is active (runtime shim). With the plugin off, Perfmatters falls back to its built-in rules (include rows are OR; all sections are AND). Reset logic to defaults before deactivating if you rely on non-default behavior.
All snippet changes are written directly into Perfmatters’ own snippet files via Perfmatters\PMCS\Snippet::update(). Location, condition logic, and other metadata that live in each snippet’s .php docblock — the same storage Perfmatters uses when you save a snippet manually.
Persistence (Safe to Deactivate or Uninstall)
- All snippet changes are written directly into Perfmatters’ own snippet files via
Perfmatters\PMCS\Snippet::update(). Location, condition logic, and other metadata that lives in each snippet’s.phpdocblock — the same storage Perfmatters uses when you save a snippet manually. - This plugin does not store snippet data in
wp_options, custom tables or separate files. If you deactivate or remove Snippet Admin Pro, your snippets and their settings remain exactly as Perfmatters left them.
Code Snippet Converter
Currently, Perfmatters only lets you import snippets that you created within Perfmatters. Perfmatters Enhancer lets you get around that by converting third-party code snippet JSON exports into the Perfmatters PMCS import format.
Supported export sources include WPCodeBox, WPCode, Code Snippets, and other JSON formats with compatible structures.
- Install and activate the plugin.
- Go to Tools → Snippet Converter.
- Upload a .json export from another snippet plugin.
- Review the preview and download the converted file.
- Import in Perfmatters → Code → Settings → Import Code Snippets.