Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classic Theme Helper: Load relevant theme compat functionality from package #41598

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

coder-karen
Copy link
Contributor

@coder-karen coder-karen commented Feb 6, 2025

Fixes https://github.com/Automattic/vulcan/issues/389

Proposed changes:

  • This PR requires the theme-tools compat files and functions that have been moved to the Classic Theme Helper package, from that package.
  • It also renames the filter copied over from modules/theme-tools.php to classic_theme_helper_theme_compat_files. This is to prevent loading issues that were obvious on Simple sites without the name change due to a file that hooks into the existing filter for those sites. Renaming the filter in the package prevents conflicts and continues to allow extensibility.
  • The PR to hook into the new filter for Simple sites is here - 172653-ghe-Automattic/wpcom - but the order in which either PR is merged makes no difference.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • 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

https://github.com/Automattic/vulcan/issues/389

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

No.

Testing instructions:

Test on self-hosted (testing locally or with the beta tester plugin), or WoA (using the beta tester plugin). The changes in this PR have no bearing for Simple sites but we can test that they are not affected - so test using the commands in the generated comment below on a sandboxed Simple site. On WoA and Simple the below implies both branches are checked out - if only one on WoA this just means we'll be loading only via that branch parent, but all functionality would still work).

Some random tests to confirm functionality is now loading via the Classic Theme Helper package:

  • Self-hosted / WoA: With TwentyFourteen active, open the Customizer > Featured Content. If you did not previously have a tag name set, the default 'featured' tag name will appear. To fully confirm it's coming from the package, you'd need to comment out add_action( 'customize_register', 'twentyfourteen_customizer_default' ); in modules/theme-tools/compat/twentyfourteen.php (If you load only via the Jetpack Mu WPcom plugin when testing WoA, commenting out the module file paths will prevent functionality. )
  • With Twenty Fifteen, Sixteen or Nineteen, ensure the responsive videos post type support works by adding a post, uploading a video (using the VideoPress block - you may need to ensure VideoPress is enabled at /wp-admin/admin.php?page=jetpack#performance), and then opening up page source on the the post front-end. You should see reference to jetpack-responsive-videos-css or responsive-videos.css (or responsive-videos.js on WoA). On Simple, the best option is to look for the jetpack-video-wrapper class in the div wrapping the video - for Simple we just want to confirm it is still working.

To confirm that we're still also reading the module file functions that are not duplicated in the Classic Theme Helper package:

  • Self-hosted only: With Twenty Fifteen, open a front-end page on your test site. View the page source, and look for the href for the twentyfifteen-jetpack-css script. It should be the modules file path.
    For Twenty Fourteen, Sixteen, Nineteen, Twenty, Twenty One, it's the same - twentyfourteen-jetpack-css etc.
  • WoA: As above, but you're looking for twentyfifteen-jetpack etc.
  • Self-hosted / WoA: With Twenty Fifteen, Twenty Sixteen, Nineteen, Twenty or Twenty One active, you should see a Jetpack_Geo_Location deprecation notice in error logs.

Copy link
Contributor

github-actions bot commented Feb 6, 2025

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 WordPress.com Simple 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, and enable the update/load-relevant-theme-compat-classic-theme-helper branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack update/load-relevant-theme-compat-classic-theme-helper
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/load-relevant-theme-compat-classic-theme-helper
    

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

Copy link
Contributor

github-actions bot commented Feb 6, 2025

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 Team Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Choose a review path based on your changes:
    • A. Team Review: add the "[Status] Needs Team Review" label
      • For most changes, including minor cross-team impacts.
      • Example: Updating a team-specific component or a small change to a shared library.
    • B. Crew Review: add the "[Status] Needs Review" label
      • For significant changes to core functionality.
      • Example: Major updates to a shared library or complex features.
    • C. Both: Start with Team, then request Crew
      • For complex changes or when you need extra confidence.
      • Example: Refactor affecting multiple systems.
  3. Get at least one approval before merging.

Still unsure? 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 semi-continuously (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for none scheduled (scheduled code freeze on undefined).

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


Mu Wpcom plugin:

  • Next scheduled release: WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2).

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


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2).

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


Classic Theme helper plugin plugin:

  • Next scheduled release: none scheduled.

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

Copy link
Contributor

github-actions bot commented Feb 6, 2025

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/classic-theme-helper/src/class-main.php 0/30 (0.00%) 0.00% 1 💔

Full summary · PHP report · JS report

… to prevent loading conflicts with the Jetpack module filter which will remain.
@coder-karen coder-karen changed the title Load relevant theme compat functionality from Classic Theme Helper pa… Classic Theme Helper: Load relevant theme compat functionality from package Feb 7, 2025
@coder-karen coder-karen marked this pull request as ready for review February 7, 2025 12:20
@coder-karen coder-karen requested a review from a team February 7, 2025 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant