Skip to content

Black Friday configuration callback emits Undefined array key "default" warning #3196

Open

Description

@pirate-bot

Summary

Otter Blocks 3.2.11 can emit Warning: Undefined array key "default" while processing Black Friday promotional configuration when an earlier filter has removed the default configuration.

Expected behavior: processing an empty or default-free promotional configuration completes without PHP warnings.

Actual behavior: Otter emits the reported warning. The affected user deactivated the plugin because of it; no fatal error or data loss was reported.

Customer context

  • Product / area: Otter Blocks free, Black Friday promotions.
  • Version: 3.2.11.
  • Environment: WordPress and PHP versions not provided. The deactivation metadata reports SDK version 2.0.0; the installed SDK source was not available for verification.
  • Integration / third party: Active plugins and custom filters unknown.
  • Reported error / symptom: Warning: Undefined array key "default" in Otter's main PHP file, line 639.
  • Impact: User deactivated the plugin.

Reproduction notes

Reported: Otter Blocks free 3.2.11 emitted the undefined default key warning, prompting deactivation. No exact triggering screen was supplied.

Source-derived verification scenario, not runtime-reproduced:

  1. Activate Otter Blocks 3.2.11 in a disposable WordPress installation.
  2. Register a callback before Otter's themeisle_sdk_blackfriday_data callback that returns an empty array.
  3. During an active or simulated Black Friday sale, open the Plugins screen to exercise promotional metadata processing with PHP warnings recorded.
  4. Check for Undefined array key "default" at inc/class-main.php:639.

Easy MCP AI contains a real empty-array policy on this hook, but its presence on the customer's site was not reported. Local runtime execution was unavailable because PHP is not installed.

Diagnosis

Conclusion

The affected release directly reads a configuration key that can be absent after earlier filters. This matches the reported warning exactly. Source inspection confirms a concrete producer of empty configurations in a companion product, but does not establish which filter removed the key on the reporting site. The defect remains in current Otter source.

Where this likely occurs

  • Otter: inc/class-main.php, line 52 — Main::init() registers add_black_friday_data() on the shared themeisle_sdk_blackfriday_data filter.
  • Otter: inc/class-main.php, lines 631–639 — Main::add_black_friday_data() documents an array of product configurations and immediately reads $configs['default'] without checking its presence.
  • SDK sibling reference: src/Modules/Announcements.php, lines 447–459 — Announcements::add_plugin_meta_links() applies the shared filter and explicitly accepts an empty resulting configuration. Announcements::black_friday_notice_render(), lines 225–245, also accepts empty results and accommodates an absent default.
  • Easy MCP AI sibling: includes/class-themeisle-sdk.php, lines 81–94 and 396–413 — Themeisle_SDK::register() registers the policy filters; Themeisle_SDK::policy() maps the shared Black Friday filter to __return_empty_array. When registered before Otter's callback, this supplies the failing input.
  • Git evidence: commit f218caad9e92c3b698f4b95f9f994707fe02274a introduced the callback and unguarded access. The callback is absent in v3.0.11 and present in v3.0.12. It remains unchanged at the failing access in v3.2.10, v3.2.11, and current source. This is not a newly introduced 3.2.11 regression.

Engineering notes

The SDK initially supplies a default entry, but the shared filter chain can replace that array before Otter receives it. Empty configuration is an intentionally supported suppression state in the inspected SDK and Easy MCP AI paths. The failure is in Otter's configuration consumer, not evidence of a partial deployment or missing runtime symbol. The free plugin owns this callback; Pro is not required to reach the read. Registration order determines whether the inspected companion policy precedes Otter.

Test coverage status

No relevant Otter callback coverage was found during inspection of tracked tests. The SDK sibling's tests/announcement-test.php, lines 262–272 — Test_Announcements::test_add_plugin_meta_links_returns_unchanged_when_configs_empty() — covers the SDK's empty-result behavior, not its interaction with Otter's callback. Runtime tests were not run because PHP is unavailable in this environment.

What to verify or explore next

  • On a disposable WordPress installation with Otter 3.2.11, verify the warning when an earlier shared-filter callback returns an empty array during the sale window.
  • Compare the same scenario with Otter v3.0.11 and v3.0.12 to validate the source-identified introduction boundary at runtime.
  • Verify registration order and warning behavior with Easy MCP AI active alongside Otter.
  • Check normal configurations containing default as a control.

Unknowns / follow-up

The customer's triggering screen, actual configuration payload, active-plugin list, PHP version, and filter registration order are unknown. The SDK sibling is reference source, not a verified copy of the customer's installed dependency. WordPress core filter internals were not inspected locally, and no live-site investigation was performed.

Confidence

Confidence: 97/100

The reported file and line match the tagged source exactly, and inspected companion code supplies the missing-key state through the same shared filter. The site's specific configuration producer remains unknown.


Source: HelpScout #3522669360
Generated by bug-report-triage (ID: bug-report-triage_6b03d680a596e6.66479444)

