• Jer Turowetz

    (@jturowetzgmailcom)


    ${var}?string interpolation is deprecated in php8.2. 8.2 is the defacto standard for most WordPress managed platforms like WP Engine. It would be nice if this plugin would update its code to fix the error. It’s rather arbitrarily easy to fix and would reduce a lot of noise in wp-cli.

    [18-Dec-2023 20:33:33 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/wp-content/plugins/unbounce/UBUtil.php on line 53
    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/wp-content/plugins/unbounce/UBUtil.php on line 53
    [18-Dec-2023 20:33:33 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/wp-content/plugins/unbounce/UBUtil.php on line 58
    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/wp-content/plugins/unbounce/UBUtil.php on line 58
    [18-Dec-2023 20:33:33 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/wp-content/plugins/unbounce/UBConfig.php on line 316
    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/wp-content/plugins/unbounce/UBConfig.php on line 316
    [18-Dec-2023 20:33:33 UTC] PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/wp-content/plugins/unbounce/UBPageTable.php on line 23
    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/wp-content/plugins/unbounce/UBPageTable.php on line 23

    Heck, I’d do it if the repo was public…

    Thanks for your time!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I want to second this request. Not only am I running into this issue, but even on php 8.1 I’m seeing

    Deprecated: parse_url(): Passing null to parameter #1 ($url) of type string is deprecated?... unbounce/UBHTTP.php?on line?186

    We really need this fixed as it litters the error logs with unnecessary messages. PHP 8.1 support runs out in 7 months so a move to PHP 8.2 is necessary in the next 6 months.

    adamreecewebbox

    (@adamreecewebbox)

    I think line 185 is responsible for this, not 186.

    $script_uri = UBUtil::array_fetch($server_global, 'SCRIPT_URI');

    The constant SCRIPT_URI within the server globals will not always be defined. This appears to come from Apache’s “mod_rewrite”, and it contains a fully absolute URL for the script path. I don’t think that PHP running in FCGI or FPM environments will have this, therefore instead of SCRIPT_URI I think adding this between lines 185 and 186 will do the same:

    if (null === $script_uri) {
    $script_uri = sprintf(
    "%s://%s%s",
    UBUtil::array_fetch($server_global, 'REQUEST_SCHEME'),
    UBUtil::array_fetch($server_global, 'HTTP_HOST'),
    UBUtil::array_fetch($server_global, 'REQUEST_URI'),
    );
    }

    That’ll give you an absolute URL, e.g. “https://example.com/whatever/page/”.

    • This reply was modified 5 months ago by adamreecewebbox. Reason: HTML character encoding
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.