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

Prevent fatal error with newer PHP versions #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KZeni
Copy link

@KZeni KZeni commented Dec 1, 2021

Simply using count() throws an error if that variable is empty since something that's empty isn't seen as countable (TypeError). Check if it's not empty first to avoid the error.

Also did a very minor version bump as it's a bit of a hotfix at the moment.

Simply using count() throws an error if that variable is empty since something that's empty isn't seen as countable (TypeError). Check if it's not empty first to avoid the error.
@KZeni
Copy link
Author

KZeni commented Feb 15, 2022

Hopefully this is something that could be given a few minutes to merge (the fix being very harmless & straightforward) and release on WP.org as it is causing fatal PHP errors on sites that might have this plugin installed that then are doing the right thing in updating their PHP version over time.

@KZeni
Copy link
Author

KZeni commented Jan 24, 2023

Giving this topic a bump since it's been more than a year to officially adopt a patch that adds PHP 8.0+ support by way of editing one line of code to first make sure a variable isn't empty before trying to use count on it (something PHP 8.0 introduced as needing to be done; likely for performance reasons [speed up count by not doing that check every time & instead have the developers do that check themselves if/when needed.])

https://wordpress.org/support/topic/prevent-fatal-error-in-php-8-0/ is where this was talked about on the WP.org support forums, btw. It's since been closed to inactivity, but hopefully, it can still be addressed here with a new version release. Better late than never.

Otherwise, I'm wondering if this plugin should be taken down from WP.org and/or archived on GitHub (or transferred to a new maintainer / forked / etc.) if it's honestly not being supported anymore with PHP 8.0+ effectively being a requirement (per https://www.php.net/supported-versions) and this one quick patch to support that isn't being adopted (plugin might as well not be offered if it only supports PHP versions that really shouldn't be used anymore.)

@KZeni
Copy link
Author

KZeni commented May 3, 2023

Okay, how is this still not addressed? It's such a quick fix (merge PR & release the new version on WP.org) for something that renders this plugin unusable as more & more people start using PHP 8.0+.

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.

1 participant