Skip to content

fix: resolve WP 7.0 / Gutenberg editor deprecations#2876

Merged
Soare-Robert-Daniel merged 10 commits into
developmentfrom
fix/deprecations
Jul 3, 2026
Merged

fix: resolve WP 7.0 / Gutenberg editor deprecations#2876
Soare-Robert-Daniel merged 10 commits into
developmentfrom
fix/deprecations

Conversation

@Soare-Robert-Daniel

@Soare-Robert-Daniel Soare-Robert-Daniel commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves the editor-console deprecation warnings that surface under WP 7.0 / Gutenberg, across both the lite and pro bundles. Each fix targets the documented stable replacement; behavior is preserved.

Deprecation Since / removal Fix
wp.editPost.PluginSidebar / PluginSidebarMoreMenuItem 6.6 import from @wordpress/editor
wp.data.registerGenericStore (otter-store) 5.9 createReduxStore + register
core/preferences hiddenBlockTypes namespace 6.5 read/write under the core scope
__experimentalGetPreviewDeviceType (core/edit-post) 6.5 core/editor getDeviceType / setDeviceType (section blocks, responsive control, CSS injector, global defaults, pro plugins)
Custom components as toolbar controls 5.6 ToolbarButton; data-toolbar-item on the Design Library header button
core/edit-post interface scope 6.6 enableComplementaryArea( 'core', … )
wp.date.__experimentalGetSettings 6.1 getSettings
RichText onSplit (icon-list item) 6.4 block.json supports.splitting
FormFileUpload 36px default 6.8 / 7.1 __next40pxDefaultSize (export/import)
moment malformed timezone offset (countdown) fix getTimezone() to emit a valid ISO ±HH:MM offset

Note: Form captcha apiVersion: 3 is already on development (#2833) and is not part of this diff.

Deferred (documented, intentional)

  • advanced-heading onSplit — core supports.splitting converts a heading's split tail to a plain core/paragraph, dropping all heading styling. Left as-is to avoid a real regression; needs a style-preserving transform.
  • TextControl 40px migration — broad, plugin-wide; tracked separately. Has a hard 7.1 removal.

Test plan

  • Unit (helper-functions-timezone.test.ts): getTimezone() returns a valid ISO 8601 offset for UTC, whole, negative, and fractional offsets — genuine red (+0:0) → green.
  • E2e (new) (icon-list.spec.js): pressing Enter mid-text splits an item into two same-type icon-list items with the content divided at the caret — guards the onSplitsupports.splitting migration.
  • E2e (regression): icon-list, alt-attributes, api-version-v3, and specs touching toolbar / section / sharing-icons blocks — all passing locally.
  • Static: phpstan clean; lint clean.
  • Manual: browser console scan inserting all Otter blocks — unique deprecations dropped from 7 → 2 (the two deferred items above).

Follow-up cleanup (171b9632)

No behavior change — trims redundant e2e assertions/helpers, simplifies section device-type selectors and otter-store action types, and shortens the OpenAI e2e stub.

Editor console deprecations surfaced under WP 7.0 / Gutenberg, fixed across
lite and pro:

- captcha: Block API v2 -> v3 (6.9)
- options sidebar: import PluginSidebar/PluginSidebarMoreMenuItem from
  @wordpress/editor (6.6)
- otter-store: registerGenericStore -> createReduxStore + register (5.9)
- preferences: read/write hiddenBlockTypes under the 'core' scope (6.5)
- device type: core/editor getDeviceType/setDeviceType instead of
  core/edit-post __experimentalGetPreviewDeviceType (6.5)
- toolbar controls: use ToolbarButton; mark the Design Library header button
  as a toolbar item (5.6)
- interface scope: enableComplementaryArea( 'core', ... ) not
  'core/edit-post' (6.6)
- date: getSettings instead of __experimentalGetSettings (6.1)
- icon-list item: RichText onSplit -> block.json supports.splitting (6.4)
- FormFileUpload: opt into __next40pxDefaultSize (6.8 / removal 7.1)
- countdown: fix malformed timezone offset (+0:0) fed into moment(), which
  forced a fallback to the JS Date constructor

Deferred, documented: advanced-heading onSplit (core splitting would convert
the styled heading tail to a plain paragraph) and the broad TextControl 40px
migration (tracked separately, removal in 7.1).

Tests:
- unit: getTimezone returns a valid ISO 8601 offset (red->green)
- e2e: icon-list splits into same-type items on Enter (guards the
  onSplit -> supports.splitting migration)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pirate-bot

pirate-bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 178.27 KB 178.27 KB 0 B (0.00%)
Blocks 1.65 MB 1.65 MB -276 B (-0.02%)
CSS 7.87 KB 7.83 KB -34 B (-0.42%)
Dashboard 172.5 KB 172.49 KB -13 B (-0.01%)
Onboarding 68.14 KB 68.14 KB 0 B (0.00%)
Export Import 4.7 KB 4.73 KB 25 B (0.52%)
Pro 439.79 KB 439.64 KB -154 B (-0.03%)

@pirate-bot

pirate-bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Plugin build for 70678db is ready 🛎️!

@pirate-bot

pirate-bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"q25":484.9,"q50":504.4,"q75":516.7,"cnt":10}, firstPaint: {"q25":1344.3,"q50":1533.1,"q75":1682.1,"cnt":10}, domContentLoaded: {"q25":3827.3,"q50":3840.65,"q75":3865.8,"cnt":10}, loaded: {"q25":3829.1,"q50":3842.6,"q75":3867.7,"cnt":10}, firstContentfulPaint: {"q25":4365,"q50":4378.5,"q75":4397.3,"cnt":10}, firstBlock: {"q25":15265.4,"q50":15405.15,"q75":15567.6,"cnt":10}, type: {"q25":29.22,"q50":31.95,"q75":36.1,"cnt":10}, typeWithoutInspector: {"q25":28.1,"q50":28.98,"q75":30.41,"cnt":10}, typeWithTopToolbar: {"q25":38.39,"q50":40,"q75":43,"cnt":10}, typeContainer: {"q25":19.3,"q50":21.47,"q75":23.27,"cnt":10}, focus: {"q25":149.76,"q50":152.73,"q75":160.68,"cnt":10}, inserterOpen: {"q25":45.71,"q50":50.4,"q75":54.53,"cnt":10}, inserterSearch: {"q25":18.72,"q50":19.84,"q75":21.19,"cnt":10}, inserterHover: {"q25":5.89,"q50":6.49,"q75":7.32,"cnt":20}, loadPatterns: {"q25":1959.28,"q50":2003.01,"q75":2040.02,"cnt":10}, listViewOpen: {"q25":254.62,"q50":270.71,"q75":288.93,"cnt":10}

Soare-Robert-Daniel and others added 2 commits June 30, 2026 17:17
Remove redundant test assertions and helpers, simplify section device-type
selectors and the otter-store action types, and shorten the OpenAI e2e stub.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Jun 30, 2026
@Soare-Robert-Daniel Soare-Robert-Daniel added the pr-checklist-skip Allow this Pull Request to skip checklist. label Jun 30, 2026
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Jun 30, 2026
Soare-Robert-Daniel and others added 4 commits June 30, 2026 18:48
Replace the legacy wp-scripts/Puppeteer uniq-id spec with a Playwright test
and drop the broken test:e2e:blockId npm script.

Co-authored-by: Cursor <cursoragent@cursor.com>
Return memoized responsive helpers from a primitive view selector so
useSelect no longer warns about changing return values. Add e2e coverage
for per-device align without console warnings.

Co-authored-by: Cursor <cursoragent@cursor.com>
Guard dashboard block visibility, responsive device attributes, form captcha v3 canvas, and toolbar migrations; fix countdown plural label assertion that failed CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Fix jsdoc/check-line-alignment lint error that failed the JS Test CI job.

Co-authored-by: Cursor <cursoragent@cursor.com>

