Skip to content

Jetpack settings: override module list & debugger page titles#46283

Merged
jeherve merged 4 commits intotrunkfrom
fix/missing-title-wp-admin-settings
Dec 16, 2025
Merged

Jetpack settings: override module list & debugger page titles#46283
jeherve merged 4 commits intotrunkfrom
fix/missing-title-wp-admin-settings

Conversation

@jeherve
Copy link
Copy Markdown
Member

@jeherve jeherve commented Dec 12, 2025

Fixes JETPACK-1008

Proposed changes:

When registering the Module list page and the Jetpack Debugger page, we do not want the page to appear in the admin menu. This causes us to run into this issue:

Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in …/wp-admin/admin-header.php on line 41

Let's override the title when we're on those pages to avoid the deprecation warning and have a proper page title on those 2 pages.

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

  • N/A

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

  • No

Testing instructions:

  • On a site with Jetpack installed, go to the following pages
    • mysite.com/wp-admin/admin.php?page=jetpack-debugger
    • mysite.com/wp-admin/admin.php?page=jetpack_modules
  • Check the page title: it should match the titles set in this PR.
  • Check your site's error logs: you should not see any errors.
  • Check the Jetpack menu in wp-admin: you should not see those 2 pages.

jeherve and others added 2 commits December 12, 2025 12:27
Fixes JETPACK-1008

When registering the Module list page and the Jetpack Debugger page, we do not want the page to appear in the admin menu. This causes us to run into this issue:
- https://core.trac.wordpress.org/ticket/57579
- #46214

```
Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in …/wp-admin/admin-header.php on line 41
```

Let's override the title when we're on those pages to avoid the deprecation warning and have a proper page title on those 2 pages.

Co-authored-by: Weston Ruter <weston@xwp.co>
@jeherve jeherve self-assigned this Dec 12, 2025
@jeherve jeherve added Bug When a feature is broken and / or not performing as intended [Status] Needs Review This PR is ready for review. Admin Page React-powered dashboard under the Jetpack menu [Pri] Low Bug labels Dec 12, 2025
@jeherve jeherve requested a review from a team December 12, 2025 11:34
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 12, 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 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/missing-title-wp-admin-settings branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/missing-title-wp-admin-settings

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 the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Dec 12, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 12, 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 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 🤖


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: January 6, 2026

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

@jp-launch-control
Copy link
Copy Markdown

jp-launch-control bot commented Dec 12, 2025

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/_inc/lib/admin-pages/class.jetpack-admin-page.php 0/193 (0.00%) 0.00% 5 💔

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a deprecation warning that occurs when loading the Jetpack Settings screen (module list page) and the Debugging Center page. These pages are registered as "hidden" admin pages (with empty parent slug) to prevent them from appearing in the admin menu, which causes WordPress's strip_tags() function to receive a null title parameter. The fix manually overrides the page titles using the current_screen action hook to provide proper titles for both pages.

Key Changes

  • Added a new override_page_title() method to set explicit page titles for hidden admin pages
  • Hooked this method to the current_screen action in the add_actions() method
  • Added changelog entry documenting the bugfix

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
projects/plugins/jetpack/changelog/fix-missing-title-wp-admin-settings Adds changelog entry documenting the deprecation notice fix
projects/plugins/jetpack/_inc/lib/admin-pages/class.jetpack-admin-page.php Adds override_page_title() method and registers it on current_screen hook to set titles for jetpack_modules and jetpack-debugger pages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +426 to +431
global $title;
if ( 'admin_page_jetpack_modules' === $screen->id ) {
$title = __( 'Jetpack Settings', 'jetpack' ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- we override the title global only on this page.
} elseif ( 'admin_page_jetpack-debugger' === $screen->id ) {
$title = __( 'Debugging Center', 'jetpack' ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- we override the title global only on this page.
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we use the admin_title filter instead of modifying the global? Or is that different than the title we are trying to modify here?

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.

We could, but since the filter is declared later (see https://github.com/WordPress/wordpress-develop/blob/48b2b65eb7f719936260b8ece17b8847d264eec5/src/wp-admin/admin-header.php#L89 ), we would still get the PHP warning.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@manzoorwanijk manzoorwanijk left a comment

Choose a reason for hiding this comment

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

This looks good to me now. Thanks

@jeherve jeherve merged commit cab13aa into trunk Dec 16, 2025
74 of 75 checks passed
@jeherve jeherve deleted the fix/missing-title-wp-admin-settings branch December 16, 2025 09:27
@github-actions github-actions bot removed the [Status] Needs Review This PR is ready for review. label Dec 16, 2025
@github-actions github-actions bot added this to the jetpack/15.4 milestone Dec 16, 2025
matticbot pushed a commit to Automattic/jetpack-production that referenced this pull request Dec 16, 2025
* Jetpack settings: override module list & debugger page titles

Fixes JETPACK-1008

When registering the Module list page and the Jetpack Debugger page, we do not want the page to appear in the admin menu. This causes us to run into this issue:
- https://core.trac.wordpress.org/ticket/57579
- Automattic/jetpack#46214

```
Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in …/wp-admin/admin-header.php on line 41
```

Let's override the title when we're on those pages to avoid the deprecation warning and have a proper page title on those 2 pages.

Co-authored-by: Weston Ruter <weston@xwp.co>

* changelog

* Change hook registration to match static declaration

See Automattic/jetpack#46283 (comment)

---------

Co-authored-by: Weston Ruter <weston@xwp.co>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/20262979158

Upstream-Ref: Automattic/jetpack@cab13aa
matticbot pushed a commit to Automattic/charts that referenced this pull request Dec 16, 2025
* Jetpack settings: override module list & debugger page titles

Fixes JETPACK-1008

When registering the Module list page and the Jetpack Debugger page, we do not want the page to appear in the admin menu. This causes us to run into this issue:
- https://core.trac.wordpress.org/ticket/57579
- Automattic/jetpack#46214

```
Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in …/wp-admin/admin-header.php on line 41
```

Let's override the title when we're on those pages to avoid the deprecation warning and have a proper page title on those 2 pages.

Co-authored-by: Weston Ruter <weston@xwp.co>

* changelog

* Change hook registration to match static declaration

See Automattic/jetpack#46283 (comment)

---------

Co-authored-by: Weston Ruter <weston@xwp.co>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/20262979158

Upstream-Ref: Automattic/jetpack@cab13aa
matticbot pushed a commit to Automattic/jetpack-storybook that referenced this pull request Dec 16, 2025
* Jetpack settings: override module list & debugger page titles

Fixes JETPACK-1008

When registering the Module list page and the Jetpack Debugger page, we do not want the page to appear in the admin menu. This causes us to run into this issue:
- https://core.trac.wordpress.org/ticket/57579
- Automattic/jetpack#46214

```
Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in …/wp-admin/admin-header.php on line 41
```

Let's override the title when we're on those pages to avoid the deprecation warning and have a proper page title on those 2 pages.

Co-authored-by: Weston Ruter <weston@xwp.co>

* changelog

* Change hook registration to match static declaration

See Automattic/jetpack#46283 (comment)

---------

Co-authored-by: Weston Ruter <weston@xwp.co>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/20262979158

Upstream-Ref: Automattic/jetpack@cab13aa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Admin Page React-powered dashboard under the Jetpack menu Bug When a feature is broken and / or not performing as intended [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants