Automattic / Automattic/jetpack

wp_is_stream() causing strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated

Open
#37,298 3 comments 0 reactions 0 assignees View on GitHub
[Package] Autoloader [Plugin] Jetpack [Pri] Normal [Status] Needs Author Reply [Status] Priority Review Triggered [Status] Stale Bug Triaged
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Impacted plugin

Jetpack

### Quick summary

> PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in wp-includes/functions.php on line 7288
> PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in wp-includes/functions.php on line 2187

I added error logging to find where this was coming from:

> wp_is_stream called with non-string path by [{"file":"wp-includes\/functions.php","line":2180,"function":"wp_is_stream"},{"file":"wp-content\/plugins\/woocommerce\/vendor\/jetpack-autoloader\/class-path-processor.php","line":73,"function":"wp_normalize_path"}]

### Steps to reproduce

Run a WP CLI command like `wp site list`

### A clear and concise description of what you expected to happen.

No depreciated error logs

### What actually happened

Error log and console errors (in the case of WP CLI)

### Impact

All

### Available workarounds?

No but the platform is still usable

### Platform (Simple and/or Atomic)

Self-hosted

### Logs or notes

Debian GNU/Linux 10 (buster)
PHP 8.1.14
WP-CLI 2.10.0
WordPress 6.5.3
WooCommerce 8.7.0

Contributor guide

Open the contributing guide

Research direction

Reproduce the problem with the WP-CLI `wp site list` command using the reported PHP and WordPress versions. Inspect `wp-includes/functions.php` around `wp_is_stream()` and `wp_normalize_path()`, along with the reported Jetpack autoloader `class-path-processor.php`; done means the command no longer emits the reported PHP deprecation messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.