@abaicus abaicus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Soare-Robert-Daniel looks fine. Can you maybe provide some comprehensive testing steps so @poonam279 could do some smoke-testing on this (i.e. a list of which blocks to check, what to test when migrating to an older version to this - what should not break, which versions to test with, etc).

@poonam279 after Robert provides some testing steps we can do a quick sweep to make sure nothing breaks when migrating from an older version, using the changed blocks, etc.

@Soare-Robert-Daniel

Soare-Robert-Daniel commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@poonam279 here are the steps. Most of them are covered by E2E tests so you can check mostly if we have an unexpected crash.

Testing steps

Setup

  • Use WP 7.0 (latest Gutenberg plugin optional — it surfaces deprecations earliest).
  • Keep the browser console open (F12) during every step below — in the editor and on the frontend pages you visit.
  • After each case, check the console for:
    • 🔴 errors — none expected, anywhere.
    • 🟡 deprecation warnings (wp.deprecated) — none new; only the 2 known deferred ones may appear (advanced-heading split, TextControl size).
  • Expected result everywhere: works as before + clean console.

1. Otter sidebar

  • Open a post → click the Otter icon (top-right).
  • ✅ Sidebar opens, all panels render.
  • Close it → reopen from the ⋮ options menu.
  • ✅ Same result.
  • In a block's Inspector → Tools panel (+ icon) → "Manage Default Tools"; and in a responsive control's sync dropdown → "Manage Global Defaults".
  • ✅ Both open the Otter sidebar.

2. Posts block (otter store)

  • Add two Posts blocks on the same page.
  • There should be no missing posts or duplicate display
  • ✅ The second block excludes posts shown by the first; no console errors when editing either.

3. Hidden blocks (Dashboard → Blocks)

  • Otter dashboard → Blocks tab → disable a block (e.g. Progress Bar).
  • Open the editor → search the inserter.
  • ✅ The block is gone. Re-enable → it's back.
  • Extra: hide a block on the old version, then update to this build.
  • ✅ It stays hidden.

4. Responsive controls (Desktop / Tablet / Mobile)

  • Insert a Section, open its padding/margin controls.
  • Switch device in the Otter control.
  • ✅ Editor preview switches too, and vice versa.
  • Set different values per device, save, reload.
  • ✅ Each device keeps its value, frontend matches.
  • Quick repeat on: Custom CSS (tablet/mobile CSS applies in preview) and Global Defaults for Section.

5. Toolbar buttons (Button → ToolbarButton)

For each, the button should look normal in the toolbar, be reachable with keyboard arrows, and work:

  • Advanced Heading — highlight color dropdown in the toolbar.
  • Lottie — Edit/Save toggle button.
  • Sharing Icons — per-network toggle buttons show/hide icons.
  • Form — "Create Form With AI" button inserts the AI generator.
  • Section — Design Library button opens the library; inserting a template works.
  • Any block with the style-switcher (appearance) toolbar dropdown — still opens and applies styles.

6. Countdown & dates

  • Insert Countdown, set a date with a timezone with a negative offset (e.g. America/New_York), then a half-hour one (e.g. Asia/Kolkata).
  • ✅ Remaining time correct in editor and frontend; no moment warning in console.
  • ✅ Date labels in the inspector follow the site's date format.
  • (Pro) Countdown pro settings and Block Conditions date-range: dates display formatted correctly.

7. Icon List splitting

  • Insert Icon List, type in an item, press Enter mid-text.
  • ✅ Splits into two icon-list items (not paragraphs), text divided at the caret.
  • Backspace at the start of the second item.
  • ✅ Merges back.

8. Export / Import

  • Select a block → Export as JSON → re-import via the toolbar Import button.
  • ✅ Round-trips identically; Import button renders at normal (40px) size.

Migration check (old version → this build)

  • On the latest stable Otter from wp.org, build a page with: Section (responsive settings), Icon List (several items), Countdown (with timezone), Sharing Icons, Posts (×2), Form, Advanced Heading, Lottie.
  • Update to this PR's build (zips in the pirate-bot comment above).
  • Reopen the page.
  • ✅ No "block contains unexpected content" warnings; editor and frontend unchanged.
  • ✅ Console clean in both the editor and the frontend page (no errors, no new deprecations).
  • Re-save → ✅ no markup changes.