Activity

  1. added
    regression
    on Nov 23, 2026
  2. added theissue type on Nov 23, 2026
  3. added
    customer report
    on Nov 23, 2026
  4. girishpanchal30 commented on Nov 23, 2026

    @girishpanchal30
    Contributor

    I have fixed it with PR #3198

  5. milicavs commented on Nov 23, 2026

    @milicavs

    🧪 QA steps and test links

    During the Black Friday sale week, when another plugin opts the site out of the Themeisle Black Friday promotion, Otter still processes the promotion and logs Warning: Undefined array key "default" on every admin page that loads it, such as Plugins. It also still shows the "Otter Pro: 60% off this week" banner that was meant to be switched off.

    Requires: the Black Friday sale window (it started Monday, Nov 23), and Otter active for more than 3 days, or the snippet below.

    Link Build Bot check
    Reproduce the bug Otter Blocks 3.2.11 (released) ✅ Reproduced: the warning is logged on Plugins and the "Otter Pro: 60% off this week" banner shows
    Verify the fix PR #3198 build 3c5509b ✅ Fixed: Plugins loads with no warning and no Black Friday banner

    In the links:

    • Steps 1 and 2 are already done, and the links open on Plugins.
    • A must-use plugin does what the snippet does, and Otter's install date is set 10 days back.
    • They run Twenty Twenty-Five, because Neve logs the same warning from its own code.
    • Tools → QA Logs shows debug.log.

    Reproduce on Otter Blocks 3.2.11:

    1. With WP_DEBUG_LOG on, add a Code Snippet titled "QA BF opt-out", set to run everywhere: add_filter( 'themeisle_sdk_blackfriday_data', '__return_empty_array', 5 ); update_option( 'otter_blocks_install', time() - 10 * DAY_IN_SECONDS );
    2. Activate the snippet.
    3. Go to Plugins.
    4. Open the debug log.
    • Bug: Undefined array key "default" from Otter's inc/class-main.php, and the "Otter Pro: 60% off this week" banner above the plugin list.
    • Fixed: no Otter warning in the log, and no Black Friday banner from Otter.
    Edge cases
    • Snippet deactivated (normal sale): the Otter Black Friday banner and the plugin row link still show, with no warning.
    • Easy MCP AI active alongside Otter instead of the snippet: no Otter warning.
    • Blocks Animation or Blocks CSS standalone (without Otter) plus the snippet: no warning.
    • Otter Pro with a valid or expired license, snippet off: the Pro wording of the sale still shows.

    Fix: #3198 (open)

  6. pirate-bot commented on Nov 23, 2026

    @pirate-bot
    ContributorAuthor

    🎉 This issue has been resolved in version 3.2.12 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

  7. added
    released
    on Nov 23, 2026
  8. pirate-bot commented on Nov 23, 2026

    @pirate-bot
    ContributorAuthor

    QA agent — 🟢 Passing checks · The "Undefined array key default" Black Friday warning is gone, and opting out of the sale now hides Otter's banner cleanly.

    We set up Otter during Black Friday week, with Otter installed 10 days ago. A small test plugin empties the shared Black Friday settings before Otter reads them, as other plugins do. On the old build, opening Plugins logged the reported warning at class-main.php line 639 and still showed Otter's sale banner. On the new build, the log stayed empty and no banner or sale link appeared. Without the opt-out, the normal sale banner and row link still show. Standalone Blocks Animation and Blocks CSS behave the same way, and the new unit tests pass.

    Worth a human look

    1. Try Otter alongside the real Easy MCP AI plugin, whose policy empties the shared Black Friday filter, to confirm that registration order also gives no warning.
    2. Check Otter Pro with a valid or expired license during the sale to confirm the Pro wording still shows.
    3. Check other admin screens that show the sale notice, such as Otter's own dashboard and About Us page, in the opt-out state.
    Checks (6 passed)
    • ✅ With Otter Blocks active (installed >3 days, Black Friday sale week) and an earlier themeisle_sdk_blackfriday_data callback at priority 5 returning an empty array, opening the Plugins screen as admin logs no Undefined array key "default" warning (or any other PHP warning/notice from otter-blocks) in debug.log; the same journey on the qa-base build does log the warning.
    • ✅ In the same empty-configuration (opt-out) scenario, the Plugins screen shows no Otter Black Friday banner ("Otter Pro: 60% off this week") and no "Black Friday Sale - 60% off" link in the Otter plugin row.
    • ✅ For default-free or empty-default configurations from an earlier filter (only another product's entry; default => empty array; default => null), loading the Plugins screen logs no PHP warnings from Otter, and Otter's callback on the hook returns each input unchanged (no Otter entry added).
    • ✅ Control: without the opt-out filter (normal sale configuration containing default), the Plugins screen still shows the Otter Black Friday banner "Otter Pro: 60% off this week" and the Otter row link "Black Friday Sale - 60% off", with no PHP warning logged.
    • ✅ Standalone Blocks Animation and Blocks CSS (Otter Blocks inactive) with the empty-array opt-out filter: loading the Plugins screen logs no Undefined array key "default" warning or other PHP warning from those plugins, and no Black Friday banner/row link from them.
    • ✅ The PR-added PHPUnit test tests/test-black-friday-data.php (TestBlackFridayData, 3 tests) passes.

    Full report, evidence and session trail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug-reportbug-report-triagecustomer reportregressionreleased

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions