Repository navigation
v1.5.0 — Configurable database connection
Configurable database connection
Every query in the plugin bound the global $wpdb with no way to change it, which made the plugin unusable on any site that partitions its data — a schema shared with a legacy system, a separate reporting store, or simply keeping support tables out of the WordPress database.
// wp-config.php
define('ESCALATED_DB_NAME', 'support');
// Optional; each falls back to the WordPress value.
define('ESCALATED_DB_USER', 'support_user');
define('ESCALATED_DB_PASSWORD', 'secret');
define('ESCALATED_DB_HOST', 'db.internal');
define('ESCALATED_DB_PREFIX', 'wp_');Define nothing and Escalated uses the global $wpdb — the same instance, the same prefix, the same queries. An unconfigured site is unchanged.
WordPress has no connection registry, so a second database means a second wpdb. Escalated builds one lazily and reuses it: wpdb connects in its constructor, so resolving per query would open a connection per query.
All 289 global $wpdb; bindings across 67 files now resolve through Escalated::db(), and a test sweeps includes/ to keep it that way — a missed one is not a visible error, it leaves some queries on one connection and some on the other, which reads as data appearing and disappearing.
Your users stay in WordPress
ESCALATED_DB_NAME moves Escalated's own tables and nothing else. The plugin never queries wp_users, wp_posts or wp_options directly — it reaches user data through get_userdata(), get_user_by() and WP_User_Query, which use the WordPress connection as they always have. A test asserts no plugin code issues raw SQL against a core table.
Creating the tables
Activation creates Escalated's tables on whichever connection is configured, so define the constants before activating. On an existing install, defining them afterwards does not move data — create the tables on the new database and copy the rows across first.
Housekeeping
Realigns the version markers, which had drifted apart: the plugin header read 1.4.0, readme.txt's stable tag read 1.2.0, and the latest release tag was v1.2.0. All three now read 1.5.0.
Tests green on PHP 8.1 and 8.2. Pint clean.
What's Changed
- chore(deps-dev): bump yoast/phpunit-polyfills from 2.0.5 to 4.0.0 by @dependabot[bot] in #50
- chore(deps): bump softprops/action-gh-release from 2 to 3 by @dependabot[bot] in #45
- chore(deps): bump actions/checkout from 4 to 6 by @dependabot[bot] in #46
- chore(deps): bump actions/setup-node from 4 to 6 by @dependabot[bot] in #47
- chore(deps): bump actions/cache from 4 to 5 by @dependabot[bot] in #49
- chore(deps): bump actions/upload-artifact from 4 to 7 by @dependabot[bot] in #48
- feat(i18n): consume central translations from escalated-dev/locale by @mpge in #51
- fix(release): composer install before zip so central locales ship by @mpge in #52
- chore(deps): bump escalated-dev/locale from 0.1.1 to 0.1.8 by @dependabot[bot] in #53
- feat(admin): users-management page with admin/agent role toggles by @mpge in #54
- feat(skills): admin skills management parity (#55) by @mpge in #56
- Validate ticket reference prefix by @mpge in #58
- feat(tickets): custom ticket actions via hooks by @mpge in #59
- ci: set least-privilege permissions on CI workflows by @mpge in #61
- feat(workflow): implement add_follower action handler by @mpge in #62
- feat(tickets): ticket subjects (#89) by @mpge in #60
- feat(newsletters): newsletter schema + models + renderer (Wave 3, WordPress - partial) by @mpge in #57
- Add SECURITY.md security policy by @mpge in #64
- chore(deps): bump actions/checkout from 6 to 7 by @dependabot[bot] in #65
- feat(newsletters): full HTTP layer + engine services (WordPress) by @mpge in #63
- feat(capacity): per-agent ticket capacity tracking by @mpge in #66
- feat(side-conversations): side conversations by @mpge in #67
- chore(deps): bump actions/cache from 5 to 6 by @dependabot[bot] in #68
- feat(api): complete /auth contract (login/register/logout/refresh/me/profile) by @mpge in #69
- chore(deps): bump actions/setup-node from 6 to 7 by @dependabot[bot] in #70
- chore(deps): refresh composer lock by @mpge in #75
- feat: add a configurable database connection by @mpge in #76
- chore(release): v1.5.0 by @mpge in #77
New Contributors
- @dependabot[bot] made their first contribution in #50
Full Changelog: v1.2.0...v1.5.0