Versions

  • WP 7.0 — main target. Console deprecations should drop to the 2 known deferred ones (advanced-heading split, TextControl size).
  • Oldest supported WP — smoke test: the blocks above insert and save without errors (APIs used are stable since 6.6).

- otter-sidebar: sidebar opens from the pinned button, Options menu, and
  "Manage Default Tools" — asserts the 'core' complementary-area scope
- posts: otter-store (createReduxStore migration) actions/selectors
  round-trip and notify subscribers
- export-import: export-as-JSON → importer FormFileUpload round-trip
- heading: "Typography Settings" toolbar dropdown (ToolbarButton swap)
- google-map: "Block Styles" style-switcher applies a style from the toolbar

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@poonam279

Copy link
Copy Markdown

@Soare-Robert-Daniel, I have tested this PR, and everything is working fine except these:

  1. I checked the Posts block, but I couldn't find the "Prevent duplicate posts" (or post exclusion) option. I also don't remember using it before. Is this option available?

  2. During the Migration check, I see this error in the console:

blocks.js?ver=5f3eba4…:32 Uncaught TypeError: Cannot read properties of undefined (reading 'call')
    at s (blocks.js?ver=5f3eba…9e0a430180:32:76621)
    at 832 (vendor.js?ver=0968bf…09c8ba45140:1:10429)
    at s (blocks.js?ver=5f3eba…9e0a430180:32:76621)
    at 696 (blocks.js?ver=5f3eba…9e0a430180:32:16964)
    at s (blocks.js?ver=5f3eba…9e0a430180:32:76621)
    at blocks.js?ver=5f3eba…99e0a430180:39:8798
    at blocks.js?ver=5f3eba…9e0a430180:40:27514
    at blocks.js?ver=5f3eba…9e0a430180:46:13205

Admin area URL: https://whipseat.s6-tastewp.com/wp-admin
Username: poonam
Password: _stAuR2TDNA

https://whipseat.s6-tastewp.com/wp-admin/post.php?post=6&action=edit

@Soare-Robert-Daniel

Soare-Robert-Daniel commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author
  1. I checked the Posts block, but I couldn't find the "Prevent duplicate posts" (or post exclusion) option. I also don't remember using it before. Is this option available?

This was a bit misspelled. There were some underlying function changes regarding the retrieval of data, and it should work like before without missing or duplicated posts.

  1. During the Migration check, I see this error in the console:
blocks.js?ver=5f3eba4…:32 Uncaught TypeError: Cannot read properties of undefined (reading 'call')
    at s (blocks.js?ver=5f3eba…9e0a430180:32:76621)
    at 832 (vendor.js?ver=0968bf…09c8ba45140:1:10429)
    at s (blocks.js?ver=5f3eba…9e0a430180:32:76621)
    at 696 (blocks.js?ver=5f3eba…9e0a430180:32:16964)
    at s (blocks.js?ver=5f3eba…9e0a430180:32:76621)
    at blocks.js?ver=5f3eba…99e0a430180:39:8798
    at blocks.js?ver=5f3eba…9e0a430180:40:27514
    at blocks.js?ver=5f3eba…9e0a430180:46:13205

Admin area URL: https://whipseat.s6-tastewp.com/wp-admin Username: poonam Password: _stAuR2TDNA

https://whipseat.s6-tastewp.com/wp-admin/post.php?post=6&action=edit

This should be fixed now. It was a very odd issue in the build system.

cc @poonam279

# Conflicts:
#	src/blocks/helpers/utility-hooks.js
#	src/blocks/plugins/ai-content/index.tsx
@Soare-Robert-Daniel Soare-Robert-Daniel merged commit 24d3013 into development Jul 3, 2026
16 of 17 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the fix/deprecations branch July 3, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants