jetpack
jetpack copied to clipboard
WordPress.com: Add the Help Center App ✨
Proposed changes:
This enqueues one of four bundles from widgets.wp.com
. It chooses the bundle based on the context:
-
help-center-gutenberg.min.js
: for GB editor in a connected site. -
help-center-wp-admin
: for wp-admin in a connected site. -
help-center-wp-admin-disconnected.js
: for wp-admin in a disconnected site. -
help-center-gutenberg-disconnected
: for GB editor in a disconnected site.
It also adds 12 new end points that proxy Atomic requests to wpcom. These endpoints are copied from ETK almost verbatim and have been battle tested for months/years.
Other information:
- [x] Have you written new tests for your changes, if applicable? No, but I will move tests from ETK in a follow up.
- [x] Have you checked the E2E test CI results, and verified that your changes do not break them?
- [x] Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?
Jetpack product discussion
There have been many discussions around moving the Help Center to Jetpack. But the most recent one is: p1718801409878749-slack-C0347E545HR
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Simple sites
- cd into
projects/packages/jetpack-mu-wpcom
. - Sync using
pnpm run build-production-js && jetpack rsync mu-wpcom-plugin wpcom-sandbox:~/public_html/wp-content/mu-plugins/jetpack-mu-wpcom-plugin/sun
- Go to the editor on a sandboxed site and smoke test the Help Center.
- Go to /wp-admin on a sandboxed site and smoke test the Help Center.
- Verify that it's loaded from Jetpack by checking the path of the
help-center
bundle in the Network tab of the DevTools.
Connected Atomic site
- cd into
projects/packages/jetpack-mu-wpcom
. - Sync
jetpack-mu-wpcom
with your WoA site using this commandjetpack rsync mu-wpcom-plugin wpcom-atomic:htdocs/wp-content/plugins/jetpack-mu-wpcom-plugin-dev
. Assuming you have an ssh host pointing to a WoA site. -
Important: Edit
~/htdocs/wp-config.php
and adddefine( 'JETPACK_AUTOLOAD_DEV', true );
. -
Important: Edit
~/htdocs/wp-config.php
and adddefine( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true );
- Go to the editor and smoke test the Help Center.
- Go to /wp-admin and smoke test the Help Center.
- Verify that it's loaded from Jetpack by checking the path of the
help-center
bundle in the Network tab of the DevTools.
Disconnected Atomic site
- Disconnect a JP site by going to
/_cli
and runningjetpack disconnect blog
. - Go to /wp-admin/post-new.php.
- Click the Help Center.
- It should take you to wp.com/help.
- Repeat in wp-admin.
- It should take you to wp.com/help.
- Reconnect your site by going to https://jptools.wordpress.com/debug/?url=YOUR_SITE and click "Restore User Connection".