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

Add a check to ensure we have a valid PHP version before loading plugin functionality and output an admin notice if needed #226

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

kmgalanakis
Copy link
Contributor

Description of the Change

In this PR, I'm adding a check for the minimum required PHP version before attempting to load the plugin files. If the condition is not met an admin notice is displayed and the plugin files are not loaded.

Closes #220

How to test the Change

  • To see the admin notice and have the plugin functionality not loaded, try to load the plugin on a site with PHP version lower that 7.4.

Changelog Entry

Added - Check for minimum required PHP version before loading the plugin

Credits

Props @kmgalanakis

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.
    c

…in functionality and output an admin notice if needed
@kmgalanakis kmgalanakis self-assigned this Aug 18, 2023
@kmgalanakis kmgalanakis added this to the 2.7.6 milestone Aug 18, 2023
Copy link
Member

@faisal-alvi faisal-alvi left a comment

Choose a reason for hiding this comment

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

@kmgalanakis Thank you for the PR.

Status: 👍🏻

I've tested and observed that when the plugin is inactive, and the site is utilizing a PHP version lower than the requirement, WordPress displays a message on the plugin list page. This prevents users from activating the plugin.

image

However, in the scenario where the plugin is already activated, the expected error notice is displayed, as shown below.

image

@faisal-alvi faisal-alvi merged commit bb366fc into develop Aug 22, 2023
9 of 10 checks passed
@faisal-alvi faisal-alvi deleted the feature/add-php-checks branch August 22, 2023 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add PHP checks
2 participants