XStore Theme PHP 7.0 Compatibility Error

This topic has 4 replies, 2 voices, and was last updated 6 years, 7 months ago ago by Laranz

  • Avatar: ano119
    ano119
    Participant
    August 26, 2017 at 19:53

    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
    August 26, 2017 at 21:41

    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
    August 27, 2017 at 06:28

    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
    August 27, 2017 at 18:34

    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.

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.