– Release config in `.gktools.json`: release from `main`, merge back to `develop`. Changelog lives in `readme.txt`.
## Gotchas
1. **Including a file turns it on.** Each `includes/` file creates its instance at the bottom. Including a class file in a test or another plugin registers its hooks.
2. **Use `GV_Extension_DataTables_Data::get_instance()`**, never `new`. The constructor registers Ajax and template hooks; a second instance doubles them.
3. **Settings defaults only apply in the admin metabox.** `gravityview_dt_default_settings` is merged with `wp_parse_args()` in `render_metabox()`. On the frontend `get_setting( $view_id, $key, $default )` returns the third argument when a key was never saved, so always pass the right default there.
4. **Unchecked checkboxes are not saved.** `save_postdata()` stores `$_POST[‘datatables_settings’]` as-is, so a missing key means “off” for `is_enabled()`. `save_state` is the exception: it defaults to on (`?? 1`).
5. **Never echo during the Ajax request.** `GV_Extension_DataTables_Response` buffers output; stray output is dropped from the JSON (and only shown as diagnostics to admins). A fatal is turned into a JSON error with a correlation ID instead of an HTML page DataTables cannot parse.
6. **`$_GET` is rebuilt inside the Ajax request** from `getData` (snapshot) and `pageQuery` (live URL). Snapshot wins on conflict. GravityView search widgets depend on this.
7. **Three names for one layout:** template ID `datatables_table`, template class slug `datatable`, legacy slug `table-dt`. The template class uses `_configuration_slug = ‘table’`, so it shares the Table layout’s field config.
8. **PDF output uses a separate class** (`GVView_DataTable_Pdf_Template`, slug `table`) so PDF for GravityView prints real rows; `fetch_entries_only_in_pdf()` lets entries load inline only then.
9. **Configs are matched by View ID in JS.** `extend_view()` pushes into `window.gvDTglobals` once per unique config; the same View embedded twice on a page is a tested case (`tests/JS/specs/two-embeds-same-view.spec.js`).
10. **Sorting is always on** for this layout (`force_sorting()` on `gk/gravityview/view/sorting/forced`, `includes/class-datatables-template.php:91`), and core pagination widgets are removed (`class-datatables-pagination-widgets.php`) because DataTables paginates itself.
11. **Multiple Forms joins:** sorting on a joined form’s field patches GF’s SQL through a temporary `gform_gf_query_sql` filter (`repair_joined_order_joins()`, `includes/class-datatables-data.php:1670`). Column searches are keyed by field ID *and* owning form ID, because two forms can share a field ID.
12. **Per-request caches:** View resolution (`GV_DataTables_Extension::$datatables_view_ids_cache`) and built configs (`$configuration_cache`) are static. Flush them in tests.
13. **Minified assets are committed.** Changing `assets/js/*.js` or `assets/css/scss/*.scss` without running `grunt` ships stale code to non-debug sites.