• Resolved yoancutillas

    (@yoancutillas)


    Hello,

    These PHP errors appear on the admin:

    [21-Jun-2024 14:14:28 UTC] PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in \wp-includes\functions.php on line 7288
    [21-Jun-2024 14:14:28 UTC] PHP Stack trace:
    [21-Jun-2024 14:14:28 UTC] PHP 1. {main}() \wp-admin\admin.php:0
    [21-Jun-2024 14:14:28 UTC] PHP 2. require() \wp-admin\admin.php:158
    [21-Jun-2024 14:14:28 UTC] PHP 3. require_once() \wp-admin\menu.php:422
    [21-Jun-2024 14:14:28 UTC] PHP 4. do_action($hook_name = 'admin_menu', ...$arg = variadic('')) \wp-admin\includes\menu.php:161
    [21-Jun-2024 14:14:28 UTC] PHP 5. WP_Hook->do_action($args = [0 => '']) \wp-includes\plugin.php:517
    [21-Jun-2024 14:14:28 UTC] PHP 6. WP_Hook->apply_filters($value = '', $args = [0 => '']) \wp-includes\class-wp-hook.php:348
    [21-Jun-2024 14:14:28 UTC] PHP 7. Bdp_Admin->bdp_register_menu('') \wp-includes\class-wp-hook.php:324
    [21-Jun-2024 14:14:28 UTC] PHP 8. add_submenu_page($parent_slug = NULL, $page_title = 'Shortcode Preview - Blog Designer Pack', $menu_title = 'Shortcode Preview', $capability = 'manage_options', $menu_slug = 'bdp-shortcode-preview', $callback = [0 => class Bdp_Admin { }, 1 => 'bdp_shortcode_preview_page'], $position = *uninitialized*) \wp-content\plugins\blog-designer-pack\includes\admin\class-bdp-admin.php:53
    [21-Jun-2024 14:14:28 UTC] PHP 9. plugin_basename($file = NULL) \wp-admin\includes\plugin.php:1480
    [21-Jun-2024 14:14:28 UTC] PHP 10. wp_normalize_path($path = NULL) \wp-includes\plugin.php:769
    [21-Jun-2024 14:14:28 UTC] PHP 11. wp_is_stream($path = NULL) \wp-includes\functions.php:2180
    [21-Jun-2024 14:14:28 UTC] PHP 12. strpos($haystack = NULL, $needle = '://') \wp-includes\functions.php:7288

    [21-Jun-2024 14:14:28 UTC] PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in \wp-includes\functions.php on line 2187
    [21-Jun-2024 14:14:28 UTC] PHP Stack trace:
    [21-Jun-2024 14:14:28 UTC] PHP 1. {main}() \wp-admin\admin.php:0
    [21-Jun-2024 14:14:28 UTC] PHP 2. require() \wp-admin\admin.php:158
    [21-Jun-2024 14:14:28 UTC] PHP 3. require_once() \wp-admin\menu.php:422
    [21-Jun-2024 14:14:28 UTC] PHP 4. do_action($hook_name = 'admin_menu', ...$arg = variadic('')) \wp-admin\includes\menu.php:161
    [21-Jun-2024 14:14:28 UTC] PHP 5. WP_Hook->do_action($args = [0 => '']) \wp-includes\plugin.php:517
    [21-Jun-2024 14:14:28 UTC] PHP 6. WP_Hook->apply_filters($value = '', $args = [0 => '']) \wp-includes\class-wp-hook.php:348
    [21-Jun-2024 14:14:28 UTC] PHP 7. Bdp_Admin->bdp_register_menu('') \wp-includes\class-wp-hook.php:324
    [21-Jun-2024 14:14:28 UTC] PHP 8. add_submenu_page($parent_slug = NULL, $page_title = 'Shortcode Preview - Blog Designer Pack', $menu_title = 'Shortcode Preview', $capability = 'manage_options', $menu_slug = 'bdp-shortcode-preview', $callback = [0 => class Bdp_Admin { }, 1 => 'bdp_shortcode_preview_page'], $position = *uninitialized*) \wp-content\plugins\blog-designer-pack\includes\admin\class-bdp-admin.php:53
    [21-Jun-2024 14:14:28 UTC] PHP 9. plugin_basename($file = NULL) \wp-admin\includes\plugin.php:1480
    [21-Jun-2024 14:14:28 UTC] PHP 10. wp_normalize_path($path = NULL) \wp-includes\plugin.php:769
    [21-Jun-2024 14:14:28 UTC] PHP 11. str_replace($search = '\\', $replace = '/', $subject = NULL) \wp-includes\functions.php:2187

    Can you fix them?

    You can fix them by replacing null by an empty string blog-designer-pack\includes\admin\class-bdp-admin.php line 53:

    add_submenu_page( null, __('Shortcode Preview - Blog Designer Pack', 'blog-designer-pack'), __('Shortcode Preview', 'blog-designer-pack'), 'manage_options', 'bdp-shortcode-preview', array($this, 'bdp_shortcode_preview_page') );

    with

    add_submenu_page( '', __('Shortcode Preview - Blog Designer Pack', 'blog-designer-pack'), __('Shortcode Preview', 'blog-designer-pack'), 'manage_options', 'bdp-shortcode-preview', array($this, 'bdp_shortcode_preview_page') );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author pluginandplay

    (@pluginandplay)

    Hi @yoancutillas

    Thanks for noticing this. It looks like it is coming in specific PHP version.

    My PHP version is 7.4.33 and at my end this error is not coming.

    Just to confirm, can you please let me know your PHP version? So I will take a look and fix it.

    Thanks

    Thread Starter yoancutillas

    (@yoancutillas)

    Hi, indeed, it appears with newer versions of PHP, I am using PHP 8.1.7. Thank you for the fix ??

    Plugin Author pluginandplay

    (@pluginandplay)

    Hi @yoancutillas

    Thanks for noticing this. Yes, this PHP warning is coming in PHP 8.1. I have fixed this error and released a new version 3.4.6

    Kindly update to the latest version.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.