-
Notifications
You must be signed in to change notification settings - Fork 293
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
Deprecated PHP Errors on Site Kit with PHP 8.1 #5110
Comments
As a minimun, those deprecation notices should be fixed before PHP 8 goes to "security fixes only" (https://www.php.net/supported-versions.php), which is due to happen in November 2022, so about 5 months from now. Websites should aim to be on the latest version of PHP that's actively supported, but bugs like those prevent many store owners from upgrading. It would be good if you could make this a priority task. |
IB ✔️ |
@asvinb @aaemnnosttv @eugene-manuilov I am working on this and confused about a few things.
Cheers.
|
Looks like this happens because we call the
That is what we need to figure out. Try to see where we use that filter. If it has been used for sanitization purposes, then using the
Yes, that's fine. Let's use |
Thank you for the investigation and recommendations,@eugene-manuilov ! It appears that we intentionally call The |
@kuasha420, yes, i think a separate ticket will be better because we will need to figure out a better way of adding hidden pages. Could you please create a new ticket?
Ok, just leave a comment about it in your PR. |
QA Update ❌
|
Hi @mohitwp Can you give screenshots of the 4 warnings you're seeing? They may be caused by the exceptions mentioned in the QAB. #5998 will address some of them. Does the "then user is not able to Set up Site kit and getting Rest API error on Splash screen" only happen with Query Monitor Active? Does this also happen on the current release without this? Cheers. |
|
QA Update ✅
|
Bug Description
On a test site set up on PHP 8.1. When on any Site Kit page, within Query Monitor there are a large number Deprecated PHP Errors. Some are for WordPress Core but most are related to Site Kit. We have completed a QA of Site Kit on this PHP version and no issues appeared in the console or front end.
Creating this ticket so we can look at any of the errors and if they need fixing to avoid issues in the future.
Constant FILTER_SANITIZE_STRING
is deprecatedfilter_input(): Passing null to parameter #4 ($options) of type array|int
is deprecatedstrpos(): Passing null to parameter #1 ($haystack) of type string
is deprecatedstr_replace(): Passing null to parameter #3 ($subject) of type array|string
is deprecatedrtrim(): Passing null to parameter #1 ($string) of type string
is deprecatedConstant FILTER_SANITIZE_STRING
is deprecatedA more comprehensive list of deprecation notices
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
FILTER_SANITIZE_STRING
filter byhtmlspecialchars
.filter_input
function to set theoptions
parameter to an empty string in case it'snull
.strtotime
andstripos
functions to have their parameters as an empty string in case it'snull
.Test Coverage
QA Brief
strpos
andstr_replace
will be fixed on Refactor undocumented use ofadd_submenu_page
withnull
parent slug to register a hidden admin page. #5998rtrip
related errors are actually coming from core and we can't fix them here. See this comment.Changelog entry
The text was updated successfully, but these errors were encountered: