8000 269 show redesigned admin wide notices in the new general page by leonidasmi · Pull Request #21644 · Yoast/wordpress-seo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

269 show redesigned admin wide notices in the new general page #21644

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

Conversation

leonidasmi
Copy link
Contributor
@leonidasmi leonidasmi commented Sep 18, 2024

Context

Summary

This PR can be summarized in the following changelog entry:

  • Shows admin-wide Yoast notices in the new dashboard
  • Stops showing all other notices in the new Dashboard

Relevant technical choices:

  • Decided to move the existing notices in JS, rather than localizing them in PHP.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

For the Premium Deactivated Notice:

  • Install Premium but don't activate it.
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that after you dismiss the notice and refresh, it no longer shows
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard.

For the FTC Notice:

  • In a fresh install (or after clicking the Reset Options in the Yoast Test helper).
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that after you dismiss the notice and refresh, it no longer shows
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard.

For the Webinar notice:

  • In a fresh install (or after you have cleared all _yoast_alerts_dismissed rows from the usermeta db table).
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that after you dismiss the notice and refresh, it no longer shows
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard.

For the Database Error Notice (NEW TITLE):

  • To trigger the notice, go to src\integrations\admin\migration-error-integration.php and comment out the following code in register_hooks:
		if ( $this->migration_status->get_error( 'free' ) === false ) {
			return;
		}
  • Also in src\presenters\admin\migration-error-presenter.php, turn the $debug_info variable into this:
		$debug_info = \sprintf(
			'<details><summary>%1$s</summary><p>%2$s</p></details>',
			\esc_html__( 'Show debug information', 'wordpress-seo' ),
			\esc_html( 'this is the error' )
		);
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also check in other places, that the notice shows like it showed before, but this time with the added title:
    image

