Skip to content

Conversation

@jeherve
Copy link
Member

@jeherve jeherve commented Apr 24, 2024

Proposed changes:

Start using the wp_admin_notice() function that was introduced in WordPress 6.4, since we now require WordPress 6.4.

=> Dev note

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

Epic: #33615

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

  • No

Testing instructions:

This wasn't easy to test, as I'm not familiar with all the notices displayed, and all the plugins. I mostly made changes to my local environment to force-trigger the notices. I would suggest doing the same with testing.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 24, 2024

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/use-wp-admin-notice 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/use-wp-admin-notice
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/use-wp-admin-notice
    

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] Ad [Feature] Contact Form [Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Feature] VideoPress A feature to help you upload and insert videos on your site. [Focus] Compatibility Ensuring our products play well with third-parties [mu wpcom Feature] Import Customizations [Package] Connection [Package] Forms [Package] Jetpack mu wpcom WordPress.com Features [Plugin] Automattic For Agencies Client [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Beta For serving live branches and the beta versions. https://github.com/automattic/jetpack-beta [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] CRM Issues about the Jetpack CRM plugin [Plugin] Debug Helper Debug Tools plugin [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Migration [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] Super Cache A fast caching plugin for WordPress. labels Apr 24, 2024
@github-actions github-actions bot added [Plugin] VaultPress [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. Docs labels Apr 24, 2024
@github-actions
Copy link
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 Team 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 🤖


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.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Beta plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Jetpack plugin:

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

  • WordPress.com Simple releases happen daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for May 7, 2024 (scheduled code freeze on May 6, 2024).

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


Debug Helper plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Backup plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Vaultpress plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Boost plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Search plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Social plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Starter Plugin plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Protect plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Videopress plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Super Cache plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Migration plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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


Automattic For agencies client plugin:

  • Next scheduled release: May 7, 2024.
  • Scheduled code freeze: April 29, 2024.

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

<p><?php echo esc_html( $message ); ?></p>
</div>
<?php
wp_admin_notice(
Copy link
Member Author

Choose a reason for hiding this comment

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

@sergeymitr I wasn't able to trigger this notice (using the Jetpack Debug helper). Do you know how those notices are triggered, by any chance?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the easiest way to trigger this using the Jetpack Debug helper would be:

  • Enable the Broken Token Utilities
  • Go to Connection Errors
Screenshot 2024-04-25 at 12 41 41
  • Create a fake verified user token error
Screenshot 2024-04-25 at 12 38 52

@jeherve jeherve requested a review from a team April 24, 2024 17:45
@jeherve jeherve added [Status] Needs Review This PR is ready for review. [Status] Needs Team Review Obsolete. Use Needs Review instead. and removed [Status] In Progress labels Apr 24, 2024
Copy link
Contributor

@fgiannar fgiannar left a comment

Choose a reason for hiding this comment

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

LGTM! Tested with most of the notices and they all display fine 🚢

@fgiannar fgiannar added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. [Status] Needs Team Review Obsolete. Use Needs Review instead. labels Apr 25, 2024
@jeherve jeherve merged commit 993a91b into trunk Apr 25, 2024
@jeherve jeherve deleted the update/use-wp-admin-notice branch April 25, 2024 13:11
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Apr 25, 2024
jeherve added a commit that referenced this pull request Oct 11, 2024
Do not use the wp_admin_notice function to display that wp-admin notice. The notice is meant to be displayed on sites running an outdated version of WordPress, and it's possible that this version is 6.3-, which does not include the wp_admin_notice function.

Internal reference: p1728598216425289-slack-C03M3KD520Zd
Related PR, where wp_admin_notice was introduced: #37051
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs [Feature] Ad [Feature] Contact Form [Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Feature] VideoPress A feature to help you upload and insert videos on your site. [Focus] Compatibility Ensuring our products play well with third-parties [mu wpcom Feature] Import Customizations [Package] Connection [Package] Forms [Package] Jetpack mu wpcom WordPress.com Features [Plugin] Automattic For Agencies Client [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Beta For serving live branches and the beta versions. https://github.com/automattic/jetpack-beta [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] CRM Issues about the Jetpack CRM plugin [Plugin] Debug Helper Debug Tools plugin [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Migration [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] Super Cache A fast caching plugin for WordPress. [Plugin] VaultPress [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Pri] Normal [Type] Janitorial

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants