Home › Blog › Article

Plugin Conflicts: Bisection and Minimal Reproduction

Answer first: what to do and how to know it is done

Capture the exact failure, reproduce it on a clean staging copy with WordPress 6.9, PHP 8.3 or 8.4, and a default theme, then disable plugins in disciplined halves until one change flips the result. WordPress plugin conflict troubleshooting is finished only when the same request fails with a named plugin active, passes with it deactivated, passes again after reactivation rollback, and a vendor can repeat that result from your minimal package. Record versions, request URL, user role, console errors, and wp-content/debug.log entries at every step.

Phenomenon and fast triage commands

Start with symptoms, not opinions: a 500 on /wp-admin/admin-ajax.php, a blank checkout, a missing Gutenberg panel, a fatal in REST, or a cron job that silently stops. In 2026, first confirm the platform baseline: WordPress 6.9.x, PHP 8.3/8.4, MySQL 8.0 or MariaDB 10.11+, and whether object cache, OPcache, or a CDN edge cache is involved. Do this on staging or a local clone, never on the live request path.

# 1) Snapshot before touching anything
wp --path=/var/www/example.com/htdocs core version
extra_flags='--skip-plugins --skip-themes'
wp --path=/var/www/example.com/htdocs $extra_flags core version
wp --path=/var/www/example.com/htdocs plugin list --format=csv > /tmp/plugins-before.csv
wp --path=/var/www/example.com/htdocs db export /tmp/before-conflict.sql
cp -a wp-content /tmp/wp-content-before

# 2) Turn on evidence, not noise
grep -nE "WP_DEBUG|WP_DEBUG_LOG|WP_DEBUG_DISPLAY|SCRIPT_DEBUG" wp-config.php
wp --path=/var/www/example.com/htdocs config set WP_DEBUG true --raw
wp --path=/var/www/example.com/htdocs config set WP_DEBUG_LOG true --raw
wp --path=/var/www/example.com/htdocs config set WP_DEBUG_DISPLAY false --raw
wp --path=/var/www/example.com/htdocs config set SCRIPT_DEBUG true --raw

# 3) Reproduce the exact request and watch the log
curl -sS -o /tmp/response.html -w '%{http_code} %{time_total}n' 
  -b /tmp/editor-cookies.txt 'https://staging.example.com/wp-admin/post.php?post=1842&action=edit'
tail -n 120 wp-content/debug.log
wp --path=/var/www/example.com/htdocs cache flush
wp --path=/var/www/example.com/htdocs transient delete --all

# 4) Health check without loading the stack
wp --path=/var/www/example.com/htdocs $extra_flags eval 'echo "bare core okn";'
php -d display_errors=1 -r 'require "wp-load.php"; echo "bootstrap okn";'

Verification here is boring but essential: the same HTTP status, same log line, and same broken UI must appear at least twice. If the failure changes between runs, you are chasing cache, rate limits, expired transients, or a background job, not a deterministic plugin conflict. Common pitfalls include testing while logged out when the bug is role-specific, leaving WP_DEBUG_DISPLAY on and corrupting JSON responses, and flushing only page cache while wp_cache still serves stale alloptions. Roll back by restoring /tmp/wp-content-before, importing /tmp/before-conflict.sql, and reverting the four wp-config.php constants with wp config set ... false --raw. For a clean clone after a host change, follow our Server Migration Checklist: Files, Database and Cutover Verification so stale serialized URLs do not masquerade as plugin errors.

Step-by-Step Isolation Process

  1. Freeze the environment: pin WordPress 6.9.x, PHP 8.3, theme version, plugin versions, and export /tmp/plugins-before.csv plus a SQL dump.
  2. Define one observable oracle: HTTP code, one debug.log fingerprint, or one DOM selector such as #woocommerce-order-data.
  3. Run the bare-core control with --skip-plugins --skip-themes, then restore the default theme only.
  4. Bisect the active plugin set in halves using wp plugin deactivate, retesting the identical request after each half.
  5. Confirm the winner with an A/B/A cycle: active fails, deactivated passes, reactivated fails again, then roll back to the snapshot.
  6. Build the minimal reproduction package and write the vendor report before applying any permanent fix.

The ordered sequence above is also the structured-data-friendly summary of the whole guide. Keep each transition small enough to undo in under 60 seconds. If a deactivation triggers an uninstall hook that drops custom tables, stop immediately and restore /tmp/before-conflict.sql; that is why we snapshot the database rather than trusting a plugin’s uninstall.php. When the site is revenue-critical and the staging copy is behind, an export website repair vendor comparison for 2026 helps decide who owns the rollback window while your team continues bisection.

Reproduce before blaming

Reproduction means a deterministic input produces a deterministic output, not that somebody saw it once. Write the oracle down: curl returns 500, debug.log contains Call to undefined function wc_get_order() in /wp-content/plugins/acme-invoice/acme-invoice.php:218, and the browser console shows TypeError: Cannot read properties of undefined from acme-admin.min.js. Capture the logged-in role, nonce age, locale, timezone, and any $_POST keys with values redacted.

Build a repeatable request

Use a saved cookie jar from a fresh login, a fixed post ID, and a fixed query string. For REST or AJAX, replay the exact payload with the X-WP-Nonce header regenerated on each run; an expired nonce is a false conflict. If the bug appears only under WP-Cron, trigger it explicitly with wp cron event run --due-now and log doing_it_wrong_run hooks. Verify by running the request three times: fail, fail, fail. Then run the bare-core control: pass, pass, pass.

Common traps and rollback

Get a Quote

Email + requirement + budget range — we reply with a quote within 24 hours.

Do not blame the last-updated plugin just because plugin list sorts by date; a 2026 update often exposes an older plugin’s missing capability check. Do not test with SCRIPT_DEBUG off if you need unminified stack traces. Do not leave a CDN purge pending; purge, then wait for the edge to report a miss. If your debug constants leak to production, restore the original wp-config.php from the snapshot and confirm wp config get WP_DEBUG_LOG matches the pre-test value. The official wp-config.php debugging reference is the baseline for these constants.

Disciplined bisection

Bisection is a binary search over state, not randomly switching plugins off in the wp-admin UI. With 24 active plugins, six controlled rounds beat 24 guesses, and each round has a reversible command. Always deactivate, never delete; never click Deactivate and Deactivate Data in the same pass. Keep must-use plugins and drop-ins visible because wp plugin list does not show wp-content/mu-plugins/ or wp-content/object-cache.php by default.

cd /var/www/example.com/htdocs
wp plugin list --status=active --field=name | sort > /tmp/active.txt
ls -1 wp-content/mu-plugins/ 2>/dev/null > /tmp/mu.txt
ls -1 wp-content/{object-cache.php,advanced-cache.php,db.php} 2>/dev/null > /tmp/dropins.txt

# Round template: keep first half, disable second half
total=$(wc -l < /tmp/active.txt); half=$(( (total + 1) / 2 ))
sed -n "$((half+1)),${total}p" /tmp/active.txt | xargs -r wp plugin deactivate
wp plugin list --status=active --field=name | sort > /tmp/round-1.txt
curl -sS -o /dev/null -w '%{http_code}n' -b /tmp/editor-cookies.txt 
  'https://staging.example.com/wp-admin/post.php?post=1842&action=edit'
tail -n 40 wp-content/debug.log

# Undo a round exactly, then split the failing half
cat /tmp/active.txt | xargs -r wp plugin activate
wp plugin list --status=active --field=name | sort | diff - /tmp/active.txt

Interpret the round with a table, not memory: if the kept half fails, the culprit is inside it; if it passes, the culprit is in the disabled half. Reactivate everything from /tmp/active.txt before the next split so you never accumulate drift. Verify with diff returning no output and with the oracle failing again. Pitfalls: plugins that register register_activation_hook() rewrite rules on reactivation, so run wp rewrite flush --hard only after the A/B/A cycle; multisite needs --network and --url=subsite.example.com; and a persistent object cache can serve a deactivated plugin’s options, so wp cache flush belongs after every round. If a round drops a custom table or rewrites wp_options, restore /tmp/before-conflict.sql and restart from round one rather than trying to patch forward. For long-running stores, pair this with a 2026 export website maintenance vendor shortlist so someone owns log rotation and staging parity after the incident closes.

RoundActive setOracle resultNext action
0All 24 + Twenty Twenty-Six500 / fatal at line 218Split 12 / 12
1First 12200 / no fatalInspect disabled 12
26 of those 12500 / same fatalSplit 3 / 3
33 of those 6500 / same fatalSplit 2 / 1, then A/B/A

Theme or plugin?

Separate the two layers before naming a culprit. Run the exact request with --skip-themes while plugins stay active, then with --skip-plugins while the real theme stays active, then with Twenty Twenty-Six 1.0 (bundled with WordPress 6.9) and the full plugin set. A theme-only failure usually points to a missing do_action(), an overridden WooCommerce template, a wp_enqueue_scripts priority that deregisters a dependency, or a block theme theme.json change that removes a script handle the plugin assumes.

