• Resolved marsu79

    (@marsu79)


    Hi, this plugin won’t activate on a very recent WP install (WP 6.4.2, Strato host, PHP 7.2.34). It throws the following fatal error:

    • Error Level: E_PARSE
    • Message: syntax error, unexpected ‘]’, expecting ‘-‘ or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)
    • File: /mnt/web314/c2/00/5807200/htdocs/STRATO-apps/wordpress_01/app/wp-content/plugins/gdpr-compliant-recaptcha-for-all-forms/includes/class-settings-menu.php
    • Line: 599
    • Request: /wp-admin/plugins.php?action=activate&plugin=gdpr-compliant-recaptcha-for-all-forms%2Frecaptcha-gdpr-compliant.php&plugin_status=all&paged=1&s&_wpnonce=4e335dc6d3
    • Referrer: http%3A%2F%2Fdev.trick-reich.de%2Fwp-admin%2Fplugins.php
    • User ID: 1

    Other active Plugins are:

    • Fatal Error Notify
    • Limit Login Attempts Reloaded
    • Media Sync
    • Strato Assistant
    • Yoast SEO
    • Essential Blocks
    • Secondary Title
    • Sticky Menu (or Anything!) on Scroll
    • SVG Support
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Matthias Nordwig

    (@matthiasnordwig)

    Hi.

    Thanks for the hint. It is kind of strange, as the respective line of code is a comment and should not be parsed at all:

    //$links[] = $settings_link;

    With the next release, I’ll cut that out.

    Cheers, Matthias

    Plugin Author Matthias Nordwig

    (@matthiasnordwig)

    I have just released a new release with the line cut out.

    But usually your PHP parser should not parse comments.

    Thread Starter marsu79

    (@marsu79)

    I don’t know if the PHP parser on this host is set to some “extra strict” setting, but now it complained about the following lines:

    • class-message-page.php:1165 (I removed the trailing comma, that fixed it)
    • class-settings-menu.php:617 (removed the [] behind the $sections. Not much experience in PHP, was that right?)
    • Now it complains about class-settings-menu.php:667
      syntax error, unexpected ” (T_ENCAPSED_AND_WHITESPACE), expecting ‘-‘ or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)

    I definitely don’t know enough about PHP or your code to fix that one.

    Any Idea what could be going on here? Some setting in my PHP that I could change? I would change my PHP to 8.2, but there is a Website on the account that still runs on an old WP4.6 which I don’t want to break until I got the new one running.

    Plugin Author Matthias Nordwig

    (@matthiasnordwig)

    Hi.

    • Line 1165: That was correct as, trailing commas are allowed since PHP v 7.3. Since PHP v.7.3 and due to WordPRess-programming practice, it is good standard to use trailing commas as one may forget to add them correctly when the respective array is enhanced
    • Line 617 was
      $sections[] = $group;
      Should have worked correctly with your PHP version. What was the explicit error?
      If you just remove the brackets, the whole array will overwritten by the content of that variable, which is wrong.
      A correct working alternative would be the following:
      array_push($sections, $group);
      But I guess the problem was not caused by the brackets themselves.
    • For line 667 your parser seems to have a problem either with the usage of the ternary operator, or with using the superglobal $_POST directly in the evaluation-header. Instead you could replace that line by:
    $gdpr_settings_selection_value_posted = $_POST[ 'gdpr-settings-selection' ];
    $gdpr_settings_selection_value = 'gdpr-tab-most-relevant';
    if( isset(  $gdpr_settings_selection_value_posted ) ){
     $gdpr_settings_selection_value = $gdpr_settings_selection_value_posted;
    }

    If you cannot solve it, we can just have a teams call. Just write m,e an email via my page for the contact details.

    Cheers, Matthias

    Thread Starter marsu79

    (@marsu79)

    I think I will wait until I transferred the old site to the new WP6.4 installation and then switch to PHP 8.2, looks like that will solve most problems. If not, I will write again ??

    Thank you for all your help.

    Plugin Author Matthias Nordwig

    (@matthiasnordwig)

    Should be solved

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Activation fails, fatal error’ is closed to new replies.