Site logo

[Resolved] Deprecated code for PHP 8.1

Home Forums Support [Resolved] Deprecated code for PHP 8.1

Home Forums Support Deprecated code for PHP 8.1

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2407142
    roadlink

    Hi there,

    fyi.

    Deprecated stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated 1
    wp-includes/functions.wp-styles.php:90
    Plugin: gp-premium

    #2407344
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Any chance you can share the full stack?

    Thanks!

    #2407680
    roadlink

    Hi Tom,
    I will provide whatever you need.
    What do you mean with full stack?

    Whole error log?

    #2407848
    David
    Staff
    Customer Support

    Hi there,

    Can we see the stack trace for that particular error.
    There should be several lines information after that line in the error.

    If need be send the whole error log.

    When doing so, can you highlight it and click the code button in the toolbar before submitting the reply.

    #2408901
    roadlink

    add whole file here.
    We have some other plugins with errors. Sorry file is a bit big.

    #2409705
    David
    Staff
    Customer Support

    Wow, that will take us a day and a half lol.

    Where you see this line:

    Deprecated stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated 1
    wp-includes/functions.wp-styles.php:90

    What is immediately before and after it ?

    #2410355
    roadlink

    OK David you got me here 🙂
    I really don’t know.
    Let me follow a bit more time and come back to you later.

    #2411096
    David
    Staff
    Customer Support

    OK – let us know 🙂

    #2411656
    Steven

    Hello,

    I get the same warning, with the following stack trace:

    #0 wp-content/plugins/gp-premium/menu-plus/functions/generate-menu-plus.php(735): wp_add_inline_style(‘…’, NULL)
    #1 wp-includes/class-wp-hook.php(308): generate_menu_plus_enqueue_css(”)
    #2 wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
    #3 wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #4 wp-includes/script-loader.php(2180): do_action(‘…’)
    #5 wp-includes/class-wp-hook.php(308): wp_enqueue_scripts(”)
    #6 wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
    #7 wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #8 wp-includes/general-template.php(3043): do_action(‘…’)
    #9 wp-content/themes/generatepress/header.php(16): wp_head()
    #10 wp-includes/template.php(783): require_once(‘…’)
    #11 wp-includes/template.php(718): load_template(‘…’, true, Array)
    #12 wp-includes/general-template.php(48): locate_template(Array, true, true, Array)
    #13 wp-content/themes/generatepress/page.php(17): get_header()
    #14 wp-includes/template-loader.php(106): include(‘…’)
    #15 wp-blog-header.php(19): require_once(‘…’)
    #16 index.php(17): require(‘…’)

    Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in wp-includes/functions.wp-styles.php on line 90

    PHP 8.1
    Wordpress 6.1
    GeneratePressVersion: 3.2.2
    GPPremium 2.2.1

    #2412066
    Tom
    Lead Developer
    Lead Developer

    Thanks for this! Seems WordPress should cast a string in its function there, but we can do our part to make sure it returns a string if nothing exists. Logged here for the next version: https://github.com/tomusborne/generatepress/issues/475

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