# Theme layer off, plugin layer intact
wp --path=/var/www/example.com/htdocs --skip-themes eval 'echo "theme bypassedn";'
curl -sS -o /dev/null -w '%{http_code}n' -b /tmp/editor-cookies.txt 
  'https://staging.example.com/checkout/'

# Plugin layer off, theme layer intact
wp --path=/var/www/example.com/htdocs --skip-plugins theme list --status=active
wp --path=/var/www/example.com/htdocs --skip-plugins eval 'echo "plugins bypassedn";'

# Default theme control, full plugin set
wp --path=/var/www/example.com/htdocs theme activate twentytwentysix
wp --path=/var/www/example.com/htdocs theme list --status=active

# Look for template overrides and hook collisions
grep -RIn "woocommerce|do_action|remove_action|wp_dequeue_script" wp-content/themes/my-theme/ | head -n 60
wp --path=/var/www/example.com/htdocs eval 'global $wp_filter; echo count($wp_filter["init"]->callbacks ?? []), " init callbacksn";'

Verify the matrix: plugin-only fail plus default-theme pass means a theme integration bug; default-theme still fail means plugin-to-plugin; both controls pass means an interaction requiring both layers, which is still a minimal reproduction, just with two variables. Pitfalls include child themes that load the parent’s functions.php twice, wp_get_theme() caching after a switch, and a custom wp-content/advanced-cache.php that short-circuits before template_redirect. Roll back with wp theme activate my-theme, restore the original wp-content/themes/ directory from /tmp/wp-content-before, and re-run wp cache flush. If the fix requires changing a plugin hook rather than patching a template, that is a scoped job for WordPress Plugin Development, where the compatibility shim can be version-gated and unit-tested instead of edited in a theme file.

What to send the vendor

Send a package that a stranger can run in ten minutes, not a screenshot and a hunch. Include the minimal active set (usually WordPress 6.9.x, Twenty Twenty-Six 1.0, the reported plugin, and exactly one conflicting plugin), the smallest content fixture, the exact request, and the expected-versus-actual result. Strip customer data, API keys, and license tokens; keep the wp-content/debug.log fingerprint with absolute paths shortened to wp-content/....

Minimal reproduction package

conflict-2026-04-18/
  README.md                 # steps, expected, actual, oracle
  versions.txt              # WP 6.9.2, PHP 8.3.14, MariaDB 10.11.9, plugin 4.8.1 / 2.3.0
  wp-config-fragment.php    # only the four debug constants
  fixture.sql               # 1 post ID 1842, 1 editor user, 1 option row
  request.sh                # curl + cookie jar + nonce refresh
  debug-log-excerpt.txt     # 12 lines, paths normalised
  mu-plugin/zz-probe.php    # optional hook-order logger

The optional probe should be tiny and removable. It exists to show hook order, not to fix anything:

<?php
/* Plugin Name: ZZ Conflict Probe */
add_action('init', static function () {
    error_log('[probe] init=' . current_action()
        . ' user=' . get_current_user_id()
        . ' acme=' . (function_exists('acme_boot') ? 'yes' : 'no'));
}, 999);
add_action('admin_enqueue_scripts', static function ($hook) {
    error_log('[probe] hook=' . $hook . ' scripts=' . implode(',', array_keys(wp_scripts()->registered)));
}, 999);

Write the README in this order: environment, install commands, one-click reproduce, expected, actual, A/B/A evidence, and what you already ruled out. State the exact versions from wp plugin list --format=csv and wp core version, plus PHP via php -v. Mention whether WP_ENVIRONMENT_TYPE='staging' is set, because many 2026 plugins branch on it. Verify the package by handing it to a colleague who did not see the incident; if they get the same 500 and the same log line without asking a question, it is ready. Common vendor-report failures: attaching a full production database, omitting the nonce refresh step, reporting only the browser console, or saying conflict with cache plugin without naming the other plugin and version. Roll back the probe with rm wp-content/mu-plugins/zz-probe.php and confirm ls wp-content/mu-plugins/ matches /tmp/mu.txt. The plugin basics handbook is a useful shared vocabulary for hooks and activation behaviour when writing the report.

Root causes, fixes, and verification

