Closed jamesozzie closed 1 year ago
This should be a very low effort since most of it is already done so the estimate should almost entirely be for QA.
IB ✅
Moving this right to code review as all that was needed was a QA Brief, so I wrote that up and reviewed the PR itself 🙂
https://github.com/google/site-kit-wp/assets/94359491/6e3757a1-ba83-44f6-b022-57cdef68cd48
Moving it back to QA from Approval.
@tofumatt I found that in front end Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/fusupexasa9642/web/ly-unicorn-luke.instawp.xyz/public_html/wp-content/plugins/google-site-kit/includes/Core/REST_API/REST_Routes.php on line 69
notice is appearing on PHP 8.1.
In back end now PHP deprecated notices are not showing, but it's still showing in front end. Since @aaemnnosttv is not available this week. Can you please guide weather should I create separate ticket for this or you will resolve this in follow-up PR ?
@mohitwp Looks like that's a legit bug, thanks for catching that. It's related to this issue so I've created a follow-up PR.
Turns out I didn't 100% fix the issue as I didn't quite get the IB as written so thought Evan's original PR was good to merge 😓
Back to you for another pass, @mohitwp.
Thanks @tofumatt @techanvil !
Could you please replace your current function with the following one? It should solve the issue you're experiencing.
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /homec/sajidhostriplex/public_html/whmtest/wp-includes/functions.php on line 2182
function wp_is_stream( $path ) { // Check if $path is null or empty if ( is_null($path) || empty($path) ) { // $path is null or empty, it can't be a stream. return false; }
$scheme_separator = strpos( $path, '://' );
if ( false === $scheme_separator ) {
// $path isn't a stream.
return false;
}
$stream = substr( $path, 0, $scheme_separator );
return in_array( $stream, stream_get_wrappers(), true );
}
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /homec/sajidhostriplex/public_html/whmtest/wp-includes/functions.php on line 7127
function wp_normalize_path( $path ) { $wrapper = '';
if ( wp_is_stream( $path ) ) {
list( $wrapper, $path ) = explode( '://', $path, 2 );
$wrapper .= '://';
}
// Check if $path is null or empty
if ( is_null($path) || empty($path) ) {
return $wrapper; // Return the wrapper part as is if $path is null or empty
}
// Standardize all paths to use '/'.
$path = str_replace( '\\', '/', $path );
// Replace multiple slashes down to a singular, allowing for network shares having two slashes.
$path = preg_replace( '|(?<=.)/+|', '/', $path );
// Windows paths should uppercase the drive letter.
if ( ':' === substr( $path, 1, 1 ) ) {
$path = ucfirst( $path );
}
return $wrapper . $path;
}
@sajidoon Thanks for getting in touch! This issue is now closed and a fix was released in Site Kit v1.108.0. If you're still experiencing issues, can you please open a topic on our support forum and we can take a look? Thanks!
Bug Description
As reported by one user in the support forums, when using PHP 8.1 the following PHP errors appear:
The error as it appears on the front end of a site
The error as it appears from wp-admin
Steps to reproduce
Additional Context
The
debug.log
should be inspected to confirm the results here as not everything is visible via plugins like Query Monitor.e.g.
The
wp-content/debug.log
file can be inspected easily using the Code Editor on instawp.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
null
screen instead of the literalREST_Routes
to not passnull
tostripos
here https://github.com/google/site-kit-wp/blob/f77756c7de0f0c602ce427a97efe8108763ffaf7/includes/Core/REST_API/REST_Routes.php#L69Test Coverage
screens
test (included above)QA Brief
debug.log
should be inspected to confirm the results here as not everything is visible via plugins like Query Monitor. e.g.wp-content/debug.log
file can be inspected using the Code Editor on instawp.)Changelog entry