WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 6 months ago

Last modified 8 weeks ago

#49334 closed enhancement (fixed)

[Theme compatibility] WP/PHP compatibility testing for theme activation

Reported by: afragen Owned by:
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Site Health Keywords: has-patch early has-screenshots has-dev-note
Focuses: administration Cc:

Description (last modified by afragen)

See #48491 and #48507

WP/PHP compatibility testing for theme activation is the last remaining piece.

Protects from themes that are manually installed like custom or premium themes.

Tries to follow how plugin activation is tested.

Attachments (4)

49334.diff (2.9 KB) - added by afragen 7 months ago.
compatibility testing for theme activation
theme-activation-php-version.gif (1.2 MB) - added by audrasjb 6 months ago.
Testing PHP version requirement
theme-activation-wordpress-version.gif (717.7 KB) - added by audrasjb 6 months ago.
Testing WP version requirement
49334.1.diff (2.8 KB) - added by audrasjb 6 months ago.
Alternative patch: remove <strong>Errors:</strong> from wp_die() as users already know we have an error.

Download all attachments as: .zip

Change History (20)

#1 @afragen
8 months ago

  • Component changed from Upgrade/Install to Site Health

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


8 months ago

#3 @afragen
8 months ago

Pinging @pento as the Upgrade/Install maintainer.

I'm having trouble getting into the data element in the script tag so that I can make the compatibility tests. Any pointers would be appreciated. Thanks.

#4 @afragen
7 months ago

  • Description modified (diff)
  • Keywords has-patch added; needs-patch removed
  • Summary changed from [Theme compatibility] WP/PHP compatibility testing for theme installation to [Theme compatibility] WP/PHP compatibility testing for theme activation

@afragen
7 months ago

compatibility testing for theme activation

#5 @afragen
7 months ago

  • Keywords early dev-feedback added
  • Milestone changed from Awaiting Review to 5.5

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


7 months ago

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


6 months ago

@audrasjb
6 months ago

Testing PHP version requirement

@audrasjb
6 months ago

Testing WP version requirement

@audrasjb
6 months ago

Alternative patch: remove <strong>Errors:</strong> from wp_die() as users already know we have an error.

#8 @audrasjb
6 months ago

  • Keywords has-screenshots added; dev-feedback removed

Hi there,

I tested this patch and it works fine to me. Let's add a commit keyword as it need to be committed early.

I also added an alternative patch which remove <strong>Errors:</strong> from wp_die() as users may already know there is an error. See ticket #47656 also slated to milestone 5.5.

#9 @audrasjb
6 months ago

  • Keywords commit added

#10 @afragen
6 months ago

The wp_die message should be consistent with the same message for plugin incompatibility r44978

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

#11 @audrasjb
6 months ago

Yep then let’s commit 49334.diff as it and fix the issue with error messages in #47656 🚀

#12 @afragen
6 months ago

I like that idea.

#13 @SergeyBiryukov
6 months ago

In 47573:

Themes: Block theme activation if it requires a higher version of PHP or WordPress.

Introduce validate_theme_requirements() for validating a theme's WordPress and PHP version requirements.

Follow-up to [44978] and [45546] for plugins.

Props afragen, audrasjb, SergeyBiryukov.
See #49334.

#14 @SergeyBiryukov
6 months ago

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

In 47574:

Plugins: Simplify the logic of validate_plugin_requirements(), update documentation.

This updates the function for consistency with validate_theme_requirements().

Follow-up to [44978], [45546], [47573].

Fixes #43992.

#15 @desrosj
3 months ago

  • Keywords needs-dev-note added; commit removed

#16 @justinahinon
8 weeks ago

  • Keywords has-dev-note added; needs-dev-note removed
Note: See TracTickets for help on using tickets.