• Hello Team,

    Please help me on the following warning.

    PHP Warning: Undefined array key 0 in /var/web/site/public_html/wp-content/plugins/web-stories/includes/Tracking.php on line 175

    FYI:
    – PHP version 8
    – in settings, added google analytics id
    – perfmatters plugin served the analytics script (gtag.js.v4) locally.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi @nviews thanks for getting in touch. Could you please explain where exactly you are seeing this message? Is it in the Web Stories Dashboard for example or the editor?

    Did you have your Web Stories working previously or has this happened since first installing the plugin?

    Could you also please share your Site Health information or You can share privately if you prefer via this form.

    Thread Starter Prabakaran Shankar

    (@nviews)

    Hello,
    The PHP warning is displayed in the PHP server error log since day 1 of the plugin installation. There are no problems with the functionality of the plugin. Also the tracking ID is working fine. I have seen the event log on my Google Analytics page.
    Please see the submitted response with the information about my website.
    Thank you very much for your time.

    Plugin Author Pascal Birchler

    (@swissspidy)

    Interesting. Looks like we can add some extra hardening there in our plugin to avoid this.

    That line tries to get the currenty logged-in user‘s user role. Do you perhaps have custom user roles or capabilities set up on your site?

    Thread Starter Prabakaran Shankar

    (@nviews)

    Hello,

    I apologize for the delay.
    Yes, I have set up a custom user role on my website for member management.
    Do I need to add a snippet?

    Plugin Author Pascal Birchler

    (@swissspidy)

    Are you using a specific plugin or code for that?

    We will look into how we can improve this from our side, so there’s theoretically nothing for you to add. Still, it would be good to understand how you are doing this so we can better understand this.

    Thread Starter Prabakaran Shankar

    (@nviews)

    With the custom plugin, I added the user roles.

    function add_custom_user_role() {
        
        add_role( 'role_1', __( 'role 1' ), get_role( 'author' )->capabilities );
        
        $author_1_role = get_role( 'role_1' );
        $author_1_role->add_cap( 'edit_others_posts' );
        $author_1_role->add_cap( 'publish_posts' );
        
        add_role( 'role_2', __( 'role_2' ), get_role( 'subscriber' )->capabilities );
        
    }
    register_activation_hook( __FILE__, 'add_custom_user_role' );

    @nviews Hiya! As mentioned earlier, we will work on improving this from our side. Just wanted to share that these efforts are tracked in this GitHub ticket, and we will be sure to follow up with you here with any updates.

    @nviews If you update to the latest version of the plugin this should no longer be an issue for you. Can you please confirm?

    Thread Starter Prabakaran Shankar

    (@nviews)

    Thank you so much….No errors or warnings!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘PHP warning – Tracking.php #175’ is closed to new replies.