wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

Use WHIP to deprecate PHP 7.2 and 7.3

Open enricobattocchi opened this issue 1 year ago • 2 comments

Context

  • We want to throw a notice to admins to notify we are dropping compatibility with PHP < 7.4. The date is tentatively set to July 1st, 2024, pending decisions.

Summary

This PR can be summarized in the following changelog entry:

  • Introduces a notice on the WordPress dashboard and the Yoast SEO dashboard to let users know we are dropping support for PHP < 7.4 starting July 1st, 2024.

Relevant technical choices:

  • We still have the class from the previous iteration as deprecated, so to avoid any conflict/confusion I introduced a new class with a slightly different name

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Run grunt artifact to create a zip. This makes it way easier to test on different envs.

  • Find a way to have WP running on PHP 7.2 and 7.3.

    • e.g. I was able to have a Local by Flywheel site on PHP 7.3. I'm on Linux, I know other people could not...
    • otherwise there is InstaWP which seems to support PHP back to 5.6
    • Switching the docker env to an older version doesn't seem to work
    • you can also hack the requirement: make sure you are on PHP 7.4, change the line 139 of src/integrations/admin/unsupported-php-version-notice.php from
    $checker->addRequirement( VersionRequirement::fromCompareString( 'php', '>=7.4' ) );
    

    to

    $checker->addRequirement( VersionRequirement::fromCompareString( 'php', '>=8.0' ) );
    

    (you can do this directly after having uploaded the artifact)

  • upload the artifact

  • activate Yoast SEO

  • see that you get a notice on the WP dashboard and in the Yoast SEO General page: Screenshot 2023-12-28 at 16-09-56 Dashboard ‹ development-symlink — WordPress

  • Click on "Remind me in 4 weeks"

    • you should be redirected to the WP Dashboard and the notice should be hidden
  • inspect the options table and set the whip_dismiss_timestamp to at least four weeks ago, e.g 1663929217.

  • see that you get the notice again on the WP dashboard and in the Yoast SEO General page.

  • Upload the artifact to a 7.4+ env and check that you don't see any notice.

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 (Block/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.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

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.

Quality assurance

  • [x] 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

  • [x] 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/roadmap/issues/398

enricobattocchi avatar Dec 28 '23 12:12 enricobattocchi

composer.lock

Package changes

Package Operation From To About
yoast/whip add - 2.0.0 view code - License: GNU General Public License v3.0 or later

Settings · Docs · Powered by Private Packagist

private-packagist[bot] avatar Dec 28 '23 12:12 private-packagist[bot]

Pull Request Test Coverage Report for Build 8309518f9c4d9613a2c44860ab7d72cb1f844615

Details

  • 0 of 38 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 52.566%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/integrations/admin/unsupported-php-version-notice.php 0 38 0.0%
<!-- Total: 0 38
Totals Coverage Status
Change from base Build d11361829804fb6ccd695e62d0583c6a22b8a4df: 0.4%
Covered Lines: 28352
Relevant Lines: 54400

💛 - Coveralls

coveralls avatar Dec 28 '23 12:12 coveralls