• Hello, I am noticing some PHP errors on version 1.1.5

    In the file wp-content/plugins/marker-io/marker-io.php, the callback is trying to access array keys that might or might not exist. I am seeing errors on lines 60,61,64,65,68,69,73, and 77.

    I looked at the file and thing you should check if the get_option on line 57 and return early if empty. Then for the lines I mentioned above, you should wrap the array keys inside an isset or is_empty like so:

    $destination_id = ! empty( $options['destination_id'] ) ? $options['destination_id'] : 0;

    or $destination_id = $options['destination_id'] ?? 0;

    I am guessing that this is happened on my staging server becuase I do not have any options set in the wp-admin which causes the get_option to return an empty array or false.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Marker.io

    (@markerio)

    Hello Clayton, thanks a lot for your message, we’re going to have a look at this.

    Could I ask you which version of WP and PHP you are using?

    We understand the proposed fix, but we are not sure why your options are not set. Can we ask why your options are empty somehow?

    • This reply was modified 1 year, 6 months ago by Marker.io.
    • This reply was modified 1 year, 6 months ago by Marker.io.
    Thread Starter Clayton Collie

    (@claytoncollie)

    Running on WP 6.2 and PHP 8.0.26

    The site I am working on version controls the wp-content directory and installs the plugin with Composer during the Ci/CD pipeline. Maybe there is a plugin activation hook that is not firing on staging. I’m not 100% sure why that option would not return something or why it is just empty.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Trying to access array offset on value of type bool’ is closed to new replies.