XStore Theme PHP 7.0 Compatibility Error

3 replies2 participantsUpdated by Laranz

  • Avatar: ano119
    ano119
    Participant

    Hi,

    I was going to upgrade my server php version to 7.0. before that I installed PHP Compatibility Checker plugin to check theme and plugins works with php7. plugin URL – https://wordpress.org/plugins/php-compatibility-checker/ .

    This checker plugin shows that XStore core plugin has one error. Below is the checker plugin error details.

    FILE: /home_ssd/heshy119/public_html/gainzauthority.com/wp-content/plugins/et-core-plugin/inc/wordpress-importer/wordpress-importer.php
    —————————————————————————————————————————————————————————
    FOUND 1 ERROR AFFECTING 1 LINE
    —————————————————————————————————————————————————————————
    796 | ERROR | Indirect access to variables, properties and methods will be evaluated strictly in left-to-right order since PHP 7.0. Use curly braces to remove ambiguity.
    —————————————————————————————————————————————————————————

    I tried to resolve the error. but i couldn’t. Actually I’m not good at PHP coding.

    please help me to resolve this issue?

    Please, contact administrator
    for this information.

    3 Answers

    Avatar: laranz
    Laranz
    Participant

    Hi,

    You can ignore that error it won’t cause anything. I run PHP latest version in my local and all looks just fine. If you still fails something after update means, go to that line #796 in this FILE: /home_ssd/heshy119/public_html/gainzauthority.com/wp-content/plugins/et-core-plugin/inc/wordpress-importer/wordpress-importer.php,

    You will see this line,

    
    foreach ( $item['postmeta'] as $meta )
    $$meta['key'] = $meta['value'];

    change that to,

    foreach ( $item['postmeta'] as $meta )
    {
    $$meta['key'] = $meta['value'];
    }

    Let us know,

    Thanks,
    laranz.

    Avatar: ano119
    ano119
    Participant

    Hi laranz,

    Sorry I couldn’t tell you yesterday. I could figure out to fix that error. I tried the way you mentioned. But it didn’t work. after that I changed the code like this.

    ${$meta[‘key’] = $meta[‘value’]};
    it worked.

    Thanks your help…

    Avatar: laranz
    Laranz
    Participant

    Hi,

    Glad you got it working. 🙂

    It seems in line #796 there is two $ signs, delete one $ sign and update the code like this,

    foreach ( $item['postmeta'] as $meta ){
    	$meta['key'] = $meta['value'];
    }

    It will fix the issue.

    Let us know If you have any other questions.

    Thanks,
    laranz.

Want to reply? Log in to reply to this topic. No account yet? Create one first.

Log inCreate account