Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#45986 closed defect (bug) (fixed)

Update the update-php URL and add annotation

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

Description

Update previously committed instances of https://wordpress.org/support/update-php to utilize the new wp_get_update_php_url() introduced in r44476

Attachments (5)

45986.diff (2.7 KB) - added by afragen 6 years ago.
Use wp_get_update_php_url()
45986.2.diff (5.5 KB) - added by afragen 6 years ago.
added wp_get_update_php_annotation()
45986.3.diff (5.5 KB) - added by afragen 6 years ago.
changed function name to wp_update_php_annotation() as it doesn't return a value so get is incorrect
45986.4.diff (5.5 KB) - added by afragen 6 years ago.
Updated @return docBlock, I hope I got this one right
45986.5.diff (6.3 KB) - added by flixos90 6 years ago.

Download all attachments as: .zip

Change History (13)

@afragen
6 years ago

Use wp_get_update_php_url()

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


6 years ago

@afragen
6 years ago

added wp_get_update_php_annotation()

@afragen
6 years ago

changed function name to wp_update_php_annotation() as it doesn't return a value so get is incorrect

@afragen
6 years ago

Updated @return docBlock, I hope I got this one right

#2 @afragen
6 years ago

  • Keywords dev-feedback added

#3 @afragen
6 years ago

  • Summary changed from Update the update-php URL to Update the update-php URL and add annotation

#4 @pento
6 years ago

  • Milestone changed from Awaiting Review to 5.1

Adding to 5.1 milestone for consideration.

#5 @flixos90
6 years ago

  • Owner set to flixos90
  • Status changed from assigned to reviewing

@flixos90
6 years ago

#6 @flixos90
6 years ago

  • Keywords dev-feedback removed

45986.5.diff enhances the previous patches in the following ways:

  • Only show the information about updating PHP if current_user_can( 'update_php' ). This was missed in the original ticket.
  • In wp-admin/includes/plugin-install.php, ensure that calling wp_update_php_annotation() does not cause invalid HTML markup with nested p tags.
  • In wp-admin/includes/plugin-install.php, get rid of the "so unfortunately you cannot install it" part of the message. This makes it consistent with the message about the WordPress version and prevents inaccuracies, as this information may also be displayed when the plugin is already installed.

#7 @flixos90
6 years ago

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

In 44627:

Plugins: Use centralized API to display information about updating PHP when a plugin requires a higher version.

This changeset uses the API functions introduced in [44476] to link to the resource about updating PHP when highlighting a plugin's required PHP version is not met. It furthermore expands them, introducing a new wp_update_php_annotation() function that prints the markup to indicate that the default URL has been altered by the web host, allowing it to be reused universally.

Furthermore, this changeset adds missing update_php capability checks before displaying the information about updating PHP.

Props afragen.
Fixes #45986. See #43986, #45686.

#8 @spacedmonkey
6 years ago

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