• Does not appear to be compatible with PHP versions higher than 7.0

    After googling a bit this appears to be a problem with PHP 7.1:

    it is PHP Design.
    Changed in PHP 7.1.0:

    The empty index operator (e.g. $str[] = $x) is not supported for strings
    anymore, and throws a fatal error instead of silently converting to array.

    So that means that you need to say that it is an array $myString = array();
    Prior to PHP 7.1.0 , PHP converted a [] to array() silently, and now not anymore

    ———————
    Error Details
    =============
    An error of type E_ERROR was caused in line 376 of the file /home/httpd/vhosts/mybemidji.com/httpdocs/wp-content/plugins/client-dash/client-dash.php. Error message: Uncaught Error: [] operator not supported for strings in /home/httpd/vhosts/mybemidji.com/httpdocs/wp-content/plugins/client-dash/client-dash.php:376
    Stack trace:
    #0 /home/httpd/vhosts/mybemidji.com/httpdocs/wp-includes/class-wp-hook.php(290): ClientDash->action_links(‘
    ——————–

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author d4mation

    (@d4mation)

    @kingsky

    Thank you for reporting this! I am going to look into a solution right away.

    Thread Starter KingSky

    (@kingsky)

    I was able to fix it by simply initializing the array before those lines:

    $links = [];

    Plugin Author d4mation

    (@d4mation)

    @kingsky

    I don’t think that’s a very good solution since that should technically would remove the deactivation button based on the usage of that Filter.

    Can you tell me the WordPress version you’re running? I’ve tested this with WP 5.4 and PHP 7.0.33-26 and I cannot reproduce this issue.

    Maybe this is a plugin compatibility issue? Have you tried this with only Client Dash active?

    Plugin Author d4mation

    (@d4mation)

    I tried it with PHP 7.1.33-14 in case I misunderstood which version the problem existed in and the current release works as-is with no errors as well for me.

    I was previously running PHP 7.2 before switching versions to test this.

    Plugin Author d4mation

    (@d4mation)

    I released a new version of Client Dash that defines Keys for the buttons being added here. I wasn’t able to reproduce this, so I’ll leave this not marked as resolved for now. But please let me know if v2.1.5 fixes your issue.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘php 7.0+ compatibility’ is closed to new replies.