Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#46074 closed enhancement (fixed)

Provide way for hosts to create a correctly labeled button or link to directly upgrade PHP

Reported by: kirasong's profile kirasong Owned by: afragen's profile afragen
Milestone: 5.1.1 Priority: normal
Severity: normal Version: 5.1
Component: Site Health Keywords: dev-reviewed servehappy has-patch has-screenshots
Focuses: Cc:

Description

At the moment, it's straightforward to change the link for more information for a user within the hosting upgrade metabox (see: make/core), but if hosts want to link users to immediately upgrade, the text "Learn more..." isn't appropriate for that action.

I think WordPress should either provide a way to do so, or a documented best practice to do so.

See this P2 comment and feedback in Slack for previous context.

Attachments (7)

46074.diff (1.7 KB) - added by afragen 6 years ago.
screenshot_01.png (50.7 KB) - added by afragen 6 years ago.
screenshot_02.png (65.4 KB) - added by afragen 6 years ago.
46074.2.diff (1.7 KB) - added by afragen 6 years ago.
updated @since
46074.3.diff (2.3 KB) - added by desrosj 6 years ago.
46074.4.diff (2.3 KB) - added by lukecarbis 6 years ago.
46074.5.diff (528 bytes) - added by desrosj 6 years ago.
Add missed @since annotation to the 5.1 branch.

Download all attachments as: .zip

Change History (41)

This ticket was mentioned in Slack in #hosting-community by mike. View the logs.


6 years ago

This ticket was mentioned in Slack in #core-php by mike. View the logs.


6 years ago

#3 @kirasong
6 years ago

  • Keywords servehappy added

This ticket was mentioned in Slack in #core-php by aaroncampbell. View the logs.


6 years ago

This ticket was mentioned in Slack in #hosting-community by mike. View the logs.


6 years ago

#6 @pento
6 years ago

  • Milestone changed from Awaiting Review to 5.1.1

Let's look at this for 5.1.1.

@afragen
6 years ago

@afragen
6 years ago

@afragen
6 years ago

#7 @afragen
6 years ago

  • Keywords has-patch dev-feedback has-screenshots added; needs-patch removed

At WordCamp Phoenix Contributor Day @aaroncampbell and I came up with this as a solution.

An environmental variable and/or a filter may be used to customize this button link, similarly to the customizable link for information on updating PHP in r44476

This ticket was mentioned in Slack in #core by lukecarbis. View the logs.


6 years ago

#9 @lukecarbis
6 years ago

  • Owner set to afragen
  • Status changed from new to assigned

This ticket was mentioned in Slack in #core by afragen. View the logs.


6 years ago

This ticket was mentioned in Slack in #core by lukecarbis. View the logs.


6 years ago

@afragen
6 years ago

updated @since

This ticket was mentioned in Slack in #core by afragen. View the logs.


6 years ago

@desrosj
6 years ago

#13 @desrosj
6 years ago

46074.2.diff worked great!

In 46074.3.diff, I pulled the code that determines the URL into a separate function. This allows the URL to be retrieved and used in different contexts without the default button. The main use case I had in mind for this was a host filtering the information page URL to one within the WordPress admin with their own branding. They could then output the URL into a call to action on that page.

This ticket was mentioned in Slack in #core-php by desrosj. View the logs.


6 years ago

This ticket was mentioned in Slack in #core by desrosj. View the logs.


6 years ago

#16 @afragen
6 years ago

Patch looks good.

#17 @pbiron
6 years ago

  • Keywords commit added; dev-feedback removed

#18 @SergeyBiryukov
6 years ago

Two minor notes on 46074.3.diff:

  • "Update your site PHP" label looks a bit strange to me, what about just "Update PHP"?
  • Having two primary buttons next to each other also looks a bit weird. Maybe "Learn more" should not have the button-primary class if there's a direct PHP update URL available?

#19 @afragen
6 years ago

@SergeyBiryukov also consider the situation where the host may have another link for Learn more. $46044

Version 1, edited 6 years ago by afragen (previous) (next) (diff)

@lukecarbis
6 years ago

#20 @lukecarbis
6 years ago

This diff includes the suggested text change to "Update PHP". Other than that, it's identical to the previous one.

#21 @desrosj
6 years ago

This looks good. Let's commit it and we can iterate on the button styles later.

#22 @desrosj
6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 44814:

General: Add a way to specify a direct link for a user to update PHP.

A direct URL to where a user can update PHP for their website can now be specified in one of two ways:

  • Defining the WP_DIRECT_UPDATE_PHP_URL environment variable.
  • Returning a URL to the wp_direct_php_update_url filter.

When a URL is specified, an additional “Update PHP” button will be displayed at the bottom of the Core dashboard widget informing administrators that their site is running an outdated version of PHP (see [42832]).

Fixes #46074.
Props afragen, desrosj, lukecarbis.

#23 @desrosj
6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening to backport.

#24 @desrosj
6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 44815:

General: Add a way to specify a direct link for a user to update PHP.

A direct URL to where a user can update PHP for their website can now be specified in one of two ways:

  • Defining the WP_DIRECT_UPDATE_PHP_URL environment variable.
  • Returning a URL to the wp_direct_php_update_url filter.

When a URL is specified, an additional “Update PHP” button will be displayed at the bottom of the Core dashboard widget informing administrators that their site is running an outdated version of PHP (see [42832]).

Merges [44814] to the 5.1 branch.

Fixes #46074.
Props afragen, desrosj, lukecarbis.

#25 @birgire
6 years ago

I noticed that @since 5.1.1 is missing from the doc block of the wp_get_direct_php_update_url() function in changeset:44814 and changeset:44815.

#26 @desrosj
6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Thanks, @birgire! I will add that now.

#27 @desrosj
6 years ago

In 44829:

General: Add missing @since annotation for wp_get_direct_php_update_url().

Missed in [44815].

Props birgire.
See #46074.

@desrosj
6 years ago

Add missed @since annotation to the 5.1 branch.

#28 @desrosj
6 years ago

  • Keywords needs-dev-review added; commit removed

This ticket was mentioned in Slack in #core by desrosj. View the logs.


6 years ago

#30 @SergeyBiryukov
6 years ago

  • Keywords dev-reviewed added; needs-dev-review removed

46074.5.diff looks good to me for backporting.

#31 @jorbin
6 years ago

In 44831:

General: Add missing @since annotation for wp_get_direct_php_update_url().

Backports [44829] to 5.1 branch. Dev-reviewed by desrosj and SergeyBiryukov.

Missed in [44815].

Props birgire.
See #46074.

#32 @pbiron
6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

This ticket was mentioned in Slack in #hosting-community by j-falk. View the logs.


6 years ago

#34 @spacedmonkey
5 years ago

  • Component changed from General to Site Health
Note: See TracTickets for help on using tickets.