Freemius / wordpress-sdk

https://freemius.com
GNU General Public License v3.0
258 stars 76 forks source link

Deprecations error with plugin_basename (str_replace & strpos) #710

Open rubas opened 2 months ago

rubas commented 2 months ago

Problem

This function can return null, which gets picket up by wp_normalize_path and wp_is_stream.

https://github.com/Freemius/wordpress-sdk/blob/master/includes/supplements/fs-essential-functions-1.1.7.1.php#L42

Stacktrace

ErrorException: Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
#14 /wp/wp-includes/functions.php(2187): wp_normalize_path
#13 /wp/wp-includes/plugin.php(769): plugin_basename
#12 /app/mu-plugins/tablepress/libraries/freemius/start.php(181): require_once
#11 /app/mu-plugins/tablepress/tablepress.php(62): tb_tp_fs
#10 /app/mu-plugins/tablepress/tablepress.php(93): include_once
ErrorException: Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated
#15 /wp/wp-includes/functions.php(7288): wp_is_stream
#14 /wp/wp-includes/functions.php(2180): wp_normalize_path
#13 /wp/wp-includes/plugin.php(769): plugin_basename
#12 /app/mu-plugins/tablepress/libraries/freemius/start.php(181): require_once
#11 /app/mu-plugins/tablepress/tablepress.php(62): tb_tp_fs
#10 /app/mu-plugins/tablepress/tablepress.php(93): include_once

Reference: https://github.com/TablePress/TablePress/issues/196