• When the plugin is first installed and before it is configured, the following warnings appear. It’s coming from these lines:

    $api_key = trim($this->get_plugin_setting( 'api_key' ));
    $api_hostname = trim($this->get_plugin_setting( 'api_hostname' ));
    $api_endpoint = trim($this->get_plugin_setting( 'api_endpoint' ));

    Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in?/wp-content/plugins/vision6-gravity-forms/class-gf-vision6.php?on line?1310

    Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in?/wp-content/plugins/vision6-gravity-forms/class-gf-vision6.php?on line?1313

    Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in?/wp-content/plugins/vision6-gravity-forms/class-gf-vision6.php?on line?1318

    Just needs a null check — something like this:

    $api_key = trim($this->get_plugin_setting( 'api_key' ) ?? '');
  • The topic ‘Deprecation warnings for PHP 8.2’ is closed to new replies.