Skip to content

Social: fix missing editor sharing controls and blank admin page on WordPress 6.9.x - #49859

Merged
robertsreberski merged 3 commits into
trunkfrom
fix/social-wp69-theme-shim
Jun 24, 2026
Merged

robertsreberski merged 3 commits into
trunkfrom
fix/social-wp69-theme-shim

Conversation

@manzoorwanijk

@manzoorwanijk manzoorwanijk commented Jun 23, 2026 •

Copy link
Copy Markdown
Member

Fixes JETPACK-1750

Proposed changes

On WordPress 6.9.x, @wordpress/theme (pulled in transitively via @wordpress/ui) is externalized to the wp-theme script handle, which only exists on WP 7.0+ — and even WP 7.0's wp-private-apis ships a core-module allowlist too old for @wordpress/theme / @wordpress/ui. WordPress silently refuses to enqueue any script with an unregistered dependency, so the Social bundles never load: the Social admin page renders blank and the editor "Share to social media" controls are missing.

This reuses the existing jetpack-wp-build-polyfills package — which already provides wp-theme / wp-private-apis for the wp-build (chassis) Social dashboard — and wires it into the two surfaces that still lacked it:

  • Revert Social: fix blank Social admin page on WordPress 6.9.x #49654. That PR fixed only the admin page, by bundling @wordpress/theme + @wordpress/private-apis inline for the social-admin-page entry. The block-editor entries kept externalizing both, so the editor controls stayed missing — and inlining private-apis there breaks lock()/unlock() across bundles (Cannot unlock an object that was not locked before).
  • Register the polyfills in the legacy admin-page and block-editor enqueue paths via a shared Publicize_Assets::register_wp_build_polyfills() helper, and de-duplicate the existing chassis call to reuse it.

All bundles keep externalizing wp-theme / wp-private-apis uniformly; the polyfills provide a single shared private-apis instance whose allowlist permits @wordpress/theme and @wordpress/ui, so every consumer — WordPress core included — shares one instance and lock()/unlock() stays consistent. No-op on WP 7.0+.

This matches the fix suggested in the issue (WP_Build_Polyfills::register()).

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

Requires a site on WordPress 6.9.x with Jetpack Social active.

  1. Editor controls: Posts → Add New → open the Jetpack sidebar panel. Confirm the "Share to social media" section appears (auto-share toggle, per-connection toggles, Manage connections, Preview & customize, Link preview).
  2. Admin page: Go to Jetpack → Social and confirm the dashboard renders (not blank). Verify both the modernized dashboard and the legacy dashboard — force the legacy one with add_filter( 'rsm_jetpack_ui_modernization_social', '__return_false' ).
  3. Confirm the browser console shows no Cannot unlock an object that was not locked before error.
  4. On WP 7.0+, confirm nothing changes — the polyfills are a no-op since core already registers wp-theme.
Before After

@github-actions

github-actions Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/social-wp69-theme-shim branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/social-wp69-theme-shim

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Feature] Publicize Now Jetpack Social, auto-sharing [Package] Publicize [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Social Issues about the Jetpack Social plugin labels Jun 23, 2026
@github-actions

github-actions Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: July 7, 2026
    • Code freeze: July 6, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jun 23, 2026
@manzoorwanijk manzoorwanijk added [Status] Needs Team Review Obsolete. Use Needs Review instead. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Jun 23, 2026
@manzoorwanijk
manzoorwanijk requested a review from a team June 23, 2026 13:44

WP_Build_Polyfills::register(
'jetpack-social',
array_merge( WP_Build_Polyfills::SCRIPT_HANDLES, WP_Build_Polyfills::MODULE_IDS )

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.

Should this list only the handles Social actually needs, rather than registering everything?

I also note that #49838 is backing out a similar registration in the block editor, although it's unclear to me if that's fixing something specific or is just to lower risk. Pinging @dhasilva for input. 🙂

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.

All dashboards are scoping the polyfills call to the dashboard page (with the exception of Social modernized dashboard, which is still under a feature flag, but I must fix before release, and PA, hence that PR).

So this PR needs to scope it as well.

Limiting the packages would require testing, but I think should be OK.

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.

In this case, it looks like they have some @wordpress/ui use in a bundle that's loaded into the editor. Which depends on @wordpress/theme, which isn't available in 6.9.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, the missing script issue is only with @wordpress/theme but it seems like private-api from WP 6.9 doesn't work with the latest @wordpress/theme. So, maybe we need both of them?

@jp-launch-control

jp-launch-control Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 2 files.

File Coverage Δ% Δ Uncovered
projects/packages/publicize/src/class-publicize-assets.php 5/31 (16.13%) 16.13% 2 ❤️‍🩹
projects/packages/publicize/src/class-social-admin-page.php 25/73 (34.25%) 0.91% 0 💚

Full summary · PHP report · JS report

…dles use

Per review: the shared helper for the Social bundles (editor + legacy admin
page) now requests only wp-theme and wp-private-apis instead of the full
SCRIPT_HANDLES + MODULE_IDS set, so the polyfill's wp-private-apis force-
replacement never touches handles Social doesn't need (e.g. wp-notices).

The wp-build chassis dashboard keeps its own full registration -- it genuinely
uses the @wordpress/boot|route|a11y modules, wp-notices, and wp-views.
@robertsreberski
robertsreberski merged commit 95f94d4 into trunk Jun 24, 2026
80 checks passed
@robertsreberski
robertsreberski deleted the fix/social-wp69-theme-shim branch June 24, 2026 07:57
@github-actions github-actions Bot removed the [Status] Needs Team Review Obsolete. Use Needs Review instead. label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Publicize Now Jetpack Social, auto-sharing [Package] Publicize [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Social Issues about the Jetpack Social plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants