Skip to content

Conversation

@fushar
Copy link
Contributor

@fushar fushar commented May 23, 2025

Part of DOTCOM-13239

Proposed Changes

This PR implements Settings -> PHP as follows.

Simple sites

In simple sites, we don't know the PHP version, and we don't advertise it. See discussion: p1747972441625309-slack-C08JZTRS6NA

The upsell will be handled separately as DOTCOM-13292.

image

Atomic sites

We show a warning badge if the version is not the recommended one.



image

While working on it, I found that the "Select item" placeholder option in the <select> is still selectable... filed DOTCOM-13298.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented May 23, 2025

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug settings-php on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented May 23, 2025

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~257 bytes added 📈 [gzipped])

name                    parsed_size           gzip_size
entry-dashboard-dotcom      +2588 B  (+0.2%)     +311 B  (+0.1%)
entry-dashboard-a4a         +2588 B  (+0.2%)     +311 B  (+0.1%)
entry-subscriptions          +357 B  (+0.0%)      +94 B  (+0.0%)
entry-stepper                +357 B  (+0.0%)      +93 B  (+0.0%)
entry-reauth-required        +357 B  (+0.0%)      +94 B  (+0.0%)
entry-main                   +357 B  (+0.0%)      +90 B  (+0.0%)
entry-domains-landing        +357 B  (+0.1%)      +94 B  (+0.0%)
entry-browsehappy            +357 B  (+0.2%)      +94 B  (+0.2%)
entry-login                  +227 B  (+0.0%)      +45 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~18 bytes removed 📉 [gzipped])

name                          parsed_size           gzip_size
staging-site                       -141 B  (-0.0%)      -31 B  (-0.0%)
async-step-unified-plans           -141 B  (-0.0%)      -13 B  (-0.0%)
a8c-for-agencies-sites             -141 B  (-0.0%)       -9 B  (-0.0%)
a8c-for-agencies-overview          -141 B  (-0.0%)       -9 B  (-0.0%)
a8c-for-agencies-migrations        -141 B  (-0.0%)       -9 B  (-0.0%)
a8c-for-agencies-marketplace       -141 B  (-0.0%)       -9 B  (-0.0%)
site-settings                      +107 B  (+0.0%)      +10 B  (+0.0%)
hosting                            +107 B  (+0.0%)       +3 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@fushar fushar marked this pull request as ready for review May 23, 2025 15:03
@fushar fushar requested review from a team and youknowriad as code owners May 23, 2025 15:03
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 23, 2025
@fushar fushar self-assigned this May 23, 2025
Copy link
Contributor

@taipeicoder taipeicoder left a comment

Choose a reason for hiding this comment

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

Needs rebasing, but otherwise looks good to me.

@StevenDufresne
Copy link
Contributor

StevenDufresne commented May 25, 2025

Should we make sure users can't submit the "Select item" option?

Nevermind, missed the issue linked in description.

fields: [ 'version' ],
};

const isDirty = formData.version !== version;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Would it make sense to name version to currentVersion for better readability, and in case formData.version is deconstructed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, done!

@fushar fushar merged commit 0a06305 into trunk May 26, 2025
11 checks passed
@fushar fushar deleted the settings-php branch May 26, 2025 03:26
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 26, 2025
loader: async ( { params: { siteSlug } } ) => {
const site = await queryClient.ensureQueryData( siteQuery( siteSlug ) );
if ( canUpdatePHPVersion( site ) ) {
return await queryClient.ensureQueryData( sitePHPVersionQuery( siteSlug ) );
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: no need to return anything

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressing it in #103702

} );
};

const renderForm = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this an inline function? I've always found these weird. Why not render it in canUpdate ? ... : ...? Or make a new component if it needs to be reusable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's just a matter of taste; I just find it's easier to read / follow instead of a giant ternary :)

Maybe @taipeicoder can update it when you implement the upsell 🙈

Copy link
Contributor

Choose a reason for hiding this comment

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

It's fine, I just don't often see it I guess :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressing it in #103702

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants