WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 6 days ago

#48491 reviewing enhancement

[Theme compatibility] WP/PHP compatibility tests for single site theme updates/activation

Reported by: afragen Owned by: SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Site Health Keywords: has-patch needs-testing dev-feedback early servehappy needs-copy-review has-screenshots
Focuses: administration Cc:

Description

As part of the WP/PHP version compatibility testing for themes, this ticket is directed towards theme updating and activation on a single site installation.

If the theme is not compatible with the currently running WP or PHP version, updating will be blocked. This also includes blocking theme activation for incompatible themes.

This addresses the themes.php and upgrade-core.php pages.

Attachments (14)

48491.diff (13.2 KB) - added by afragen 5 months ago.
screenshot_02.png (149.1 KB) - added by afragen 5 months ago.
screenshot_04.png (201.2 KB) - added by afragen 5 months ago.
screenshot_01.png (49.8 KB) - added by afragen 5 months ago.
48491.2.diff (13.2 KB) - added by afragen 5 months ago.
Precedence: API > readme.txt > style.css
48491.3.diff (14.2 KB) - added by afragen 5 months ago.
Disable 'Live Preview' button
48491.4.patch (11.1 KB) - added by afragen 5 months ago.
removed changes to class-wp-theme.php, now in #48515
48491.4.diff (10.8 KB) - added by jorbin 7 weeks ago.
customizer-popup.png (1.0 MB) - added by afragen 2 weeks ago.
customizer-activate.png (42.4 KB) - added by afragen 2 weeks ago.
customizer-browser.png (471.4 KB) - added by afragen 2 weeks ago.
48491.5.diff (19.2 KB) - added by afragen 2 weeks ago.
add Customizer part
48491.6.diff (19.6 KB) - added by afragen 13 days ago.
minor updates to patch
48491.7.diff (19.7 KB) - added by afragen 12 days ago.
update 'Activate & Publish' back to button type

Change History (41)

#1 @afragen
5 months ago

Still to do are tickets/patches for installing themes and multisite.

#2 @afragen
5 months ago

Related: #44592

#3 @SergeyBiryukov
5 months ago

  • Milestone changed from Awaiting Review to 5.4

@afragen
5 months ago

#4 @afragen
5 months ago

The screenshots screenshot_02.png, screenshot_04.png, and screenshot_01.png show an incompatible update.

I manually set the PHP requirement so it would fail.

Last edited 5 months ago by afragen (previous) (diff)

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


5 months ago

@afragen
5 months ago

Precedence: API > readme.txt > style.css

#6 @afragen
5 months ago

Hmm, I think I need to deactivate the Live Preview button as it can be used to activate.

#7 @afragen
5 months ago

It is still possible, using the Customizer, to see updates and activate a non-compliant theme. I will need help with fixing this component.

#8 @afragen
5 months ago

  • Keywords has-screenshots added

@afragen
5 months ago

Disable 'Live Preview' button

#9 @afragen
5 months ago

It is my plan to clean up this a bit. My intent is to remove the changes to WP_Theme and put them in their own ticket/patch. This patch would be the first patch needed to be reviewed/committed as it will be required by all these subsequent tickets/patches.

That way this ticket doesn't need to be committed before any of the others. Hopefully this simplifies the testing.

@afragen
5 months ago

removed changes to class-wp-theme.php, now in #48515

#10 @SergeyBiryukov
4 months ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#11 @sathyapulse
4 months ago

@afragen I am not able to apply the patch in my local environment. Could you please regenerate the patch?

#12 @afragen
4 months ago

@sathyapulse it's likely because the patch was created against core.git.wordpress.org, not develop.git.wordpress.org.

#13 @afragen
4 months ago

@sathyapulse I've tested the patch again and it is applies cleanly on trunk using npm run grunt patch:48491

It might depend upon how your local environment is set up.

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


3 months ago

This ticket was mentioned in Slack in #core-site-health by carike. View the logs.


2 months ago

This ticket was mentioned in Slack in #core-site-health by clorith. View the logs.


2 months ago

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


8 weeks ago

#18 @afragen
7 weeks ago

Pinging @jorbin per our discussion at WCPHX.

#19 @SergeyBiryukov
7 weeks ago

Just noting this is on my list to commit today (along with #48507), more eyes definitely welcome though :)

#20 @jorbin
7 weeks ago

I'm taking a look now, but that doesn't need to block merging by any means

@jorbin
7 weeks ago

#21 @jorbin
7 weeks ago

Uploaded update that applies cleanly, still testing

#22 @jorbin
7 weeks ago

I think this is going to need the customizer piece in order to be complete and land in trunk.

Based on timing, I would suggest punting and work continuing so it can be ready for 5.5

#23 @TimothyBlynJacobs
7 weeks ago

For the customizer stuff, it looks like this data can be added in the wp_ajax_query_themes() PHP function. And adding a modification like this in the tmpl-theme-preview template in wp-admin/theme-install.php.

<# if ( data.installed ) { #>
    <a class="button button-primary activate" href="{{ data.activate_url }}"><?php _e( 'Activate' ); ?></a>
<# } else if ( data.compatible_php ) { #>
    <a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
<# } else { #>
    <a href="{{ data.install_url }}" class="button button-primary theme-install disabled" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
<# } #>

#24 @Clorith
7 weeks ago

  • Milestone changed from 5.4 to 5.5

Moving this to the 5.5 milestone, as it's marked early, and we are one day away from beta for 5.4

#25 @afragen
2 weeks ago

Latest patch 48491.5.diff adds compatibility testing when in the Customizer.

To test simply change the Requires PHP header of the style.css of an installed theme. You can test the update part by also decrementing the version number too.

@afragen
2 weeks ago

add Customizer part

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


13 days ago

@afragen
13 days ago

minor updates to patch

@afragen
12 days ago

update 'Activate & Publish' back to button type

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


6 days ago

Note: See TracTickets for help on using tickets.