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

Add upgrade routine to remove WordPress upgrade notice #14036

Merged
merged 1 commit into from
Dec 16, 2019

Conversation

Djennez
Copy link
Member

@Djennez Djennez commented Dec 11, 2019

Summary

This PR can be summarized in the following changelog entry:

  • Removes the "Upgrade WordPress to the most recent version" notification.

Relevant technical choices:

  • The function that adds or removes this notification was removed in 12.5 with no upgrade routine to clean up the database. This made this a persistent message until dismissed or the plugin was deactivated and reactivated.
  • Added a notification removal to the 12.8 upgrade routine.

Test instructions

This PR can be tested by following these steps:

This test is for the RC only. Testing this as a branch requires altering the version number in-code.

  1. Install this RC and the Yoast Test Helper
  2. Add the following database entry to the wp_usermeta table:
  • umeta_id: the next one
  • user_id: 1 (assuming you are the admin user)
  • meta_key: wp_yoast_notifications
  • meta_value:
a:1:{i:0;a:2:{s:7:"message";s:817:"<strong>Upgrade WordPress to the most recent version</strong><br/>We’ve noticed that you’re not on the latest WordPress version, which might cause an issue soon. Yoast (for reasons of security and stability) only supports the current and previous version of WordPress. When the next version of WordPress comes out, that means that we will support WordPress 5.2 and 5.3. This means you will not get any updates to Yoast SEO until you update your WordPress, so please make sure to upgrade to the latest WordPress version soon!<br/><br/><br/><br/>Read <a href="https://yoa.st/old-wp-support?php_version=7.3&platform=wordpress&platform_version=5.2.4&software=free&software_version=11.4&days_active=0-1" target="_blank" rel="">this post for more information about why we’re not supporting older versions.</a>";s:7:"options";a:9:{s:4:"type";s:5:"error";s:2:"id";s:31:"wpseo-dismiss-wordpress-upgrade";s:5:"nonce";N;s:8:"priority";d:0.5;s:9:"data_json";a:0:{}s:13:"dismissal_key";N;s:12:"capabilities";a:1:{i:0;s:20:"wpseo_manage_options";}s:16:"capability_check";s:3:"all";s:14:"yoast_branding";b:0;}}}
  1. Confirm you are seeing the WordPress-upgrade notice in the notification center.
  2. In the Yoast Test Helper set the version to 12.7 so that the upgrade routine from 12.7 to 12.8 runs
  3. Observe that the notification is gone.

UI changes

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

Documentation

  • I have written documentation for this change.

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended

Fixes #13861

@Djennez Djennez added the changelog: other Needs to be included in the 'Other' category in the changelog label Dec 11, 2019
@Djennez
Copy link
Member Author

Djennez commented Dec 11, 2019

PS: it doesn't sit right with me that there are 2 identical calls now with different IDs. Is there a way to write this more efficient? If so, I'd like to know :)

@IreneStr IreneStr added this to the 12.8 milestone Dec 16, 2019
@IreneStr IreneStr merged commit 2142e03 into trunk Dec 16, 2019
@IreneStr IreneStr deleted the 13861_remove-wordpress-upgrade-notice branch December 16, 2019 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: other Needs to be included in the 'Other' category in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On WP 5.3 getting the Upgrade WordPress to the most recent version notice
2 participants