Automattic / studio

Studio by WordPress.com, a free desktop app that helps developers streamline their local WordPress development workflow.
https://developer.wordpress.com/studio/
GNU General Public License v2.0
172 stars 17 forks source link

Pick right PHP version for sites created before introducing the PHP selector #262

Closed fluiddot closed 3 months ago

fluiddot commented 3 months ago

Related to https://github.com/Automattic/studio/pull/240#issuecomment-2173667408 and https://github.com/Automattic/studio/pull/225.

Proposed Changes

Testing Instructions

New sites

  1. Create a new site.
  2. Go to the Settings tab.
  3. Observe that the PHP version is 8.1.
  4. Open WP admin and navigate to wp-admin/site-health.php?tab=debug.
  5. Open the Server section.
  6. Observe that the PHP version is 8.1.

Old sites

  1. Install a version of the Studio app before changes from https://github.com/Automattic/studio/pull/225 were applied.
    • Alternatively, you can edit the file ~/Library/Application\ Support/Studio/appdata-v1.json and remove phpVersion property from sites.
  2. Create a new site.
  3. Build/install a version with the changes from this PR.
  4. Select the previously created site.
  5. Go to the Settings tab.
  6. Observe that its PHP version is 8.0.
  7. Edit the PHP version.
  8. Observe that in the "Edit PHP version" modal, the version 8.0 is selected.

Pre-merge Checklist