For the Missing SPL Notice (NEW TITLE):

  • Go to the dashboard page
  • In wp-seo-main.php turn if ( ! $spl_autoload_exists ) { into if ( true ) { and refresh the page
  • Confirm that you get the following notice in the new dashboard:
    image
    (note that this will automatically deactivate Yoast SEO)
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard or anywhere in the admin, but with that new title in place.

For the Incomplete Install Notice (NEW TITLE):

  • Go to the dashboard page
  • In wp-seo-main.php before the if ( is_readable( $yoast_autoload_file ) ) { line, add a add_action( 'admin_init', 'yoast_wpseo_missing_autoload', 1 ); 8000 line and refresh the page
  • Confirm that you get the following notice in the new dashboard:
    image
    (note that this will automatically deactivate Yoast SEO)
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard or anywhere in the admin, but with that new title in place.

For Premium's Needs Upgrade notice:

  • Install Premium
  • In Premium's src\integrations\admin\update-premium-notification.php turn the if ( $this->version_helper->is_free_upgraded() && $this->version_helper->is_premium_update_available() ) { line into if ( true ) { to trigger the notice
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that after you dismiss the notice and refresh, it no longer shows
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard.

For Premium's Needs Latest Yoast notice (NEW TITLE):

  • Install Premium
  • In Premium's src\addon-installer.php turn the MINIMUM_YOAST_SEO_VERSION value into a larger Yoast version, eg. 33.3
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that clicking the button installs the Yoast plugin (although you will probably get a The plugin is at the latest version message)
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but this time with the added title.

For Local's Needs Yoast SEO Notice (NEW TITLE):

  • Install Local
  • In Premium's local-seo.php turn the if ( ! defined( 'WPSEO_VERSION' ) ) { line into if ( true ) { to trigger the notice
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also check in other places, that the notice shows like it showed before, but this time with the added title:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but this time with the added title.

For Local's Needs Organization name and logo Notice (NEW TITLE):

  • Install Local
  • Don't set organization name or logo
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also check in other places, that the notice shows like it showed before, but this time with the added title:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but this time with the added title.

For Local's Needs Latest Yoast notice (NEW TITLE):

  • Install Local
  • In Local's local-seo.php turn the if ( version_compare( WPSEO_VERSION, '22.0-RC0', '<' ) ) { line into a larger Yoast version, eg. 33.3
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

For News's Needs Upgraded WordPress notice (NEW TITLE):

  • Install News SEO
  • In News's classes\wpseo-news.php turn the if ( version_compare( $wp_version, '6.4', '<' ) ) { line into if ( true ) {
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

For News's Needs Yoast SEO notice (NEW TITLE):

  • Install News SEO
  • In Local's classes\wpseo-news.php turn the if ( $wordpress_seo_version === false ) { line into if ( true ) {
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

For News's Needs Upgraded Yoast SEO notice (NEW TITLE):

  • Install News SEO
  • In News's classes\wpseo-news.php turn the if ( version_compare( $wordpress_seo_version, '22.2-RC1', '<' ) ) { line into if ( true ) {
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

For ACF content analysis's Needs ACF notice (NEW TITLE):

  • Install ACF content analysis without installing ACF
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

For ACF content analysis's Needs Yoast notice (NEW TITLE):

  • In inc\dependencies\dependency-yoast-seo.php replace both if ( ! defined( 'WPSEO_VERSION' ) ) { lines with if ( true ) {
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

For ACF content analysis's Needs Upgraded Yoast notice (NEW TITLE):

  • In inc\dependencies\dependency-yoast-seo.php replace both if ( ! $this->has_required_version() ) { lines with if ( true ) {
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

For ACF content analysis's could not be loaded notice (NEW TITLE):

  • In yoast-acf-analysis.php replace if ( ! class_exists( 'AC_Yoast_SEO_ACF_Content_Analysis' ) ) { with if ( true ) {
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

For Woo SEO's Needs Upgraded WordPress notice (NEW TITLE):

  • Install Woo SEO
  • In Woo SEO's classes\woocommerce-dependencies.php turn the if ( ! version_compare( $wp_version, '6.4', '>=' ) ) { line into if ( true ) {
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

For Woo SEO's Needs WooCommerce notice (NEW TITLE):

  • Install Woo SEO
  • In Woo SEO's classes\woocommerce-dependencies.php turn the if ( ! $this->check_woocommerce_exists() ) { line into if ( true ) {
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

For Woo SEO's Needs Yoast SEO notice (NEW TITLE):

  • Install Woo SEO
  • In Woo SEO's classes\woocommerce-dependencies.php turn the if ( ! $wordpress_seo_version ) { line into if ( true ) {
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

For Woo SEO's Needs Upgraded Yoast SEO notice (NEW TITLE):

  • Install Woo SEO
  • In Woo SEO's classes\woocommerce-dependencies.php turn the if ( ! version_compare( $wordpress_seo_version, '23.5-RC0', '>=' ) ) { line into if ( true ) {
  • Confirm that you get the following notice in the new dashboard:
    image
  • Also confirm that without the feature flag, the notice shows as before in the old dashboard, but with the new title in place:
    image

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes https://github.com/Yoast/reserved-tasks/issues/269

@coveralls
Copy link
coveralls commented Sep 20, 2024

Pull Request Test Coverage Report for Build 18e6ca5b50de7a4e7ebaa982170ac8f2c1ca6859

Details

  • 23 of 57 (40.35%) changed or added relevant lines in 8 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 54.475%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/dashboard/store/index.js 0 3 0.0%
packages/js/src/dashboard/tailwind-components/notice.js 0 3 0.0%
packages/js/src/dashboard/app.js 0 4 0.0%
wp-seo-main.php 0 4 0.0%
packages/js/src/helpers/migrateNotices.js 0 20 0.0%
Files with Coverage Reduction New Missed Lines %
packages/js/src/dashboard/app.js 1 0.0%
Totals Coverage Status
Change from base Build 32b600b34fc231b69fc8fbfa337f57bbd2d09c3b: -0.03%
Covered Lines: 29546
Relevant Lines: 54500

💛 - Coveralls

@leonidasmi leonidasmi force-pushed the 269-show-redesigned-admin-wide-notices-in-the-new-general-page branch from 4ca272a to e8ed22b Compare September 24, 2024 07:51
@leonidasmi leonidasmi added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Sep 25, 2024
@leonidasmi leonidasmi marked this pull request as ready for review September 25, 2024 07:08
@leonidasmi leonidasmi added the UI change PRs that result in a change in the UI label Sep 25, 2024
6D40
Copy link
Member
@igorschoester igorschoester left a comment

Choose a reason for hiding this comment

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

CR 🏗️

I have to admire the seemingly smooth approach you took!
Though, for the non-Yoast ones, I wish there was a PHP part that would filter them out instead of just hiding them like this? Might not be worth the effort though.

Copy link
Member
@igorschoester igorschoester left a comment

Choose a reason for hiding this comment

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

CR && AT ✅

@igorschoester igorschoester added this to the 23.7 milestone Oct 1, 2024
@igorschoester igorschoester merged commit dc76a14 into trunk Oct 1, 2024
34 checks passed
@igorschoester igorschoester deleted the 269-show-redesigned-admin-wide-notices-in-the-new-general-page branch October 1, 2024 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog UI change PRs that result in a change in the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0