PHP 8.2+ Compatibility Issue - Fatal Error in GF Survey Utils Static Method

Plugin: Gravity Forms Survey Add-On
Version: (included in gravityformssurvey.zip)
PHP Version: 8.3.24
WordPress Version: 6.7.1

Issue Description: When using Gravity Forms with Survey features on PHP 8.2+, forms crash with a fatal error when attempting to display. The error occurs because $this is being used in a static method context.

Error Message:

Fatal error: Uncaught Error: Using $this when not in object context in /var/www/html/wp-content/plugins/gravityformssurvey/includes/class-gf-survey-utils.php:52

Root Cause: In /wp-content/plugins/gravityformssurvey/includes/class-gf-survey-utils.php, the static method get_requested_slug() attempts to access $this->query_var on line 52:

php

public static function get_requested_slug() {
    global $wp;
    if ( self::is_plain_permalinks() && isset( $wp->query_vars[ $this->query_var ] ) ) {
        return strtolower( $wp->query_vars[ $this->query_var ] );
    } else {
        return strtolower( $wp->request );
    }
}

Temporary Fix Applied (tested): Replaced $this->query_var with the hardcoded string 'gf_theme_layers'.

Suggested Permanent Fix: one of:

  1. Make the method non-static and update all callers

  2. Replace $this->query_var with the appropriate constant or class property access

  3. Pass the query_var as a parameter to the method

To report a bug, you’ll need to open a support ticket at: https://www.gravityforms.com/open-support-ticket/technical/