Once the pair is isolated, map the symptom to a mechanism before editing code. The usual 2026 causes are: duplicate function or class names without a namespace or function_exists() guard; two plugins hooking the same action at priority 10 and assuming order; a Composer dependency bundled at incompatible majors (for example Guzzle 6 vs 7) inside separate plugins; wp_enqueue_script() with an undeclared dependency such as wp-api-fetch; a REST route registered on the same namespace; add_filter('woocommerce_get_order') returning a non-WC_Order; or a plugin reading $_POST during plugins_loaded before sanitisation and nonce checks.

Fix in the narrowest layer. For a hook-order issue, change priority to add_action('init', 'acme_boot', 20) and guard with if (! function_exists('acme_boot')) only where a genuine duplicate exists; do not wrap entire files in class_exists() to hide a real collision. For an asset issue, declare dependencies explicitly: wp_enqueue_script('acme-admin', $url, ['wp-api-fetch', 'wp-i18n'], '4.8.1', true). For a shared library, move it to a single MU-plugin loader or require the vendor to prefix with strauss/PHP-Scoper rather than shipping two autoloaders. For template overrides, copy only the changed block into the child theme and keep the plugin’s do_action() calls intact.

Verify with the same oracle plus a regression check: the original request returns 200, debug.log has no new fatal for 30 minutes under wp cron event run --due-now, the conflicting pair both report active in wp plugin list, and a second editor role can repeat the flow. Then re-enable the full 24-plugin set from /tmp/active.txt and run the request again; a fix that only works in the minimal set is not a production fix. Pitfalls: editing the plugin file directly (overwritten on the next 4.8.2 update), leaving SCRIPT_DEBUG true and shipping unminified assets, or fixing staging while the live site still holds a stale object-cache.php. Roll back by restoring /tmp/wp-content-before/plugins/, importing /tmp/before-conflict.sql, and reapplying only the reviewed patch as a version-gated MU shim. If the shim grows beyond roughly 40 lines, convert it into a proper maintained plugin rather than leaving incident code in mu-plugins.

Prevention for 2026 and beyond

Make conflicts cheap to detect. Keep a staging clone with identical PHP 8.3, identical object-cache drop-in, and a nightly wp plugin list --format=csv diff in Git. Gate updates behind a smoke test that hits one editor URL, one REST endpoint, one checkout, and one cron event, failing the deploy on any new debug.log match for Fatal error|Uncaught|Doing it wrong. Require vendors to namespace, declare script dependencies, avoid bundled unprefixed Composer libs, and document every hook priority they rely on. Keep WP_ENVIRONMENT_TYPE, WP_DEBUG_LOG, and a central log shipper consistent across environments so a 2026 incident produces the same evidence everywhere.

Operational habits matter as much as code: one change per deploy, a written rollback command beside every change, and a 30-day retention on /tmp/plugins-before.csv-style manifests. Site owners should ask for the A/B/A evidence before approving a fix; developers should refuse to close a ticket until the minimal package reproduces on a machine they did not configure. For broader patterns across our 2026 incident notes, see the technical column index.

Action checklist

  • Snapshot core version, plugin CSV, wp-content/, and SQL before any deactivation.
  • Define one oracle and reproduce it three times plus a bare-core control.
  • Run the six-step bisection with reversible halves and an A/B/A confirmation.
  • Separate theme and plugin layers with Twenty Twenty-Six, then ship the minimal vendor package.
  • Re-test the full active set, remove debug constants and the probe, and archive the report.

Frequently asked questions

How do I know it is a real conflict and not a cache or nonce issue?

Repeat the identical request three times after wp cache flush and a fresh nonce. If the result flips without any plugin state change, it is cache, session, or expiry. A real conflict survives those resets and flips only when one named plugin changes state.

Can I bisect on the live site during a quiet hour?

No. Deactivation can fire uninstall hooks, flush rewrites, and drop tables. Clone to staging, snapshot the database, and keep the live site untouched. If you already started live, restore /tmp/before-conflict.sql immediately and move the test off production.

What if the bug only appears with all 24 plugins active?

That is still reproducible: keep the smallest set that fails, then add plugins back in pairs until the threshold appears. Report the threshold explicitly, because it usually indicates an accumulated hook priority or autoloader collision rather than a single bad plugin.

Need a maintained fix instead of a hot patch?

Our engineers turn minimal reproductions into version-gated, tested compatibility shims and maintained add-ons. Review WordPress Plugin Development or browse all services for staging audits, upgrade support, and 2026 production troubleshooting.

References & further reading

Need WordPress Development?

Free proposal and quote within 24 hours — we serve clients worldwide.

QQ