Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade/Install: Verify plugin packages during bulk upgrade. #5116

Conversation

costdev
Copy link
Contributor

@costdev costdev commented Aug 30, 2023

Previously, bulk upgrades did not verify that a plugin package was compatible with the site's WordPress version or the server's PHP version. This could lead to incompatible updates being installed, causing various compatibility issues and errors.

This change implements the following checks:

  • If available, the API response's requires and requires_php values are checked for compatibility. This saves time, diskspace, memory and file operations by failing the upgrade before the package is downloaded and unpacked.
  • If the API check passes, the downloaded and unpacked package is verified using Plugin_Upgrader::check_package() to ensure a plugin file is present, and the plugin's "RequiresWP" and "RequiresPHP" headers are compatible, if present. This ensures that an API/Plugin headers mismatch does not cause an incompatible plugin to be installed.

Trac ticket: https://core.trac.wordpress.org/ticket/59198

@afragen
Copy link
Member

afragen commented Aug 30, 2023

Tested locally and works.

@costdev costdev force-pushed the verify_plugin_package_during_bulk_upgrade branch from 60c74ca to 6a34256 Compare August 30, 2023 04:21
Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Thanks @costdev for the PR. Working fine for me.

Copy link
Member

@johnbillion johnbillion left a comment

Choose a reason for hiding this comment

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

@costdev Go for it

@costdev
Copy link
Contributor Author

costdev commented Sep 6, 2023

Committed in 56525.

@costdev costdev closed this Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants