• Resolved diegpl

    (@diegpl)


    Is it possible to update this code in /google-site-kit/includes/Core/Admin/Screens.php:113

    	add_action(
    			'admin_menu',
    			function() {
    				$this->add_screens();
    			}
    		);

    for this one, to prevent php 8.1 warnings, please? Tks! ??

    add_action(
    	'admin_menu',
    	function() {
    		if ($this !== null && is_string($this)) {
    			$this->add_screens();
    		}
    	}
    );
    
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support James Osborne

    (@jamesosborne)

    Thanks for getting in touch @diegpl. I’ll certainly put forward your suggestion to the team regarding this. While I’m doing so can you provide a screenshot or any browser console errors with error reporting enabled and I’ll check this with the team?

    Thread Starter diegpl

    (@diegpl)

    You can use Query Monitor plugin to check it out ??


    i am having the same problem



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



    Plugin Support James Osborne

    (@jamesosborne)

    Thanks for the input @mbwebmaster. I’ll let you know here as soon as I have an update from the team.

    ok

    Plugin Support Adam Dunnage

    (@adamdunnage)

    @diegpl Thanks once more for raising this. The team are aware and are looking to always improve this in the plugin. These messages won’t stop the functionality of the plugin so are nothing to worry about. We will look to address these however in a future release. Thanks.

    Thread Starter diegpl

    (@diegpl)

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

    1. wp-content/plugins/google-site-kit/includes/Core/REST_API/REST_Routes.php:69
    2. stripos()
      wp-content/plugins/google-site-kit/includes/Core/REST_API/REST_Routes.php:69
    3. Google\S\C\R\REST_Routes->Google\S\C\R\{closure}()
      wp-includes/class-wp-hook.php:308
    4. apply_filters('query_vars')
      wp-includes/class-wp.php:299
    5. WP->parse_request()
      wp-includes/class-wp.php:780
    6. WP->main()
      wp-includes/functions.php:1334
    7. wp()
      wp-blog-header.php:16

    Please, change this code:

    $unset_vars = ( $wp->request && stripos( $wp->request, trailingslashit( rest_get_url_prefix() ) . self::REST_ROOT ) !== false ) // Check regular permalinks.
    							|| ( empty( $wp->request ) && stripos( $this->context->input()->filter( INPUT_GET, 'rest_route' ), self::REST_ROOT ) !== false ); // Check plain permalinks.

    For this one as well:

    $unset_vars = ( $wp->request && stripos( (string) $wp->request, trailingslashit( rest_get_url_prefix() ) . self::REST_ROOT ) !== false ) // Check regular permalinks.
        || ( empty( $wp->request ) && stripos( (string) $this->context->input()->filter( INPUT_GET, 'rest_route' ), self::REST_ROOT ) !== false ); // Check plain permalinks.

    Tks! ??

    Plugin Support James Osborne

    (@jamesosborne)

    Thanks for the update @diegpl. Based on you providing these useful insights we’ve created the below GitHub issue and we’ll have an update out for this soon:
    https://github.com/google/site-kit-wp/issues/7147

    We’ll also keep you updated once a solution is in place, which should be very soon. As my colleague mention this doesn’t impact Site Kit functionality. Thanks again!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘PHP 8.1 warning: strpos(): Passing null to parameter #1 ($haystack) of type stri’ is closed to new replies.